JP6631370B2 - Microcomputer and electronic control unit - Google Patents

Microcomputer and electronic control unit Download PDF

Info

Publication number
JP6631370B2
JP6631370B2 JP2016075780A JP2016075780A JP6631370B2 JP 6631370 B2 JP6631370 B2 JP 6631370B2 JP 2016075780 A JP2016075780 A JP 2016075780A JP 2016075780 A JP2016075780 A JP 2016075780A JP 6631370 B2 JP6631370 B2 JP 6631370B2
Authority
JP
Japan
Prior art keywords
core
data
buffer
interrupt
microcomputer
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.)
Active
Application number
JP2016075780A
Other languages
Japanese (ja)
Other versions
JP2017187909A (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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2016075780A priority Critical patent/JP6631370B2/en
Publication of JP2017187909A publication Critical patent/JP2017187909A/en
Application granted granted Critical
Publication of JP6631370B2 publication Critical patent/JP6631370B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Multi Processors (AREA)
  • Microcomputers (AREA)
  • Information Transfer Systems (AREA)

Description

本発明は、複数のコア間で通信を行うマイクロコンピュータ,及びそのマイクロコンピュータを備えて構成される電子制御装置に関する。   The present invention relates to a microcomputer that performs communication between a plurality of cores, and an electronic control device that includes the microcomputer.

複数のコアを備えたマイクロコンピュータでは、一般にそれらのコア間で通信を行う必要がある。以下、マイクロコンピュータを「マイコン」と略称する。コア間で通信を行う場合、複数のコアからアクセス可能な共有メモリを設けたり、例えば特許文献1に開示されているように、2つのプロセッサ間で通信するための通信チャネルを用いることが一般に行われている。   In a microcomputer having a plurality of cores, it is generally necessary to communicate between the cores. Hereinafter, the microcomputer is abbreviated as “microcomputer”. When communication is performed between cores, it is common practice to provide a shared memory that can be accessed from a plurality of cores, or to use a communication channel for communication between two processors, for example, as disclosed in Patent Document 1. Has been done.

この構成では、データを送信するコアは通信チャネルを介して他のコアの記憶領域にアクセスし、データを受信するコアは、対応する記憶領域へアクセスし、記憶されたデータを読み込むことでコア間通信を行う。この場合、送信側のコアがデータを書き込んだり受信側のコアがデータ読み込んでいる間は、他のコアが別の処理を実行することが可能であるからデータ転送を効率良く行うことができる。   In this configuration, the core that transmits data accesses the storage area of another core via the communication channel, and the core that receives data accesses the corresponding storage area and reads the stored data to establish a connection between the cores. Perform communication. In this case, while the transmitting core is writing data or the receiving core is reading data, other cores can execute other processing, so that data transfer can be performed efficiently.

特表2005−534094号公報JP 2005-534094 A

特許文献1の構成では、効率的な通信が可能である一方で、通信可能なコアの組み合わせが予め決定されてしまう。そのため、複数のコアを含むマイコンで通信するコアの組み合わせを柔軟に変更することができない。   In the configuration of Patent Document 1, while efficient communication is possible, a combination of communicable cores is determined in advance. Therefore, it is not possible to flexibly change the combination of the cores communicated by the microcomputer including the plurality of cores.

ところで、複数のコア間での通信を柔軟且つ効率的に行う手段の1つとして、共通記憶領域にFIFO(Fast In First Out)を用いることが想定される。特許文献1の構成を採用する場合、送信側のコアから直接受信側の記憶領域にアクセス可能なため、共通記憶領域にFIFOを用いる通信と同様のデータ通信を実現するにはプログラムによる管理が必要となる。したがって、プログラムの処理時間が増加する問題が生じる。   By the way, as one of means for performing communication between a plurality of cores flexibly and efficiently, it is assumed that a FIFO (Fast In First Out) is used for a common storage area. When the configuration of Patent Document 1 is adopted, the storage area on the receiving side can be directly accessed from the core on the transmitting side, so that management by a program is necessary to realize data communication similar to communication using FIFO for the common storage area. It becomes. Therefore, there is a problem that the processing time of the program increases.

本発明は上記事情に鑑みてなされたものであり、その目的は、プログラムによる管理を不要にして任意のコア間でのFIFO通信を実現できるマイクロコンピュータ及びそのマイクロコンピュータを備えている電子制御装置を提供することにある。   The present invention has been made in view of the above circumstances, and has as its object to provide a microcomputer capable of realizing FIFO communication between arbitrary cores without the need for management by a program, and an electronic control device including the microcomputer. To provide.

請求項1記載のマイクロコンピュータによれば、コア間通信部が備えるバッファは、複数のコアによりアクセスされ、これらの間で行われるコア間通信により転送されるデータが先入れ先出し制御で格納される。そして、割り込み送信部は、コア間通信を制御するためコアに対して割り込み信号を送信する。このように構成すれば、複数のコア間で行う通信により転送されるデータを、先入れ先出し制御でバッファに格納することができ、且つそのバッファを介して行うコア間の転送を割り込みで制御できるので、各コアによる前記転送に関するプログラムでの管理が不要になり、FIFO通信を容易に実現できる。   According to the microcomputer of the first aspect, the buffer provided in the inter-core communication unit is accessed by a plurality of cores, and data transferred by inter-core communication performed between them is stored by first-in first-out control. Then, the interrupt transmitting unit transmits an interrupt signal to the core to control the communication between the cores. With this configuration, data transferred by communication performed between a plurality of cores can be stored in a buffer by first-in first-out control, and transfer between cores performed through the buffer can be controlled by interruption. There is no need to manage the transfer by a program in each core, and FIFO communication can be easily realized.

また、請求項記載のマイクロコンピュータによれば、設定レジスタにより指定を行うことで、バッファに格納されているデータの状態に応じて割り込み送信部による割込み信号の送信先を切り換える。したがって、前記送信先のコアは、受信するべきデータがバッファに格納されたことを割り込みによって認識できる。また、状態レジスタは、バッファにおけるデータの格納状態を示すので、コアは、バッファに対するデータの読み書きが完了しなかった際に、状態レジスタを参照することでバッファの状態を認識できる。 Further, according to the microcomputer according to claim 1, wherein, by performing a designation by setting register switches the destination of the interrupt signal by the interrupt transmission section in accordance with the state of the data stored in the buffer. Therefore, the transmission destination core can recognize that the data to be received is stored in the buffer by the interruption. Further, since the status register indicates the storage status of data in the buffer, the core can recognize the status of the buffer by referring to the status register when reading / writing of data from / to the buffer is not completed.

請求項記載のマイクロコンピュータによれば、設定レジスタとして、バッファにデータが書き込み可能な状態である時に割り込み信号を送信するコアを指定するための送信元設定レジスタと、バッファに対するデータの書き込みが完了した時に割り込み信号を送信するコアを指定するための受信元設定レジスタとを備える。このように構成すれば、コア間通信においてデータの送信元及び送信先となるコアを任意に設定して、それぞれに対して割り込みを発生させることができる。 According to claim 2 microcomputer according completion as setting register, a source setting register for designating a core for transmitting an interrupt signal when the state data can be written to the buffer, the writing of data to the buffer And a reception source setting register for designating a core to which an interrupt signal is to be transmitted when an error occurs. With this configuration, it is possible to arbitrarily set the data transmission source and transmission destination cores in the inter-core communication and generate an interrupt for each of them.

第1実施形態であり、マイクロコンピュータ及び電子制御装置の構成を示す機能ブロック図FIG. 2 is a functional block diagram illustrating a configuration of a microcomputer and an electronic control device according to the first embodiment. コア間通信の準備に関する処理を示すフローチャートFlowchart showing processing related to preparation for inter-core communication 送信側のコアによる処理を示すフローチャートFlow chart showing processing by the core on the transmitting side 受信側のコアによる処理を示すフローチャートFlow chart showing processing by the core on the receiving side コア間通信の一例を示すタイミングチャートTiming chart showing an example of inter-core communication 第2実施形態であり、マイクロコンピュータ及び電子制御装置の構成を示す機能ブロック図2 is a functional block diagram illustrating a configuration of a microcomputer and an electronic control device according to a second embodiment.

(第1実施形態)
以下、第1実施形態について説明する。図1に示すように、本実施形態のマイコン1は、複数のコア2(1),2(2),…2(n)と、これらのコア2と共有バス3を介して接続されているFIFO通信装置4とを備えている。FIFO通信装置4は、バッファ・レジスタ部5と割り込み送信部6とを備えている。バッファ・レジスタ部5は、FIFOバッファ7,割り込み送信先設定レジスタ8及び状態レジスタ9で構成される。また、割り込み送信部6は、各コア2(1)〜2(n)のそれぞれに対して割り込み信号INT‘(1)〜INT(n)を入力する。FIFO通信装置4はコア間通信部に相当する。
(1st Embodiment)
Hereinafter, the first embodiment will be described. As shown in FIG. 1, the microcomputer 1 of the present embodiment is connected to a plurality of cores 2 (1), 2 (2),... 2 (n) and these cores 2 via a shared bus 3. And a FIFO communication device 4. The FIFO communication device 4 includes a buffer register unit 5 and an interrupt transmission unit 6. The buffer / register unit 5 includes a FIFO buffer 7, an interrupt destination setting register 8, and a status register 9. Further, the interrupt transmission unit 6 inputs the interrupt signals INT ′ (1) to INT (n) to each of the cores 2 (1) to 2 (n). The FIFO communication device 4 corresponds to an inter-core communication unit.

FIFOバッファ7は、先入れ先出し順でデータを管理する記憶領域である。FIFOバッファ7に対するコア2からの書き込み及び読み出しは排他制御され、複数のコア2によって同時にデータが読み書きされることはない。FIFOバッファ7には、予め決められた記憶容量に達するまでデータの書き込みが可能である。また、FIFOバッファ7に書き込まれた有効なデータがある場合には、FIFOバッファ7からデータの読み出しが可能である。   The FIFO buffer 7 is a storage area for managing data in a first-in first-out order. Writing and reading from and to the FIFO buffer 7 from the core 2 are exclusively controlled, and data is not read and written by a plurality of cores 2 at the same time. Data can be written to the FIFO buffer 7 until a predetermined storage capacity is reached. In addition, when there is valid data written in the FIFO buffer 7, data can be read from the FIFO buffer 7.

FIFOバッファ7からデータを読み出す際には、書き込まれた順に読み出される。そして、一度読み出されたデータは削除され、そのデータが記憶されていた領域は再度書き込み可能な領域となる。そのため、FIFOバッファ7の記憶容量が上限に達するとデータの書き込みはできず、書き込みを行うコア2は、記憶領域に空きが生じるのを待つ必要がある。同様に、FIFOバッファ7に有効なデータが無い場合、読み込みを行うコア2は有効なデータがFIFOバッファ7に保存されるまで待つ必要がある。   When reading data from the FIFO buffer 7, the data is read in the order of writing. Then, the data once read is deleted, and the area where the data is stored becomes a writable area again. Therefore, when the storage capacity of the FIFO buffer 7 reaches the upper limit, data cannot be written, and the writing core 2 needs to wait for a free space in the storage area. Similarly, when there is no valid data in the FIFO buffer 7, the reading core 2 needs to wait until valid data is stored in the FIFO buffer 7.

割り込み送信先設定レジスタ8は、2つの設定領域SND及びRCVを持つ。これらの領域には、割り込み信号を送信する先のコア2を指定する。領域SNDに指定したコア2には、FIFOバッファ7の記憶領域にデータを書き込み可能な場合に割り込み信号INTが送信される。また、領域RCVに指定したコア2には、FIFOバッファ7の記憶領域に有効なデータが存在する場合に割り込み信号INTが送信される。つまり、領域SNDにはデータを送信する側のコア2を指定し、領域RCVにはデータを受信する側のコア2を指定する。   The interrupt destination setting register 8 has two setting areas SND and RCV. In these areas, the core 2 to which the interrupt signal is transmitted is specified. An interrupt signal INT is transmitted to the core 2 designated as the area SND when data can be written to the storage area of the FIFO buffer 7. Further, an interrupt signal INT is transmitted to the core 2 designated as the area RCV when valid data exists in the storage area of the FIFO buffer 7. That is, the core 2 on the data transmission side is specified in the area SND, and the core 2 on the data reception side is specified in the area RCV.

これらの領域SND,RCVで指定されたコア2には、割り込み送信部6より割り込み信号INTが送信される。尚、領域SNDにコア2が指定されていなければ、割り込み信号INTは何れのコア2にも送信されない。また、領域RCVも同様に、コア2も指定されていなければ、何れのコア2にも割り込み信号INTは送信されない。領域SNDは送信元設定レジスタに相当し、領域RCVは受信元設定レジスタに相当する。   The interrupt signal INT is transmitted from the interrupt transmission unit 6 to the core 2 specified by these areas SND and RCV. If the core 2 is not specified in the area SND, the interrupt signal INT is not transmitted to any of the cores 2. Similarly, if no core 2 is specified in the region RCV, the interrupt signal INT is not transmitted to any core 2. The area SND corresponds to a transmission source setting register, and the area RCV corresponds to a reception source setting register.

状態レジスタ9は、FIFOバッファ7の状態を示すレジスタであり、コア2はそのレジスタ値を読み出すことで、FIFOバッファ7の状態を知ることができる。具体的には、状態レジスタ9は(1)FIFOバッファ7の記憶領域に有効なデータが無い状態,(2)FIFOバッファ7の記憶領域に空きがない状態,(3)FIFOバッファ7にデータを追加可能な状態,及び(4)FIFOバッファ7からのデータ読み出しが可能な状態を示す。そして、例えば車両制御用の電子制御装置10は、マイコン1に図示しない周辺回路等を加えて構成されている。   The status register 9 is a register indicating the status of the FIFO buffer 7, and the core 2 can know the status of the FIFO buffer 7 by reading the register value. Specifically, the status register 9 stores (1) a state in which there is no valid data in the storage area of the FIFO buffer 7, (2) a state in which there is no free space in the storage area of the FIFO buffer 7, and (3) a state in which data is stored in the FIFO buffer 7. A state in which data can be added and a state in which data can be read from the FIFO buffer 7 are shown. For example, the electronic control unit 10 for controlling the vehicle is configured by adding a peripheral circuit (not shown) to the microcomputer 1.

次に、本実施形態の作用について説明する。図2に示すように、FIFO通信装置4を用いたコア間通信の準備においては、主に3つの処理が必要となる。その1つはFIFOバッファ7の初期化であり(S1)、他の1つは割り込み送信先設定レジスタ8の領域RCVの設定である(S2)。領域RCVには、前述したように通信を行うコア2の内、受信側のコア2を指定する。残りの1つは、同レジスタ8の領域SNDの設定である(S3)。領域SNDには、通信を行うコア2の内、送信側のコア2を指定する。なお、送信側の処理で割り込みを用いない場合には、この設定を省略することもできる。   Next, the operation of the present embodiment will be described. As shown in FIG. 2, in preparation for inter-core communication using the FIFO communication device 4, three processes are mainly required. One is to initialize the FIFO buffer 7 (S1), and the other is to set the area RCV of the interrupt destination setting register 8 (S2). In the area RCV, the core 2 on the receiving side is specified among the cores 2 that perform communication as described above. The other one is the setting of the area SND of the register 8 (S3). In the area SND, of the cores 2 that perform communication, the transmission-side core 2 is specified. If no interrupt is used in the process on the transmitting side, this setting can be omitted.

尚、上記3つの処理は、本実施形態のようにバッファ・レジスタ部5が1つの場合である。後述する第2実施形態のように、複数のバッファ・レジスタ部5を備えるFIFO通信装置を用いる場合には、通信に利用する全てのバッファ・レジスタ部5について上記3つの処理を行う必要がある(S4)。   Note that the above three processes are performed when the number of the buffer / register unit 5 is one as in the present embodiment. When a FIFO communication device including a plurality of buffer / register units 5 is used as in a second embodiment described later, it is necessary to perform the above three processes for all the buffer / register units 5 used for communication ( S4).

図3に示すように、FIFO通信装置4を用いてコア2からデータを書き込む場合は、先ずFIFOバッファ7へのデータ書き込みを試行する(S11)。この際、FIFOバッファ7へのアクセスは、当該バッファ7側のロジックにより排他制御されているので、従来技術のような排他制御機構を用いたロック取得は不要である。それから、FIFOバッファ7への書き込みが完了したか否かを判定する(S12)。この判定は、書き込み先に「書き込み完了」か「書き込みエラー」かを示す値が設定されているので、その値に基づいて行う。FIFOバッファ7への書き込みが完了した場合は(YES)、そのまま書き込み処理を終了する。一方、書き込みが完了しなかった場合には(NO)、書き込み可能な状態となるまで待機する必要がある(S13,S14)。   As shown in FIG. 3, when data is written from the core 2 using the FIFO communication device 4, first, data writing to the FIFO buffer 7 is attempted (S11). At this time, since access to the FIFO buffer 7 is exclusively controlled by the logic of the buffer 7, it is not necessary to acquire a lock using an exclusive control mechanism as in the related art. Then, it is determined whether or not the writing to the FIFO buffer 7 has been completed (S12). This determination is made based on a value indicating whether “write completed” or “write error” is set in the write destination. If the writing to the FIFO buffer 7 has been completed (YES), the writing process ends. On the other hand, if the writing has not been completed (NO), it is necessary to wait until the writing becomes possible (S13, S14).

ここで、上記の待機処理には2つの方法があり、その1つは割り込みを用いるものである。図2に示す準備処理において、割り込み送信先設定レジスタ8の領域SNDが設定済みである場合は、対応するコア2の割り込み受付可能に設定し、割り込み信号INTの入力があるまで待機する。領域SNDが未設定の場合は、送信側のコア2を指定した後に割り込みの受付を可能に設定し、割り込み信号INTの入力があるまで待機する。待機中に、前記コア2に対して割り込み信号INTの入力があればFIFOバッファ7への書き込みが可能となっているので、再びFIFOバッファ7への書き込みを試行する。   Here, there are two methods for the above-mentioned standby processing, one of which uses an interrupt. In the preparation process shown in FIG. 2, if the area SND of the interrupt destination setting register 8 has been set, the corresponding core 2 is set to be ready to accept an interrupt, and waits until an interrupt signal INT is input. If the area SND is not set, the reception of the interrupt is set after designating the core 2 on the transmission side, and the apparatus waits until an interrupt signal INT is input. During standby, if an interrupt signal INT is input to the core 2, writing to the FIFO buffer 7 is possible, so writing to the FIFO buffer 7 is tried again.

他の1つは、バッファ・レジスタ部5の状態レジスタ9を用いる方法である。状態レジスタ9のレジスタ値には、前述したように(1)〜(4)の4つの状態が反映されている。したがって、コア2が状態レジスタ9の値を参照し、その値がFIFOバッファ7にデータを追加可能な状態かを確認すれば良い。書き込み可能な状態であれば、再びFIFOバッファへ7の書き込みを試行する。書き込み可能な状態でなければ再び状態レジスタ9の値を読み込み、FIFOバッファ7の状態を確認することを繰り返す。   Another method is to use the status register 9 of the buffer register unit 5. The register value of the state register 9 reflects the four states (1) to (4) as described above. Therefore, the core 2 may refer to the value of the status register 9 to check whether the value is a state in which data can be added to the FIFO buffer 7. If it is in a writable state, an attempt is made to write 7 into the FIFO buffer again. If it is not in a writable state, reading the value of the state register 9 again and checking the state of the FIFO buffer 7 are repeated.

図4に示すように、コア2がデータを受信する場合には、先ずFIFOバッファ7に対するデータの読み込みを試行する(S21)。この際、書き込みと同様に、排他制御機構を用いたロック取得は不要である。FIFOバッファ7からの読み込みができた場合(S22で「YES」)そのまま読み込み処理を終了する。読み込みできなかった場合は(S22で「NO」)読み込みができるまで待機する(S23,S24)。FIFOバッファ7からの読み込み可否の判定は読み込んだ値で判断可能であり、その値がエラー値であれば読み込みができておらず、エラー値でなければ読み込みができていることを示す。   As shown in FIG. 4, when the core 2 receives data, first, it tries to read data into the FIFO buffer 7 (S21). At this time, similarly to the writing, it is not necessary to acquire the lock using the exclusive control mechanism. When the reading from the FIFO buffer 7 has been completed ("YES" in S22), the reading process is terminated. If the data cannot be read ("NO" in S22), the process waits until the data can be read (S23, S24). Whether the data can be read from the FIFO buffer 7 can be determined based on the read value. If the value is an error value, the data is not read. If the value is not an error value, the data is read.

FIFOバッファ7からの読み込みができず、読み込み可能になるまで待つ処理は、書き込みのケースと同様に2つの方法がある。第1の割り込みを用いる方法では、図2に示した準備フローにて、設定レジスタ8の領域RCVを設定していればその直後に、未設定であれば受信側のコア2を設定した後、割り込みの受付を可能にしてから割り込みによる通知があるまで待機する。待機中に割り込みによる通知があればFIFOバッファ7からの読み込みが可能となったことを示すので、コア2は読み込みを再試行する。   As in the case of the writing, there are two methods for waiting for the data to be read from the FIFO buffer 7 and becoming readable. In the method using the first interrupt, in the preparation flow shown in FIG. 2, immediately after setting the area RCV of the setting register 8, if not set, the receiving side core 2 is set. Wait for the interrupt to be accepted and wait for a notification by the interrupt. If there is a notification by an interrupt during standby, it indicates that reading from the FIFO buffer 7 is possible, and the core 2 retries reading.

第2の状態レジスタ9を用いる方法では、状態レジスタ9の値を取得し、その値によりFIFOバッファ7からデータを読み出し可能な状態かを確認する。読み出し可能な状態であれば、再びFIFOバッファ7からの読み込みを試行し、読み込み可能な状態でなければ再び状態レジスタ9の値を読み込んで状態を確認することを繰り返す。   In the method using the second status register 9, the value of the status register 9 is obtained, and it is confirmed whether the data can be read from the FIFO buffer 7 based on the obtained value. If the state is readable, the reading from the FIFO buffer 7 is tried again. If the state is not readable, the reading of the value of the state register 9 and the confirmation of the state are repeated.

例えば図5に示す一例では、コア2(1)が送信側であり、コア2(2)が受信側となっている。コア2(1)は、図2に示す初期化処理において設定レジスタ8の領域RCV及びSNDの設定を行うと(A)処理を開始する(B)。ここで、図3に示す送信側の処理である、FIFOバッファ7に対する書き込み1が行われる。この書き込み1が完了すると、FIFOバッファ7の状態は前述の(1)から(2)の空きが無い状態である「Full」になる(C)。   For example, in the example shown in FIG. 5, the core 2 (1) is on the transmitting side, and the core 2 (2) is on the receiving side. The core 2 (1) starts the processing (A) when the areas RCV and SND of the setting register 8 are set in the initialization processing shown in FIG. Here, the writing 1 to the FIFO buffer 7, which is the process on the transmitting side shown in FIG. 3, is performed. When the writing 1 is completed, the state of the FIFO buffer 7 is changed to "Full" (C), which is a state in which there is no empty space from (1) to (2).

尚、図2に示す初期化処理を行うコア2は、例えば複数のコア2の内でマスタとなるものが、本ケースではコア2(1)が、予め例えば制御プログラムにおいて指定されており、そのマスタとなるコア2のみが行う。   The core 2 that performs the initialization processing shown in FIG. 2 is, for example, a master among a plurality of cores 2. In this case, the core 2 (1) is specified in advance in, for example, a control program. Only the core 2, which is the master, performs this.

一方、コア2(2)も同様に、予め例えば制御プログラムにおいて受信側に設定されていることを認識しており、コア2(2)について行う初期化処理などを行った後に、受信側の処理を開始する。FIFOバッファ7が初期化されており、有効なデータが存在しない「Empty」の状態ではコア2(2)はデータを読み出せない。但し、このケースでは、FIFOバッファ7が「Empty」の期間にコア2(2)はデータの読み出しを開始しておらず、読み出しを待機する状態は発生していない。   On the other hand, the core 2 (2) also recognizes in advance that it is set on the receiving side in, for example, a control program, and after performing the initialization processing performed on the core 2 (2), the processing on the receiving side. To start. The core 2 (2) cannot read data in the state of “Empty” where the FIFO buffer 7 has been initialized and no valid data exists. However, in this case, the core 2 (2) has not started reading data during the period when the FIFO buffer 7 is "Empty", and a state of waiting for reading has not occurred.

続いて、コア2(1)は、次に送信するデータの書き込み2を行うが(D)、コア2(2)による読み込み1が完了しておらず、FIFOバッファ7が「Full」の状態である間は待機する。ここでは、割込み送信部6からの割り込みによる通知を待つ(E)。そして、コア2(2)による読み込み1が完了すると(F)コア2(1)に対する割り込みが発生する。これによりコア2(1)は、FIFOバッファ7が状態(3)である「Empty」になったことを認識し(G)書き込み2を行う。一方、コア2(2)は次の処理を開始するが(H)、ここでもFIFOバッファ7が「Empty」の期間にデータの読み込み2を開始しておらず、待機状態は発生していない。   Subsequently, the core 2 (1) performs the writing 2 of the data to be transmitted next (D), but the reading 1 by the core 2 (2) is not completed, and the FIFO buffer 7 is in the “Full” state. Wait for a while. Here, it waits for a notification by the interrupt from the interrupt transmitting unit 6 (E). When the reading 1 by the core 2 (2) is completed, (F) an interrupt to the core 2 (1) occurs. As a result, the core 2 (1) recognizes that the FIFO buffer 7 has changed to the state (3) “Empty” and performs (G) write 2. On the other hand, the core 2 (2) starts the next processing (H), but also in this case, the FIFO buffer 7 has not started data reading 2 during the “Empty” period, and no standby state has occurred.

そして、コア2(1)による書き込み2が完了した時点(I)以降に、コア2(2)は読み込み2を開始する。コア2(1)は、書き込み2の完了後に次の処理を開始するが(J)、FIFOバッファ7が「Full」の状態である間は次のデータの書き込み3を開始しておらず、待機状態は発生していない。   The core 2 (2) starts the reading 2 after the point (I) at which the writing 2 by the core 2 (1) is completed. The core 2 (1) starts the next processing after the completion of the write 2 (J), but does not start the next data write 3 while the FIFO buffer 7 is in the “Full” state, and waits. No condition has occurred.

読み込み2が完了すると(K)、コア2(2)は次の読み込み3を開始するが(L)、コア2(1)による書き込み3が完了しておらずFIFOバッファ7は「Empty」の
状態にある。したがって、コア2(2)は読み込み3を実行できず、割込み待ちとなる(M)。そして、コア2(1)による書き込み3が完了すると(N)、コア2(2)は割り込み信号による通知を受信して(O)読み込み3を実行し、その後、読み込み3が完了する(P)。
When the reading 2 is completed (K), the core 2 (2) starts the next reading 3 (L), but the writing 3 by the core 2 (1) is not completed, and the FIFO buffer 7 is in the “Empty” state. It is in. Therefore, the core 2 (2) cannot execute the reading 3, and waits for an interrupt (M). Then, when the writing 3 by the core 2 (1) is completed (N), the core 2 (2) receives the notification by the interrupt signal and executes (O) the reading 3, and thereafter the reading 3 is completed (P). .

尚、図5に示す例では、コア2が書き込みや読み込みを待機している状態から、書き込みや読み込みが可能になったことを割り込み信号による通知で認識している。これを、図3及び図4に示したように、コア2がポーリングにより状態レジスタ9を参照することで認識するようにしても良い。   In the example shown in FIG. 5, from the state where the core 2 is waiting for writing or reading, it is recognized by the notification by the interrupt signal that writing or reading has become possible. This may be recognized by the core 2 referring to the status register 9 by polling, as shown in FIGS.

以上のように本実施形態によれば、FIFO通信装置4が備えるFIFOバッファ7は、複数のコア2によりアクセスされ、これらの間で行われるコア間通信により転送されるデータが先入れ先出し制御で格納される。割り込み送信部6は、コア間通信を制御するためコア2に対して割り込み信号を送信する。このように構成すれば、複数のコア2間で行う通信により転送されるデータを、先入れ先出し制御でFIFOバッファ7に格納することができる。   As described above, according to the present embodiment, the FIFO buffer 7 included in the FIFO communication device 4 is accessed by the plurality of cores 2 and stores data transferred by inter-core communication performed between the cores 2 on a first-in first-out basis. You. The interrupt transmission unit 6 transmits an interrupt signal to the core 2 to control communication between the cores. With this configuration, data transferred by communication performed between the plurality of cores 2 can be stored in the FIFO buffer 7 by first-in first-out control.

そして、FIFOバッファ7を介して行うコア2間のデータ転送を割り込みで制御できるので、各コア2による前記転送に関するプログラムでの管理が不要になり、FIFO通信を容易に実現できる。すなわち、コア2間での効率的なFIFO通信が従来技術よりも少ない工程で可能となり、プログラムの処理負荷削減できる共にFIFO通信に関するプログラムの作成が容易になる。   Since data transfer between the cores 2 via the FIFO buffer 7 can be controlled by interruption, management of the transfer by each core 2 in a program is not necessary, and FIFO communication can be easily realized. That is, efficient FIFO communication between the cores 2 can be performed in fewer steps than in the related art, so that the processing load of the program can be reduced and the creation of a program relating to the FIFO communication becomes easy.

また、設定レジスタ8に指定を行うことで、FIFOバッファ7に格納されているデータの状態に応じて割り込み送信部6による割込み信号の送信先を切り換えるので、送信先のコア2は、受信するべきデータがFIFOバッファ7に格納されたことを割り込みの通知により認識できる。また、状態レジスタ9は、FIFOバッファ7におけるデータの格納状態を示すので、コア2は、FIFOバッファ7に対するデータの読み書きが完了しなかった際に、状態レジスタ9を参照することでその状態を認識できる。   Also, by specifying the setting register 8, the destination of the interrupt signal by the interrupt transmitting unit 6 is switched according to the state of the data stored in the FIFO buffer 7, so that the transmission destination core 2 should receive the signal. The fact that the data has been stored in the FIFO buffer 7 can be recognized by the notification of the interrupt. Further, since the status register 9 indicates the data storage status in the FIFO buffer 7, the core 2 recognizes the status by referring to the status register 9 when reading / writing of data from / to the FIFO buffer 7 is not completed. it can.

更に、設定レジスタ8として、FIFOバッファ7にデータが書き込み可能な状態である時に割り込み信号を送信するコア2を指定するための領域SNDと、FIFOバッファ7に対するデータの書き込みが完了した時に割り込み信号を送信するコア2を指定するための領域RCVとを備える。このように構成すれば、コア間通信においてデータの送信元及び送信先となるコア2を任意に設定して、それぞれに対して割り込みを発生させることができる。   Further, as the setting register 8, an area SND for designating the core 2 that transmits an interrupt signal when data can be written to the FIFO buffer 7, and an interrupt signal when data writing to the FIFO buffer 7 is completed And a region RCV for designating the core 2 to be transmitted. With this configuration, it is possible to arbitrarily set the data transmission source and the transmission destination core 2 in the inter-core communication, and generate an interrupt for each of them.

また、送信側となるコア2は、FIFOバッファ7にデータを書き込み可能な空き領域が存在しなければ、空き領域が発生するまで書き込み処理を待機する。その際に、割り込み送信部6は、FIFOバッファ7に空き領域が発生すると、データの書き込み待ち状態にあるコア2に対して割り込み信号を送信するので、送信側となるコア2は、その割り込み信号により空き領域の発生を確認できる。また、送信側となるコア2は、状態レジスタ9を参照することによっても、空き領域の発生の有無を判断できる。   If there is no free area in the FIFO buffer 7 where data can be written, the core 2 on the transmission side waits for a write process until a free area is generated. At this time, when an empty area occurs in the FIFO buffer 7, the interrupt transmitting unit 6 transmits an interrupt signal to the core 2 in a data write waiting state. Can confirm the occurrence of an empty area. The transmission-side core 2 can also determine whether or not an empty area has occurred by referring to the status register 9.

また、受信側となるコア2は、FIFOバッファ7に読み込み可能なデータが存在しなければ、FIFOバッファ7にデータが書き込まれるまで読み込み処理を待機する。その際に、割り込み送信部6は、FIFOバッファ7に対するデータの書き込みが完了すると、データの読み込み待ち状態にあるコア2に対して割り込み信号を送信するので、受信側となるコア2は、その割り込み信号によりデータの書き込み完了を確認できる。また、受信側となるコア2は、状態レジスタ9を参照することによっても、書き込み完了の有無を判断できる。   If there is no readable data in the FIFO buffer 7, the core 2 on the receiving side waits for a reading process until data is written to the FIFO buffer 7. At this time, when the writing of data to the FIFO buffer 7 is completed, the interrupt transmitting unit 6 transmits an interrupt signal to the core 2 which is in a data read waiting state. The completion of data writing can be confirmed by the signal. Also, the core 2 on the receiving side can determine whether the writing has been completed by referring to the status register 9.

(第2実施形態)
以下、第1実施形態と同一部分には同一符号を付して説明を省略し、異なる部分について説明する。図6に示す第2実施形態のマイコン11は、FIFO通信装置4に替わるFIFO通信装置12を備えている。FIFO通信装置12は、複数のバッファ・レジスタ部5(1),5(2),…,5(n)を有し、これらによって共通の割り込み送信部13が制御される。そして、電子制御装置14は、マイコン11を備えて構成されている。
(2nd Embodiment)
Hereinafter, the same portions as those of the first embodiment will be denoted by the same reference numerals, and the description thereof will be omitted, and different portions will be described. The microcomputer 11 of the second embodiment shown in FIG. 6 includes a FIFO communication device 12 instead of the FIFO communication device 4. The FIFO communication device 12 has a plurality of buffer / register units 5 (1), 5 (2),..., 5 (n), and the common interrupt transmission unit 13 is controlled by these units. The electronic control unit 14 includes the microcomputer 11.

各コア2は、共有バス3を介して何れのバッファ・レジスタ部5(1),5(2),…,5(n)にもアクセスが可能である。したがって、同じコア2による送信,受信の組み合わせに対して、任意の数のバッファ・レジスタ部5を用いたコア間通信が可能である。   Each core 2 can access any of the buffer / register sections 5 (1), 5 (2),..., 5 (n) via the shared bus 3. Therefore, for the combination of transmission and reception by the same core 2, inter-core communication using an arbitrary number of buffer registers 5 is possible.

本発明は上記した、又は図面に記載した実施形態にのみ限定されるものではなく、以下のような変形又は拡張が可能である。
書込み及び読み出しの可否を判断する際に状態レジスタ9を参照する処理は、必要に応じて行えば良い。
車両制御用の電子制御装置に限ることなく、その他の電子制御装置や、その他の装置を構成するマイクロコンピュータに適用しても良い。
The present invention is not limited only to the embodiments described above or illustrated in the drawings, and the following modifications or extensions are possible.
The process of referring to the status register 9 when judging whether writing or reading is possible may be performed as needed.
The present invention is not limited to the electronic control device for controlling the vehicle, and may be applied to other electronic control devices and microcomputers constituting other devices.

1 マイクロコンピュータ、2 コア、4 FIFO通信装置、5 バッファ・レジスタ部、6 割り込み送信部、7 FIFOバッファ、8 割り込み送信先設定レジスタ、9 状態レジスタ、10 電子制御装置。   1 microcomputer, 2 cores, 4 FIFO communication device, 5 buffer register section, 6 interrupt transmission section, 7 FIFO buffer, 8 interrupt destination setting register, 9 status register, 10 electronic control unit.

Claims (10)

複数のコア(2)と、
これら複数のコアによりアクセスされ、当該複数のコア間で行われるコア間通信により転送されるデータが先入れ先出し制御で格納されるバッファ(7),及び前記コア間通信を制御するためコアに対して割り込み信号を送信する割り込み送信部(6,13)を有するコア間通信部(4,12)と、
前記バッファに格納されているデータの状態に応じて、前記割り込み送信部による割込み信号の送信先を切り換えるための設定レジスタ(8)と、
前記バッファにおけるデータの格納状態を示す状態レジスタと、
を備えるマイクロコンピュータ。
A plurality of cores (2);
A buffer (7) in which data accessed by the plurality of cores and transferred by inter-core communication performed between the plurality of cores is stored by first-in first-out control, and an interrupt to the core for controlling the inter-core communication is performed. An inter-core communication unit (4, 12) having an interrupt transmission unit (6, 13) for transmitting a signal,
A setting register (8) for switching a transmission destination of an interrupt signal by the interrupt transmission unit according to a state of data stored in the buffer;
A status register indicating a data storage status in the buffer;
A microcomputer comprising:
前記設定レジスタは、前記バッファにデータが書き込み可能な状態である時に割り込み信号を送信するコアを指定するための送信元設定レジスタ(SND)と、
前記バッファに対するデータの書き込みが完了した時に割り込み信号を送信するコアを指定するための受信元設定レジスタ(RCV)と、
を備える請求項記載のマイクロコンピュータ。
A source setting register (SND) for designating a core that transmits an interrupt signal when data is ready to be written to the buffer;
A receiver setting register (RCV) for designating a core to which an interrupt signal is transmitted when data writing to the buffer is completed;
The microcomputer according to claim 1, further comprising:
前記設定レジスタ及び前記状態レジスタを複数組備える請求項又は記載のマイクロコンピュータ。 It said setting register and claim 1 or 2 microcomputer according comprising a plurality of sets of the status register. データの送信側となるコアは、前記バッファにデータを書き込み可能な空き領域が存在しなければ、前記空き領域が発生するまで前記バッファに対する書き込み処理を待機する請求項1からの何れか一項に記載のマイクロコンピュータ。 Core of the transmission side of the data, unless free space available to write data into the buffer is present, any one of claims 1 to 3, waiting for the write processing for the buffer to said free area is generated The microcomputer according to 1. 前記割り込み送信部は、前記バッファに空き領域が発生すると、データの書き込み待ち状態にあるコアに対して割り込み信号を送信し、
前記送信側となるコアは、前記割り込み信号により前記空き領域の発生を確認する請求項記載のマイクロコンピュータ。
The interrupt transmitting unit transmits an interrupt signal to a core in a data write waiting state when an empty area occurs in the buffer,
5. The microcomputer according to claim 4 , wherein the core on the transmission side confirms the occurrence of the empty area based on the interrupt signal.
前記送信側となるコアは、前記状態レジスタを参照することで前記空き領域の発生の有無を判断する請求項記載のマイクロコンピュータ。 The microcomputer according to claim 4, wherein the transmission side core determines whether or not the free area has occurred by referring to the status register. データの受信側となるコアは、前記バッファに読み込み可能なデータが存在しなければ、前記バッファにデータが書き込まれるまで前記バッファに対する読み込み処理を待機する請求項1からの何れか一項に記載のマイクロコンピュータ。 7. The data receiving core according to any one of claims 1 to 6 , wherein if there is no readable data in the buffer, the core on the data receiving side waits for a reading process on the buffer until data is written in the buffer. Microcomputer. 前記割り込み送信部は、前記バッファに対するデータの書き込みが完了すると、データの読み込み待ち状態にあるコアに対して割り込み信号を送信し、
前記受信側となるコアは、前記割り込み信号により前記書き込み完了を確認する請求項記載のマイクロコンピュータ。
When the writing of the data to the buffer is completed, the interrupt transmitting unit transmits an interrupt signal to the core in a data read waiting state,
8. The microcomputer according to claim 7 , wherein the core on the receiving side confirms the completion of the writing by the interrupt signal.
前記受信側となるコアは、前記状態レジスタを参照することで前記バッファに対する書き込み完了の有無を判断する請求項記載のマイクロコンピュータ。 The receiving side to become core you determine the presence or absence of write completion to said buffer by referring to the status register Motomeko 7 microcomputer according. 請求項1からの何れか一項に記載のマイクロコンピュータ(1,11)を備える電子制御装置。 An electronic control device comprising the microcomputer (1, 11) according to any one of claims 1 to 9 .
JP2016075780A 2016-04-05 2016-04-05 Microcomputer and electronic control unit Active JP6631370B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016075780A JP6631370B2 (en) 2016-04-05 2016-04-05 Microcomputer and electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016075780A JP6631370B2 (en) 2016-04-05 2016-04-05 Microcomputer and electronic control unit

Publications (2)

Publication Number Publication Date
JP2017187909A JP2017187909A (en) 2017-10-12
JP6631370B2 true JP6631370B2 (en) 2020-01-15

Family

ID=60045579

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016075780A Active JP6631370B2 (en) 2016-04-05 2016-04-05 Microcomputer and electronic control unit

Country Status (1)

Country Link
JP (1) JP6631370B2 (en)

Also Published As

Publication number Publication date
JP2017187909A (en) 2017-10-12

Similar Documents

Publication Publication Date Title
KR102416283B1 (en) Serial peripheral interface
JP2004302713A (en) Storage system and its control method
JP2003076654A (en) Data transfer system between memories of dsps
JP2009043256A (en) Accessing method and arrangement of memory unit
US20030167368A1 (en) Transmission control circuit, reception control circuit, communications control circuit, and communications control unit
JPH07225727A (en) Computer system
US20080147906A1 (en) DMA Transferring System, DMA Controller, and DMA Transferring Method
JP5456434B2 (en) Pipe arbitration circuit, pipe arbitration method
JP6631370B2 (en) Microcomputer and electronic control unit
JP4104939B2 (en) Multiprocessor system
JP4856413B2 (en) Arithmetic processing apparatus, information processing apparatus, and control method for arithmetic processing apparatus
US20080126472A1 (en) Computer communication
US10185684B2 (en) System interconnect and operating method of system interconnect
JP2011070259A (en) Data transfer device and data transfer method
JP2006119724A (en) Cpu system, bus bridge, its control method, and computer system
JP2006285872A (en) Multi-cpu system
JP2014241124A (en) Exclusive control system
JP6430710B2 (en) Data transfer control device and data transfer control method
JP4411138B2 (en) Data flow control system, circuit thereof, and method thereof
US20230236742A1 (en) NONVOLATILE MEMORY EXPRESS (NVMe) OVER COMPUTE EXPRESS LINK (CXL)
WO2017056172A1 (en) Computer system which performs exclusive access control of memory region
JP3799741B2 (en) Bus controller
JP5587530B2 (en) Engine / processor linkage system and linkage method
JP2000339179A (en) Inter-process communication system in computer system
US9854117B2 (en) Information processing system including device provided with circuit capable of configuring logic circuit according to circuit information and plurality of control units

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180621

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190702

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190802

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20191008

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191015

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191125

R151 Written notification of patent or utility model registration

Ref document number: 6631370

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250