JP2010086321A - Memory control system - Google Patents

Memory control system Download PDF

Info

Publication number
JP2010086321A
JP2010086321A JP2008255301A JP2008255301A JP2010086321A JP 2010086321 A JP2010086321 A JP 2010086321A JP 2008255301 A JP2008255301 A JP 2008255301A JP 2008255301 A JP2008255301 A JP 2008255301A JP 2010086321 A JP2010086321 A JP 2010086321A
Authority
JP
Japan
Prior art keywords
program
memory
memory device
read
compressed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2008255301A
Other languages
Japanese (ja)
Inventor
Toshiyuki Maekawa
俊行 前川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Schneider Electric Japan Holdings Ltd
Original Assignee
Digital Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Digital Electronics Corp filed Critical Digital Electronics Corp
Priority to JP2008255301A priority Critical patent/JP2010086321A/en
Publication of JP2010086321A publication Critical patent/JP2010086321A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To quickly carry out decompression processing of a compressed program by using hardware when transferring the compressed program stored in a low-speed memory device to a high-speed memory device. <P>SOLUTION: A reversibly compressed program is read from a program memory 2 as the low-speed memory device by a read DMAC 12 to be decompressed by a pipeline circuit 8. In the pipeline circuit 8, decompression is carried out by pipeline processing to prevent failure in following of input of the compressed data due to low speed of decompression processing. Thereby decompression processing of the compressed program read from the program memory 2 is carried out continuously, the program can be transferred from the program memory 2 to a main memory 3 as the high-speed memory device. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、低速のメモリ装置に格納されたプログラムを高速のメモリ装置に高速で転送するメモリ制御システムに関するものである。   The present invention relates to a memory control system for transferring a program stored in a low-speed memory device to a high-speed memory device at high speed.

NORフラッシュメモリ、NANDフラッシュメモリ、SRAM、ハードディスク装置等の低速のメモリデバイスに格納されたプログラムをCPUによって実行するには、DRAM等の高速のメモリデバイスに当該プログラムを転送する。プログラムをそのままの状態で転送する場合、低速メモリデバイスからのリード動作が低速で行われるため、転送に時間がかかり、システムの高速化を図ることができない。また、メモリの利用効率向上などのために、プログラムを圧縮した状態で低速メモリデバイスに格納しておくこともある。この場合は、プログラムを高速メモリデバイスに転送するときの伸長がソフトウェアで行われるため、プログラムを圧縮しない場合よりも転送に時間を要することが多い。   In order for a CPU to execute a program stored in a low-speed memory device such as a NOR flash memory, a NAND flash memory, an SRAM, or a hard disk device, the program is transferred to a high-speed memory device such as a DRAM. When the program is transferred as it is, since the read operation from the low-speed memory device is performed at a low speed, the transfer takes time and the system cannot be speeded up. In addition, the program may be stored in a low-speed memory device in a compressed state in order to improve memory utilization efficiency. In this case, since the expansion is performed by software when the program is transferred to the high-speed memory device, the transfer often takes longer than when the program is not compressed.

これに対し、特許文献1には、圧縮されたプログラムをハードウェアで伸長することが記載されている。この構成では、ROMから読み出された圧縮されたプログラムが、ROMインターフェースに設けられた伸長ハードウェアで伸長されて、RAMに格納された後に、CPUを起動する。
特開2007−148865号公報(2007年6月14日公開)
On the other hand, Patent Document 1 describes that a compressed program is decompressed by hardware. In this configuration, the compressed program read from the ROM is decompressed by decompression hardware provided in the ROM interface and stored in the RAM, and then the CPU is activated.
JP 2007-148865 A (released on June 14, 2007)

特許文献1には、ハードウェアで圧縮されたプログラムを伸長することが開示されているが、具体的な伸長方法については開示されていない。ハードウェアでプログラムを伸長する場合、ROMから読み出された圧縮プログラムを取り込む時間よりも、圧縮プログラムを伸長する処理に時間がかかり、圧縮プログラムの読み出しが滞ってしまう。これは、圧縮のアルゴリズムが複雑化したり、伸長回路への入力データサイズが動的に変化したりすることで、より顕著になる。このため、CPUの起動が遅くなるという不都合が生じる。   Patent Document 1 discloses that a program compressed by hardware is decompressed, but a specific decompression method is not disclosed. When decompressing a program by hardware, it takes a longer time to decompress the compressed program than it takes to retrieve the compressed program read from the ROM, and reading of the compressed program is delayed. This becomes more conspicuous as the compression algorithm becomes complicated and the size of input data to the decompression circuit changes dynamically. For this reason, there arises an inconvenience that the activation of the CPU is delayed.

本発明は、上記の問題点に鑑みてなされたものであり、低速メモリデバイスに格納された圧縮プログラムを高速メモリデバイスに転送するときに、ハードウェアを用いて圧縮プログラムの伸長処理を高速に行うことができるメモリ制御システムを提供することを目的としている。   The present invention has been made in view of the above-described problems. When a compressed program stored in a low-speed memory device is transferred to the high-speed memory device, the decompression process of the compressed program is performed at high speed using hardware. An object of the present invention is to provide a memory control system.

本発明に係るメモリ制御システムは、上記の課題を解決するために、圧縮プログラムおよび起動用の非圧縮プログラムを格納する第1メモリ装置と、当該第1メモリ装置より高速で動作する第2メモリ装置と、前記第1メモリ装置から読み出された前記圧縮プログラムを伸長して前記第2メモリ装置に転送する転送回路と、前記第2メモリ装置に転送された伸長後の前記圧縮プログラムを実行するとともに、起動時に前記非圧縮プログラムを実行するCPUとを備え、前記転送回路が、前記CPUの起動後に前記圧縮プログラムをパイプライン処理で伸長する伸長回路を有していることを特徴としている。   In order to solve the above problems, a memory control system according to the present invention includes a first memory device that stores a compressed program and an uncompressed program for activation, and a second memory device that operates at a higher speed than the first memory device. And a transfer circuit for decompressing the compressed program read from the first memory device and transferring it to the second memory device, and executing the decompressed compressed program transferred to the second memory device And a CPU that executes the uncompressed program at startup, and the transfer circuit includes a decompression circuit that decompresses the compressed program by pipeline processing after the CPU is activated.

上記の構成では、転送回路によって、第1メモリ装置から第2メモリ装置に圧縮プログラムが転送されるときに、まず、第1メモリ装置から読み出された非圧縮プログラム、すなわち起動プログラムによってCPUが起動される。その後に、伸長回路によって、第1メモリ装置から読み出されたプログラムがパイプライン処理で行われる。具体的には、例えば、前記伸長回路は、前記第1メモリ装置から読み出された前記圧縮プログラムを保持する第1工程と、前記圧縮プログラムにおける命令の出現頻度に基づいて読出アドレスを決定する第2工程と、前記読出アドレスに基づいて、圧縮プログラムの符号化コードに対応する圧縮前の値を読み出す第3工程とを順次並行して実行する。   In the above configuration, when the compressed circuit is transferred from the first memory device to the second memory device by the transfer circuit, the CPU is first activated by the uncompressed program read from the first memory device, that is, the activation program. Is done. Thereafter, the program read from the first memory device is executed by pipeline processing by the decompression circuit. Specifically, for example, the decompression circuit determines a read address based on a first step of holding the compressed program read from the first memory device and an appearance frequency of instructions in the compressed program. Two steps and a third step of reading a value before compression corresponding to the encoded code of the compression program based on the read address are sequentially executed in parallel.

これにより、伸長処理が複数ステージ(複数工程)からなる一連の処理が並行的に繰り返し行われる。それゆえ、伸長処理に要する時間を短縮することができる。   Thereby, a series of processes in which the decompression process is composed of a plurality of stages (a plurality of processes) are repeatedly performed in parallel. Therefore, the time required for the decompression process can be shortened.

また、伸長回路がCPUの起動後に圧縮プログラムを伸長することにより、CPUの起動を優先させることから、CPUの起動の遅れを回避することができる。   In addition, since the decompression circuit decompresses the compressed program after the CPU is activated, priority is given to the activation of the CPU, so that a delay in the activation of the CPU can be avoided.

前記メモリ制御システムにおいては、前記非圧縮プログラムが前記圧縮プログラムより小さいことが好ましい。起動プログラムは、CPUの起動のみに用いられるため、一般に、第2メモリ装置に転送される圧縮プログラムの圧縮前のプログラムよりも小さく、多くの場合は極めて小さく作成することができる。このため、圧縮プログラムの伸長の開始を早めることができる。   In the memory control system, the uncompressed program is preferably smaller than the compressed program. Since the activation program is used only for activation of the CPU, it is generally smaller than the program before compression of the compression program transferred to the second memory device, and in many cases can be created extremely small. For this reason, the start of decompression of the compression program can be accelerated.

前記メモリ制御システムにおいて、前記第1メモリ装置に格納された前記圧縮プログラムを前記伸長回路に読み出すリードDMACを備えていることが好ましい。これにより、高速で第1メモリ装置から圧縮プログラムを伸長回路に読み出すことができる。   The memory control system preferably includes a read DMAC that reads the compressed program stored in the first memory device to the decompression circuit. As a result, the compressed program can be read from the first memory device to the decompression circuit at high speed.

前記メモリ制御システムは、前記伸長回路によって前記圧縮プログラムから伸長された前記プログラムを蓄えるFIFOメモリと、前記FIFOメモリから出力される前記プログラムを前記第2メモリ装置に書き込むライトDMACとを備えていることが好ましい。これにより、伸長回路から出力されるプログラムのバンド幅が動的に変化しても、それを吸収するとともに、第2メモリ装置への書き込みタイミングを調整することができる。また、ライトDMACを用いることにより、FIFOメモリから第2メモリ装置へのプログラムの書き込みを高速で行うことができる。   The memory control system includes a FIFO memory that stores the program decompressed from the compressed program by the decompression circuit, and a write DMAC that writes the program output from the FIFO memory to the second memory device. Is preferred. As a result, even if the bandwidth of the program output from the decompression circuit changes dynamically, it can be absorbed and the write timing to the second memory device can be adjusted. Further, by using the write DMAC, the program can be written from the FIFO memory to the second memory device at a high speed.

本発明に係るメモリ制御システムは、以上のように、圧縮プログラムおよび起動用の非圧縮プログラムを格納する第1メモリ装置と、当該第1メモリ装置より高速で動作する第2メモリ装置と、前記第1メモリ装置から読み出された前記圧縮プログラムを伸長して前記第2メモリ装置に転送する転送回路と、前記第2メモリ装置に転送された伸長後の前記圧縮プログラムを実行するとともに、起動時に前記非圧縮プログラムを実行するCPUとを備え、前記転送回路が、前記CPUの起動後に前記圧縮プログラムをパイプライン処理で伸長する伸長回路を有している。これにより、伸長処理に要する時間を短縮することができる。したがって、メモリ制御システムにおいて、第1メモリ装置から第2メモリ装置への圧縮プログラムの転送の過程において、CPUの起動を遅らせることなく、ハードウェアを用いて圧縮プログラムの伸長処理を高速に行うことができるという効果を奏する。   As described above, the memory control system according to the present invention includes the first memory device that stores the compressed program and the uncompressed program for activation, the second memory device that operates at a higher speed than the first memory device, and the first memory device. A transfer circuit that decompresses the compressed program read from one memory device and transfers it to the second memory device; executes the decompressed compressed program transferred to the second memory device; A CPU that executes an uncompressed program, and the transfer circuit includes a decompression circuit that decompresses the compressed program by pipeline processing after the CPU is activated. Thereby, the time required for the decompression process can be shortened. Therefore, in the memory control system, in the process of transferring the compressed program from the first memory device to the second memory device, the decompression process of the compressed program can be performed at high speed using hardware without delaying the activation of the CPU. There is an effect that can be done.

本発明の実施形態について図1〜図5に基づいて説明すると、以下の通りである。   An embodiment of the present invention will be described with reference to FIGS. 1 to 5 as follows.

なお、図1および図2において各回路間の接続線は、太い実線が複数ビットの信号線を表し、細い実線が1ビットの信号線を表している。   In FIG. 1 and FIG. 2, the connection lines between the circuits are such that a thick solid line represents a multi-bit signal line and a thin solid line represents a 1-bit signal line.

図1に示すように、本実施の形態に係るメモリ制御システム1は、プログラムメモリ2と、メインメモリ3と、CPU4と、転送回路5と、3ステートバッファ6,7とを備えている。   As shown in FIG. 1, the memory control system 1 according to the present embodiment includes a program memory 2, a main memory 3, a CPU 4, a transfer circuit 5, and three-state buffers 6 and 7.

プログラムメモリ2(第1メモリ装置)は、NORフラッシュメモリ、NANDフラッシュメモリ、SRAM、ハードディスク装置等の低速のメモリデバイスによって構成されている。このプログラムメモリ2には、圧縮プログラムと、非圧縮プログラムとを格納している。プログラムメモリ2は、CPU4によってリードアドレスがアドレス端子ADDに与えられると、記憶している非圧縮プログラムをデータ出力端子DATAから出力する。また、プログラムメモリ2は、後述するリードDMAC12(図2参照)によってリードアドレスがアドレス端子ADDに与えられると、記憶している圧縮プログラムをデータ出力端子DATAから出力する。   The program memory 2 (first memory device) is composed of a low-speed memory device such as a NOR flash memory, a NAND flash memory, an SRAM, and a hard disk device. The program memory 2 stores a compressed program and an uncompressed program. When the read address is given to the address terminal ADD by the CPU 4, the program memory 2 outputs the stored uncompressed program from the data output terminal DATA. Further, when the read address is given to the address terminal ADD by a read DMAC 12 (see FIG. 2) described later, the program memory 2 outputs the stored compressed program from the data output terminal DATA.

圧縮プログラムは、アプリケーションプログラム等のプログラムであって、CPU4によって実行されるために、メインメモリ3に転送されて格納される。また、圧縮プログラムは、例えば、ハフマン符号等によって可逆的に圧縮されている。この圧縮プログラムは、通常命令と高頻度命令とからなる。   The compression program is a program such as an application program, and is transferred to the main memory 3 and stored in order to be executed by the CPU 4. The compression program is reversibly compressed by, for example, a Huffman code. This compressed program consists of normal instructions and high frequency instructions.

通常命令は、圧縮前のプログラムにおいて最も出現頻度が低い命令であり、圧縮されない。通常命令が圧縮されないのは、最も出現頻度が低いために、圧縮プログラム全体の圧縮度の低下に及ぼす影響が低く、かつ圧縮および伸長の効率を向上させることができるからである。この通常命令は、5バイトからなり、最初の1バイト(第1バイト)が通常命令を表す“00h”というコードであり、残余の4バイトが命令本体を表すコードとなっている。   The normal instruction is an instruction having the lowest appearance frequency in the program before compression, and is not compressed. The reason why the normal instruction is not compressed is that since the appearance frequency is the lowest, the influence on the reduction of the compression degree of the entire compression program is low, and the compression and decompression efficiency can be improved. This normal instruction is composed of 5 bytes, and the first 1 byte (first byte) is a code “00h” representing the normal instruction, and the remaining 4 bytes are a code representing the instruction body.

高頻度命令は、通常命令より出現頻度が高い命令である。この高頻度命令は、32ビット(4バイト)の命令が1バイトに圧縮されており、上記の“00h”以外の値で構成されている。   A high-frequency instruction is an instruction that appears more frequently than a normal instruction. In this high-frequency instruction, a 32-bit (4 byte) instruction is compressed to 1 byte, and is configured with a value other than the above-mentioned “00h”.

非圧縮プログラムは、CPU4の起動用(リセット後の動作用)のプログラムであって、メインメモリ3には転送されない。また、非圧縮プログラムは、後述するリードDMAC12の設定および起動を行うとともに、リードDMAC12の動作終了の検知も行う。このような非圧縮プログラムは、圧縮プログラムに比べて小さい、多くの場合は極めて小さいサイズを有しており、実行時間も短いため、CPU4の起動から、後述する圧縮プログラムの転送処理の完了に至る総処理時間を長引かせることはない。   The uncompressed program is a program for starting up the CPU 4 (for operation after reset), and is not transferred to the main memory 3. The uncompressed program sets and activates the read DMAC 12 to be described later, and also detects the end of the operation of the read DMAC 12. Such an uncompressed program is smaller than the compressed program, and in many cases has an extremely small size, and has a short execution time. Therefore, from the start of the CPU 4 to the completion of the transfer process of the compressed program described later. The total processing time is not prolonged.

メインメモリ3(第2メモリ装置)は、DRAM等の高速メモリデバイスであり、プログラムメモリ2に比べて高速に動作する。   The main memory 3 (second memory device) is a high-speed memory device such as a DRAM and operates faster than the program memory 2.

CPU4は、プログラムメモリ2から読み出された上記の非圧縮プログラムを実行することにより、起動処理を行うとともに、伸長されてメインメモリ3に転送される上記の圧縮プログラムを実行する。   The CPU 4 executes the above-described uncompressed program read from the program memory 2 to perform a startup process and execute the above-described compressed program that is decompressed and transferred to the main memory 3.

転送回路5は、プログラムメモリ2に格納された圧縮プログラムをメインメモリ3に転送する回路である。また、この転送回路5は、プログラムメモリ2から圧縮プログラムを読み出して伸長するとともに、書き込みのタイミングを調整しながらメインメモリ3へ書き込む。この転送回路5については、後に詳述する。   The transfer circuit 5 is a circuit that transfers the compressed program stored in the program memory 2 to the main memory 3. The transfer circuit 5 reads and expands the compressed program from the program memory 2 and writes it to the main memory 3 while adjusting the write timing. The transfer circuit 5 will be described in detail later.

3ステートバッファ6は、プログラムメモリ2からのデータバス21の接続および遮断を行う回路であり、CPU4からのバスアクノリッジ信号BACKが“L”となるときに、データバス21を接続し、バスアクノリッジ信号BACKが“H”となるときに、データバス21を遮断する。3ステートバッファ7は、プログラムメモリ2へのアドレスバス22の接続および遮断を行う回路であり、CPU4からのバスアクノリッジ信号BACKが“L”となるときにアドレスバス22を接続し、バスアクノリッジ信号BACKが“H”となるときにアドレスバス22を遮断する。   The 3-state buffer 6 is a circuit for connecting and disconnecting the data bus 21 from the program memory 2, and when the bus acknowledge signal BACK from the CPU 4 becomes "L", the data bus 21 is connected and the bus acknowledge signal is connected. When the BACK becomes “H”, the data bus 21 is shut off. The 3-state buffer 7 is a circuit for connecting and disconnecting the address bus 22 to and from the program memory 2, and when the bus acknowledge signal BACK from the CPU 4 becomes "L", the address bus 22 is connected, and the bus acknowledge signal BACK When the signal becomes "H", the address bus 22 is shut off.

続いて、転送回路5について、より詳しく説明する。   Next, the transfer circuit 5 will be described in more detail.

転送回路5は、パイプライン回路8、FIFOメモリ9、3ステートバッファ10、メモリコントローラ11、リードDMAC12およびライトDMAC13を有している。また、メモリ制御システム1は、図2に示すように、カウンタ14およびANDゲート15をさらに有している。   The transfer circuit 5 includes a pipeline circuit 8, a FIFO memory 9, a three-state buffer 10, a memory controller 11, a read DMAC 12, and a write DMAC 13. The memory control system 1 further includes a counter 14 and an AND gate 15 as shown in FIG.

パイプライン回路8は、プログラムメモリ2から読み出された圧縮プログラムに施された符号化に対応した復号化を行うことにより圧縮プログラムを伸長する回路である。このパイプライン回路8は、圧縮プログラムの伸長処理が遅いために、圧縮プログラムの入力に間に合わなくならないように、伸長をパイプライン処理で行うようにしている。パイプライン回路8については、後に詳細に説明する。   The pipeline circuit 8 is a circuit that decompresses the compressed program by performing decoding corresponding to the encoding applied to the compressed program read from the program memory 2. The pipeline circuit 8 performs the decompression by pipeline processing so as not to be in time for the input of the compression program because the decompression processing of the compression program is slow. The pipeline circuit 8 will be described in detail later.

FIFOメモリ9は、パイプライン回路8によって伸長されたプログラムを一時的に蓄えるバッファメモリとして機能している。これにより、FIFOメモリ9は、パイプライン回路8から出力されるプログラムのバンド幅(データビット長と速度との積)が動的に変化しても、それを吸収するとともに、メインメモリ3への書き込みタイミングを調整することができる。また、FIFOメモリ9は、記憶領域に空きがある状態(記憶可能状態)のときに“H”となり、記憶領域に空きがない状態(出力可能状態)のときに“L”となる出力制御信号OCをライトDMAC13に与える。FIFOメモリ9は、出力制御信号OCが“H”となる期間にプログラムの記憶を継続して出力を行い、出力制御信号OCが“L”となる期間にプログラムの記憶を停止して、読み出しを行う。   The FIFO memory 9 functions as a buffer memory that temporarily stores a program expanded by the pipeline circuit 8. As a result, the FIFO memory 9 absorbs even if the bandwidth (product of the data bit length and the speed) of the program output from the pipeline circuit 8 changes dynamically, The write timing can be adjusted. Further, the FIFO memory 9 is “H” when the storage area is empty (storable state), and is “L” when the storage area is not empty (output enabled state). OC is given to the write DMAC 13. The FIFO memory 9 continues to output the program during the period when the output control signal OC is “H”, stops the program storage during the period when the output control signal OC is “L”, and reads out the program. Do.

3ステートバッファ10は、FIFOメモリ9からのデータバス21の接続および遮断を行う回路であり、CPU4からのバスアクノリッジ信号BACKが“H”となるときに、データバス21を接続し、バスアクノリッジ信号BACKが“L”となるときに、データバス21を遮断する。   The three-state buffer 10 is a circuit for connecting and disconnecting the data bus 21 from the FIFO memory 9, and when the bus acknowledge signal BACK from the CPU 4 becomes "H", the data bus 21 is connected and the bus acknowledge signal is connected. When the BACK becomes “L”, the data bus 21 is shut off.

メモリコントローラ11は、FIFOメモリ9からのプログラムのメインメモリ3への書き込み、およびメインメモリ3からCPU4へのプログラムの読み出しを制御する回路である。   The memory controller 11 is a circuit that controls writing of a program from the FIFO memory 9 to the main memory 3 and reading of the program from the main memory 3 to the CPU 4.

リードDMAC12は、プログラムメモリ2からパイプライン回路8への圧縮プログラムの読み出しを制御する回路である。このリードDMAC12は、CPU4からバス権を取得するときに、バスリクエスト信号BREQを“H”とし、CPU4へバス権を受け渡すときに、バスリクエスト信号BREQを“L”とする。また、リードDMAC12は、パイプライン回路8に伸長を制御するための制御信号を与える。   The read DMAC 12 is a circuit that controls reading of the compressed program from the program memory 2 to the pipeline circuit 8. The read DMAC 12 sets the bus request signal BREQ to “H” when acquiring the bus right from the CPU 4, and sets the bus request signal BREQ to “L” when transferring the bus right to the CPU 4. The read DMAC 12 gives a control signal for controlling the expansion to the pipeline circuit 8.

ライトDMAC13は、FIFOメモリ9からメモリコントローラ11へのプログラムの読み出しを制御する回路である。このライトDMAC13は、FIFOメモリ9からの出力制御信号OCが“L”となるときに、アドレスバスに22にリードアドレスを出力する。また、ライトDMAC13は、CPU4からバス権を取得するときに、バスリクエスト信号BREQを“H”とし、CPU4へバス権を受け渡すときに、バスリクエスト信号BREQを“L”とする。また、ライトDMAC13は、FIFOメモリ9からの出力制御信号OCが“H”となるときには、FIFOメモリ9からプログラムが出力されないので、リードアドレスを出力しないが、出力制御信号OCが“L”となるときには、FIFOメモリ9からプログラムが出力されるので、リードアドレスを出力をメインメモリ3に出力する。   The write DMAC 13 is a circuit that controls reading of a program from the FIFO memory 9 to the memory controller 11. The write DMAC 13 outputs a read address to the address bus 22 when the output control signal OC from the FIFO memory 9 becomes “L”. The write DMAC 13 sets the bus request signal BREQ to “H” when acquiring the bus right from the CPU 4, and sets the bus request signal BREQ to “L” when delivering the bus right to the CPU 4. Further, when the output control signal OC from the FIFO memory 9 becomes “H”, the write DMAC 13 does not output the program from the FIFO memory 9 and therefore does not output the read address, but the output control signal OC becomes “L”. In some cases, since the program is output from the FIFO memory 9, the read address is output to the main memory 3.

メモリコントローラ11は、FIFOメモリ9から3ステートバッファ10を介して読み出されたプログラムをライトDMAC13から出力されるリードアドレスとともに、メインメモリ3に与えて、プログラムの書き込みを制御する。また、メモリコントローラ11は、CPU4からのリードアドレスをメインメモリ3に与えることによって、メインメモリ3に記憶されているプログラムをデータバスに読み出してCPU4に与える。   The memory controller 11 gives a program read from the FIFO memory 9 via the three-state buffer 10 to the main memory 3 together with a read address output from the write DMAC 13 to control program writing. Further, the memory controller 11 gives the read address from the CPU 4 to the main memory 3, thereby reading the program stored in the main memory 3 to the data bus and giving it to the CPU 4.

引き続いて、パイプライン回路8について詳細に説明する。   Subsequently, the pipeline circuit 8 will be described in detail.

図2に示すように、パイプライン回路8は、セレクタ81,82、レジスタ83〜85、NORゲート86、ステートマシン87およびテーブルROM88を有している。   As shown in FIG. 2, the pipeline circuit 8 includes selectors 81 and 82, registers 83 to 85, a NOR gate 86, a state machine 87, and a table ROM 88.

セレクタ81は、S端子の値が“1”となるときに、プログラムメモリ2から出力される圧縮プログラム(圧縮コード化された8ビットのデータ)を出力する一方、S端子の値が“0”となるときに、レジスタ83の出力データを出力する。S端子に入力される値は、カウンタ14およびANDゲート15によって生成される。   The selector 81 outputs the compressed program (compressed 8-bit data) output from the program memory 2 when the value of the S terminal is “1”, while the value of the S terminal is “0”. At this time, the output data of the register 83 is output. The value input to the S terminal is generated by the counter 14 and the AND gate 15.

カウンタ14は、ベースクロック信号BCLKをカウントする2ビットバイナリカウンタである。ANDゲート15は、カウンタ14がベースクロック信号BCLKを4クロックカウントして“11”を出力する毎に1クロック期間だけ“1”を出力する。ANDゲート15の出力は、リードDMAC12によるプログラムメモリ2の読み出しを制御するレディ信号RDYとして用いられる。このレディ信号RDYにより、リードDMAC12は、リードアドレスをプログラムメモリ2に出力するとともに、カウンタ14に与えるリセット信号を“1”から“0”にする。カウンタ14は、このリセット信号によりリセットされると、カウンタを再開する。   The counter 14 is a 2-bit binary counter that counts the base clock signal BCLK. The AND gate 15 outputs “1” for one clock period each time the counter 14 counts the base clock signal BCLK for four clocks and outputs “11”. The output of the AND gate 15 is used as a ready signal RDY that controls reading of the program memory 2 by the read DMAC 12. In response to the ready signal RDY, the read DMAC 12 outputs the read address to the program memory 2 and changes the reset signal applied to the counter 14 from “1” to “0”. When the counter 14 is reset by this reset signal, the counter 14 is restarted.

NORゲート86は、プログラムメモリ2から出力される8ビットの圧縮プログラムの最下位ビットが“0”となり、かつリードDMAC12からの前述のリセット信号が“0”となるときのみ“1”を出力する。   The NOR gate 86 outputs “1” only when the least significant bit of the 8-bit compressed program output from the program memory 2 is “0” and the above-described reset signal from the read DMAC 12 is “0”. .

レジスタ83は、セレクタ81から出力された圧縮プログラムならびにANDゲート15およびNORゲート86の出力をベースクロック信号BCLKのタイミングで保持する。レジスタ84は、レジスタ83に保持された圧縮プログラムをベースクロック信号BCLKのタイミングで保持する。   Register 83 holds the compression program output from selector 81 and the outputs of AND gate 15 and NOR gate 86 at the timing of base clock signal BCLK. The register 84 holds the compression program held in the register 83 at the timing of the base clock signal BCLK.

ステートマシン87は、ROMRDY1端子に入力されるレディ信号RDYの状態、およびNCT端子に入力されるNORゲート86から入力される圧縮プログラムの組み合わせに応じて、TBLADR端子から出力されるアドレス、NCEN端子から出力されるセレクタ制御信号およびWRTEN端子から出力される書込制御信号を、レジスタ83が圧縮プログラムを保持するタイミングと同じベースクロック信号BCLKに基づいたタイミングで出力するデジタル回路である。また、ステートマシン87は、NCT端子から通常命令の各バイト(第1〜第5バイト)が入力される毎に1を加算していく3ビットの内部カウンタ(図示せず)を含んでおり、現在どのバイトが入力されているかを認識する。この内部カウンタは、第5バイトをカウントすると初期化される。   The state machine 87 has an address output from the TBLADR terminal according to the combination of the state of the ready signal RDY input to the ROMRDY1 terminal and the compression program input from the NOR gate 86 input to the NCT terminal, from the NCEN terminal. This is a digital circuit that outputs the selector control signal to be output and the write control signal to be output from the WRTEN terminal at the timing based on the same base clock signal BCLK as the timing at which the register 83 holds the compressed program. The state machine 87 includes a 3-bit internal counter (not shown) that increments 1 each time each byte (first to fifth bytes) of the normal instruction is input from the NCT terminal. Recognize which byte is currently input. This internal counter is initialized when the fifth byte is counted.

ステートマシン87が実行する処理は、図3に示すように、ハフマンコードをデコード処理するように行われる。このデコード処理については後に詳しく説明する。   The process executed by the state machine 87 is performed to decode the Huffman code as shown in FIG. This decoding process will be described in detail later.

テーブルROM88は、レジスタ84からの8ビットのデータがテーブルアドレスの上位8ビット(A9−A2)として入力され、ステートマシン87のTBLADR端子から出力されるアドレスがテーブルアドレスの下位の2ビット(A0,A1)として入力される。テーブルROM88は、上記のようにして入力される10ビットのテーブルアドレス(A9−A0)に対応する8ビットのデータ(D7−D0)を書込データとして出力する。具体的には、図4に示すように、テーブルROM88は、テーブルアドレス(A9−A0)が“000”から“003”までの4バイトの領域を使用せず、以降の4バイト×8ビット(1ワード)の領域毎に各1個の機械語として伸長された32ビットの高頻度命令(伸長コード)を格納している(合計255個)。   In the table ROM 88, 8-bit data from the register 84 is input as the upper 8 bits (A9-A2) of the table address, and the address output from the TBLADR terminal of the state machine 87 is the lower 2 bits (A0, A0, It is input as A1). The table ROM 88 outputs 8-bit data (D7-D0) corresponding to the 10-bit table address (A9-A0) input as described above as write data. Specifically, as shown in FIG. 4, the table ROM 88 does not use the 4-byte area from the table address (A9-A0) from “000” to “003”, and the subsequent 4 bytes × 8 bits ( A 32-bit high frequency instruction (expanded code) expanded as one machine language is stored for each (1 word) area (a total of 255).

ハフマン符号化法によって得られるコードは、出現頻度が高いほどビット数が少なくなっている。圧縮プログラムがハフマン符号化法によって圧縮されたものである場合、テーブルROM88は、ハフマン符号化されたコードのデコードテーブルとして構成されており、各テーブルアドレスに各ビット数の少ない順にコードを格納している。   The code obtained by the Huffman coding method has a smaller number of bits as the appearance frequency increases. When the compressed program is compressed by the Huffman coding method, the table ROM 88 is configured as a decoding table of Huffman-coded codes, and codes are stored in each table address in ascending order of the number of bits. Yes.

セレクタ82は、S端子の値が“1”となるときに、レジスタ84から8ビットのデータを出力する一方、S端子の値が“0”となるときに、テーブルROM88から出力される8ビットのデータを出力する。   The selector 82 outputs 8-bit data from the register 84 when the value of the S terminal becomes “1”, while the 8-bit data output from the table ROM 88 when the value of the S terminal becomes “0”. Output the data.

レジスタ83は、セレクタ82から出力されたデータおよびステートマシン87のWRTEN端子から出力される書込制御信号をベースクロック信号BCLKのタイミングで保持して、FIFOメモリ9に与える。   The register 83 holds the data output from the selector 82 and the write control signal output from the WRTEN terminal of the state machine 87 at the timing of the base clock signal BCLK, and supplies the same to the FIFO memory 9.

続いて、ステートマシン87における状態の遷移について説明する。ここでは、ハフマン符号によってプログラムを圧縮した場合の復号を行う例について説明する。   Next, state transition in the state machine 87 will be described. Here, an example will be described in which decoding is performed when a program is compressed using Huffman codes.

図3に示すように、まず、プログラムメモリ2のウエイト状態において、ROMRDY1端子の値が“0”である場合、NCEN端子の値、WRTEN端子の値、TBLADR端子の値および内部カウンタのカウント値CNTの値が全て“0”となる。この場合は、プログラムメモリ2から圧縮プログラムが読み出されていない状態であるので、ウエイト状態を持続する。   As shown in FIG. 3, first, in the wait state of the program memory 2, when the value of the ROMRDY1 terminal is “0”, the value of the NCEN terminal, the value of the WRTEN terminal, the value of the TBLADR terminal, and the count value CNT of the internal counter The values of all become “0”. In this case, since the compressed program is not read from the program memory 2, the wait state is maintained.

〔状態遷移(1)〕
“(ROMRDY1 & NCT)=1”は、ROMRDY1端子の値が“1”であり、かつNCT端子に入力されるバイトが“00h”(通常命令)であることを表している。この場合、NCEN端子の値の値が“1”となる一方、WRTEN端子および内部カウンタのカウント値CNTの値が“0”となる。この場合は、通常命令の出力処理に状態が遷移し、セレクタ82からレジスタ84に保持された通常命令の第1バイト(00h)が出力されて、レジスタ85に保持される。しかしながら、“00h”は、通常命令であることを表すコードであり、命令本体ではないので、FIFOメモリ9への書き込みは行われない。
[State transition (1)]
“(ROMRDY1 & NCT) = 1” indicates that the value of the ROMRDY1 terminal is “1” and the byte input to the NCT terminal is “00h” (normal instruction). In this case, the value of the NCEN terminal is “1”, while the count value CNT of the WRTEN terminal and the internal counter is “0”. In this case, the state transits to the normal instruction output process, and the first byte (00h) of the normal instruction held in the register 84 is output from the selector 82 and held in the register 85. However, “00h” is a code indicating that it is a normal instruction and is not an instruction main body, and therefore writing to the FIFO memory 9 is not performed.

〔状態遷移(2)〕
通常命令の出力処理において、“(ROMRDY1=1) && (CNT!=4)”は、通常命令の第2バイトから第4バイトがそれぞれ入力されたことを表している。この場合、WRTEN端子の値を“1”とし、カウント値CNTを第2バイトから第4バイトが入力される毎に1つずつ加算する。また、この場合、状態遷移(1)と同様、NCEN端子の値の値が“1”に維持されているので、セレクタ82から出力された通常命令の第2〜第4バイトはレジスタ84に保持されて、FIFOメモリ9に書き込まれる。
[State transition (2)]
In the normal instruction output process, “(ROMRDY1 = 1) && (CNT! = 4)” indicates that the second to fourth bytes of the normal instruction are input. In this case, the value of the WRTEN terminal is set to “1”, and the count value CNT is incremented by one every time the second to fourth bytes are input. In this case, as in the state transition (1), the value of the value of the NCEN terminal is maintained at “1”, so the second to fourth bytes of the normal instruction output from the selector 82 are held in the register 84. And written in the FIFO memory 9.

〔状態遷移(3)〕
通常命令の出力処理において、“(ROMRDY1=1) && (CNT=4)”は、通常命令の第5バイトが入力されたことを表している。この場合、WRTEN端子の値を“1”とし、カウント値CNTを次のカウントに備えるため初期化する。また、この場合、状態遷移(1)と同様、NCEN端子の値の値が“1”に維持されているので、セレクタ82から出力された通常命令の第5バイトはレジスタ84に保持されて、FIFOメモリ9に書き込まれる。そして、状態をメモリプログラム2のウエイト状態に戻す。
[State transition (3)]
In the normal instruction output process, “(ROMRDY1 = 1) && (CNT = 4)” indicates that the fifth byte of the normal instruction is input. In this case, the value of the WRTEN terminal is set to “1”, and the count value CNT is initialized to prepare for the next count. In this case, as in the state transition (1), the value of the value of the NCEN terminal is maintained at “1”, so the fifth byte of the normal instruction output from the selector 82 is held in the register 84, It is written in the FIFO memory 9. Then, the state is returned to the wait state of the memory program 2.

〔状態遷移(4)〕
通常命令の出力処理において、ROMRDY1端子の値が“0”である場合、WRTEN端子の値が“0”となる。この場合は、プログラムメモリ2から圧縮プログラムが読み出されないので、FIFOメモリ9への書き込みは行われない。
[State transition (4)]
In the normal instruction output process, if the value of the ROMRDY1 terminal is “0”, the value of the WRTEN terminal is “0”. In this case, since the compressed program is not read from the program memory 2, writing to the FIFO memory 9 is not performed.

〔状態遷移(5)〕
“(ROMRDY1 & ^NCT)=1”は、ROMRDY1端子の値が“1”であり、かつNCT端子に入力されるバイトが“00h”(通常命令)以外のコードであることを表している。この場合、NCEN端子の値およびTBLADR端子の値が“0”(“00”)となる一方、WRTEN端子の値が“1”となる。この場合は、高頻度命令の伸長処理に状態が遷移し、レジスタ84を介して入力された上記のバイトと上記のTBLADR端子の値とからなるテーブルアドレスにより、テーブルROM88から伸長コードが読み出される。この伸長コードは、セレクタ82を介してレジスタ85に保持され、FIFOメモリ9に書き込まれる。
[State transition (5)]
“(ROMRDY1 & ^ NCT) = 1” indicates that the value of the ROMRDY1 terminal is “1” and the byte input to the NCT terminal is a code other than “00h” (normal instruction). In this case, the value of the NCEN terminal and the value of the TBLADR terminal are “0” (“00”), while the value of the WRTEN terminal is “1”. In this case, the state transitions to the high-frequency instruction decompression process, and the decompression code is read from the table ROM 88 based on the table address composed of the bytes input via the register 84 and the value of the TBLADR terminal. This decompressed code is held in the register 85 via the selector 82 and written into the FIFO memory 9.

〔状態遷移(6)〕
高頻度命令の伸長処理において、ROMRDY1端子の値が“0”である場合、TBLADR端子の値に1を加算して出力する。この場合は、新たに圧縮プログラムが読み出されないので、テーブルROM88から、前のテーブルアドレスに1が加算されたテーブルアドレスの伸長コードが出力される。
[State transition (6)]
In the decompression process of the high-frequency instruction, when the value of the ROMRDY1 terminal is “0”, 1 is added to the value of the TBLADR terminal and output. In this case, since a new compressed program is not read, the table ROM 88 outputs a decompressed code at a table address obtained by adding 1 to the previous table address.

〔状態遷移(7)〕
高頻度命令の伸長処理において、状態遷移(5)と同様、“(ROMRDY1 & ^NCT)=1”で表されるように、NCT端子に入力されるバイトが通常命令以外のコードである場合、高頻度命令の伸長処理状態を維持する。
[State transition (7)]
In the decompression process of the high-frequency instruction, as in the state transition (5), when the byte input to the NCT terminal is a code other than the normal instruction as represented by “(ROMRDY1 & ^ NCT) = 1”, Maintain the decompression status of high-frequency instructions.

〔状態遷移(8)〕
高頻度命令の伸長処理において、状態遷移(1)と同様、“(ROMRDY1 & NCT)=1”で表されるように、NCT端子に入力されるバイトが通常命令を表す場合、通常命令の出力処理状態に遷移する。
[State transition (8)]
In the high-frequency instruction decompression process, as in the state transition (1), when the byte input to the NCT terminal represents a normal instruction as represented by "(ROMRDY1 & NCT) = 1", the normal instruction output Transition to the processing state.

〔状態遷移(9)〕
高頻度命令の伸長処理において、状態遷移(5)と同様、“(ROMRDY1 & ^NCT)=1”で表されるように、NCT端子に入力されるバイトが通常命令以外のコードである場合、高頻度命令の伸長処理状態に遷移する。
[State transition (9)]
In the decompression process of the high-frequency instruction, as in the state transition (5), when the byte input to the NCT terminal is a code other than the normal instruction as represented by “(ROMRDY1 & ^ NCT) = 1”, Transitions to the high-frequency instruction decompression processing state.

ここで、上記のように構成されるメモリ制御システム1のプログラム転送の動作について説明する。   Here, the program transfer operation of the memory control system 1 configured as described above will be described.

まず、CPU4がリセットされると、CPU4がバスアクノリッジ信号BACKを“L”とするので、3ステートバッファ6がデータバス21をCPU4側に接続するとともに、3ステートバッファ7がアドレスバス22をCPU4側に接続する。これにより、CPU4は、プログラムメモリ2から非圧縮プログラムを読み出すように、リードアドレスをプログラムメモリ2に与える。すると、非圧縮プログラムがプログラムメモリ2からCPU4に読み出され、CPU4により実行される。   First, when the CPU 4 is reset, the CPU 4 sets the bus acknowledge signal BACK to “L”, so that the 3-state buffer 6 connects the data bus 21 to the CPU 4 side and the 3-state buffer 7 connects the address bus 22 to the CPU 4 side. Connect to. As a result, the CPU 4 gives the read address to the program memory 2 so as to read the uncompressed program from the program memory 2. Then, the uncompressed program is read from the program memory 2 to the CPU 4 and executed by the CPU 4.

非圧縮プログラムは、実行が終了すると、リードDMAC12を起動させるように規定されている。これにより、CPU4の起動処理が終了すると、リードDMAC12は、起動して、CPU4からバス権を取得するように、バスリクエスト信号BREQを“H”とする。すると、CPU4はバスアクノリッジ信号BACKを“H”として、リードDMAC12へバス権を譲渡する。このとき、3ステートバッファ6はデータバス21をCPU4側と切り離し、3ステートバッファ7はアドレスバス22をCPU4側と切り離す。また、3ステートバッファ10はデータバス21をFIFOメモリ9とメモリコントローラ11側とで接続する。   The uncompressed program is defined to activate the read DMAC 12 when the execution is completed. Thus, when the activation process of the CPU 4 is completed, the read DMAC 12 is activated and sets the bus request signal BREQ to “H” so as to acquire the bus right from the CPU 4. Then, the CPU 4 sets the bus acknowledge signal BACK to “H” and transfers the bus right to the read DMAC 12. At this time, the 3-state buffer 6 disconnects the data bus 21 from the CPU 4 side, and the 3-state buffer 7 disconnects the address bus 22 from the CPU 4 side. The 3-state buffer 10 connects the data bus 21 between the FIFO memory 9 and the memory controller 11 side.

この状態で、リードDMAC12は、プログラムメモリ2にリードアドレスを与え、圧縮プログラムをパイプライン回路8に読み出す。パイプライン回路8では、圧縮プログラムの伸長処理がパイプライン処理で行われ、圧縮プログラムが圧縮前のプログラムに復元される。これにより、伸長処理が並列化されるので、並列処理に要する時間が短縮され、伸長処理の速度を圧縮プログラムの入力速度に合わせることができる。したがって、圧縮プログラムを間断なく読み出すことができる。   In this state, the read DMAC 12 gives a read address to the program memory 2 and reads the compressed program to the pipeline circuit 8. In the pipeline circuit 8, decompression processing of the compressed program is performed by pipeline processing, and the compressed program is restored to the program before compression. Thereby, since the decompression process is parallelized, the time required for the parallel process is shortened, and the speed of the decompression process can be matched with the input speed of the compression program. Therefore, the compressed program can be read without interruption.

パイプライン回路8で伸長(復元)されたプログラムは、FIFOメモリ9に一時的に蓄えられる。このとき、ライトDMAC13は、“H”のバスアクノリッジ信号BACKにより起動状態にあるので、FIFOメモリ9からの出力制御信号OCが“L”となる期間に、FIFOメモリ9からプログラムの読み出しを行う。また、ライトDMAC13は、併せてリードアドレスをメモリコントローラ11に出力する。読み出されたプログラムは、3ステートバッファ10を介してメモリコントローラ11に出力され、メモリコントローラ11によって、メインメモリ3のリードアドレスに指定された領域に書き込まれる。パイプライン回路8で伸長されたプログラムを一旦FIFOメモリ9に蓄えることにより、パイプライン回路8の出力のバンド幅が動的に変化しても、それを吸収することができる。   The program decompressed (restored) by the pipeline circuit 8 is temporarily stored in the FIFO memory 9. At this time, since the write DMAC 13 is activated by the “H” bus acknowledge signal BACK, the program is read from the FIFO memory 9 during the period when the output control signal OC from the FIFO memory 9 is “L”. The write DMAC 13 also outputs a read address to the memory controller 11. The read program is output to the memory controller 11 via the three-state buffer 10, and is written by the memory controller 11 in an area specified by the read address of the main memory 3. By temporarily storing the program expanded by the pipeline circuit 8 in the FIFO memory 9, even if the bandwidth of the output of the pipeline circuit 8 changes dynamically, it can be absorbed.

続いて、パイプライン回路8における伸長動作について説明する。   Next, the decompression operation in the pipeline circuit 8 will be described.

まず、プログラムメモリ2から読み出された圧縮プログラム(リードデータ)はセレクタ81に入力される。また、このとき、カウンタ14は、図5に示すように、ベースクロック信号BCLKをカウントしており、ANDゲート15は、カウンタ14がカウントの開始から4クロック分カウントした出力により、“1”となるレディ信号RDYを出力する。これにより、セレクタ81は、リードデータを選択して出力する。このときのベースクロック信号BCLKのクロックを第1クロックCL1とする。   First, the compressed program (read data) read from the program memory 2 is input to the selector 81. At this time, as shown in FIG. 5, the counter 14 counts the base clock signal BCLK, and the AND gate 15 is set to “1” by the output counted by the counter 14 for four clocks from the start of counting. A ready signal RDY is output. Thereby, the selector 81 selects and outputs the read data. The clock of the base clock signal BCLK at this time is set as the first clock CL1.

また、レディ信号RDYが“1”となるとき、リードDMAC12からのリセット信号RSTがベースクロック信号BCLKの1クロック分“0”となることにより、カウンタ14がリセットされ、ベースクロック信号BCLKのカウントが再開される。このリセット信号RSTは、NORゲート86にも入力されている。また、NORゲート86には、プログラムメモリ2からの8ビットのリードデータが入力される。   Further, when the ready signal RDY becomes “1”, the reset signal RST from the read DMAC 12 becomes “0” for one clock of the base clock signal BCLK, whereby the counter 14 is reset and the count of the base clock signal BCLK is counted. Resumed. This reset signal RST is also input to the NOR gate 86. Further, 8-bit read data from the program memory 2 is input to the NOR gate 86.

当該リードデータが通常命令である場合、最初の第1バイトがNORゲート86を介してレジスタ83に入力される。また、リードデータが高頻度命令である場合、その1バイトがNORゲート86を介してレジスタ83に入力される。このNORゲート86の出力は、前述の第1クロックCL1に続く第2クロックCL2のタイミングで、レディ信号RDYおよびセレクタ81からのリードデータとともにレジスタ83に保持される。このように、セレクタ81の出力、NORゲート86の出力およびレディ信号RDYがレジスタ83に保持されるまでの工程が第1ステージとなる。   When the read data is a normal instruction, the first first byte is input to the register 83 via the NOR gate 86. If the read data is a high-frequency instruction, the 1 byte is input to the register 83 via the NOR gate 86. The output of the NOR gate 86 is held in the register 83 together with the ready signal RDY and the read data from the selector 81 at the timing of the second clock CL2 following the first clock CL1. Thus, the process until the output of the selector 81, the output of the NOR gate 86, and the ready signal RDY are held in the register 83 is the first stage.

レジスタ83に保持されたリードデータは、上記の第2クロックCL2に続く第3クロックCL3のタイミングで、レジスタ84に保持される。また、レジスタ83に保持されたNORゲート86の出力(リードデータ)とレディ信号RDY(“1”)とは、それぞれステートマシン87のROMRDY1端子とNCT端子とに入力される。ステートマシン87では、上記の第3クロックCL3のタイミングで、NCEN端子、WRTEN端子およびTBLADR端子のそれぞれの値が決定される。   The read data held in the register 83 is held in the register 84 at the timing of the third clock CL3 following the second clock CL2. The output (read data) of the NOR gate 86 and the ready signal RDY (“1”) held in the register 83 are input to the ROMRDY1 terminal and the NCT terminal of the state machine 87, respectively. In the state machine 87, the values of the NCEN terminal, the WRTEN terminal, and the TBLADR terminal are determined at the timing of the third clock CL3.

このように、第1ステージの終わりから、圧縮プログラムのレジスタ84への保持、ならびにステートマシン87によるNCEN端子、WRTEN端子およびTBLADR端子の各値の決定までの工程が第2ステージとなる。   As described above, the process from the end of the first stage to the holding of the compressed program in the register 84 and the determination of the values of the NCEN terminal, the WRTEN terminal, and the TBLADR terminal by the state machine 87 is the second stage.

テーブルROM88では、レジスタ84に保持された8ビットのリードデータと、上記のTBLADR端子の2ビットの値とが与えられる。これらの10ビットからなるテーブルアドレス(A9−A0)で指定された領域に格納された伸長コード(復元値)が伸長されたプログラム、すなわち出力データ(D7−D0)としてセレクタ82に出力される。   In the table ROM 88, the 8-bit read data held in the register 84 and the 2-bit value of the TBLADR terminal are given. The decompressed code (restored value) stored in the area specified by the 10-bit table address (A9-A0) is output to the selector 82 as a decompressed program, that is, output data (D7-D0).

セレクタ82は、S端子の値(NCEN端子の値)が“0”であることから、テーブルROM88からの出力データを選択してレジスタ85に出力する。この出力データは、上記の第3クロックCL3に続く第4クロックCL4のタイミングで、ステートマシン87から書込制御信号として出力されるWRTEN端子の値とともにレジスタ85に保持される。そして、レジスタ85に保持された出力データ(プログラム)がFIFOメモリ9に書き込まれる。   The selector 82 selects the output data from the table ROM 88 and outputs it to the register 85 because the value of the S terminal (the value of the NCEN terminal) is “0”. This output data is held in the register 85 together with the value of the WRTEN terminal output as a write control signal from the state machine 87 at the timing of the fourth clock CL4 following the third clock CL3. Then, the output data (program) held in the register 85 is written into the FIFO memory 9.

このように、第2ステージの終わりから、テーブルROM88からのデータ出力およびセレクタ82から出力のレジスタ85への保持までの工程が第3ステージとなる。   Thus, the process from the end of the second stage to the data output from the table ROM 88 and the holding of the output from the selector 82 to the register 85 is the third stage.

上記のような第1ないし第3ステージの処理が行われることにより、高頻度命令の場合、第1〜第4クロックCL1〜CL4からなる1サイクルで1つの高頻度命令が伸長されてFIFO9に書き込まれる。また、通常命令の場合は、第1クロックCL1の期間に読み出された第1バイトが、続く第2〜第4クロックCL2〜CL4の期間で、それぞれレジスタ83〜85に保持され、第2〜第4バイトも同様にして読み出されて保持される。したがって、第1〜第4クロックCL1〜CL4からなるサイクルが5回繰り返されることにより、5バイト分の1つの通常命令がFIFO9に書き込まれる。   By performing the first to third stage processing as described above, in the case of a high-frequency instruction, one high-frequency instruction is expanded and written to the FIFO 9 in one cycle including the first to fourth clocks CL1 to CL4. It is. In the case of a normal instruction, the first byte read in the period of the first clock CL1 is held in the registers 83 to 85 in the subsequent second to fourth clocks CL2 to CL4, respectively. The fourth byte is read and held in the same manner. Accordingly, a cycle consisting of the first to fourth clocks CL1 to CL4 is repeated five times, so that one normal instruction for five bytes is written into the FIFO 9.

ここで、パイプライン回路8における並行処理について説明する。   Here, parallel processing in the pipeline circuit 8 will be described.

上記の第1ステージでリードデータのレジスタ83への取り込みが行われている第2クロックCL2の期間では、カウンタ14がベースクロック信号BCLKのカウントを再開しており、4クロック分のカウントに達していないことから、ANDゲート15の出力であるレディ信号RDYが“0”となる。このため、リードDMAC12からリードデータが読み出されない。また、セレクタ81のS端子が“0”となるので、今回の第1ステージでは、前回の第1ステージでレジスタ83に保持されているリードデータがセレクタ83を介してレジスタ83に入力され、第3クロックCL3のタイミングで再び保持される。今回の第2ステージにおいても、ROMRDY1端子の値が“0”となることから、高頻度命令の伸長処理の場合、リードデータステートマシン87では、第4クロックCL4のタイミングでTBLADR端子の値に1が加算される(状態遷移(6))。   In the period of the second clock CL2 in which the read data is taken into the register 83 in the first stage, the counter 14 resumes counting the base clock signal BCLK, and has reached the count of 4 clocks. Therefore, the ready signal RDY that is the output of the AND gate 15 becomes “0”. For this reason, read data is not read from the read DMAC 12. In addition, since the S terminal of the selector 81 is “0”, the read data held in the register 83 in the previous first stage is input to the register 83 via the selector 83 in the first stage this time. It is held again at the timing of 3 clocks CL3. Also in the second stage of this time, the value of the ROMRDY1 terminal is “0”. Therefore, in the case of high-frequency instruction decompression processing, the read data state machine 87 sets the value of the TBLADR terminal to 1 at the timing of the fourth clock CL4. Are added (state transition (6)).

今回の第3ステージにおいて、テーブルROM88に入力されるA0,A1が1つ増加することから、テーブルアドレスが変更される。これにより、前回の第3ステージにおいてテーブルROM88から読み出された伸長コードと異なる領域に格納された伸長コードがセレクタ82から出力されて、次のサイクルの第1クロックCL1のタイミングでレジスタ85に保持され、さらにFIFOメモリ9に書き込まれる。   In this third stage, A0 and A1 input to the table ROM 88 are increased by 1, so that the table address is changed. As a result, the decompressed code stored in an area different from the decompressed code read from the table ROM 88 in the previous third stage is output from the selector 82 and held in the register 85 at the timing of the first clock CL1 of the next cycle. Further, it is written in the FIFO memory 9.

このように、高頻度命令の場合は、カウンタ14によるベースクロック信号BCLKのカウントが4クロック分のカウントに達するまで、ステートマシン87では、TBLADR端子の値に1が順次加算されていくので、リードデータの読み出しがない第2〜第4クロックCL2〜CL4の期間でも、異なる出力データがテーブルROM88から読み出される。   As described above, in the case of a high-frequency instruction, the state machine 87 sequentially adds 1 to the value of the TBLADR terminal until the count of the base clock signal BCLK by the counter 14 reaches a count of 4 clocks. Different output data is read from the table ROM 88 even during the second to fourth clocks CL2 to CL4 during which no data is read.

このように、第1ないし第3ステージの処理が、ベースクロック信号BCLKのタイミングに基づいて繰り返して並行的に行われるので、プログラムメモリ2からの圧縮プログラムの読み出しが滞ることなく、伸長処理を行うことができる。したがって、圧縮プログラムが1/Nに圧縮されている場合、圧縮されていない場合に比べて、ほぼN倍の速度でプログラムメモリ2からメインメモリ3へのプログラムの転送を行うことができる。   As described above, the processes of the first to third stages are repeatedly performed in parallel based on the timing of the base clock signal BCLK, so that the decompression process is performed without delaying the reading of the compressed program from the program memory 2. be able to. Therefore, when the compressed program is compressed to 1 / N, the program can be transferred from the program memory 2 to the main memory 3 at a speed approximately N times that when the compressed program is not compressed.

なお、本実施の形態では、圧縮プログラムの符号化をハフマン符号化法を用いた例について説明しているが、圧縮プログラムの符号化方法についてはハフマン符号化法に限定されず、他の可逆型の圧縮符号化法を用いることも可能である。   In this embodiment, an example in which the compression program is encoded using the Huffman encoding method is described. However, the encoding method of the compression program is not limited to the Huffman encoding method, and other lossless types may be used. It is also possible to use the compression encoding method.

本発明は、上述した実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能である。すなわち、請求項に示した範囲で適宜変更した技術的手段を組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。   The present invention is not limited to the above-described embodiments, and various modifications can be made within the scope shown in the claims. That is, embodiments obtained by combining technical means appropriately modified within the scope of the claims are also included in the technical scope of the present invention.

本発明のメモリ制御システムは、可逆的に圧縮されたプログラムを低速メモリデバイスから読み出し、パイプライン処理で伸長して高速メモリデバイスに転送するので、圧縮プログラムの伸長処理が遅いために、圧縮プログラムの入力に間に合わなくなることが回避され、低速メモリデバイスから高速メモリデバイスへ高速でプログラムを転送することができる。このため、本メモリ制御システムを含むシステムの動作の高速化を図ることに好適に利用できる。   The memory control system of the present invention reads a reversibly compressed program from a low-speed memory device, decompresses it by pipeline processing, and transfers it to the high-speed memory device. It is avoided that the input is not in time, and the program can be transferred from the low-speed memory device to the high-speed memory device at high speed. For this reason, it can be suitably used for speeding up the operation of the system including the memory control system.

本発明の実施形態に係るメモリ制御システムの構成を示すブロック図である。It is a block diagram which shows the structure of the memory control system which concerns on embodiment of this invention. 上記メモリ制御システムにおけるパイプライン回路の構成を示すブロック図である。It is a block diagram which shows the structure of the pipeline circuit in the said memory control system. 上記パイプライン回路におけるステートマシンで実行される処理の遷移状態を示す図である。It is a figure which shows the transition state of the process performed with the state machine in the said pipeline circuit. 上記パイプライン回路におけるテーブルROMにおけるデータ格納の構成を示す図である。It is a figure which shows the structure of the data storage in the table ROM in the said pipeline circuit. 上記パイプライン回路の動作を示すタイミングチャートである。It is a timing chart which shows operation | movement of the said pipeline circuit.

符号の説明Explanation of symbols

1 メモリ制御システム
2 プログラムメモリ(第1メモリ装置)
3 メインメモリ(第2メモリ装置)
4 CPU
5 転送回路
8 パイプライン回路(伸長回路)
1 Memory Control System 2 Program Memory (First Memory Device)
3 Main memory (second memory device)
4 CPU
5 Transfer circuit 8 Pipeline circuit (extension circuit)

Claims (5)

圧縮プログラムおよび起動用の非圧縮プログラムを格納する第1メモリ装置と、
当該第1メモリ装置より高速で動作する第2メモリ装置と、
前記第1メモリ装置から読み出された前記圧縮プログラムを伸長して前記第2メモリ装置に転送する転送回路と、
前記第2メモリ装置に転送された伸長後の前記圧縮プログラムを実行するとともに、起動時に前記非圧縮プログラムを実行するCPUとを備え、
前記転送回路は、前記CPUの起動後に前記圧縮プログラムをパイプライン処理で伸長する伸長回路を有していることを特徴とするメモリ制御システム。
A first memory device for storing a compressed program and an uncompressed program for activation;
A second memory device operating at a higher speed than the first memory device;
A transfer circuit for decompressing the compressed program read from the first memory device and transferring the decompressed program to the second memory device;
A CPU for executing the decompressed compressed program transferred to the second memory device and executing the uncompressed program at the time of activation;
The memory control system, wherein the transfer circuit includes a decompression circuit that decompresses the compressed program by pipeline processing after the CPU is activated.
前記非圧縮プログラムが前記圧縮プログラムより小さいことを特徴とする請求項1に記載のメモリ制御システム。   The memory control system according to claim 1, wherein the uncompressed program is smaller than the compressed program. 前記第1メモリ装置に格納された前記圧縮プログラムを前記伸長回路に読み出すリードDMACを備えていることを特徴とする請求項1または2に記載のメモリ制御システム。   3. The memory control system according to claim 1, further comprising a read DMAC that reads the compressed program stored in the first memory device to the decompression circuit. 前記伸長回路によって前記圧縮プログラムから伸長されたプログラムを蓄えるFIFOメモリと、
前記FIFOメモリから出力される前記プログラムを前記第2メモリ装置に書き込むライトDMACとを備えていることを特徴とする請求項3に記載のメモリ制御システム。
A FIFO memory for storing a program decompressed from the compressed program by the decompression circuit;
The memory control system according to claim 3, further comprising a write DMAC that writes the program output from the FIFO memory to the second memory device.
前記伸長回路は、前記第1メモリ装置から読み出された前記圧縮プログラムを保持する第1工程と、前記圧縮プログラムにおける命令の出現頻度に基づいて読出アドレスを決定する第2工程と、前記読出アドレスに基づいて、圧縮プログラムの符号化コードに対応する圧縮前の値を読み出す第3工程とを順次並行して実行することを特徴とする請求項1から4のいずれか1項に記載のメモリ制御システム。   The decompression circuit includes a first step of holding the compressed program read from the first memory device, a second step of determining a read address based on an appearance frequency of instructions in the compressed program, and the read address 5. The memory control according to claim 1, wherein a third step of reading a value before compression corresponding to an encoded code of the compression program is sequentially executed in parallel based on system.
JP2008255301A 2008-09-30 2008-09-30 Memory control system Pending JP2010086321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008255301A JP2010086321A (en) 2008-09-30 2008-09-30 Memory control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008255301A JP2010086321A (en) 2008-09-30 2008-09-30 Memory control system

Publications (1)

Publication Number Publication Date
JP2010086321A true JP2010086321A (en) 2010-04-15

Family

ID=42250211

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008255301A Pending JP2010086321A (en) 2008-09-30 2008-09-30 Memory control system

Country Status (1)

Country Link
JP (1) JP2010086321A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019620A (en) * 2012-11-30 2013-04-03 中国科学院上海技术物理研究所 Storage circuit system based on flash memory-SRAM (Static Random Access Memory) flow line
US9367445B2 (en) 2012-08-31 2016-06-14 Samsung Electronics Co., Ltd. Data processing apparatus, method for processing data, and computer readable recording medium recorded with program to perform the method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9367445B2 (en) 2012-08-31 2016-06-14 Samsung Electronics Co., Ltd. Data processing apparatus, method for processing data, and computer readable recording medium recorded with program to perform the method
CN103019620A (en) * 2012-11-30 2013-04-03 中国科学院上海技术物理研究所 Storage circuit system based on flash memory-SRAM (Static Random Access Memory) flow line

Similar Documents

Publication Publication Date Title
WO2020025006A1 (en) Data compression and decompression method and related apparatus, electronic device, and system
WO2009033397A1 (en) Method for accessing data in flash memory and data accessing controller
JP2001350713A (en) Transfer controller
US7728742B2 (en) Method and apparatus for compressing and decompressing data
TW200839571A (en) Device and method for access time reduction by speculatively decoding non-memory read commands on a serial interface
JPWO2009022531A1 (en) Data compression / decompression method
US20020161989A1 (en) Apparatus and method for storing instruction set information
JP2006338538A (en) Stream processor
US20080294855A1 (en) Memory control system and memory data fetching method
JP2010086321A (en) Memory control system
JP2000066948A (en) Memory lsi with compressed data input/output function
JP2010170164A (en) Dma transfer control device
US7742544B2 (en) System and method for efficient CABAC clock
CN113890540A (en) Parallel acceleration LZ77 decoding method and device
JPH06103225A (en) Chain type dma system and dma controller therefor
US7376152B2 (en) Method and/or architecture implemented in hardware for the adjustment of messages with indeterministic length
CN110764710A (en) Data access method and storage system of low-delay and high-IOPS
US20190391840A1 (en) Memory module
US9378782B1 (en) Apparatus with write-back buffer and associated methods
KR100308134B1 (en) Digital audio decoder and decoding method thereof
JPH05189360A (en) Data transfer and storage system
US20230281124A1 (en) Memory controller
US20220414014A1 (en) Technology for early abort of compression acceleration
JP2015148851A (en) image processing apparatus
JP2011227539A (en) Image processing device