JPH05257685A - Program access device - Google Patents

Program access device

Info

Publication number
JPH05257685A
JPH05257685A JP5157792A JP5157792A JPH05257685A JP H05257685 A JPH05257685 A JP H05257685A JP 5157792 A JP5157792 A JP 5157792A JP 5157792 A JP5157792 A JP 5157792A JP H05257685 A JPH05257685 A JP H05257685A
Authority
JP
Japan
Prior art keywords
program
data
address
clock signal
program data
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.)
Withdrawn
Application number
JP5157792A
Other languages
Japanese (ja)
Inventor
Masaaki Aoyama
正明 青山
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 VLSI Ltd
Fujitsu Ltd
Original Assignee
Fujitsu VLSI Ltd
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 VLSI Ltd, Fujitsu Ltd filed Critical Fujitsu VLSI Ltd
Priority to JP5157792A priority Critical patent/JPH05257685A/en
Publication of JPH05257685A publication Critical patent/JPH05257685A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To reduce a load on a programmer, and also, to decrease size of a program memory. CONSTITUTION:In a program memory 1, program data is read out successively, based on an address. An address generating circuit 2 contains a program counter 3 for holding the next address data synchronously with a clock signal, and accesses the program memory 1. An adding circuit 4 inputs the program data of the program memory 1, outputs it as it is unless it is a branch instruction, outputs a branch instruction until the clock signal inputted, if it is the branch instruction and outputs a non-operation instruction synchronously with the clock signal, and also, stops an operation of the program counter 3 until the clock signal is inputted. A pipeline register 5 holds successively the program data of the adding circuit 4 synchronously with the clock signal and outputs it to an address generating circuit 2.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は水平型プログラム、すわ
なち、オペレーションコード部とオペランド部とで構成
される1ワードのプログラムを1アドレスでアクセスで
きるプログラムアクセス装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a horizontal program, that is, a program access device capable of accessing a 1-word program consisting of an operation code section and an operand section with one address.

【0002】水平型プログラムをパイプラインレジスタ
を用いて処理する場合で、プログラムカウンタがブラン
チ命令により新たなアドレスを発生するタイミングがク
ロック信号に同期して行われるプログラムアクセス装置
においては、プログラムを作成する際、ブランチ命令の
直後にはノンオペレーション命令を定義する必要があ
り、プログラムが複雑化したり、プログラムメモリサイ
ズの小型化抑制を招いている。このため、プログラムの
複雑化を緩和できるとともに、プログラムメモリサイズ
の小型化が望まれている。
In the case of processing a horizontal program using a pipeline register, a program is created in a program access device in which the timing at which a program counter generates a new address by a branch instruction is synchronized with a clock signal. At this time, it is necessary to define a non-operation instruction immediately after the branch instruction, which leads to a complicated program and a reduction in the program memory size. Therefore, it is desired to reduce the complexity of the program and reduce the program memory size.

【0003】[0003]

【従来の技術】従来のプログラムアクセス装置40を図
7に示す。プログラムアクセス装置40はプログラムカ
ウンタ42を含むアドレス発生回路41、プログラムメ
モリ43およびパイプラインレジスタ44を備えて構成
されている。アドレス発生回路41はパイプラインレジ
スタ44から出力されるプログラムデータDE44を入
力し、そのプログラムデータDE44に基づいて次にア
クセスするアドレスを算出してプログラムカウンタ42
に出力する。プログラムカウンタ42は算出されたアド
レスデータをクロック信号CLKに同期して保持し、プ
ログラムメモリ43にアドレスデータAD42として出
力する。
2. Description of the Related Art A conventional program access device 40 is shown in FIG. The program access device 40 includes an address generation circuit 41 including a program counter 42, a program memory 43, and a pipeline register 44. The address generation circuit 41 receives the program data DE44 output from the pipeline register 44, calculates an address to be accessed next based on the program data DE44, and calculates the program counter 42.
Output to. The program counter 42 holds the calculated address data in synchronization with the clock signal CLK and outputs it to the program memory 43 as the address data AD42.

【0004】プログラムメモリ43には1ワードがオペ
レーションコード部とオペランド部とで構成される多数
のプログラムデータからなるプログラムが格納されてい
る。プログラムメモリ43からはアドレスデータAD4
2が入力される毎にそのアドレスに対応するプログラム
データDR43が順次読み出され、パイプラインレジス
タ44に出力される。
The program memory 43 stores a program having a large number of program data, each word of which is composed of an operation code part and an operand part. Address data AD4 from the program memory 43
Each time 2 is input, the program data DR43 corresponding to the address is sequentially read and output to the pipeline register 44.

【0005】パイプラインレジスタ44はプログラムア
クセス装置40を高速動作させるために設けられてお
り、クロック信号CLKに同期してプログラムメモリ4
3から入力されるプログラムデータDR43を順次保持
し、プログラムデータDE44としてアドレス発生回路
41に出力する。
The pipeline register 44 is provided for operating the program access device 40 at a high speed, and is synchronized with the clock signal CLK.
The program data DR43 input from 3 is sequentially held and output as the program data DE44 to the address generation circuit 41.

【0006】上記のように構成されたプログラムアクセ
ス装置40において、時刻t0においてプログラムカウ
ンタ42からN番地のアドレスデータAD42が出力さ
れると、時刻t0から所定のアクセスタイムだけ遅れて
プログラムメモリ43から内容NのプログラムデータD
R43が読み出される。そして、時刻t1においてクロ
ック信号CLKの立ち上がりエッジに同期してプログラ
ムカウンタ42がインクリメントされてアドレスデータ
AD42は(N+1)番地となるとともに、パイプライ
ンレジスタ44に内容NのプログラムデータDR43が
ラッチされてプログラムデータDE44としてアドレス
発生回路41に出力される。
In the program access device 40 configured as described above, when the program counter 42 outputs the address data AD42 of the address N at time t0, the contents of the program memory 43 are delayed by a predetermined access time from time t0. Program data D of N
R43 is read. Then, at time t1, the program counter 42 is incremented in synchronization with the rising edge of the clock signal CLK, the address data AD42 becomes the address (N + 1), and the pipeline register 44 latches the program data DR43 having the content N and the program data DR43 is latched. The data DE44 is output to the address generation circuit 41.

【0007】そして、時刻t1から所定のアクセスタイ
ムだけ経過すると、プログラムメモリ43から内容(N
+1)のプログラムデータDR43が読み出され、時刻
t2においてクロック信号CLKの立ち上がりエッジに
同期してパイプラインレジスタ44に内容(N+1)の
プログラムデータDR43がラッチされてプログラムデ
ータDE44としてアドレス発生回路41に出力され
る。即ち、プログラムカウンタ42のアドレスデータA
D42が変化してからクロック信号CLKの1サイクル
分遅れてパイプラインレジスタ44にそのアドレスデー
タAD42に対応する内容のプログラムデータがラッチ
される。
When a predetermined access time elapses from the time t1, the contents (N
The program data DR43 of +1) is read, and the program data DR43 of content (N + 1) is latched in the pipeline register 44 at the time t2 in synchronization with the rising edge of the clock signal CLK and is stored in the address generation circuit 41 as the program data DE44. Is output. That is, the address data A of the program counter 42
The program data having the content corresponding to the address data AD42 is latched in the pipeline register 44 with a delay of one cycle of the clock signal CLK after the change of D42.

【0008】[0008]

【発明が解決しようとする課題】しかしながら、上記の
ように構成されたプログラムアクセス装置40におい
て、例えばプログラムデータDE44の内容Nがアドレ
スを「19」加算するブランチ命令であり、プログラム
データDE44の内容(N+1)がアドレスを「10」
加算するブランチ命令であるとする。実際には時刻t2
においてプログラムカウンタ42に(N+20)をラッ
チさせ、時刻t3にてプログラムカウンタ42に(N+
21)をラッチさせたいのであるが、この場合には時刻
t3において(N+1)番地の内容(N+1)に基づい
てプログラムカウンタ42には(N+30)がラッチさ
れてしまう。
However, in the program access device 40 configured as described above, for example, the content N of the program data DE44 is a branch instruction for adding "19" to the address and the content of the program data DE44 ( N + 1) sets the address to "10"
It is a branch instruction to be added. Actually time t2
At the time t3, the program counter 42 is made to latch (N + 20) at (N + 20).
21), but in this case, (N + 30) is latched in the program counter 42 based on the contents (N + 1) of the (N + 1) address at time t3.

【0009】このように、ブランチ命令を連続したアド
レスに定義すると、意図しないアドレスのプログラムデ
ータをアクセスしてしまうことになるため、プログラム
作成時にブランチ命令の直後は必ずノンオペレーション
命令を定義しなければならなかった。従って、プログラ
ムステップは1つのブランチ命令に対して2ステップ必
要となり、プログラムが複雑となってプログラマの負荷
が増大するとともに、プログラムメモリのサイズが大き
くなるという問題があった。
Thus, if branch instructions are defined at consecutive addresses, program data at unintended addresses will be accessed. Therefore, when a program is created, a non-operation instruction must be defined immediately after the branch instruction. did not become. Therefore, two branch steps are required for one branch instruction, the program becomes complicated, the load on the programmer increases, and the size of the program memory increases.

【0010】本発明は上記問題点を解決するためになさ
れたものであって、ブランチ命令の直後のノンオペレー
ション命令を自動発生させ、プログラムの複雑さを緩和
してプログラマの負荷を軽減できるとともに、プログラ
ムメモリのサイズを低減できることを目的とする。
The present invention has been made in order to solve the above-mentioned problems. It is possible to automatically generate a non-operation instruction immediately after a branch instruction to reduce the complexity of the program and the load on the programmer. The purpose is to reduce the size of the program memory.

【0011】[0011]

【課題を解決するための手段】図1は本発明の原理説明
図である。プログラムメモリ1はアドレスデータが入力
される毎にオペレーションコード部とオペランド部とか
らなる1ワードのプログラムデータが順次読み出され
る。アドレス発生回路2は入力されたプログラムデータ
に基づく次のアドレスデータをクロック信号に同期して
保持するプログラムカウンタ3を含み、プログラムカウ
ンタ3に保持されたアドレスデータに基づいてプログラ
ムメモリ1をアクセスする。
FIG. 1 illustrates the principle of the present invention. The program memory 1 sequentially reads 1-word program data including an operation code portion and an operand portion each time address data is input. The address generation circuit 2 includes a program counter 3 that holds the next address data based on the input program data in synchronization with a clock signal, and accesses the program memory 1 based on the address data held by the program counter 3.

【0012】付加回路4はプログラムメモリ1から読み
出されたプログラムデータを入力し、そのプログラムデ
ータがブランチ命令以外の命令であるときにはそのまま
出力し、また、そのプログラムデータがブランチ命令で
あるときにはクロック信号が入力されるまでそのプログ
ラムデータを出力しクロック信号に同期してノンオペレ
ーション命令を出力するとともに、クロック信号が入力
されるまでプログラムカウンタ3の動作を停止させる。
The additional circuit 4 receives the program data read from the program memory 1, outputs it as it is when the program data is an instruction other than a branch instruction, and outputs the clock signal when the program data is a branch instruction. The program data is output until the input signal is input, the non-operation instruction is output in synchronization with the clock signal, and the operation of the program counter 3 is stopped until the clock signal is input.

【0013】パイプラインレジスタ5は付加回路4から
出力されたプログラムデータをクロック信号に同期して
順次保持してアドレス発生回路2に出力する。
The pipeline register 5 sequentially holds the program data output from the additional circuit 4 in synchronization with the clock signal and outputs the program data to the address generation circuit 2.

【0014】[0014]

【作用】従って、プログラム作成においてブランチ命令
後のプログラムステップをノンオペレーション命令とす
る必要がないので、プログラムステップの削減が可能と
なり、プログラムメモリサイズの小型化が可能になると
ともに、プログラムの複雑さが緩和されてプログラム作
成におけるプログラマの負荷が軽減される。
Therefore, since it is not necessary to make the program step after the branch instruction a non-operation instruction when creating the program, the number of program steps can be reduced, the program memory size can be reduced, and the program complexity can be reduced. This alleviates the load on the programmer in programming.

【0015】[0015]

【実施例】以下、本発明を具体化した一実施例を図2〜
図6に従って説明する。図2に示すように、本実施例の
プログラムアクセス装置10はアドレス発生回路11、
プログラムメモリ12、付加回路13、パイプラインレ
ジスタ14およびクロックジェネレータ15等を備えて
構成されている。クロックジェネレータ15は図5に示
すクロック信号CLKをアドレス発生回路11、付加回
路13及びパイプラインレジスタ14に供給している。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment embodying the present invention will now be described with reference to FIGS.
It will be described with reference to FIG. As shown in FIG. 2, the program access device 10 of this embodiment includes an address generation circuit 11,
The program memory 12, the additional circuit 13, the pipeline register 14, the clock generator 15 and the like are provided. The clock generator 15 supplies the clock signal CLK shown in FIG. 5 to the address generation circuit 11, the additional circuit 13 and the pipeline register 14.

【0016】プログラムメモリ12には図6に示すよう
に、オペレーションコード部31とオペランド部32と
からなる1ワード構成のプログラムデータ30が格納さ
れている。本実施例のプログラムデータ30では、オペ
レーションコード部31はビットB15〜B12の4ビ
ットで構成され、ビットB15がブランチ命令ビットに
設定されている。また、オペランド部32はビットB1
1〜B0の12ビットで構成されている。そして、プロ
グラムメモリ12はアドレス発生回路11からアドレス
データAD17が入力される毎にアクセスされ、そのア
ドレスに対応するプログラムデータが順次読み出され
る。読み出されたプログラムデータDR12は付加回路
13に出力される。
As shown in FIG. 6, the program memory 12 stores program data 30 having a one-word structure including an operation code section 31 and an operand section 32. In the program data 30 of this embodiment, the operation code section 31 is composed of 4 bits B15 to B12, and the bit B15 is set as a branch instruction bit. In addition, the operand part 32 is bit B1
It is composed of 12 bits 1 to B0. The program memory 12 is accessed each time the address data AD17 is input from the address generation circuit 11, and the program data corresponding to the address is sequentially read. The read program data DR12 is output to the addition circuit 13.

【0017】アドレス発生回路11はパイプラインレジ
スタ14から入力されるプログラムデータDE14に基
づいてプログラムメモリ12にアドレスデータAD17
を出力するようになっている。即ち、アドレス発生回路
11は図3に示すように、加算器16とプログラムカウ
ンタ17とを備えて構成されている。加算器16は一方
の入力部にプログラムカウンタ17のアドレスデータA
D17を入力するとともに、他方の入力部に前記プログ
ラムデータ30におけるオペランド部32のビットB1
1〜B0を入力している。そして、加算器16はアドレ
スデータAD17とビットB11〜B0とを加算し、加
算結果をプログラムカウンタ17に出力する。
The address generation circuit 11 stores the address data AD17 in the program memory 12 based on the program data DE14 input from the pipeline register 14.
Is to be output. That is, the address generation circuit 11 includes an adder 16 and a program counter 17, as shown in FIG. The adder 16 has the address data A of the program counter 17 at one input portion.
D17 is input and the bit B1 of the operand part 32 in the program data 30 is input to the other input part.
You have entered 1-B0. Then, the adder 16 adds the address data AD17 and the bits B11 to B0 and outputs the addition result to the program counter 17.

【0018】プログラムカウンタ17は前記オペレーシ
ョンコード部31のブランチ命令ビットB15、前記ク
ロックジェネレータ15のクロック信号CLK、図示し
ない制御部からのリセット信号XRES、および付加回
路13から出力される停止制御信号バーSTOPを入力
している。プログラムカウンタ17はブランチ命令ビッ
トB15が有効でない(=「0」)、即ち、ブランチ命
令以外の命令である場合にはクロック信号CLKの立ち
上がりエッジが入力されると、そのとき保持しているア
ドレスデータAD17をインクリメントして次のアドレ
スデータとして保持し出力する。また、プログラムカウ
ンタ17はブランチ命令ビットB15が有効(=
「1」)である、即ち、ブランチ命令である場合にはク
ロック信号CLKの立ち上がりエッジが入力されると、
そのとき加算器16から出力されている加算結果を次の
アドレスデータとして保持し出力する。さらに、プログ
ラムカウンタ17はLレベルの停止制御信号バーSTO
Pが入力されているときにはクロック信号CLKに基づ
くアドレス更新動作を停止する。
The program counter 17 has a branch instruction bit B15 of the operation code section 31, a clock signal CLK of the clock generator 15, a reset signal XRES from a control section (not shown), and a stop control signal bar STOP output from the additional circuit 13. You are typing. When the branch instruction bit B15 is not valid (= “0”), that is, when the rising edge of the clock signal CLK is input, the program counter 17 holds the address data held at that time. AD17 is incremented and held and output as the next address data. In the program counter 17, the branch instruction bit B15 is valid (=
"1"), that is, when the rising edge of the clock signal CLK is input in the case of a branch instruction,
At that time, the addition result output from the adder 16 is held and output as the next address data. Further, the program counter 17 is an L level stop control signal bar STO.
When P is input, the address update operation based on the clock signal CLK is stopped.

【0019】プログラムメモリ12に接続された付加回
路13はマスク回路18と停止制御回路19とで構成さ
れ、プログラムメモリ12から出力されたプログラムデ
ータDR12を入力し、プログラムデータDE18を出
力するようになっている。
The additional circuit 13 connected to the program memory 12 comprises a mask circuit 18 and a stop control circuit 19, and receives the program data DR12 output from the program memory 12 and outputs the program data DE18. ing.

【0020】図4に示すように、マスク回路18はAN
D回路20とデータフリップフロップ(以下、単にデー
タFFという)21とからなり、入力したプログラムデ
ータDR12のビットB14〜B0はそのままプログラ
ムデータDE18のビットB14〜B0としてパイプラ
インレジスタ14に出力する。AND回路20はプログ
ラムデータDR12のブランチ命令ビットB15とデー
タFF21の反転出力XQとの論理積信号をプログラム
データDE18のブランチ命令ビットB15として出力
する。
As shown in FIG. 4, the mask circuit 18 is an AN.
It is composed of a D circuit 20 and a data flip-flop (hereinafter, simply referred to as data FF) 21, and the bits B14 to B0 of the input program data DR12 are directly output to the pipeline register 14 as the bits B14 to B0 of the program data DE18. The AND circuit 20 outputs a logical product signal of the branch instruction bit B15 of the program data DR12 and the inverted output XQ of the data FF21 as the branch instruction bit B15 of the program data DE18.

【0021】データFF21のデータ端子にはAND回
路20の論理積信号が入力され、データFF21は前記
クロックジェネレータ15から出力されるクロック信号
CLKに同期してAND回路20の論理積信号をラッチ
し、反転出力XQとしてその論理積信号の反転信号を出
力する。また、データFF21はLレベルのリセット信
号XRESが入力されるとリセットされ、反転出力XQ
として「1」を出力する。
The AND signal of the AND circuit 20 is input to the data terminal of the data FF 21, and the data FF 21 latches the AND signal of the AND circuit 20 in synchronization with the clock signal CLK output from the clock generator 15. An inverted signal of the logical product signal is output as the inverted output XQ. The data FF 21 is reset when the L level reset signal XRES is input, and the inverted output XQ
"1" is output as.

【0022】従って、プログラムデータDR12のブラ
ンチ命令ビットB15が有効でない(=「0」)ときに
は「0」がそのままプログラムデータDE18のブラン
チ命令ビットB15として出力される。プログラムデー
タDR12のブランチ命令ビットB15が「0」のとき
にはクロック信号CLKの立ち上がりエッジに同期して
データFF21に「0」がラッチされて反転出力XQは
「1」となっている。
Therefore, when the branch instruction bit B15 of the program data DR12 is not valid (= "0"), "0" is output as it is as the branch instruction bit B15 of the program data DE18. When the branch instruction bit B15 of the program data DR12 is "0", "0" is latched in the data FF21 in synchronization with the rising edge of the clock signal CLK, and the inverted output XQ is "1".

【0023】データFF21の反転出力XQが「1」の
状態において、プログラムデータDR12のブランチ命
令ビットB15が有効(=「1」)となると、AND回
路20の論理積信号は「1」となり、プログラムデータ
DE18のブランチ命令ビットB15として「1」が出
力される。プログラムデータDR12のブランチ命令ビ
ットB15が「1」となった後、次のクロック信号CL
KがデータFF21に入力されると、データFF21に
「1」がラッチされ反転出力XQが「0」となるため、
AND回路20の論理積信号は「0」となり、プログラ
ムデータDE18のブランチ命令ビットB15として
「0」が出力される。即ち、プログラムデータDR12
のブランチ命令ビットB15(=「1」)はマスクされ
てノンオペレーション(NOP)命令となる。
When the branch instruction bit B15 of the program data DR12 becomes valid (= "1") while the inverted output XQ of the data FF21 is "1", the AND signal of the AND circuit 20 becomes "1", and the program “1” is output as the branch instruction bit B15 of the data DE18. After the branch instruction bit B15 of the program data DR12 becomes "1", the next clock signal CL
When K is input to the data FF 21, "1" is latched in the data FF 21 and the inverted output XQ becomes "0".
The AND signal of the AND circuit 20 becomes "0", and "0" is output as the branch instruction bit B15 of the program data DE18. That is, the program data DR12
The branch instruction bit B15 (= “1”) is masked to be a non-operation (NOP) instruction.

【0024】停止制御回路19はインバータからなり、
AND回路20の論理積信号を反転して停止制御信号バ
ーSTOPを出力する。例えば、AND回路20の論理
積信号が「0」のときには停止制御信号バーSTOPは
Hレベルとなり、論理積信号が「1」のときには停止制
御信号バーSTOPはLレベルとなる。即ち、インバー
タ19はプログラムデータDR12のブランチ命令ビッ
トB15が有効となった後、次のクロック信号CLKの
立ち上がりエッジが入力されるまでの間、Lレベルの停
止制御信号バーSTOPを出力する。
The stop control circuit 19 comprises an inverter,
The AND signal of the AND circuit 20 is inverted and the stop control signal bar STOP is output. For example, when the logical product signal of the AND circuit 20 is "0", the stop control signal bar STOP becomes H level, and when the logical product signal is "1", the stop control signal bar STOP becomes L level. That is, the inverter 19 outputs the L-level stop control signal STOP until the next rising edge of the clock signal CLK is input after the branch instruction bit B15 of the program data DR12 becomes valid.

【0025】パイプラインレジスタ14は付加回路13
から出力されたプログラムデータDE18をクロック信
号CLKに同期して順次保持してアドレス発生回路11
に出力する。
The pipeline register 14 is an additional circuit 13
The program data DE18 output from the address generator circuit 11 is sequentially held in synchronization with the clock signal CLK.
Output to.

【0026】次に上記のように構成されたプログラムア
クセス装置10の作用を図5に従って説明する。いま、
プログラムカウンタ17から(N−1)番地のアドレス
データAD17が出力されてプログラムメモリ12から
ブランチ命令以外の命令である内容(N−1)のプログ
ラムデータDR12が出力されると、そのブランチ命令
ビットB15は有効でない(=「0」)ため、付加回路
13からは内容(N−1)がそのままプログラムデータ
DE18として出力される。
Next, the operation of the program access device 10 configured as described above will be described with reference to FIG. Now
When the program counter 17 outputs the address data AD17 at the address (N-1) and the program memory 12 outputs the program data DR12 having the content (N-1) which is an instruction other than the branch instruction, the branch instruction bit B15. Is invalid (= "0"), the content (N-1) is output from the additional circuit 13 as it is as the program data DE18.

【0027】時刻t0においてクロック信号CLKの立
ち上がりエッジに同期してプログラムカウンタ17がイ
ンクリメントされてアドレスデータAD17がN番地と
なる。このとき、付加回路13のデータFF21ではク
ロック信号CLKの立ち上がりエッジに同期してAND
回路20の論理積信号「0」がラッチされて反転出力X
Qは「1」となる。
At time t0, the program counter 17 is incremented in synchronization with the rising edge of the clock signal CLK and the address data AD17 becomes the address N. At this time, the data FF 21 of the additional circuit 13 AND's in synchronization with the rising edge of the clock signal CLK.
The logical product signal “0” of the circuit 20 is latched and the inverted output X
Q becomes "1".

【0028】時刻t0から所定のアクセスタイムだけ遅
れてN番地のアドレスデータAD17に基づいてプログ
ラムメモリ12から内容NのプログラムデータDR12
が読み出される。この内容NのプログラムデータDR1
2がM番地へジャンプするブランチ命令であると、その
ブランチ命令ビットB15は有効(=「1」)であり、
データFF21の反転出力XQが「1」であるため、A
ND回路20の論理積信号が「1」となり、付加回路1
3からは内容NがそのままプログラムデータDE18と
して出力される。また、AND回路20の論理積信号が
「1」となるため、インバータ19の停止制御信号バー
STOPはLレベルとなる。
Program data DR12 having a content N from the program memory 12 based on the address data AD17 at address N after a predetermined access time from time t0.
Is read. Program data DR1 with this content N
If 2 is a branch instruction that jumps to address M, the branch instruction bit B15 is valid (= “1”),
Since the inverted output XQ of the data FF 21 is “1”, A
The logical product signal of the ND circuit 20 becomes "1", and the additional circuit 1
From 3, the content N is directly output as the program data DE18. Further, since the AND signal of the AND circuit 20 becomes "1", the stop control signal bar STOP of the inverter 19 becomes L level.

【0029】そして、時刻t1においてクロック信号C
LKの立ち上がりエッジに同期してパイプラインレジス
タ14に内容NのプログラムデータDE18がラッチさ
れてプログラムデータDE14としてアドレス発生回路
11に出力される。アドレス発生回路11ではこの内容
NのプログラムデータDE14に基づいて加算器16に
よりジャンプ先アドレスが算出され、算出結果がプログ
ラムカウンタ17に出力される。
Then, at time t1, the clock signal C
The program data DE18 having the content N is latched in the pipeline register 14 in synchronization with the rising edge of LK and output to the address generation circuit 11 as the program data DE14. In the address generation circuit 11, the jump destination address is calculated by the adder 16 based on the program data DE14 having the content N, and the calculation result is output to the program counter 17.

【0030】また、時刻t1においてデータFF21で
はクロック信号CLKの立ち上がりエッジに同期してA
ND回路20の論理積信号「1」がラッチされて反転出
力XQは「0」となる。このため、AND回路20の論
理積信号は「0」となり、内容NのプログラムデータD
R12のブランチ命令ビットB15(=「1」)はマス
クされてNOP命令となり、付加回路13からはこのN
OP命令がプログラムデータDE18として出力され
る。また、AND回路20の論理積信号が「0」となる
ため、インバータ19の停止制御信号バーSTOPはH
レベルとなる。
At the time t1, the data FF 21 synchronizes with A in synchronization with the rising edge of the clock signal CLK.
The logical product signal "1" of the ND circuit 20 is latched and the inverted output XQ becomes "0". Therefore, the AND signal of the AND circuit 20 becomes "0", and the program data D of the content N
The branch instruction bit B15 (= “1”) of R12 is masked to become a NOP instruction, and the N
The OP instruction is output as the program data DE18. Further, since the AND signal of the AND circuit 20 becomes “0”, the stop control signal bar STOP of the inverter 19 becomes H.
It becomes a level.

【0031】一方、時刻t1において停止制御信号バー
STOPはLレベルであるため、クロック信号CLKの
立ち上がりエッジが入力されてもプログラムカウンタ1
7のアドレス更新動作は実行されず、プログラムカウン
タ17のアドレスデータAD17はN番地に保持され
る。このN番地のアドレスデータAD17に基づいてプ
ログラムメモリ12からはブランチ命令である内容Nの
プログラムデータDR12が出力される。
On the other hand, since the stop control signal bar STOP is at the L level at the time t1, the program counter 1 is input even if the rising edge of the clock signal CLK is input.
The address updating operation of No. 7 is not executed, and the address data AD17 of the program counter 17 is held at the address N. Based on the address data AD17 at the address N, the program memory 12 outputs the program data DR12 having the content N which is a branch instruction.

【0032】ところが、データFF21の反転出力XQ
は「0」となっているため、AND回路20の論理積信
号は「0」となり、内容NのプログラムデータDR12
はマスクされて付加回路13からはNOP命令がプログ
ラムデータDE18として出力され続ける。
However, the inverted output XQ of the data FF 21
Is "0", the AND signal of the AND circuit 20 is "0", and the program data DR12 of the content N is
Are masked and the NOP instruction is continuously output from the additional circuit 13 as the program data DE18.

【0033】そして、時刻t2においてプログラムカウ
ンタ17にはパイプラインレジスタ14から内容Nのプ
ログラムデータDE14のブランチ命令ビットB15
(=「1」)が入力されているため、クロック信号CL
Kの立ち上がりエッジに同期してプログラムカウンタ1
7に加算器16から出力されているジャンプ先アドレス
がラッチされアドレスデータAD17はM番地となる。
Then, at time t2, the branch counter bit B15 of the program data DE14 having the content N from the pipeline register 14 is stored in the program counter 17.
(= “1”) is input, clock signal CL
Program counter 1 in synchronization with the rising edge of K
The jump destination address output from the adder 16 is latched to 7 and the address data AD17 becomes the address M.

【0034】また、時刻t2においてクロック信号CL
Kの立ち上がりエッジに同期してパイプラインレジスタ
14にNOP命令であるプログラムデータDE18がラ
ッチされてプログラムデータDE14としてアドレス発
生回路11に出力される。アドレス発生回路11では入
力されたプログラムデータDE14がNOP命令である
ので、何も実行されない。
Further, at time t2, the clock signal CL
In synchronization with the rising edge of K, the pipeline register 14 latches the program data DE18, which is a NOP instruction, and outputs it as the program data DE14 to the address generation circuit 11. Since the input program data DE14 is the NOP instruction in the address generation circuit 11, nothing is executed.

【0035】時刻t2から所定のアクセスタイムだけ経
過すると、M番地のアドレスデータAD17に基づいて
プログラムメモリ12から内容MのプログラムデータD
R12が読み出される。この内容Mのプログラムデータ
DR12がブランチ命令以外の命令であると、そのブラ
ンチ命令ビットB15は有効でない(=「0」)である
ため、AND回路20の論理積信号が「0」となり、付
加回路13からは内容MがそのままプログラムデータD
E18として出力される。
After a lapse of a predetermined access time from time t2, the program data D having the content M is read from the program memory 12 based on the address data AD17 at the address M.
R12 is read. If the program data DR12 of this content M is an instruction other than a branch instruction, the branch instruction bit B15 is not effective (= "0"), so the AND signal of the AND circuit 20 becomes "0", and the additional circuit From 13 the content M is the same as the program data D
It is output as E18.

【0036】次の時刻t3においてクロック信号CLK
の立ち上がりエッジに同期してパイプラインレジスタ1
7がインクリメントされてアドレスデータAD17は
(M+1)番地となるとともに、パイプラインレジスタ
14に内容MのプログラムデータDE18がラッチされ
てプログラムデータDE14としてアドレス発生回路1
1に出力される。
At the next time t3, the clock signal CLK
Pipeline register 1 in synchronization with the rising edge of
7 is incremented and the address data AD17 becomes the address (M + 1), and the pipeline register 14 latches the program data DE18 having the content M to generate the program data DE14 as the address generation circuit 1
It is output to 1.

【0037】以下、前記と同様にしてアドレス発生回路
11におけるプログラムカウンタ17のアドレスデータ
AD17が変化してからクロック信号CLKの1サイク
ル分遅れてパイプラインレジスタ14にそのアドレスデ
ータAD17に対応する内容のプログラムデータがラッ
チされ、アドレス発生回路11にてそのプログラムデー
タに基づいて次のアドレスデータが出力される。
Thereafter, in the same manner as described above, after the address data AD17 of the program counter 17 in the address generation circuit 11 has changed, the pipeline register 14 is delayed by one cycle of the clock signal CLK and the contents corresponding to the address data AD17 are stored. The program data is latched, and the address generating circuit 11 outputs the next address data based on the program data.

【0038】このように、本実施例ではプログラムメモ
リ12から読み出されたプログラムデータDR12がブ
ランチ命令であるときには、付加回路13のインバータ
19によりプログラムカウンタ17のアドレス更新動作
を停止させ、マスク回路18によりそのブランチ命令を
一旦パイプラインレジスタ14に出力した後、クロック
信号CLKに同期してそのブランチ命令のブランチ命令
ビットB15をマスクしてノンオペレーション命令とし
てパイプラインレジスタ14に出力するようにした。
As described above, in this embodiment, when the program data DR12 read from the program memory 12 is a branch instruction, the address update operation of the program counter 17 is stopped by the inverter 19 of the additional circuit 13 and the mask circuit 18 is executed. Thus, the branch instruction is once output to the pipeline register 14, and then the branch instruction bit B15 of the branch instruction is masked and output to the pipeline register 14 as a non-operation instruction in synchronization with the clock signal CLK.

【0039】従って、プログラム作成においてブランチ
命令後のプログラムステップをノンオペレーション命令
とする必要がなく、プログラムステップを1つのブラン
チ命令に対して1ステップとすればよくなるので、プロ
グラムステップを削減してプログラムの複雑さを緩和で
き、プログラマの負荷を軽減することができる。
Therefore, it is not necessary to make the program step after the branch instruction a non-operation instruction when creating the program, and it is sufficient to make the program step one step for one branch instruction. The complexity can be reduced and the load on the programmer can be reduced.

【0040】また、プログラムステップを削減できるの
で、プログラムメモリ12のサイズを低減することがで
きる。
Since the number of program steps can be reduced, the size of the program memory 12 can be reduced.

【0041】[0041]

【発明の効果】以上詳述したように、本発明によれば、
ブランチ命令の直後のノンオペレーション命令を自動発
生させ、プログラムの複雑さを緩和してプログラマの負
荷を軽減できるとともに、プログラムメモリのサイズを
低減できる優れた効果がある。
As described in detail above, according to the present invention,
The non-operation instruction immediately after the branch instruction is automatically generated, the complexity of the program can be reduced, the load on the programmer can be reduced, and the size of the program memory can be reduced.

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

【図1】本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】一実施例のプログラムアクセス装置を示すブロ
ック図である。
FIG. 2 is a block diagram showing a program access device according to an embodiment.

【図3】一実施例のアドレス発生回路を示すブロック図
である。
FIG. 3 is a block diagram showing an address generation circuit according to an embodiment.

【図4】一実施例の付加回路を示す回路図である。FIG. 4 is a circuit diagram showing an additional circuit according to an embodiment.

【図5】一実施例の作用を示すタイミングチャートであ
る。
FIG. 5 is a timing chart showing the operation of the embodiment.

【図6】プログラムのデータ形式を示す図である。FIG. 6 is a diagram showing a data format of a program.

【図7】従来のプログラムアクセス装置を示すブロック
図である。
FIG. 7 is a block diagram showing a conventional program access device.

【図8】従来例の作用を示すタイミングチャートであ
る。
FIG. 8 is a timing chart showing the operation of the conventional example.

【符号の説明】[Explanation of symbols]

1 プログラムメモリ 2 アドレス発生回路 3 プログラムカウンタ 4 付加回路 5 パイプラインレジスタ 1 Program Memory 2 Address Generation Circuit 3 Program Counter 4 Additional Circuit 5 Pipeline Register

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 アドレスデータが入力される毎にオペレ
ーションコード部とオペランド部とで構成される1ワー
ドのプログラムデータが順次読み出されるプログラムメ
モリ(1)と、 入力されたプログラムデータに基づく次のアドレスデー
タをクロック信号に同期して保持するプログラムカウン
タ(3)を含み、プログラムカウンタ(3)に保持され
たアドレスデータに基づいて前記プログラムメモリ
(1)をアクセスするアドレス発生回路(2)と、 プログラムメモリ(1)から読み出されたプログラムデ
ータを入力し、そのプログラムデータがブランチ命令以
外の命令であるときにはそのまま出力し、また、そのプ
ログラムデータがブランチ命令であるときにはクロック
信号が入力されるまでそのプログラムデータを出力しク
ロック信号に同期してノンオペレーション命令を出力す
るとともに、クロック信号が入力されるまで前記プログ
ラムカウンタ(3)の動作を停止させる付加回路(4)
と、 前記付加回路(4)から出力されたプログラムデータを
クロック信号に同期して順次保持して前記アドレス発生
回路(2)に出力するパイプラインレジスタ(5)とを
備えることを特徴とするプログラムアクセス装置。
1. A program memory (1) in which 1-word program data composed of an operation code section and an operand section is sequentially read every time address data is input, and a next address based on the input program data. An address generation circuit (2) including a program counter (3) for holding data in synchronization with a clock signal, and accessing the program memory (1) based on address data held in the program counter (3); When the program data read from the memory (1) is input, and the program data is an instruction other than a branch instruction, the program data is output as it is. When the program data is a branch instruction, the program data is output until a clock signal is input. Outputs program data and clock signal Outputs the non-op in synchronization, additional circuit for stopping the operation of said program counter (3) until the clock signal is inputted (4)
And a pipeline register (5) which sequentially holds the program data output from the additional circuit (4) in synchronization with a clock signal and outputs the program data to the address generation circuit (2). Access device.
JP5157792A 1992-03-10 1992-03-10 Program access device Withdrawn JPH05257685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5157792A JPH05257685A (en) 1992-03-10 1992-03-10 Program access device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5157792A JPH05257685A (en) 1992-03-10 1992-03-10 Program access device

Publications (1)

Publication Number Publication Date
JPH05257685A true JPH05257685A (en) 1993-10-08

Family

ID=12890801

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5157792A Withdrawn JPH05257685A (en) 1992-03-10 1992-03-10 Program access device

Country Status (1)

Country Link
JP (1) JPH05257685A (en)

Similar Documents

Publication Publication Date Title
JP2559868B2 (en) Information processing device
JP2752076B2 (en) Programmable controller
JPH05257685A (en) Program access device
JP3098409B2 (en) Apparatus or method for processing instructions in real time
JPH02235289A (en) Self clocking resister file
JPH0831033B2 (en) Data processing device
JP2530873B2 (en) Instruction prefetch address update circuit
JPH0619700B2 (en) Arithmetic unit
JPH01273132A (en) Microprocessor
JPH07262002A (en) Logic circuit
JP2721610B2 (en) Programmable controller
KR940006816B1 (en) Circuit for enhancement of processing speed for plc system
JP2001100991A (en) Digital signal processor
JPH0652044A (en) Microprocessor
JPH06103152A (en) Central processing unit
JPS6086625A (en) Data processing device
JPH06267264A (en) Fifo memory controller
JPH05250156A (en) Risc processor
JPH01263750A (en) Single chip microcomputer
JPH04329436A (en) Central processing unit
JPS59168548A (en) Program execution delaying device
JPS61161509A (en) System and device for operating high speed sequence
JPH05334078A (en) Address generation circuit
JPH0287254A (en) External memory access system
JPH038044A (en) Timer control method for multiprocessor system

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990518