JP2716563B2 - Data write control method - Google Patents

Data write control method

Info

Publication number
JP2716563B2
JP2716563B2 JP2066084A JP6608490A JP2716563B2 JP 2716563 B2 JP2716563 B2 JP 2716563B2 JP 2066084 A JP2066084 A JP 2066084A JP 6608490 A JP6608490 A JP 6608490A JP 2716563 B2 JP2716563 B2 JP 2716563B2
Authority
JP
Japan
Prior art keywords
write
address
data
buffer
size
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.)
Expired - Fee Related
Application number
JP2066084A
Other languages
Japanese (ja)
Other versions
JPH03266047A (en
Inventor
一泰 野々村
敬人 野田
裕士 神阪
徹 渡部
拓巳 丸山
巧 竹野
慎哉 加藤
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2066084A priority Critical patent/JP2716563B2/en
Publication of JPH03266047A publication Critical patent/JPH03266047A/en
Application granted granted Critical
Publication of JP2716563B2 publication Critical patent/JP2716563B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔発明の概要〕 メモリにバスを介して接続された情報処理装置の書込
み制御回路に関し、 ソフトウエアによりアドレス境界を意識することなく
メモリライトが行なえ、またアドレス境界を跨がないラ
イトアクセスは遅くなることがないようにすることを目
的とし、 1.メモリとバスにより接続されたデータ処理装置におけ
るデータ書込み制御回路にして, データバス幅(k)の2倍以上の容量(j)を有し,
データ処理装置(CPU)からのライトデータを保持する
データバッファ(13)と, データ処理装置からのライトアドレスを保持するアド
レスバッファ(14)と, データ処理装置からのライトサイズ幅を保持するサイ
ズバッファ(16)と, データ処理装置からのライトデータを,ライトアドレ
スの前記容量(j)の余剰だけサーキュラシフトしてデ
ータバッファにセットするサーキュラシフタ(12)と, ライトアドレスとライトサイズにより,ライトアクセ
スがアドレス境界に跨ることを検出するバウンダリチェ
ック回路(17)とを備え, 前記バウンダリチェック回路(17)は,前記ライトアド
レス及びライトサイズを加算する加算器(17a)と,該
加算器(17a)の加算結果の下位log2Kビット(Kはデ
ータバス値)目からキャリーが発生した場合,あるいは
K幅のライトでライトアドレスの下位log2Kビット以下
のビットが全て0でない場合にライトアクセスがアドレ
ス境界に跨がるものとしてセットするフラグ(17b)と
を有し, さらに前記バウンダリチェック回路(17)のフラグ
(17b)がセットされているとき,1回目のライトアクセ
スのあと,データ処理装置のクロックを1サイクル抑止
するクロック制御回路(15)を備え、跨がりが検出され
た場合データ処理装置の動作を停止してライトアクセス
をもう一度行なうように制御し,また, ライトサイズバス(WSB)上に送出するライトサイズ
は,フラグ(17b)がセットされていない場合は,サイ
ズバッファの値とし,フラグ(17b)がセットされてい
る場合は,1回目はk−ライトアドレスのk剰余として,2
回目はサイズバッファの値−1回目のライトサイズと
し, アドレスバス(AB)上に送出するライトアドレスは,
フラグ(17b)がセットされていない場合は,アドレス
バッファの値とし,フラグ(17b)がセットされている
場合は,1回目はアドレスバッファの値として,2回目はそ
れを次のアドレス境界へ更新した値とし, データバス(DB)上へ送出するライトデータは,フラ
グがセットされていない場合はデータバッファの上位k
分とし,フラグがセットされている場合は,1回目はデー
タバッファの上位k分として,2回目は下位k分とするこ
とを特徴とする。
DETAILED DESCRIPTION OF THE INVENTION [Summary of the Invention] A write control circuit of an information processing device connected to a memory via a bus, a memory write can be performed without being aware of an address boundary by software, and The purpose of this is to prevent write access without delay from becoming slow: 1. A data write control circuit in a data processing device connected by a memory and a bus, with a capacity of at least twice the data bus width (k) (J),
A data buffer (13) for holding write data from the data processing unit (CPU), an address buffer (14) for holding a write address from the data processing unit, and a size buffer for holding a write size width from the data processing unit (16), a circular shifter (12) for circularly shifting the write data from the data processing device by the surplus of the capacity (j) of the write address and setting it in the data buffer, and a write access by the write address and the write size. A boundary check circuit (17) for detecting that the address crosses an address boundary. The boundary check circuit (17) includes an adder (17a) for adding the write address and the write size, and the adder (17a). If (the K data bus values) lower log 2 K bits of the addition result of the carry is generated from the eye Or write access if the lower log 2 following bits K-bit write address K width of the write are not all zero and a flag (17b) to be set as a straddle thing to address boundary, further said boundary check circuit When the flag (17b) of (17) is set, a clock control circuit (15) for suppressing the clock of the data processing device for one cycle after the first write access is provided. Controls the processing unit to stop the operation and performs write access again. The write size to be sent on the write size bus (WSB) is the value of the size buffer if the flag (17b) is not set. If the flag (17b) is set, the first time is calculated as k remainder of k-write address,
The second time is the value of the size buffer minus the first write size, and the write address transmitted on the address bus (AB) is
If the flag (17b) is not set, the value of the address buffer is used. If the flag (17b) is set, the value is updated to the address buffer for the first time and updated to the next address boundary for the second time. The write data sent to the data bus (DB) is the upper k of the data buffer if the flag is not set.
When the flag is set, the first time is the upper k minutes of the data buffer, and the second time is the lower k minutes.

〔産業上の利用分野〕[Industrial applications]

本発明は、メモリにバスを介して接続された情報処理
装置の書込み制御回路に関する。
The present invention relates to a write control circuit of an information processing device connected to a memory via a bus.

プロセサにおいては、メモリアクセスは非常に頻度が
高く、その高速化が重要である。
In a processor, memory access is very frequent and it is important to increase the speed.

また、連続するメモリ領域に続けてアクセスする場合
も多く、プログラムの作成を容易にし、異なるメモリバ
ス幅をもつ装置間でのプログラムの互換性を容易にする
ためにも、ソフトがアドレス境界を意識する必要のない
ことが要求される。しかも、アドレス境界をまたがって
アクセスを行っても、性能の低下が最小限に抑えられる
ことが要求される。
In many cases, continuous memory areas are accessed successively, and software is conscious of address boundaries in order to facilitate program creation and facilitate program compatibility between devices with different memory bus widths. Need not be done. In addition, even if access is performed across address boundaries, it is required that performance degradation be minimized.

〔従来の技術〕[Conventional technology]

データバスが複数バイト幅を持ち、1回のメモリアク
セスでその複数バイトがリード/ライトされ、しかしデ
ータはバイト単位でリード/ライト可能なシステムがあ
る。第4図(a)(b)では該複数バイトは4バイトで
あり、メモリMEMは1アドレスで4バイトがリード/ラ
イトされる。しかしデータはバイト単位で扱うことがで
き、これはメモリアクセスアドレスは下位2ビットを除
いたものとし、これでリード/ライトされる4バイトの
各バイトを該下位2ビットで指定するという方法で可能
である。このシステムではバスアドレスとメモリアドレ
スが対応している。即ち32本(4バイト)のバス信号線
上の各データは、メモリの1アドレス上の32ビットと1
対1対応している。
There is a system in which a data bus has a width of a plurality of bytes and a plurality of bytes are read / written by one memory access, but data can be read / written in byte units. In FIGS. 4 (a) and 4 (b), the plurality of bytes are 4 bytes, and 4 bytes are read / written by one address in the memory MEM. However, data can be handled in byte units. This is possible by excluding the lower 2 bits of the memory access address and specifying each byte of 4 bytes to be read / written by the lower 2 bits. It is. In this system, a bus address corresponds to a memory address. That is, each data on the 32 (4 bytes) bus signal lines is composed of 32 bits on one address of the memory and 1 data.
One to one.

このようなシステムでは、メモリアドレスに対応する
4バイトを扱うのは簡単で、リードなら該アドレスでメ
モリMEMを読出し、出てきた4バイトをデータバスDBへ
取出せばよく、またライトならデータバスDB上の4バイ
トを、メモリMEMのアドレスで選択した記憶位置へ書込
めばよい。これは第4図(a)で言えば、アドレス0〜
3,4〜7,……(これは前記下位2ビットのアドレスで表
わされるもの)の4バイトデータを単位としてリードラ
イトすることに相当する。
In such a system, it is easy to handle 4 bytes corresponding to a memory address. For a read, the memory MEM is read at that address, and the 4 bytes that have come out are taken out to the data bus DB. The upper four bytes may be written to the storage location selected by the address of the memory MEM. This is described with reference to FIG.
.. (This is represented by the address of the lower 2 bits) corresponds to reading / writing in units of 4-byte data.

データはバイト単位で扱うから、上記のような0〜3,
4〜7,……各4バイト単位でなく、3と4の2バイトを
リード/ライトする、こともある。これを行なうには、
リードなら、0〜3を読出してそのうちの3を選択し、
また4〜7を読出してそのうちの4を選択する、という
処理になる。またライトなら、メモリに1バイトライ
ト、2バイトライト、……4バイトライトという機能が
あるからそれを利用して、1回目のメモリアクセスで3
を該当位置へライトし、2回目のメモリアクセスで4を
該当位置へライトする、という処理になる。4バイトア
クセスだけなら、0〜3を読出し、そのうちの3を新デ
ータで置換え、結果を読出したアドレスへライトし、ま
た4〜7を読出し、そのうちの4を新データで置換え、
結果を読出したアドレスへライトし、などという処理に
なる。
Data is handled in byte units, so 0-3,
4 to 7,... In some cases, 2 bytes of 3 and 4 are read / written instead of 4 bytes. To do this,
If it is read, read 0-3 and select 3 of them,
Further, the processing is to read out 4 to 7 and select 4 of them. In the case of write, the memory has a function of 1-byte write, 2-byte write,..., 4-byte write.
Is written to the corresponding position, and 4 is written to the corresponding position in the second memory access. If only 4-byte access, read 0-3, replace 3 of them with new data, write the result to the read address, read 4-7, replace 4 of them with new data,
The result is written to the read address, and so on.

このように、3と4の間、7と8の間のようなアドレ
ス境界に跨るアクセスをするときは、アドレス境界に跨
らない(アドレス境界で区切れている)アクセスをする
場合とは異なった処理になり、複雑になる。
In this way, when accessing across an address boundary such as between 3 and 4 or between 7 and 8, it is different from the case where accessing does not cross an address boundary (partitioned by an address boundary). Processing and complexity.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来においては、プロセッサがデータを書き込む場合
には、そのアドレスをソフトウエアまたはファームウエ
アによりチェックし、バスの境界に跨る場合には、2回
に分けてアクセスを行うようにし、各アクセスのアドレ
スの更新、ライトサイズの決定等をプログラムで行って
いた。
Conventionally, when data is written by a processor, its address is checked by software or firmware, and when it crosses a bus boundary, an access is made in two steps, and the address of each access is Updating, determination of the light size, etc. were performed by a program.

従って、アドレスをレジスタにロードし、その下位ビ
ットでバス幅の境界を跨るかどうかチェックし、跨る場
合には、1回目のライトサイズを計算し、ライトアクセ
スを行い、次にアドレスの更新を行ってから2回目のラ
イトサイズを計算し、2回目のライトを行う。
Therefore, the address is loaded into the register, it is checked whether or not the lower bit crosses the boundary of the bus width, and if so, the first write size is calculated, write access is performed, and then the address is updated. After that, the second write size is calculated, and the second write is performed.

このソフトウエアによりアドレスをチェックしてメモ
リライトリクエストを発行する場合の問題点は、単純な
メモリライトであるにもかかわらず、ステップ数がかな
り大きくなり、ライトが完了するまでの時間が非常に大
きくなってしまうことである。また、ファームウエアで
アドレスチェックを行う場合には、メモリライトを行う
命令の最初で、必ずアドレス境界のチェックを行うた
め、アドレス境界に跨らないライト命令まで遅くなって
しまうことである。
The problem with issuing a memory write request by checking the address using this software is that despite the simple memory write, the number of steps is considerably large, and the time until the write is completed is extremely long. It will be. In addition, when an address check is performed by firmware, an address boundary is always checked at the beginning of a memory write instruction, so that a write instruction that does not cross an address boundary may be delayed.

本発明はかゝる点を改善し、ソフトウエアによりアド
レス境界を意識することなくメモリライトが行なえ、ま
たアドレス境界を跨がないライトアドレスは遅くなるこ
とがないようにすることを目的とするものである。
It is an object of the present invention to improve such a point that a memory write can be performed without being aware of an address boundary by software, and a write address that does not cross an address boundary is not delayed. It is.

〔課題を解決するための手段〕[Means for solving the problem]

第1図に示すように本発明ではデータ書込み制御に、
サーキュラシフタ12、データバッファ13、アドレスバッ
ファ14、サイズバッファ16、バウンダリチェック回路17
を用いる。
As shown in FIG. 1, in the present invention, the data write control
Circular shifter 12, Data buffer 13, Address buffer 14, Size buffer 16, Boundary check circuit 17
Is used.

データバッファ13は、データバスDBのバス幅kの2倍
以上の容量jを持つ。前述の例ではバス幅kは4バイ
ト、容量jは8バイトである。データ処理装置(CPU)1
1のデータ幅は、バス幅に等しく、本例では4バイトで
ある。
The data buffer 13 has a capacity j that is at least twice the bus width k of the data bus DB. In the above example, the bus width k is 4 bytes and the capacity j is 8 bytes. Data processing unit (CPU) 1
The data width of 1 is equal to the bus width, and is 4 bytes in this example.

サーキュラシフタ12はCPU11からの4バイトデータを
受け、ライトアドレスの容量jの剰余だけシフトして、
例えばライトアドレスが3なら8(j)−3=5だけシ
フトしてデータバッファ13にセットする。
The circular shifter 12 receives the 4-byte data from the CPU 11, shifts by the remainder of the capacity j of the write address, and
For example, if the write address is 3, the data is shifted by 8 (j) -3 = 5 and set in the data buffer 13.

バウンダリチェック回路17は、ライトアドレスとライ
トサイズにより、ライトアクセスがアドレス境界に跨る
か否かをチェックする。例えばライトアドレスの下位2
ビットが00で、ライトサイズが4バイトなら、ライトア
クセスがアドレス境界に跨ることはない、であり、ライ
トアドレスが3でライトサイズが2なら、ライトアクセ
スがアドレス境界に跨る、であり、バウンダリチェック
回路17はかゝる跨る/跨らないを検出する。跨るとき、
バウンダリチェック回路17の出力WCは例えば1、跨らな
いときその反対の0である。跨るとき、CPUのクロックC
LKを1サイクル抑止して、ライトアクセスをもう一度行
なわせる。
The boundary check circuit 17 checks, based on the write address and the write size, whether the write access crosses an address boundary. For example, lower 2 of the write address
If the bit is 00 and the write size is 4 bytes, the write access does not cross the address boundary, and if the write address is 3 and the write size is 2, the write access crosses the address boundary, and the boundary check is performed. The circuit 17 detects such a straddling / not straddling. When straddling,
The output WC of the boundary check circuit 17 is, for example, 1; When crossing, CPU clock C
LK is suppressed for one cycle and write access is performed again.

データライトに当ってはデータバスDBへライトデータ
を、アドレスバスABへライトアドレスを、ライトサイズ
バスWSBへライトサイズをのせる。WSBへのせるライトサ
イズは、跨らないときサイズバッファ16の値、跨ると
き、1回目はk−ライトアドレスのkの剰余、2回目は
サイズバッファの値−1回目のライトサイズである。ま
たABへのせるライトアドレスは、跨らないとき、アドレ
スバッファの値、跨るとき、1回目はアドレスバッファ
の値、2回目はそれを次のアドレス境界へ更新した値で
ある。またDBへのせるライトデータは、跨らないとき、
データバッファの上位kバイト、跨るとき、1回目はデ
ータバッファの上位kバイト、2回目は下位kバイトで
ある。
In the data write, the write data is put on the data bus DB, the write address is put on the address bus AB, and the write size is put on the write size bus WSB. The write size to be added to the WSB is the value of the size buffer 16 when not straddling, the surplus of k of the k-write address when straddling the first time, and the value of the size buffer minus the first write size when straddling. The write address to be assigned to the AB is the value of the address buffer when it does not straddle, the value of the address buffer when straddling the first time, and the value updated to the next address boundary the second time. Also, when writing data to the DB does not straddle,
When straddling the upper k bytes of the data buffer, the first is the upper k bytes of the data buffer and the second is the lower k bytes.

〔作用〕[Action]

この構成によれば、CPU11がライトデータD、ライト
アドレスADD、ライトサイズSZを出力するだけで、アド
レス境界に跨らないなら1回のライトアクセスで、跨る
なら2回のライトアクセスで、ライトデータをその2回
用に分け、ライトアドレスもその2回用に更新して、デ
ータ書込みをすることができる。
According to this configuration, the CPU 11 only outputs the write data D, the write address ADD, and the write size SZ. If the CPU 11 does not cross an address boundary, the CPU 11 performs one write access. Can be divided into two times, and the write address can be updated for the two times to write data.

アドレス境界に跨る/跨らないは、バウンダリチェッ
ク回路17が判定し、その結果によりセレクタ18,19,10が
データ、アドレス、サイズ選択を行なう。
The boundary check circuit 17 determines whether or not an address boundary is straddled, and the selectors 18, 19, and 10 select data, address, and size according to the result.

この方式では、ソフトによるアドレス境界判定などの
サイクルは入らないから、迅速なライトアクセスが可能
である。
In this method, since a cycle such as address boundary determination by software does not enter, quick write access is possible.

〔実施例〕〔Example〕

第1図を詳述すると、CPU11はライトアクセスにより、
ライトアドレスADDとライトデータD、ライトバイト数
(ライトサイズ)SZを生成する。サーキュラーバレルシ
フタ12はアドレスADDの値により、ライトデータDをメ
モリバス上のライト位置にサーキュラシフトする。ライ
トデータDを保持するデータバッファ13は、ライト命令
により該データをセットされる。アドレスデータを保持
するアドレスバッファ14は、ライト命令によりアドレス
ADDをセットされる。クロック制御回路15は、CPUに入力
されるクロックCLKを、バウンダリチェック回路17の出
力によりディセーブルする。ライトデータ幅を保持する
ライトサイズバッファ16はライト命令によりライトサイ
ズZをセットされる。バウンダリチェック回路17は、ラ
イトアドレスADDとライトデータ幅SZにより、ライトア
ドレスがバスアドレス境界に跨るかどうかをチェックす
る回路であり、その結果の信号WCで、プロセッサのクロ
ックCLKの制御、バスに出力するデータ/アドレス/ラ
イトサイズの選択を行う。データセレクト18は、バスに
出力するデータを選択する回路で、ライトアドレスADD
と、回路17の境界チェックの結果により、バスに送出す
るライトデータを選択する。アドレスセレクト19はバス
に出力するアドレスを選択する回路で、上記境界チェッ
クの結果により送出するアドレスを選択する。サイズセ
レクト10は、バスに出力するライトサイズを選択する回
路で、上記アドレスADDと、境界チェックの結果によ
り、バスに出力するライトサイズを選択する。
More specifically, FIG. 1 shows that the CPU 11 performs write access,
The write address ADD, the write data D, and the number of write bytes (write size) SZ are generated. The circular barrel shifter 12 circularly shifts the write data D to a write position on the memory bus according to the value of the address ADD. The data buffer 13 holding the write data D is set with the write command by the write command. The address buffer 14 holding the address data is addressed by a write instruction.
ADD is set. The clock control circuit 15 disables the clock CLK input to the CPU by the output of the boundary check circuit 17. The write size Z is set in the write size buffer 16 for holding the write data width by a write instruction. The boundary check circuit 17 is a circuit for checking whether or not the write address crosses the bus address boundary based on the write address ADD and the write data width SZ. The resultant signal WC controls the clock CLK of the processor and outputs the signal to the bus. Data / address / write size to be selected. The data select 18 is a circuit for selecting data to be output to the bus.
Then, according to the result of the boundary check of the circuit 17, the write data to be transmitted to the bus is selected. The address select 19 is a circuit for selecting an address to be output to the bus, and selects an address to be transmitted based on the result of the boundary check. The size select 10 is a circuit for selecting a write size to be output to the bus, and selects a write size to be output to the bus based on the address ADD and the result of the boundary check.

CPU11が32ビットタイプであると、バス幅は32ビット
(4バイト)であり、ライトデータが2バイト、1バイ
ト、3バイトなどであれば第3図に示すようにこれらは
一端から詰めた形、一般には右詰めで出力する。サーキ
ュラシフタ12はこれを受け、ライトアドレスの下位ビッ
ト本例では下位2ビットに従ってシフトする。例えば前
記の例のように2バイトのデータD1とD2をアドレス3と
4にライトする場合は、3回シフトして第3図の12aの
状態にする。データバッファにバス幅の2倍(2倍以上
でもよいが)の容量を持たせておき、2分すると、その
一方13aの右端(アドレス3)にデータD1が、その他方1
3bの左端(アドレス0)にデータD2がくる。従って1回
目のライトは13aを用いて、また2回目のライトは13bを
用いて行なえば、所望のライトを行なうことができる。
サーキュラシフタ12とデータバッファ13はかゝる機能を
持ち、データセレクト18は13a,13bの選択を行なう。
If the CPU 11 is a 32-bit type, the bus width is 32 bits (4 bytes), and if the write data is 2 bytes, 1 byte, 3 bytes, etc., these are packed from one end as shown in FIG. , Generally output right justified. In response to this, the circular shifter 12 shifts according to the lower 2 bits of the write address, in this example, the lower 2 bits. For example, to write a 2-byte data D 1 and D 2 in address 3 and 4 as in the above example, a state of FIG. 3 of 12a shifted 3 times. The data buffer has a capacity twice as large as the bus width (although it may be more than twice), and when the data buffer is divided into two, the data D 1 is placed on the right end (address 3) of 13a,
Comes data D 2 to 3b the left edge of the (address 0). Therefore, a desired write can be performed by using the first write 13a and the second write 13b.
The circular shifter 12 and the data buffer 13 have such functions, and the data select 18 selects between 13a and 13b.

全体を通して説明すると、CPUライト命令により、デ
ータバッファ13、アドレスバッファ14、およびサイズバ
ッファ16がセットされる。この際CPUからのライトデー
タはサーキュラシフタ12でシフトされる。前記の例では
このシフト回数は3であるが、これはデータバッファ13
の容量8バイト、ライトアドレス3、ライトサイズ2か
ら8−3−2として計算できる。なお第3図の右詰めに
するまでのシフト回数も加えると、シフト回数は8−3
=5になる(詳しくはD1については8−3,D2については
8−4)。アドレスバッファ14とサイズバッファ16へ
は、プロセッサからのライトアドレス、ライトデータ幅
がそのまゝセットされる。
Explaining the whole, the data buffer 13, the address buffer 14, and the size buffer 16 are set by the CPU write instruction. At this time, the write data from the CPU is shifted by the circular shifter 12. In the above example, the number of shifts is three, but this is
8-8, the write address 3, and the write size 2 can be calculated as 8-3-2. In addition, when the number of shifts until the right-justification in FIG. 3 is added, the number of shifts is 8-3.
= Become 5 (details 8-3 for D 1, 8-4 for the D 2). The write address and the write data width from the processor are set in the address buffer 14 and the size buffer 16 as they are.

バウンダリチェック回路17は、ライトアドレスにライ
トサイズを加算し、加算結果の下位log2kビット目から
のキャリーをチェックし、このキャリーが1で、ライト
アクセスがあったとき、制御信号WCを1サイクル後に1
サイクルだけ送出する。こゝでkはバス幅で、本例では
4である。従って下位log2kビット目は本例では下位2
ビット目であり、ライトアドレスは3(2進で11、上位
ビットは省略)、ライトサイズは2(2進の10)なら11
+10=101で、下位2ビット目からキャリー1が出る。
これはバスのアドレス境界に跨ることを示す。
The boundary check circuit 17 adds the write size to the write address, checks the carry from the lower log 2 k bit of the addition result, and when the carry is 1 and there is a write access, the control signal WC is cycled for one cycle. After one
Send only cycles. Here, k is the bus width, which is 4 in this example. In this example the lower log 2 k bit thus lower 2
The write address is 3 (11 in binary, upper bits are omitted) and the write size is 11 if it is 2 (10 in binary).
When + 10 = 101, carry 1 is output from the lower 2nd bit.
This indicates that it straddles the address boundary of the bus.

バスのアドレス境界に跨らないライトアクセスの場合
はキャリーは0で(キャリーはなく)、CPUからのアド
レス、ライトサイズ、ライトデータは各々のバッファに
セットされた後、そのまゝ(所要のデータシフトはあ
る)アドレスAB、ライトサイズバスWSB、データバスDB
上に送出される。
In the case of write access that does not cross the bus address boundary, the carry is 0 (there is no carry), and the address, write size, and write data from the CPU are set in each buffer and then left unchanged (the required data There is a shift) address AB, write size bus WSB, data bus DB
Sent up.

バスのアドレス境界に跨るライトアクセスの場合、ア
ドレス境界までのライトデータとライトアドレスが、バ
ッファにセットされた後の、そのまゝバス上に送出され
る。ライトサイズとしては(k−ライトアドレス)が、
バスに送出される。そして、その次のサイクルで制御信
号WCがオンになり、CPUのクロックが抑止され、またラ
イトアドレスはアドレスADDをアドレス境界まで更新し
た値がバス上に送出され、更にライトデータはアドレス
境界を越えた領域へのライトデータがセレクトされてバ
ス上へ送出される。ライトサイズについても、制御信号
WCがオンのときは、ライトサイズSZから1回目のライト
サイズを差し引いた値をバス上へ送出する。
In the case of a write access that crosses an address boundary of a bus, write data and a write address up to the address boundary are sent out onto the bus without being set in the buffer. As the write size, (k-write address)
Sent to the bus. Then, in the next cycle, the control signal WC is turned on, the clock of the CPU is suppressed, the value of the write address updated from the address ADD up to the address boundary is sent out onto the bus, and the write data exceeds the address boundary. Write data to the selected area is selected and sent out onto the bus. Control signal for light size
When the WC is on, a value obtained by subtracting the first light size from the light size SZ is transmitted to the bus.

これを第3図で説明すると、アドレス境界までのライ
トデータD1と、ライトアドレス3と、ライトサイズ1=
4−3がバスに送出されて1回目のライトが行なわれ、
然る後ライトはまだ未了なのでクロック従ってCPU動作
を停止した状態で、アドレスADDを4バイト単位の次の
値へ更新して(下位2桁は0)これをバスへ送り、また
データバッファ13bをセレクトしてそのデータD2をバス
へ送り、ライトサイズは残りの2−1=1としてバスへ
送り、これで2回目のライトを行なう。
To explain this in Figure 3, the write data D 1 of the up address boundary, a write address 3, write size 1 =
4-3 is sent out to the bus and the first write is performed.
After that, since the writing has not yet been completed, the address ADD is updated to the next value in units of 4 bytes (the lower two digits are 0) while the CPU is stopped according to the clock, and this is sent to the bus, and the data buffer 13b a selection of and sends the data D 2 to the bus, a write size is sent to the bus as the remaining 2-1 = 1, this performs the second write.

第3図の例で、2バイトデータをアドレス1へライト
する場合は、アドレスの境界を跨ぐことはないから1回
のアクセスでよく、この場合は次のようになる。即ちサ
ーキュラシフタ12は8−1−2=5回シフトしてデータ
D1,D2を13aの左から2番目と3番目へ移し、ライトアド
レスは1、ライトサイズは2として、ライトを指示す
る。これで残りのライトサイズは0であるから、終了で
ある。バウンダリチェックも行なうが、これはライト動
作と並行して行なわれ、従ってこのチェックのためにラ
イト動作が遅れるようなことはない。
In the example of FIG. 3, when 2-byte data is written to address 1, only one access is required because it does not cross an address boundary. In this case, the following is performed. That is, the circular shifter 12 shifts 8-1-2 = 5 times and shifts the data.
D 1, D transferred 2 from the left 13a to the second and third, the write address 1, write size as 2 instructs the light. Since the remaining light size is now 0, the process is completed. A boundary check is also performed, but this is performed in parallel with the write operation, so that the write operation is not delayed due to this check.

バウンダリチェック回路17などの具体例を第2図に示
す。データバッファ13は第3図の13aと13bからなる8バ
イトレジスタであり、セレクタ18はその13a,13bの選択
を行なう。その選択信号はセレクタ21の出力である。バ
ウンダリチェック回路17は加算器17aとフラグ17bで構成
され、加算器17aはアドレスバッファ14の出力とサイズ
バッファ16の出力とを加算し、下位2ビット目からのキ
ャリーが1のとき、または4バイトライトでライトアド
レスの下位2ビットが00以外のとき信号Cを出力し、フ
ラグ17bをセットする。従ってライトアクセスが4バイ
ト境界を跨ぐ場合は信号Cがオンになり、フラグ17bを
セットすると共に、セレクタ10を操作してバス上へ送出
するライトサイズを、サイズバッファ16の値でなくセレ
クタ22の出力にする。フラグ17bは2回目のライトサイ
クルを指示するもので、オンの間CPU11のクロックを止
め、セレクタ22、19,21を制御する。このフラグ17bは、
ライト1回あたり1サイクルだけオンになることがあ
る。
FIG. 2 shows a specific example of the boundary check circuit 17 and the like. The data buffer 13 is an 8-byte register composed of 13a and 13b in FIG. 3, and the selector 18 selects between 13a and 13b. The selection signal is the output of the selector 21. The boundary check circuit 17 includes an adder 17a and a flag 17b. The adder 17a adds the output of the address buffer 14 and the output of the size buffer 16, and when the carry from the second least significant bit is 1, or 4 bytes. When the lower 2 bits of the write address are other than 00 in the write operation, the signal C is output and the flag 17b is set. Therefore, when the write access crosses the 4-byte boundary, the signal C is turned on, the flag 17b is set, and the write size to be sent out onto the bus by operating the selector 10 is not the value of the size buffer 16 but the value of the selector 22. Output. The flag 17b instructs the second write cycle, and stops the clock of the CPU 11 while the flag 17b is on, thereby controlling the selectors 22, 19, and 21. This flag 17b
It may be turned on for only one cycle per write.

加減算器23はライトサイズ+ライトアドレスの下位2
ビット−4を出力する。前記の例なら2+3−4=1を
出力する。引算器24は4−ライトアドレス下位2ビット
を出力する。前記の例なら4−3=1を出力する。加算
器17aの出力Cはオフ(O)のときセレクタ10にサイズ
バッファ16を選択させ、オンのときセレクタ22を選択さ
せ、セレクタ22はフラグ17bがオフ(1回目のアクセ
ス)のとき引算器24を、オン(2回目のアクセス)のと
き加減算器23を選択する。
The adder / subtracter 23 is the lower 2 of the write size + write address.
Output bit-4. In the above example, 2 + 3-4 = 1 is output. The subtractor 24 outputs the lower 2 bits of the 4-write address. In the above example, 4-3 = 1 is output. When the output C of the adder 17a is off (O), the selector 10 selects the size buffer 16; when it is on, the selector 22 is selected; when the flag 17b is off (first access), the selector 22 When 24 is ON (second access), the adder / subtractor 23 is selected.

加算器25は、ライトアドレスの下位2ビットを0にし
たもの+4を出力する。即ち、アドレス境界毎のアドレ
スを出力する。セレクタ19はWC=0のとき(1回目アク
セス)のときアドレスバッファ14を選択し、WC=1のと
き(2回目アクセス)のとき加算器25を選択する。
The adder 25 outputs +4 obtained by setting the lower 2 bits of the write address to 0. That is, an address for each address boundary is output. The selector 19 selects the address buffer 14 when WC = 0 (first access), and selects the adder 25 when WC = 1 (second access).

フラグ出力WCはまたセレクタ21を操作し、WC=0で、
ライトアドレスの下位から3ビット目が0のときはデー
タバッファ13の上位4バイト(13a)を選択し、該3ビ
ット目が1のときはデータバッファ13の下位4バイト
(13b)を選択する。WC=1のときは、その反対のライ
トデータをバス上で出力する。
The flag output WC also operates the selector 21 and when WC = 0,
When the third bit from the lower end of the write address is 0, the upper 4 bytes (13a) of the data buffer 13 are selected, and when the third bit is 1, the lower 4 bytes (13b) of the data buffer 13 are selected. When WC = 1, the opposite write data is output on the bus.

フラグ出力WCは更にインヒビットゲートであるクロッ
クコントロール15を制御し、WC=1の間、発振器が出力
するクロックがCPU11に入力するのを禁止する。
The flag output WC further controls the clock control 15, which is an inhibit gate, and inhibits the clock output from the oscillator from being input to the CPU 11 while WC = 1.

ライトアクセスが4バイトバス境界を跨がらない例と
して、CPUが0番目から4バイトデータをライトする場
合を説明すると、アドレスバッファ14に下位2ビットが
0のアドレスがセットされ、サイズバッファ16に4がセ
ットされる。またライトデータは、ライトアドレスの下
位2ビットが0であるからシフタ12により4回シフトさ
れて、8バイトデータバッファ13に左詰めでセットされ
る。加算器17aの出力Cは、0+4では下位2ビット目
からのキャリーはなくまた4バイトライトでライトアド
レスの下位2ビットが0であるから、C=0であり、バ
ッファ13,14,16のデータがそのまゝバスDB,AB,WSBへ出
力され、1回のライトアクセスで完了となる。
As an example where the write access does not cross the 4-byte bus boundary, the case where the CPU writes 4-byte data from the 0th byte will be described. An address whose lower 2 bits are 0 is set in the address buffer 14 and the size buffer 16 stores 4 bits. Is set. Since the lower 2 bits of the write address are 0, the write data is shifted four times by the shifter 12 and set in the 8-byte data buffer 13 left-justified. The output C of the adder 17a is 0 + 4, since there is no carry from the lower 2 bits and the lower 2 bits of the write address are 0 in 4-byte write, C = 0, and the data of the buffers 13, 14, 16 Is output to the buses DB, AB, and WSB, and is completed by one write access.

次にライトアクセスが4バイト境界を跨ぐ例として、
CPUが3番目から4バイトライトする場合の動作を説明
すると、この場合はアドレスバッファ14に3が、サイズ
バッファ4がセットされる。ライトデータは、ライトア
ドレスが3であるから8−3−4=1回シフトされて8
バイトデータバッファ13へセットされる。
Next, as an example where write access crosses a 4-byte boundary,
The operation when the CPU writes the third to fourth bytes will be described. In this case, 3 is set in the address buffer 14 and the size buffer 4 is set. Since the write address is 3, the write data is shifted by 8-3-4 = 1 time to 8
It is set in the byte data buffer 13.

加算器17aの出力Cは、4バイトライトでアドレスの
下位2ビットが0でないのでオンになり、次サイクルで
フラグ17bがセットされると共に、ライトサイズは最初
は引算器24の値1、次は加減算器23の値3になる。
The output C of the adder 17a is turned on because the lower 2 bits of the address are not 0 in a 4-byte write, the flag 17b is set in the next cycle, and the write size is initially the value 1 of the subtractor 24, the next Becomes the value 3 of the adder / subtractor 23.

ライトアドレスは、最初はWC=0であるからアドレス
バッファ14の値、次はWC=1であるから加算器25の値で
ある。ライトデータは最初は8バイトデータバッファ13
の上位4バイト、次は下位4バイトである。
The write address is the value of the address buffer 14 since WC = 0 at first, and the value of the adder 25 since WC = 1 next. Write data is initially an 8-byte data buffer 13
Is the upper 4 bytes, and the next is the lower 4 bytes.

また本発明では、CPU本体やプログラムの変更は必要
でなく外部インタフェース回路を付加するのみでアクセ
スを高速化することができる。
Further, according to the present invention, the access can be speeded up only by adding an external interface circuit without changing the CPU main body or the program.

〔発明の効果〕〔The invention's effect〕

以上説明したよにう、本発明によれば、ソフトウエア
によりアドレス境界を意識することなくメモリのライト
アクセスが行える。また、アドレス境界を跨がないライ
トアクセスが遅くなることはなく、境界を跨ぐライトア
クセスも、跨がない場合にくらべて1サイクル遅くなる
だけであり、従来のアドレス判定をしてメモリアクセス
するのに比べて、格段に速い。
As described above, according to the present invention, memory write access can be performed by software without being aware of address boundaries. In addition, write access that does not straddle an address boundary is not delayed, and write access that straddles a boundary is only one cycle slower than when there is no straddle. It is much faster than

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明の原理図、 第2図は本発明の実施例を示すブロック図、 第3図は動作説明図、 第4図はアドレス境界の説明図である。 第1図で11はデータ処理装置、WSBはライトサイズバッ
ファ、ABはアドレスバス、DBはデータバスである。
1 is a principle diagram of the present invention, FIG. 2 is a block diagram showing an embodiment of the present invention, FIG. 3 is an explanatory diagram of an operation, and FIG. 4 is an explanatory diagram of an address boundary. In FIG. 1, 11 is a data processing device, WSB is a write size buffer, AB is an address bus, and DB is a data bus.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 渡部 徹 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 丸山 拓巳 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 竹野 巧 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (72)発明者 加藤 慎哉 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (56)参考文献 特開 昭48−68209(JP,A) 特開 昭54−129934(JP,A) 特開 昭62−174842(JP,A) ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Toru Watanabe 1015 Uedanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Prefecture Inside Fujitsu Limited (72) Inventor Takumi Maruyama 1015 Kamikodanaka, Nakahara-ku, Kawasaki-shi, Kanagawa Fujitsu Limited ( 72) Inventor Takumi Takeno 1015 Uedanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Inside Fujitsu Limited (72) Inventor Shinya Kato 1015, Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Inside Fujitsu Limited (56) References JP-A Sho48 JP-A-68209 (JP, A) JP-A-54-129934 (JP, A) JP-A-62-174842 (JP, A)

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】メモリとバスにより接続されたデータ処理
装置におけるデータ書込み制御回路にして, データバス幅(k)の2倍以上の容量(j)を有し,
データ処理装置(CPU)からのライトデータを保持する
データバッファ(13)と, データ処理装置からのライトアドレスを保持するアド
レスバッファ(14)と, データ処理装置からのライトサイズ幅を保持するサイ
ズバッファ(16)と, データ処理装置からのライトデータを,ライトアドレ
スの前記容量(j)の余剰だけサーキュラシフトしてデ
ータバッファにセットするサーキュラシフタ(12)と, ライトアドレスとライトサイズにより,ライトアクセ
スがアドレス境界に跨ることを検出するバウンダリチェ
ック回路(17)とを備え, 前記バウンダリチェック回路(17)は,前記ライトアド
レス及びライトサイズを加算する加算器(17a)と,該
加算器(17a)の加算結果の下位log2Kビット(Kはデ
ータバス値)目からキャリーが発生した場合,あるいは
K幅のライトでライトアドレスの下位log2Kビット以下
のビットが全て0でない場合にライトアクセスがアドレ
ス境界に跨がるものとしてセットするフラグ(17b)と
を有し, さらに前記バウンダリチェック回路(17)のフラグ
(17b)がセットされているとき,1回目のライトアクセ
スのあと,データ処理装置のクロックを1サイクル抑止
するクロック制御回路(15)を備え、跨がりが検出され
た場合データ処理装置の動作を停止してライトアクセス
をもう一度行なうように制御し,また, ライトサイズバス(WSB)上に送出するライトサイズ
は,フラグ(17b)がセットされていない場合は,サイ
ズバッファの値とし,フラグ(17b)がセットされてい
る場合は,1回目はk−ライトアドレスのk剰余として,2
回目はサイズバッファの値−1回目のライトサイズと
し, アドレスバス(AB)上に送出するライトアドレスは,
フラグ(17b)がセットされていない場合は,アドレス
バッファの値とし,フラグ(17b)がセットされている
場合は,1回目はアドレスバッファの値として,2回目はそ
れを次のアドレス境界へ更新した値とし, データバス(DB)上へ送出するライトデータは,フラ
グがセットされていない場合はデータバッファの上位k
分とし,フラグがセットされている場合は,1回目はデー
タバッファの上位k分として,2回目は下位k分とするこ
とを特徴とするデータ書込み制御回路。
1. A data write control circuit in a data processing device connected to a memory and a bus, the data write control circuit having a capacity (j) of twice or more a data bus width (k),
A data buffer (13) for holding write data from the data processing unit (CPU), an address buffer (14) for holding a write address from the data processing unit, and a size buffer for holding a write size width from the data processing unit (16), a circular shifter (12) for circularly shifting the write data from the data processing device by the surplus of the capacity (j) of the write address and setting it in the data buffer, and a write access by the write address and the write size. A boundary check circuit (17) for detecting that the address crosses an address boundary. The boundary check circuit (17) includes an adder (17a) for adding the write address and the write size, and the adder (17a). If (the K data bus values) lower log 2 K bits of the addition result of the carry is generated from the eye Or write access if the lower log 2 following bits K-bit write address K width of the write are not all zero and a flag (17b) to be set as a straddle thing to address boundary, further said boundary check circuit When the flag (17b) of (17) is set, a clock control circuit (15) for suppressing the clock of the data processing device for one cycle after the first write access is provided. Controls the processing unit to stop the operation and performs write access again. If the flag (17b) is not set, the write size sent to the write size bus (WSB) is the value of the size buffer. If the flag (17b) is set, the first time is calculated as k remainder of k-write address,
The second time is the value of the size buffer minus the first write size, and the write address transmitted on the address bus (AB) is
If the flag (17b) is not set, the value of the address buffer is used. If the flag (17b) is set, the value is updated to the address buffer for the first time and updated to the next address boundary for the second time. The write data sent to the data bus (DB) is the upper k of the data buffer if the flag is not set.
A data write control circuit characterized in that when the flag is set, the first time is the upper k minutes of the data buffer, and the second time is the lower k minutes.
JP2066084A 1990-03-16 1990-03-16 Data write control method Expired - Fee Related JP2716563B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2066084A JP2716563B2 (en) 1990-03-16 1990-03-16 Data write control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2066084A JP2716563B2 (en) 1990-03-16 1990-03-16 Data write control method

Publications (2)

Publication Number Publication Date
JPH03266047A JPH03266047A (en) 1991-11-27
JP2716563B2 true JP2716563B2 (en) 1998-02-18

Family

ID=13305638

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2066084A Expired - Fee Related JP2716563B2 (en) 1990-03-16 1990-03-16 Data write control method

Country Status (1)

Country Link
JP (1) JP2716563B2 (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4868209A (en) * 1971-12-20 1973-09-18
JPS54129934A (en) * 1978-03-31 1979-10-08 Fujitsu Ltd Data access control system

Also Published As

Publication number Publication date
JPH03266047A (en) 1991-11-27

Similar Documents

Publication Publication Date Title
US5206942A (en) Partially storing control circuit used in a memory unit
JP2716563B2 (en) Data write control method
JP2005182538A (en) Data transfer device
JPS6211736B2 (en)
US5933856A (en) System and method for processing of memory data and communication system comprising such system
JP3190847B2 (en) Data transfer control device
JP2507634B2 (en) Information processing device
JP2573711B2 (en) Micro subroutine control method
JP2511063B2 (en) Pipeline control method
JPH05173778A (en) Data processor
JP2000029508A (en) Programmable controller
JPH0743668B2 (en) Access control device
JP3074897B2 (en) Memory circuit
KR100970616B1 (en) Method for Storing and Loading Double Precision Data of Digital Signal Processor
JPH0823820B2 (en) Address overlap check processor
JPS6019810B2 (en) Buffer memory control method
JPH02133841A (en) Data store control system
JPH02190968A (en) Vector processor
JPH01243120A (en) Firmware control device
JPS6327795B2 (en)
JPS59144090A (en) Stack memory device
JPH0412491B2 (en)
JPS5838876B2 (en) Shumemory Seigiyohoshiki
JPH04125747A (en) Cache memory controller
JPS63263537A (en) Information processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees