JPS6267639A - System and circuit for controlling data flow subroutine - Google Patents

System and circuit for controlling data flow subroutine

Info

Publication number
JPS6267639A
JPS6267639A JP20841385A JP20841385A JPS6267639A JP S6267639 A JPS6267639 A JP S6267639A JP 20841385 A JP20841385 A JP 20841385A JP 20841385 A JP20841385 A JP 20841385A JP S6267639 A JPS6267639 A JP S6267639A
Authority
JP
Japan
Prior art keywords
address
subroutine
data
link
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP20841385A
Other languages
Japanese (ja)
Inventor
Hiroko Midorikawa
緑川 博子
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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP20841385A priority Critical patent/JPS6267639A/en
Publication of JPS6267639A publication Critical patent/JPS6267639A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Abstract

PURPOSE:To give program flexibility by defining a part of contents of a table memory, where data destination addresses and instructions are stored, as a subroutine processing to control the data flow. CONSTITUTION:A subroutine start base address C1, an offset OF indicating the position of the corresponding parameter of a subroutine, a subroutine return base address a1, and an address R1 for referring to a memory 2 are stored in a table memory 1. The address a1 is temporarily stored in the memory 2. The input token to the memory 1 has the address a1 stored temporarily in the area of the memory 2 referred by the address R1, and the address C1 obtained by referring to the memory 1 and the offset OF are added and the resultant address is sent together with a data part. The memory 1 is referred to read out the address R1, and the address a1 in the memory 2 is read out and is added to the offset OF in the memory 1, and the resultant address is outputted. Thus, the program flexibility is given.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はデータフロー処理装置に関し、詳しくはサブル
ーチン処理に関するものである。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a data flow processing device, and more particularly to subroutine processing.

(従来技術とその問題点) 従来、サブルーチン処理のための回路を備えたデータフ
ロー処理装置はなかった。たとえばイメージパイプライ
ンプロセッサ(日本電気製Pp−D7281)、あるい
は特開昭58−70360号公報”データフロー処理装
置″では、サブルーチンコールサブルーチンリターンと
いった命令はないため、5AVE命令などを代わりに用
いている。これはユーザがあらかじめサブルーチンの戻
り番地をアセンブル時に絶対番地で固定としておく必要
があり、プログラム作成の上で繁雑であり、プログラム
変更時にも柔軟性がなかった。また、サブルーチンの入
出力パラメタの数だけそれぞれの対応する番地を定める
必要があった。
(Prior Art and its Problems) Conventionally, there has been no data flow processing device equipped with a circuit for subroutine processing. For example, in the image pipeline processor (NEC Pp-D7281) or the "Data Flow Processing Device" disclosed in Japanese Patent Application Laid-open No. 58-70360, there is no instruction such as subroutine call subroutine return, so instructions such as 5AVE are used instead. . This requires the user to fix the return address of the subroutine in advance as an absolute address when assembling, which is complicated when creating a program, and there is no flexibility when changing the program. In addition, it was necessary to determine the corresponding addresses for each input/output parameter of the subroutine.

(発明の目的) 本発明の目的は、前述の様なデータフロー処理装置にお
いて、サブルーチンの入出力パラメタを設定する繁雑さ
を省き、プログラム開発を容易にし、プログラムの柔軟
性を高め、さらにサブルーチンを用いることによりプロ
グラムサイズを小さくするためのサブルーチン制御方式
及び回路を提供することである。
(Objective of the Invention) An object of the present invention is to eliminate the complexity of setting input/output parameters of subroutines in a data flow processing device as described above, facilitate program development, improve program flexibility, and further improve the flexibility of subroutines. An object of the present invention is to provide a subroutine control method and circuit that can be used to reduce program size.

(発明の構成) 本発明の第1の発明によればデータの行き先アドレスと
、命令が格納されたテーブルメモリを備え、アドレス値
とデータ値とを組にしたトークンを入力し、前記アドレ
スで前記テーブルメモリを参照し、前記テーブルメモリ
内の命令に従い、データを処理し、これにより生じた新
しいデータと前記テーブルメモリ中の行き先アドレスと
を組にして新しいトークンを生成し、さらに前記テーブ
ルメモリを参照する一連の処理を繰り返すことにより、
データ処理を行うデータフロー処理装置におけるサブル
ーチン制御方式において、テーブルメモリ中の一部分を
サブルーチン処理として定義し、サブルーチンコール命
令の格納された前記テーブルメモリを参照したトークン
は、行き先アドレスを、前記サブルーチンのスタートベ
ースアドレスと前記トークンがサブルーチンの何番目の
入力パラメタに対応するかによるオフセットを加えたア
ドレスに付け替えて新しいトークンを生成し、前記テー
ブルメモリにあらかじめ格納されたアドレスをサブルー
チンリターンベースアドレスとして蓄えておき、またサ
ブルーチンリターン命令が格納された前記テーブルメモ
リを参照したトークンは、行き先アドレスを、前記蓄え
られたサブルーチンリターンベースアドレスに、前記ト
ークンが前記サブルーチン処理の何番目の出力パラメタ
に対応するかによるオフセットを加えたアドレスに付け
替えて、新tいトークンを生成することにより、サブル
ーチンコール、リターンの制御、及び入出力データの受
け渡しを行うデータフローサブルーチン制御方式が得ら
れる。本発明の第2の発明によれば、データ行き先アド
レス値であるリンクアドレスとデータ値を入力とし、前
記リンクアドレスによって参照され、次のデータの行き
先アドレス値と命令格納番地を示すファンクジョンアド
レスとを蓄えたリンクテーブルと前記ファンクションア
ドレスによって参照され命令コード、サブルーチンスタ
ードア・ドレス、リターンレジスタナンバを蓄えたファ
ンクションテーブルと、前記ファンクションテーブル中
の命令コードをデコードするデコーダと前記ファンクシ
ョンテーブル中のリターンレジスタナンバで参照され、
サブルーチンリターンアドレスを格納しておくリターン
レジスタと、前記入力中のリンクアドレスと前記リター
ンレジスタ中のサブルーチンリターンアドレスを加算す
る加算器と、前記ファンクションテーブル中のサブルー
チンスタートアドレスと前記リンクアドレスを加算する
加算器と、前記リンクアドレス、前記2つの加算器の出
力から、前記デコーダの出力によって、1つを選択する
アルチプレクサとを含み、サブルーチン処理を行う際に
前記リンクアドレスの付け替えや、サブルーチンリター
ンベースアドレスの格納入出力ハラメタの受け渡しを行
うサブルーチン制御回路が得られる。
(Structure of the Invention) According to the first aspect of the present invention, a table memory is provided in which a data destination address and an instruction are stored, and a token that is a set of an address value and a data value is input, and the Refers to the table memory, processes the data according to the instructions in the table memory, generates a new token by pairing the resulting new data with the destination address in the table memory, and further refers to the table memory. By repeating a series of processes,
In a subroutine control system in a data flow processing device that performs data processing, a part of a table memory is defined as subroutine processing, and a token that refers to the table memory in which a subroutine call instruction is stored sets the destination address to the start of the subroutine. A new token is generated by replacing the base address with an address that adds an offset depending on which input parameter of the subroutine the token corresponds to, and the address previously stored in the table memory is stored as the subroutine return base address. , and the token that referred to the table memory in which the subroutine return instruction was stored sets the destination address to the stored subroutine return base address and an offset according to which output parameter of the subroutine processing the token corresponds to. A data flow subroutine control system that controls subroutine calls, returns, and transfers input/output data can be obtained by replacing the address with an address added by t and generating a new token. According to the second aspect of the present invention, a link address and a data value that are data destination address values are input, and a function address that is referenced by the link address and indicates the destination address value and instruction storage address of the next data. a link table that stores the instruction code, a subroutine start address, and a return register number referenced by the function address, a decoder that decodes the instruction code in the function table, and a return register in the function table. Referenced by number,
a return register for storing a subroutine return address; an adder for adding the input link address and the subroutine return address in the return register; and an adder for adding the subroutine start address in the function table and the link address. and an multiplexer that selects one from the link address and the output of the two adders according to the output of the decoder, and is used to change the link address when performing subroutine processing and to change the subroutine return base address. A subroutine control circuit for exchanging storage input/output parameters is obtained.

(実施例) 第1図は本発明の第1の発明の実施例を示すブロック図
である。同図(a)はデータの行先アドレスと命令が格
納されたテーブルメモリの一部分をサブルーチンとして
定義したときのサブルーチンコール命令を実行する場合
を示し、同図(b)はサブルーチンリターン命令を実行
する場合を示す。
(Embodiment) FIG. 1 is a block diagram showing an embodiment of the first invention of the present invention. Figure (a) shows the case where a subroutine call instruction is executed when a part of the table memory where data destination addresses and instructions are stored is defined as a subroutine, and figure (b) shows the case where a subroutine return instruction is executed. shows.

第1図(a)においてテーブルメモリ■にはサブルーチ
ン開始ベースアドレスC1、サブルーチンの何番目のパ
ラメタに対応するかを示すオフセ、ントOF、サブルー
チンリターンベースアドレスa1、メモリ■を参照する
ためのアドレスR1から成る。メモリ■はサブルーチン
リターンベースアドレスを一時格納するためのメモリで
ある。同図(a)を用いサブルーチンコール時の制御方
式について説明する。
In FIG. 1(a), the table memory ■ contains a subroutine start base address C1, an offset point OF indicating which parameter of the subroutine corresponds to, a subroutine return base address a1, and an address R1 for referring to the memory ■. Consists of. Memory ■ is a memory for temporarily storing a subroutine return base address. The control method at the time of a subroutine call will be explained using FIG.

メモリ■への入カドークンはデータ部(図示せず)とメ
モリ参照アドレスから成る。メモリ参照アドレスにより
メモリ■を参照することにより、サブルーチンリターン
ベースアドレスa1、すなわちデータの行き先アドレス
を、アドレスR1で参照されるメモリ■の領域に一時格
納し、同じくテーブルメモリ■を参照して得られるサブ
ルーチン開始ベースアドレスC1とオフセットOFを加
算し、これをデータの行き先アドレスとして入カドーク
ンのデータ部と共に送り出す。これにより、サブルーチ
ンコールではデータの行き先アドレスa1が、サブルー
チン内のパラメタ入力アドレス(CI+F)へ付け替え
られ、元の行き先アドレス(サブルーチンリターンベー
スアドレスal)はサブルーチン終了時のサブルーチン
リターンベースアドレスとしてメモリ■へ一時格納して
おく。
The input to memory 2 consists of a data section (not shown) and a memory reference address. By referring to the memory ■ using the memory reference address, the subroutine return base address a1, that is, the data destination address, is temporarily stored in the area of the memory ■ referred to by the address R1, which can also be obtained by referring to the table memory ■. Add the subroutine start base address C1 and the offset OF, and send this as the data destination address together with the data part of the input card. As a result, in the subroutine call, the data destination address a1 is replaced with the parameter input address (CI+F) within the subroutine, and the original destination address (subroutine return base address al) is stored in memory as the subroutine return base address at the end of the subroutine. Store it temporarily.

次に、第1図の(b)を用いてサブルーチンリターン時
の制御方式について説明する。同図(a)と同じく入カ
ドークンのアドレス部でテーブルメモリ■を参照しこの
中のメモリ■のアドレスR1を読み出し、メモリ■中の
サブルーチンリターンアドレスを読み出し、テーブルメ
モリ■中のオフセットOFと加算し、データの行き先ア
ドレスとして、入カドークンのデータ部と共に送り出す
Next, the control method at the time of subroutine return will be explained using FIG. 1(b). In the same way as in the same figure (a), refer to the table memory ■ in the address field of the input card, read out the address R1 of the memory ■ in this, read the subroutine return address in the memory ■, and add it to the offset OF in the table memory ■. , as the destination address of the data, along with the data part of the input card.

以上サブルーチンコールとサブルーチンリターンの方式
について説明した。テーブルメモリ■は命令、データ行
き先アドレスを格納していることからデータフロー処理
装置におけるプログラムともいうべき性質のものを格納
しており、この中のデータ行き先アドレスをつけ替える
ことによりサブルーチン制御が可能となる。第2図は本
発明の第二の発明の実施例を示すブロック図である。実
施例の構成要素は、データの行き先であるリンクドレス
99で参照され、次のデータの行き先アドレスと命令格
納番地を示すファンクションアドレスを蓄えたリンクテ
ーブル0と、リンクテーブル0中のファンクションアド
レス100を入力としファンクションアドレス101を
出力するラッチ71とファンクションアドレス101に
よって参照され、命令コード103、サブルーチンスタ
ートベースアドレス104、リターンレジスタナンバ1
05を蓄えたファンクションテーブル1とファンクショ
ンテーブル1の出力である命令コード103をデコード
するデコーダ2と、ファンクションテーブル1の出力、
リターンレジスタナンパ105で参照され、サブルーチ
ンリターンベースアドレス108を格納しておくリター
ンレジスタ3と、リンクアドレス102とファンクショ
ンテーブル1中のサブルーチンスタートベースアドレス
104を加算する加算器4と、リンクテーブル1からの
出力で、ラッチ71にラッチされたリンクアドレス10
2とリターンレジスタ3の出力であるサブルーチンリタ
ーンベースアドレス108を加算する加算器5と、デコ
ーダ2の出力信号107をもとに、加算器4の出力11
0、加真器5の出力109、リンクアドレス102、フ
ァンクションテーブル1の出力、サブルーチンスタート
ベースアドレス104の4つの信号から一つを選択する
マルチプレクサ6がある。ラッチ72は外部からのデー
タ113をラッチする。ラッチ116はマルチプレクサ
6の出力111とラッチ72の声力114をラッチして
、各々、次のデータの行き先アドレス(すなわち新しい
リンクアドレス)、データ値として外部へ信号116と
して出力される。第1図■のテーブルメモリに対応する
部分が第2図中のデータの行き先アドレスa1を蓄えた
リンクテーブルOと、サブルーチンスタートベースアド
レスC1,メモリ■参照アドレスR1を蓄えた、ファン
クションテーブル1の2つである。第1図の(a)、 
(b)両機能を1つのテーブルメモリで実現するためフ
ァンクションテーブル1には命令コードを加え、これを
デコードすることにより、サブルーチンコール、サブル
ーチンリターンの両命令が実行できるようにした。
The subroutine call and subroutine return methods have been explained above. Since the table memory ■ stores instructions and data destination addresses, it stores something that can be called a program for a data flow processing device, and subroutine control is possible by changing the data destination addresses in this memory. Become. FIG. 2 is a block diagram showing a second embodiment of the present invention. The components of the embodiment include a link table 0 that is referenced by a link address 99, which is the destination of data, and stores a function address indicating the destination address of the next data and an instruction storage address, and a function address 100 in the link table 0. Referenced by the latch 71 that outputs the function address 101 as input and the function address 101, the instruction code 103, subroutine start base address 104, return register number 1
05, a decoder 2 that decodes the instruction code 103 that is the output of the function table 1, and the output of the function table 1.
A return register 3 that is referenced by the return register pick-up 105 and stores a subroutine return base address 108; an adder 4 that adds the link address 102 and the subroutine start base address 104 in the function table 1; At the output, link address 10 latched in latch 71
2 and the subroutine return base address 108 which is the output of the return register 3, and the output 11 of the adder 4 based on the output signal 107 of the decoder 2.
There is a multiplexer 6 for selecting one from four signals: 0, the output 109 of the booster 5, the link address 102, the output of the function table 1, and the subroutine start base address 104. Latch 72 latches data 113 from the outside. The latch 116 latches the output 111 of the multiplexer 6 and the output 114 of the latch 72, and outputs the destination address of the next data (ie, new link address) and data value to the outside as a signal 116, respectively. The parts corresponding to the table memory in FIG. 1 are the link table O that stores the data destination address a1 in FIG. It is one. (a) in Figure 1,
(b) In order to realize both functions with one table memory, an instruction code is added to the function table 1, and by decoding it, both subroutine call and subroutine return instructions can be executed.

第2図には、このためデコーダ2がある。また、リンク
テーブルOにはファンクションテーブル1を参照するた
めのアドレスをあらたに加えた。第1図のメモリ■に対
応する部分は第2図中リターンレジスタ3に対応してい
る。また第1図の加算部に対応するものが第2図の加算
S4,5である。
In FIG. 2 there is a decoder 2 for this purpose. Additionally, an address for referencing function table 1 was newly added to link table O. The portion corresponding to memory 3 in FIG. 1 corresponds to return register 3 in FIG. Also, additions S4 and S5 in FIG. 2 correspond to the addition section in FIG. 1.

次に第2図について第6図のタイミングチャート、第7
図のデコーダ2の入出力論理表を用いて詳しく説明する
。外部からリンクテーブル1を参照するためのアドレス
値とデータ値99を入力とし、リンクテーブルOを参照
することにより、次のデータの行き先アドレス、すなわ
ち新しいリンクアドレスと次のテーブルメモリ、すなわ
ちファンクションテーブル1を参照するためのファンク
ションアドレスを得る。
Next, regarding Fig. 2, the timing chart of Fig. 6, and the timing chart of Fig. 7.
This will be explained in detail using the input/output logic table of the decoder 2 shown in the figure. By inputting the address value and data value 99 for referring to link table 1 from the outside and referring to link table O, the destination address of the next data, that is, the new link address, and the next table memory, that is, function table 1 are obtained. Get the function address to refer to.

外部からリンクアドレス99によりリンクテーブル0が
参照され、ファンクションアドレス、次のデータ行き先
である100が出力される。クロック201の立ち上が
りで、第2図のラッチ71へ入力データ100が入力さ
れ、ファンクションテーブル1を入力データ中のファン
クションアドレス101で参照し、命令コード103、
サブルーチンスタートベースアドレス104、リターン
レジスタナンバ105が読み出される。この命令コード
103と入力ラッチ中の制御ビット112からデコーダ
2はマルチプレクサ6への選択信号107とリターンレ
ジスタ3へのリードライト信号115を出力する。リー
ドライト信号115は1′のときリード゛0゛のときラ
イトである。デコーダ2の入力命令コード103がサブ
ルーチンジャンプ(GO8UB)で制御ビット112が
1′のときは、選択信号107は01′、リードライト
信号115はリード゛1′である。制御ビット112が
ゞO′のときは、選択信号107+t’00′、リード
ライト信号115は不定である。命令コード103がサ
ブルーチンリターン(RTNSUB)のときは制御ビッ
ト112にかかわりなく選択信号107は11′、リー
ドライト信号115はライト信号゛0′である。これ以
外の命令コードの場合は選択信号107は10′である
。マルチプレクサ6は、選択信号107のゞOO’、 
’01’。
Link table 0 is referenced from the outside using link address 99, and a function address and 100, which is the next data destination, are output. At the rising edge of the clock 201, the input data 100 is input to the latch 71 in FIG.
The subroutine start base address 104 and return register number 105 are read. From this instruction code 103 and the control bit 112 in the input latch, the decoder 2 outputs a selection signal 107 to the multiplexer 6 and a read/write signal 115 to the return register 3. When the read/write signal 115 is 1', it is read and when it is 0, it is write. When the input instruction code 103 of the decoder 2 is a subroutine jump (GO8UB) and the control bit 112 is 1', the selection signal 107 is 01' and the read/write signal 115 is read '1'. When the control bit 112 is O', the selection signal 107+t'00' and the read/write signal 115 are undefined. When the instruction code 103 is a subroutine return (RTNSUB), the selection signal 107 is 11' and the read/write signal 115 is a write signal "0" regardless of the control bit 112. For other instruction codes, the selection signal 107 is 10'. The multiplexer 6 selects the selection signals 107 ゞOO',
'01'.

′1σ、゛11”に応じ、信号110.104.108
.109を選択する。選択されたリンクアドレス111
は入力されラッチ72を経て得られデータ114と共に
出力ラッチ73にラッチされ出力データ116として外
部へ出力される。本回路は、2つのクロック201.2
02よりパイプライン的に制御され、入力ラッチ71.
72、出力ラッチ73はタロツク201に同期して動く
According to '1σ, '11', signal 110.104.108
.. Select 109. Selected link address 111
is inputted and obtained through the latch 72, latched together with the data 114 in the output latch 73, and outputted to the outside as output data 116. This circuit uses two clocks 201.2
02 in a pipeline manner, and input latches 71.
72, the output latch 73 moves in synchronization with the tarlock 201.

次に実際に、データフロータイブのプログラムでのサブ
ルーチンの記述とどう対応するか説明する。本方式をイ
メージパイプラインプロセッサ(日本電気ppD728
1)のファンクションテーブル部、あるいは特開昭58
−70360公報のパラメタテーブル部(同公報第2図
23)に、組み込んだ場合の処理について説明する。第
5図にイメージパイプラインプロセッサのブロック図を
示す。イメージパイプラインプロセッサ(以下lmPP
という)では、リンクテーブルLT22(第2図0に対
応)にデータの次の行き先を示すリンクアドレスID’
  と(第2図102に対応)命令格納番地を示すファ
ンクションアドレスPTA(第2図101に対応)と制
御ビットSが格納されている。ファンクションテーブル
FT23には命令コードがはいっている。外部からのデ
ータとリンクアドレスIDをもったトークンが入力され
ると、インプットコントローラIC21を通り、リンク
アドレスIDでリンクテーブルLT22を参照し、次の
リンクアドレスID’  とファンクションアドレスP
TAを得て、次にファンクションアドレスPTAでファ
ンクションテーブルFT23を参照する。ここで命令コ
ードを得て、命令コードに応じた処理を、データメモリ
DM24、プロセッシングユニットPU26で行う。プ
ロセッシングユニットPU26がビジーのとき一時デー
タはキューQ25に蓄えられる。プロセッシングユニツ
) PU26で処理が終了すると、先に得たリンクアド
レスID’ で、さらにリンクテーブルLT22を参照
し、以下これを繰り返す。ファンクションテーブルFT
23の命令が出力命令のときは、キューQ25からアウ
トプットキュー0Q27を通り、アウトプットコントロ
ーラ0C28を経て外部へ出力される。外部に出力がで
きないときは、一時、アウトプットキュー0Q27に蓄
えられる。
Next, we will explain how this corresponds to the description of subroutines in data flow type programs. This method is applied to an image pipeline processor (NEC ppD728
1) function table section or JP-A-58
The processing when incorporated into the parameter table section of Publication No. 70360 (FIG. 23 of the Publication) will be explained. FIG. 5 shows a block diagram of the image pipeline processor. Image pipeline processor (lmPP)
), the link address ID' indicating the next destination of the data is stored in the link table LT22 (corresponding to 0 in FIG. 2).
(corresponding to 102 in FIG. 2), a function address PTA (corresponding to 101 in FIG. 2) indicating an instruction storage address, and a control bit S are stored. Function table FT23 contains instruction codes. When external data and a token with a link address ID are input, it passes through the input controller IC 21, refers to the link table LT 22 with the link address ID, and obtains the next link address ID' and function address P.
After obtaining TA, the function table FT23 is referred to using the function address PTA. An instruction code is obtained here, and processing according to the instruction code is performed in the data memory DM24 and the processing unit PU26. When processing unit PU26 is busy, temporary data is stored in queue Q25. When the processing is completed in the PU 26, the link table LT 22 is further referred to using the previously obtained link address ID', and this process is repeated. Function table FT
When the instruction No. 23 is an output instruction, the instruction is output from the queue Q25 to the outside through the output queue 0Q27 and the output controller 0C28. When the data cannot be output to the outside, it is temporarily stored in the output queue 0Q27.

したがって、この様なデータプロータイプのプロセッサ
でのサブルーチン制御とは、ファンクションテーブルF
T23にサブルーチンの処理部分に対応する命令コード
を蓄え、サブルーチンコール時にそのFT部を参照する
様にリンクアドレスIDをかきかえ、サブルーチンリタ
ーン時にコール前にもともとつけられていたリンクアド
レスIDに戻してやることが必要となる。このため本実
施例ではリターン時のリンクアドレスを一時格納するリ
ターンレジスタ(第2図3)を用いている。またサブル
ーチンへの複数の入力データは、それぞれの対応するサ
ブルーチンの入口を示すリンクアドレスにかきかえる必
要がある。これらはサブルーチンの先頭アドレスから順
に連続したリンクアドレスで入力されることとし、あら
かじめ、何番目の入力データに対応するかリンクテーブ
ルLTに蓄えられている。次に実際のリンクテーブルフ
ァンクションテーブルの様子をlmPPアセンブラの記
述と対応づけて説明する。
Therefore, subroutine control in such a data-flow type processor is based on the function table F.
Store the instruction code corresponding to the processing part of the subroutine in T23, change the link address ID so that the FT part is referenced when the subroutine is called, and return it to the link address ID that was originally attached before the call when the subroutine returns. Is required. For this reason, this embodiment uses a return register (FIG. 2, 3) that temporarily stores the link address at the time of return. Furthermore, it is necessary to replace multiple pieces of input data to a subroutine with link addresses indicating the entrances of the respective corresponding subroutines. These are input as consecutive link addresses in order from the start address of the subroutine, and the corresponding input data is stored in advance in the link table LT. Next, the state of the actual link table function table will be explained in association with the description of the lmPP assembler.

第3図はメインプログラムのからサブルーチン■を呼ぶ
アセンブラ記述を示している。すべて関数型記述となっ
ており、LINK文からはリンクテーブル、FUNCT
ION文からファンクションテーブルの内容が生成され
る。各テーブルに生成された内容をテンプレートと呼ぶ
。サブルーチンSはメインプログラム中のbl、 b2
. b3を入力として、al、 a2. a3を出力す
るプログラムである。サブルーチンの記述では仮引数と
してそれぞれ入力にcl、 c2. c3、出力el、
 e2. e3を用いている。第3図の様なアセンブラ
記述をすることにより、第4図に示す様なテンプレート
が生成される。すなわちサブルーチンSを呼ぶ命令を記
述したLINK文■からID=al、S=1とID=1
゜S=0とID=2.S=0である様なテンプレートが
生成される。これは第4図中の■サブルーチンコール部
に対応する。これはサブルーチンの入力データのうち最
初にサブルーチンに入力するデータのテンプレートの次
の行先リンクアドレスをalとし、制御ビットS=1と
する。サブルーチンにあとから入力されるデータのテン
プレートの行き先リンクアドレスは、リンク■の、記述
類に1から順に番号をつける。第3図中のリンク文■に
示す様にサブルーチンSへの入力データがはいってくる
テンプレートは第4図中Oで示すサブルーチン入力部で
ある。同様に第3図中のリンク文■に対して生成された
テンプレートは第4図中■で示されるサブルーチン出力
部である。また第3図中のサブルーチンの出力テ゛−タ
を受けとる部分のリンク文■から、第4図中■で示され
るテンプレートが生成される。
FIG. 3 shows an assembler description that calls subroutine (2) from the main program. All are functional descriptions, and from the LINK statement, link table, FUNCT
The contents of the function table are generated from the ION statement. The content generated in each table is called a template. Subroutine S is bl, b2 in the main program.
.. With b3 as input, al, a2. This is a program that outputs a3. In the subroutine description, cl, c2. c3, output el,
e2. e3 is used. By writing the assembler description as shown in FIG. 3, a template as shown in FIG. 4 is generated. In other words, from the LINK statement ■ which describes the instruction to call subroutine S, ID=al, S=1 and ID=1
゜S=0 and ID=2. A template with S=0 is generated. This corresponds to the subroutine call part (2) in FIG. This sets the next destination link address of the template of the data first input to the subroutine among the input data of the subroutine to be al, and sets the control bit S=1. For the destination link address of the template for data that will be input later into the subroutine, the descriptions of link (2) are numbered sequentially starting from 1. The template into which the input data to the subroutine S is input, as shown by the link text ■ in FIG. 3, is the subroutine input section shown by O in FIG. Similarly, the template generated for the link statement ■ in FIG. 3 is the subroutine output portion shown by ■ in FIG. 4. Further, a template shown by ■ in FIG. 4 is generated from the link statement (■) in the part that receives the output data of the subroutine in FIG.

一方ファンクションテーブルには第4図に示す様にサブ
ルーチンの開始アドレスC1とサブルーチンにとぶ命令
(GO8UB)あるいはサブルーチンから戻る命令(R
TNSUB)を示す命令コード(OP)、またサブルー
チンの戻り番地を一時格納するリターンレジスタ番号(
RNO)を含んだテンプレートが生成される。
On the other hand, as shown in Figure 4, the function table contains the start address C1 of the subroutine and the command to jump to the subroutine (GO8UB) or the command to return from the subroutine (R
TNSUB), the instruction code (OP), and the return register number (OP) that temporarily stores the return address of the subroutine.
A template containing the RNO) is generated.

次に動作の概略を説明する。第4図の■で示される様に
サブルーチンの入力データ、すなわちリンクアドレスI
D =M、 b2. b3が付されたデータは、それぞ
れリンクテーブルをbl、 b2. b3のアドレスで
参照し、新しいリンクアドレスをIb’  =al、 
1.2制御アフラグを8=1.O,Oとして、ファンク
ションアドレスF1でファンクションテーブルを参照す
る。ファンクションテーブルでは、アドレスF1のファ
ンクションテーブル内には命令コードとしてサブルーチ
ンにとぶ命令GO8UBがはいっているので、制御ビッ
トSに応じて、次の処理を行う。S=1のときはファン
クションテーブルのリターンレジスタナンバ(RNO)
で示されるリターンレジスタにリンクテーブル内のリン
クアドレスal(戻りアドレス)を格納し、新しく、フ
ァンクションテーブル内のサブルーチン開始アドレスC
1をリンクアドレスとして付け替える。S=0のときは
リンクテーブル内のリンクアドレス(この場合は1また
は2)とサブルーチン開始アドレスC1を加算して、新
しいリンクアドレスとして付け替える。
Next, an outline of the operation will be explained. As shown by ■ in Figure 4, the input data of the subroutine, that is, the link address I
D=M, b2. Data with b3 are linked to link tables bl, b2. Refer to the address of b3 and set the new link address as Ib' = al,
1.2 Control Afrag 8=1. As O, O, refer to the function table using the function address F1. In the function table, the function table at address F1 contains an instruction GO8UB that jumps to a subroutine as an instruction code, so the next process is performed according to the control bit S. When S=1, return register number (RNO) of function table
The link address al (return address) in the link table is stored in the return register indicated by , and a new subroutine start address C in the function table is stored.
1 as the link address. When S=0, the subroutine start address C1 is added to the link address in the link table (1 or 2 in this case) and replaced as a new link address.

これによりサブルーチン入力データとしてリンクアドレ
スbl、 b2. b3が付されたデータは、リンクア
ドレスCI、C1+1.C1+2に付け替えられリター
ンレジスタにはalが格納される。サブルーチンの入力
データのリンクアドレスは前述した様に連続しているの
で01+1=02. C1+2=03であり、これによ
りリンクアドレスbl、 b2. b3にはいってきた
データはリンクアドレスCI、 C2,C3へはいるデ
ータに変わる。
As a result, link addresses bl, b2 . The data with b3 are the link addresses CI, C1+1 . It is replaced with C1+2 and al is stored in the return register. Since the link addresses of the subroutine input data are continuous as described above, 01+1=02. C1+2=03, so the link addresses bl, b2. The data that entered b3 changes to the data that enters link addresses CI, C2, and C3.

一方サブルーチンから戻る場合は第3図の■のリンク文
で表される様に、リンクアドレスel、 C2,C3が
付されたデータがリンクアドレスを参照する。リンクア
ドレスel、 C2,C3のリンクテーブルにはファン
クションアドレスFIOがはいっており、これを参照す
ると命令コードとしてRINSUBがはいっている。
On the other hand, when returning from the subroutine, the data to which link addresses el, C2, and C3 are attached refer to the link addresses, as shown by the link statement (■) in FIG. The link table for link addresses el, C2, and C3 contains a function address FIO, and when this is referenced, RINSUB is entered as an instruction code.

この場合はファンクションテーブルFIOにあるリター
ンレジスタナンバRNOでリターンレジスタ内の戻りリ
ンクアドレスを読み出し、リンクテーブル内のリンクア
ドレスと加算する。すなわち第4図の例ではリンクアド
レスel、 C2,C3が付されたデータはal+0.
 al+2. al+2のリンクアドレスに付け替えら
れる。サブルーチンの出力データの戻りリンクアドレス
も連続しているので、al + 1 =a2゜al +
 2 = C3であり、サブルーチンの出力データのリ
ンクアドレスel、 C2,C3が戻りリンクアドレス
al、 C2゜C3に変えられる。
In this case, the return link address in the return register is read out using the return register number RNO in the function table FIO, and is added to the link address in the link table. That is, in the example of FIG. 4, the data to which link addresses el, C2, and C3 are attached are al+0.
al+2. It is replaced with the link address of al+2. Since the return link addresses of the output data of the subroutine are also consecutive, al + 1 = a2゜al +
2 = C3, and the link addresses el, C2, C3 of the output data of the subroutine are changed to the return link addresses al, C2°C3.

(発明の効果) 本発明をデータフロー処理装置に組み込むことにより、
データフロープログラムにおいてのサブルーチンの使用
が容易になった。すなわちサブルーチンコール、リター
ン命令が設定でき、サブルーチンの開始アドレスを任意
に決定でき、サブルーチンの入出力データの受け渡しも
ユーザに負担をかけずに自動的に行える。これによりサ
ブルーチンを使用する際の従来のプログラム開発時の繁
雑さ、プログラム変更時の柔軟性のなさが解消され、サ
ブルーチンを用いることによりプログラムサイズも小さ
くなった。
(Effect of the invention) By incorporating the present invention into a data flow processing device,
Easier to use subroutines in dataflow programs. That is, subroutine calls and return instructions can be set, the start address of the subroutine can be determined arbitrarily, and input and output data of the subroutine can be exchanged automatically without any burden on the user. This eliminates the complexity of conventional program development and the lack of flexibility when changing programs when using subroutines, and the use of subroutines also reduces program size.

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

第1図(a)、(b)は本発明の基本的なブロック図で
、第2図は本発明の一実施例を示すブロック図、第3図
はデータフロー処理装置においてサブルーチンを用いた
プログラムを作成した場合のアセンブラ記述例を示す図
、第4図は第3図のアセンブラ記述から生成されたリン
クテーブルファンクションテーブルリターンアドレスの
内容を示す図、第5図は本発明を適用したデータフロー
型処理装置を示すブロック図、第6図は第2図のタイミ
ング信号図、第7図は第2図デコーダ2の論理入出力を
示す図である。図において■はテーブルメモリ、■はメ
モリ、Oはリンクテーブル、1はファンクションテーブ
ル、2はデコーダ、3はリターンレジスタ、4゜5は加
算器、6はマルチプレクサ、21はインプットコントロ
ーラ、22はリンクテーブル、23はファンクションテ
ーブル、24はデータメモリ、25はキュー、26はプ
ロセッシングユニット、27はアウトプットキュー、2
8はアウトプットコントローラ代理人弁理士 内 1f
jtJ:、ン・芋  Z  図
Figures 1 (a) and (b) are basic block diagrams of the present invention, Figure 2 is a block diagram showing an embodiment of the present invention, and Figure 3 is a program using subroutines in a data flow processing device. FIG. 4 is a diagram showing the contents of the link table function table return address generated from the assembler description in FIG. 3. FIG. 5 is a data flow type to which the present invention is applied. FIG. 6 is a block diagram showing the processing device, FIG. 6 is a timing signal diagram of FIG. 2, and FIG. 7 is a diagram showing logical input/output of the decoder 2 of FIG. In the figure, ■ is table memory, ■ is memory, O is link table, 1 is function table, 2 is decoder, 3 is return register, 4゜5 is adder, 6 is multiplexer, 21 is input controller, 22 is link table , 23 is a function table, 24 is a data memory, 25 is a queue, 26 is a processing unit, 27 is an output queue, 2
8 is the patent attorney representing the output controller, 1st floor
jtJ:, N-Imo Z Figure

Claims (2)

【特許請求の範囲】[Claims] (1)データの行き先アドレスと、命令が格納されたテ
ーブルメモリを備え、アドレス値とデータ値とを組にし
たトークンを入力し、前記アドレスで前記テーブルメモ
リを参照し、前記テーブルメモリ内の命令に従い、デー
タを処理し、これにより生じた新しいデータと前記テー
ブルメモリ中の行き先アドレスとを組にして新しいトー
クンを生成し、さらに前記テーブルメモリを参照する一
連の処理を繰り返すことにより、データ処理を行うデー
タフロー処理装置におけるサブルーチン制御方式におい
て、テーブルメモリ中の一部分をサブルーチン処理とし
て定義し、サブルーチンコール命令の格納された前記テ
ーブルメモリを参照したトークンは、その行き先アドレ
スを、前記サブルーチンのスタートベースアドレスと前
記トークンが、前記サブルーチンの何番目の入力パラメ
タに対応するかによるオフセットを加えたアドレスに付
け替えて新しいトークンを生成し、前記テーブルメモリ
にあらかじめ格納されたアドレスをサブルーチンリター
ンベースアドレスとして蓄えておき、またサブルーチン
リターン命令が格納された前記テーブルメモリを参照し
たトークンは、行き先アドレスを、前記蓄えられたサブ
ルーチンリターンベースアドレスに、前記トークンが前
記サブルーチン処理の何番目の出力パラメタに対応する
かによってオフセットを加えたアドレスに付け替えて、
新しいトークンを生成することにより、サブルーチンコ
ール、リターンの制御、及び入出力パラメタの受け渡し
を行うことを特徴とするデータフローサブルーチン制御
方式。
(1) A table memory in which a data destination address and an instruction are stored is provided, a token that is a pair of an address value and a data value is input, the table memory is referred to by the address, and the instruction in the table memory is Accordingly, data processing is performed by processing the data, generating a new token by pairing the resulting new data with the destination address in the table memory, and repeating a series of processes that refer to the table memory. In a subroutine control method in a data flow processing device, a part of a table memory is defined as subroutine processing, and a token that refers to the table memory in which a subroutine call instruction is stored sets its destination address to the start base address of the subroutine. and generates a new token by adding an offset depending on which input parameter of the subroutine the token corresponds to, and stores the address previously stored in the table memory as a subroutine return base address. , and the token that referred to the table memory in which the subroutine return instruction was stored offsets the destination address from the stored subroutine return base address according to which output parameter of the subroutine processing the token corresponds to. Replace the address with the addition of
A data flow subroutine control method characterized by controlling subroutine calls, returns, and passing input/output parameters by generating new tokens.
(2)データの行き先アドレス値であるリンクアドレス
とデータ値を入力とし、前記リンクアドレスによって参
照され、次のデータの行き先アドレス値と命令格納番地
を示すファンクションアドレスを蓄えたリンクテーブル
と、前記ファンクションアドレスによって参照され命令
コード、サブルーチンスタートアドレス、リターンレジ
スタナンバを蓄えたファンクションテーブルと、前記フ
ァンクションテーブル中の命令コードをデコードするデ
コーダと前記ファンクションテーブル中のリターンレジ
スタナンバで参照され、サブルーチンリターンベースア
ドレスを格納しておくリターンレジスタと、前記入力中
のリンクアドレスと前記リターンレジスタ中のサブルー
チンリターンベースアドレスを加算する加算器と、前記
ファンクションテーブル中のサブルーチンスタートベー
スアドレスと前記リンクアドレスを加算する加算器と、
前記リンクアドレスと、前記2つの加算器の出力から、
前記デコーダの出力によって、1つを選択するアルチプ
レクサとを含みサブルーチン処理を行う際に前記リンク
アドレスの付け替えや、サブルーチンリターンベースア
ドレスの格納、入出力パラメタの受け渡しを行うことを
特徴とするデータフローサブルーチン制御回路。
(2) A link table that receives a link address and a data value that are the destination address value of data, is referenced by the link address, and stores a function address that indicates the destination address value and instruction storage address of the next data, and the function A function table that is referenced by the address and stores instruction codes, subroutine start addresses, and return register numbers, a decoder that decodes the instruction code in the function table, and a subroutine return base address that is referenced by the return register number in the function table. a return register for storing; an adder for adding the input link address and the subroutine return base address in the return register; and an adder for adding the subroutine start base address in the function table and the link address. ,
From the link address and the outputs of the two adders,
The data flow subroutine includes an multiplexer that selects one based on the output of the decoder, and performs reassignment of the link address, storage of a subroutine return base address, and exchange of input/output parameters when performing subroutine processing. control circuit.
JP20841385A 1985-09-19 1985-09-19 System and circuit for controlling data flow subroutine Pending JPS6267639A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20841385A JPS6267639A (en) 1985-09-19 1985-09-19 System and circuit for controlling data flow subroutine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20841385A JPS6267639A (en) 1985-09-19 1985-09-19 System and circuit for controlling data flow subroutine

Publications (1)

Publication Number Publication Date
JPS6267639A true JPS6267639A (en) 1987-03-27

Family

ID=16555822

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20841385A Pending JPS6267639A (en) 1985-09-19 1985-09-19 System and circuit for controlling data flow subroutine

Country Status (1)

Country Link
JP (1) JPS6267639A (en)

Similar Documents

Publication Publication Date Title
US4616313A (en) High speed address calculation circuit for a pipeline-control-system data-processor
KR100227277B1 (en) Computer methods for writing a sclar value to a vector
US4633390A (en) Microprogram control system
US4598358A (en) Pipelined digital signal processor using a common data and control bus
US4674063A (en) Information processing apparatus having a sequence control function
JPS6267639A (en) System and circuit for controlling data flow subroutine
US5463747A (en) Microprogram data processor processing operand address calculation and instruction execution with common hardware
JPS6079431A (en) Programmable controller
JP2006134347A (en) Microcomputer
JPS58200349A (en) Microprogram controller
US5768554A (en) Central processing unit
JPS60157635A (en) Microprogram controller
KR950006585B1 (en) Micro program control apparatus and control method thereof
JP2851192B2 (en) Addition / subtraction processing method with carry in parallel processing unit
JPS6315333A (en) Microprogram sequence control system
JPH0682321B2 (en) Micro controller
JPH0157818B2 (en)
JPH052481A (en) Arithmetic control circuit
JPH0517574B2 (en)
JPS60110042A (en) Address generating circuit of program memory
JPH05265746A (en) Microprocessor
JPS62251930A (en) Information processor
JPH0290324A (en) Microprogram controller
JPS6146857B2 (en)
JPS62157944A (en) Microprogram control device