JP4859176B2 - Microprocessor and I / O port replacement method - Google Patents
Microprocessor and I / O port replacement method Download PDFInfo
- Publication number
- JP4859176B2 JP4859176B2 JP2005240194A JP2005240194A JP4859176B2 JP 4859176 B2 JP4859176 B2 JP 4859176B2 JP 2005240194 A JP2005240194 A JP 2005240194A JP 2005240194 A JP2005240194 A JP 2005240194A JP 4859176 B2 JP4859176 B2 JP 4859176B2
- Authority
- JP
- Japan
- Prior art keywords
- port
- register
- replacement
- permission
- map
- 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
Links
Images
Landscapes
- Executing Machine-Instructions (AREA)
- Microcomputers (AREA)
Description
本発明は、制御回路と、数値演算ユニットと、所定のレジスタと、I/Oポートとを含むマイクロプロセッサに関する。 The present invention relates to a microprocessor including a control circuit, a numerical operation unit, a predetermined register, and an I / O port.
一般に、プロセッサはI/Oポートを備え、I/Oポートにより外部との間でデータを入出力している。そして、I/Oポートによってデータを入出力する方式として、I/O専用命令を用いる方式と、I/Oポートをメモリ空間にマップして(メモリマップドI/O)メモリアクセス命令を用いる方式とがある。 Generally, a processor includes an I / O port, and data is input / output from / to the outside through the I / O port. As a method for inputting / outputting data through an I / O port, a method using an I / O dedicated instruction and a method using a memory access instruction by mapping an I / O port to a memory space (memory mapped I / O) There is.
ここで、I/O専用命令を用いる方式では、I/Oポートへの入出力を行う際にI/Oポートと汎用レジスタとの間でデータの転送を行う、I/O転送命令を用いるか、或いはI/Oポートの値を直接制御する、I/O直接制御命令を使用している。 Here, in the method using the I / O dedicated instruction, is the I / O transfer instruction used to transfer data between the I / O port and the general-purpose register when performing input / output to / from the I / O port? Alternatively, an I / O direct control command that directly controls the value of the I / O port is used.
例えば、ATMEL社のAT90S4414マイクロプロセッサでは、I/O転送命令として、I/Oポートから汎用レジスタへの転送を行うIN命令と、汎用レジスタからI/Oポートへの転送を行うOUT命令が用意されている。 For example, the ATEL AT90S4414 microprocessor is provided with an IN instruction that transfers from the I / O port to the general-purpose register and an OUT instruction that transfers from the general-purpose register to the I / O port as I / O transfer instructions. ing.
また、I/O直接制御命令として、I/Oポートのビット値に応じて次命令をスキップするSBIC/SBIS命令、I/Oポートのビット値を直接「1」又は「0」にするSBI/CBI命令が用意されている。 Also, as an I / O direct control instruction, an SBIC / SBIS instruction that skips the next instruction according to the bit value of the I / O port, and an SBI / S bit that directly sets the bit value of the I / O port to “1” or “0”. CBI instructions are available.
一方、メモリアクセス命令を用いる方式では、メモリ上の一部の領域をI/Oポートとして使用する。これを「メモリマップドI/O」と呼ぶ。このメモリマップドI/Oでは、I/Oをマップしたメモリアドレスに対してメモリアクセスを行うと、I/Oポートへの入出力が行われる。 On the other hand, in the method using the memory access instruction, a part of the area on the memory is used as an I / O port. This is referred to as “memory mapped I / O”. In this memory mapped I / O, when a memory access is performed to a memory address to which the I / O is mapped, input / output to the I / O port is performed.
例えば、Zilog社のZ80マイクロプロセッサでは、AND A,(HL)命令によりAレジスタとHLレジスタが示すメモリアドレスの内容とのAND演算が行われる。ここで、メモリアドレスの0xff00番地がI/Oポートにマップされており、HLレジスタが0xff00の場合にAND A,(HL)を実行すると、AレジスタとI/OポートをANDした結果がAレジスタに代入される。 For example, in the Z80 microprocessor of Zilog, an AND operation is performed on the contents of the memory address indicated by the A register and the HL register by an AND A, (HL) instruction. Here, when the memory address 0xff00 is mapped to the I / O port and the HL register is 0xff00 and AND A, (HL) is executed, the result of ANDing the A register and the I / O port is the A register. Is assigned to
この例に示すように、メモリマップドI/Oでは、メモリからの読み出しを行う命令をI/Oポートからの読み出しを行う命令として使用することができる。また同様に、メモリへの書き込みを行う命令をI/Oポートへの書き込みを行う命令として使用することができる。
しかしながら、上述したI/O専用命令を用いる方式では、プロセッサがI/Oポートによってデータを処理する場合、汎用レジスタのデータやフラグを処理するよりも、実行サイクル数が多くなる。例えば、I/O専用命令を持つATMEL社のAT90S4414マイクロプロセッサでは、汎用レジスタ間で加算を行うADD命令が用意されているが、I/Oポートについては用意されていない。このため、I/O転送命令を用いて、一旦汎用レジスタへ転送を行う必要があり、汎用レジスタの演算命令に比べてI/O転送命令を実行する分、実行サイクル数が多くなる。 However, in the method using the I / O dedicated instruction described above, when the processor processes data through the I / O port, the number of execution cycles is larger than when processing data and flags in the general-purpose register. For example, an ATEL AT90S4414 microprocessor having an I / O dedicated instruction provides an ADD instruction for performing addition between general-purpose registers, but does not provide an I / O port. For this reason, it is necessary to once transfer to the general-purpose register using the I / O transfer instruction, and the number of execution cycles is increased by executing the I / O transfer instruction as compared with the operation instruction of the general-purpose register.
また、マイクロプロセッサでは、データに応じて処理を変更しようとする場合、条件分岐命令を用いるが、I/Oポートに対する条件分岐命令は汎用レジスタやフラグに対する条件分岐命令が限られている。このため、一旦I/Oポートから汎用レジスタへと転送を行う必要があり、実行サイクル数が多くなる。 In the microprocessor, a conditional branch instruction is used when processing is changed according to data. However, conditional branch instructions for I / O ports are limited to general-purpose registers and conditional branch instructions. For this reason, it is necessary to transfer from the I / O port to the general-purpose register once, and the number of execution cycles increases.
一方、メモリマップドI/O方式でも、メモリ或いはキャッシュメモリへのアクセスは汎用レジスタへのアクセスよりも時間が掛かる。そのため、メモリアクセス命令を用いてI/Oポートへの入出力を行うと、汎用レジスタ間の演算命令よりも、実行サイクル数が増加してしまう。 On the other hand, even in the memory mapped I / O method, access to a memory or cache memory takes longer than access to a general-purpose register. Therefore, when input / output to / from the I / O port is performed using a memory access instruction, the number of execution cycles is increased as compared with an operation instruction between general-purpose registers.
このように、従来、プロセッサが処理を行う際に、入力データ又は出力データがI/Oポートにあると、入力データ又は出力データが汎用レジスタにあるよりも実行サイクル数が増える。特に、非常に短いサイクル数によりI/Oポートの入出力を含む処理が必要な場合、実行サイクル数を十分小さくすることができなかった。 Thus, conventionally, when the processor performs processing, if input data or output data is in the I / O port, the number of execution cycles is greater than if input data or output data is in the general-purpose register. In particular, when a process including input / output of an I / O port is required with a very short number of cycles, the number of execution cycles cannot be made sufficiently small.
また、特に非常に短いサイクル数によりI/Oポートへの入出力を含む割り込み処理が必要な場合にも、上述の場合と同様に、実行サイクル数を小さくすることができなかった。 Further, even when interrupt processing including input / output to / from an I / O port is required with a very short cycle number, the number of execution cycles cannot be reduced as in the case described above.
本発明は、上述の課題を解決するためになされたもので、プロセッサが非常に短い実行サイクル数でI/Oポートに対する所定の処理を実現できることを目的とする。 The present invention has been made to solve the above-described problems, and an object of the present invention is to enable a processor to realize predetermined processing for an I / O port with a very short number of execution cycles.
また、割り込み処理時にも、非常に短い実行サイクル数でI/Oポートに対する所定の処理を実現できることを目的とする。 It is another object of the present invention to realize predetermined processing for an I / O port with an extremely short number of execution cycles even during interrupt processing.
本発明は、レジスタと、I/Oポートとを含むマイクロプロセッサであって、前記I/Oポートが置き換えられる前記レジスタを指定する指定手段と、前記I/Oポートを前記指定手段で指定された前記レジスタに置き換えるか否かを許可する許可手段と、前記許可手段で許可された場合、前記I/Oポートを前記レジスタに置き換える置換手段と、前記置換手段によって前記I/Oポートを前記レジスタに置き換えた場合に、前記I/Oポートからデータを読み出して演算する演算手段とを有し、前記置換手段は、割り込み処理時と通常処理時とで異なる置き換えを行うことを特徴とする。 The present invention is a microprocessor including a register and an I / O port, the designation means for designating the register to which the I / O port is replaced, and the I / O port is designated by the designation means Permission means for permitting whether or not to replace with the register; replacement means for replacing the I / O port with the register when permitted by the permission means; and the I / O port with the register by the replacement means. when replaced, have a calculating means for calculating read data from the I / O ports, the replacement unit may perform different replaced by the interrupt processing time and normal processing.
また、本発明は、レジスタと、I/Oポートとを含むマイクロプロセッサにおけるI/Oポート置換方法であって、前記I/Oポートが置き換えられる前記レジスタを指定する指定工程と、前記I/Oポートを前記指定工程で指定された前記レジスタに置き換えるか否かを許可する許可工程と、前記許可工程で許可された場合、前記I/Oポートを前記レジスタに置き換える置換工程と、前記置換工程において前記I/Oポートが前記レジスタに置き換えられた場合に、前記I/Oポートからデータを読み出して演算する演算工程とを有し、前記置換工程においては、割り込み処理時と通常処理時とで異なる置き換えを行うことを特徴とする。 The present invention also relates to an I / O port replacement method in a microprocessor including a register and an I / O port, the designation step for designating the register in which the I / O port is replaced, and the I / O A permission step for permitting whether or not to replace a port with the register designated in the designation step; a substitution step for replacing the I / O port with the register when permitted in the permission step; and a substitution step if the I / O port is replaced in the register, the data is read from the I / O ports possess a calculating step of calculating, in the substitution step differs between the interrupt processing time and normal processing It is characterized by performing replacement .
本発明によれば、プロセッサの演算手段がI/Oポートのデータを読み出して処理する場合において、実行サイクル数を低減できる。 According to the present invention, the number of execution cycles can be reduced when the arithmetic means of the processor reads and processes the data of the I / O port .
また、割り込み処理時にも、非常に短い実行サイクル数でI/Oポートに対する所定の処理を実現することができる。 Also, during interrupt processing, predetermined processing for an I / O port can be realized with a very short number of execution cycles.
以下、図面を参照しながら発明を実施するための最良の形態について詳細に説明する。 The best mode for carrying out the invention will be described below in detail with reference to the drawings.
本実施形態は、プロセッサにおけるI/Oポートをメモリ上にマップするのではなく、数値演算などに用いられるレジスタやフラグにマップすることにより、プロセッサの実行サイクル数を減少させるものである。 In the present embodiment, the number of execution cycles of the processor is reduced by mapping the I / O port in the processor to a register or flag used for numerical operation or the like instead of mapping it to the memory.
図1は、本実施形態におけるI/Oポートを汎用レジスタにマップ可能なプロセッサの構成の一例を示す図である。図1に示すプロセッサは、従来のプロセッサと同様な構成のレジスタ間演算ブロックと、I/Oポート102と、本実施形態におけるI/Oポートを汎用レジスタにマップ可能にするI/Oポートマップブロックと、各種制御信号とで構成されている。
FIG. 1 is a diagram illustrating an example of a configuration of a processor capable of mapping an I / O port to a general-purpose register in the present embodiment. The processor shown in FIG. 1 has an arithmetic operation block between registers having the same configuration as that of a conventional processor, an I /
上述のレジスタ間演算ブロックは、レジスタファイル100と、フラグレジスタ101と、数値演算ユニット(ALU)108と、制御回路109とから構成されている。
The above-described inter-register operation block includes a
また、I/Oポートマップブロックは、レジスタ103、ビットレジスタ104、比較器105a、105b、判定器106a、106b、選択回路(マルチプレクサ)107a、107b、及びゲート110、111から構成されている。
The I / O port map block includes a
ここで、レジスタ103には、制御回路109からのI/Oポートマップレジスタ番号書き込み信号141によりI/Oポートを汎用レジスタにマップするためのI/Oポートマップレジスタ番号が書き込まれる。ビットレジスタ104には、制御回路109からのI/Oポートマップ有効ビット書き込み信号142によりI/Oポートマップ有効ビットが書き込まれる。比較器105a、105bは、レジスタ103からI/Oポートマップレジスタ番号と制御回路109からのオペランドレジスタ番号制御信号121a、121bとを比較する。判定器106a、106bは、I/Oポートマップ有効ビット104が「1」の場合に比較器105a、105bの結果を出力する。
Here, an I / O port map register number for mapping an I / O port to a general-purpose register is written in the
選択回路107a、107bは、I/Oポートマップ有効判定126a、126bに基づいてレジスタファイル100か、I/Oポート102かを選択し、オペランドレジスタを読み出す。ゲート110、111は、I/Oポートマップ有効判定126a、126bと制御回路109からのレジスタファイル書き込み制御信号120とに基づいてデータをレジスタファイル100か、I/Oポート102のどちらに書き込むかを選択する。
The
尚、ALU機能選択制御信号123、及びフラグ入力信号127の制御信号については、更に後述する。
The ALU function
ここで、説明を簡単にするために、レジスタファイル100には4つのレジスタR0〜R3が存在し、フラグレジスタ101には演算結果がゼロか否かを示すZビットと、演算時にキャリーが発生したか否かを示すCビットが存在するものとする。
Here, in order to simplify the explanation, the
まず、I/Oポートが汎用レジスタにマップされていない場合のプロセッサの動作を、命令にXOR R1, R3を指定した場合を例として説明する。この例では、I/Oポートが汎用レジスタにマップされていないことを示すI/Oポートマップ有効ビット104に「0」が格納されている。また、命令はXOR R1, R3であるので、制御回路109はレジスタファイル100のR1とR3を読み出すために、オペランドレジスタ番号制御信号121a、121bにそれぞれ「1」と「3」を出力する。また、XOR演算を行うためにALU機能選択制御信号123にXOR機能を示す値を出力する。更に、演算結果をレジスタファイル100に書き込むためにレジスタファイル書き込み制御信号120に「1」を出力する。
First, the operation of the processor when the I / O port is not mapped to the general-purpose register will be described as an example where XOR R1 and R3 are specified in the instruction. In this example, “0” is stored in the I / O port map
このとき、レジスタファイル100からオペランド1としてR1が読み出され、122aを介してI/Oポートマップ読み出し選択107aに入力される。また、R1と同様に、レジスタファイル100からオペランド2としてR3が読み出され、122bを介してI/Oポートマップ読み出し選択107bに入力される。
At this time, R1 is read as
I/Oポートマップ有効ビット104が「0」であるため、I/Oポートマップ判定回路を構成するI/Oポートマップ比較器105a、105bと、I/Oポートマップ有効判定106a、106bの出力信号126a、126bは共に「0」となる。このため、I/Oポートマップ読み出し選択107a、107bの出力信号137a、137bにはそれぞれ122a、122bから入力されたR1、R3が出力される。
Since the I / O port map
数値演算ユニット108は、出力信号137a、137bとして入力されたR1、R3に対してALU機能選択制御信号123で指定されたXOR演算を行い、演算結果124として出力する。ここで、フラグレジスタ101への出力125には、演算結果がゼロか否かに応じてZビットに「1」か「0」を出力する。この場合、出力125のCビットには常に「0」を出力する。
The
次に、演算結果124は、レジスタファイル書き込み制御信号120が「1」の場合、選択入力信号126aが「0」であればレジスタファイル100に書き込まれ、「1」であればI/Oポート102に書き込まれる。レジスタファイル書き込み制御信号120が「0」の場合、レジスタファイル100とI/Oポート102の何れにも書き込みは行われない。
Next, when the register file
命令XOR R1, R3の例では、レジスタファイル書き込み制御信号120が「1」となるが、オペランド1はI/Oポートにマップされていないため、選択入力信号126aが「0」となり、演算結果はレジスタファイル100に書き込まれる。レジスタファイル100のうち、書き込みが行われるレジスタはオペランドレジスタ番号制御信号121aで指定されるR1になる。また、数値演算ユニット108の出力125はフラグレジスタ101のZビットとCビットに記録される。このように、I/Oポートが汎用レジスタにマップされていない場合、命令XOR R1, R3が実行される。
In the example of the instruction XOR R1, R3, the register file
次に、I/Oポートが汎用レジスタにマップされている場合のプロセッサ動作を、I/Oポート102が汎用レジスタR1にマップされており、命令にXOR R1, R3を指定し、実際にXOR PA, R3が実行される場合を例として説明する。この例では、I/Oポート102が汎用レジスタR1にマップされているために、I/Oポートマップ有効ビット104はマップが有効であることを示す「1」が格納されている。また、I/Oポートマップレジスタ番号103はR1を示す「1」が格納されていることが最初の例と異なる。
Next, the processor operation when the I / O port is mapped to the general-purpose register, the I /
一方、命令は同じであるため、制御回路109が出力する信号は先の例と同じである。即ち、命令はXOR R1, R3であるので、制御回路109はレジスタファイル100のR1とR3を読み出すために、オペランドレジスタ番号制御信号121a、121bに「1」と「3」を出力する。また、XOR演算を行うためにALU機能選択制御信号123にXOR機能を示す値を出力する。更に、演算結果をレジスタファイル100に書き込むためにレジスタファイル書き込み制御信号120に「1」を出力する。
On the other hand, since the instructions are the same, the signal output from the
このとき、レジスタファイル100からオペランド1としてR1が読み出され、122aを介してI/Oポートマップ読み出し選択107aに入力される。また、R1と同様に、レジスタファイル100からオペランド2としてR3が読み出され、122bを介してI/Oポートマップ読み出し選択107bに入力される。
At this time, R1 is read as
I/Oポートマップ有効ビット104が「1」であるため、オペランドレジスタ番号制御信号121aと121bはそれぞれI/Oポートマップレジスタ番号103と比較したものが選択入力信号126aと126bとなる。この例では、オペランドレジスタ番号制御信号121a、121bはそれぞれ「1」、「3」、I/Oポートマップレジスタ番号103は「1」であるため、選択入力信号126a、126bはそれぞれ「1」、「0」となる。このため、I/Oポートマップ読み出し選択107a、107bの出力信号137aと137bにはPAとR3が出力される。
Since the I / O port map
数値演算ユニット108は、出力信号137a、137bとして入力されたPAとR3に対してALU機能選択制御信号123で指定されたXOR演算を行い、演算結果124として出力する。演算結果124は、レジスタファイル書き込み制御信号120が「1」、選択入力信号126aが「1」であるためI/Oポート102に書き込まれる。
The
このように、I/Oポート102が汎用レジスタR1にマップされている場合、命令にXOR R1, R3を指定すると、実際にはXOR PA, R3が実行される。これにより、I/Oポートを汎用レジスタにマップすることができる。
As described above, when the I /
次に、I/Oポートマップレジスタ番号103とI/Oポートマップ有効ビット104とをソフトウェアが書き換える手順を説明する。
Next, a procedure for software to rewrite the I / O port
まず、ソフトウェアがI/Oポートマップレジスタ番号103を書き換えることを指示すると、制御回路109はI/Oポートマップレジスタ番号書き込み信号141にI/Oポートをマップする汎用レジスタ番号と書き込み許可信号を出力する。これにより、I/Oポートマップレジスタ番号103が更新される。また、103と同様に、ソフトウェアがI/Oポートマップ有効ビット104を書き換えることを指示すると、制御回路109はI/Oポートマップレジスタ番号書き込み信号141にI/Oポートをマップ有効又は無効と書き込み許可信号を出力する。これにより、I/Oポートマップ有効番号104が更新される。このように、ソフトウェアからI/Oポートマップレジスタ番号103と、I/Oポートマップ有効ビット104とを書き換えることができる。
First, when the software instructs to rewrite the I / O port
図2は、I/Oポートをフラグレジスタにマップ可能なプロセッサの構成の一例を示す図である。図1と同様な機能を有するものには同一の符号を付し、その説明は省略する。図2に示すように、I/Oポートマップ有効ビット130の出力信号129に基づいて、選択回路131がフラグレジスタ101の出力信号128か、I/Oポート101のPAの何れかを選択して出力する。
FIG. 2 is a diagram illustrating an example of a configuration of a processor capable of mapping an I / O port to a flag register. Components having the same functions as those in FIG. 1 are denoted by the same reference numerals, and description thereof is omitted. As shown in FIG. 2, based on the
ここで、説明を簡単にするために、フラグレジスタ101は、図3に示すように、演算結果がゼロであるか否かを示すZビット201と、演算時にキャリーが発生したか否かを示すCビット202が存在するものとする。そして、Zビット201はビット1の位置に、Cビットはビット0の位置に設定されているものとする。
Here, for the sake of simplicity of explanation, as shown in FIG. 3, the
また、I/Oポートマップ有効ビット130は、図4に示すように、ビット毎にフラグレジスタ101を読み出すか、I/Oポート102の値を読み出すかを1ビット毎に指定する値が格納されている。図4に示す例では、フラグレジスタ101を読み出す場合には「0」が、I/Oポート102の値を読み出す場合には「1」がI/Oポートマップ有効ビット130に格納されているものとする。
In addition, as shown in FIG. 4, the I / O port map
まず、I/Oポート102がフラグレジスタ101にマップされていない場合のプロセッサの動作をBNZ命令(フラグのZビット=0なら分岐する)でZビットが0、Cビットが1、I/Oポート102が0x2の場合を例にして説明する。
First, the operation of the processor when the I /
BNZ命令を実行する際に、制御回路109からの制御信号としては、レジスタファイル書き込み制御信号120は0(レジスタファイルへの書き込みを行わない)、ALU機能選択信号123は入力Fをそのままフラグ出力125へ出力する。オペランドレジスタ番号制御信号121a、121bは任意の値である。また、フラグレジスタ101のZビット201は「0」、Cビット202は「1」であるので、フラグレジスタ101の出力128は0x1となる。そして、I/Oポート102がフラグレジスタ101にマップされていないため、I/Oマップレジスタ203、204は共に「0」となり、I/Oマップレジスタの出力129は0x0になる。
When the BNZ instruction is executed, as the control signal from the
ここで、選択回路131の選択信号129は0x0であるため、選択回路131の出力にはフラグレジスタの出力128が出力される。即ち、この例では、0x1が出力されている。従って、制御回路109のフラグの入力値は0x1で、Zビットに対応する1ビット目の値は「0」であるので、分岐は実行されることになる。
Here, since the
次に、I/Oポート102がフラグレジスタ101にマップされている場合のプロセッサの動作を説明する。BNZ命令(フラグのZビット=0なら分岐する)でZビットが0、Cビットが1、I/Oポート102が0x2(フラグのZビットにマップされる値は1)である。そして、I/Oマップレジスタは0x02(I/Oポート102のビット1をフラグのZビットにマップする)の場合を例にして説明する。
Next, the operation of the processor when the I /
BNZ命令を実行する際に、先のマップされていない場合の例と異なるのはI/Oポートマップ有効ビットの出力129が0x2となっている点で、制御回路109からの制御信号は、先の場合の例と同じである。
When executing the BNZ instruction, the difference from the previous unmapped example is that the
ここで、選択回路131の選択信号129は0x2であるため、選択回路131のZビットの出力にはI/Oポート102のPAのビット1が出力され、Cビットの出力にはフラグレジスタ101のCビットが出力される。この例では、PAのビット1は「1」であり、フラグレジスタ101のCビットは「1」であるので、選択回路131の出力131は0x3が出力される。従って、制御回路109のフラグの入力値は0x3で、Zビットに対応するビット1は「1」であるので、分岐は実行されないことになる。
Here, since the
このように、I/Oポート102のPAのビット1がフラグレジスタ101のZビットにマップされている時は、命令にBNZ命令を指定すると、実際にはPA[1]=0なら分岐する命令が実行される。また、I/Oマップレジスタの値によりI/Oポート102をフラグレジスタ101にマップするか否かを切り替えることが可能になる。
Thus, when
更に、図1に示した例と同様に、ソフトウェアがI/Oポートマップ有効ビット130を書き換えることを指示すると、制御回路109はI/Oポートマップレジスタ番号書き込み信号141にI/Oポートをマップ有効/無効と書き込み許可信号を出力する。これにより、I/Oポートマップ有効番号104が更新される。このように、ソフトウェアから、I/Oポートマップ有効ビット130を書き換えることができる。
Further, as in the example shown in FIG. 1, when the software instructs to rewrite the I / O port map
図5は、I/Oポートを汎用レジスタにマップ可能であると共に割り込み時にマップを切り替え可能なプロセッサの構成の一例を示す図である。尚、図5は、図1に示す構成に、割り込み時にマップを切り替え可能にする構成が付加されたものであるため、ここでは図1と異なる個所のみ説明する。 FIG. 5 is a diagram illustrating an example of a configuration of a processor that can map an I / O port to a general-purpose register and can switch a map at the time of an interrupt. Note that FIG. 5 is obtained by adding a configuration that can switch the map at the time of interruption to the configuration shown in FIG.
図5に示すように、制御回路109から出力される追加割り込み処理レベル信号301が追加されている。この割り込みレベル信号301は割り込み処理中の時に「1」、割り込み処理中ではない時に「0」となるものとする。また、図1に示すI/Oポートマップレジスタ番号103とI/Oポートマップ有効ビット104とが、割り込み処理レベル毎に用意され、I/Oポートマップレジスタ番号103a、103b、I/Oポートマップ有効ビット104a、104bとなっている。そして、割り込み処理レベル信号301により、I/Oポートマップレジスタ番号とI/Oポートマップ有効ビットとを切り替える選択回路302a、302bが追加されている。
As shown in FIG. 5, an additional interrupt
尚、I/Oポートマップレジスタ番号書き込み信号141は、I/Oポートマップレジスタ番号103aと103bの何れかを指定して書き込みを行うものとする。また同様に、I/Oポートマップ有効ビット書き込み信号142もI/Oポートマップ有効ビット104a、104bの何れかを指定して書き込みを行うものとする。
The I / O port map register
図5において、割り込み処理レベル信号301が「0」の場合は、選択回路302a、302bにより、I/Oポートマップレジスタ番号は103a、I/Oポートマップ有効ビットは104aが使用される。これに対して、割り込み処理レベル信号301が「1」の場合は、選択回路302a、302bにより、I/Oポートマップレジスタ番号は103b、I/Oポートマップ有効ビットには104bが使用される。
In FIG. 5, when the interrupt
これにより、割り込み処理時と通常処理時でI/Oポートをマップする汎用レジスタを変化させることができる。このため、割り込み処理中のI/Oポートと汎用レジスタとの間での転送命令や割り込み処理開始/終了時に、マップを変化させるための命令が不要になるため、割り込み処理にかかる実行サイクル数を短くすることができる。 As a result, the general-purpose register that maps the I / O port can be changed during interrupt processing and normal processing. This eliminates the need for a transfer instruction between the I / O port during interrupt processing and the general-purpose register or an instruction for changing the map at the start / end of interrupt processing. Can be shortened.
図6は、I/Oポートをフラグレジスタにマップ可能であると共に割り込み時にマップを切り替え可能なプロセッサの構成の一例を示す図である。尚、図6は、図2に示す構成に、割り込み時にマップを切り替え可能にする構成が付加されたものであるため、ここでは図2と異なる個所のみ説明する。 FIG. 6 is a diagram illustrating an example of a configuration of a processor that can map an I / O port to a flag register and can switch a map at the time of an interrupt. Note that FIG. 6 is obtained by adding a configuration that can switch the map at the time of interruption to the configuration shown in FIG.
図6に示すように、制御回路109から出力される追加割り込み処理レベル信号301が追加されている。この割り込みレベル信号301は割り込み処理中の時に「1」、割り込み処理中ではない時に「0」となるものとする。また、図2に示すI/Oポートマップ有効ビット130が割り込み処理レベル毎に用意され、I/Oポートマップ有効ビット130a、130bとなっている。そして、割り込み処理レベル信号301により、I/Oポートマップレジスタ番号とI/Oポートマップ有効ビットとを切り替える選択回路302が追加されている。
As shown in FIG. 6, an additional interrupt
尚、I/Oポートマップレジスタ番号書き込み信号141は、I/Oポートマップ有効ビット130a、130bの何れかを指定して書き込みを行うものとする。
The I / O port map register
図6において、割り込み処理レベル信号301が「0」の場合、選択回路302により、I/Oポートマップ有効ビットは130aが使用される。これに対して、割り込み処理レベル信号301が「1」の場合、選択回路302により、I/Oポートマップ有効ビットには130bが使用される。
In FIG. 6, when the interrupt
これにより、割り込み処理時と通常処理時でI/Oポートをマップするフラグレジスタを変化させることができる。このため、割り込み処理中のI/Oポートと汎用レジスタとの間での転送命令や割り込み処理開始/終了時にマップを変化させるための命令が不要になるため、割り込み処理にかかる実行サイクル数を短くすることができる。 As a result, the flag register that maps the I / O port can be changed during interrupt processing and normal processing. This eliminates the need for a transfer instruction between the I / O port during the interrupt processing and the general-purpose register and an instruction for changing the map at the start / end of the interrupt process, thereby reducing the number of execution cycles required for the interrupt process. can do.
以上説明した実施形態によれば、I/Oポートを汎用レジスタ或いはフラグレジスタにマップできるようにすると共に、I/Oポートと汎用レジスタ或いはフラグレジスタへのマップをソフトウェアから変更できる。従って、非常に短いサイクル数でI/Oポートの入出力を含む処理を実現することができる。 According to the embodiment described above, the I / O port can be mapped to the general purpose register or the flag register, and the map to the I / O port and the general purpose register or the flag register can be changed from software. Therefore, processing including input / output of the I / O port can be realized with a very short number of cycles.
更に、割り込み処理時にI/Oポートをマップする汎用レジスタ或いはフラグレジスタを変更できることにより、割り込み処理において非常に短いサイクル数でI/Oポートの入出力を含む処理を実現することができる。 Furthermore, since a general-purpose register or flag register that maps an I / O port can be changed during interrupt processing, processing including input / output of the I / O port can be realized with a very short number of cycles in interrupt processing.
尚、本発明は複数の機器(例えば、ホストコンピュータ,インターフェース機器,リーダ,プリンタなど)から構成されるシステムに適用しても、1つの機器からなる装置(例えば、複写機,ファクシミリ装置など)に適用しても良い。 Even if the present invention is applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), it is applied to an apparatus (for example, a copier, a facsimile machine, etc.) composed of a single device. It may be applied.
また、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記録媒体を、システム或いは装置に供給し、そのシステム或いは装置のコンピュータ(CPU若しくはMPU)が記録媒体に格納されたプログラムコードを読出し実行する。これによっても、本発明の目的が達成されることは言うまでもない。 In addition, a recording medium in which a program code of software for realizing the functions of the above-described embodiments is recorded is supplied to the system or apparatus, and the computer (CPU or MPU) of the system or apparatus stores the program code stored in the recording medium. Read and execute. It goes without saying that the object of the present invention can also be achieved by this.
この場合、記録媒体から読出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記録媒体は本発明を構成することになる。 In this case, the program code itself read from the recording medium realizes the functions of the above-described embodiment, and the recording medium storing the program code constitutes the present invention.
このプログラムコードを供給するための記録媒体としては、例えばフロッピー(登録商標)ディスク,ハードディスク,光ディスク,光磁気ディスク,CD−ROM,CD−R,磁気テープ,不揮発性のメモリカード,ROMなどを用いることができる。 As a recording medium for supplying the program code, for example, a floppy (registered trademark) disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM, a CD-R, a magnetic tape, a nonvolatile memory card, a ROM, or the like is used. be able to.
また、コンピュータが読出したプログラムコードを実行することにより、前述した実施形態の機能が実現されるだけでなく、次の場合も含まれることは言うまでもない。即ち、プログラムコードの指示に基づき、コンピュータ上で稼働しているOS(オペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理により前述した実施形態の機能が実現される場合。 In addition, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also the following cases are included. That is, when the OS (operating system) running on the computer performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing.
更に、記録媒体から読出されたプログラムコードがコンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書込む。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部又は全部を行い、その処理により前述した実施形態の機能が実現される場合も含まれることは言うまでもない。 Further, the program code read from the recording medium is written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. After that, based on the instruction of the program code, the CPU of the function expansion board or function expansion unit performs part or all of the actual processing, and the function of the above-described embodiment is realized by the processing. Needless to say.
100 レジスタファイル
101 フラグレジスタ
102 I/Oポート
103 I/Oポートマップレジスタ番号
104 I/Oポートマップ有効ビット
105 I/Oポートマップ比較器
106 I/Oポートマップ有効判定
107 I/Oポートマップ読み出し選択
108 数値演算ユニット(ALU)
109 制御回路
110 I/Oポートマップ書き込み選択
111 I/Oポートマップ書き込み選択
130 I/Oポートマップ有効ビット
131 I/Oポートマップ読み出し選択
302 選択回路
100
109 Control Circuit 110 I / O Port Map Write Selection 111 I / O Port Map Write Selection 130 I / O Port Map Valid Bit 131 I / O Port
Claims (10)
前記I/Oポートが置き換えられる前記レジスタを指定する指定手段と、
前記I/Oポートを前記指定手段で指定された前記レジスタに置き換えるか否かを許可する許可手段と、
前記許可手段で許可された場合、前記I/Oポートを前記レジスタに置き換える置換手段と、
前記置換手段によって前記I/Oポートを前記レジスタに置き換えた場合に、前記I/Oポートからデータを読み出して演算する演算手段とを有し、
前記置換手段は、割り込み処理時と通常処理時とで異なる置き換えを行うことを特徴とするマイクロプロセッサ。 A microprocessor including a register and an I / O port;
Designating means for designating the register in which the I / O port is replaced;
Permission means for permitting whether to replace the I / O port with the register designated by the designation means;
A replacement unit that replaces the I / O port with the register when permitted by the permission unit;
Wherein when the I / O port is replaced in the register, have a calculating means for calculating read data from the I / O port by said replacement means,
The microprocessor according to claim 1, wherein the replacement means performs different replacements in interrupt processing and normal processing .
前記I/Oポートが置き換えられる前記レジスタを指定する指定手段と、Designating means for designating the register in which the I / O port is replaced;
前記I/Oポートを前記指定手段で指定された前記レジスタに置き換えるか否かを許可する許可手段と、Permission means for permitting whether to replace the I / O port with the register designated by the designation means;
前記許可手段で許可された場合、前記I/Oポートを前記レジスタに置き換える置換手段と、A replacement unit that replaces the I / O port with the register when permitted by the permission unit;
前記置換手段によって前記I/Oポートを前記レジスタに置き換えた場合に、前記I/Oポートからデータを読み出して演算する演算手段とを有し、Arithmetic means for reading and calculating data from the I / O port when the replacement means replaces the I / O port with the register;
前記レジスタは、少なくともフラグレジスタの1つであることを特徴とするマイクロプロセッサ。The microprocessor is characterized in that the register is at least one of flag registers.
前記置換手段は、前記許可手段で許可された場合、前記I/Oポートを前記特定されたフラグレジスタに置き換えることを特徴とする請求項2に記載のマイクロプロセッサ。3. The microprocessor according to claim 2, wherein the replacement unit replaces the I / O port with the specified flag register when the permission unit permits.
前記制御回路は、前記I/Oポートを置き換えるレジスタの指定又は前記I/Oポートを前記レジスタに置き換えるか否かの許可を変更可能であることを特徴とする請求項1乃至3のいずれか1項に記載のマイクロプロセッサ。 A control circuit for controlling the designation by the designation means and the permission by the permission means;
Wherein the control circuit, any one of claims 1 to 3, characterized in that the designation or the I / O ports of the register replacing the I / O ports can be changed to permit or not to replace the register The microprocessor according to item .
前記置換手段は、前記許可手段で許可された場合、前記I/Oポートを前記特定されたレジスタに置き換えることを特徴とする請求項7に記載のマイクロプロセッサ。 A specifying means for specifying one register in the general-purpose register;
8. The microprocessor according to claim 7 , wherein the replacement unit replaces the I / O port with the specified register when permitted by the permission unit.
前記I/Oポートが置き換えられる前記レジスタを指定する指定工程と、
前記I/Oポートを前記指定工程で指定された前記レジスタに置き換えるか否かを許可する許可工程と、
前記許可工程で許可された場合、前記I/Oポートを前記レジスタに置き換える置換工程と、
前記置換工程において前記I/Oポートが前記レジスタに置き換えられた場合に、前記I/Oポートからデータを読み出して演算する演算工程とを有し、
前記置換工程においては、割り込み処理時と通常処理時とで異なる置き換えを行うことを特徴とするI/Oポート置換方法。 An I / O port replacement method in a microprocessor including a register and an I / O port, comprising:
A designation step for designating the register in which the I / O port is replaced;
A permission step for permitting whether or not to replace the I / O port with the register designated in the designation step;
A replacement step of replacing the I / O port with the register if permitted in the permission step;
Wherein when the I / O ports in a substitution step is replaced in the register, it possesses a calculating step of calculating reads data from the I / O ports,
In the replacement step, the I / O port replacement method is characterized in that different replacement is performed during interrupt processing and during normal processing .
前記I/Oポートが置き換えられる前記レジスタを指定する指定工程と、A designation step for designating the register in which the I / O port is replaced;
前記I/Oポートを前記指定工程で指定された前記レジスタに置き換えるか否かを許可する許可工程と、A permission step for permitting whether or not to replace the I / O port with the register designated in the designation step;
前記許可工程で許可された場合、前記I/Oポートを前記レジスタに置き換える置換工程と、A replacement step of replacing the I / O port with the register if permitted in the permission step;
前記置換工程において前記I/Oポートが前記レジスタに置き換えられた場合に、前記I/Oポートからデータを読み出して演算する演算工程とを有し、A calculation step of reading and calculating data from the I / O port when the I / O port is replaced with the register in the replacement step;
前記レジスタは、少なくともフラグレジスタの1つであることを特徴とするI/Oポート置換方法。The I / O port replacement method, wherein the register is at least one of flag registers.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005240194A JP4859176B2 (en) | 2005-08-22 | 2005-08-22 | Microprocessor and I / O port replacement method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005240194A JP4859176B2 (en) | 2005-08-22 | 2005-08-22 | Microprocessor and I / O port replacement method |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2007058330A JP2007058330A (en) | 2007-03-08 |
JP2007058330A5 JP2007058330A5 (en) | 2008-09-04 |
JP4859176B2 true JP4859176B2 (en) | 2012-01-25 |
Family
ID=37921814
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005240194A Expired - Fee Related JP4859176B2 (en) | 2005-08-22 | 2005-08-22 | Microprocessor and I / O port replacement method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4859176B2 (en) |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5833584B2 (en) * | 1977-05-19 | 1983-07-20 | 株式会社東芝 | information processing equipment |
JP3628361B2 (en) * | 1994-11-02 | 2005-03-09 | 株式会社ルネサステクノロジ | Digital processing equipment |
JP2001117903A (en) * | 1999-10-22 | 2001-04-27 | Seiko Epson Corp | Semiconductor integrated circuit device, microprocessor, microcomputer and electronic equipment |
-
2005
- 2005-08-22 JP JP2005240194A patent/JP4859176B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2007058330A (en) | 2007-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4679140A (en) | Data processor with control of the significant bit lengths of general purpose registers | |
US11593117B2 (en) | Combining load or store instructions | |
JP3204323B2 (en) | Microprocessor with built-in cache memory | |
JPS58102381A (en) | Buffer memory | |
JP3203401B2 (en) | Data processing device | |
JP2020519991A (en) | Apparatus and method for managing capability metadata | |
US7130955B2 (en) | Microprocessor and video/sound processing system | |
JP4228241B2 (en) | Arithmetic processing unit | |
JPH0395629A (en) | Data processor | |
US20060143405A1 (en) | Data processing device | |
JP4859176B2 (en) | Microprocessor and I / O port replacement method | |
US8583897B2 (en) | Register file with circuitry for setting register entries to a predetermined value | |
US6260136B1 (en) | Substitute register for use in a high speed data processor | |
KR19980024622A (en) | Program execution method and device using the method | |
JP2553200B2 (en) | Information processing device | |
JP2540959B2 (en) | Information processing device | |
JP4664011B2 (en) | Information processing apparatus and information processing method | |
CN115562723A (en) | Method and device for realizing integer register file in multi-instruction set processor | |
JP2000112754A (en) | Data processor | |
JP2010092273A (en) | Information processor | |
JP2002007154A (en) | Information processor | |
JP2987281B2 (en) | Processor | |
JP2002073328A (en) | Digital signal processor, command executing method, and recording medium | |
JPH07191911A (en) | Address converter and microprocessor computation method | |
JP3541936B2 (en) | Instruction execution device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080717 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080717 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20100712 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100720 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100909 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100927 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20110627 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110921 |
|
A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20110927 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20111028 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20111031 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20141111 Year of fee payment: 3 |
|
LAPS | Cancellation because of no payment of annual fees |