JP3839068B2 - Semiconductor integrated circuit device - Google Patents

Semiconductor integrated circuit device Download PDF

Info

Publication number
JP3839068B2
JP3839068B2 JP09603994A JP9603994A JP3839068B2 JP 3839068 B2 JP3839068 B2 JP 3839068B2 JP 09603994 A JP09603994 A JP 09603994A JP 9603994 A JP9603994 A JP 9603994A JP 3839068 B2 JP3839068 B2 JP 3839068B2
Authority
JP
Japan
Prior art keywords
interrupt
cpu
bus
data processing
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.)
Expired - Fee Related
Application number
JP09603994A
Other languages
Japanese (ja)
Other versions
JPH07302255A (en
Inventor
直幹 三ッ石
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP09603994A priority Critical patent/JP3839068B2/en
Publication of JPH07302255A publication Critical patent/JPH07302255A/en
Application granted granted Critical
Publication of JP3839068B2 publication Critical patent/JP3839068B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は、半導体集積回路装置に関し、たとえばシングルチップマイクロコンピュータにおける多数の割込によるデータ転送および使用者毎の固有の処理を可能とし、かつ処理効率を向上させることができ、さらにこのシングルチップマイクロコンピュータのデバック効率の向上が可能な半導体集積回路装置およびそのエミュレーション用プロセッサならびにエミュレータに適用して有効な技術に関する。
【0002】
【従来の技術】
たとえば、シングルチップマイクロコンピュータは、昭和59年11月30日、オーム社発行の『LSIハンドブック』P540およびP541に記載されるように、中央処理装置(CPU)を中心にしてプログラム保持用のROM(リードオンリメモリ)、データ保持用のRAM(ランダムアクセスメモリ)、およびデータの入出力を行うための入出力回路などの機能ブロックが一つの半導体基板上に形成されてなる。
【0003】
このようなシングルチップマイクロコンピュータに、ダイレクトメモリアクセスコントローラ(DMAC)を内蔵し、CPUとは独立にデータ転送を内蔵したものに、平成5年3月、(株)日立製作所発行『H8/3003 ハードウェアマニュアル』または特願平4−137954号がある。このDMACは、割込要求によって起動でき、リピートモード、ブロック転送モードなどを行うことができ、ステッピングモータの制御やプリンタの印字データ制御に好適である。たとえば、最大8チャネルの転送を行うことができる。
【0004】
また、DMACの転送はCPUと独立しているために、データ転送に必要なサイクル数のみCPUを停止するのみでよく、CPUは実行中の処理を継続できる。たとえば、バイトデータの転送、転送元・転送先アドレスをインクリメントする場合、前記の例では、デッドサイクル1ステートを含めてデータ転送6ステートである。
【0005】
【発明が解決しようとする課題】
ところが、前記のようなDMACにおいては、転送元アドレス、転送先アドレス、転送カウンタ、制御レジスタを各チャネルに持つために、多数のチャネルのデータ転送を行おうとすれば、前記レジスタを多数組み設けねばならず、DMACの、ひいては半導体集積回路装置全体の論理的・物理的規模を増大させてしまう。さらに、規模の増大は製造費用を増大させてしまう。すなわち、割込要因の全て、あるいは大多数のデータ転送を行うことは困難である。
【0006】
一方、このようなレジスタを、記憶密度が高い汎用のRAM上に配置し、論理的・物理的規模の増大を防いだデータ転送装置、いわゆるデータトランスファコントローラ(DTC)を内蔵したものに、昭和63年12月、(株)日立製作所発行『H8/532 ハードウェアマニュアル』などがある。このDTCでは、実質的に全ての割込要因によってデータ転送を行うことができる。
【0007】
しかしながら、転送情報を保持するレジスタを汎用のRAM上に配置したために、データ転送に先だって、このレジスタをDTCに読み込み、この読み込んだ内容に従ってデータ転送を行い、さらにデータ転送によって更新されたレジスタ情報をRAMに退避する必要がある。この期間はCPUを停止しなければならず、データ転送に比較して、大きな時間をレジスタの読み込み・退避に費やしてしまう。
【0008】
このため、シングルチップマイクロコンピュータまたは半導体集積回路装置全体の処理効率を低下させてしまう。たとえば、バイトデータの転送、転送元・転送先アドレスをインクリメントする場合、前記の例では、データ転送5ステートに対してレジスタの読み込み・退避に30ステートを要し、合計35ステートの期間CPUは停止することになる。
【0009】
また、DMACあるいはDTCの動作の制御は、制御レジスタの制御ビットの内容によって指定されるものであり、転送モードや起動要因を選択できるのみである。この制御ビットのビット数を増やせば、転送データの加算(チェックサム)や、パリティ計算などを行うことも可能であるが、使用者毎に固有の処理を行わせることは困難である。また、多様な処理を実現しようとすれば、これを制御する回路の論理的・物理的規模が増加してしまう。
【0010】
当然、CPUを利用して、データ転送に付随する使用者毎の固有の処理を行うことができる。たとえば、割込が発生したときに、主たる処理を中断して所望の処理を行うものである。しかしながら、CPUが行うべき主たる処理を中断しなければならなくなってしまい、またCPUの内部状態の退避・復帰を行わなければならないために、オーバヘッドが発生し、シングルチップマイクロコンピュータ全体の処理性能を向上することができなくなってしまう。
【0011】
そこで、本発明の目的は、多数の割込によるデータ転送および使用者毎の固有の処理を可能とし、かつ処理効率を向上させることができるシングルチップマイクロコンピュータまたは半導体集積回路装置を提供することにある。
【0012】
さらに、このシングルチップマイクロコンピュータのデバック効率を向上させることができる半導体集積回路装置のエミュレーション用プロセッサならびにエミュレータを提供するものである。
【0013】
本発明の前記ならびにその他の目的と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。
【0014】
【課題を解決するための手段】
本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、以下のとおりである。
【0015】
すなわち、本発明の半導体集積回路装置は、第2のデータ処理装置を設け、第1のデータ処理装置の使用する第1のバスと第2のデータ処理装置の使用する第2のバスを分離可能とし、第1のデータ処理装置のバス使用と第2のデータ処理装置のバス使用を同時に行うことを可能とし、さらに第1のデータ処理装置と第2のデータ処理装置のそれぞれの動作に必要な機能ブロックまたはモジュールをそれぞれの第1または第2のバスによって接続し、特に第1のデータ処理装置と第2のデータ処理装置が実行すべきプログラムを格納可能な第1の読み出し可能な記憶手段と第2の読み出し可能な記憶手段を設け、第1のデータ処理装置が第1の読み出し可能な記憶手段から、第2のデータ処理装置が第2の読み出し可能な記憶手段からプログラムを読み出して動作するようにしたものである。
【0016】
また、第1、第2のデータ処理装置と、これらに共通の読み出し可能な記憶手段をバスによって相互に接続し、第1のデータ処理装置は、単位時間に実行可能な命令より大きい量の命令をバスを使用して記憶手段から読み出し、連続的にバスを使用して記憶手段を読み出すことなく、第1のデータ処理装置の命令実行速度の低下を最小限として第2のデータ処理装置が命令を記憶手段から読み出すようにしたものである。
【0017】
この場合に、割込要因のうち、第1の要因は第1のデータ処理装置に、第2の要因は第2のデータ処理装置に要求可能にするものであり、第1のデータ処理装置のアドレス空間は第2のデータ処理装置のアドレス空間を包含するようにするとよく、また入出力手段は第1のデータ処理装置と第2のデータ処理装置からリード/ライト可能とし、2つのデータ処理装置の動作を調停する機能を設けるようにしたものである。
【0018】
また、この半導体集積回路装置を評価するためのエミュレーション用プロセッサは、第1、第2のデータ処理装置が排他的に動作するバスをいずれのデータ処理装置が使用しているかを示す信号を出力し、第1、第2のデータ処理装置を停止するための第1、第2のブレーク割込入力端子を有するものである。
【0019】
さらに、このプロセッサを搭載したエミュレータは、第1、第2のデータ処理装置の動作情報を同時に記憶手段に蓄積するか、一方のデータ処理装置の動作情報を選択的に記憶手段に蓄積するかをシステム開発装置からの指定に基づいて選択する手段を有したり、または第1、第2のデータ処理装置にブレーク割込を要求する条件をシステム開発装置からの指定に基づいて独立に設定する手段を有するものである。
【0020】
【作用】
前記した半導体集積回路装置によれば、2つのデータ処理装置に並立したバスによって独立した2つの読み出し可能な記憶手段に格納した命令のリード可能にしたり、バスの幅を拡張してデータ処理装置が単位時間に実行可能な命令数以上の命令をリード可能にしたり、2つのデータ処理装置を並立的に動作可能な命令を供給する機能を内蔵することにより、複数の記憶手段を同時に選択可能とし、複数の記憶手段の同時書込みまたは同時読み出しを行うことによって割込によるデータ処理のチャネル数の制約をなくし、さらにデータ処理内容を任意とすることができる。
【0021】
また、第1、第2のデータ処理装置が同時に動作することにより、シングルチップマイクロコンピュータまたは半導体集積回路装置の処理速度を向上することができる。
【0022】
さらに、エミュレーション用プロセッサ、およびこれを搭載したエミュレータによれば、第1のブレーク割込によって第1のデータ処理装置を停止し、また第2のブレーク割込によって第2のデータ処理装置を停止でき、このように2つのデータ処理装置を独立に停止する割込を有することにより、デバック効率を向上することができる。
【0023】
【実施例】
以下、本発明の実施例を図面に基づいて詳細に説明する。
【0024】
(実施例1)
図1は本発明の一実施例であるシングルチップマイクロコンピュータを示すブロック図、図2は本実施例のシングルチップマイクロコンピュータにおける全体のアドレスマップの説明図、図3はシングルチップマイクロコンピュータのバスの接続状態のブロック図、図4は割込コントローラの概略ブロック図、図5は割込要求ビットおよび割込許可回路の概略ブロック図、図6はバスの動作タイミング図、図7は低消費電力状態制御回路の概略ブロック図、図8は入出力ポートを制御するレジスタ構成の説明図、図9は入出力ポートの概略ブロック図、図10はPROMのアドレスマップ、図11はPROMモードの主要部のブロック図、図12はテストモードの主要部のブロック図、図13はエミュレーション用プロセッサの概略ブロック図、図14はエミュレータの概略ブロック図、図15は本実施例におけるシングルチップマイクロコンピュータの変形例を示すブロック図である。
【0025】
まず、図1により本実施例のシングルチップマイクロコンピュータの構成を説明する。
【0026】
本実施例のシングルチップマイクロコンピュータは、中央処理装置(CPU1:第1のデータ処理装置、CPU2:第2のデータ処理装置)、リードオンリメモリ(ROM1:第1の読み出し可能な記憶手段、ROM2:第2の読み出し可能な記憶手段)、ランダムアクセスメモリ(RAM1、RAM2、RAMP)、タイマ、パルス出力回路、シリアルコミュニケーションインタフェース(SCI)、A/D変換器(A/D)、入出力ポート(IOP0〜IOP11:データ入出力手段)、割込コントローラ(割込制御手段)、バスコントローラ(バス制御手段)、クロック発振器の機能ブロック(またはモジュール)から構成され、一つの半導体基板上に形成されている。
【0027】
これらの機能ブロックは、内部バスによって相互に接続される。内部バスはアドレスバス、データバスの他、リード信号、ライト信号を含み、さらにバスサイズ信号あるいはシステムクロックを含んでもよい。この内部アドレスバスには、IAB1(第1のバス)、IAB2(第2のバス)、PAB(第3のバス)が存在し、また内部データバスにはIDB1(第1のバス)、IDB2(第2のバス)、PDB(第3のバス)が存在する。この内部データバスIDB1、IDB2、PDBは16ビット構成である。また、CPU1、CPU2の命令は16ビット単位としている。
【0028】
なお、CPU1、ROM1、RAM1はIAB1、IDB1に接続され、CPU2、ROM2、RAM2はIAB2、IDB2に接続されている点で相違される。また、RAMPはPAB、PDBに接続される。このIAB1、IAB2、PABはバスコントローラでインタフェースされ、同様にIDB1、IDB2、PDBはバスコントローラでインタフェースされる。
【0029】
また、PAB、PDBはバスコントローラ、RAMP、タイマ、パルス出力回路、SCI、A/D変換器、割込コントローラ、IOP0〜11に接続される。CPU1、CPU2のいずれか一方がPAB、PDBを使用して、これらをリード/ライトできる。割込コントローラは、タイマ、SCI、入出力ポートの出力する割込信号を入力し、CPU1またはCPU2に割込要求信号とベクタ番号を出力する。
【0030】
入出力ポートは、外部バス信号、入出力回路の入出力信号と兼用とされている。IOP0〜3はアドレスバス出力、IOP4、5はデータバス入出力、IOP6はバス制御信号入出力信号と兼用されている。外部アドレス、外部データは、それぞれこれらの入出力ポートに含まれるバッファ回路を介してIAB1、IDB1と接続されている。PAB、PDBは入出力ポートのレジスタをリード/ライトするために使用し、外部バスとは直接の関係はない。
【0031】
このバス制御信号出力は、アドレスストローブ、ハイ/ロウデータストローブ、リードストローブ、ライトストローブ、バスアクノリッジ信号などがあり、またバス制御入力信号にはウェイト信号、バスリクエスト信号などがある。これらの入出力信号は図示はされない。外部バス拡張を行うことは、動作モードなどで選択され、これらの入出力ポートの機能も選択される。
【0032】
また、IOP7はタイマ入出力、IOP8はパルス出力、IOP9はSCI入出力、IOP10はアナログ入力、IOP11は外部割込要求(IRQ)入力と兼用されている。なお、タイマ、SCI、A/D変換器とIOP7、IOP9、IOP10との入出力信号は図示はされない。
【0033】
そのほか、電源端子Vcc、Vss、アナログ電源端子AVcc、AVss、リセット入力RES、スタンバイ入力STBY、割込入力NMI、クロック入力EXTAL、XTAL、動作モード入力MD0、MD1、MD2などの入力端子がある。
【0034】
パルス出力回路は、タイマから与えられるトリガ信号に従って、図示はされないレジスタ(NDR)に保持した内容をIOP8と兼用の端子から出力する。
【0035】
次に、図2によりシングルチップマイクロコンピュータのアドレスマップを説明する。
【0036】
たとえば、CPU1は4Gバイトのアドレス空間、CPU2は64kバイトのアドレス空間を持つ。また、ROM1、RAM1はCPU1のアドレス空間上にのみ、ROM2、RAM2はCPU2のアドレス空間上にのみ存在する。斜線部で示されるRAMP、およびタイマ、パルス出力回路、SCI、A/D変換器、IOP0〜11、割込コントローラの各機能ブロックのアドレス、すなわち内部レジスタは、1つの物理的アドレスに対し、それぞれのCPUのアドレス空間上で固有の論理的アドレスを有する。
【0037】
このアドレスは、それぞれアドレスで対応付けられており、具体的にはCPU2のアドレスの上位にH’FFFFを付加したアドレスがCPU1のアドレスになる。たとえば、RAMPの先頭アドレスはCPU1ではH’FFFFFB80、CPU2ではH’FB80である。
【0038】
すなわち、CPU1はROM1、RAM1、RAMP、内部レジスタをリード/ライトでき、CPU2はROM2、RAM2、RAMP、内部レジスタをリード/ライトできる。
【0039】
次に、図3により、このシングルチップマイクロコンピュータのアドレスバス、データバスの接続状態を説明する。
【0040】
図3において、I/Oには図1のタイマ、パルス出力回路、SCI、A/D変換器、IOP0〜11、割込コントローラの各機能ブロックを含む。クロック発振器はバスと接続されていないので省略する。
【0041】
アドレスバス、データバスとして、CPU1、ROM1、RAM1、外部を接続するIAB1、またCPU2、ROM2、RAM2を接続するIAB2、さらにRAMP、I/Oを接続するPABがある。このようなアドレスバス、データバスはバスコントローラ(BSC)でインタフェースされている。
【0042】
たとえば、CPU1がROM1からプログラムをリードする場合、またはRAM1とのデータのリード/ライトする場合、IAB1、IDB1を使用して動作が行われる。このCPU1はPAB、PDBを使用しない。
【0043】
一方、CPU2がROM2からプログラムをリードする場合、またはRAM2とのデータのリード/ライトする場合、IAB2、IDB2を使用して動作が行われる。このCPU2はPAB、PDBを使用しない。このとき、CPU1とCPU2は互いに独立したバスを用いて動作し、並列に動作することができる。
【0044】
また、CPU1とCPU2のいずれか一方が、RAMPまたはI/Oとのデータのリード/ライトを行う場合、バス権調停が行われる。この場合に、CPU2によるバス権要求がCPU1によるバス権要求より優先される。このバス権調停は、IAB1/IAB2に示されるアドレスとCPU1/2が出力するコマンド信号によって、バスコントローラが行う。コマンド信号にはリード要求、ライト要求、サイズ信号等を含む。
【0045】
一方がRAMPまたはI/Oとのデータのリード/ライト中に、他方がRAMPまたはI/Oとのデータのリード/ライトを行おうとすると、後者は前者のリード/ライトが終了するまで、バスコントローラから待機信号を与えられ、待機状態とされる。たとえば、CPU2がRAMPまたはI/Oとのデータのリード/ライトを行っている間、CPU1はROM1、RAM1のリード/ライトを行うことができる。
【0046】
さらに、CPU1とCPU2が、同時にRAMPまたはI/Oとのデータのリード/ライトを行おうとした場合、一方のCPUは停止状態にすることになるが、プログラムをRAMPまたはI/Oには配置しないことによって、RAMPまたはI/Oとのデータのリード/ライトをデータのみに限定して頻度を低下することができる。
【0047】
この場合に、リードした命令に基づいてデータのリード/ライトを行うのであるから、命令のリードとデータのリード/ライトの回数の比は1/2以上にはならない。また、データのリード/ライト命令で全てのプログラムが構成されることはないから、前記の比はさらに小さくできる。一般的には1/4〜1/5程度であると考えられる。この実施例中に記載されるプログラムによっても同様であることが示される。従って、CPU1とCPU2の並列動作性を高めることができる。
【0048】
このような並列動作を有効に利用するためには、CPU1が全体的な設定と、ROM1、RAM1あるいは外部のデバイスを用いた主たるプログラム処理を行い、CPU2がI/Oの逐次的な制御を行うようにするとよい。また、CPUの命令をROM1またはROM2に配置し、作業領域をRAM1またはRAM2に配置するとよい。
【0049】
次に、図4により割込コントローラを詳細に説明する。
【0050】
たとえば、割込要因には内部割込、外部割込の2種類があり、それぞれ割込要因フラグを有する。この内部割込の要因フラグは、タイマ、SCI、A/D変換器の入出力回路が所定の状態になったときに“1”にセットされ、また外部割込の要因フラグは、外部割込入力端子が所定のレベルになったとき、または所定の信号変化が発生したときに“1”にセットされる。この割込要因フラグは、CPU1/2のライト動作によって“0”にクリアされる。
【0051】
割込要因フラグの各ビットの出力は、割込許可回路に入力され、この割込許可回路には、さらに割込許可レジスタの内容、すなわち割込許可ビットが入力される。この割込許可レジスタは、CPU1/2からリード/ライト可能なレジスタで、対応する割込を許可するか、禁止するかを選択する。
【0052】
たとえば、割込要因フラグが“1”にセットされ、割込許可ビットが“1”にセットされていると、割込が要求される。すなわち、割込許可回路は、対応する割込要因フラグと割込許可ビットとを入力とした論理積回路で構成される。
【0053】
割込許可回路の出力は、CPU選択回路に入力され、このCPU選択回路には、さらに割込選択レジスタIRQSELの内容が入力される。この割込選択レジスタは、割込が要求されたとき、CPU1またはCPU2のいずれに割込を許可するかを選択する。
【0054】
たとえば、割込選択レジスタのビットが“1”にセットされていると、CPU2に割込が要求される。割込選択レジスタのビットが“0”にクリアされていると、CPU1の割込が要求される。すなわち、CPU選択回路は、対応する割込信号と割込選択ビットの論理積回路、および割込信号と割込選択ビットの反転信号の論理積回路で構成される。前者の論理積回路の出力がCPU2割込要求信号とされ、後者の論理積回路の出力がCPU1割込要求信号とされる。
【0055】
CPU選択回路の出力は、CPU1割込要求とCPU2割込要求が独立に、優先順位判定回路に入力され、この優先順位判定回路には、さらにプライオリティレジスタの出力が入力される。このプライオリティレジスタは割込要因のグループ毎に、たとえば2レベルの優先順位を設定する。
【0056】
この場合に、CPU1/2割込要求のそれぞれについて優先順位を判定する。この判定の結果、優先順位の最高のものが選択され、ベクタ番号が生成され、CPU1/2割込要求のそれぞれのベクタ番号が出力される。
【0057】
このCPU1/2割込要求信号、ベクタ番号はマスクレベル判定回路に入力され、このマスクレベル判定回路には、さらに対応するCPU1/2の割込マスクビットが入力される。ここで、要求された割込がCPUの割込マスクレベル以下であれば保留される。そして、CPU1/2のそれぞれに対し、割込要求信号とベクタ番号が出力される。なお、CPU1は2ビットのマスクビットを持つが、CPU2は1ビットのマスクビットを持つ。
【0058】
さらに、それぞれのCPUに対する割込要求信号が活性状態になると、このCPUは実行中の命令の終了時点で割込例外処理を開始し、ベクタ番号に対応するベクタアドレスから分岐先アドレスを取り出し、割込処理ルーチンへ分岐する。
【0059】
このような優先順位判定や割込マスクレベルについては、前記平成5年3月、(株)日立製作所発行『H8/3003 ハードウェアマニュアル』または特願平4−137955号などによって公知であるので、詳細な説明は省略する。
【0060】
また、CPU1またはCPU2のいずれに要求されるかによらず、ベクタ番号は一定である。しかし、アドレス空間の大きさに対応して、ベクタアドレスは、CPU1では4バイト単位、CPU2では2バイト単位とされる。
【0061】
ノンマスカブル割込NMIは、1本の端子NMIから入力されるが、2つのCPUに同時に割込を要求できる。これは対応する割込許可ビットを持たない。このNMI割込は、マスク不可能な特性上、シングルチップマイクロコンピュータまたは半導体集積回路の暴走時などに、CPUの処理を強制的に停止させるために用いるため、1本のNMI端子によって、CPU1およびCPU2の両方にNMI割込を要求することは都合がよい。少なくとも2本の端子にするのに比較して、端子1本を節約して、入出力ポートなどとして有効に使用することができる。
【0062】
また、割込要因フラグには、CPU2がライト可能な割込要求ビットを持つ。この割込許可ビットを“1”にセットすると、CPU1に割込を要求できる。また、割込要求ビットはCPU2から“1”にセットすることが可能であり、CPU1からは“0”にクリアすることができる。CPU1が“0”にクリアする場合は、事前に“1”の状態をリードした後、“0”をライトする必要がある。
【0063】
次に、割込コントローラにおいて、図5により割込要求ビットと割込許可回路を詳細に説明する。
【0064】
たとえば、2つのフリップフロップFF1、FF2を含む。このFF1は、割込要求ビットを構成し、クリア信号CLRとしてリセット信号RESETが入力される。また、セット信号Sには論理積回路AND1の出力が入力され、リセット信号Rには論理積回路AND3Aの出力が入力され、出力Qは、論理積回路AND4を介して割込要求として出力されるほか、論理積回路AND2、出力バッファに入力される。
【0065】
論理積回路AND1には、CPU2のバス権信号、レジスタライト信号、および内部データバスの所定のビットが入力される。なお、レジスタリード/レジスタライト信号は、リード信号/ライト信号と、アドレスをデコードしてこのレジスタが選択されたことを示す信号との論理積で生成される信号とする。たとえば、レジスタライト信号は、CPU2またはCPU1がこの割込要求ビットのアドレスにライトしたとき、活性状態“1”となる。
【0066】
FF2は、割込要求ビットの制御を行い、クリア信号CLRとしてリセット信号RESETが入力される。また、セット信号Sには論理積回路AND2の出力が入力され、リセット信号Rには論理積回路AND3Aの出力が入力され、出力Qは論理積回路AND3Aに入力される。
【0067】
論理積回路AND2には、FF1の出力、CPU1のバス権信号、およびレジスタリード信号が入力される。
【0068】
論理積回路AND3Aには、FF2の出力、および内部データバスの所定のビットの反転、およびAND3Bの出力が入力される。このAND3Bには、CPU1のバス権信号、レジスタライト信号が入力される。
【0069】
論理積回路AND4には、FF1の出力、および、図示はされない割込許可レジスタの所定のビットの出力である割込許可信号を入力し、出力は割込要求信号とされる。なお、選択ビットは設けられず、必ずCPU1に割込を要求するとよい。
【0070】
出力バッファは、FF1の出力をデータとして入力し、レジスタリード信号をクロック信号として入力する。この出力は内部データバスの所定のビットに結合される。
【0071】
従って、CPU2がこの割込要求ビットのアドレスに“1”をライトしたとき、AND1の出力が“1”となって、FF1が“1”にセットされる。このように、割込許可レジスタの所定のビットが“1”にセットされていると、CPU1に割込が要求される。
【0072】
さらに、CPU1がこの状態で割込要求ビットのアドレスをリードすると、出力バッファを介してデータバスに割込要求ビットの内容を出力するとともに、AND2の出力が“1”となって、FF2が“1”にセットされる。
【0073】
続いて、CPU1が割込要求ビットに“0”をライトすると、AND3Aの出力が“1”となって、FF1およびFF2が“0”にクリアされる。同様に、CPU1がライト可能な割込要求ビットを持ち、この割込許可ビットはCPU2からのみライトでき、CPU2に割込を要求できる。
【0074】
いわゆるリードモディファイライト命令では、リードとライトの間にバスを解放しないようにするとよい。たとえば、ビットセット命令は、指定されたアドレスのデータをバイトサイズでCPUに取込み、CPU内部で指定された1ビットを“1”にセットし、バイトサイズでデータをライトするものである。
【0075】
このリードとライトの間はPAB、PDBを他方のCPUに解放しないようにする。このバスの解放を禁止する信号は、CPU1/2がバスコントローラに出力する前記コマンド信号に含めることができる。
【0076】
次に、図6により内部バスの動作タイミングの一例を説明する。
【0077】
本実施例のシングルチップマイクロコンピュータは、たとえばシステムクロックφに同期して動作し、IAB1/2はφの反転信号であるφ#に同期して出力され、またCPU1/2のROM1/2およびRAM1/2に対するリードは1ステートで行われる。
【0078】
まず、IAB1/2はφ#に同期して1ステート出力され、特に制限はされないものの、ROM1/2およびRAM1/2の中でφに同期してラッチされる。これに対応するリードデータはφ#に同期して出力され、φ#が活性状態の期間にCPUに取り込まれる。たとえば、T1のφ#に同期してIAB1/2に出力されたアドレスに対するデータはT2のφ#が活性状態の期間に、それぞれCPU1/2に取り込まれる。
【0079】
一方、RAMPに対するリード/ライトは2ステート、I/Oに対するリード/ライトは3ステートで行われる。このφ#に同期したIAB1/2は、バスコントローラでφに同期化される。
【0080】
この場合に、CPU1のプログラムは以下の通りとする。なお、命令の表記方法は、平成元年7月、(株)日立製作所発行『H8/300シリーズ プログラミングマニュアル』に記載のCPUと同様とする。
【0081】
CMP.B #CODE,R0L
BEQ N1
BTST #0,@PORT
BNE N2
たとえば、CMP、BEQ、BNE命令は2バイト長、TST命令は4バイト長とする。
【0082】
始めに、アドレスnからCMP命令をリードする。このCMP命令の実行を開始すると、まずアドレスn+2からBEQ命令をリードするとともに、内部でイミディエイトデータCODEと汎用レジスタR0Lの内容を比較して、コンディションコードに反映する。
【0083】
さらに、BEQ命令の実行を開始すると、まず、アドレスn+4からBTST命令をリードする。次に、分岐先のアドレスN1から命令をリードするとともに、前記比較結果が一致しているかを判定する。一致していなければ、アドレスN1の命令は無視して、すでにリード済みのBTST命令の実行を行う。
【0084】
続いて、BTST命令の第2ワードをリードする。このBTST命令を実行すると、絶対アドレスPORTで指定されるI/Oから、PAB/PDBを使用して、バイトサイズでデータをリードする。次にアドレスn+6からBNE命令をプリフェッチする。
【0085】
また、CPU2のプログラムは以下の通りとする。
【0086】
BCLR #RDRF,@SSR
たとえば、BCLR命令は4バイト長とする。
【0087】
始めに、アドレスm、アドレスm+2からBCLR命令をリードする。このBCLR命令の実行を開始すると、まず絶対アドレスSSRで指定されるI/Oから、PAB/PDBを使用してバイトサイズでデータをリードする。
【0088】
続いて、アドレスm+4から次の命令をプリフェッチするとともに、内部でリードデータのイミディエイトデータRDRFで指定されるビットを“0”にクリアする。このデータを、絶対アドレスSSRで指定されるI/Oへ、PAB/PDBを使用してライトする。次の命令の実行を開始し、さらにアドレスm+6から次の命令をプリフェッチする。
【0089】
T1では、CPU1/2のROM1/2からの命令フェッチが行われ、IAB1/2にアドレスが出力される。
【0090】
T2では、ROM1/2からIDB1/2に読み出された命令コード(CMP命令、BCLR命令の第1ワード)をCPU1/2がそれぞれ取り込むとともに、次の命令フェッチのアドレスがIAB1/2に出力される。
【0091】
T3では、ROM1/2からIDB1/2に読み出された命令コード(BEQ命令、BCLR命令の第2ワード)をCPU1/2がそれぞれ取り込むとともに、CPU1は次の命令フェッチのアドレスを、CPU2はアドレスSSRを、それぞれIAB1/2に出力する。
【0092】
この場合に、PAB/PDBを使用するのがCPU2だけなので、CPU2のPAB/PDBの使用が許可される。ここで、SCIのリードが3ステート必要であるため、CPU2待機信号がハイレベルになる。
【0093】
T4では、バス権信号がロウレベルになって、CPU2のPAB/PDBの使用を表示する。IAB2の内容がPABに出力されて、SCIのレジスタSSRの内容がリードされる。このリードデータはT6で得られる。
【0094】
この場合に、ROM1からIDB1に読み出された命令コード(BTST命令の第1ワード)をCPU1が取り込むとともに、CPU1は分岐先アドレスN1をIAB1に出力する(BTST命令の第2ワード)。
【0095】
T5では、ROM1からIDB1に読み出された命令コードをCPU1が取り込むが、これは分岐条件が不成立で実行されない。先にフェッチ済みのBTST命令の第1ワードが有効になる。この場合に、CPU1は次の命令フェッチのアドレスをそれぞれIAB1に出力する。
【0096】
T6では、SCIのレジスタSSRから読み出されたデータをPDB、IDB2を介してCPU2が取り込む。また、CPU2待機信号がロウレベルになり、次の命令フェッチのアドレスをIAB2に出力する。
【0097】
この場合に、CPU1はアドレスPORTをIAB1に出力し、またCPU2のPAB/PDBの使用が終了しているので、CPU1のPAB/PDBの使用が許可される。ここで、PORTのリードが3ステート必要であるため、CPU1待機信号がハイレベルになる。
【0098】
T7では、バス権信号がハイレベルになって、CPU1のPAB/PDBの使用を表示する。IAB1の内容がPABに出力されて、入出力ポートのレジスタPORTの内容がリードされる。このリードデータはT9で得られる。
【0099】
この場合に、CPU1待機信号がロウレベルになり、次の命令フェッチのアドレスをIAB1に出力し、またCPU2はアドレスSSRをIAB2に出力する。ここで、PAB/PDBをCPU1が使用しているので、CPU2の動作は保留され、CPU2待機信号がハイレベルになる。
【0100】
T8では、CPU2はアドレスSSRにライトすべきデータをIDB2に出力する。
【0101】
T9では、入出力ポートのレジスタPORTから読み出されたデータをPDB、IDB2を介してCPU1が取り込む。このCPU1は次の命令フェッチのアドレスをIAB1に出力する。この場合に、CPU1待機信号がロウレベルになり、次の命令フェッチのアドレスをIAB1に出力する。
【0102】
T10では、ROM1からIDB1に読み出された命令コード(BNE命令)をCPU1が取り込む。次の命令フェッチのアドレスをIAB1に出力する。この場合に、バス権信号がロウレベルになって、CPU2のPAB/PDBの使用を表示する。IAB2の内容がPABに出力されて、IDB2の内容がSCIのレジスタSSRにライトされる。
【0103】
T11、T12でライト動作が行われる。この場合に、T12でCPU2待機信号がロウレベルになり、次の命令フェッチのアドレスをIAB2に出力する。また、CPU1は上記同様の動作を繰り返す。
【0104】
なお、CPU1は、外部CPUとすることもでき、共通部分を外部のCPUが周辺機能としてリード/ライトすることができる。また、CPU2が共通部分をリード/ライトする場合には、外部CPUにウェイト信号を活性状態にして、待機させる。このとき、シングルチップマイクロコンピュータが外部CPUに対する割込信号を出力する。
【0105】
続いて、データ転送のプログラム例を以下に示す。ここでは、SCIの受信データのチェックサムを行い、結果は内蔵RAM2上に配置した作業用アドレスSUMに格納するものとする。また、受信データ数は内蔵RAM2上に配置した作業用アドレスSUMに格納されているものとする。
【0106】
その他、転送回数を記憶する作業用アドレスCNT、およびSCIの受信データレジスタRDR、ステータスレジスタSSR、割込コントローラの割込選択レジスタIRQSELを使用する。
【0107】

Figure 0003839068
始めに、CPU2に受信完了割込RXIが要求され、割込ルーチンに分岐する。まず、汎用レジスタR0をスタックに退避する(1)。そして、SCIの受信データレジスタRDRの内容を汎用レジスタR0の下位8ビットR0Lにリードする(2)。
【0108】
また、内蔵RAM2上に配置した作業用アドレスSUMの内容を汎用レジスタR0の上位8ビットR0Hにリードする(3)。そして、R0HとR0Lの内容を加算する(4)。この加算結果をアドレスSUMにライトする(5)。
【0109】
さらに、内蔵RAM2上に配置した作業用アドレスCNTの内容を汎用レジスタR0Hにリードする(6)。そして、R0Hの内容をデクリメント(−1)する(7)。このデクリメント結果をアドレスCNTにライトする(8)。
【0110】
この内容が“0”であれば、L1に分岐し(9)、割込選択レジスタIRQSELの受信完了割込RXIに対応するビットを反転する(12)。このとき、割込要求フラグRDRFが“1”にセットされたままなので、CPU1に受信完了割込RXIが要求される。そして、割込ルーチンから復帰する(13)。
【0111】
また、前記アドレスCNTにライトされた内容が“0”でなければ(9)、割込要求フラグRDRFを“0”にクリアする(10)。そして、分岐命令を実行した(11)後、割込ルーチンから復帰する(13)。
【0112】
また、以下のプログラム例により、マルチプロセッサ受信のアドレス判定を行うことができる。なお、この場合にはアドレス判定の結果、受信したアドレスが自身のアドレスに一致していれば、受信完了割込の要求先をCPU1に変更するものとする。
【0113】
Figure 0003839068
始めに、CPU2に受信完了割込RXIが要求され、割込ルーチンに分岐する。まず、汎用レジスタR0をスタックに退避する(1)。そして、SCIの受信データレジスタRDRの内容を汎用レジスタR0の下位8ビットR0Lにリードする(2)。
【0114】
この内容を、マルチプロセッサ受信の自分のIDと比較する(3)。この結果、一致していれば、L1に分岐し(4)、割込選択レジスタIRQSELの受信完了割込RXIに対応するビットを反転する(7)。このとき、割込要求フラグRDRFが“1”にセットされたままなので、CPU1に受信完了割込RXIが要求される。そして、割込ルーチンから復帰する(8)。
【0115】
また、自分のIDと比較した結果が一致していなければ(4)、割込要求フラグを“0”にクリアする(5)。そして、分岐命令を実行した(6)後、割込ルーチンから復帰する(8)。
【0116】
なお、この場合に1本の割込で複数の転送を行うことができる。たとえば、ステッピングモータを駆動して、かつこの加速/減速を行うことができる。また、タイマのコンペアマッチ割込OCMI毎に、ポートから出力するデータを更新してモータを駆動する。さらに、コンペアレジスタの内容を更新して、データ出力の周期を変更して加速/減速を行うことができる。
【0117】
この状態の表示に、内蔵RAM2上に配置した作業用アドレスUPDWの内容を用いる。このビット6が“0”にクリアされているときに定速動作であり、“1”にセットされているときは加速または減速、すなわちビット7が“0”にクリアされているときは減速、“1”にセットされているときには加速動作である。なお、初期値はビット6、7ともに“1”にセットしておく。
【0118】
また、パルス出力回路のネクストデータレジスタNDRに次の出力パルスを格納するものとし、タイマの定数レジスタOCRにパルス出力周期を設定するものとする。タイマカウンタが定数レジスタの値に一致すると、図示はされないコンペアマッチ信号が発生し、NDRの内容がIOP8と兼用の端子から出力される。同時にタイマカウンタの値は0にクリアされる。このNDRは4ビットとする。
【0119】
このようなパルス出力については、特願平4−117969号と同様とする。
【0120】
PUSH R0 (1)
MOV.B @NDR,R0L (2)
ROTL.B R0L (3)
BLD #4、R0L (4)
BST #0,R0L (5)
MOV.B R0L,@NDR (6)
始めに、CPU2にコンペアマッチ割込OCMIが要求され、割込ルーチンに分岐する。まず、汎用レジスタR0をスタックに退避する(1)。そして、ネクストデータレジスタNDRの内容を汎用レジスタR0の下位8ビットR0Lにリードする(2)。
【0121】
この内容を回転する(3)。ここでは、4ビット単位の回転とするために、回転後のビット4をキャリフラグに格納し(4)、このキャリフラグをビット0に格納する(5)。この4ビット単位の回転が終了した結果をNDRに書き込む(6)。この内容が次のコンペアマッチで端子から出力される。
【0122】
Figure 0003839068
続いて、アドレスUPDWのビット6の内容を検査し(7)、この内容が“0”(定速動作)であれば、L3に分岐し(8)、定数レジスタOCRの内容は保持される。また、“0”でなければ、定数データレジスタOCRの内容を汎用レジスタR0にリードする(9)。
【0123】
さらに、アドレスUPDWのビット7の内容を検査し(10)、この内容が“0”(減速動作)であれば、L1に分岐し(11)、“0”でなければ(加速動作)、定数値CNSTを汎用レジスタR0から減算し(12)、L2に分岐する(13)。このL1では定数値CNSTを汎用レジスタR0に加算し(14)、L3では汎用レジスタR0の内容を定数レジスタOCRに書き込む(15)。
【0124】
Figure 0003839068
続いて、アドレスCNTの内容を汎用レジスタR0Hにリードする(16)。この内容R0Hの内容をデクリメント(−1)する(17)。この内容が“0”でなければ、L5に分岐し(18)、“0”であれば、アドレスUPDWのビット6の内容を検査する(19)。
【0125】
さらに、この内容が“0”(定速動作)であれば、L6に分岐し(20)、“0”でなければ、ビット7の内容を検査し(21)、さらにこの内容が“0”(減速動作)であれば、L6に分岐し(22)、“0”でなければ(加速動作)、アドレスUPDWのビット6を“0”にクリアして、定速動作に遷移し(23)、低速動作の回転数CNT1をR0Hに設定する(24)。そして、L5に分岐する(25)。
【0126】
L4では、減速動作に遷移するため、アドレスUPDWのビット6を“1”にセット(26)し、ビット7を“0”にクリアする(27)。また、減速動作の回転数CNT2をR0Hに設定する(28)。
【0127】
さらに、L5では、汎用レジスタR0Hの内容をアドレスCNTにライトする(29)。そして、分岐命令を実行(30)した後、割込ルーチンから復帰する(32)。
【0128】
そして、減速動作の終了後、L6では割込選択レジスタIRQSELのにコンペアマッチ割込OCMIに対応するビットを反転する(31)。このとき、割込要求フラグOCMFが“1”にセットされたままなので、CPU1に受信完了割込RXIが要求される。そして、割込ルーチンから復帰する(32)。
【0129】
また、起動は、前記割込要求レジスタを用いて、CPU1からCPU2に割込を要求して、たとえばRAMP上の所定のアドレスにコマンドを配置して指示をすればよい。
【0130】
以上により、たとえば特願平4−137954号または特願平4−117969号に記載の方法に比べて、RAMにデータを展開しておく必要がなく、RAMの使用量を節約できる。
【0131】
また、CPU2を、割込に対応したデータ処理に主として使用すれば、CPU2は常に処理すべきプログラムがあるとは限らない。そこで、1つの割込によるデータ処理が終了した時点で、処理すべきプログラムがなければ、CPU2は低消費電力状態、いわゆるスリープ状態にするのがよい。
【0132】
このスリープ状態では、専用のSLEEP命令を実行することにより遷移する。そして、CPU2に供給されるクロックが停止される。また、割込が要求されると、スリープ状態は解除される。
【0133】
次に、図7により低消費電力状態制御回路を詳細に説明する。
【0134】
なお、この低消費電力状態制御回路は、たとえばクロック発振器内に構成され、この低消費電力状態は3個のフリップフロップSLPF1、SLPF2、SSBYFで制御される。
【0135】
フリップフロップSLPF1は、CPU1がSLEEP命令を実行すると、セット状態となる。このとき、CPU1はスリープ状態となる。また、CPU1に対する割込要求が発生するとクリア状態となる。
【0136】
フリップフロップSLPF2は、CPU2がSLEEP命令を実行すると、セット状態となる。このとき、CPU2はスリープ状態となる。また、CPU2に対する割込要求が発生するとクリア状態となる。
【0137】
フリップフロップSSBYFは、図示はされない制御ビットSSBYを“1”にセットした状態で、一方のCPUがスリープ状態で、他方のCPUがSLEEP命令を実行するとセット状態となる。このソフトウェアスタンバイ状態では、クロック発振器を始め、全ての機能の動作が停止する。内部はリセット状態となる。
【0138】
ただし、規定の電圧が与えられている限り、RAM1、RAM2、RAMPの内容は保持される。また、入出力ポートの状態も保持される。そして、NMI割込要求が発生するとクリア状態となる。なお、内部はリセット状態となるためにNMI以外の割込要求は発生しない。
【0139】
このソフトウェアスタンバイ状態に遷移するためには、一方のCPUがSSBYビットを“1”にセットし、SLEEP命令を実行すればよい。他方のCPUの状態に応じて、直ちにソフトウェアスタンバイ状態に遷移するか、一旦スリープ状態に遷移した後、他方のCPUがSLEEP命令を実行した後にソフトウェアスタンバイ状態に遷移するかが自動的に選択される。このため、プログラムを作成する場合に、相互の動作状態を確認する必要がなく、プログラムの作成効率を向上することができる。
【0140】
また、割込処理を開始したとき、直前が動作中であったか、スリープ状態であったかを示すビットを設けるとよい。この動作中に割込を受け付けた場合には、CPUの内部のレジスタの内容を退避しなければならないが、スリープ中に割込を受け付ければ、CPUの内部のレジスタには作業中のデータはないので退避する必要がない。この退避動作および処理終了時の復帰動作を行わなければ、高速化を行うことができる。
【0141】
さらに、入出力ポートは、いずれのCPUからライト可能にするか選択可能にする。
【0142】
次に、図8により入出力ポートのレジスタを詳細に説明する。
【0143】
この入出力ポートのレジスタは、データディレクションレジスタ(DDR)、データレジスタ(DR)、ポート制御レジスタ(PSEL)からなる。
【0144】
DDRは、ライト専用レジスタであり、“0”にクリアされているときに入力、“1”にセットされているときには出力となる。
【0145】
DRは、出力データを格納する。このDDRを“1”にセットすると、DRの内容が出力される。リード時にはDRの内容または端子の状態が読み出される。すなわち、DDRが“0”にクリアされているときは端子の状態、“1”にセットされているときにはDRの内容が読み出される。
【0146】
PSELが、各入出力端子の制御をいずれのCPUで行うかを選択する。このポート制御レジスタ(PSEL)の制御ビットは、データレジスタ(DR)とデータディレクションレジスタ(DDR)のビットを共通に制御する。PSELが“0”にクリアされているときはCPU1によって、“1”にセットされているときにはCPU2によってライトが行われる。
【0147】
なお、ポートにプルアップMOSを内蔵したり、2重出力バッファとしたりする場合、これらの制御を行うレジスタも、PSELで共通に制御すればよい。このようなレジスタの例は、前記平成5年3月、(株)日立製作所発行『H8/3003 ハードウェアマニュアル』P263〜P306、P419〜P445に記載されている。
【0148】
次に、図9により入出力ポートを詳細に説明する。
【0149】
本実施例の入出力ポートにおいては、データディレクションレジスタ(DDR)、データレジスタ(DR)、ポート制御レジスタ(PSEL)はフリップフロップで構成される。いずれも、内部データバスの所定のビットをデータ入力(D)とし、リセット信号(RESET)をクリア入力(CLR)としている。
【0150】
DDRの入力クロック(C)は、論理積回路AND1の出力である。この出力(Q)は、出力バッファOBUFの制御信号およびセレクタSEL1の選択信号とされる。
【0151】
DRの入力クロック(C)は、論理積回路AND2の出力である。この出力(Q)は出力バッファOBUFのデータ入力およびセレクタ1のデータ入力とされる。
【0152】
PSELの入力クロック(C)は、PSELリード信号WRPSELである。この出力(Q)はセレクタSEL2の選択信号とされる。
【0153】
出力バッファOBUFは、制御信号としてDDR出力、データ入力はDR出力とされ、出力信号は端子Pに接続される。
【0154】
入力バッファIBUFは、入力信号が端子Pに接続され、出力信号がセレクタSEL1のデータ入力とされる。
【0155】
セレクタSEL1は、DDR出力を選択信号、DR出力および入力バッファIBUF出力をデータ入力とする。このDDR出力が“0”のときは入力バッファIBUF出力が選択され、DDR出力が“1”のときにはDR出力が選択される。このセレクタSEL1の出力はDRリードバッファの入力とされる。
【0156】
セレクタSEL2は、PSEL出力を選択信号、CPU1/2バス権信号をデータ入力とする。この出力はライト許可信号となる。PSELが“0”のときはCPU1バス権で、CPU1がライト許可状態となる。PSELが“1”のときにはCPU2バス権で、CPU2がライト許可状態となる。
【0157】
DRリードバッファDRBUFは、セレクタSEL1の出力を入力し、DRリード信号RDDRをクロックとし、出力信号は内部データバスの所定のビットに接続される。このRDDRが活性状態のとき、セレクタSEL1の出力を内部データバスに出力する。
【0158】
PSELリードバッファPSBUFは、PSELフリップフロップの出力を入力し、PSELリード信号RDPSELをクロックとし、出力信号は内部データバスの所定のビットに接続される。このRDPSELが活性状態のとき、PSELフリップフロップの出力を内部データバスに出力する。
【0159】
論理積回路AND1は、ライト許可信号とDDRライト信号WRDDRを入力とし、出力信号はDDRの入力クロックとなる。
【0160】
論理積回路AND2は、ライト許可信号とDRライト信号WRDRを入力とし、出力信号はDRの入力クロックとなる。
【0161】
ROM1およびROM2をPROMとすることができ、このPROMを外部からプログラムするとき、2つのROMを外部から連続したアドレスとするようにするとよい。
【0162】
次に、図10によりPROMのアドレスマップを説明する。
【0163】
たとえば、PROM1は64kバイト、PROM2は32kバイトとする。MCUモードでは、PROM1はH’00000000〜H’0000FFFFに、PROM2はH’0000〜H’7FFFに配置される。
【0164】
また、PROMモードでは、PROM1はH’00000〜H’0FFFFに、PROM2はH’10000〜H’17FFFに配置される。
【0165】
次に、図11によりPROMモードを詳細に説明する。
【0166】
このPROMモードは、モード端子MD1、MD0、およびSTBY端子をいずれもロウレベルとすることによって設定される。このとき、図示はされないモード設定回路によって、内部信号EPMが活性状態(ハイレベル)とされる。このPROMモードのときには、CPU1/2はBUFC1/2によって、アドレスバス、データバスから切り離される。
【0167】
図11において、CS制御回路、バッファBUFC1/2などはバスコントローラに含まれてなる。
【0168】
PROMは、図1におけるROM1およびROM2とし、メモリアレイ、アドレスデコーダ、入出力回路、制御回路からなる。このアドレスデコーダにはアドレスが入力され、入出力回路はデータの入出力を行い、また制御回路は制御信号を入力し、入出力回路を制御してデータの書込み/読み出しなどを行う。また、メモリアレイは不揮発記憶素子が配列されている。
【0169】
制御回路には、EPM、CS−1/2#、OE#、PGM#、およびMS−1/2#、リード信号が入力される。このEPMが活性状態のとき、PROMとしての書込み/読み出し動作が、CS−1/2#、OE#、PGM#に基づいて行われる。また、EPMが非活性状態のときには、CPUのアドレス空間上でのROMとしての読み出し動作が、MS−1/2#、リード信号に基づいて行われる。
【0170】
PROMモードのとき、VPP、CS#、OE#、PGM#で制御される。このような制御は、たとえば1993年3月、(株)日立製作所発行『HITACHI IC Memory Data Book No.2(10th Edition)』P510〜P524に記載されるPROMと同様である。
【0171】
VPP端子はRES端子と、CS#、OE#、PGM#はP61、P62、P63端子と、アドレスA0−15はP00−07、P10−17端子と、A16はP60端子と、データD7−0はP40−P47端子と兼用にされている。なお、VPPは図示はされないが、PROM1/2に与えられる。
【0172】
内部信号としては、OE#、PGM#がバッファ回路を介して入力され、PROM1、PROM2に供給される。CS−1#は、アドレス上位信号A16の反転信号との論理積信号、CS−2#は、アドレス上位信号A15の反転信号、およびA16との論理積信号で生成される。このCS−1#、CS−2#が、それぞれPROM1、PROM2に与えられる。
【0173】
PROMモードのとき、IDB1とIDB2がバッファを介して接続される。PROM2のデータはIDB2、IDB1およびIOP3を介して入出力される。すなわち、CS−2#が活性状態で読み出し動作のとき、PROM2から読み出したIDB2の内容がIDB1に出力される。さらに、読み出し動作のとき、IDB1の内容がIOP3を介して外部に出力される。
【0174】
また、書込み動作のとき、外部の内容がIOP3を介してIDB1に入力される。CS−2#が活性状態で書込み動作のとき、IDB1の内容がIDB2に出力され、PROM2に与えられる。さらに、IDB1の内容がIOP3を介して外部に出力される。
【0175】
PROMモードのとき、IAB1とIAB2がバッファを介して接続される。すなわち、IOP1、2を介して入力されたIAB1のアドレスが、IAB2に入力され、PROM2に与えられる。なお、PROM1/2の最大容量が64kバイトであるので、それぞれのPROMに与えられるアドレスは16ビットである。
【0176】
たとえば、読み出し動作はCS−1/2#、OE#が活性状態、PGM#が非活性状態のときに行われ、書込み動作はCS−1/2#、PGM#が活性状態、OE#が非活性状態のときに行われる。
【0177】
その他、ベリファイやページ書込みなどが可能とされるが、本発明には直接の関係はないので、詳細な説明は省略する。
【0178】
1つのPROMモードで、PROM1、PROM2を、外面的には1つのPROMとして一括して書込むことができる。これによって、書込みを効率的に行うことができる。
【0179】
次に、図12によりテストモードを詳細に説明する。
【0180】
このテストモードは、モード端子MD1、MD0をいずれもロウレベル、およびSTBY端子をハイレベルとすることによって設定される。このとき、図示はされないモード設定回路によって、内部信号TMが活性状態(ハイレベル)とされる。
【0181】
図12において、制御回路1/2、バス権調停回路、選択回路、バッファBSBUF、バッファBUFC1/2はバスコントローラに含まれてなる。
【0182】
バス権調停回路は、CPU1/2のいずれが、PAB/PDBを使用するかを選択して制御信号PAKを出力する。このPAKがハイレベルのときはCPU1、PAKがロウレベルのときにはCPU2がPAB/PDBを使用する。テストモードの場合は、P62端子から与えられる選択信号によってPAK信号は制御される。
【0183】
テストモードのとき、CPU1/2はBUFC1/2によって、アドレスバス、データバス、リード信号/ライト信号から切り離される。
【0184】
アドレスはIOP3〜IOP0から、バッファBUFPを介してIAB1に入力され、さらにBSBUFを介してIAB2およびPABに入力される。なお、IAB1は4Gバイトのアドレス空間に対応して32本のアドレスを有するが、IAB2は64kバイトのアドレス空間に対応して16本、PABはRAMP、I/Oのアドレスに対応して10本のアドレスを有する。従って、外部からアドレスを与えるためにはIAB1を利用するのがよい。
【0185】
データバスは、IOP4によって、バッファBUFPを介してIDB1と入出力される。リード/ライト動作およびアドレスに対応して、IDB2またはPDBの内容がBSBUFを介してIDB1と入出力される。
【0186】
リード信号、ライト信号は、P60端子、P61端子からBUFPを介して入力される。RD1/2、WR1/2として、ROM1、RAM1/ROM2、RAM2に供給される。また、バス権信号PAKによって選択されてRDP、WRPとなって、RAMP、I/Oに供給される。テストモードにおいては、PAK信号によらず、RD1/2/Pは常に同様の動作となり、WR1/2/Pも常に同様の動作となる。
【0187】
制御回路1/2は、IAB1/2のアドレスに基づいて、選択信号MSROM1/2、MSRAM1/2、MSRAMP、MSIOを出力する。MSRAMP、MSIOは共通信号であるので、PAK信号に基づいて、一方が出力、他方はハイインピーダンスとなる。たとえば、PAK信号がハイレベルのときは制御回路1が出力し、制御回路2はハイインピーダンスとなる。
【0188】
また、テストモード時には、MSROM1/2、MSRAM1/2はPAK信号に基づいて一方が禁止される。これは外部から与えるアドレスに基づいて、1つの機能ブロックが選択されるようにするためである。たとえば、PAK信号がハイレベルのときはMSROM1、MSRAM1はIAB1に基づいた出力、MSROM2、MSRAM2は非活性状態とされる。
【0189】
ROM1/RAM1をテストする場合には、P62端子をハイレベルにして、PAK信号をハイレベルにした状態で、アドレス、リード信号/ライト信号を与えることによってリード/ライトを行うことができる。
【0190】
また、ROM2/RAM2をテストする場合には、P62端子をロウレベルにして、PAK信号をロウレベルにした状態で、アドレス、リード信号/ライト信号を与えることによってリード/ライトを行うことができる。このアドレスは下位16ビットのみが有効になる。
【0191】
さらに、RAMP/I/Oをテストする場合には、P62端子をハイレベルにして、PAK信号をハイレベルにした状態で、アドレス、リード信号/ライト信号を与えることによってリード/ライトを行うことができる。
【0192】
上記によって、CPUによってアドレスが与えられ、かつデータの入出力が行われるべき内部バスに、内蔵の機能ブロックを外部からリード/ライトするためのアドレスデータなどを外部から供給可能にして、この機能ブロックに必要なデータのリード/ライトを外部から直接行うことができるようにし、このシングルチップマイクロコンピュータに内蔵される機能ブロックのテストの容易化、ならびにテスティング効率の向上を実現できる。
【0193】
また、内蔵RAMをテストする場合、データのテストは独立して行い、アドレスデコーダのテストは並行して行うようにするとよい。このアドレスデコーダのテストを行うには、RAM1/2/Pを同時に選択可能にすることによって同時にテストを行うことができる。
【0194】
この場合に、図12に対してRAMテストモードを設ければよい。テストモードにした状態で、P63端子をロウレベルとすると前記同様のテストモード、P63端子をハイレベルにするとRAMテストモードとなる。
【0195】
このRAMテストモードでは、RAM1/2/Pの選択信号MSRAM1、MSRAM2、MSRAMPを同時に活性状態にすることができる。ただし、リードするデータはそれぞれ、ビット0〜1、ビット2〜3、ビット4〜7とする。
【0196】
CPU1とCPU2は、実質的に同一のCPUであるか、またはCPU1がCPU2を包含するようにし、ソフトウェアの開発環境を共有できるようにするのがよい。このようなCPUには、たとえば特願平4ー226447号がある。
【0197】
以上のようなシングルチップマイクロコンピュータを評価するエミュレータは、使用者が外部からブレーク条件を設定するとき、いずれのCPUにブレークを設定するかを指定可能にするとよい。また、2つのCPUの条件が両方成立したときにブレークするように指定可能にするとよい。
【0198】
次に、図13によりエミュレーション用プロセッサの構成を説明する。
【0199】
エミュレーション用プロセッサは、CPU1、CPU2を含むマイクロコンピュータ部分、および図示はされないバッファ回路などを含むエミュレーション用プロセッサ専用ブロックから構成され、公知の半導体製造技術によって1つの半導体基板上に形成されている。
【0200】
このエミュレーション用プロセッサは、応用システムと信号の送受信を行うユーザインタフェース、およびマイクロコンピュータ開発装置と信号の送受信を行うエミュレーションインタフェースを有している。
【0201】
エミュレーション用バスとしては、IAB1およびIDB1、IAB2およびIDB2をエミュレーションインタフェースを介して入出力する。また、PABおよびPDBのいずれのCPUが使用しているかを示すバス権表示信号を出力している。これは図13のPAK信号に相当するものとされる。また、バス権調停によって、CPUが待機状態とされていることを示す信号を出力している。
【0202】
PAB、PDBのアクセス状態は明示的には表示されないが、バス権表示信号とIAB1およびIDB1、IAB2およびIDB2によるエミュレーション用バスの内容によって判断することができる。このPAB、PDBによるエミュレーション用バスを出力しないことによって、エミュレーション用プロセッサの端子数を削減でき、これによってパッケージサイズを小さくして、ひいてはエミュレータのサイズを縮小できる。
【0203】
ブレーク要求端子は、BRK1#、BRK2#の2本がエミュレーションインタフェースに含まれてなる。これに基づいてBRK1、BRK2信号によって、それぞれCPU1、CPU2にブレーク割込を要求する。これらは対応するCPU選択ビットを持たず、優先順位判定回路を経て、割込要求信号と並列したCPUへのブレーク要求信号を活性状態にする。また、ベクタ番号信号は一般の割込要求と兼用される。
【0204】
CPU1、CPU2が、ブレーク割込を受け付けると、それぞれブレークアクノリッジ信号BRKAK1、BRKAK2が活性状態になる。たとえば、CPU2が、前記のようなSCIの受信処理、パルス出力処理を行っている場合、CPU1をブレーク割込によって停止しても、CPU2はユーザの処理を実行するためにSCIの受信を中断してしまい、いわゆるオーバランエラーが発生したり、パルス出力を中断してしまい、たとえばユーザシステムのモータ駆動ができなくなってしまうようなことを回避できる。
【0205】
次に、図14により、エミュレーション用プロセッサを搭載したエミュレータの構成を説明する。
【0206】
コネクタ部がシングルチップマイクロコンピュータの代わりに応用システム(ユーザシステム)に装着される。エミュレーション用プロセッサは、このコネクタ部とインタフェースケーブルを介し、ターゲットシステムインタフェースを用いて応用システムと信号の入出力を行う。
【0207】
また、エミュレーション用プロセッサはエミュレーションインタフェースを用いてエミュレーションバス1/2に接続される。このエミュレーションバス1がIAB1/IDB1に対応し、エミュレーションバス2がIAB2/IDB2に対応する。これらのエミュレーションバスには、図示はされない状態信号、制御信号などを含む。
【0208】
このエミュレーションバスを用いて、エミュレーション用プロセッサから、応用システムとエミュレーション用プロセッサの内部状態に応じた情報などが出力され、またエミュレーション用プロセッサに対し、エミュレーションのための各種制御信号が入力される。そして、エミュレーション用プロセッサの、図示はされないエミュレートモード端子が電源レベルに固定され、エミュレーション用プロセッサ内部ではエミュレートモードが設定される。
【0209】
また、エミュレーションバスには、特に制限はされないものの、応用システムまたはターゲットマイクロコンピュータ内蔵のメモリを代行するためのRAMでなるようなエミュレーションメモリと、エミュレーション用プロセッサの制御状態やエミュレーションバスの状態を監視して、その状態が予め設定された状態に達した時に、エミュレータ専用割込を入力して、CPUによるユーザプログラムの実行を停止させ、エミュレーション用プログラム実行状態に遷移させる(ブレーク)ためのブレーク制御回路が接続される。
【0210】
さらに、このエミュレーションバスには、CPUのリード動作またはライト動作を示す信号、命令リード動作を示す信号などに基づき、エミュレーションバスに与えられるアドレスやデータさらには制御情報を逐次蓄えるリアルタイムトレース回路などが接続される。本実施例においては、エミュレーションバス1/2がエミュレーションメモリ、ブレーク制御回路、リアルタイムトレース回路などにそれぞれ接続される。
【0211】
従って、エミュレーションメモリは、IAB1/IDB1およびIAB2/IDB2のデータを独立して並立的に入出力する。また、ブレーク制御回路は、IAB1/IDB1およびIAB2/IDB2のアドレス/データ、その他の情報を独立に判定する。このIAB1/IDB1側の条件が成立した後、IAB2/IDB2側の条件が成立したときにブレークを要求することが可能にされる。前記の通り、ブレーク割込はCPU1およびCPU2の両方に同時に要求することもできるし、一方のCPUのみに要求することもできる。
【0212】
また、リアルタイムトレース回路は、IAB1/IDB1およびIAB2/IDB2のアドレス/データ、その他の情報を独立に蓄積し、一方のCPUがブレークしたときには、他方のCPUのアドレス/データ、その他の情報のみを蓄積する。また、一方のCPUのみのアドレス/データ、その他の情報を選択的に蓄積することもできる。
【0213】
このエミュレーションメモリ、ブレーク制御回路、リアルタイムトレース回路はコントロールバスに接続され、コントロールバスを介してコントロールプロセッサの制御を受けるようになっている。このコントロールバスは、エミュレーション用プロセッサ制御回路に接続されるとともに、インタフェース回路を介して、特に制限はされないものの、パーソナルコンピュータなどのシステム開発装置に接続される。
【0214】
たとえば、システム開発装置から入力されたプログラムをエミュレーションメモリに転送し、内蔵ROM上に配置されるべきこのプログラムをCPUがリードすると、エミュレーションメモリ上のプログラムがリードされる。また、ブレーク条件や、リアルタイムトレース条件などもシステム開発装置から与えることができる。
【0215】
このブレーク条件としては、少なくとも、CPU1とCPU2の条件が独立して設定できるようにされる。また、リアルタイムトレース条件としては、少なくとも、CPU1とCPU2のアドレス/データ、その他の情報を同時に蓄積するか、選択的に一方のCPUのアドレス/データ、その他の情報のみを蓄積するかを選択できるようにする。
【0216】
従って、本実施例のシングルチップマイクロコンピュータによれば、データ処理装置としてのCPU1,CPU2、バス制御手段としてのバスコントローラ、読み出し可能な記憶手段としてのROM1,ROM2、データ入出力手段としてのIOP0〜IOP11を主要な構成とすることにより、以下の作用効果を得ることができる。
【0217】
(1).CPU1とROM1を接続するIAB1,IDB1と、CPU2とROM2を接続するIAB2,IDB2とを独立に設け、ROM1にCPU1のプログラムを、ROM2にCPU2のプログラムを格納することにより、CPU1とCPU2が並列動作することを可能にし、またRAMPとIOP0〜IOP11などによる入出力回路を共通のPAB,PDBに接続し、CPU1およびCPU2が利用可能とすることにより、CPU1とCPU2の制御すべきデータを任意に配分して利用することができる。これによって、シングルチップマイクロコンピュータの処理速度を向上し、資源利用効率を向上できる。
【0218】
(2).1つのシングルチップマイクロコンピュータで2つの処理を同時に行うことにより、従来の複数の半導体集積回路装置を利用していたシステムを代替して、小型化を実現することができる。
【0219】
(3).CPU1およびCPU2が、相互に割込を要求することを可能にすることにより、容易にCPU1,2の相互の同期を実現することができる。
【0220】
(4).CPU1およびCPU2の動作によって、ソフトウェアスタンバイのようなシングルチップマイクロコンピュータの全体を停止状態とする場合、SSBYビットを“1”にセットした状態で、一方のCPUがSLEEP命令を実行したときに、他方のCPUの状態に応じて、直ちにソフトウェアスタンバイ状態に遷移するか、一旦スリープ状態に遷移した後、他方のCPUがSLEEP命令を実行した後にソフトウェアスタンバイ状態に遷移するかが自動的に選択することによって、プログラムを作成する場合に、相互の動作状態を確認する必要がなく、プログラムの作成効率を向上することができる。
【0221】
(5).IOP0〜IOP11をビット単位で、いずれのCPU1,2が利用するかを指定するレジスタDRを設けることにより、1本の入出力ポートを2つのCPU1,2で利用することができ、資源の利用効率をより向上することができる。
【0222】
(6).割込を、いずれのCPU1,2に要求するかを指定するレジスタを割込許可回路に設けることにより、入出力回路を2つのCPU1,2で任意に配分して利用することができ、資源の利用効率をより向上することができる。
【0223】
(7).一方のCPUを、主に割込によるデータ転送を行うことに使用することにより、割込時の種々の処理を容易に行うことができる。
【0224】
(8).ROM1,2をPROMで構成した場合、PROMモード時にはROM1とROM2を連続したアドレスに配置することにより、ROM1とROM2を1つのPROMと互換性を持たせ、PROM書込みを効率化することができる。
【0225】
(9).1つの物理的アドレスに対応して、CPU1,2毎に異なる論理的アドレスを有する場合、または異なるCPU1,2の1つの論理的アドレスに対応して、異なる物理的アドレスを有する場合に、いずれの論理アドレスを使用するかを選択する制御信号を与えることによって、CPU1,2によってアドレスが与えられ、かつデータの入出力が行われるべき複数の内部バスに、外部から内蔵の機能ブロックをリード/ライトするためのアドレスデータなどを前記内部バスより少ないバッファ回路を介して供給可能にして、この機能ブロックに必要なデータのリード/ライトを外部から直接行うことができるようにし、このシングルチップマイクロコンピュータに内蔵される機能ブロックのテストの容易化、ならびにテスティング効率の向上を実現できる。
【0226】
(10). CPU1とCPU2の互換性を持たせることにより、開発効率を向上することができ、またサポートツールを共通化することを可能にし、開発装置の開発効率を向上することができる。これにより、使用者が必要とする開発装置の数を低減し、開発装置に必要な費用を低減することができる。
【0227】
(11). このシングルチップマイクロコンピュータのエミュレータにおいては、2つのCPU1,2を独立に停止する割込を有することにより、デバック効率を向上することができる。
【0228】
また、本実施例においては、図15に示すように、図1のシングルチップマイクロコンピュータに対して、ダイレクトメモリアクセスコントローラ(DMAC)がCPU1と同様にIAB1,IDB1に接続されて追加されることにより、CPU1とDMACを、バスコントローラのバス権調停に基づいて互いに排他的に動作させることができる。
【0229】
すなわち、DMACは、起動要因として、CPU1が所定の制御ビットを“1”にセットすることによって、データ転送を行うオートリクエストや、DMA要求端子に所定の信号が与えられたときに、データ転送を行う外部リクエスト機能を持ち、また転送モードとして、オートリクエストのとき、CPU1を停止してバスを専有してデータ転送を行うバーストモードや、1回の転送毎にバス権を解放してCPU1と交互に動作しつつ、データ転送を行うサイクルスチールモードを持つことにより可能となる。
【0230】
また、割込要求信号を起動要求信号として、データ転送を行うことができ、CPU2が割込でデータ転送を行うより高速のデータ転送が可能である。
【0231】
さらに、バス調停は、リード/ライトの競合時に行うほか、時分割で動作するようにしてもよい。たとえば、8ステート毎にCPU1およびCPU2にバス権を与える。また、8ステート間にバスが終了しなかった場合には、終了するまで動作する。たとえば、CPU1には4ステート、CPU2には12ステートずつバス権を与えてもよい。
【0232】
(実施例2)
図16は本発明の他の実施例であるシングルチップマイクロコンピュータを示すブロック図、図17は本実施例のシングルチップマイクロコンピュータにおけるバスの動作タイミング図である。
【0233】
本実施例のシングルチップマイクロコンピュータは、実施例1に対して、IAB1とIAB2、IDB1とIDB2が共通化されてIAB/IDBとされ、データバス幅を32ビットとし、同様にROM1とROM2、RAM1とRAM2が共通化されてリードオンリメモリ(ROM:読み出し可能な記憶手段)/ランダムアクセスメモリ(RAM)とされ、これらは32ビット同時にリード/ライト可能にしている。
【0234】
また、CPU1(第1のデータ処理装置)およびCPU2(第2のデータ処理装置)は時分割で、内部アドレスバス(IAB)/内部データバス(IDB)を利用して、ROM/RAMをリード/ライトする。前記の通り、これらのCPU1/2の命令は16ビット単位であり、最小命令を1ステートで実行する。
【0235】
すなわち、1つのCPU1/2に対して、命令については16ビットを1ステートでリードして、命令リード量と命令実行量が同等となる。32ビットで命令をリードすれば、命令リードの回数を半分にして、IAB/IDBおよびROM/RAMの使用頻度を1/2とすることができる。従って、CPU1およびCPU2が交互にIAB/IDBを利用してROMから命令を読み出すことができ、並列に実行可能とすることができる。
【0236】
実際には、分岐命令などのように32ビットで命令をリードしても、16ビットが無駄になってしまったり、データアクセスのときには使用頻度を減らせなっかたりして完全な並列動作はできないが、前記の通り命令のリード回数が多く、本実施例によっても、実施例1に対して処理速度をそれほど低下させることがない。また、ROM/RAMを共通化することによって、物理的規模を低下させたり、CPU1/2の使用するメモリ容量を任意に設定したりすることができる。
【0237】
次に、図17により内部バスの動作タイミングの一例を説明する。
【0238】
なお、CPU1/2のプログラムは図6と同様であり、バスの使用権は、前回バスを使用していたCPU1/2が非優先とされ、そのほかの場合にはCPU2を優先するものとする。
【0239】
たとえば、IAB1/2は、φ#に同期して出力され、またCPU1/2のROMおよびRAMに対するリードは、32ビット一括して1ステートで行われる。ただし、これは4の倍数番地から始まる32ビットデータに限定される。
【0240】
まず、IAB1/2はφ#に同期して、1ステート出力され、特に制限はされないものの、ROMおよびRAMの中でφに同期してラッチされる。これに対応するリードデータはφ#に同期して出力され、φ#が活性状態の期間にCPU1/2に取り込まれる。
【0241】
また、前記同様に、RAMPに対するリード/ライトは2ステート、I/Oに対するリード/ライトは3ステートで行われる。φ#に同期したIAB1/2は、バスコントローラでφに同期化される。この場合に、先頭命令の存在するアドレスm、nは4の倍数番地とされる。
【0242】
T1では、CPU1/2のROMからの命令フェッチが要求されるが、CPU2の命令フェッチが優先され、IABにアドレスmが出力される。
【0243】
T2では、ROMからIDBに読み出された命令コード(BCLR命令の第1、第2ワード)をCPU2が取り込むとともに、CPU1の命令フェッチのアドレスnがIABに出力される。
【0244】
T3では、ROMからIDBに読み出された命令コード(CMP、BEQ命令)をCPU1が取り込むとともに、CPU2はアドレスSSRをIABに出力する。自動的に、CPU2のPAB/PDBの使用が許可される。この場合に、SCIのリードが3ステート必要であるため、CPU2待機信号がハイレベルになる。
【0245】
T4では、IABの内容がPABに出力されて、SCIのレジスタSSRの内容がリードされる。このリードデータはT6で得られる。一方、CPU1が命令フェッチを要求するが、CPU2がバスを使用中であるので、保留とされ、CPU1待機信号がハイレベルになる。
【0246】
T5では、CPU1/2ともに待機状態とされる。
【0247】
T6では、SCIのレジスタSSRから読み出されたデータをPDB、IDBを介してCPU2が取り込む。また、CPU2は次の命令フェッチを要求するが、CPU1の命令フェッチが優先され、CPU1待機信号がロウレベルとなり、CPU2待機信号ハイレベルのままである。この場合に、CPU1の命令フェッチのアドレスn+4をIABに出力する。
【0248】
T7では、ROMからIDBに読み出された命令コード(BTST命令の第1ワード)をCPU1が取り込む。この場合に、CPU1は分岐先命令のフェッチを要求するが、CPU2の命令フェッチが優先され、CPU2待機信号がロウレベルとなり、CPU1待機信号ハイレベルになる。
【0249】
T8では、ROMからIDBに読み出された次の命令コードをCPU2が取り込む。この場合に、CPU1待機信号がロウレベルとなり、CPU1の命令フェッチのアドレスN1をIABに出力する。
【0250】
T9では、ROMからIDBに読み出された命令コードをCPU1が取り込むが、これは分岐条件が不成立で実行されない。先にフェッチ済みのBTST命令の第1ワードが有効になる。この場合に、CPU1は次の命令フェッチを要求するが、CPU2が優先され、CPU1待機信号ハイレベルになる。
【0251】
一方、CPU2はアドレスSSRをIABに出力する。自動的に、CPU2のPAB/PDBの使用が許可される。ここで、SCIのリードが3ステート必要であるため、CPU2待機信号がハイレベルになる。
【0252】
T10では、IABの内容がPABに出力され、CPU2はアドレスSSRにライトすべきデータをIDB経由PDBに出力する。ここで、CPU1は待機状態とされる。
【0253】
T11では、CPU2待機信号がロウレベルになる。
【0254】
T12では、CPU1待機信号がロウレベルとなり、CPU1の命令フェッチのアドレスn+6をIABに出力する。
【0255】
T13では、ROMからIDBに読み出された命令コード(BTST命令の第2ワード)をCPU1が取り込む。この場合に、CPU1はアドレスPORTのリードを要求し、CPU2はROMからの命令フェッチを要求するが、CPU2が優先され、CPU1待機信号ハイレベルになる。ここで、IABにCPU2の命令フェッチのアドレスm+8が出力される。
【0256】
T14では、ROMからIDBに読み出された次の命令コードをCPU2が取り込む。この場合に、CPU1はアドレスPORTをIABに出力する。ここで、入出力ポートのリードが3ステート必要であるため、CPU1待機信号が再度ハイレベルとなる。
【0257】
T15では、IABの内容がPABに出力されて、入出力ポートのレジスタPORTの内容がリードされる。このリードデータはT17で得られる。一方、CPU2が命令フェッチを要求するが、CPU1がバスを使用中であるので、保留とされ、CPU2待機信号がハイレベルになる。
【0258】
以上のように、本実施例においては、図6の実施例1に比較して、実行時間が長くなっているが、少なくとも1つのCPU1/2で実現する場合よりも短くできる。
【0259】
まず、割込やサブルーチン分岐などでCPU1/2の内部状態を退避したり、復帰したりする作業を除くことができる。また、2つのCPU1/2を単純に交互に動作するよりも短くできる。これは、ROMからCPU1/2が単位時間に実行できるより大きい量の命令を単位時間にリード可能にし、バスを使用しないでよい時間を作り、これを他方のCPU1/2が利用可能としているためである。
【0260】
これは、内蔵のROMにプログラムを配置する場合に特に有効であり、CPUがリード/ライトする大部分が命令のリードであることと、内部のメモリは外部のメモリに対して読み出し速度を向上しやすいこと、バスの幅を容易に広げられるためである。
【0261】
このとき、CPU2は、前記DMACやDTCのようなデータ処理装置またはデータ転送装置であっても、同様にCPU1の処理速度を低下することを最小限として、データ転送を行うことができる。特に、データ転送に先立って転送情報をRAMから読み出す必要がある前記DTCに特に有効である。
【0262】
従って、本実施例のシングルチップマイクロコンピュータによれば、データ処理装置としてのCPU1,CPU2、読み出し可能な記憶手段としてのROMを主要な構成とし、IAB/IDB、ROM/RAMを共通化することにより、実施例1に加えて以下の作用効果を得ることができる。
【0263】
すなわち、CPU1/2が単位時間に実行できる命令のバイト数より、大きなバイト数を単位時間でリード可能なIAB/IDBに、複数のCPU1/2を接続することにより、複数のCPU1/2が時分割的にIAB/IDBを利用して実質的に並立動作を可能にし、また共通のROM/RAMを任意に配分して利用し、シングルチップマイクロコンピュータの処理速度を向上し、資源利用効率を向上することができる。
【0264】
以上、本発明者によってなされた発明を実施例1および2に基づき具体的に説明したが、本発明は前記実施例に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。
【0265】
たとえば、バスの具体的な回路構成についても種々変更可能であり、IAB1、IDB1とPAB、PDBを直結してもよい。この場合には、CPU1とCPU2が並立的にプログラムを読み出して実行できるようにすればよく、これによって相互に動作を制約する頻度が高くなるが、物理的規模を縮小できる場合がある。
【0266】
また、RAM1、RAM2、RAMPを1つの機能ブロックとしてもよい。
【0267】
さらに、CPUの数も3個以上にすることができ、この場合には複数のCPUを第1のバスに接続して、バスを時分割で利用し、さらに別の単数または複数のCPUを第2のバスに接続してもよい。
【0268】
また、内蔵のROMはマスクROM、PROMの他、EEPROM、フラッシュメモリなどのCPUが実行すべきプログラムを格納するメモリであればよい。このROM1とROM2が異なっていてもよい。
【0269】
さらに、タイマ、SCIなどの割込を要求する機能ブロックあるいはパルス出力回路などの割込処理の対象となる機能ブロックの種類、機能、数などには何等制約されない。
【0270】
以上の説明では、主として本発明者によってなされた発明をその利用分野であるシングルチップマイクロコンピュータに適用した場合について説明したが、これに限定されるものではなく、その他の半導体集積回路装置にも適用可能であり、本発明は、少なくとも複数のデータ処理装置を内蔵した半導体集積回路装置に適用することができる。
【0271】
【発明の効果】
本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば、以下のとおりである。
【0272】
(1).2つのデータ処理装置に並立したバスによって独立した2つの読み出し可能な記憶手段に格納した命令をリード可能にしたり、バスの幅を拡張してデータ処理装置が単位時間に実行可能な命令数以上の命令をリード可能にして、2つのデータ処理装置を並立的に動作可能な命令を供給する機能を内蔵するシングルチップマイクロコンピュータまたは半導体集積回路装置において、複数の記憶手段を同時に選択可能とし、複数の記憶手段の同時書込みまたは同時読み出しを行うことによって割込によるデータ処理のチャネル数の制約をなくし、さらにデータ処理内容を任意とすることができるので、任意の転送処理の実現、物理的規模の縮小、転送チャネル数の制約解除、あるいはシングルチップマイクロコンピュータまたは半導体集積回路装置の製造費用の削減が可能となる。
【0273】
(2).前記(1) により、第1、第2のデータ処理装置を同時に動作させることができるので、シングルチップマイクロコンピュータまたは半導体集積回路装置の処理速度の向上が可能となる。
【0274】
(3).前記シングルチップマイクロコンピュータまたは半導体集積回路装置のエミュレーション用プロセッサ、さらにエミュレータによれば、2つのデータ処理装置を独立に停止させることができるので、デバック効率の向上を図ることが可能となる。
【図面の簡単な説明】
【図1】本発明の実施例1であるシングルチップマイクロコンピュータを示すブロック図である。
【図2】実施例1のシングルチップマイクロコンピュータにおける全体のアドレスマップの説明図である。
【図3】実施例1におけるシングルチップマイクロコンピュータのバスの接続状態のブロック図である。
【図4】実施例1における割込コントローラの概略ブロック図である。
【図5】実施例1における割込要求ビットおよび割込許可回路の概略ブロック図である。
【図6】実施例1におけるバスの動作タイミング図である。
【図7】実施例1における低消費電力状態制御回路の概略ブロック図である。
【図8】実施例1における入出力ポートを制御するレジスタ構成の説明図である。
【図9】実施例1における入出力ポートの概略ブロック図である。
【図10】実施例1におけるPROMのアドレスマップである。
【図11】実施例1におけるPROMモードの主要部のブロック図である。
【図12】実施例1におけるテストモードの主要部のブロック図である。
【図13】実施例1におけるエミュレーション用プロセッサの概略ブロック図である。
【図14】実施例1におけるエミュレータの概略ブロック図である。
【図15】実施例1におけるシングルチップマイクロコンピュータの変形例を示すブロック図である。
【図16】本発明の実施例2であるシングルチップマイクロコンピュータを示すブロック図である。
【図17】実施例2のシングルチップマイクロコンピュータにおけるバスの動作タイミング図である。
【符号の説明】
CPU1 中央処理装置(第1のデータ処理装置)
CPU2 中央処理装置(第2のデータ処理装置)
ROM1 リードオンリメモリ(第1の読み出し可能な記憶手段)
ROM2 リードオンリメモリ(第2の読み出し可能な記憶手段)
RAM1,RAM2,RAMP ランダムアクセスメモリ
SCI シリアルコミュニケーションインタフェース
A/D A/D変換器
IOP0〜IOP11 入出力ポート(データ入出力手段)
IAB1 内部アドレスバス(第1のバス)
IAB2 内部アドレスバス(第2のバス)
PAB 内部アドレスバス(第3のバス)
IDB1 内部データバス(第1のバス)
IDB2 内部データバス(第2のバス)
PDB 内部データバス(第3のバス)
DMAC ダイレクトメモリアクセスコントローラ
ROM リードオンリメモリ(読み出し可能な記憶手段)
RAM ランダムアクセスメモリ
IAB 内部アドレスバス
IDB 内部データバス[0001]
[Industrial application fields]
The present invention relates to a semiconductor integrated circuit device. For example, data transfer by a large number of interrupts in a single chip microcomputer and unique processing for each user can be performed, and the processing efficiency can be improved. The present invention relates to a semiconductor integrated circuit device capable of improving the debugging efficiency of a computer, and a technology effective when applied to an emulation processor and an emulator thereof.
[0002]
[Prior art]
For example, as described in “LSI Handbook” P540 and P541 issued by Ohm Co., Ltd. on November 30, 1984, a single-chip microcomputer is a ROM for holding a program centering on a central processing unit (CPU). Functional blocks such as a read only memory (RAM), a data holding RAM (random access memory), and an input / output circuit for inputting and outputting data are formed on one semiconductor substrate.
[0003]
Such a single-chip microcomputer has a built-in direct memory access controller (DMAC) and a built-in data transfer independent of the CPU. Wear manual "or Japanese Patent Application No. 4-137554. This DMAC can be activated by an interrupt request, can perform a repeat mode, a block transfer mode, and the like, and is suitable for control of a stepping motor and printer print data. For example, transfer of up to 8 channels can be performed.
[0004]
Further, since the DMAC transfer is independent of the CPU, it is only necessary to stop the CPU for the number of cycles necessary for the data transfer, and the CPU can continue the processing being executed. For example, when transferring byte data and incrementing a transfer source / destination address, in the above example, there are 6 data transfer states including 1 dead cycle state.
[0005]
[Problems to be solved by the invention]
However, since the DMAC as described above has a transfer source address, a transfer destination address, a transfer counter, and a control register in each channel, if a plurality of channels are to be transferred, a large number of registers must be provided. In other words, the logical and physical scales of the DMAC, and thus the entire semiconductor integrated circuit device, are increased. Furthermore, the increase in scale increases manufacturing costs. That is, it is difficult to transfer all of the interrupt factors or the majority of data.
[0006]
On the other hand, such a register is disposed on a general-purpose RAM having a high storage density, and a data transfer device that prevents an increase in logical / physical scale, that is, a so-called data transfer controller (DTC) is built in Showa 63 December, "H8 / 532 Hardware Manual" published by Hitachi, Ltd. In this DTC, data transfer can be performed by substantially all interrupt factors.
[0007]
However, since the register holding the transfer information is arranged on the general-purpose RAM, prior to data transfer, this register is read into the DTC, data transfer is performed according to the read contents, and the register information updated by the data transfer is further updated. It is necessary to save to RAM. During this period, the CPU must be stopped, and much time is spent reading and saving registers compared to data transfer.
[0008]
For this reason, the processing efficiency of the entire single-chip microcomputer or semiconductor integrated circuit device is lowered. For example, when transferring byte data and incrementing the transfer source / destination address, in the above example, 30 states are required for register reading / saving for 5 data transfer states, and the CPU is stopped for a total of 35 states. Will do.
[0009]
The control of the DMAC or DTC operation is specified by the contents of the control bit of the control register, and only the transfer mode and the activation factor can be selected. If the number of control bits is increased, transfer data addition (checksum), parity calculation, and the like can be performed, but it is difficult to perform specific processing for each user. If various processes are to be realized, the logical and physical scales of the circuits that control the processes will increase.
[0010]
Of course, the CPU can be used to perform a unique process for each user associated with data transfer. For example, when an interrupt occurs, the main process is interrupted and a desired process is performed. However, the main processing to be performed by the CPU must be interrupted, and the internal state of the CPU must be saved and restored, resulting in overhead and improving the processing performance of the entire single-chip microcomputer. You will not be able to.
[0011]
SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a single chip microcomputer or a semiconductor integrated circuit device which can perform data transfer by a large number of interrupts and unique processing for each user and can improve processing efficiency. is there.
[0012]
It is another object of the present invention to provide an emulation processor and emulator for a semiconductor integrated circuit device capable of improving the debugging efficiency of the single chip microcomputer.
[0013]
The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.
[0014]
[Means for Solving the Problems]
Of the inventions disclosed in this application, the outline of typical ones will be briefly described as follows.
[0015]
That is, the semiconductor integrated circuit device of the present invention is provided with the second data processing device, and the first bus used by the first data processing device can be separated from the second bus used by the second data processing device. The bus use of the first data processing device and the bus use of the second data processing device can be performed at the same time, and further necessary for the operations of the first data processing device and the second data processing device, respectively. Functional blocks or modules connected by respective first or second buses, and in particular, a first readable storage means capable of storing a program to be executed by the first data processing device and the second data processing device. A second readable storage means is provided, and the first data processing apparatus is programmed from the first readable storage means, and the second data processing apparatus is programmed from the second readable storage means. It is obtained so as to operate by reading the beam.
[0016]
In addition, the first and second data processing devices and the readable storage means common to them are connected to each other by a bus, and the first data processing device has a larger number of instructions than the instructions that can be executed in unit time. Is read from the storage means using the bus, and the second data processing apparatus instructs the second data processing apparatus to minimize the decrease in the instruction execution speed of the first data processing apparatus without continuously reading the storage means using the bus. Is read from the storage means.
[0017]
In this case, among the interrupt factors, the first factor can be requested to the first data processing device, and the second factor can be requested to the second data processing device. The address space may include the address space of the second data processing device, and the input / output means is readable / writable from the first data processing device and the second data processing device. Is provided with a function for adjusting the operation.
[0018]
The emulation processor for evaluating the semiconductor integrated circuit device outputs a signal indicating which data processing device is using the bus on which the first and second data processing devices operate exclusively. , First and second break interrupt input terminals for stopping the first and second data processing devices.
[0019]
Furthermore, an emulator equipped with this processor determines whether the operation information of the first and second data processing devices is stored in the storage means at the same time, or whether the operation information of one data processing device is selectively stored in the storage means. Means for selecting based on designation from system development device, or means for independently setting conditions for requesting break interrupt to first and second data processing devices based on designation from system development device It is what has.
[0020]
[Action]
According to the semiconductor integrated circuit device described above, the data processing device can be read by making it possible to read instructions stored in two independent readable storage means by buses juxtaposed to the two data processing devices, or by expanding the bus width. By making it possible to read more instructions than the number of instructions that can be executed per unit time, or by incorporating a function that supplies instructions that can operate two data processing devices in parallel, a plurality of storage means can be selected simultaneously. By simultaneously writing or simultaneously reading a plurality of storage means, the restriction on the number of channels of data processing due to interrupts can be eliminated, and the data processing contents can be made arbitrary.
[0021]
In addition, since the first and second data processing devices operate simultaneously, the processing speed of the single chip microcomputer or the semiconductor integrated circuit device can be improved.
[0022]
Furthermore, according to the emulation processor and the emulator equipped with the emulation processor, the first data processing device can be stopped by the first break interrupt, and the second data processing device can be stopped by the second break interrupt. Thus, debugging efficiency can be improved by having an interrupt for independently stopping the two data processing devices.
[0023]
【Example】
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0024]
Example 1
FIG. 1 is a block diagram showing a single chip microcomputer according to an embodiment of the present invention, FIG. 2 is an explanatory diagram of an entire address map in the single chip microcomputer of the present embodiment, and FIG. 3 is a bus diagram of the single chip microcomputer. FIG. 4 is a schematic block diagram of the interrupt controller, FIG. 5 is a schematic block diagram of the interrupt request bit and interrupt permission circuit, FIG. 6 is a bus operation timing diagram, and FIG. 7 is a low power consumption state. 8 is a schematic block diagram of the control circuit, FIG. 8 is an explanatory diagram of a register configuration for controlling the input / output port, FIG. 9 is a schematic block diagram of the input / output port, FIG. 10 is an address map of the PROM, and FIG. FIG. 12 is a block diagram of the main part of the test mode, and FIG. 13 is a schematic block of the emulation processor. 14 shows a schematic block diagram of the emulator, FIG. 15 is a block diagram showing a modification of the single-chip microcomputer according to the present embodiment.
[0025]
First, the configuration of the single chip microcomputer of this embodiment will be described with reference to FIG.
[0026]
The single-chip microcomputer of this embodiment includes a central processing unit (CPU1: first data processing device, CPU2: second data processing device), read-only memory (ROM1: first readable storage means, ROM2: Second readable storage means), random access memory (RAM1, RAM2, RAMP), timer, pulse output circuit, serial communication interface (SCI), A / D converter (A / D), input / output port (IOP0) ~ IOP11: data input / output means), interrupt controller (interrupt control means), bus controller (bus control means), and clock oscillator functional block (or module), formed on one semiconductor substrate .
[0027]
These functional blocks are connected to each other by an internal bus. The internal bus includes a read signal and a write signal in addition to an address bus and a data bus, and may further include a bus size signal or a system clock. The internal address bus includes IAB1 (first bus), IAB2 (second bus), and PAB (third bus), and the internal data bus includes IDB1 (first bus) and IDB2 ( A second bus) and a PDB (third bus). The internal data buses IDB1, IDB2, and PDB have a 16-bit configuration. The instructions of CPU1 and CPU2 are in units of 16 bits.
[0028]
CPU1, ROM1, and RAM1 are connected to IAB1 and IDB1, and CPU2, ROM2, and RAM2 are connected to IAB2 and IDB2. RAMP is connected to PAB and PDB. These IAB1, IAB2, and PAB are interfaced by a bus controller, and similarly, IDB1, IDB2, and PDB are interfaced by a bus controller.
[0029]
PAB and PDB are connected to a bus controller, RAMP, timer, pulse output circuit, SCI, A / D converter, interrupt controller, and IOP0 to IOP11. Either one of CPU1 and CPU2 can read / write these using PAB and PDB. The interrupt controller inputs an interrupt signal output from the timer, SCI, and input / output port, and outputs an interrupt request signal and a vector number to the CPU 1 or CPU 2.
[0030]
The input / output port is also used as an external bus signal and an input / output signal of the input / output circuit. IOP0-3 are used as address bus outputs, IOP4, 5 are used as data bus input / output, and IOP6 is also used as bus control signal input / output signal. The external address and the external data are connected to IAB1 and IDB1 via buffer circuits included in these input / output ports, respectively. PAB and PDB are used to read / write the registers of the input / output ports, and are not directly related to the external bus.
[0031]
The bus control signal output includes an address strobe, a high / low data strobe, a read strobe, a write strobe, and a bus acknowledge signal. The bus control input signal includes a wait signal and a bus request signal. These input / output signals are not shown. The expansion of the external bus is selected by an operation mode or the like, and the functions of these input / output ports are also selected.
[0032]
Also, IOP7 is a timer input / output, IOP8 is a pulse output, IOP9 is an SCI input / output, IOP10 is an analog input, and IOP11 is also used as an external interrupt request (IRQ) input. The input / output signals of the timer, SCI, A / D converter and IOP7, IOP9, IOP10 are not shown.
[0033]
In addition, there are input terminals such as power supply terminals Vcc, Vss, analog power supply terminals AVcc, AVss, reset input RES, standby input STBY, interrupt input NMI, clock input EXTAL, XTAL, operation mode inputs MD0, MD1, MD2.
[0034]
The pulse output circuit outputs the content held in a register (NDR) (not shown) from a terminal also serving as IOP8 in accordance with a trigger signal given from the timer.
[0035]
Next, an address map of the single chip microcomputer will be described with reference to FIG.
[0036]
For example, CPU 1 has a 4 Gbyte address space, and CPU 2 has a 64 kbyte address space. ROM1 and RAM1 exist only in the address space of CPU1, and ROM2 and RAM2 exist only in the address space of CPU2. The RAMP indicated by the hatched portion, the address of each functional block of the timer, pulse output circuit, SCI, A / D converter, IOP0 to 11, and interrupt controller, that is, the internal register, for each physical address, Have a unique logical address on the address space of the CPU.
[0037]
These addresses are associated with each other, and specifically, an address obtained by adding H′FFFF above the address of CPU 2 becomes the address of CPU 1. For example, the start address of RAMP is H′FFFFFB80 for CPU1 and H′FB80 for CPU2.
[0038]
That is, the CPU 1 can read / write ROM1, RAM1, RAMP, and internal registers, and the CPU2 can read / write ROM2, RAM2, RAMP, and internal registers.
[0039]
Next, the connection state of the address bus and data bus of this single chip microcomputer will be described with reference to FIG.
[0040]
In FIG. 3, I / O includes the functional blocks of the timer, pulse output circuit, SCI, A / D converter, IOP 0 to 11, and interrupt controller of FIG. Since the clock oscillator is not connected to the bus, it is omitted.
[0041]
As the address bus and data bus, there are CPU1, ROM1, RAM1, IAB1 connecting the outside, IAB2 connecting CPU2, ROM2, RAM2, and PAB connecting RAMP, I / O. Such an address bus and data bus are interfaced by a bus controller (BSC).
[0042]
For example, when the CPU 1 reads a program from the ROM 1 or reads / writes data from / to the RAM 1, the operation is performed using the IAB1 and IDB1. The CPU 1 does not use PAB and PDB.
[0043]
On the other hand, when the CPU 2 reads a program from the ROM 2 or reads / writes data from / to the RAM 2, the operation is performed using the IAB2 and IDB2. The CPU 2 does not use PAB and PDB. At this time, the CPU 1 and the CPU 2 operate using mutually independent buses and can operate in parallel.
[0044]
When either one of the CPU 1 and the CPU 2 reads / writes data to / from the RAMP or the I / O, the bus right arbitration is performed. In this case, the bus right request by the CPU 2 has priority over the bus right request by the CPU 1. This bus arbitration is performed by the bus controller based on the address indicated by IAB1 / IAB2 and the command signal output by the CPU1 / 2. The command signal includes a read request, a write request, a size signal, and the like.
[0045]
If one side reads / writes data to / from RAMP or I / O and the other side attempts to read / write data to / from RAMP or I / O, the latter continues until the former read / write is completed. Is given a standby signal to enter a standby state. For example, the CPU 1 can read / write the ROM 1 and RAM 1 while the CPU 2 is reading / writing data with RAMP or I / O.
[0046]
Furthermore, if CPU 1 and CPU 2 try to read / write data to / from RAMP or I / O at the same time, one CPU will be in a stopped state, but the program will not be placed in RAMP or I / O. As a result, data read / write with RAMP or I / O can be limited to data only, and the frequency can be reduced.
[0047]
In this case, since data read / write is performed based on the read instruction, the ratio of the number of instruction read and data read / write does not become 1/2 or more. Further, since all programs are not configured by data read / write instructions, the ratio can be further reduced. Generally, it is considered to be about 1/4 to 1/5. The same is shown by the program described in this embodiment. Therefore, the parallel operability of CPU1 and CPU2 can be improved.
[0048]
In order to effectively use such parallel operation, the CPU 1 performs overall settings and main program processing using the ROM 1, RAM 1 or an external device, and the CPU 2 performs sequential control of I / O. It is good to do so. In addition, CPU instructions may be arranged in the ROM 1 or the ROM 2 and the work area may be arranged in the RAM 1 or the RAM 2.
[0049]
Next, the interrupt controller will be described in detail with reference to FIG.
[0050]
For example, there are two types of interrupt factors, internal interrupts and external interrupts, each having an interrupt factor flag. This internal interrupt factor flag is set to “1” when the timer, SCI, and A / D converter input / output circuits are in a predetermined state, and the external interrupt factor flag is external interrupt. Set to “1” when the input terminal reaches a predetermined level or when a predetermined signal change occurs. This interrupt factor flag is cleared to “0” by the write operation of the CPU 1/2.
[0051]
The output of each bit of the interrupt factor flag is input to the interrupt permission circuit, and the content of the interrupt permission register, that is, the interrupt permission bit is further input to this interrupt permission circuit. This interrupt permission register is a register that can be read / written by the CPU 1/2, and selects whether to permit or prohibit the corresponding interrupt.
[0052]
For example, if the interrupt factor flag is set to “1” and the interrupt permission bit is set to “1”, an interrupt is requested. That is, the interrupt permission circuit is configured by a logical product circuit having the corresponding interrupt factor flag and the interrupt permission bit as inputs.
[0053]
The output of the interrupt permission circuit is input to the CPU selection circuit, and the contents of the interrupt selection register IRQSEL are further input to this CPU selection circuit. This interrupt selection register selects whether the CPU 1 or the CPU 2 is permitted to interrupt when an interrupt is requested.
[0054]
For example, if the bit of the interrupt selection register is set to “1”, the CPU 2 is requested to interrupt. When the bit of the interrupt selection register is cleared to “0”, the CPU 1 is requested to interrupt. That is, the CPU selection circuit includes a logical product circuit of the corresponding interrupt signal and the interrupt selection bit, and a logical product circuit of the interrupt signal and the inverted signal of the interrupt selection bit. The output of the former AND circuit is a CPU2 interrupt request signal, and the output of the latter AND circuit is a CPU1 interrupt request signal.
[0055]
As for the output of the CPU selection circuit, the CPU1 interrupt request and the CPU2 interrupt request are independently input to the priority determination circuit, and the output of the priority register is further input to this priority determination circuit. This priority register sets, for example, two levels of priority for each group of interrupt factors.
[0056]
In this case, the priority order is determined for each CPU1 / 2 interrupt request. As a result of this determination, the highest priority is selected, a vector number is generated, and each vector number of the CPU1 / 2 interrupt request is output.
[0057]
The CPU1 / 2 interrupt request signal and vector number are input to the mask level determination circuit, and the corresponding CPU1 / 2 interrupt mask bits are input to the mask level determination circuit. Here, if the requested interrupt is below the interrupt mask level of the CPU, it is suspended. Then, an interrupt request signal and a vector number are output to each of CPU 1/2. CPU 1 has 2 mask bits, but CPU 2 has 1 mask bit.
[0058]
Furthermore, when the interrupt request signal for each CPU becomes active, this CPU starts interrupt exception processing at the end of the instruction being executed, extracts the branch destination address from the vector address corresponding to the vector number, and interrupts. Branch to the load processing routine.
[0059]
Since such priority determination and interrupt mask level are known in March 1993, published by Hitachi, Ltd. “H8 / 3003 Hardware Manual” or Japanese Patent Application No. 4-137955, etc. Detailed description is omitted.
[0060]
Further, the vector number is constant regardless of whether the CPU 1 or the CPU 2 is required. However, corresponding to the size of the address space, the vector address is in units of 4 bytes in CPU 1 and in units of 2 bytes in CPU 2.
[0061]
The non-maskable interrupt NMI is input from one terminal NMI, but can request interrupts from two CPUs simultaneously. This does not have a corresponding interrupt enable bit. This NMI interrupt is used to forcibly stop the processing of the CPU when the single-chip microcomputer or the semiconductor integrated circuit is out of control because of its non-maskable characteristics. It is convenient to request NMI interrupts to both CPUs 2. Compared to using at least two terminals, one terminal can be saved and used effectively as an input / output port or the like.
[0062]
The interrupt factor flag has an interrupt request bit that can be written by the CPU 2. When this interrupt permission bit is set to “1”, the CPU 1 can be requested to interrupt. The interrupt request bit can be set to “1” from the CPU 2 and can be cleared to “0” from the CPU 1. When the CPU 1 clears to “0”, it is necessary to read “1” in advance and then write “0”.
[0063]
Next, the interrupt request bit and the interrupt permission circuit in the interrupt controller will be described in detail with reference to FIG.
[0064]
For example, two flip-flops FF1 and FF2 are included. The FF1 constitutes an interrupt request bit, and a reset signal RESET is input as the clear signal CLR. The output of the AND circuit AND1 is input to the set signal S, the output of the AND circuit AND3A is input to the reset signal R, and the output Q is output as an interrupt request via the AND circuit AND4. In addition, it is input to the AND circuit AND2 and the output buffer.
[0065]
The AND circuit AND1 receives the bus right signal of the CPU 2, the register write signal, and predetermined bits of the internal data bus. The register read / register write signal is a signal generated by a logical product of the read signal / write signal and a signal indicating that the register is selected by decoding the address. For example, the register write signal becomes active “1” when CPU 2 or CPU 1 writes to the address of this interrupt request bit.
[0066]
The FF2 controls the interrupt request bit, and the reset signal RESET is input as the clear signal CLR. Further, the output of the AND circuit AND2 is input to the set signal S, the output of the AND circuit AND3A is input to the reset signal R, and the output Q is input to the AND circuit AND3A.
[0067]
The output of FF1, the bus right signal of CPU1, and the register read signal are input to the AND circuit AND2.
[0068]
The AND circuit AND3A receives the output of FF2, the inversion of a predetermined bit of the internal data bus, and the output of AND3B. The bus right signal and register write signal of the CPU 1 are input to the AND 3B.
[0069]
The AND circuit AND4 receives an output of the FF1 and an interrupt permission signal which is an output of a predetermined bit of an interrupt permission register (not shown), and the output is an interrupt request signal. Note that the selection bit is not provided, and it is always necessary to request the CPU 1 for an interrupt.
[0070]
The output buffer inputs the output of FF1 as data, and inputs the register read signal as a clock signal. This output is coupled to a predetermined bit of the internal data bus.
[0071]
Therefore, when the CPU 2 writes “1” to the address of the interrupt request bit, the output of the AND1 becomes “1” and the FF1 is set to “1”. As described above, when the predetermined bit of the interrupt permission register is set to “1”, the CPU 1 is requested to interrupt.
[0072]
Further, when the CPU 1 reads the address of the interrupt request bit in this state, the contents of the interrupt request bit are output to the data bus via the output buffer, and the output of the AND2 becomes “1”, so that the FF2 becomes “ Set to 1 ″.
[0073]
Subsequently, when the CPU 1 writes “0” to the interrupt request bit, the output of the AND3A becomes “1”, and FF1 and FF2 are cleared to “0”. Similarly, the CPU 1 has an interrupt request bit that can be written, and this interrupt permission bit can be written only from the CPU 2 and can request the CPU 2 to interrupt.
[0074]
In the so-called read modify write instruction, it is preferable not to release the bus between read and write. For example, the bit set instruction fetches data at a specified address into the CPU in byte size, sets 1 bit specified in the CPU to “1”, and writes the data in byte size.
[0075]
The PAB and PDB are not released to the other CPU between this read and write. The signal prohibiting the release of the bus can be included in the command signal output from the CPU 1/2 to the bus controller.
[0076]
Next, an example of the operation timing of the internal bus will be described with reference to FIG.
[0077]
The single-chip microcomputer of this embodiment operates in synchronization with, for example, the system clock φ, IAB1 / 2 is output in synchronization with φ # which is an inverted signal of φ, and ROM1 / 2 and RAM1 of CPU1 / 2. Reading for / 2 is performed in one state.
[0078]
First, IAB1 / 2 is output in one state in synchronization with φ #, and is not particularly limited, but is latched in ROM1 / 2 and RAM1 / 2 in synchronization with φ. Read data corresponding to this is output in synchronization with φ #, and φ # is taken into the CPU during the active period. For example, the data corresponding to the address output to IAB1 / 2 in synchronization with φ # of T1 is taken into CPU 1/2 during the period in which φ # of T2 is active.
[0079]
On the other hand, read / write with respect to RAMP is performed in two states, and read / write with respect to I / O is performed in three states. The IAB1 / 2 synchronized with φ # is synchronized with φ by the bus controller.
[0080]
In this case, the program of the CPU 1 is as follows. The instruction notation is the same as that of the CPU described in “H8 / 300 Series Programming Manual” issued by Hitachi, Ltd. in July 1989.
[0081]
CMP. B #CODE, R0L
BEQ N1
BTST # 0, @PORT
BNE N2
For example, the CMP, BEQ, and BNE instructions are 2 bytes long, and the TST instruction is 4 bytes long.
[0082]
First, a CMP instruction is read from address n. When the execution of the CMP instruction is started, the BEQ instruction is first read from the address n + 2, and the immediate data CODE and the contents of the general-purpose register R0L are internally compared and reflected in the condition code.
[0083]
Further, when the execution of the BEQ instruction is started, first, the BTST instruction is read from the address n + 4. Next, an instruction is read from the branch destination address N1, and it is determined whether the comparison results match. If they do not match, the instruction at address N1 is ignored and the already read BTST instruction is executed.
[0084]
Subsequently, the second word of the BTST instruction is read. When this BTST instruction is executed, data is read in byte size from the I / O specified by the absolute address PORT using PAB / PDB. Next, a BNE instruction is prefetched from address n + 6.
[0085]
The program of the CPU 2 is as follows.
[0086]
BCLR #RDRF, @SSR
For example, the BCLR instruction is 4 bytes long.
[0087]
First, a BCLR instruction is read from address m and address m + 2. When the execution of the BCLR instruction is started, data is first read in byte size using PAB / PDB from the I / O specified by the absolute address SSR.
[0088]
Subsequently, the next instruction is prefetched from the address m + 4, and the bit designated by the immediate data RDRF of the read data is cleared to “0”. This data is written to the I / O specified by the absolute address SSR using PAB / PDB. The execution of the next instruction is started, and the next instruction is prefetched from the address m + 6.
[0089]
At T1, instruction fetch from ROM1 / 2 of CPU1 / 2 is performed, and an address is output to IAB1 / 2.
[0090]
At T2, the instruction codes (CMP instruction, first word of the BCLR instruction) read from ROM 1/2 to IDB 1/2 are fetched by CPU 1/2, and the next instruction fetch address is output to IAB 1/2. The
[0091]
At T3, the CPU 1/2 fetches the instruction code (the BEQ instruction and the second word of the BCLR instruction) read from the ROM 1/2 to the IDB 1/2, the CPU 1 receives the next instruction fetch address, and the CPU 2 addresses Each SSR is output to IAB1 / 2.
[0092]
In this case, since only the CPU 2 uses the PAB / PDB, the use of the PAB / PDB of the CPU 2 is permitted. Here, since the SCI read requires three states, the CPU2 standby signal becomes high level.
[0093]
At T4, the bus right signal goes low, indicating the use of PAB / PDB of CPU2. The contents of IAB2 are output to PAB, and the contents of SCI register SSR are read. This read data is obtained at T6.
[0094]
In this case, the CPU 1 fetches the instruction code read from the ROM 1 to the IDB 1 (first word of the BTST instruction), and the CPU 1 outputs the branch destination address N1 to the IAB 1 (second word of the BTST instruction).
[0095]
At T5, the CPU 1 fetches the instruction code read from the ROM 1 to the IDB 1, but this is not executed because the branch condition is not satisfied. The first word of the previously fetched BTST instruction becomes valid. In this case, the CPU 1 outputs the next instruction fetch address to the IAB 1.
[0096]
At T6, the CPU 2 fetches the data read from the SCI register SSR via the PDB and IDB2. Further, the CPU2 standby signal becomes low level, and the next instruction fetch address is output to IAB2.
[0097]
In this case, the CPU 1 outputs the address PORT to the IAB 1, and since the use of the PAB / PDB of the CPU 2 is finished, the use of the PAB / PDB of the CPU 1 is permitted. Here, since the PORT read requires three states, the CPU1 standby signal becomes high level.
[0098]
At T7, the bus right signal goes high, indicating the use of PAB / PDB of CPU1. The contents of IAB1 are output to PAB, and the contents of register PORT of the input / output port are read. This read data is obtained at T9.
[0099]
In this case, the CPU1 standby signal becomes low level, the next instruction fetch address is output to IAB1, and CPU2 outputs the address SSR to IAB2. Here, since the CPU 1 is using PAB / PDB, the operation of the CPU 2 is suspended, and the CPU 2 standby signal becomes high level.
[0100]
At T8, the CPU 2 outputs data to be written to the address SSR to the IDB2.
[0101]
At T9, the CPU 1 takes in data read from the register PORT of the input / output port via the PDB and IDB2. The CPU 1 outputs the next instruction fetch address to the IAB 1. In this case, the CPU1 standby signal goes low, and the next instruction fetch address is output to IAB1.
[0102]
At T10, the CPU 1 captures the instruction code (BNE instruction) read from the ROM 1 to the IDB 1. The address of the next instruction fetch is output to IAB1. In this case, the bus right signal becomes low level, and the use of the PAB / PDB of the CPU 2 is displayed. The contents of IAB2 are output to PAB, and the contents of IDB2 are written to SCI register SSR.
[0103]
A write operation is performed at T11 and T12. In this case, the CPU2 standby signal becomes low level at T12, and the address of the next instruction fetch is output to IAB2. The CPU 1 repeats the same operation as described above.
[0104]
Note that the CPU 1 can be an external CPU, and an external CPU can read / write the common part as a peripheral function. Further, when the CPU 2 reads / writes the common part, the wait signal is activated in the external CPU and waits. At this time, the single chip microcomputer outputs an interrupt signal to the external CPU.
[0105]
Next, a data transfer program example is shown below. Here, the checksum of the SCI received data is performed, and the result is stored in the work address SUM arranged on the built-in RAM 2. Further, it is assumed that the number of received data is stored in the work address SUM arranged on the built-in RAM 2.
[0106]
In addition, the work address CNT for storing the number of transfers, the SCI reception data register RDR, the status register SSR, and the interrupt controller's interrupt selection register IRQSEL are used.
[0107]
Figure 0003839068
First, the CPU 2 requests the reception completion interrupt RXI, and branches to an interrupt routine. First, the general-purpose register R0 is saved on the stack (1). Then, the contents of the SCI reception data register RDR are read into the lower 8 bits R0L of the general-purpose register R0 (2).
[0108]
Further, the contents of the work address SUM arranged on the built-in RAM 2 are read into the upper 8 bits R0H of the general-purpose register R0 (3). Then, the contents of R0H and R0L are added (4). The addition result is written to the address SUM (5).
[0109]
Further, the contents of the work address CNT arranged on the built-in RAM 2 are read into the general-purpose register R0H (6). Then, the contents of R0H are decremented (-1) (7). The decrement result is written to the address CNT (8).
[0110]
If this content is "0", the process branches to L1 (9), and the bit corresponding to the reception completion interrupt RXI of the interrupt selection register IRQSEL is inverted (12). At this time, since the interrupt request flag RDRF remains set to “1”, the reception completion interrupt RXI is requested to the CPU 1. Then, the process returns from the interrupt routine (13).
[0111]
If the content written in the address CNT is not “0” (9), the interrupt request flag RDRF is cleared to “0” (10). Then, after executing the branch instruction (11), the process returns from the interrupt routine (13).
[0112]
Also, the address determination for multiprocessor reception can be performed by the following program example. In this case, if the received address matches its own address as a result of the address determination, the request destination of the reception completion interrupt is changed to the CPU 1.
[0113]
Figure 0003839068
First, the CPU 2 requests the reception completion interrupt RXI, and branches to an interrupt routine. First, the general-purpose register R0 is saved on the stack (1). Then, the contents of the SCI reception data register RDR are read into the lower 8 bits R0L of the general-purpose register R0 (2).
[0114]
This content is compared with the ID of the multiprocessor reception (3). As a result, if they match, the process branches to L1 (4), and the bit corresponding to the reception completion interrupt RXI of the interrupt selection register IRQSEL is inverted (7). At this time, since the interrupt request flag RDRF remains set to “1”, the reception completion interrupt RXI is requested to the CPU 1. Then, the process returns from the interrupt routine (8).
[0115]
If the result of comparison with its own ID does not match (4), the interrupt request flag is cleared to “0” (5). Then, after executing the branch instruction (6), the process returns from the interrupt routine (8).
[0116]
In this case, a plurality of transfers can be performed with one interrupt. For example, a stepping motor can be driven and this acceleration / deceleration can be performed. In addition, for each compare match interrupt OCMI of the timer, the data output from the port is updated to drive the motor. Further, the contents of the compare register can be updated to change the data output cycle to perform acceleration / deceleration.
[0117]
For the display of this state, the contents of the work address UPDW arranged on the built-in RAM 2 are used. When this bit 6 is cleared to “0”, the operation is constant speed. When it is set to “1”, acceleration or deceleration is performed. That is, when bit 7 is cleared to “0”, deceleration is performed. When it is set to “1”, the acceleration operation is performed. The initial value is set to “1” for both bits 6 and 7.
[0118]
The next output pulse is stored in the next data register NDR of the pulse output circuit, and the pulse output cycle is set in the constant register OCR of the timer. When the timer counter matches the value of the constant register, a compare match signal (not shown) is generated, and the contents of NDR are output from a terminal shared with IOP8. At the same time, the value of the timer counter is cleared to zero. This NDR is 4 bits.
[0119]
Such pulse output is the same as that of Japanese Patent Application No. 4-117969.
[0120]
PUSH R0 (1)
MOV. B @NDR, R0L (2)
ROTL. B R0L (3)
BLD # 4, R0L (4)
BST # 0, R0L (5)
MOV. BR0L, @NDR (6)
First, the CPU 2 requests the compare match interrupt OCMI, and branches to an interrupt routine. First, the general-purpose register R0 is saved on the stack (1). Then, the contents of the next data register NDR are read into the lower 8 bits R0L of the general register R0 (2).
[0121]
This content is rotated (3). Here, in order to perform rotation in units of 4 bits, the rotated bit 4 is stored in the carry flag (4), and this carry flag is stored in bit 0 (5). The result of completion of this 4-bit unit rotation is written to the NDR (6). This content is output from the terminal at the next compare match.
[0122]
Figure 0003839068
Subsequently, the content of bit 6 of the address UPDW is inspected (7). If this content is "0" (constant speed operation), the process branches to L3 (8), and the content of the constant register OCR is held. If not "0", the contents of the constant data register OCR are read into the general-purpose register R0 (9).
[0123]
Further, the content of bit 7 of the address UPDW is inspected (10). If this content is “0” (deceleration operation), the process branches to L1 (11), and if not “0” (acceleration operation), The numerical value CNST is subtracted from the general-purpose register R0 (12) and branched to L2 (13). In L1, the constant value CNST is added to the general register R0 (14), and in L3, the contents of the general register R0 are written to the constant register OCR (15).
[0124]
Figure 0003839068
Subsequently, the contents of the address CNT are read into the general-purpose register R0H (16). The content R0H is decremented (-1) (17). If this content is not "0", the process branches to L5 (18), and if "0", the content of bit 6 of the address UPDW is inspected (19).
[0125]
Further, if this content is “0” (constant speed operation), the process branches to L6 (20). If not “0”, the content of bit 7 is inspected (21), and further this content is “0”. If (deceleration operation), branch to L6 (22), if not "0" (acceleration operation), clear bit 6 of address UPDW to "0" and transition to constant speed operation (23) Then, the rotational speed CNT1 of the low speed operation is set to R0H (24). And it branches to L5 (25).
[0126]
In L4, in order to shift to a deceleration operation, bit 6 of address UPDW is set to “1” (26), and bit 7 is cleared to “0” (27). Further, the rotational speed CNT2 of the deceleration operation is set to R0H (28).
[0127]
Further, in L5, the contents of the general-purpose register R0H are written to the address CNT (29). Then, after executing the branch instruction (30), the process returns from the interrupt routine (32).
[0128]
After the deceleration operation is completed, the bit corresponding to the compare match interrupt OCMI is inverted in the interrupt selection register IRQSEL at L6 (31). At this time, since the interrupt request flag OCMF remains set to “1”, the reception completion interrupt RXI is requested to the CPU 1. Then, the process returns from the interrupt routine (32).
[0129]
The activation may be instructed by requesting an interrupt from the CPU 1 to the CPU 2 using the interrupt request register and arranging a command at a predetermined address on the RAMP, for example.
[0130]
As described above, for example, compared with the method described in Japanese Patent Application No. 4-137854 or Japanese Patent Application No. 4-117969, it is not necessary to develop data in the RAM, and the amount of RAM used can be saved.
[0131]
Further, if the CPU 2 is mainly used for data processing corresponding to an interrupt, the CPU 2 does not always have a program to be processed. Therefore, when there is no program to be processed when data processing by one interrupt is completed, the CPU 2 should be in a low power consumption state, so-called sleep state.
[0132]
In this sleep state, a transition is made by executing a dedicated SLEEP instruction. Then, the clock supplied to the CPU 2 is stopped. When an interrupt is requested, the sleep state is canceled.
[0133]
Next, the low power consumption state control circuit will be described in detail with reference to FIG.
[0134]
The low power consumption state control circuit is configured in, for example, a clock oscillator, and the low power consumption state is controlled by three flip-flops SLPF1, SLPF2, and SSBYF.
[0135]
The flip-flop SLPF1 is set when the CPU1 executes the SLEEP instruction. At this time, the CPU 1 enters a sleep state. Further, when an interrupt request to the CPU 1 is generated, a clear state is entered.
[0136]
The flip-flop SLPF2 is set when the CPU2 executes the SLEEP instruction. At this time, the CPU 2 enters a sleep state. When an interrupt request for the CPU 2 is generated, the CPU 2 is cleared.
[0137]
The flip-flop SSBYF enters a set state when one CPU is in a sleep state and the other CPU executes a SLEEP instruction with a control bit SSBY (not shown) set to “1”. In this software standby state, the operation of all functions including the clock oscillator is stopped. The inside is reset.
[0138]
However, as long as a prescribed voltage is applied, the contents of RAM1, RAM2, and RAMP are retained. In addition, the state of the input / output port is also maintained. When an NMI interrupt request is generated, a clear state is entered. Since the inside is in a reset state, no interrupt request other than NMI is generated.
[0139]
In order to transition to this software standby state, one CPU may set the SSBY bit to “1” and execute the SLEEP instruction. Depending on the state of the other CPU, whether to immediately transition to the software standby state or to transition to the software standby state after the other CPU executes the SLEEP instruction after the transition to the sleep state is automatically selected. . For this reason, when creating a program, it is not necessary to confirm the mutual operation state, and the efficiency of program creation can be improved.
[0140]
Also, when the interrupt process is started, it is preferable to provide a bit indicating whether the previous operation was in operation or the sleep state. If an interrupt is accepted during this operation, the contents of the CPU's internal registers must be saved, but if an interrupt is accepted during sleep, the CPU's internal registers will not have the data being worked on. There is no need to evacuate. If the save operation and the return operation at the end of the process are not performed, the speed can be increased.
[0141]
Further, the input / output port allows selection from which CPU writing is possible.
[0142]
Next, the register of the input / output port will be described in detail with reference to FIG.
[0143]
The register of the input / output port includes a data direction register (DDR), a data register (DR), and a port control register (PSEL).
[0144]
DDR is a write-only register, and is input when it is cleared to “0” and output when it is set to “1”.
[0145]
The DR stores output data. When this DDR is set to “1”, the contents of DR are output. At the time of reading, the contents of DR or the state of terminals are read out. That is, when the DDR is cleared to “0”, the terminal state is read. When the DDR is set to “1”, the contents of the DR are read.
[0146]
The PSEL selects which CPU controls each input / output terminal. The control bit of the port control register (PSEL) controls the bits of the data register (DR) and the data direction register (DDR) in common. When PSEL is cleared to “0”, writing is performed by CPU 1, and when it is set to “1”, writing is performed by CPU 2.
[0147]
When a pull-up MOS is incorporated in the port or a double output buffer is used, the registers for performing these controls may be controlled in common by PSEL. Examples of such registers are described in “H8 / 3003 Hardware Manual” P263 to P306, P419 to P445 issued by Hitachi, Ltd. in March 1993.
[0148]
Next, the input / output ports will be described in detail with reference to FIG.
[0149]
In the input / output port of this embodiment, the data direction register (DDR), the data register (DR), and the port control register (PSEL) are configured by flip-flops. In either case, a predetermined bit of the internal data bus is used as a data input (D), and a reset signal (RESET) is used as a clear input (CLR).
[0150]
The DDR input clock (C) is the output of the AND circuit AND1. This output (Q) is used as a control signal for the output buffer OBUF and a selection signal for the selector SEL1.
[0151]
The DR input clock (C) is the output of the AND circuit AND2. This output (Q) is used as the data input of the output buffer OBUF and the data input of the selector 1.
[0152]
The PSEL input clock (C) is a PSEL read signal WRPSEL. This output (Q) is used as a selection signal for the selector SEL2.
[0153]
The output buffer OBUF is a DDR output as a control signal, a data input is a DR output, and an output signal is connected to a terminal P.
[0154]
The input buffer IBUF has an input signal connected to the terminal P and an output signal as a data input of the selector SEL1.
[0155]
The selector SEL1 uses the DDR output as a selection signal and the DR output and the input buffer IBUF output as data inputs. When the DDR output is “0”, the input buffer IBUF output is selected, and when the DDR output is “1”, the DR output is selected. The output of the selector SEL1 is input to the DR read buffer.
[0156]
The selector SEL2 uses the PSEL output as a selection signal and the CPU1 / 2 bus right signal as a data input. This output is a write permission signal. When PSEL is “0”, the CPU1 is in a write-permitted state with the CPU1 bus right. When PSEL is “1”, the CPU 2 is in a write-permitted state with the CPU 2 bus right.
[0157]
The DR read buffer DRBUF receives the output of the selector SEL1, uses the DR read signal RDDR as a clock, and the output signal is connected to a predetermined bit of the internal data bus. When this RDDR is active, the output of the selector SEL1 is output to the internal data bus.
[0158]
The PSEL read buffer PSBUF receives the output of the PSEL flip-flop, uses the PSEL read signal RDPSEL as a clock, and the output signal is connected to a predetermined bit of the internal data bus. When this RDPSEL is active, the output of the PSEL flip-flop is output to the internal data bus.
[0159]
The AND circuit AND1 receives the write permission signal and the DDR write signal WRDDR, and the output signal is the DDR input clock.
[0160]
The AND circuit AND2 receives the write permission signal and the DR write signal WRDR, and the output signal is the DR input clock.
[0161]
ROM1 and ROM2 can be PROMs, and when this PROM is programmed from the outside, it is preferable that the two ROMs have consecutive addresses from the outside.
[0162]
Next, the address map of the PROM will be described with reference to FIG.
[0163]
For example, PROM1 is 64 kbytes and PROM2 is 32 kbytes. In the MCU mode, PROM1 is arranged in H'00000000 to H'0000FFFF, and PROM2 is arranged in H'0000 to H'7FFF.
[0164]
In the PROM mode, PROM1 is arranged at H'0000-H'0FFFF, and PROM2 is arranged at H'10000-H'17FFF.
[0165]
Next, the PROM mode will be described in detail with reference to FIG.
[0166]
This PROM mode is set by setting mode terminals MD1, MD0, and STBY terminals to a low level. At this time, the internal signal EPM is activated (high level) by a mode setting circuit (not shown). In the PROM mode, the CPU 1/2 is disconnected from the address bus and data bus by BUFC 1/2.
[0167]
In FIG. 11, the CS control circuit, the buffer BUFC1 / 2, etc. are included in the bus controller.
[0168]
The PROM is the ROM 1 and the ROM 2 in FIG. 1, and includes a memory array, an address decoder, an input / output circuit, and a control circuit. An address is input to the address decoder, the input / output circuit inputs / outputs data, and the control circuit inputs a control signal, and controls the input / output circuit to write / read data. In addition, the memory array is arranged with non-volatile storage elements.
[0169]
An EPM, CS-1 / 2 #, OE #, PGM #, MS-1 / 2 #, and read signal are input to the control circuit. When this EPM is in an active state, a write / read operation as a PROM is performed based on CS-1 / 2 #, OE #, and PGM #. When the EPM is inactive, a read operation as a ROM in the CPU address space is performed based on the MS-1 / 2 #, read signal.
[0170]
In the PROM mode, it is controlled by VPP, CS #, OE #, and PGM #. Such control is performed by, for example, “HITACHI IC Memory Data Book No.” issued by Hitachi, Ltd. in March 1993. 2 (10th Edition) "PROM described in P510 to P524.
[0171]
The VPP terminal is the RES terminal, the CS #, OE #, and PGM # are the P61, P62, and P63 terminals, the address A0-15 is the P00-07, the P10-17 terminal, the A16 is the P60 terminal, and the data D7-0 is Also used as P40-P47 terminals. Although VPP is not shown, it is given to PROM1 / 2.
[0172]
As internal signals, OE # and PGM # are input via a buffer circuit and supplied to PROM1 and PROM2. CS-1 # is generated by a logical product signal with an inverted signal of the address upper signal A16, and CS-2 # is generated by an inverted signal of the address upper signal A15 and a logical product signal with A16. These CS-1 # and CS-2 # are given to PROM1 and PROM2, respectively.
[0173]
In the PROM mode, IDB1 and IDB2 are connected via a buffer. The data in PROM2 is input / output via IDB2, IDB1 and IOP3. That is, when the read operation is performed when CS-2 # is in the active state, the contents of IDB2 read from PROM2 are output to IDB1. Furthermore, during the read operation, the contents of IDB1 are output to the outside via IOP3.
[0174]
Also, during the write operation, external contents are input to IDB1 via IOP3. When CS-2 # is in the active state and the write operation is performed, the contents of IDB1 are output to IDB2 and given to PROM2. Further, the contents of IDB1 are output to the outside via IOP3.
[0175]
In the PROM mode, IAB1 and IAB2 are connected via a buffer. That is, the address of IAB1 input via IOP1 and 2 is input to IAB2 and given to PROM2. Since the maximum capacity of PROM1 / 2 is 64 kbytes, the address given to each PROM is 16 bits.
[0176]
For example, a read operation is performed when CS-1 / 2 #, OE # is active, and PGM # is inactive, and a write operation is CS-1 / 2 #, PGM # is active, and OE # is non-active. Performed when active.
[0177]
In addition, verification, page writing, and the like are possible. However, since there is no direct relationship with the present invention, detailed description is omitted.
[0178]
In one PROM mode, PROM1 and PROM2 can be collectively written as one PROM externally. Thereby, writing can be performed efficiently.
[0179]
Next, the test mode will be described in detail with reference to FIG.
[0180]
This test mode is set by setting the mode terminals MD1 and MD0 to low level and the STBY terminal to high level. At this time, the internal signal TM is activated (high level) by a mode setting circuit (not shown).
[0181]
In FIG. 12, a control circuit 1/2, a bus arbitration circuit, a selection circuit, a buffer BSBUF, and a buffer BUFC1 / 2 are included in the bus controller.
[0182]
The bus arbitration circuit selects which of the CPUs 1/2 uses PAB / PDB and outputs a control signal PAK. When the PAK is high, the CPU 1 uses the PAB / PDB. When the PAK is low, the CPU 2 uses the PAB / PDB. In the test mode, the PAK signal is controlled by the selection signal supplied from the P62 terminal.
[0183]
In the test mode, CPU 1/2 is disconnected from the address bus, data bus, and read / write signal by BUFC 1/2.
[0184]
Addresses are input from IOP3 to IOP0 to IAB1 via buffer BUFP, and further input to IAB2 and PAB via BSBUF. IAB1 has 32 addresses corresponding to the 4 Gbyte address space, IAB2 has 16 addresses corresponding to the 64 kbyte address space, and PAB has 10 addresses corresponding to the RAMP and I / O addresses. Address. Therefore, IAB1 is preferably used to give an address from the outside.
[0185]
The data bus is input / output from / to IDB1 by the IOP4 via the buffer BUFP. Corresponding to the read / write operation and the address, the contents of IDB2 or PDB are input / output from / to IDB1 via BSBUF.
[0186]
The read signal and the write signal are input from the P60 terminal and the P61 terminal via BUFP. RD1 / 2 and WR1 / 2 are supplied to ROM1, RAM1 / ROM2, and RAM2. Further, it is selected by the bus right signal PAK, becomes RDP, WRP, and is supplied to the RAMP, I / O. In the test mode, regardless of the PAK signal, RD1 / 2 / P always operates in the same manner, and WR1 / 2 / P always operates in the same manner.
[0187]
The control circuit 1/2 outputs selection signals MSROM1 / 2, MSRAM1 / 2, MSRAMP, and MSIO based on the address of IAB1 / 2. Since MSRAMP and MSIO are common signals, one is output and the other is high impedance based on the PAK signal. For example, when the PAK signal is at a high level, the control circuit 1 outputs and the control circuit 2 becomes high impedance.
[0188]
In the test mode, one of MSROM1 / 2 and MSRAM1 / 2 is prohibited based on the PAK signal. This is because one functional block is selected based on an address given from the outside. For example, when the PAK signal is at high level, MSROM1 and MSRAM1 are output based on IAB1, and MSROM2 and MSRAM2 are inactivated.
[0189]
When testing the ROM1 / RAM1, read / write can be performed by giving an address and a read / write signal with the P62 terminal at a high level and the PAK signal at a high level.
[0190]
When testing ROM2 / RAM2, read / write can be performed by giving an address and a read / write signal with the P62 terminal set to low level and the PAK signal set to low level. Only the lower 16 bits of this address are valid.
[0191]
Further, when testing RAMP / I / O, read / write can be performed by giving an address and a read signal / write signal with the P62 terminal at a high level and the PAK signal at a high level. it can.
[0192]
As described above, address data for externally reading / writing internal function blocks can be supplied from the outside to the internal bus to which data is input / output by the CPU, and this function block. It is possible to directly read / write data necessary for the operation from the outside, facilitating the test of the functional blocks built in the single-chip microcomputer and improving the testing efficiency.
[0193]
When testing the built-in RAM, the data test is preferably performed independently, and the address decoder test is preferably performed in parallel. In order to test the address decoder, the RAM 1/2 / P can be selected at the same time so that the test can be performed simultaneously.
[0194]
In this case, a RAM test mode may be provided for FIG. In the test mode, when the P63 terminal is set to the low level, the test mode is the same as described above, and when the P63 terminal is set to the high level, the RAM test mode is set.
[0195]
In the RAM test mode, the RAM1 / 2 / P selection signals MSRAM1, MSRAM2, and MSRAMP can be simultaneously activated. However, the data to be read is bit 0 to 1, bit 2 to 3, and bit 4 to 7, respectively.
[0196]
The CPU 1 and the CPU 2 may be substantially the same CPU, or the CPU 1 may include the CPU 2 so that the software development environment can be shared. An example of such a CPU is Japanese Patent Application No. 4-226447.
[0197]
The emulator that evaluates the single-chip microcomputer as described above is preferably configured so that when the user sets a break condition from the outside, it can be specified which CPU the break is set to. In addition, it is preferable that it is possible to designate a break when both of the two CPU conditions are satisfied.
[0198]
Next, the configuration of the emulation processor will be described with reference to FIG.
[0199]
The emulation processor includes a microcomputer portion including CPU1 and CPU2, and a block dedicated to the emulation processor including a buffer circuit (not shown) and the like, and is formed on one semiconductor substrate by a known semiconductor manufacturing technique.
[0200]
This emulation processor has a user interface for transmitting and receiving signals to and from the application system, and an emulation interface for transmitting and receiving signals to and from the microcomputer development apparatus.
[0201]
As the emulation bus, IAB1 and IDB1, IAB2 and IDB2 are input / output via the emulation interface. In addition, a bus right display signal indicating which CPU of PAB or PDB is using is output. This corresponds to the PAK signal in FIG. In addition, a signal indicating that the CPU is in a standby state is output by bus right arbitration.
[0202]
The access status of PAB and PDB is not explicitly displayed, but can be determined by the bus right display signal and the contents of the emulation bus by IAB1, IDB1, IAB2, and IDB2. By not outputting the PAB and PDB emulation buses, the number of terminals of the emulation processor can be reduced, thereby reducing the package size and thus the emulator size.
[0203]
Two break request terminals, BRK1 # and BRK2 #, are included in the emulation interface. Based on this, a break interrupt is requested to CPU1 and CPU2 by BRK1 and BRK2 signals, respectively. These do not have a corresponding CPU selection bit, and activate the break request signal to the CPU in parallel with the interrupt request signal via the priority determination circuit. The vector number signal is also used as a general interrupt request.
[0204]
When CPU1 and CPU2 accept a break interrupt, break acknowledge signals BRKAK1 and BRKAK2 are activated. For example, when the CPU 2 performs the SCI reception processing and pulse output processing as described above, even if the CPU 1 is stopped by a break interrupt, the CPU 2 interrupts the SCI reception to execute the user processing. Thus, it is possible to avoid the occurrence of a so-called overrun error or interruption of the pulse output, for example, the motor drive of the user system cannot be performed.
[0205]
Next, the configuration of an emulator equipped with an emulation processor will be described with reference to FIG.
[0206]
The connector portion is attached to the application system (user system) instead of the single chip microcomputer. The emulation processor performs input / output of signals to / from the application system using the target system interface via the connector portion and the interface cable.
[0207]
The emulation processor is connected to the emulation bus 1/2 using an emulation interface. The emulation bus 1 corresponds to IAB1 / IDB1, and the emulation bus 2 corresponds to IAB2 / IDB2. These emulation buses include state signals, control signals, and the like not shown.
[0208]
Using this emulation bus, information corresponding to the internal state of the application system and the emulation processor is output from the emulation processor, and various control signals for emulation are input to the emulation processor. An emulation mode terminal (not shown) of the emulation processor is fixed to the power supply level, and the emulation mode is set inside the emulation processor.
[0209]
Although the emulation bus is not particularly limited, it monitors the control status of the emulation processor, the emulation processor, and the status of the emulation bus. When the state reaches a preset state, a break control circuit for inputting an emulator-dedicated interrupt, stopping execution of the user program by the CPU, and transitioning to the emulation program execution state (break) Is connected.
[0210]
In addition, the emulation bus is connected to a real-time trace circuit that sequentially stores addresses, data, and control information given to the emulation bus based on signals indicating CPU read or write operations and signals indicating instruction read operations. Is done. In this embodiment, the emulation buses 1/2 are connected to an emulation memory, a break control circuit, a real-time trace circuit, and the like.
[0211]
Therefore, the emulation memory inputs / outputs IAB1 / IDB1 and IAB2 / IDB2 data independently and in parallel. The break control circuit independently determines the address / data of IAB1 / IDB1 and IAB2 / IDB2, and other information. After the condition on the IAB1 / IDB1 side is established, a break can be requested when the condition on the IAB2 / IDB2 side is established. As described above, the break interrupt can be requested to both the CPU 1 and the CPU 2 simultaneously, or can be requested to only one CPU.
[0212]
The real-time trace circuit stores IAB1 / IDB1 and IAB2 / IDB2 addresses / data and other information independently. When one CPU breaks, only the other CPU's address / data and other information are stored. To do. It is also possible to selectively store the address / data of only one CPU and other information.
[0213]
The emulation memory, break control circuit, and real-time trace circuit are connected to the control bus and are controlled by the control processor via the control bus. The control bus is connected to an emulation processor control circuit and is connected to a system development device such as a personal computer through an interface circuit, although not particularly limited.
[0214]
For example, when the program input from the system development apparatus is transferred to the emulation memory and the CPU reads this program to be placed on the built-in ROM, the program on the emulation memory is read. In addition, break conditions and real-time trace conditions can be given from the system development device.
[0215]
As this break condition, at least the conditions of CPU1 and CPU2 can be set independently. As the real-time trace condition, at least the address / data of CPU 1 and CPU 2 and other information can be stored at the same time, or the address / data and other information of only one CPU can be selectively stored. To.
[0216]
Therefore, according to the single chip microcomputer of this embodiment, the CPU 1 and CPU 2 as data processing devices, the bus controller as bus control means, the ROM 1 and ROM 2 as readable storage means, and the IOP 0 as data input / output means. By using the IOP 11 as a main configuration, the following operational effects can be obtained.
[0217]
(1) IAB1 and IDB1 that connect CPU1 and ROM1 and IAB2 and IDB2 that connect CPU2 and ROM2 are provided independently. By storing the program of CPU1 in ROM1 and the program of CPU2 in ROM2, Data that should be controlled by CPU1 and CPU2 is made possible by allowing CPU2 to operate in parallel and connecting input / output circuits such as RAMP and IOP0 to IOP11 to a common PAB and PDB so that CPU1 and CPU2 can use them. Can be allocated and used arbitrarily. As a result, the processing speed of the single chip microcomputer can be improved and the resource utilization efficiency can be improved.
[0218]
(2) By performing two processes simultaneously with one single-chip microcomputer, it is possible to replace the system that used a plurality of conventional semiconductor integrated circuit devices and to achieve miniaturization.
[0219]
(3) By allowing the CPU 1 and the CPU 2 to request mutual interrupts, the CPUs 1 and 2 can be easily synchronized with each other.
[0220]
(4) When the entire single-chip microcomputer such as software standby is stopped by the operation of CPU 1 and CPU 2, one CPU executes the SLEEP instruction with the SSBY bit set to “1”. Sometimes, depending on the state of the other CPU, whether it immediately transitions to the software standby state or temporarily transitions to the sleep state and then transitions to the software standby state after the other CPU executes the SLEEP instruction. By selecting, when creating a program, it is not necessary to confirm the mutual operation state, and the creation efficiency of the program can be improved.
[0221]
(5) By providing a register DR that designates which CPUs 1 and 2 use IOP0 to IOP11 in bit units, one input / output port can be used by two CPUs 1 and 2, Resource utilization efficiency can be further improved.
[0222]
(6) By providing a register for designating which CPU 1 or 2 the interrupt is requested to the interrupt permission circuit, the two CPUs 1 and 2 can arbitrarily allocate and use the input / output circuit. It is possible to improve the resource utilization efficiency.
[0223]
(7) By using one of the CPUs mainly for data transfer by interruption, various processes at the time of interruption can be easily performed.
[0224]
(8) When ROM1 and ROM2 are composed of PROM, ROM1 and ROM2 are arranged at consecutive addresses in the PROM mode, so that ROM1 and ROM2 are compatible with one PROM, and PROM writing is made efficient. be able to.
[0225]
(9) When the CPUs 1 and 2 have different logical addresses corresponding to one physical address, or when the CPUs 1 and 2 have different physical addresses corresponding to one logical address By providing a control signal for selecting which logical address to be used, an internal function block is externally provided to a plurality of internal buses to which addresses are given by the CPUs 1 and 2 and data is to be input / output Address data for reading / writing data can be supplied via a buffer circuit smaller than the internal bus so that data necessary for this functional block can be directly read / written from the outside. Easier testing of functional blocks built in chip microcomputers and improved testing efficiency Can be realized.
[0226]
(10). By making the CPU 1 and the CPU 2 compatible, the development efficiency can be improved, the support tool can be shared, and the development efficiency of the development apparatus can be improved. As a result, the number of development devices required by the user can be reduced, and the cost required for the development devices can be reduced.
[0227]
(11). In this single-chip microcomputer emulator, the debugging efficiency can be improved by having an interrupt that stops the two CPUs 1 and 2 independently.
[0228]
Further, in this embodiment, as shown in FIG. 15, a direct memory access controller (DMAC) is connected to IAB1 and IDB1 in the same manner as CPU 1 and added to the single chip microcomputer of FIG. The CPU 1 and the DMAC can be operated exclusively with each other based on the bus right arbitration of the bus controller.
[0229]
That is, the DMAC performs data transfer when the CPU 1 sets a predetermined control bit as “1” as an activation factor, and when a predetermined signal is given to the DMA request terminal or the DMA request terminal. It has an external request function to perform, and the transfer mode is the auto request, in the burst mode in which the CPU 1 is stopped and the bus is exclusively used for data transfer, or the bus right is released for each transfer and alternated with the CPU 1 This is possible by having a cycle steal mode in which data is transferred while operating in the same manner.
[0230]
Further, data transfer can be performed using the interrupt request signal as an activation request signal, and higher speed data transfer is possible than the CPU 2 performs data transfer by interrupt.
[0231]
Further, the bus arbitration may be performed in a time division manner in addition to the read / write conflict. For example, a bus right is given to CPU 1 and CPU 2 every 8 states. If the bus does not end during 8 states, the operation continues until it ends. For example, the bus right may be given to CPU 1 by 4 states and CPU 2 by 12 states.
[0232]
(Example 2)
FIG. 16 is a block diagram showing a single chip microcomputer according to another embodiment of the present invention, and FIG. 17 is an operation timing chart of a bus in the single chip microcomputer according to this embodiment.
[0233]
The single-chip microcomputer of this embodiment is different from that of the first embodiment in that IAB1 and IAB2, IDB1 and IDB2 are shared to form IAB / IDB, and the data bus width is 32 bits. Similarly, ROM1, ROM2, and RAM1 And RAM 2 are used in common as a read-only memory (ROM: readable storage means) / random access memory (RAM), which can simultaneously read / write 32 bits.
[0234]
CPU 1 (first data processing device) and CPU 2 (second data processing device) read / write ROM / RAM using the internal address bus (IAB) / internal data bus (IDB) in a time-sharing manner. Write. As described above, these CPU1 / 2 instructions are 16-bit units, and the minimum instruction is executed in one state.
[0235]
In other words, 16 bits are read in one state for one CPU 1/2, and the instruction read amount and the instruction execution amount are equal. If an instruction is read with 32 bits, the number of instruction reads can be halved and the frequency of use of IAB / IDB and ROM / RAM can be halved. Therefore, the CPU 1 and the CPU 2 can alternately read instructions from the ROM by using IAB / IDB, and can be executed in parallel.
[0236]
Actually, even if an instruction is read with 32 bits, such as a branch instruction, 16 bits are wasted, and the frequency of use cannot be reduced during data access, but complete parallel operation cannot be performed. As described above, the number of times the instruction is read is large, and the processing speed is not reduced so much as in the first embodiment. Further, by sharing the ROM / RAM, the physical scale can be reduced, or the memory capacity used by the CPU 1/2 can be arbitrarily set.
[0237]
Next, an example of the operation timing of the internal bus will be described with reference to FIG.
[0238]
The CPU 1/2 program is the same as that shown in FIG. 6, and the right to use the bus is that CPU 1/2 that used the previous bus has no priority, and in other cases, the CPU 2 has priority.
[0239]
For example, IAB1 / 2 is output in synchronism with φ #, and the read of the CPU1 / 2 with respect to the ROM and RAM is performed in one state in a batch of 32 bits. However, this is limited to 32-bit data starting from a multiple of 4.
[0240]
First, IAB1 / 2 is output in one state in synchronization with φ #, and is not particularly limited, but is latched in synchronization with φ in ROM and RAM. The corresponding read data is output in synchronization with φ #, and is fetched by the CPU 1/2 during the period in which φ # is in the active state.
[0241]
Similarly to the above, read / write with respect to RAMP is performed in two states, and read / write with respect to I / O is performed in three states. IAB1 / 2 synchronized with φ # is synchronized with φ by the bus controller. In this case, the addresses m and n where the head instruction exists are set to a multiple of 4.
[0242]
At T1, instruction fetch from the ROM of CPU1 / 2 is requested, but instruction fetch of CPU2 is prioritized and address m is output to IAB.
[0243]
At T2, the instruction code (first and second words of the BCLR instruction) read from the ROM to the IDB is fetched by the CPU 2, and the instruction fetch address n of the CPU 1 is output to the IAB.
[0244]
At T3, the CPU 1 fetches an instruction code (CMP, BEQ instruction) read from the ROM to the IDB, and the CPU 2 outputs an address SSR to the IAB. The use of the PAB / PDB of the CPU 2 is automatically permitted. In this case, since three SCI reads are required, the CPU2 standby signal goes high.
[0245]
At T4, the contents of IAB are output to PAB, and the contents of SCI register SSR are read. This read data is obtained at T6. On the other hand, the CPU 1 requests an instruction fetch, but since the CPU 2 is using the bus, it is put on hold and the CPU 1 standby signal becomes high level.
[0246]
At T5, both CPU 1/2 are set in a standby state.
[0247]
At T6, the CPU 2 fetches the data read from the SCI register SSR via the PDB and IDB. The CPU 2 requests the next instruction fetch, but the instruction fetch of the CPU 1 is prioritized, the CPU 1 standby signal becomes low level, and the CPU 2 standby signal remains at high level. In this case, the instruction fetch address n + 4 of the CPU 1 is output to the IAB.
[0248]
At T7, the CPU 1 captures the instruction code (first word of the BTST instruction) read from the ROM to the IDB. In this case, the CPU 1 requests to fetch the branch destination instruction. However, the instruction fetch of the CPU 2 is prioritized, the CPU 2 standby signal becomes low level, and the CPU 1 standby signal becomes high level.
[0249]
At T8, the CPU 2 fetches the next instruction code read from the ROM to the IDB. In this case, the CPU1 standby signal becomes a low level, and the instruction fetch address N1 of the CPU1 is output to the IAB.
[0250]
At T9, the CPU 1 fetches the instruction code read from the ROM to the IDB, but this is not executed because the branch condition is not satisfied. The first word of the previously fetched BTST instruction becomes valid. In this case, the CPU 1 requests the next instruction fetch, but the CPU 2 has priority, and the CPU 1 standby signal becomes high level.
[0251]
On the other hand, the CPU 2 outputs the address SSR to the IAB. The use of the PAB / PDB of the CPU 2 is automatically permitted. Here, since the SCI read requires three states, the CPU2 standby signal becomes high level.
[0252]
At T10, the contents of IAB are output to PAB, and CPU 2 outputs data to be written to address SSR to PDB via IDB. Here, the CPU 1 is in a standby state.
[0253]
At T11, the CPU2 standby signal becomes low level.
[0254]
At T12, the CPU1 standby signal goes low, and the instruction fetch address n + 6 of CPU1 is output to the IAB.
[0255]
At T13, the CPU 1 captures the instruction code (second word of the BTST instruction) read from the ROM to the IDB. In this case, the CPU 1 requests to read the address PORT, and the CPU 2 requests to fetch an instruction from the ROM. However, the CPU 2 has priority, and the CPU 1 standby signal becomes high level. Here, the instruction fetch address m + 8 of the CPU 2 is output to the IAB.
[0256]
At T14, the CPU 2 fetches the next instruction code read from the ROM to the IDB. In this case, the CPU 1 outputs the address PORT to the IAB. Here, since three states are required for reading the input / output port, the CPU1 standby signal becomes high level again.
[0257]
At T15, the contents of IAB are output to PAB, and the contents of register PORT of the input / output port are read. This read data is obtained at T17. On the other hand, the CPU 2 requests an instruction fetch, but since the CPU 1 is using the bus, it is put on hold and the CPU 2 standby signal becomes high level.
[0258]
As described above, in this embodiment, the execution time is longer than that in the first embodiment shown in FIG. 6, but the execution time can be shortened as compared with the case where it is realized by at least one CPU 1/2.
[0259]
First, the operation of saving or restoring the internal state of the CPU 1/2 by interruption or subroutine branching can be excluded. Also, the two CPUs 1/2 can be made shorter than simply operating alternately. This is because a larger amount of instructions that can be executed from the ROM by the CPU1 / 2 in unit time can be read in unit time, and a time that does not require the use of the bus is created, which is available to the other CPU1 / 2. It is.
[0260]
This is particularly effective when the program is arranged in the built-in ROM. Most of the CPU reads / writes are instruction reads, and the internal memory improves the reading speed relative to the external memory. This is because the width of the bus can be easily increased.
[0261]
At this time, even if the CPU 2 is a data processing device or data transfer device such as the DMAC or DTC, the CPU 2 can similarly perform data transfer with a minimum reduction in the processing speed of the CPU 1. This is particularly effective for the DTC in which transfer information needs to be read from the RAM prior to data transfer.
[0262]
Therefore, according to the single chip microcomputer of this embodiment, the CPU 1 and CPU 2 as data processing devices and the ROM as readable storage means are the main components, and the IAB / IDB and ROM / RAM are shared. In addition to the first embodiment, the following effects can be obtained.
[0263]
That is, by connecting a plurality of CPUs 1/2 to an IAB / IDB that can read a larger number of bytes per unit time than the number of instructions that CPU 1/2 can execute per unit time, Uses IAB / IDB in a divided manner to enable substantially parallel operation. Arbitrarily allocates and uses common ROM / RAM to improve the processing speed of single-chip microcomputers and improve resource utilization efficiency. can do.
[0264]
The invention made by the present inventor has been specifically described based on the first and second embodiments. However, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention. Needless to say.
[0265]
For example, the specific circuit configuration of the bus can be variously changed, and the IAB1 and IDB1 may be directly connected to the PAB and PDB. In this case, it is only necessary that the CPU 1 and the CPU 2 can read and execute the program in parallel, and this increases the frequency of restricting the operations mutually, but the physical scale may be reduced in some cases.
[0266]
Further, RAM1, RAM2, and RAMP may be a single functional block.
[0267]
Further, the number of CPUs can be three or more. In this case, a plurality of CPUs are connected to the first bus, the bus is used in a time-sharing manner, and another one or more CPUs are connected to the first bus. You may connect to 2 buses.
[0268]
The built-in ROM may be a memory that stores programs to be executed by the CPU, such as an EEPROM and a flash memory, in addition to the mask ROM and PROM. The ROM 1 and the ROM 2 may be different.
[0269]
Furthermore, there are no restrictions on the type, function, number, etc. of functional blocks that require interrupt processing, such as functional blocks that require interrupts such as timers and SCI, or pulse output circuits.
[0270]
In the above description, the case where the invention mainly made by the present inventor is applied to a single chip microcomputer which is a field of use of the invention has been described. However, the present invention is not limited to this and is applicable to other semiconductor integrated circuit devices. The present invention can be applied to a semiconductor integrated circuit device including at least a plurality of data processing devices.
[0271]
【The invention's effect】
Of the inventions disclosed in the present application, effects obtained by typical ones will be briefly described as follows.
[0272]
(1). It is possible to read instructions stored in two readable storage means independent by a bus parallel to two data processing devices, or the bus width can be expanded to allow the data processing device to execute in unit time. Multiple memory means can be selected simultaneously in a single-chip microcomputer or semiconductor integrated circuit device that has the function of supplying instructions capable of operating two data processing devices in parallel by enabling the reading of more instructions than the number of instructions By simultaneously writing to or simultaneously reading from a plurality of storage means, the restriction on the number of data processing channels due to interrupts can be eliminated, and the data processing content can be made arbitrary. Reduction in size, restriction on the number of transfer channels, or single-chip microcomputer or semiconductor integrated circuit The manufacturing cost of the apparatus can be reduced.
[0273]
(2) According to (1), the first and second data processing devices can be operated simultaneously, so that the processing speed of the single chip microcomputer or the semiconductor integrated circuit device can be improved.
[0274]
(3) According to the emulation processor of the single-chip microcomputer or semiconductor integrated circuit device, and further the emulator, the two data processing devices can be stopped independently, so that the debugging efficiency can be improved. Become.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a single-chip microcomputer that is Embodiment 1 of the present invention.
FIG. 2 is an explanatory diagram of an entire address map in the single chip microcomputer according to the first embodiment;
3 is a block diagram of a bus connection state of the single chip microcomputer according to the first embodiment. FIG.
FIG. 4 is a schematic block diagram of an interrupt controller according to the first embodiment.
FIG. 5 is a schematic block diagram of an interrupt request bit and an interrupt permission circuit according to the first embodiment.
FIG. 6 is an operation timing chart of the bus in the first embodiment.
FIG. 7 is a schematic block diagram of a low power consumption state control circuit according to the first embodiment.
8 is an explanatory diagram of a register configuration for controlling input / output ports in Embodiment 1. FIG.
FIG. 9 is a schematic block diagram of an input / output port according to the first embodiment.
10 is an address map of the PROM in Embodiment 1. FIG.
11 is a block diagram of the main part of the PROM mode in Embodiment 1. FIG.
12 is a block diagram of a main part of a test mode in Embodiment 1. FIG.
13 is a schematic block diagram of an emulation processor in Embodiment 1. FIG.
FIG. 14 is a schematic block diagram of an emulator according to the first embodiment.
FIG. 15 is a block diagram showing a modification of the single chip microcomputer in the first embodiment.
FIG. 16 is a block diagram showing a single-chip microcomputer that is Embodiment 2 of the present invention.
17 is an operation timing chart of a bus in the single chip microcomputer of Embodiment 2. FIG.
[Explanation of symbols]
CPU1 Central processing unit (first data processing unit)
CPU2 Central processing unit (second data processing unit)
ROM1 Read-only memory (first readable storage means)
ROM2 Read-only memory (second readable storage means)
RAM1, RAM2, RAMP Random access memory
SCI serial communication interface
A / D A / D converter
IOP0 to IOP11 I / O port (data I / O means)
IAB1 internal address bus (first bus)
IAB2 internal address bus (second bus)
PAB internal address bus (third bus)
IDB1 internal data bus (first bus)
IDB2 internal data bus (second bus)
PDB internal data bus (third bus)
DMAC direct memory access controller
ROM read-only memory (readable storage means)
RAM random access memory
IAB internal address bus
IDB internal data bus

Claims (8)

第1、第2のデータ処理装置と、バス制御手段と、第1、第2の読み出し可能な記憶手段と、データ入出力手段とを有する半導体集積回路装置であって、
前記第1のデータ処理装置と、前記バス制御手段と、前記第1の読み出し可能な記憶手段とが第1のバスによって相互に接続され、
前記第2のデータ処理装置と、前記バス制御手段と、前記第2の読み出し可能な記憶手段とが第2のバスによって相互に接続され、
かつ前記バス制御手段と、前記データ入出力手段とが第3のバスによって相互に接続され、
前記バス制御手段は前記第1のバスと前記第2のバスを前記第3のバスに接続するかしないかを選択し、前記第1のデータ処理装置の前記第1のバスを使用した読み出しと、前記第2のデータ処理装置の前記第2のバスを使用した読み出しとを並行して行うことが可能であって、
前記半導体集積回路装置は外部バスに接続され、前記第1のバスを介して前記第1のデータ処理装置から外部へデータを出力し、または前記外部バスを介して前記第1のデータ処理装置にデータを入力する制御を可能とし、
前記データ入出力手段はレジスタ手段を含み、前記データ入出力手段に含まれるレジスタ手段の少なくとも1つのレジスタ手段は複数のビットを持ち、別のレジスタ手段の状態によって前記第1、第2のデータ処理装置のいずれから書込み可能とするかを選択可能とすることを特徴とする半導体集積回路装置。
A semiconductor integrated circuit device having first and second data processing devices, bus control means, first and second readable storage means, and data input / output means,
The first data processing device, the bus control means, and the first readable storage means are interconnected by a first bus,
The second data processing device, the bus control means, and the second readable storage means are interconnected by a second bus;
And the bus control means and the data input / output means are connected to each other by a third bus,
The bus control means selects whether to connect the first bus and the second bus to the third bus, and reads the first data processing device using the first bus. , It is possible to perform reading using the second bus of the second data processing device in parallel,
The semiconductor integrated circuit device is connected to an external bus and outputs data from the first data processing device to the outside via the first bus, or to the first data processing device via the external bus. Allows control to input data ,
The data input / output means includes register means, and at least one register means of the register means included in the data input / output means has a plurality of bits, and the first and second data processing are performed according to the state of another register means. A semiconductor integrated circuit device, which can be selected from which of the devices is writable .
請求項1記載の半導体集積回路装置であって、
前記データ入出力手段は割込要求可能とされ、
更に、割込制御手段を有し、前記データ入出力手段が出力する割込信号を前記割込制御手段に入力し、前記割込制御手段は前記第1、第2のデータ処理装置にそれぞれ第1、第2の割込要求信号を出力し、
前記割込制御手段は、データ処理装置選択手段、第1、第2の割込優先順位判定手段、第1、第2のマスク制御手段を有し、前記割込信号が活性状態となることに呼応して、前記第1、第2の割込要求信号のいずれを活性状態とするかを選択可能とされ、
前記データ処理装置選択手段は、レジスタの設定に従って、所定の割込信号を前記第1、第2の割込優先順位判定手段のいずれに要求するかを選択し、
前記第1、第2の割込優先順位判定手段は、入力された割込信号の優先順位を判定し、判定結果を、それぞれ、前記第1、第2のマスク制御手段に出力し、
前記第1、第2のマスク制御手段は、前記第1、第2のデータ処理装置の割込マスク状態にて、それぞれ、前記第1、第2のデータ処理装置に割込を要求するとともに、少なくとも1つの割込は、前記データ処理装置選択手段を介さず、前記第1、第2の割込優先順位判定手段に供給されることを特徴とする半導体集積回路装置。
The semiconductor integrated circuit device according to claim 1,
The data input / output means can make an interrupt request,
And an interrupt control means for inputting an interrupt signal output from the data input / output means to the interrupt control means. The interrupt control means is connected to each of the first and second data processors. 1. Output the second interrupt request signal.
The interrupt control means has data processing device selection means, first and second interrupt priority order judgment means, and first and second mask control means, and the interrupt signal is activated. In response, it is possible to select which of the first and second interrupt request signals is activated.
The data processing device selection means selects whether the predetermined interrupt signal is requested to the first or second interrupt priority determination means according to a register setting,
The first and second interrupt priority determining means determine the priority of the input interrupt signal, and output the determination results to the first and second mask control means, respectively.
The first and second mask control means request the first and second data processing devices for interrupts in the interrupt mask states of the first and second data processing devices, respectively. The semiconductor integrated circuit device according to claim 1, wherein at least one interrupt is supplied to the first and second interrupt priority determining means without going through the data processing device selecting means.
請求項1または2記載の半導体集積回路装置であって、
前記第2のデータ処理装置が書込み可能なレジスタ手段を有し、前記レジスタ手段の状態によって前記第1のデータ処理装置に割込を要求することを可能とすることを特徴とする半導体集積回路装置。
The semiconductor integrated circuit device according to claim 1, wherein:
A semiconductor integrated circuit device characterized in that the second data processing device has writable register means, and that it is possible to request an interrupt from the first data processing device according to the state of the register means. .
請求項1、2または3記載の半導体集積回路装置であって、
割込を要求する端子を有し、前記端子に所定の信号変化が発生することに呼応して、前記第1、第2のデータ処理装置の両方に割込を要求することを可能とすることを特徴とする半導体集積回路装置。
A semiconductor integrated circuit device according to claim 1, 2 or 3,
It has a terminal requesting an interrupt, and it is possible to request an interrupt to both the first and second data processing devices in response to a predetermined signal change occurring at the terminal. A semiconductor integrated circuit device.
請求項記載の半導体集積回路装置であって、
前記第1、第2のデータ処理装置のいずれから書込み可能とするかを選択可能とされるレジスタ手段は端子の状態を制御するものであることを特徴とする半導体集積回路装置。
The semiconductor integrated circuit device according to claim 4 ,
2. A semiconductor integrated circuit device according to claim 1, wherein the register means capable of selecting which of the first data processing device and the second data processing device can be written controls a terminal state.
請求項1、2、3、4または5記載の半導体集積回路装置であって、
前記半導体集積回路装置の全体を停止する全体停止状態、前記第1のデータ処理装置を停止する第1の待機状態、前記第2のデータ処理装置を停止する第2の待機状態をそれぞれ設定する全体停止手段、第1の待機手段、第2の待機手段を有し、前記全体停止状態、前記第1の待機状態、前記第2の待機状態は前記第1、第2のデータ処理装置が所定の遷移命令を実行したことに呼応して遷移するものであって、前記第1のデータ処理装置が前記全体停止状態を設定する前記遷移命令を実行したとき、前記第2のデータ処理装置が前記第2の待機状態であれば前記全体停止状態に遷移し、前記第2のデータ処理装置が前記第2の待機状態でなければ前記第1の待機状態に遷移することを特徴とする半導体集積回路装置。
A semiconductor integrated circuit device according to claim 1, 2, 3, 4 or 5 ,
Overall setting for setting an overall stop state for stopping the entire semiconductor integrated circuit device, a first standby state for stopping the first data processing device, and a second standby state for stopping the second data processing device, respectively. A stop unit, a first standby unit, and a second standby unit, wherein the first and second data processing devices are predetermined in the overall stop state, the first standby state, and the second standby state. Transition in response to execution of the transition command, and when the first data processing device executes the transition command for setting the overall stop state, the second data processing device The semiconductor integrated circuit device shifts to the overall stop state if the standby state is 2, and transitions to the first standby state if the second data processing device is not the second standby state. .
請求項1、2、3、4、5または6記載の半導体集積回路装置であって、
テストモード設定手段と、バッファ手段とを有し、前記バッファ手段は、前記テストモード設定手段がテストモードを設定したときに、アドレス、リード信号またはライト信号、アドレス空間選択信号を入力し、前記リード信号またはライト信号に従ってデータを入出力するものであって、前記アドレス空間選択信号は、前記入力されたアドレスが前記第1、第2のデータ処理装置のいずれのアドレス空間に対応するかを指定するものであって、前記アドレス空間選択信号と前記アドレスに従って前記読み出し可能な記憶手段または前記データ入出力手段が選択されて、前記リード信号またはライト信号に従って前記読み出し可能な記憶手段または前記データ入出力手段はリードまたはライトされることが可能とされることを特徴とする半導体集積回路装置。
A semiconductor integrated circuit device according to claim 1, 2, 3, 4, 5 or 6 ,
A test mode setting means; and a buffer means. The buffer means inputs an address, a read signal or a write signal, and an address space selection signal when the test mode setting means sets a test mode, and the read mode Data is input / output according to a signal or a write signal, and the address space selection signal specifies which address space of the first or second data processing device the input address corresponds to. The readable storage means or the data input / output means is selected according to the address space selection signal and the address, and the readable storage means or the data input / output means is selected according to the read signal or write signal. Is characterized in that it can be read or written Integrated circuit device.
請求項1、2、3、4、5、6または7記載の半導体集積回路装置であって、
前記第1、第2の読み出し可能な記憶手段は第1、第2の電気的に書込み可能な記憶手段であって、書込みモード設定手段と、バッファ手段とを有し、前記バッファ手段は、前記書込みモード設定手段が書込みモードを設定したときに、アドレス、データおよび制御信号を入力し、前記制御信号に従って前記第1、第2の電気的に書込み可能な記憶手段に書込みを行うものであって、前記第1、第2の電気的に書込み可能な記憶手段が連続的に書込み可能なアドレスに配置されることを特徴とする半導体集積回路装置。
A semiconductor integrated circuit device according to claim 1, 2, 3, 4, 5, 6 or 7 ,
The first and second readable storage means are first and second electrically writable storage means, each having a write mode setting means and a buffer means. When the write mode setting means sets the write mode, an address, data, and a control signal are input, and writing is performed to the first and second electrically writable storage means according to the control signal. The semiconductor integrated circuit device is characterized in that the first and second electrically writable storage means are arranged at continuously writable addresses.
JP09603994A 1994-05-10 1994-05-10 Semiconductor integrated circuit device Expired - Fee Related JP3839068B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP09603994A JP3839068B2 (en) 1994-05-10 1994-05-10 Semiconductor integrated circuit device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP09603994A JP3839068B2 (en) 1994-05-10 1994-05-10 Semiconductor integrated circuit device

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2005300848A Division JP2006040310A (en) 2005-10-14 2005-10-14 Semiconductor integrated circuit system and microcomputer

Publications (2)

Publication Number Publication Date
JPH07302255A JPH07302255A (en) 1995-11-14
JP3839068B2 true JP3839068B2 (en) 2006-11-01

Family

ID=14154358

Family Applications (1)

Application Number Title Priority Date Filing Date
JP09603994A Expired - Fee Related JP3839068B2 (en) 1994-05-10 1994-05-10 Semiconductor integrated circuit device

Country Status (1)

Country Link
JP (1) JP3839068B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5061272B2 (en) * 2005-11-01 2012-10-31 新世代株式会社 Serial data transmitter / receiver
WO2007023975A1 (en) * 2005-08-22 2007-03-01 Ssd Company Limited Multi-processor, direct memory access controller, and serial data transmitting/receiving apparatus
JP5539156B2 (en) * 2010-10-29 2014-07-02 ルネサスエレクトロニクス株式会社 Semiconductor integrated circuit device

Also Published As

Publication number Publication date
JPH07302255A (en) 1995-11-14

Similar Documents

Publication Publication Date Title
JP4226085B2 (en) Microprocessor and multiprocessor system
JPH10134008A (en) Semiconductor device and computer system
US7581054B2 (en) Data processing system
JP2002140289A (en) Micro-controller dma operation with adjustable word size transfer and address array/increase
EP0355462B1 (en) Dedicated service processor with inter-channel communication features
JPH0696008A (en) Information processor
JPH05257657A (en) Power-on time sequence device
JP3839068B2 (en) Semiconductor integrated circuit device
US7310717B2 (en) Data transfer control unit with selectable transfer unit size
JP4322284B2 (en) Single chip microcomputer
JP2001109708A (en) Microcomputer
JP3681590B2 (en) Data processing apparatus and data processing system
JPH0855097A (en) Data processing system and its memory access method
JP2006040310A (en) Semiconductor integrated circuit system and microcomputer
US7237099B2 (en) Multiprocessor system having a plurality of control programs stored in a continuous range of addresses of a common memory and having identification registers each corresponding to a processor and containing data used in deriving a starting address of a CPU-linked interrupt handler program to be executed by the corresponding processor
JP3323341B2 (en) Emulation processor and emulator equipped with it
JPH0227696B2 (en) JOHOSHORISOCHI
JPS63310060A (en) Multiprocessor system
JPH02252044A (en) Coprocessor and data transfer control system
JP3905660B2 (en) Microcomputer and microcomputer system
JP3139310B2 (en) Digital signal processor
JPH08137784A (en) Information processor
JP2003196253A (en) Single chip microcomputer
JP2001297012A (en) Processor and emulator
JPS62200427A (en) Interruption processing system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040526

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041124

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050816

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051014

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060411

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060609

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: 20060718

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060802

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090811

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100811

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120811

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees