JP6632416B2 - Shared memory control circuit and shared memory control method - Google Patents

Shared memory control circuit and shared memory control method Download PDF

Info

Publication number
JP6632416B2
JP6632416B2 JP2016026830A JP2016026830A JP6632416B2 JP 6632416 B2 JP6632416 B2 JP 6632416B2 JP 2016026830 A JP2016026830 A JP 2016026830A JP 2016026830 A JP2016026830 A JP 2016026830A JP 6632416 B2 JP6632416 B2 JP 6632416B2
Authority
JP
Japan
Prior art keywords
memory
semaphore
register
memory area
processor
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
JP2016026830A
Other languages
Japanese (ja)
Other versions
JP2017146703A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2016026830A priority Critical patent/JP6632416B2/en
Publication of JP2017146703A publication Critical patent/JP2017146703A/en
Application granted granted Critical
Publication of JP6632416B2 publication Critical patent/JP6632416B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、共有メモリ制御回路及び共有メモリ制御方法に関し、特に、複数のプロセッサからアクセス可能な共有メモリを有するマルチプロセッサシステムに関する。   The present invention relates to a shared memory control circuit and a shared memory control method, and more particularly, to a multiprocessor system having a shared memory accessible from a plurality of processors.

共有メモリを有するマルチプロセッサシステムにおいて、複数のプロセッサ(CPU)から共有メモリにアクセスする際の排他制御のためにセマフォ(排他制御用変数)が用いられる。共有メモリを複数の領域に分割し、分割したメモリ領域に対応したセマフォレジスタを設ける。共有メモリアクセス時には、アクセスする領域に対応するセマフォレジスタが”0”であることを読み出すことにより、他のプロセッサにセマフォが獲得されていないことを確認した後に、セマフォ使用中を示すために”1”を書き込み、セマフォを獲得することで排他制御を行う。セマフォを獲得したあとに共有メモリへアクセスし、読み出し又は書き込みを行うことにより、複数のプロセッサからの同時アクセスを禁止し、同時書き込みによるデータ破壊やデータ読み出し中にデータが書き換えられることを防止している。そのため、セマフォ獲得失敗時すなわちセマフォレジスタから読み出した値が”1”の場合にはポーリングなどでセマフォ解放を待つ必要がある。
セマフォ獲得時は、セマフォレジスタの状態読み出し動作から獲得状態書き込み動作までの間に、別のプロセッサから読み出し又は書き込みが発生すると排他制御が実現できない。このため、セマフォレジスタの状態読み出しから獲得状態書き込みまでは他のプロセッサからのアクセスを禁止する必要があり、リード・モディファイ・ライトと呼ばれる状態読み出しを行うと同時に獲得状態を書き込む処理を行わなければならない。
In a multiprocessor system having a shared memory, a semaphore (an exclusive control variable) is used for exclusive control when a plurality of processors (CPUs) access the shared memory. The shared memory is divided into a plurality of areas, and semaphore registers corresponding to the divided memory areas are provided. At the time of shared memory access, by reading that the semaphore register corresponding to the area to be accessed is "0", it is confirmed that the semaphore has not been acquired by another processor, and then "1" to indicate that the semaphore is in use. To perform exclusive control by acquiring a semaphore. By accessing the shared memory after acquiring the semaphore and reading or writing, simultaneous access from multiple processors is prohibited, preventing data corruption due to simultaneous writing and rewriting data during data reading. I have. Therefore, when the semaphore acquisition fails, that is, when the value read from the semaphore register is “1”, it is necessary to wait for the semaphore release by polling or the like.
At the time of semaphore acquisition, exclusive control cannot be realized if reading or writing occurs from another processor between the state reading operation of the semaphore register and the acquisition state writing operation. For this reason, it is necessary to prohibit access from another processor from the state reading of the semaphore register to the writing of the acquired state, and it is necessary to perform a state read called a read-modify-write and simultaneously perform a process of writing the acquired state. .

そのため、複数のセマフォレジスタを同時に読み出すと、アクセスした複数のセマフォを獲得してしまう場合があるため、不要なセマフォを獲得しないようにするためには、1回のアクセスでは1つのセマフォレジスタしかアクセスできない。したがって、複数のセマフォ状態を同時に知ることができず、セマフォを獲得するためには1レジスタずつ順番にアクセスする必要があり、アクセス時間の増大によりスループットが低下していた。   Therefore, if multiple semaphore registers are read at the same time, multiple semaphores accessed may be acquired. In order to avoid acquiring unnecessary semaphores, only one semaphore register is accessed in one access. Can not. Therefore, it is not possible to know a plurality of semaphore states at the same time, and it is necessary to access the registers one by one in order to acquire the semaphore, and the throughput has decreased due to an increase in access time.

また、共有メモリを用いて通信を行う場合、分割された共有メモリ領域内で有効な通信データが保存されたアドレス範囲を判別することができない。そのため、分割された共有メモリ領域内の全てのアドレスを読み出す必要があり、通信に用いられるデータが保存されていないアドレスからもデータを読み出さなければならず、通信のスループットが低下していた。また、通信で使用されるデータが保存されている領域と保存されていない領域を区別することができず、未使用のメモリ領域も含めたすべての共有メモリ領域を常時動作させておく必要があり、消費電力を増大させる原因となっていた。   Further, when communication is performed using the shared memory, it is impossible to determine an address range in which valid communication data is stored in the divided shared memory area. Therefore, it is necessary to read all the addresses in the divided shared memory area, and it is necessary to read data even from an address where data used for communication is not stored, and the communication throughput is reduced. Also, it is not possible to distinguish between the area where data used for communication is stored and the area where data is not stored, and it is necessary to keep all shared memory areas, including unused memory areas, always running. , Causing power consumption to increase.

このような問題に対し、特開2004−178374では、共有バス上を流れるデータおよびアドレスを監視し、自プロセッサ用キャッシュにコピーすることで、セマフォレジスタへのアクセスを減らして、バスのひっ迫を抑制する。このように、共有メモリデータおよびセマフォレジスタデータと同一の内容を自プロセッサのキャッシュにコピーしてバス使用率を低減する技術が開示されている。   To cope with such a problem, Japanese Patent Application Laid-Open No. 2004-178374 monitors data and addresses flowing on a shared bus and copies them to a cache for the own processor, thereby reducing access to a semaphore register and suppressing bus tightness. I do. As described above, a technique is disclosed in which the same contents as the shared memory data and the semaphore register data are copied to the cache of the own processor to reduce the bus usage rate.

しかし、特開2004−178374では、セマフォ獲得失敗時にはポーリングなどでセマフォ解放を待つ必要がある。また、複数のセマフォ状態を同時に知ることができず、セマフォを獲得するためには1レジスタずつ順番にアクセスする必要があり、アクセス時間や通信スループット、共有メモリによる消費電力を改善することができない。また、共有メモリデータおよびセマフォレジスタデータを保存できる大容量のキャッシュが必要であり、高コストとなる問題がある。   However, in Japanese Patent Application Laid-Open No. 2004-178374, it is necessary to wait for semaphore release by polling or the like when semaphore acquisition fails. In addition, it is not possible to know the state of a plurality of semaphores at the same time, and it is necessary to access the registers one by one in order to acquire the semaphore. Therefore, the access time, the communication throughput, and the power consumption by the shared memory cannot be improved. Further, a large-capacity cache capable of storing the shared memory data and the semaphore register data is required, which causes a problem of high cost.

また、特開2001−222466では、共有メモリを小ブロックに分割し、各ブロックに最後に更新したCPUの識別子を示す識別子記憶領域を設置し、アクセスCPUと一致する場合は、共有メモリを参照せず、CPU専用メモリのデータを使用する技術が開示されている。   In Japanese Patent Application Laid-Open No. 2001-222466, the shared memory is divided into small blocks, and an identifier storage area indicating the identifier of the CPU updated last is installed in each block. Instead, a technique using data in a CPU-only memory is disclosed.

しかし、特開2001−222466では、セマフォ獲得失敗時にはポーリングなどでセマフォ解放を待つ必要がある。また、複数のセマフォ状態を同時に知ることができず、セマフォを獲得するためには1レジスタずつ順番にアクセスする必要があり、アクセス時間や通信スループット、共有メモリによる消費電力を改善することができない。   However, in Japanese Patent Application Laid-Open No. 2001-222466, when semaphore acquisition fails, it is necessary to wait for semaphore release by polling or the like. In addition, it is not possible to know the state of a plurality of semaphores at the same time, and it is necessary to access the registers one by one in order to acquire the semaphore. Therefore, the access time, the communication throughput, and the power consumption by the shared memory cannot be improved.

特開2004−178374号公報JP 2004-178374 A 特開2001−222466号公報JP 2001-222466 A

上記のように、複数のプロセッサから共有メモリにアクセスするシステムではセマフォを用いた排他制御が行われるが、セマフォ獲得の失敗時にはポーリングなどでセマフォ解放を待つ必要があった。また、複数のセマフォ状態を同時に知ることができず、セマフォを獲得するためには1レジスタずつ順番にアクセスする必要があり、アクセス時間が増大し、スループットが低下していた。
また、共有メモリを用いて通信を行う場合、通信するデータが保存されたアドレスやシステムとして使用していないメモリ領域を判別することができず、通信に使用されてない領域へのアクセスによる通信スループットの低下いった課題があった。
また。未使用のメモリ領域も含めたすべての共有メモリ領域を常時動作させておくことによる消費電力の増大といった課題があった。
As described above, in a system in which a shared memory is accessed from a plurality of processors, exclusion control using a semaphore is performed, but when acquisition of a semaphore fails, it is necessary to wait for semaphore release by polling or the like. Further, it is not possible to know a plurality of semaphore states at the same time, and it is necessary to access the registers one by one in order to acquire the semaphore, so that the access time increases and the throughput decreases.
In addition, when performing communication using the shared memory, it is not possible to determine an address at which data to be communicated is stored or a memory area not used as a system, and a communication throughput by accessing an area not used for communication. There was a problem that declined.
Also. There has been a problem in that power consumption is increased by constantly operating all shared memory areas including unused memory areas.

本発明は、複数のプロセッサからアクセスできる共有メモリを使用した通信スループットの改善を行うことを目的とする。   An object of the present invention is to improve communication throughput using a shared memory accessible from a plurality of processors.

本発明の共有メモリ制御回路は、
複数のプロセッサがアクセスする共有メモリ制御回路において、
複数のメモリ領域と、
前記複数のメモリ領域に対応して設けられた複数のセマフォレジスタであって、メモリ領域の排他制御のために用いられるセマフォを記録する複数のセマフォレジスタと、
前記複数のセマフォレジスタの状態を記録するセマフォ状態サマリレジスタと
を備えた。
The shared memory control circuit of the present invention includes:
In a shared memory control circuit accessed by a plurality of processors,
Multiple memory areas,
A plurality of semaphore registers provided corresponding to the plurality of memory areas, a plurality of semaphore registers for recording semaphores used for exclusive control of the memory area,
A semaphore state summary register for recording states of the plurality of semaphore registers.

本発明によれば、複数のセマフォレジスタの状態を1回のアクセスで確認可能なセマフォ状態サマリレジスタを備えているので、共有メモリへのアクセス時間の短縮及び通信スループットの改善が可能となる。   According to the present invention, since a semaphore status summary register that can check the status of a plurality of semaphore registers by one access is provided, it is possible to shorten the access time to the shared memory and improve the communication throughput.

この発明の実施の形態1による共有メモリ制御回路50を説明する図である。FIG. 3 is a diagram illustrating a shared memory control circuit 50 according to the first embodiment of the present invention. この発明の実施の形態1において複数のセマフォ状態読み出しの実現方法を説明する図である。FIG. 5 is a diagram for explaining a method for implementing a plurality of semaphore state reads in the first embodiment of the present invention. この発明の実施の形態1において送信側のプロセッサの動作を説明する図である。FIG. 3 is a diagram illustrating an operation of a processor on a transmission side according to the first embodiment of the present invention. この発明の実施の形態1において受信側のプロセッサの動作を説明する図である。FIG. 3 is a diagram illustrating an operation of a processor on the receiving side according to the first embodiment of the present invention. この発明の実施の形態2による共有メモリ制御回路50を説明する図である。FIG. 7 is a diagram illustrating a shared memory control circuit 50 according to a second embodiment of the present invention. この発明の実施の形態2において複数の共有メモリ領域の使用状態読み出しの実現方法を説明する図である。FIG. 13 is a diagram for explaining a method of realizing use state reading of a plurality of shared memory areas according to the second embodiment of the present invention. この発明の実施の形態2において送信側のプロセッサの動作を説明する図である。FIG. 9 is a diagram illustrating an operation of a processor on a transmission side according to a second embodiment of the present invention. この発明の実施の形態2において受信側のプロセッサの動作を説明する図である。FIG. 8 is a diagram illustrating an operation of a processor on a receiving side according to a second embodiment of the present invention. この発明の実施の形態3による共有メモリ制御回路50を説明する図である。FIG. 10 is a diagram for explaining a shared memory control circuit 50 according to Embodiment 3 of the present invention. この発明の実施の形態3において複数の共有メモリ領域の使用可否情報読み出しの実現方法を説明する図である。FIG. 14 is a diagram for explaining a method of reading availability information of a plurality of shared memory areas in Embodiment 3 of the present invention. この発明の実施の形態3においてメモリ領域停止動作を説明する図である。FIG. 13 is a diagram for explaining a memory area stop operation in the third embodiment of the present invention. この発明の実施の形態3においてメモリ領域起動動作を説明する図である。FIG. 14 is a diagram illustrating a memory area starting operation according to Embodiment 3 of the present invention. この発明の実施の形態3においてメモリ領域起動動作を説明する図である。FIG. 14 is a diagram illustrating a memory area starting operation according to Embodiment 3 of the present invention.

実施の形態1.
***構成の説明***
図1は、本発明の第1の実施の形態における共有メモリ制御回路50を含むマルチプロセッサシステム100の構成を示す図である。
図1において、プロセッサ10、プロセッサ20、プロセッサ30は、バス40に接続されている。共有メモリ制御回路50もバス40に接続されている。共有メモリ制御回路50は、共有メモリ520と共有メモリ520のアクセスを制御するアクセス制御部541とを有している。
共有メモリ520はN個に分割して管理されており、共有メモリ制御回路50は、複数のメモリ領域を有し、図1では、共有メモリ520はメモリ領域521、522、523、524に分割されている。また、共有メモリ制御回路50は、複数のメモリ領域に対応して複数のセマフォレジスタを設けている。セマフォレジスタは、メモリ領域の排他制御のために用いられるセマフォを記録するレジスタである。図1では、それぞれのメモリ領域521、522、523、524に対応するセマフォレジスタ501、502、503、504を設けている。図1において、「RG」は「レジスタ」を意味する。以下、セマフォレジスタ501、502、503、504を区別する必要がない場合は単にセマフォレジスタ500という。
また、共有メモリ制御回路50は、複数のセマフォレジスタの状態を記録するセマフォ状態サマリレジスタ531を設けている。
Embodiment 1 FIG.
*** Configuration description ***
FIG. 1 is a diagram showing a configuration of a multiprocessor system 100 including a shared memory control circuit 50 according to the first embodiment of the present invention.
In FIG. 1, a processor 10, a processor 20, and a processor 30 are connected to a bus 40. The shared memory control circuit 50 is also connected to the bus 40. The shared memory control circuit 50 includes a shared memory 520 and an access control unit 541 that controls access to the shared memory 520.
The shared memory 520 is managed by being divided into N pieces. The shared memory control circuit 50 has a plurality of memory areas. In FIG. 1, the shared memory 520 is divided into memory areas 521, 522, 523 and 524. ing. The shared memory control circuit 50 has a plurality of semaphore registers corresponding to a plurality of memory areas. The semaphore register is a register that records a semaphore used for exclusive control of a memory area. In FIG. 1, semaphore registers 501, 502, 503, and 504 corresponding to the respective memory areas 521, 522, 523, and 524 are provided. In FIG. 1, “RG” means “register”. Hereinafter, the semaphore registers 501, 502, 503, and 504 are simply referred to as the semaphore registers 500 when it is not necessary to distinguish them.
In addition, the shared memory control circuit 50 includes a semaphore state summary register 531 for recording states of a plurality of semaphore registers.

図2に示すように、セマフォレジスタ500は、複数ビットからなるレジスタであり、セマフォレジスタ500の最下位ビットは1ビットからなるセマフォを記録するセマフォ状態ビット509である。セマフォ状態ビット509が”0”のときセマフォが獲得されていないことを示し、”1”のときセマフォが獲得されていることを示す。セマフォ状態ビット509は、共有メモリ520を分割したメモリ領域に対応したセマフォレジスタ内のセマフォ獲得中を表すビットである。
また、図2に示すように、セマフォ状態サマリレジスタ531は、セマフォ状態ビット509の値を引き出して配列したNビットのレジスタである。セマフォ状態サマリレジスタ531の各ビットは、対応するセマフォ状態ビット509に信号線で接続されており、セマフォ状態ビット509が変化すると同時にセマフォ状態サマリレジスタ531の各ビットの値に反映される。これにより、セマフォ状態サマリレジスタ531の最下位ビットから最上位ビットに向かってセマフォレジスタ501、502、503、504のセマフォ状態ビット509の値と同じ値が順に記録される。セマフォ状態サマリレジスタ531は、プロセッサから1回のアクセスで読み取ることができ、プロセッサは1回のアクセスでN個のセマフォ状態を知ることが可能となり、複数のセマフォレジスタに個別にアクセスする必要がなくなる。この際、セマフォ状態サマリレジスタ531をセマフォ状態ビット509に接続せずに独立したレジスタとし、セマフォ状態ビット509の値が変化した際にプロセッサまたはアクセス制御部541がセマフォ状態サマリレジスタ531を書き換えても良い。
As shown in FIG. 2, the semaphore register 500 is a register composed of a plurality of bits, and the least significant bit of the semaphore register 500 is a semaphore status bit 509 for recording a semaphore composed of one bit. When the semaphore status bit 509 is "0", it indicates that the semaphore has not been acquired, and when it is "1", it indicates that the semaphore has been acquired. The semaphore status bit 509 is a bit indicating that a semaphore is being acquired in a semaphore register corresponding to a memory area obtained by dividing the shared memory 520.
Further, as shown in FIG. 2, the semaphore state summary register 531 is an N-bit register in which the value of the semaphore state bit 509 is extracted and arranged. Each bit of the semaphore status summary register 531 is connected to the corresponding semaphore status bit 509 via a signal line, and is reflected in the value of each bit of the semaphore status summary register 531 at the same time as the semaphore status bit 509 changes. As a result, the same value as the value of the semaphore state bit 509 of the semaphore registers 501, 502, 503, and 504 is sequentially recorded from the least significant bit of the semaphore state summary register 531 to the most significant bit. The semaphore state summary register 531 can be read by a single access from the processor, and the processor can know the N semaphore states in one access, eliminating the need to individually access a plurality of semaphore registers. . At this time, the semaphore status summary register 531 is not connected to the semaphore status bit 509 but is made an independent register. Even when the value of the semaphore status bit 509 changes, the processor or the access control unit 541 rewrites the semaphore status summary register 531. good.

***動作の説明***
図3と図4を用いて、共有メモリ制御回路50の共有メモリ制御方法について説明する。ここでは、異なるプロセッサ間で共有メモリを使用したデータ通信を行う際の動作を、プロセッサ1からプロセッサ2に向けてデータを送信する場合を例に説明する。
*** Explanation of operation ***
The method of controlling the shared memory by the shared memory control circuit 50 will be described with reference to FIGS. Here, an operation when data communication using a shared memory is performed between different processors will be described by taking a case where data is transmitted from the processor 1 to the processor 2 as an example.

<<データ送信動作>>
ステップ11:セマフォ状態サマリレジスタ読み出しステップ
図3にデータ送信側のプロセッサ1の動作フローチャートを示す。データ送信側のプロセッサ1は、メモリ記憶領域にアクセスする際は、セマフォ状態サマリレジスタ531の値を読み出す。
<< Data transmission operation >>
Step 11: Step of reading semaphore state summary register FIG. 3 shows an operation flowchart of the processor 1 on the data transmission side. When accessing the memory storage area, the processor 1 on the data transmitting side reads the value of the semaphore state summary register 531.

ステップ12:セマフォ獲得ステップとセマフォ状態記録ステップ
次に、プロセッサ1は、セマフォ状態サマリレジスタ531の値が”0”のビットを探しセマフォが獲得されていないセマフォレジスタを検出する。プロセッサ1は、メモリ領域が未使用のセマフォレジスタにアクセスし、セマフォを獲得する。すなわち、プロセッサ1は、セマフォ状態サマリレジスタ531の0の値のビットに対応するセマフォレジスタにアクセスし、そのセマフォレジスタの値を読み出すとともにセマフォ状態ビット509を”1”に書き換える。セマフォレジスタの状態読み出しから獲得状態書き込みまでは他のプロセッサからのアクセスを禁止する必要があり、例えば、リード・モディファイ・ライトと呼ばれる状態読み出しを行うと同時に獲得状態を書き込む処理をする。
この際、セマフォ状態ビット509に信号線で接続されているセマフォ状態サマリレジスタ531の対応するビットの値にセマフォ状態ビット509の値が反映される。また、セマフォ状態サマリレジスタ531をセマフォ状態ビット509に接続せずに独立したレジスタとした場合には、プロセッサ1は、セマフォ状態ビット509が”1”に書き換えられたセマフォレジスタに対応するセマフォ状態サマリレジスタ531のビットを”1”に書き換える。セマフォ状態サマリレジスタ531のビットを”1”に書き換える処理は、プロセッサ1ではなく、アクセス制御部541が実施してもよい。この場合は、アクセス制御部541は、セマフォ状態ビット509が”1”に書き換えられることを検出してセマフォ状態サマリレジスタ531の対応するビットを”1”に書き換える。
このように、セマフォ獲得ステップは、複数のメモリ領域に対応して設けられた複数のセマフォレジスタに、メモリ領域の排他制御のために用いられるセマフォを記録するステップである。
また、セマフォ状態記録ステップは、セマフォ状態サマリレジスタにセマフォレジスタの状態を記録するステップである。
Step 12: Semaphore Acquisition Step and Semaphore State Recording Step Next, the processor 1 looks for a bit whose value of the semaphore state summary register 531 is “0” and detects a semaphore register for which no semaphore has been acquired. The processor 1 accesses the semaphore register whose memory area is not used, and acquires the semaphore. That is, the processor 1 accesses the semaphore register corresponding to the bit of the value of 0 of the semaphore state summary register 531, reads the value of the semaphore register, and rewrites the semaphore state bit 509 to “1”. From the state reading of the semaphore register to the writing of the acquisition state, it is necessary to prohibit access from another processor.
At this time, the value of the semaphore status bit 509 is reflected on the value of the corresponding bit of the semaphore status summary register 531 connected to the semaphore status bit 509 by a signal line. When the semaphore status summary register 531 is an independent register without being connected to the semaphore status bit 509, the processor 1 sets the semaphore status summary corresponding to the semaphore register whose semaphore status bit 509 is rewritten to “1”. The bit of the register 531 is rewritten to “1”. The process of rewriting the bit of the semaphore status summary register 531 to “1” may be performed not by the processor 1 but by the access control unit 541. In this case, the access control unit 541 detects that the semaphore status bit 509 is rewritten to “1” and rewrites the corresponding bit of the semaphore status summary register 531 to “1”.
As described above, the semaphore acquisition step is a step of recording a semaphore used for exclusive control of the memory area in a plurality of semaphore registers provided corresponding to the plurality of memory areas.
The semaphore state recording step is a step of recording the state of the semaphore register in the semaphore state summary register.

ステップ13:セマフォ獲得チェックステップ
セマフォ獲得の際、セマフォ状態サマリレジスタ531の読み出しからセマフォレジスタの状態読み出しまでの間に、別のプロセッサが同一のセマフォを獲得してしまうことにより、セマフォ獲得に失敗する、すなわちセマフォレジスタから読み出した値が”1”である可能性がある。この際は、読み出したセマフォ状態サマリレジスタの値から別のセマフォレジスタを選定し、セマフォが獲得されていないセマフォレジスタにアクセスすることでセマフォを獲得する。
Step 13: Semaphore Acquisition Check Step At the time of semaphore acquisition, the semaphore acquisition fails because another processor acquires the same semaphore between the time when the semaphore status summary register 531 is read and the time when the semaphore register status is read. That is, the value read from the semaphore register may be “1”. In this case, another semaphore register is selected from the read value of the semaphore state summary register, and a semaphore is acquired by accessing a semaphore register for which no semaphore has been acquired.

ステップ14:データ書き込みステップ(メモリ領域アクセスステップ)
次に、データ送信側のプロセッサ1は、獲得したセマフォに対応するメモリ領域に送信データを書き込む。
Step 14: Data writing step (memory area access step)
Next, the processor 1 on the data transmission side writes the transmission data to a memory area corresponding to the acquired semaphore.

ステップ15:セマフォ開放ステップ
全ての通信データの書き込みが終了すると、プロセッサ1はアクセスしたメモリ境域に対応するセマフォレジスタに”0”を書き込むことでセマフォを解放する。この際、セマフォ状態ビット509に信号線で接続されているセマフォ状態サマリレジスタ531の対応するビットの値にセマフォ状態ビット509の値が反映される。また、セマフォ状態サマリレジスタ531をセマフォ状態ビット509に接続せずに独立したレジスタとした場合には、プロセッサ1はセマフォ状態サマリレジスタ531の対応するビットを”0”に書き換える。
これにより、プロセッサ1からのデータ送信が完了する。
Step 15: Semaphore Release Step When writing of all communication data is completed, the processor 1 releases the semaphore by writing “0” to the semaphore register corresponding to the accessed memory area. At this time, the value of the semaphore status bit 509 is reflected on the value of the corresponding bit of the semaphore status summary register 531 connected to the semaphore status bit 509 by a signal line. When the semaphore status summary register 531 is an independent register without being connected to the semaphore status bit 509, the processor 1 rewrites the corresponding bit of the semaphore status summary register 531 to “0”.
Thereby, the data transmission from the processor 1 is completed.

<<データ受信動作>>
次に、データ受信側のプロセッサ2が、プロセッサ1が書き込んだデータの読み出しを行う動作について説明する。図4にデータ受信側のプロセッサ2の動作フローチャートを示す。
<< Data reception operation >>
Next, an operation in which the processor 2 on the data receiving side reads data written by the processor 1 will be described. FIG. 4 shows an operation flowchart of the processor 2 on the data receiving side.

ステップS21:通知信号待ちステップ
プロセッサ2が共有メモリから通信データを読み出す読み出しタイミングは、プロセッサ1からプロセッサ2に割り込み信号などの通知信号で通知するか、またはポーリングを行う。プロセッサ2は、プロセッサ1から通知信号を待つ。
Step S21: Notification Signal Waiting Step The processor 1 notifies the processor 2 of the read timing of reading communication data from the shared memory by a notification signal such as an interrupt signal or polling. The processor 2 waits for a notification signal from the processor 1.

ステップS22:読み出し開始ステップ
プロセッサ2は、通知信号を受信すると読み出し動作を開始する。
Step S22: Read Start Step Upon receiving the notification signal, the processor 2 starts the read operation.

ステップS23:セマフォ獲得ステップとセマフォ状態記録ステップ
プロセッサ2は、通知信号を解析して、通信データが記録されたメモリ領域を特定し、対応するセマフォレジスタにアクセスし、セマフォを獲得する。セマフォレジスタのアクセス動作とセマフォの獲得動作は、セマフォ状態サマリレジスタ531へのアクセスがない点を除き、前述したステップ12と同じである。セマフォ状態サマリレジスタ531へのアクセスが不要である理由は、通信データが記録されたメモリ領域がすでにプロセッサ2に通知されており、プロセッサ2はアクセスすべきセマフォレジスタをすでに知っているからである。
Step S23: Semaphore Acquisition Step and Semaphore State Recording Step The processor 2 analyzes the notification signal, specifies the memory area where the communication data is recorded, accesses the corresponding semaphore register, and acquires the semaphore. The operation of accessing the semaphore register and the operation of acquiring the semaphore are the same as those in step 12 described above except that the semaphore state summary register 531 is not accessed. The reason why the access to the semaphore state summary register 531 is unnecessary is that the memory area in which the communication data is recorded has already been notified to the processor 2, and the processor 2 already knows the semaphore register to be accessed.

ステップ24:セマフォ獲得チェックステップ
セマフォ獲得の際、セマフォ獲得が失敗する場合がある。すなわち、セマフォレジスタから読み出した値が”1”の場合には、プロセッサ2又はアクセス制御部541は、ポーリングでセマフォレジスタのセマフォ解放を待つ。
Step 24: Semaphore acquisition check step At the time of semaphore acquisition, semaphore acquisition may fail. That is, when the value read from the semaphore register is “1”, the processor 2 or the access control unit 541 waits for the release of the semaphore from the semaphore register by polling.

ステップS25:データ読み出しステップ(メモリ領域アクセスステップ)
セマフォ獲得後、プロセッサ2は、通信データが記録されたメモリ領域から通信データを読み出す。
Step S25: Data read step (memory area access step)
After acquiring the semaphore, the processor 2 reads the communication data from the memory area where the communication data is recorded.

ステップS26:セマフォ開放ステップ
プロセッサ2による通信データの読み出しが終了すると、プロセッサ2は、アクセスしたメモリ領域に対応するセマフォレジスタに”0”を書き込み、セマフォを解放する。この際、セマフォ状態ビット509に信号線で接続されているセマフォ状態サマリレジスタ531の対応するビットの値にセマフォ状態ビット509の値が反映される。また、セマフォ状態サマリレジスタ531をセマフォ状態ビット509に接続せずに独立したレジスタとした場合には、プロセッサ2又はアクセス制御部541は、セマフォが開放されたセマフォレジスタに対応するセマフォ状態サマリレジスタ531のビットを”0”に書き換える。
これにより、プロセッサ2の受信処理が完了する。
Step S26: Release Semaphore Step When the reading of communication data by the processor 2 ends, the processor 2 writes "0" into the semaphore register corresponding to the accessed memory area, and releases the semaphore. At this time, the value of the semaphore status bit 509 is reflected on the value of the corresponding bit of the semaphore status summary register 531 connected to the semaphore status bit 509 by a signal line. When the semaphore status summary register 531 is not connected to the semaphore status bit 509 but is an independent register, the processor 2 or the access control unit 541 sends the semaphore status summary register 531 corresponding to the semaphore register whose semaphore is released. Is rewritten to “0”.
Thereby, the receiving process of the processor 2 is completed.

***実施の形態の効果の説明***
本発明の実施の形態によれば、共有メモリ制御回路50は、セマフォ状態サマリレジスタ531を備えているので、複数のプロセッサからアクセスできる共有メモリを使用した通信スループットの改善ができる。すなわち、複数のセマフォレジスタの状態を1回のアクセスで確認可能なセマフォ状態サマリレジスタ531を備えているので共有メモリへのアクセス時間の短縮が可能となる。
*** Explanation of effect of embodiment ***
According to the embodiment of the present invention, since the shared memory control circuit 50 includes the semaphore state summary register 531, it is possible to improve communication throughput using a shared memory that can be accessed from a plurality of processors. That is, since the semaphore status summary register 531 that can confirm the status of the plurality of semaphore registers by one access is provided, the access time to the shared memory can be reduced.

実施の形態2.
この実施の形態では、主として実施の形態1と異なる点について説明する。
***構成の説明***
図5は、本発明の第2の実施の形態における共有メモリ制御回路50を含むシステムの構成を示す図である。
共有メモリ制御回路50は、複数のメモリ領域に対応して複数のメモリ管理レジスタを設けている。複数のメモリ管理レジスタは、メモリ領域の使用状態を記録するレジスタである。図5では、メモリ領域521、522、523、524に対応するメモリ管理レジスタ511、512、513、514を設けている。以下、メモリ管理レジスタ511、512、513、514を区別する必要がない場合は単にメモリ管理レジスタ510という。
また、共有メモリ制御回路50は、複数のメモリ領域の状態を記録するメモリ状態サマリレジスタ532を設けている。
Embodiment 2 FIG.
In this embodiment, points different from the first embodiment will be mainly described.
*** Configuration description ***
FIG. 5 is a diagram showing a configuration of a system including the shared memory control circuit 50 according to the second embodiment of the present invention.
The shared memory control circuit 50 has a plurality of memory management registers corresponding to a plurality of memory areas. The plurality of memory management registers are registers that record the use state of the memory area. In FIG. 5, memory management registers 511, 512, 513, and 514 corresponding to the memory areas 521, 522, 523, and 524 are provided. Hereinafter, when it is not necessary to distinguish the memory management registers 511, 512, 513, and 514, they are simply referred to as memory management registers 510.
In addition, the shared memory control circuit 50 includes a memory status summary register 532 that records the status of a plurality of memory areas.

図6に示すように、メモリ管理レジスタ510は、複数ビットからなるレジスタである。メモリ管理レジスタ510の最下位ビットは1ビットからなるメモリ使用状態ビット517である。メモリ使用状態ビット517が”0”のとき対応するメモリ領域が未使用であり、”1”のとき対応するメモリ領域が使用中であることを示す。メモリ使用状態ビット517は、共有メモリ520を分割したメモリ領域が未使用か使用中かを示すフラグビットである。
また、図6に示すように、メモリ状態サマリレジスタ532は、メモリ使用状態ビット517の値を引き出して配列したNビットのレジスタである。メモリ状態サマリレジスタ532の各ビットは、対応するメモリ使用状態ビット517に信号線で接続されており、メモリ使用状態ビット517が変化すると同時にメモリ状態サマリレジスタ532の各ビットの値に反映される。これにより、メモリ状態サマリレジスタ532の最下位ビットから最上位ビットに向かってメモリ管理レジスタ511、512、513、514のメモリ使用状態ビット517の値と同じ値が順に記録されている。メモリ状態サマリレジスタ532は、プロセッサから1回のアクセスで読み取ることができ、プロセッサは1回のアクセスでN個のメモリ使用状態を知ることが可能となり、複数のメモリ管理レジスタに個別にアクセスする必要がなくなる。
As shown in FIG. 6, the memory management register 510 is a register composed of a plurality of bits. The least significant bit of the memory management register 510 is a memory use state bit 517 consisting of one bit. When the memory use status bit 517 is “0”, the corresponding memory area is unused, and when “1”, it indicates that the corresponding memory area is in use. The memory use status bit 517 is a flag bit indicating whether the memory area obtained by dividing the shared memory 520 is unused or in use.
As shown in FIG. 6, the memory status summary register 532 is an N-bit register in which the values of the memory usage status bits 517 are extracted and arranged. Each bit of the memory status summary register 532 is connected to the corresponding memory usage status bit 517 by a signal line, and is reflected in the value of each bit of the memory status summary register 532 at the same time as the memory usage status bit 517 changes. As a result, the same value as the value of the memory use state bit 517 of the memory management registers 511, 512, 513, 514 is recorded in order from the least significant bit to the most significant bit of the memory state summary register 532. The memory status summary register 532 can be read by a single access from the processor, and the processor can know the N memory usage status in one access, and need to individually access a plurality of memory management registers. Disappears.

メモリ管理レジスタ510は、対応するメモリ記憶領域に関する情報を保存するレジスタである。メモリ管理レジスタ510は、最下位ビットに前述したメモリ使用状態ビット517を有し、最下位ビット以外にメモリアクセス状態ビット518を有する。
メモリ使用状態ビット517は、メモリ領域の使用状態(有効な通信データの有無)を保存する。
メモリアクセス状態ビット518は、少なくとも以下のビットのいずれか1つ以上からなり、以下のメモリ記憶領域の情報を保存する。
1.最終アクセス種類ビット(1ビット)
メモリ領域への最終アクセス種類(0:読み出し又は1:書き込み)、
メモリアクセスの状態を知ることができる。
2.最終アクセスプロセッサビット(複数ビット)
メモリ領域への最終アクセスをしたプロセッサのプロセッサ番号、
3.通信用IDビット(複数ビット)
通信データの宛先となる通信先プロセッサのプロセッサ番号、
4.データ識別ビット(複数ビット)
送信データの順番などを表す通信データのデータ識別番号を記録する。
5.アドレスビット(複数ビット)
送信データが記録されたメモリ領域の開始アドレスおよび終了アドレス。
および、読み出しを行ったメモリ領域の開始アドレスおよび終了アドレス。
The memory management register 510 is a register that stores information on a corresponding memory storage area. The memory management register 510 has the above-mentioned memory use state bit 517 in the least significant bit, and has a memory access state bit 518 in addition to the least significant bit.
The memory use state bit 517 stores the use state (presence or absence of valid communication data) of the memory area.
The memory access status bit 518 includes at least one of the following bits, and stores the following information of the memory storage area.
1. Last access type bit (1 bit)
Final access type to memory area (0: read or 1: write),
The state of memory access can be known.
2. Last access processor bits (multiple bits)
The processor number of the processor that last accessed the memory area,
3. Communication ID bits (multiple bits)
The processor number of the communication destination processor that is the destination of the communication data,
4. Data identification bit (multiple bits)
The data identification number of the communication data indicating the order of the transmission data is recorded.
5. Address bits (multiple bits)
The start address and end address of the memory area where the transmission data is recorded.
Also, the start address and the end address of the memory area from which the reading was performed.

メモリ領域へのアクセス時にメモリ管理レジスタ510のこれらの情報をハードウェア又はソフトウェアによりメモリ管理レジスタに保存する。具体的には、プロセッサ又はアクセス制御部541が、メモリ領域へのアクセス時にこれらの情報をメモリ管理レジスタに保存する。プロセッサは、このメモリ管理レジスタ510にアクセスすることにより、システム内の全てのプロセッサが共有メモリの使用状態を知ることができる。   When accessing the memory area, the information of the memory management register 510 is stored in the memory management register by hardware or software. Specifically, the processor or the access control unit 541 stores such information in the memory management register when accessing the memory area. By accessing the memory management register 510, all processors in the system can know the use state of the shared memory.

***動作の説明***
図7と図8を用いて、共有メモリ制御回路50の共有メモリ制御方法について説明する。
*** Explanation of operation ***
The method of controlling the shared memory by the shared memory control circuit 50 will be described with reference to FIGS.

<<データ送信動作>>
ステップ11:セマフォ状態サマリレジスタとメモリ状態サマリレジスタの読み出しステップ
データ送信側のプロセッサ1は、共有メモリにアクセスする際は、セマフォ状態サマリレジスタ531およびメモリ状態サマリレジスタ532の値を読み出す。
<< Data transmission operation >>
Step 11: Step of reading semaphore state summary register and memory state summary register When accessing the shared memory, the processor 1 on the data transmission side reads the values of the semaphore state summary register 531 and the memory state summary register 532.

ステップ12:セマフォ獲得ステップとセマフォ状態記録ステップ
プロセッサ1は、セマフォ状態サマリレジスタ531の値が”0”のビットを探しセマフォが獲得されていないセマフォレジスタを検出するとともに、メモリ状態サマリレジスタ532の値が”0”のビットを探し未使用のメモリ領域を検出する。そして、プロセッサ1は、セマフォが獲得されておらず未使用のメモリ領域のセマフォレジスタにアクセスし、セマフォを獲得する。その後、実施の形態1と同様の動作により、プロセッサ1は、セマフォレジスタに、メモリ領域の排他制御のために用いられるセマフォを記録し、セマフォ状態ビットに信号線で接続されているセマフォ状態サマリレジスタの対応するビットの値にセマフォ状態ビットの値が反映される。また、セマフォ状態サマリレジスタをセマフォ状態ビットに接続せずに独立したレジスタとした場合には、プロセッサ1はセマフォ状態サマリレジスタにセマフォレジスタの状態を記録する。
Step 12: Semaphore Acquisition Step and Semaphore State Recording Step The processor 1 searches the semaphore state summary register 531 for a bit having a value of “0”, detects a semaphore register for which a semaphore has not been acquired, and detects the value of the memory state summary register 532. Looks for a bit of "0" and detects an unused memory area. Then, the processor 1 accesses the semaphore register of the unused memory area where the semaphore has not been acquired, and acquires the semaphore. Thereafter, by the same operation as in the first embodiment, the processor 1 records the semaphore used for exclusive control of the memory area in the semaphore register, and the semaphore state summary register connected to the semaphore state bit by a signal line. The value of the semaphore state bit is reflected in the value of the corresponding bit of. When the semaphore status summary register is an independent register without being connected to the semaphore status bit, the processor 1 records the status of the semaphore register in the semaphore status summary register.

ステップ13:セマフォ獲得チェックステップ
セマフォ獲得の際、セマフォ状態サマリレジスタ531の読み出しからセマフォレジスタの状態読み出しまでの間に、別のプロセッサが同一のセマフォを獲得してしまうことにより、セマフォ獲得に失敗する可能性がある。この際は、読み出したセマフォ状態サマリレジスタ531およびメモリ状態サマリレジスタ532の値から別のセマフォレジスタを選定し、セマフォが獲得されていないセマフォレジスタにアクセスすることでセマフォを獲得する。
Step 13: Semaphore Acquisition Check Step At the time of semaphore acquisition, the semaphore acquisition fails because another processor acquires the same semaphore between the time when the semaphore status summary register 531 is read and the time when the semaphore register status is read. there is a possibility. In this case, another semaphore register is selected from the read values of the semaphore status summary register 531 and the memory status summary register 532, and the semaphore is acquired by accessing a semaphore register for which no semaphore has been acquired.

ステップ14−1:データ書き込みステップ(メモリ領域アクセスステップ)
次に、データ送信側のプロセッサ1は、獲得したセマフォに対応するメモリ領域に送信データを書き込む。
Step 14-1: Data writing step (memory area access step)
Next, the processor 1 on the data transmission side writes the transmission data to a memory area corresponding to the acquired semaphore.

ステップ14−2:使用状態記録ステップ
この際、アクセス制御部541は、書き込み先のメモリ領域に対応したメモリ管理レジスタのメモリ使用状態ビットに”1”を書き込み、対応するメモリ領域がプロセッサ間通信で使用中であることを記録する。ここで、メモリ領域が使用中であるとは、通信用のデータが保存されており、かつ読み出されていない状態であることを意味する。また、メモリ領域が未使用であるとは、使用中の通信用のデータが無い状態、すなわち、通信用のデータが保存されていないか、または保存されているが通信先のプロセッサによって通信データが読み出し済みであることを意味する。この際、メモリ使用状態ビットに信号線で接続されているメモリ状態サマリレジスタの対応するビットの値にセメモリ使用状態ビットの値が反映される。
同時に、アクセス制御部541は、最終アクセス種類ビットに”1”を書き込むことで、直前のアクセスが書き込みであったことを示す。また、アクセス制御部541は、最終アクセスプロセッサビットに”1”を書き込み、最終アクセスプロセッサがプロセッサ1であったことを示す。さらに、アクセス制御部541は、通信用IDビットにデータ送信先のプロセッサIDである”2”を書き込むことで、送信先のプロセッサを指定する。加えて、アクセス制御部541は、データ識別ビットに送信データの順番を表す通信データ識別番号を書き込んでも良い。
アクセス制御部541は、データ書き込み時にデータの書き込み開始アドレスと書き込み終了アドレスをメモリ管理レジスタのアドレスビットの開始アドレスと終了アドレスに書き込み、メモリ領域のどのアドレスにデータが書き込まれたかを記憶する。
以上のように、使用状態記録ステップは、複数のメモリ領域に対応して設けられた複数のメモリ管理レジスタに、メモリ領域の使用状態を記録するステップである。
Step 14-2: Use State Recording Step At this time, the access control unit 541 writes “1” to the memory use state bit of the memory management register corresponding to the write destination memory area, and the corresponding memory area is used for inter-processor communication. Record that it is in use. Here, that the memory area is being used means that communication data is stored and is not read out. In addition, the memory area is unused when there is no communication data in use, that is, the communication data is not stored or the communication data is stored by the communication destination processor. It means that it has been read. At this time, the value of the memory use state bit is reflected on the value of the corresponding bit of the memory state summary register connected to the memory use state bit by a signal line.
At the same time, the access control unit 541 writes “1” to the last access type bit to indicate that the immediately preceding access was a write. Further, the access control unit 541 writes “1” in the last access processor bit, indicating that the last access processor is the processor 1. Further, the access control unit 541 specifies the processor of the transmission destination by writing “2” which is the processor ID of the data transmission destination to the communication ID bit. In addition, the access control unit 541 may write a communication data identification number indicating the order of transmission data in the data identification bit.
The access control unit 541 writes the write start address and the write end address of the data to the start address and the end address of the address bits of the memory management register when writing data, and stores at which address in the memory area the data is written.
As described above, the use state recording step is a step of recording the use state of the memory area in a plurality of memory management registers provided corresponding to the plurality of memory areas.

ステップ14−3:管理状態記録ステップ
また、メモリ状態サマリレジスタをメモリ使用状態ビットに接続せずに独立したレジスタとした場合には、アクセス制御部541は、メモリ状態サマリレジスタ532の対応するビットへ”1”を書き込む。アクセス制御部541は、書き込み先のメモリ領域に対応したメモリ状態サマリレジスタ532の対応するビットに”1”を書き込み、対応するメモリ領域がプロセッサ間通信で使用中であることを記録する。
以上のように、管理状態記録ステップは、メモリ状態サマリレジスタ532にメモリ領域の使用状態を記録するステップである。
Step 14-3: Management Status Recording Step If the memory status summary register is not connected to the memory use status bit but is an independent register, the access control unit 541 sets the corresponding bit of the memory status summary register 532 to the corresponding bit. Write "1". The access control unit 541 writes “1” to the corresponding bit of the memory status summary register 532 corresponding to the write destination memory area, and records that the corresponding memory area is being used for inter-processor communication.
As described above, the management state recording step is a step of recording the use state of the memory area in the memory state summary register 532.

ステップ15:セマフォ開放ステップ
全ての通信データの書き込みが終了すると、プロセッサ1はアクセスしたメモリ境域に対応するセマフォレジスタに”0”を書き込むことでセマフォを解放する。
この際、セマフォ状態ビットに信号線で接続されているセマフォ状態サマリレジスタの対応するビットの値にセマフォ状態ビットの値が反映される。また、セマフォ状態サマリレジスタをセマフォ状態ビットに接続せずに独立したレジスタとした場合には、プロセッサ1又はアクセス制御部541は、セマフォが開放されたセマフォレジスタに対応するセマフォ状態サマリレジスタ531のビットを”0”に書き換える。
これにより、プロセッサ1からのデータ送信が完了する。
Step 15: Semaphore Release Step When writing of all communication data is completed, the processor 1 releases the semaphore by writing “0” to the semaphore register corresponding to the accessed memory boundary.
At this time, the value of the semaphore status bit is reflected on the value of the corresponding bit of the semaphore status summary register connected to the semaphore status bit by a signal line. When the semaphore status summary register is not connected to the semaphore status bit but is an independent register, the processor 1 or the access control unit 541 determines the bit of the semaphore status summary register 531 corresponding to the semaphore register whose semaphore is released. Is rewritten to “0”.
Thereby, the data transmission from the processor 1 is completed.

<<データ受信動作>>
次に、データ受信側のプロセッサ2が、プロセッサ1が書き込んだデータの読み出しを行う動作について説明する。図8にデータ受信側のプロセッサ2の動作フローチャートを示す。
<< Data reception operation >>
Next, an operation in which the processor 2 on the data receiving side reads data written by the processor 1 will be described. FIG. 8 shows an operation flowchart of the processor 2 on the data receiving side.

ステップS21:ポーリングステップ又は通知信号待ちステップ
プロセッサ2が共有メモリから通信データを読み出すタイミングは、プロセッサ2がメモリ状態サマリレジスタ532をポーリングすることにより判断する。プロセッサ2は、メモリ状態サマリレジスタ532のあるビットへ”1”が書き込まれたことを検出すると、対応するメモリ管理レジスタ510の通信用IDビットに記録された通信先プロセッサIDが”2”であるか否かを判断する。プロセッサ2は、メモリ状態サマリレジスタ532をポーリングする代わりに、メモリ管理レジスタをポーリングしてもよい。
あるいは、実施の形態1と同じく、プロセッサ2が共有メモリから通信データを読み出す読み出しタイミングは、プロセッサ1からプロセッサ2への通知信号で通知してもよい。
Step S21: Polling Step or Notification Signal Waiting Step The timing at which the processor 2 reads communication data from the shared memory is determined by the processor 2 polling the memory status summary register 532. When the processor 2 detects that “1” has been written to a certain bit of the memory status summary register 532, the communication destination processor ID recorded in the communication ID bit of the corresponding memory management register 510 is “2”. It is determined whether or not. Instead of polling the memory status summary register 532, the processor 2 may poll the memory management register.
Alternatively, as in the first embodiment, the read timing at which the processor 2 reads communication data from the shared memory may be notified by a notification signal from the processor 1 to the processor 2.

ステップS22:読み出し開始ステップ
プロセッサ2は通信データが書き込まれたメモリ領域に対応するメモリ管理レジスタを読み出し、メモリ使用状態が”1”であり、通信用プロセッサIDが自プロセッサIDである”2”と一致し、最終アクセス種類が書き込みであった場合、未受信のデータがあると判断する。未受信のデータがあると判断した場合、共有メモリから通信データの読み出しを開始する。
あるいは、プロセッサ2は、通知信号を受信すると読み出し動作を開始する。
Step S22: Read Start Step The processor 2 reads the memory management register corresponding to the memory area in which the communication data has been written, and the memory use state is “1” and the communication processor ID is “2” which is its own processor ID. If they match and the final access type is write, it is determined that there is unreceived data. If it is determined that there is unreceived data, reading of communication data from the shared memory is started.
Alternatively, the processor 2 starts the reading operation when receiving the notification signal.

ステップS23:セマフォ獲得ステップとセマフォ状態記録ステップ
プロセッサ2は、未受信のデータがあると判断した場合、実施の形態1と同じく、対応するセマフォレジスタにアクセスし、セマフォを獲得して、セマフォレジスタにセマフォの獲得を記録し、セマフォ状態サマリレジスタにセマフォレジスタの値を反映させる。
Step S23: Semaphore Acquisition Step and Semaphore State Recording Step When the processor 2 determines that there is unreceived data, it accesses the corresponding semaphore register, acquires the semaphore, and stores it in the semaphore register, as in the first embodiment. The semaphore acquisition is recorded, and the value of the semaphore register is reflected in the semaphore status summary register.

ステップ24:セマフォ獲得チェックステップ
セマフォ獲得の際、セマフォ獲得が失敗する場合がある。すなわち、セマフォレジスタから読み出した値が”1”の場合には、プロセッサ2又はアクセス制御部541は、ポーリングでセマフォレジスタのセマフォ解放を待つ。
Step 24: Semaphore acquisition check step At the time of semaphore acquisition, semaphore acquisition may fail. That is, when the value read from the semaphore register is “1”, the processor 2 or the access control unit 541 waits for the release of the semaphore from the semaphore register by polling.

ステップS25:データ読み出しステップ(メモリ領域アクセスステップ)
セマフォ獲得後、プロセッサ2は、通信データが記録されたメモリ領域から通信データを読み出す。
プロセッサ2は、読み出したメモリ管理レジスタのアドレスビットの開始アドレスと終了アドレスに記録された書き込み開始アドレスと書き込み終了アドレスから有効なデータが保存されているアドレス範囲を判断し、このアドレス範囲のデータを読み出す。これにより、書き込みが行われていないメモリ領域への不要なアクセスを防止することができるため、通信スループットを向上することができる。
プロセッサ2によるデータ読み出しが終了すると、プロセッサ2は、メモリ管理レジスタのアドレスビットの読み出し開始アドレスと終了アドレスに読み出したアドレスを書き込み、送信データを全て受信したことを示す。例えば、データが記録された開始アドレスと終了アドレスが読み出し開始アドレスと終了アドレスに一致することを判定し、送信データを全て受信したことを示す。
Step S25: Data read step (memory area access step)
After acquiring the semaphore, the processor 2 reads the communication data from the memory area where the communication data is recorded.
The processor 2 determines an address range in which valid data is stored based on the read start address and the write end address recorded in the read start address and end address of the address bits of the memory management register, and converts the data in this address range into data. read out. As a result, unnecessary access to a memory area in which writing has not been performed can be prevented, so that communication throughput can be improved.
When the data read by the processor 2 is completed, the processor 2 writes the read address to the read start address and the end address of the address bits of the memory management register, indicating that all the transmission data has been received. For example, it is determined that the start address and the end address where the data is recorded match the read start address and the end address, indicating that all the transmission data has been received.

ステップS26:セマフォ開放ステップ
プロセッサ2による通信データの読み出しが終了すると、プロセッサ2は、プロセッサ2はメモリ管理レジスタのメモリ使用状態ビット517に”0”を書き込み、プロセッサ間通信が完了したことを示す。
また、プロセッサ2は、アクセスしたメモリ領域に対応するセマフォレジスタに”0”を書き込み、セマフォを解放する。
この際、セマフォ状態ビットに信号線で接続されているセマフォ状態サマリレジスタの対応するビットの値にセマフォ状態ビットの値が反映される。また、セマフォ状態サマリレジスタをセマフォ状態ビットに接続せずに独立したレジスタとした場合には、プロセッサ2又はアクセス制御部541は、セマフォが開放されたセマフォレジスタに対応するセマフォ状態サマリレジスタ531のビットを”0”に書き換える。
また、メモリ状態サマリレジスタをメモリ使用状態ビットに接続せずに独立したレジスタとした場合には、プロセッサ2又はアクセス制御部541は、メモリ状態サマリレジスタ352のビットを”0”に書き換える。
これにより、プロセッサ2の受信処理が完了する。
Step S26: Semaphore Release Step When the reading of communication data by the processor 2 ends, the processor 2 writes "0" in the memory use state bit 517 of the memory management register, indicating that the inter-processor communication has been completed.
Further, the processor 2 writes “0” into the semaphore register corresponding to the accessed memory area, and releases the semaphore.
At this time, the value of the semaphore status bit is reflected on the value of the corresponding bit of the semaphore status summary register connected to the semaphore status bit by a signal line. When the semaphore status summary register is not connected to the semaphore status bit but is an independent register, the processor 2 or the access control unit 541 determines the bit of the semaphore status summary register 531 corresponding to the semaphore register whose semaphore is released. Is rewritten to “0”.
If the memory status summary register is an independent register without being connected to the memory use status bit, the processor 2 or the access control unit 541 rewrites the bit of the memory status summary register 352 to “0”.
Thereby, the receiving process of the processor 2 is completed.

***実施の形態の効果の説明***
本実施の形態によれば、複数のセマフォレジスタの状態を1回のアクセスで確認可能なメモリ状態サマリレジスタ532を備えているので共有メモリへのアクセス時間の短縮が可能となる。
また、プロセッサからメモリ領域へのアクセス履歴および状態をソフトウェア又はハードウェアで記録するメモリ管理レジスタを備え、複数のプロセッサからアクセス可能とすることにより、通信するプロセッサのアクセス状況確認と制御を可能とすることができ、複数のプロセッサからアクセスできる共有メモリを使用した通信スループットの改善が可能になる。
*** Explanation of effect of embodiment ***
According to the present embodiment, since the memory status summary register 532 that can confirm the status of a plurality of semaphore registers by one access is provided, the access time to the shared memory can be reduced.
In addition, a memory management register that records the access history and state of the memory area from the processor to the memory area by software or hardware is provided, and by enabling access from a plurality of processors, it is possible to confirm and control the access status of the communicating processor. The communication throughput can be improved using a shared memory that can be accessed from a plurality of processors.

実施の形態3.
この実施の形態では、主として実施の形態1、2と異なる点について説明する。
Embodiment 3 FIG.
In this embodiment, points different from Embodiments 1 and 2 will be mainly described.

***構成の説明***
図9を用いて、本発明の第3の実施の形態における共有メモリ制御回路50を含むシステムを説明する。
実施の形態1と同様に、図9に示すように、メモリ領域521、522、523、524に対応したセマフォレジスタ501、502、503、504およびセマフォ状態サマリレジスタ531を設ける。
また、共有メモリ制御回路50は、複数のメモリ領域の使用の可否を記録するメモリ制御サマリレジスタ533と、メモリ制御サマリレジスタ533において使用不可と記録されたメモリ領域の動作を停止させるメモリ制御部542とを設けている。
*** Configuration description ***
A system including the shared memory control circuit 50 according to the third embodiment of the present invention will be described with reference to FIG.
As in the first embodiment, as shown in FIG. 9, semaphore registers 501, 502, 503, and 504 and semaphore state summary registers 531 corresponding to memory areas 521, 522, 523, and 524 are provided.
Further, the shared memory control circuit 50 includes a memory control summary register 533 that records whether a plurality of memory areas can be used and a memory control unit 542 that stops the operation of the memory area recorded as unusable in the memory control summary register 533. Are provided.

図10に示すように、メモリ管理レジスタの最下位ビットに、メモリ領域が使用可能かどうかを示すメモリ制御状態ビット519を設ける。メモリ制御状態ビット519が”0”のとき対応するメモリ領域は使用不可であり、”1”のとき対応するメモリ領域が使用可であることを示す。メモリ使用状態ビット517は、共有メモリ520を分割したメモリ領域の使用の可否を示すフラグビットである。ここで、メモリ領域が使用可能であるとは、対応するメモリ領域に電源とクロックが正常に供給されており、メモリへの書き込みおよび読み出しができる状態であることを意味する。
また、図10に示すように、メモリ制御サマリレジスタ533は、メモリ使用状態ビット517の値を引き出して配列したNビットのレジスタである。メモリ制御サマリレジスタ533の最下位ビットから最上位ビットに向かってメモリ管理レジスタ511、512、513、514のメモリ制御状態ビット519の値と同じ値が順に記録されている。メモリ制御サマリレジスタ533は、プロセッサから1回のアクセスで読み取ることができ、プロセッサは1回のアクセスでN個のメモリ使用状態を知ることが可能となり、複数のメモリ管理レジスタに個別にアクセスする必要がなくなる。
As shown in FIG. 10, a memory control status bit 519 indicating whether a memory area is available is provided in the least significant bit of the memory management register. When the memory control status bit 519 is “0”, the corresponding memory area is unusable, and when the bit is “1”, the corresponding memory area is usable. The memory use status bit 517 is a flag bit indicating whether the memory area obtained by dividing the shared memory 520 can be used. Here, that the memory area is usable means that the power and the clock are normally supplied to the corresponding memory area, and the memory area can be written and read.
As shown in FIG. 10, the memory control summary register 533 is an N-bit register in which the values of the memory use state bits 517 are extracted and arranged. The same value as the value of the memory control status bit 519 of the memory management registers 511, 512, 513, 514 is recorded in order from the least significant bit to the most significant bit of the memory control summary register 533. The memory control summary register 533 can be read by a single access from the processor, and the processor can know the N memory usage states in one access, and need to access a plurality of memory management registers individually. Disappears.

メモリ制御部542は、メモリ領域の使用可否を制御する。メモリ制御部542は、分割されたメモリ領域ごとにクロックの動作又は停止と電源の供給有無を制御する。メモリ制御部542は、クロックの動作又は停止と電源の供給有無とのいずれか一方のみを制御してもよいし、両方とも制御してもよい。   The memory control unit 542 controls availability of the memory area. The memory control unit 542 controls the operation or stop of the clock and the power supply / non-supply for each divided memory area. The memory control unit 542 may control only one of the operation or stop of the clock and the supply of power, or may control both of them.

***動作の説明***
図11を用いて、未使用のメモリ領域の動作停止方法について説明する。
ステップS31:未使用判定ステップ
プロセッサは、メモリ状態サマリレジスタ532を読み出すことで未使用すなわち使用中の通信用のデータが無い状態(通信用のデータが保存されていないか、又は保存されているが通信先のプロセッサによって通信データが読み出し済みの状態)のメモリ領域を判定する。また、プロセッサを使用せずに、アクセス制御部541又はメモリ制御部542がメモリ状態サマリレジスタ532の値から未使用のメモリ領域を判定してもよい。
この判定は定期的に実行してもよいし、プロセッサの受信処理が完了するたびに実行してもよい。
また、メモリ状態サマリレジスタ532を参照する代わりに、メモリ管理レジスタ510のメモリ制御状態ビット519を参照して未使用のメモリ領域を判定してもよい。
*** Explanation of operation ***
A method of stopping operation of an unused memory area will be described with reference to FIG.
Step S31: Unused determination step The processor reads the memory status summary register 532 to indicate that the processor is unused, ie, there is no communication data in use (communication data is not stored or is stored. The memory area in which the communication data has been read by the communication destination processor is determined. Alternatively, the access control unit 541 or the memory control unit 542 may determine an unused memory area from the value of the memory status summary register 532 without using the processor.
This determination may be performed periodically, or may be performed each time the reception processing of the processor is completed.
Instead of referring to the memory status summary register 532, an unused memory area may be determined by referring to the memory control status bit 519 of the memory management register 510.

ステップS32:停止ステップ
プロセッサは、未使用のメモリ領域を検出すると、メモリ制御部542を介して未使用のメモリ領域のクロックの停止又は電源の遮断を行う。また、アクセス制御部541がメモリ制御部542を介して未使用のメモリ領域のクロックの停止又は電源の遮断を行ってもよい。あるいは、メモリ制御部542が未使用のメモリ領域のクロックの停止又は電源の遮断を行ってもよい。これにより、使用しないメモリ領域の動作を停止させることができ、消費電力を低減できる。
Step S32: Stop Step When the processor detects an unused memory area, the processor stops the clock of the unused memory area or shuts off the power supply via the memory control unit 542. Further, the access control unit 541 may stop the clock of the unused memory area or cut off the power supply via the memory control unit 542. Alternatively, the memory control unit 542 may stop the clock of the unused memory area or cut off the power. Thus, the operation of the unused memory area can be stopped, and the power consumption can be reduced.

ステップS33:停止記録ステップ
さらに、プロセッサ又はアクセス制御部541が、クロックを停止又は電源を遮断したメモリ領域に対応するメモリ管理レジスタのメモリ制御状態ビット519に”0”を書き込む。また、プロセッサ又はアクセス制御部541がメモリ制御サマリレジスタ533の対応するビットに”0”を書き込む。これにより、対応するメモリ領域が使用不可であることを、全てのプロセッサがメモリ制御サマリレジスタ533から読み出すことができるため、使用不可のメモリ領域にアクセスすることを防止できる。
Step S33: Stop Recording Step Further, the processor or the access control unit 541 writes “0” to the memory control status bit 519 of the memory management register corresponding to the memory area where the clock is stopped or the power supply is shut off. Further, the processor or the access control unit 541 writes “0” to a corresponding bit of the memory control summary register 533. This allows all processors to read from the memory control summary register 533 that the corresponding memory area is unusable, thereby preventing access to the unusable memory area.

プロセッサ又はアクセス制御部541が、動作を停止させるメモリ領域は、未使用のメモリ領域のうちの一部でも全てでもよい。もしくは未使用のメモリ領域が一定数又は一定率になるようにしてもよい。   The memory area in which the processor or the access control unit 541 stops the operation may be a part or all of the unused memory areas. Alternatively, the number of unused memory areas may be a fixed number or a fixed rate.

停止中のメモリ領域の起動方法について説明する。
動作を停止させたメモリ領域は、電源とクロックを供給することにより再起動させて使用可能にすることができる。
A method of activating the stopped memory area will be described.
The memory area whose operation has been stopped can be restarted and made usable by supplying power and a clock.

<<未使用のメモリ領域の全てを停止させている場合の再起動>>
図12を用いて、未使用のメモリ領域の全てを停止させている場合のメモリ領域の起動方法について説明する。
ステップS41:起動ステップ
未使用のメモリ領域の全てを停止させた状態でセマフォレジスタへのアクセスが発生した時、プロセッサ又はアクセス制御部541は、アクセスが発生したセマフォレジスタに対応するメモリ領域を再起動させ使用可能にする。
ステップS42:起動記録ステップ
プロセッサ又はアクセス制御部541は、対応するメモリ管理レジスタのメモリ制御状態ビット519に”1”を書き込むとともに、メモリ制御状態ビットに信号線で接続されているメモリ制御サマリレジスタの対応するビットの値にメモリ制御状態ビットの値が反映される。また、メモリ制御サマリレジスタをメモリ制御状態ビットに接続せずに独立したレジスタとした場合には、プロセッサ又はアクセス制御部541は、メモリ制御サマリレジスタ533の対応するビットに”1”を書き込む。こうして、対応するメモリ領域が使用可能になったことをメモリ制御サマリレジスタ533からプロセッサが読み出すことができ、プロセッサは、実施の形態1,2で述べた動作を開始することができる。
<< Restart when all unused memory areas are stopped >>
A method of activating a memory area when all unused memory areas are stopped will be described with reference to FIG.
Step S41: Starting Step When an access to the semaphore register occurs while all the unused memory areas are stopped, the processor or the access control unit 541 restarts the memory area corresponding to the accessed semaphore register. And make it usable.
Step S42: Start Recording Step The processor or the access control unit 541 writes “1” in the memory control status bit 519 of the corresponding memory management register, and writes the memory control summary register of the memory control summary register connected to the memory control status bit by a signal line. The value of the memory control status bit is reflected in the value of the corresponding bit. When the memory control summary register is an independent register without being connected to the memory control status bit, the processor or the access control unit 541 writes “1” to a corresponding bit of the memory control summary register 533. Thus, the processor can read from the memory control summary register 533 that the corresponding memory area has become available, and the processor can start the operations described in the first and second embodiments.

<<未使用のメモリ領域の一部を停止させている場合の再起動>>
図13を用いて、未使用のメモリ領域の一部を停止させている場合のメモリ領域の起動方法について説明する。
ステップS51:使用可能なメモリ領域の選択ステップ
未使用のメモリ領域の一部のみ停止させた状態でセマフォレジスタへのアクセスが発生した時、プロセッサがメモリ制御サマリレジスタ533から動作中の使用可能なメモリ領域の存在を判断する。使用可能なメモリ領域があれば、プロセッサは、メモリ状態サマリレジスタ532から使用可能なメモリ領域であってかつ未使用のメモリ領域を選択することにより、共有メモリの使用を開始する。
このように、プロセッサは、メモリ制御サマリレジスタ533、メモリ状態サマリレジスタ532およびセマフォ状態サマリレジスタ531の値を順に読み出すことにより、メモリ領域を特定する。プロセッサは、電源及びクロックが正常に供給されており、かつ使用中の通信用のデータがなく、セマフォが解放されているメモリ領域を特定し、対応するセマフォの獲得を行う。これにより、アクセス元のプロセッサは共有メモリのクロック動作と電源供給を制御することなく、共有メモリへのアクセスが可能である。
<< Restart when a part of unused memory area is stopped >>
A method of activating a memory area when a part of the unused memory area is stopped will be described with reference to FIG.
Step S51: Step of selecting usable memory area When an access to the semaphore register occurs in a state where only a part of the unused memory area is stopped, the available memory being operated by the processor from the memory control summary register 533. Determine the existence of the area. If there is an available memory area, the processor starts using the shared memory by selecting an available and unused memory area from the memory status summary register 532.
As described above, the processor specifies the memory area by sequentially reading the values of the memory control summary register 533, the memory status summary register 532, and the semaphore status summary register 531. The processor specifies a memory area where power and clock are normally supplied, there is no communication data in use, and the semaphore is released, and the corresponding semaphore is obtained. As a result, the accessing processor can access the shared memory without controlling the clock operation and power supply of the shared memory.

ステップS52:起動ステップ
さらに、プロセッサがメモリ状態サマリレジスタ532から使用可能なメモリ領域であってかつ未使用のメモリ領域を選択してゆくと、使用可能なメモリ領域であってかつ未使用のメモリ領域がなくなるか、もしくは一定数以下になる。この場合は、プロセッサ又はアクセス制御部541は、停止中のメモリ領域を再起動させることで未使用のメモリ領域を確保する。
Step S52: Startup Step Further, when the processor selects an available memory area and an unused memory area from the memory status summary register 532, the available memory area and the unused memory area Disappears or falls below a certain number. In this case, the processor or the access control unit 541 secures an unused memory area by restarting the stopped memory area.

ステップS53:起動記録ステップ
プロセッサ又はアクセス制御部541は、対応するメモリ管理レジスタのメモリ制御状態ビット519に”1”を書き込むとともに、メモリ制御状態ビットに信号線で接続されているメモリ制御サマリレジスタの対応するビットの値にメモリ制御状態ビットの値が反映される。また、メモリ制御サマリレジスタをメモリ制御状態ビットに接続せずに独立したレジスタとした場合には、プロセッサ又はアクセス制御部541は、メモリ制御サマリレジスタ533の対応するビットに”1”を書き込む。こうして、対応するメモリ領域が使用可能になったことをメモリ制御サマリレジスタ533からプロセッサが読み出すことができ、プロセッサは、実施の形態1,2で述べた動作を開始することができる。
Step S53: Start Recording Step The processor or the access control unit 541 writes “1” into the memory control status bit 519 of the corresponding memory management register, and writes the memory control summary bit of the memory control summary register connected to the memory control status bit by a signal line. The value of the memory control status bit is reflected in the value of the corresponding bit. When the memory control summary register is an independent register without being connected to the memory control status bit, the processor or the access control unit 541 writes “1” to a corresponding bit of the memory control summary register 533. Thus, the processor can read from the memory control summary register 533 that the corresponding memory area has become available, and the processor can start the operations described in the first and second embodiments.

***実施の形態の効果の説明***
本実施の形態によれば、共有メモリ動作の制御が可能なメモリ状態サマリレジスタ532を備え、未使用のメモリ領域の動作を停止させるので、消費電力の削減を行うことが可能となる。すなわち、メモリへのアクセス状態から判定されたメモリ使用状態を記憶するメモリ状態サマリレジスタ532を備えることにより、使用していないメモリ領域を判定して電源供給を停止、又はクロック供給を停止することが可能になる。
*** Explanation of effect of embodiment ***
According to the present embodiment, since the memory state summary register 532 capable of controlling the operation of the shared memory is provided and the operation of the unused memory area is stopped, it is possible to reduce the power consumption. That is, by providing the memory status summary register 532 that stores the memory usage status determined from the access status to the memory, it is possible to determine the unused memory area and stop the power supply or stop the clock supply. Will be possible.

本実施の形態によれば、複数のメモリ領域のメモリ使用状態を1回のアクセスで確認可能なメモリ制御サマリレジスタ533を備えているので共有メモリへのアクセス時間の短縮が可能となる。   According to the present embodiment, since the memory control summary register 533 capable of confirming the memory usage state of a plurality of memory areas by one access is provided, it is possible to reduce the access time to the shared memory.

***他の構成の説明***
アクセス制御部541は、プロセッサの命令を受付けてその命令を処理する部分であるから、前述した実施の形態1,2,3で、プロセッサの動作はアクセス制御部541の動作とみなすことができる。前述した実施の形態1,2,3のアクセス制御部541の動作は、すべてプロセッサが実行してもよい。
アクセス制御部541及びメモリ制御部542は、プロセッサで実現でき、ハードウェア、ファームウェア、ソフトウェアの組み合わせで実現することができる。
共有メモリは、ランダムアクセスメモリ、キャッシュメモリ、固定ディスク、光ディスクなどで実現することができる。
前述した実施の形態1,2,3で説明したレジスタは共有メモリ制御回路50の内部にあるデータの保持や演算結果の保持や実行状態の保持に用いる記憶素子であるが、レジスタはデータを記憶するメモリでもよく、好ましくはプロセッサから高速にかつ少ない回数のアクセスで読み書きできるメモリであってもよい。
*** Description of other configurations ***
The access control unit 541 is a unit that receives a processor instruction and processes the instruction. Therefore, in the first, second, and third embodiments, the operation of the processor can be regarded as the operation of the access control unit 541. All operations of the access control unit 541 of the first, second, and third embodiments may be executed by the processor.
The access control unit 541 and the memory control unit 542 can be realized by a processor, and can be realized by a combination of hardware, firmware, and software.
The shared memory can be realized by a random access memory, a cache memory, a fixed disk, an optical disk, or the like.
The registers described in the first, second, and third embodiments are storage elements that are used in the shared memory control circuit 50 to hold data, hold operation results, and hold execution states. The registers store data. A memory that can be read and written by a processor at high speed and with a small number of accesses may be used.

実施の形態2において、実施の形態1で述べたセマフォ状態サマリレジスタ531はなくてもよい。すなわち、共有メモリ制御回路50に、セマフォレジスタ500とアクセス制御部541とメモリ状態サマリレジスタ532とメモリ管理レジスタ510と共有メモリ520が存在しているだけでもよい。
あるいは、セマフォレジスタ500とアクセス制御部541とメモリ状態サマリレジスタ532と共有メモリ520が存在しているだけでもよい。
また、メモリ状態サマリレジスタ532は、メモリ管理レジスタ510のメモリ使用状態ビット517と同じ情報を有しているから、メモリ状態サマリレジスタ532があればメモリ管理レジスタ510のメモリ使用状態ビット517はなくてもよい。逆に、メモリ管理レジスタ510のメモリ使用状態ビット517があればメモリ状態サマリレジスタ532はなくてもよい。
In the second embodiment, the semaphore state summary register 531 described in the first embodiment may not be provided. That is, the shared memory control circuit 50 may include only the semaphore register 500, the access control unit 541, the memory status summary register 532, the memory management register 510, and the shared memory 520.
Alternatively, only the semaphore register 500, the access control unit 541, the memory status summary register 532, and the shared memory 520 may exist.
Further, since the memory status summary register 532 has the same information as the memory usage status bit 517 of the memory management register 510, if the memory status summary register 532 is present, the memory usage status bit 517 of the memory management register 510 is not present. Is also good. Conversely, if the memory use status bit 517 of the memory management register 510 is present, the memory status summary register 532 may not be provided.

実施の形態3において、実施の形態1、2で述べたセマフォ状態サマリレジスタ531とセマフォレジスタ500とメモリ管理レジスタ510はなくてもよい。すなわち、共有メモリ制御回路50に、アクセス制御部541とメモリ状態サマリレジスタ532とメモリ制御サマリレジスタ533とメモリ制御部542と共有メモリ520が存在しているだけでもよい。
また、メモリ制御サマリレジスタ533は、メモリ管理レジスタ510のメモリ制御状態ビット519と同じ情報を有しているから、メモリ制御サマリレジスタ533があればメモリ管理レジスタ510のメモリ制御状態ビット519はなくてもよい。逆に、メモリ管理レジスタ510のメモリ制御状態ビット519があればメモリ制御サマリレジスタ533はなくてもよい。
In the third embodiment, the semaphore status summary register 531, the semaphore register 500, and the memory management register 510 described in the first and second embodiments may not be provided. That is, the shared memory control circuit 50 may include only the access control unit 541, the memory status summary register 532, the memory control summary register 533, the memory control unit 542, and the shared memory 520.
Further, since the memory control summary register 533 has the same information as the memory control status bit 519 of the memory management register 510, if the memory control summary register 533 exists, the memory control status bit 519 of the memory management register 510 does not exist. Is also good. Conversely, if there is a memory control status bit 519 of the memory management register 510, the memory control summary register 533 may not be provided.

セマフォ状態サマリレジスタ531とメモリ状態サマリレジスタ532とメモリ制御サマリレジスタ533のいずれか2個のレジスタ又はすべてのレジスタを組み合わせて一つの統合サマリレジスタにしてもよい   Any two or all of the semaphore state summary register 531, the memory state summary register 532, and the memory control summary register 533 may be combined into one integrated summary register.

10 プロセッサ、20 プロセッサ、30 プロセッサ、40 バス、50 共有メモリ制御回路、100 マルチプロセッサシステム、500,501,502,503,504 セマフォレジスタ、509 セマフォ状態ビット、510,511,512,513,514 メモリ管理レジスタ、517 メモリ使用状態ビット、518 メモリアクセス状態ビット、519 メモリ制御状態ビット、520 共有メモリ、521,522,523,524 メモリ領域、531 セマフォ状態サマリレジスタ、532 メモリ状態サマリレジスタ、533 メモリ制御サマリレジスタ、541 アクセス制御部、542 メモリ制御部。   10 processors, 20 processors, 30 processors, 40 buses, 50 shared memory control circuits, 100 multiprocessor systems, 500, 501, 502, 503, 504 semaphore registers, 509 semaphore status bits, 510, 511, 512, 513, 514 memory Management register, 517 memory use status bit, 518 memory access status bit, 519 memory control status bit, 520 shared memory, 521, 522, 523, 524 memory area, 531 semaphore status summary register, 532 memory status summary register, 533 memory control Summary register, 541 access control unit, 542 memory control unit.

Claims (6)

複数のプロセッサがアクセスする共有メモリ制御回路において、
複数のメモリ領域と、
前記複数のメモリ領域に対応して設けられ、メモリ領域の使用状態を記録する複数のメモリ管理レジスタと、
前記複数のメモリ領域の使用状態を記録するメモリ状態サマリレジスタと
を備え
前記プロセッサは、前記メモリ状態サマリレジスタから未使用のメモリ領域を検出し、検出した未使用のメモリ領域に対応するセマフォレジスタにアクセスしてセマフォを獲得する共有メモリ制御回路。
In a shared memory control circuit accessed by a plurality of processors,
Multiple memory areas,
A plurality of memory management registers provided corresponding to the plurality of memory areas and recording a use state of the memory area;
A memory status summary register for recording usage status of the plurality of memory areas ,
A shared memory control circuit , wherein the processor detects an unused memory area from the memory status summary register and accesses a semaphore register corresponding to the detected unused memory area to acquire a semaphore .
複数のプロセッサがアクセスする共有メモリ制御回路において、
複数のメモリ領域と、
前記複数のメモリ領域に対応して設けられた複数のメモリ管理レジスタであって、メモリ領域の使用状態を記録する複数のメモリ管理レジスタと
を備え、
前記メモリ管理レジスタは、対応するメモリ領域に対して、メモリ領域が使用中であるか未使用であるかという使用状態を記録するメモリアクセス状態ビットを有し、
1.メモリ領域への最終アクセスの種類を記録する最終アクセス種類ビット、
2.メモリ領域への最終アクセスをしたプロセッサのプロセッサ番号を記録する最終アクセスプロセッサビット、
3.通信データの宛先となる通信先プロセッサのプロセッサ番号を記録する通信用IDビット、
4.通信データのデータ識別番号を記録するデータ識別ビット、
5.通信データが記録されたメモリ領域の開始アドレスおよび終了アドレス、および、読み出しを行ったメモリ領域の開始アドレスおよび終了アドレスを記録するアドレスビットの少なくともいずれか1つ以上のビットを有する共有メモリ制御回路。
In a shared memory control circuit accessed by a plurality of processors,
Multiple memory areas,
A plurality of memory management registers provided corresponding to the plurality of memory areas, the plurality of memory management registers recording a use state of the memory area;
With
The memory management register has, for a corresponding memory area, a memory access state bit for recording a use state of whether the memory area is in use or unused,
1. A last access type bit for recording the last access type to the memory area,
2. A last access processor bit that records the processor number of the processor that last accessed the memory area,
3. A communication ID bit for recording a processor number of a communication destination processor which is a destination of communication data;
4. A data identification bit for recording a data identification number of communication data,
5. Start address and end address of the memory area where the communication data is recorded, and, shared memory that have a least any one or more bits of the address bits to record the start address and end address of the memory area was read Control circuit.
複数のプロセッサがアクセスする共有メモリ制御回路において、  In a shared memory control circuit accessed by a plurality of processors,
複数のメモリ領域と、  Multiple memory areas,
前記複数のメモリ領域に対応して設けられ、メモリ領域の使用状態を記録する複数のメモリ管理レジスタと、  A plurality of memory management registers provided corresponding to the plurality of memory areas and recording a use state of the memory area;
前記複数のメモリ領域の使用状態を記録するメモリ状態サマリレジスタと  A memory status summary register for recording usage status of the plurality of memory areas;
を備え、With
前記メモリ管理レジスタは、対応するメモリ領域に対して、メモリ領域が使用中であるか未使用であるかという使用状態を記録するメモリアクセス状態ビットを有し、  The memory management register has, for a corresponding memory area, a memory access state bit for recording a use state of whether the memory area is in use or unused,
1.メモリ領域への最終アクセスの種類を記録する最終アクセス種類ビット、1. A last access type bit for recording the last access type to the memory area,
2.メモリ領域への最終アクセスをしたプロセッサのプロセッサ番号を記録する最終アクセスプロセッサビット、2. A last access processor bit that records the processor number of the processor that last accessed the memory area,
3.通信データの宛先となる通信先プロセッサのプロセッサ番号を記録する通信用IDビット、3. A communication ID bit for recording a processor number of a communication destination processor which is a destination of communication data;
4.通信データのデータ識別番号を記録するデータ識別ビット、4. A data identification bit for recording a data identification number of communication data,
5.通信データが記録されたメモリ領域の開始アドレスおよび終了アドレス、および、読み出しを行ったメモリ領域の開始アドレスおよび終了アドレスを記録するアドレスビットの少なくともいずれか1つ以上のビットを有する共有メモリ制御回路。5. A shared memory control circuit having at least one of an address bit for recording a start address and an end address of a memory area in which communication data is recorded, and an address bit for recording a start address and an end address of a memory area from which data is read.
複数のプロセッサがアクセスする共有メモリ制御回路において、
複数のメモリ領域と、
前記複数のメモリ領域の使用状態を記録するメモリ状態サマリレジスタと、
前記メモリ状態サマリレジスタにおいて未使用と記録されたメモリ領域の動作を停止させるメモリ制御部と、
前記メモリ制御部により動作が停止されたメモリ領域を記録するメモリ制御サマリレジスタと
を備え
前記プロセッサは、前記メモリ状態サマリレジスタから未使用のメモリ領域を検出し、検出した未使用のメモリ領域に対応するセマフォレジスタにアクセスしてセマフォを獲得する共有メモリ制御回路。
In a shared memory control circuit accessed by a plurality of processors,
Multiple memory areas,
A memory status summary register for recording a usage status of the plurality of memory areas;
A memory control unit for stopping the operation of the memory area recorded as unused in the memory status summary register;
A memory control summary register that records a memory area stopped operating by the memory control unit ,
A shared memory control circuit , wherein the processor detects an unused memory area from the memory status summary register and accesses a semaphore register corresponding to the detected unused memory area to acquire a semaphore .
複数のメモリ領域を有する共有メモリに対して複数のプロセッサがアクセスする共有メモリ制御方法において、
前記複数のメモリ領域に対応して設けられた複数のメモリ管理レジスタに、メモリ領域の使用状態を記録する使用状態記録ステップと、
メモリ状態サマリレジスタに前記メモリ領域の使用状態を記録する管理状態記録ステップと、
前記メモリ状態サマリレジスタから未使用のメモリ領域を検出し、検出した未使用のメモリ領域に対応するセマフォレジスタにアクセスしてセマフォを獲得するセマフォ獲得ステップと
を備えた共有メモリ制御方法。
In a shared memory control method in which a plurality of processors access a shared memory having a plurality of memory areas,
A use state recording step of recording a use state of a memory area in a plurality of memory management registers provided corresponding to the plurality of memory areas;
A management state recording step of recording a use state of the memory area in a memory state summary register;
Detecting an unused memory area from the memory status summary register, and accessing a semaphore register corresponding to the detected unused memory area to acquire a semaphore.
前記複数のメモリ領域のなかで使用していない未使用のメモリ領域を判定する未使用判定ステップと、
前記未使用判定ステップで判定された未使用のメモリ領域の動作を停止させる停止ステップと、
メモリ制御サマリレジスタに、動作を停止させたメモリ領域を記録する停止記録ステップと、
前記メモリ制御サマリレジスタを参照して、使用可能なメモリ領域を判断して、使用可能なメモリ領域を選択する選択ステップと、
前記メモリ制御サマリレジスタを参照して、停止しているメモリ領域を判断して、停止しているメモリ領域を起動する起動ステップと
を備えた請求項5に記載の共有メモリ制御方法。
An unused determination step of determining an unused memory area that is not used among the plurality of memory areas;
A stopping step of stopping the operation of the unused memory area determined in the unused determining step,
A stop recording step of recording, in the memory control summary register, a memory area whose operation has been stopped;
A selecting step of determining an available memory area by referring to the memory control summary register and selecting an available memory area;
The shared memory control method according to claim 5, further comprising: a starting step of determining a stopped memory area with reference to the memory control summary register and starting the stopped memory area.
JP2016026830A 2016-02-16 2016-02-16 Shared memory control circuit and shared memory control method Expired - Fee Related JP6632416B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2016026830A JP6632416B2 (en) 2016-02-16 2016-02-16 Shared memory control circuit and shared memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016026830A JP6632416B2 (en) 2016-02-16 2016-02-16 Shared memory control circuit and shared memory control method

Publications (2)

Publication Number Publication Date
JP2017146703A JP2017146703A (en) 2017-08-24
JP6632416B2 true JP6632416B2 (en) 2020-01-22

Family

ID=59682273

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016026830A Expired - Fee Related JP6632416B2 (en) 2016-02-16 2016-02-16 Shared memory control circuit and shared memory control method

Country Status (1)

Country Link
JP (1) JP6632416B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171862B (en) * 2018-01-08 2021-03-09 北京值得买科技股份有限公司 Number sending method and number sender
JPWO2022230674A1 (en) * 2021-04-28 2022-11-03

Also Published As

Publication number Publication date
JP2017146703A (en) 2017-08-24

Similar Documents

Publication Publication Date Title
US20180143923A1 (en) Providing State Storage in a Processor for System Management Mode
JP5229326B2 (en) Power consumption control method, power consumption control program and information processing system in multi-core CPU
US8156376B2 (en) Method, device and system for storing data in cache in case of power failure
JP2010140361A (en) Computer system and abnormality detection circuit
US10642782B2 (en) Multi-core processor and operation method thereof
JPWO2010097925A1 (en) Information processing device
JP2011129104A (en) Adaptive optimized compare-exchange operation
JP2007334403A (en) System and method for supporting trouble of computer system
JP2002245022A (en) Multiprocessor system, its shared memory control method and shared memory control program,
JP6632416B2 (en) Shared memory control circuit and shared memory control method
US10740167B2 (en) Multi-core processor and cache management method thereof
CN115576734B (en) Multi-core heterogeneous log storage method and system
KR102377729B1 (en) Multi-core processor and operation method thereof
US10545885B2 (en) Information processing device, information processing method, and computer program product
US10269194B2 (en) Multiprocessor system and vehicle control system
KR102376396B1 (en) Multi-core processor and cache management method thereof
US10997105B2 (en) Semiconductor device and method of operating the same
JP2015118493A (en) Trace device and trace program
US20030200401A1 (en) Microcomputer system automatically backing-up data written in storage medium in transceiver, and transceiver connected thereto
JP2015014962A (en) Arithmetic device, arithmetic method, and program
JP3239935B2 (en) Tightly-coupled multiprocessor system control method, tightly-coupled multiprocessor system, and recording medium therefor
JPH10283302A (en) Method and system for supplying data to bus connected to plural processors
JP4853620B2 (en) Multiprocessor system and initial startup method and program
JP2005010995A (en) Multiprocessor system and process for dealing with trouble of write-back thereof
US20070124522A1 (en) Node detach in multi-node system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180822

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190523

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190611

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190705

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

R150 Certificate of patent or registration of utility model

Ref document number: 6632416

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees