JP2010086321A - Memory control system - Google Patents
Memory control system Download PDFInfo
- 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
Links
Images
Abstract
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を起動する。
特許文献1には、ハードウェアで圧縮されたプログラムを伸長することが開示されているが、具体的な伸長方法については開示されていない。ハードウェアでプログラムを伸長する場合、ROMから読み出された圧縮プログラムを取り込む時間よりも、圧縮プログラムを伸長する処理に時間がかかり、圧縮プログラムの読み出しが滞ってしまう。これは、圧縮のアルゴリズムが複雑化したり、伸長回路への入力データサイズが動的に変化したりすることで、より顕著になる。このため、CPUの起動が遅くなるという不都合が生じる。
本発明は、上記の問題点に鑑みてなされたものであり、低速メモリデバイスに格納された圧縮プログラムを高速メモリデバイスに転送するときに、ハードウェアを用いて圧縮プログラムの伸長処理を高速に行うことができるメモリ制御システムを提供することを目的としている。 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
プログラムメモリ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
圧縮プログラムは、アプリケーションプログラム等のプログラムであって、CPU4によって実行されるために、メインメモリ3に転送されて格納される。また、圧縮プログラムは、例えば、ハフマン符号等によって可逆的に圧縮されている。この圧縮プログラムは、通常命令と高頻度命令とからなる。
The compression program is a program such as an application program, and is transferred to the
通常命令は、圧縮前のプログラムにおいて最も出現頻度が低い命令であり、圧縮されない。通常命令が圧縮されないのは、最も出現頻度が低いために、圧縮プログラム全体の圧縮度の低下に及ぼす影響が低く、かつ圧縮および伸長の効率を向上させることができるからである。この通常命令は、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
メインメモリ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
CPU4は、プログラムメモリ2から読み出された上記の非圧縮プログラムを実行することにより、起動処理を行うとともに、伸長されてメインメモリ3に転送される上記の圧縮プログラムを実行する。
The
転送回路5は、プログラムメモリ2に格納された圧縮プログラムをメインメモリ3に転送する回路である。また、この転送回路5は、プログラムメモリ2から圧縮プログラムを読み出して伸長するとともに、書き込みのタイミングを調整しながらメインメモリ3へ書き込む。この転送回路5については、後に詳述する。
The
3ステートバッファ6は、プログラムメモリ2からのデータバス21の接続および遮断を行う回路であり、CPU4からのバスアクノリッジ信号BACKが“L”となるときに、データバス21を接続し、バスアクノリッジ信号BACKが“H”となるときに、データバス21を遮断する。3ステートバッファ7は、プログラムメモリ2へのアドレスバス22の接続および遮断を行う回路であり、CPU4からのバスアクノリッジ信号BACKが“L”となるときにアドレスバス22を接続し、バスアクノリッジ信号BACKが“H”となるときにアドレスバス22を遮断する。
The 3-
続いて、転送回路5について、より詳しく説明する。
Next, the
転送回路5は、パイプライン回路8、FIFOメモリ9、3ステートバッファ10、メモリコントローラ11、リードDMAC12およびライトDMAC13を有している。また、メモリ制御システム1は、図2に示すように、カウンタ14およびANDゲート15をさらに有している。
The
パイプライン回路8は、プログラムメモリ2から読み出された圧縮プログラムに施された符号化に対応した復号化を行うことにより圧縮プログラムを伸長する回路である。このパイプライン回路8は、圧縮プログラムの伸長処理が遅いために、圧縮プログラムの入力に間に合わなくならないように、伸長をパイプライン処理で行うようにしている。パイプライン回路8については、後に詳細に説明する。
The
FIFOメモリ9は、パイプライン回路8によって伸長されたプログラムを一時的に蓄えるバッファメモリとして機能している。これにより、FIFOメモリ9は、パイプライン回路8から出力されるプログラムのバンド幅(データビット長と速度との積)が動的に変化しても、それを吸収するとともに、メインメモリ3への書き込みタイミングを調整することができる。また、FIFOメモリ9は、記憶領域に空きがある状態(記憶可能状態)のときに“H”となり、記憶領域に空きがない状態(出力可能状態)のときに“L”となる出力制御信号OCをライトDMAC13に与える。FIFOメモリ9は、出力制御信号OCが“H”となる期間にプログラムの記憶を継続して出力を行い、出力制御信号OCが“L”となる期間にプログラムの記憶を停止して、読み出しを行う。
The
3ステートバッファ10は、FIFOメモリ9からのデータバス21の接続および遮断を行う回路であり、CPU4からのバスアクノリッジ信号BACKが“H”となるときに、データバス21を接続し、バスアクノリッジ信号BACKが“L”となるときに、データバス21を遮断する。
The three-
メモリコントローラ11は、FIFOメモリ9からのプログラムのメインメモリ3への書き込み、およびメインメモリ3からCPU4へのプログラムの読み出しを制御する回路である。
The memory controller 11 is a circuit that controls writing of a program from the
リードDMAC12は、プログラムメモリ2からパイプライン回路8への圧縮プログラムの読み出しを制御する回路である。このリードDMAC12は、CPU4からバス権を取得するときに、バスリクエスト信号BREQを“H”とし、CPU4へバス権を受け渡すときに、バスリクエスト信号BREQを“L”とする。また、リードDMAC12は、パイプライン回路8に伸長を制御するための制御信号を与える。
The
ライト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
メモリコントローラ11は、FIFOメモリ9から3ステートバッファ10を介して読み出されたプログラムをライトDMAC13から出力されるリードアドレスとともに、メインメモリ3に与えて、プログラムの書き込みを制御する。また、メモリコントローラ11は、CPU4からのリードアドレスをメインメモリ3に与えることによって、メインメモリ3に記憶されているプログラムをデータバスに読み出してCPU4に与える。
The memory controller 11 gives a program read from the
引き続いて、パイプライン回路8について詳細に説明する。
Subsequently, the
図2に示すように、パイプライン回路8は、セレクタ81,82、レジスタ83〜85、NORゲート86、ステートマシン87およびテーブルROM88を有している。
As shown in FIG. 2, the
セレクタ81は、S端子の値が“1”となるときに、プログラムメモリ2から出力される圧縮プログラム(圧縮コード化された8ビットのデータ)を出力する一方、S端子の値が“0”となるときに、レジスタ83の出力データを出力する。S端子に入力される値は、カウンタ14およびANDゲート15によって生成される。
The
カウンタ14は、ベースクロック信号BCLKをカウントする2ビットバイナリカウンタである。ANDゲート15は、カウンタ14がベースクロック信号BCLKを4クロックカウントして“11”を出力する毎に1クロック期間だけ“1”を出力する。ANDゲート15の出力は、リードDMAC12によるプログラムメモリ2の読み出しを制御するレディ信号RDYとして用いられる。このレディ信号RDYにより、リードDMAC12は、リードアドレスをプログラムメモリ2に出力するとともに、カウンタ14に与えるリセット信号を“1”から“0”にする。カウンタ14は、このリセット信号によりリセットされると、カウンタを再開する。
The
NORゲート86は、プログラムメモリ2から出力される8ビットの圧縮プログラムの最下位ビットが“0”となり、かつリードDMAC12からの前述のリセット信号が“0”となるときのみ“1”を出力する。
The NOR
レジスタ83は、セレクタ81から出力された圧縮プログラムならびにANDゲート15およびNORゲート86の出力をベースクロック信号BCLKのタイミングで保持する。レジスタ84は、レジスタ83に保持された圧縮プログラムをベースクロック信号BCLKのタイミングで保持する。
ステートマシン87は、ROMRDY1端子に入力されるレディ信号RDYの状態、およびNCT端子に入力されるNORゲート86から入力される圧縮プログラムの組み合わせに応じて、TBLADR端子から出力されるアドレス、NCEN端子から出力されるセレクタ制御信号およびWRTEN端子から出力される書込制御信号を、レジスタ83が圧縮プログラムを保持するタイミングと同じベースクロック信号BCLKに基づいたタイミングで出力するデジタル回路である。また、ステートマシン87は、NCT端子から通常命令の各バイト(第1〜第5バイト)が入力される毎に1を加算していく3ビットの内部カウンタ(図示せず)を含んでおり、現在どのバイトが入力されているかを認識する。この内部カウンタは、第5バイトをカウントすると初期化される。
The
ステートマシン87が実行する処理は、図3に示すように、ハフマンコードをデコード処理するように行われる。このデコード処理については後に詳しく説明する。
The process executed by the
テーブル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
ハフマン符号化法によって得られるコードは、出現頻度が高いほどビット数が少なくなっている。圧縮プログラムがハフマン符号化法によって圧縮されたものである場合、テーブル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
セレクタ82は、S端子の値が“1”となるときに、レジスタ84から8ビットのデータを出力する一方、S端子の値が“0”となるときに、テーブルROM88から出力される8ビットのデータを出力する。
The
レジスタ83は、セレクタ82から出力されたデータおよびステートマシン87のWRTEN端子から出力される書込制御信号をベースクロック信号BCLKのタイミングで保持して、FIFOメモリ9に与える。
The
続いて、ステートマシン87における状態の遷移について説明する。ここでは、ハフマン符号によってプログラムを圧縮した場合の復号を行う例について説明する。
Next, state transition in the
図3に示すように、まず、プログラムメモリ2のウエイト状態において、ROMRDY1端子の値が“0”である場合、NCEN端子の値、WRTEN端子の値、TBLADR端子の値および内部カウンタのカウント値CNTの値が全て“0”となる。この場合は、プログラムメモリ2から圧縮プログラムが読み出されていない状態であるので、ウエイト状態を持続する。
As shown in FIG. 3, first, in the wait state of the
〔状態遷移(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
〔状態遷移(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
〔状態遷移(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
〔状態遷移(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
〔状態遷移(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
〔状態遷移(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
〔状態遷移(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
まず、CPU4がリセットされると、CPU4がバスアクノリッジ信号BACKを“L”とするので、3ステートバッファ6がデータバス21をCPU4側に接続するとともに、3ステートバッファ7がアドレスバス22をCPU4側に接続する。これにより、CPU4は、プログラムメモリ2から非圧縮プログラムを読み出すように、リードアドレスをプログラムメモリ2に与える。すると、非圧縮プログラムがプログラムメモリ2からCPU4に読み出され、CPU4により実行される。
First, when the
非圧縮プログラムは、実行が終了すると、リード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
この状態で、リードDMAC12は、プログラムメモリ2にリードアドレスを与え、圧縮プログラムをパイプライン回路8に読み出す。パイプライン回路8では、圧縮プログラムの伸長処理がパイプライン処理で行われ、圧縮プログラムが圧縮前のプログラムに復元される。これにより、伸長処理が並列化されるので、並列処理に要する時間が短縮され、伸長処理の速度を圧縮プログラムの入力速度に合わせることができる。したがって、圧縮プログラムを間断なく読み出すことができる。
In this state, the
パイプライン回路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
続いて、パイプライン回路8における伸長動作について説明する。
Next, the decompression operation in the
まず、プログラムメモリ2から読み出された圧縮プログラム(リードデータ)はセレクタ81に入力される。また、このとき、カウンタ14は、図5に示すように、ベースクロック信号BCLKをカウントしており、ANDゲート15は、カウンタ14がカウントの開始から4クロック分カウントした出力により、“1”となるレディ信号RDYを出力する。これにより、セレクタ81は、リードデータを選択して出力する。このときのベースクロック信号BCLKのクロックを第1クロックCL1とする。
First, the compressed program (read data) read from the
また、レディ信号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
当該リードデータが通常命令である場合、最初の第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
レジスタ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
このように、第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
テーブルROM88では、レジスタ84に保持された8ビットのリードデータと、上記のTBLADR端子の2ビットの値とが与えられる。これらの10ビットからなるテーブルアドレス(A9−A0)で指定された領域に格納された伸長コード(復元値)が伸長されたプログラム、すなわち出力データ(D7−D0)としてセレクタ82に出力される。
In the
セレクタ82は、S端子の値(NCEN端子の値)が“0”であることから、テーブルROM88からの出力データを選択してレジスタ85に出力する。この出力データは、上記の第3クロックCL3に続く第4クロックCL4のタイミングで、ステートマシン87から書込制御信号として出力されるWRTEN端子の値とともにレジスタ85に保持される。そして、レジスタ85に保持された出力データ(プログラム)がFIFOメモリ9に書き込まれる。
The
このように、第2ステージの終わりから、テーブルROM88からのデータ出力およびセレクタ82から出力のレジスタ85への保持までの工程が第3ステージとなる。
Thus, the process from the end of the second stage to the data output from the
上記のような第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
ここで、パイプライン回路8における並行処理について説明する。
Here, parallel processing in the
上記の第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
今回の第3ステージにおいて、テーブルROM88に入力されるA0,A1が1つ増加することから、テーブルアドレスが変更される。これにより、前回の第3ステージにおいてテーブルROM88から読み出された伸長コードと異なる領域に格納された伸長コードがセレクタ82から出力されて、次のサイクルの第1クロックCL1のタイミングでレジスタ85に保持され、さらにFIFOメモリ9に書き込まれる。
In this third stage, A0 and A1 input to the
このように、高頻度命令の場合は、カウンタ14によるベースクロック信号BCLKのカウントが4クロック分のカウントに達するまで、ステートマシン87では、TBLADR端子の値に1が順次加算されていくので、リードデータの読み出しがない第2〜第4クロックCL2〜CL4の期間でも、異なる出力データがテーブルROM88から読み出される。
As described above, in the case of a high-frequency instruction, the
このように、第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
なお、本実施の形態では、圧縮プログラムの符号化をハフマン符号化法を用いた例について説明しているが、圧縮プログラムの符号化方法についてはハフマン符号化法に限定されず、他の可逆型の圧縮符号化法を用いることも可能である。 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.
1 メモリ制御システム
2 プログラムメモリ(第1メモリ装置)
3 メインメモリ(第2メモリ装置)
4 CPU
5 転送回路
8 パイプライン回路(伸長回路)
1
3 Main memory (second memory device)
4 CPU
5
Claims (5)
当該第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.
前記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.
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)
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 |
-
2008
- 2008-09-30 JP JP2008255301A patent/JP2010086321A/en active Pending
Cited By (2)
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 |