JP2015215641A - Information processor, emulation program and emulation method - Google Patents

Information processor, emulation program and emulation method Download PDF

Info

Publication number
JP2015215641A
JP2015215641A JP2014096206A JP2014096206A JP2015215641A JP 2015215641 A JP2015215641 A JP 2015215641A JP 2014096206 A JP2014096206 A JP 2014096206A JP 2014096206 A JP2014096206 A JP 2014096206A JP 2015215641 A JP2015215641 A JP 2015215641A
Authority
JP
Japan
Prior art keywords
read
virtual
storage unit
queue
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2014096206A
Other languages
Japanese (ja)
Inventor
柴崎 省吾
Shogo Shibazaki
省吾 柴崎
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2014096206A priority Critical patent/JP2015215641A/en
Publication of JP2015215641A publication Critical patent/JP2015215641A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an information processor capable of reproducing an object device which includes an object storage and plural object processing parts sharing a storage area of the object storage by using a virtual model while preventing performance degradation of the virtual model.SOLUTION: The information processor includes: a storage section 41 that stores requests to write on a virtual storage part 30 in a processing order corresponding to object storage which is issued from each of plural virtual processing parts 10 and 20 corresponding to plural object processing parts; and read-out control units 42 and 43 that determine, relevant to the read-out request to the virtual storage part 30 issued from the virtual processing parts 10 and 20, whether or not an access range relevant to the read-out request overlaps with an access range relevant to one or more write requests stored in the storage section 41, and if not overlap, executes the read-out processing relevant to the read-out request.

Description

本発明は、情報処理装置,エミュレーションプログラム,及びエミュレーション方法に関する。   The present invention relates to an information processing apparatus, an emulation program, and an emulation method.

近年、DVD(Digital Versatile Disc)/HDD(Hard Disk Drive)レコーダやNAS(Network Area Storage)装置をはじめとする各種装置のライフサイクルが短くなり、ベンダが自社のみで装置の全ての部品を製造することが減少している。代わりに、ベンダが部品を各社から調達して組み立て、ソフトウェア(Firmware;FW等)を組み込むことで、1つの装置を製造することが多くなっている。   In recent years, the life cycle of various devices including DVD (Digital Versatile Disc) / HDD (Hard Disk Drive) recorders and NAS (Network Area Storage) devices has been shortened, and vendors manufacture all parts of the devices by themselves. That is decreasing. Instead, vendors often procure parts from various companies, assemble them, and incorporate software (Firmware, FW, etc.) to manufacture a single device.

大規模な装置は多くの細かなソフトウェア(モジュール等)を組み込まれることが多い。これらのソフトウェアの多くは、装置が完成してからデバッグが行なわれるため、ソフトウェアの数が多くなるのに伴ってデバッグに時間がかかる。   Large-scale devices often incorporate many small pieces of software (modules, etc.). Since most of these softwares are debugged after the apparatus is completed, debugging takes time as the number of softwares increases.

このため、試作としての装置(試作装置)を多く作成して同時に(並行して)デバッグを行ない、デバッグ期間を短縮する手法等が考えられる。しかし、この手法では、試作装置を多く作成するため、コストがかかる。また、装置の修正(改版)等があった場合、再度複数の試作装置を作成することになるため、工数が増加し、ライフサイクルに合わなくなったり、装置のコストアップに繋がる場合もある。   For this reason, a method of shortening the debugging period by creating a large number of prototype devices (prototype devices) and performing debugging simultaneously (in parallel) can be considered. However, this method is costly because many prototype devices are created. In addition, when the device is corrected (revised) or the like, a plurality of prototype devices are created again, which may increase the number of man-hours and may not be able to meet the life cycle or increase the cost of the device.

上記の不都合を回避する手法として、装置の全体若しくは一部をソフトウェア的にサーバやPC(Personal Computer)等のコンピュータ(情報処理装置)上でエミュレート(再現)することが考えられる。   As a technique for avoiding the above inconvenience, it is conceivable to emulate (reproduce) the whole or a part of the apparatus on a computer (information processing apparatus) such as a server or a PC (Personal Computer).

上述したエミュレーションでは、装置を実際に製造せずに、コンピュータ上で、装置(ハードウェア)をエミュレートするソフトウェア(エミュレータ)により仮想的に装置を構成し、仮想的な装置(仮想装置)上で実際のソフトウェアを実行させる。これにより、装置を実際に製造した際の問題点を洗い出すことができる。   In the above-described emulation, the device is virtually configured by software (emulator) that emulates the device (hardware) on the computer without actually manufacturing the device, and on the virtual device (virtual device). Run the actual software. Thereby, the problem at the time of actually manufacturing an apparatus can be identified.

特開2001−175632号公報JP 2001-175632 A 特開2001−318825号公報JP 2001-318825 A

しかし、エミュレータでは、再現対象の対象装置(ハードウェア)とは異なり、情報処理装置のプロセッサ(CPU等)が、ソフトウェアで再現した仮想CPU(Central Processing Unit)及び仮想デバイスから仮想メモリへのアクセスを行なう。このため、仮想装置では、対象装置とは異なり、エミュレータ特有で起こる性能(動作速度)の低下が生じ得る。   However, in the emulator, unlike the target device (hardware) to be reproduced, the processor (CPU, etc.) of the information processing device accesses the virtual memory from the virtual CPU (Central Processing Unit) and virtual device reproduced by software. Do. For this reason, unlike the target device, the virtual device may have a decrease in performance (operation speed) that is unique to the emulator.

1つの側面では、本発明は、対象装置を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することを目的とする。   In one aspect, an object of the present invention is to suppress degradation in performance of a virtual model in an information processing apparatus that reproduces a target device using a virtual model.

なお、前記目的に限らず、後述する発明を実施するための形態に示す各構成により導かれる作用効果であって、従来の技術によっては得られない作用効果を奏することも本発明の他の目的の1つとして位置付けることができる。   In addition, the present invention is not limited to the above-described object, and other effects of the present invention can be achieved by the functions and effects derived from the respective configurations shown in the embodiments for carrying out the invention which will be described later. It can be positioned as one of

本件の情報処理装置は、対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置であり、格納部と読出制御部とをそなえる。前記格納部は、前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納する。前記読出制御部は、前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定する。重ならない場合、前記読出制御部は、前記読み出し要求に係る読み出し処理を実行する。   The information processing apparatus according to the present embodiment is an information processing apparatus that reproduces a target device including a target storage unit and a plurality of target processing units that share the storage area of the target storage unit, and includes a storage unit and a read control unit. The storage unit stores a write request to the virtual storage unit corresponding to the target storage unit issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units in the order of processing. For the read request to the virtual storage unit issued from the virtual processing unit, whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit Determine whether or not. If they do not overlap, the read control unit executes a read process related to the read request.

一実施形態によれば、対象装置を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することができる。   According to one embodiment, it is possible to suppress the performance degradation of the virtual model in the information processing apparatus that reproduces the target device using the virtual model.

再現対象の装置(対象装置)をエミュレータにより再現した仮想装置の構成例を示す図である。It is a figure which shows the structural example of the virtual apparatus which reproduced the apparatus (target apparatus) of reproduction object by the emulator. 再現対象の装置(対象装置)をエミュレータにより再現した仮想装置の構成例を示す図である。It is a figure which shows the structural example of the virtual apparatus which reproduced the apparatus (target apparatus) of reproduction object by the emulator. 一実施形態に係るエミュレーションサーバの構成例を示す図である。It is a figure which shows the structural example of the emulation server which concerns on one Embodiment. 図3に示すエミュレーションサーバのハードウェア構成例を示す図である。It is a figure which shows the hardware structural example of the emulation server shown in FIG. 一実施形態に係るエミュレータの構成例を示す図である。It is a figure which shows the structural example of the emulator which concerns on one Embodiment. 図5に示すキュー処理部の動作例を説明する図である。It is a figure explaining the operation example of the queue process part shown in FIG. 図5に示すキュー処理部によるキューイング(追加)の動作例を説明する図である。It is a figure explaining the operation example of the queuing (addition) by the queue process part shown in FIG. 図5に示すキュー処理部によるキューイング(削除)の動作例を説明する図である。It is a figure explaining the operation example of the queuing (deletion) by the queue process part shown in FIG. 図5に示すキュー処理部によるキュー格納部へのキューの挿入の動作例を説明する図である。It is a figure explaining the operation example of insertion of the queue in the queue storage part by the queue process part shown in FIG. 図5に示すキュー処理部によるキュー格納部へのキューの挿入の動作例を説明する図である。It is a figure explaining the operation example of insertion of the queue in the queue storage part by the queue process part shown in FIG. 一実施形態に係るエミュレータ(仮想装置)の動作例を示すシーケンス図である。It is a sequence diagram showing an operation example of an emulator (virtual device) according to an embodiment. 一実施形態に係るエミュレータ(仮想装置)の動作例を示すシーケンス図である。It is a sequence diagram showing an operation example of an emulator (virtual device) according to an embodiment. 一実施形態に係るエミュレータにおけるWrite関数の処理手順の一例を説明するフローチャートである。It is a flowchart explaining an example of the processing procedure of the Write function in the emulator which concerns on one Embodiment. 一実施形態に係るエミュレータにおけるQueue登録関数の処理手順の一例を説明するフローチャートである。It is a flowchart explaining an example of the process sequence of the Queue registration function in the emulator which concerns on one Embodiment. 一実施形態に係るエミュレータにおけるRead関数の処理手順の一例を説明するフローチャートである。It is a flowchart explaining an example of the processing procedure of the Read function in the emulator which concerns on one Embodiment. 一実施形態に係るエミュレータにおけるRead関数の処理手順の一例を説明するフローチャートである。It is a flowchart explaining an example of the processing procedure of the Read function in the emulator which concerns on one Embodiment. 一実施形態に係るエミュレータにおけるアクセス処理(スレッド)の処理手順の一例を説明するフローチャートである。It is a flowchart explaining an example of the process sequence of the access process (thread) in the emulator which concerns on one Embodiment. 一実施形態に係るエミュレータにおけるRead関数の処理及びアクセス処理(スレッド)の一例を説明する図である。It is a figure explaining an example of the process of a Read function and the access process (thread) in the emulator which concerns on one Embodiment. 一実施形態に係るエミュレータにおけるEXECフラグの設定の処理手順の一例を説明するフローチャートである。It is a flowchart explaining an example of the processing procedure of the setting of the EXEC flag in the emulator which concerns on one Embodiment. 再現対象の装置(対象装置)をエミュレータにより再現した仮想装置の構成例を示す図である。It is a figure which shows the structural example of the virtual apparatus which reproduced the apparatus (target apparatus) of reproduction object by the emulator. 一実施形態に係るエミュレータを適用した仮想装置の構成例を示す図である。It is a figure which shows the structural example of the virtual apparatus to which the emulator which concerns on one Embodiment is applied. 一実施形態に係る対象装置の構成例を示す図である。It is a figure which shows the structural example of the target apparatus which concerns on one Embodiment.

以下、図面を参照して本発明の実施の形態を説明する。ただし、以下に説明する実施形態は、あくまでも例示であり、以下に明示しない種々の変形や技術の適用を排除する意図はない。すなわち、本実施形態を、その趣旨を逸脱しない範囲で種々変形して実施することができる。なお、以下の実施形態で用いる図面において、同一符号を付した部分は、特に断らない限り、同一若しくは同様の部分を表す。   Embodiments of the present invention will be described below with reference to the drawings. However, the embodiment described below is merely an example, and there is no intention to exclude various modifications and technical applications that are not explicitly described below. That is, the present embodiment can be implemented with various modifications without departing from the spirit of the present embodiment. Note that, in the drawings used in the following embodiments, portions denoted by the same reference numerals represent the same or similar portions unless otherwise specified.

〔1〕一実施形態
〔1−1〕対比例
はじめに、図1及び図2に示す対比例を説明する。図1及び図2は、それぞれ、再現対象の装置(対象装置)1000(図22参照)をエミュレータにより再現した仮想装置100及び200の構成例を示す図である。なお、対象装置1000の構成例を図22に示す。対象装置1000は、図22に示すように、CPU1100及び複数のデバイス1200−1〜1200−3が、内部バス1400を介してメモリ1300にアクセスすることができる。
[1] One Embodiment [1-1] Comparison The comparison shown in FIGS. 1 and 2 will be described first. FIG. 1 and FIG. 2 are diagrams showing configuration examples of virtual devices 100 and 200 in which a reproduction target device (target device) 1000 (see FIG. 22) is reproduced by an emulator, respectively. A configuration example of the target device 1000 is shown in FIG. As illustrated in FIG. 22, the target device 1000 allows the CPU 1100 and the plurality of devices 1200-1 to 1200-3 to access the memory 1300 via the internal bus 1400.

エミュレータは、装置(対象装置)1000のエミュレートを行なうソフトウェアであり、図示しないCPU及びRAM(Random Access Memory)等のメモリをそなえるサーバやPC等のコンピュータ(情報処理装置)上で実行される。エミュレータは、コンピュータにおいてCPUによりメモリ上に展開されたエミュレーションプログラムが実行されることで実現される。エミュレータは、図1に示すようにソフトウェア的に仮想装置100を構成することができる。   The emulator is software for emulating the device (target device) 1000, and is executed on a computer (information processing device) such as a server or a PC having a memory such as a CPU and a RAM (Random Access Memory) (not shown). The emulator is realized by executing an emulation program developed on a memory by a CPU in a computer. The emulator can configure the virtual device 100 in software as shown in FIG.

仮想装置100は、エミュレーションの対象装置1000を再現したものであり、図1に示すように仮想(疑似)CPU(Pseudo CPU)110,複数(例えば3つ)の仮想(疑似)デバイス(Pseudo Device)120−1〜120−3,及び仮想メモリ130をそなえる。   The virtual device 100 is a reproduction of the emulation target device 1000, and as shown in FIG. 1, a virtual (pseudo) CPU (Pseudo CPU) 110 and a plurality of (for example, three) virtual (pseudo) devices (Pseudo Device). 120-1 to 120-3 and a virtual memory 130 are provided.

仮想CPU110は、実際のプログラム(FW)を実行する仮想的なCPUである。仮想デバイス120−1〜120−3(以下の説明において仮想デバイス120−1〜120−3を区別しない場合には単に仮想デバイス120という)は、対象装置1000(仮想装置100)内部の各デバイスの動作を疑似的に再現する仮想的なデバイスである。以下、仮想CPU110及び複数の仮想デバイス120をまとめて仮想処理部という場合がある。   The virtual CPU 110 is a virtual CPU that executes an actual program (FW). Virtual devices 120-1 to 120-3 (in the following description, when virtual devices 120-1 to 120-3 are not distinguished from each other, they are simply referred to as virtual devices 120) It is a virtual device that simulates the operation. Hereinafter, the virtual CPU 110 and the plurality of virtual devices 120 may be collectively referred to as a virtual processing unit.

仮想メモリ130は、コンピュータのメモリのリソースを用いて実現される仮想的なメモリである。仮想CPU110及び仮想デバイス120は、仮想メモリ130に対してアクセス、つまりデータの読み出しや書き込みを行なうことができる。   The virtual memory 130 is a virtual memory that is realized using the memory resources of the computer. The virtual CPU 110 and the virtual device 120 can access the virtual memory 130, that is, read and write data.

ところで、図1に示すエミュレータでは、各仮想処理部は互いに独立して仮想装置100内の仮想メモリ130に対しアクセスを発生させる。すなわち、図1に示すエミュレータは、仮想処理部間にて排他処理を行なう機能をそなえていない。   By the way, in the emulator shown in FIG. 1, each virtual processing unit generates access to the virtual memory 130 in the virtual device 100 independently of each other. That is, the emulator shown in FIG. 1 does not have a function of performing exclusive processing between virtual processing units.

仮想装置100では、仮想CPU110が仮想デバイス120から仮想メモリ130への書き込みの値を監視し、状態が変化したときに次の処理に移行するようなプログラムが実行されることがある。このとき、仮想CPU110は、仮想デバイス120から仮想メモリ130への書き込みが中途半端な状態でも次の動作に移行してしまう場合がある。   In the virtual device 100, a program may be executed in which the virtual CPU 110 monitors a value written from the virtual device 120 to the virtual memory 130 and shifts to the next process when the state changes. At this time, the virtual CPU 110 may shift to the next operation even when the writing from the virtual device 120 to the virtual memory 130 is halfway.

一例として、仮想CPU110と仮想デバイス120とが仮想メモリ130の同一の空間(記憶領域)をアクセスするような処理を考える。このような処理としては、割り込み等を使用して仮想デバイス120が複数のデータを仮想メモリ130に書き込み、そのデータを仮想CPU110が読み出すような処理が挙げられる。この場合、仮想デバイス120が仮想メモリ130へのデータの書き込みを完了しないうちに、仮想CPU110が同一の記憶領域からの読み出しを実行し、仮想デバイス120からのデータが途中までしか書き込まれない事態が生じ得る。   As an example, consider a process in which the virtual CPU 110 and the virtual device 120 access the same space (storage area) of the virtual memory 130. Such processing includes processing in which the virtual device 120 writes a plurality of data in the virtual memory 130 using an interrupt or the like, and the virtual CPU 110 reads the data. In this case, before the virtual device 120 completes the writing of data to the virtual memory 130, the virtual CPU 110 executes reading from the same storage area, and the data from the virtual device 120 is only partially written. Can occur.

また、Linux(登録商標)を実行するコンピュータ上で動作するエミュレータにおいて、仮想CPU110が仮想メモリ130にアクセスすると、ページ概念により4Kバイト単位でスレッドが切り替わる可能性がある。このため、データが途中までしか書き込まれない状態と同様に、転送途中で次の処理が実行され処理の追い越しが発生する可能性があり、予期しない誤動作を生じる場合もある。   Further, in an emulator operating on a computer that executes Linux (registered trademark), when the virtual CPU 110 accesses the virtual memory 130, there is a possibility that threads are switched in units of 4K bytes depending on the page concept. For this reason, similarly to the state where data is written only halfway, the next process may be executed during the transfer and the process may be overtaken, and an unexpected malfunction may occur.

このように、仮想装置100が対象装置1000の仕様とは異なる動作をする場合、エミュレータの使用者等は、このような不都合が発生する都度、対処方法を検討し修正することになる。   As described above, when the virtual device 100 operates different from the specification of the target device 1000, the emulator user or the like examines and corrects the countermeasure whenever such inconvenience occurs.

上述した不都合を解消する手法として、図2に示すエミュレータを用いることも考えられる。このエミュレータは、図2に示すようにソフトウェア的に仮想装置200を構成(再現)することができる。   As a technique for solving the above-described inconvenience, an emulator shown in FIG. 2 may be used. The emulator can configure (reproduce) the virtual device 200 in software as shown in FIG.

仮想装置200は、基本的に図1に示す仮想装置100と同様の構成をそなえるが、図2に示すように、仮想装置100の構成に加えて、アービタ140及びセレクタ150をそなえる点が異なる。   The virtual device 200 basically has the same configuration as that of the virtual device 100 shown in FIG. 1, except that it includes an arbiter 140 and a selector 150 in addition to the configuration of the virtual device 100 as shown in FIG.

アービタ140は、ハードウェアの装置で用いられるアービタと同様に、仮想処理部間で仮想メモリ130へのメモリアクセスに対し調停(排他処理)を行ない、メモリアクセスを調整する。例えば、アービタ140は、入力される複数のリクエスト信号の送信元の仮想処理部について調停を行ない、選択した仮想処理部から完了信号を入力されるまで当該仮想処理部にメモリアクセスを行なわせる。   Similar to the arbiter used in the hardware device, the arbiter 140 adjusts memory access by arbitrating (exclusive processing) memory access to the virtual memory 130 between the virtual processing units. For example, the arbiter 140 performs arbitration for the virtual processing unit that is the source of a plurality of input request signals, and causes the virtual processing unit to perform memory access until a completion signal is input from the selected virtual processing unit.

セレクタ150は、アービタ140から入力される選択信号に応じた仮想処理部を選択し、仮想メモリ130へのアクセスを許可すべく入力側の切り替えを行なう。このとき、セレクタ150は、選択信号に応じた仮想処理部へ、選択されていることを示す信号(被セレクト信号)を出力することで、仮想処理部は自身が選択されていることを検出する。   The selector 150 selects a virtual processing unit corresponding to the selection signal input from the arbiter 140 and performs switching on the input side to permit access to the virtual memory 130. At this time, the selector 150 outputs a signal (selected signal) indicating that it is selected to the virtual processing unit corresponding to the selection signal, so that the virtual processing unit detects that it is selected. .

このように、仮想装置200では、全仮想処理部(仮想CPU110及び仮想デバイス120)による仮想メモリ130への全てのリード及びライトに対し、調停(排他処理)を行なうことになる。   As described above, in the virtual device 200, arbitration (exclusive processing) is performed on all reads and writes to the virtual memory 130 by all virtual processing units (the virtual CPU 110 and the virtual device 120).

しかし、図2に示す仮想装置200において、アービタ140及びセレクタ150を含む調停処理部分は、仮想デバイス120が増加するにつれ複雑化し、規模が大きくなるため、仮想装置200の処理速度の低下が発生し得る。例えば、CPUから見たプログラム領域は読出専用(Read Only)であり、実際には調停は不要であるが、仮想装置200では当該領域まで調停することになるため、不要な調停が発生して処理速度の低下を招くことになる。   However, in the virtual device 200 shown in FIG. 2, the arbitration processing portion including the arbiter 140 and the selector 150 becomes more complicated and the scale increases as the virtual device 120 increases, and the processing speed of the virtual device 200 decreases. obtain. For example, the program area viewed from the CPU is read-only, and no arbitration is actually required. However, since the virtual device 200 mediates up to the area, unnecessary arbitration occurs and processing is performed. The speed will be reduced.

以上のように、エミュレータにより対象装置1000を再現し調停処理部分を含む仮想装置200を構成すると、エミュレータ特有で起こる、仮想装置200(エミュレータひいてはコンピュータ)の動作速度の低下が生じ得る。   As described above, when the target device 1000 is reproduced by the emulator and the virtual device 200 including the arbitration processing portion is configured, the operation speed of the virtual device 200 (emulator, and thus the computer) may be lowered, which is peculiar to the emulator.

〔1−2〕エミュレーションサーバについて
上述した点に鑑み、本実施形態に係るエミュレーションサーバ1(図3参照)によれば、以下に詳述するように、仮想装置3(図5参照)がキュー処理部40をそなえる。このキュー処理部40は、複数の仮想処理部の各々から発行される仮想記憶部への書き込み要求を、処理される処理順に格納する。また、キュー処理部40は、仮想処理部から発行される仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が、格納する1以上の書き込み要求に係るアクセス範囲と重なるか否かを判定する。そして、キュー処理部40は、重ならない場合、読み出し要求に係るリード処理を実行する。
[1-2] Emulation Server In view of the above points, according to the emulation server 1 (see FIG. 3) according to the present embodiment, the virtual device 3 (see FIG. 5) performs queue processing as will be described in detail below. A part 40 is provided. The queue processing unit 40 stores a write request to the virtual storage unit issued from each of the plurality of virtual processing units in the order of processing. Further, the queue processing unit 40 determines whether the access range related to the read request overlaps the access range related to one or more write requests to be stored for the read request issued from the virtual processing unit to the virtual storage unit. judge. Then, when there is no overlap, the queue processing unit 40 executes a read process related to the read request.

上述のように、図2に示す仮想装置200では、書き込み要求及び読み出し要求のアクセス範囲が重ならない場合にもアービタ140による調停が画一的に行なわれ、処理速度の低下が生じ得る。   As described above, in the virtual device 200 shown in FIG. 2, even when the access ranges of the write request and the read request do not overlap, arbitration by the arbiter 140 is performed uniformly, and the processing speed may decrease.

これに対し、エミュレーションサーバ1によれば、各仮想処理部のメモリ調停(排他処理)を最小限に留め、単純化することができるため、速度低下を抑制でき、高速にエミュレートを行なうことができる。従って、対象装置1000を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することができる。   On the other hand, according to the emulation server 1, since the memory arbitration (exclusive processing) of each virtual processing unit can be minimized and simplified, the speed reduction can be suppressed and the emulation can be performed at high speed. it can. Accordingly, it is possible to suppress the performance degradation of the virtual model in the information processing apparatus that reproduces the target device 1000 using the virtual model.

〔1−3〕エミュレーションサーバの構成
以下、図3及び図4を参照しながら、本実施形態に係るエミュレーションサーバ1の構成について説明する。図3は、一実施形態に係るエミュレーションサーバ1の構成例を示す図であり、図4は、図3に示すエミュレーションサーバ1のハードウェア構成例を示す図である。
[1-3] Configuration of Emulation Server The configuration of the emulation server 1 according to this embodiment will be described below with reference to FIGS. 3 and 4. FIG. 3 is a diagram illustrating a configuration example of the emulation server 1 according to an embodiment, and FIG. 4 is a diagram illustrating a hardware configuration example of the emulation server 1 illustrated in FIG. 3.

エミュレーションサーバ1は、メモリ(対象記憶部)と当該メモリの記憶領域を共用する複数のデバイス及び1以上のCPU(複数の対象処理部)とをそなえるエミュレーション対象の対象装置1000を、仮想装置(仮想モデル)を用いてエミュレート(再現)する。エミュレーションサーバ1としては、例えばサーバやPC等の情報処理装置が挙げられる。   The emulation server 1 includes a target device 1000 to be emulated that includes a memory (target storage unit), a plurality of devices that share the storage area of the memory, and one or more CPUs (a plurality of target processing units). (Model) to emulate (reproduce). Examples of the emulation server 1 include information processing apparatuses such as servers and PCs.

図3及び図4に示すように、エミュレーションサーバ1は、CPU1a,メモリ1b,記憶部1c,インタフェース部1d,入出力部1e,記録媒体1f,及び読取部1gをそなえることができる。   As shown in FIGS. 3 and 4, the emulation server 1 can include a CPU 1a, a memory 1b, a storage unit 1c, an interface unit 1d, an input / output unit 1e, a recording medium 1f, and a reading unit 1g.

CPU1aは、種々の制御や演算を行なう演算処理装置(プロセッサ)の一例である。CPU1aは、対応する各ブロック1b〜1gと接続され、メモリ1b,記憶部1c,記録媒体1fや1h,又は図示しないROM(Read Only Memory)等に格納されたプログラムを実行することにより、種々の機能を実現することができる。例えばCPU1aは、メモリ1bに格納されたエミュレーションプログラム5(図3参照)を実行することにより、仮想装置3をエミュレートするエミュレータ2としての機能を実現することができる。   The CPU 1a is an example of an arithmetic processing device (processor) that performs various controls and arithmetic operations. The CPU 1a is connected to the corresponding blocks 1b to 1g, and executes various programs stored in a memory 1b, a storage unit 1c, a recording medium 1f or 1h, a ROM (Read Only Memory) (not shown), and the like. Function can be realized. For example, the CPU 1a can realize the function as the emulator 2 that emulates the virtual device 3 by executing the emulation program 5 (see FIG. 3) stored in the memory 1b.

メモリ1bは、種々のデータやプログラムを格納する記憶装置である。CPU1aは、プログラムを実行する際に、メモリ1bにデータやプログラムを格納し展開する。メモリ1bは、上記エミュレーションプログラム5を保存するほか、エミュレータ2によるエミュレーションで用いられるエミュレーション領域4を確保する。なお、メモリ1bとしては、例えばRAM等の揮発性メモリが挙げられる。記憶部1cは、種々のデータやプログラム等を格納するハードウェアである。記憶部1cとしては、例えばHDD等の磁気ディスク装置,SSD(Solid State Drive)等の半導体ドライブ装置,フラッシュメモリ等の不揮発性メモリ等の各種装置が挙げられる。   The memory 1b is a storage device that stores various data and programs. When executing the program, the CPU 1a stores and develops data and programs in the memory 1b. The memory 1b stores the emulation program 5 and secures an emulation area 4 used for emulation by the emulator 2. As the memory 1b, for example, a volatile memory such as a RAM can be cited. The storage unit 1c is hardware that stores various data, programs, and the like. Examples of the storage unit 1c include various devices such as a magnetic disk device such as an HDD, a semiconductor drive device such as an SSD (Solid State Drive), and a nonvolatile memory such as a flash memory.

インタフェース部1dは、有線又は無線による、ネットワーク(図示省略)や他の情報処理装置との間の接続及び通信の制御等を行なうものである。インタフェース部1dとしては、例えば、LAN(Local Area Network),ファイバチャネル(Fibre Channel;FC),インフィニバンド(InfiniBand)等に準拠したアダプタが挙げられる。入出力部1eは、マウスやキーボード等の入力装置及びディスプレイやプリンタ等の出力装置の少なくとも一方を含むことができる。例えば、入力装置は使用者等によるエミュレーションサーバ1(仮想装置3)の条件やデータの入力等の作業に用いられ、出力装置はエミュレーションサーバ1(仮想装置3)による動作状態や処理結果等の出力に用いられる。   The interface unit 1d performs connection and communication control with a network (not shown) or another information processing apparatus by wire or wireless. Examples of the interface unit 1d include an adapter compliant with LAN (Local Area Network), Fiber Channel (FC), InfiniBand, and the like. The input / output unit 1e can include at least one of an input device such as a mouse and a keyboard and an output device such as a display and a printer. For example, the input device is used for operations such as conditions of the emulation server 1 (virtual device 3) and data input by a user or the like, and the output device outputs an operation state, processing result, etc. by the emulation server 1 (virtual device 3). Used for.

記録媒体1fは、例えばフラッシュメモリやROM等の記憶装置であり、種々のデータやプログラムを記録することができる。読取部1gは、コンピュータ読取可能な記録媒体1hに記録されたデータやプログラムを読み出す装置である。記録媒体1f及び1hの少なくとも一方には、本実施形態に係るエミュレーションサーバ1の各種機能の全部もしくは一部を実現するエミュレーションプログラム5が格納されてもよい。例えば、CPU1aは、記録媒体1fから読み出したプログラム、又は、読取部1gを介して記録媒体1hから読み出したプログラムを、メモリ1b等の記憶装置に展開して実行してもよい。   The recording medium 1f is a storage device such as a flash memory or a ROM, and can record various data and programs. The reading unit 1g is a device that reads data and programs recorded on a computer-readable recording medium 1h. At least one of the recording media 1f and 1h may store an emulation program 5 that realizes all or some of the various functions of the emulation server 1 according to the present embodiment. For example, the CPU 1a may develop and execute the program read from the recording medium 1f or the program read from the recording medium 1h via the reading unit 1g in a storage device such as the memory 1b.

なお、記録媒体1hとしては、例えばフレキシブルディスク、CD(Compact Disc)、DVD(Digital Versatile Disc)、ブルーレイディスク等の光ディスクや、USB(Universal Serial Bus)メモリやSDカード等のフラッシュメモリが挙げられる。なお、CDとしては、CD−ROM、CD−R(CD-Recordable)、CD−RW(CD-Rewritable)等が挙げられる。また、DVDとしては、DVD−ROM、DVD−RAM、DVD−R、DVD−RW、DVD+R、DVD+RW等が挙げられる。   Examples of the recording medium 1h include optical disks such as a flexible disk, CD (Compact Disc), DVD (Digital Versatile Disc), and Blu-ray disc, and flash memories such as a USB (Universal Serial Bus) memory and an SD card. Examples of the CD include CD-ROM, CD-R (CD-Recordable), and CD-RW (CD-Rewritable). Examples of DVD include DVD-ROM, DVD-RAM, DVD-R, DVD-RW, DVD + R, DVD + RW, and the like.

上述した各ブロック1a〜1g間はバスで相互に通信可能に接続される。また、エミュレーションサーバ1の上述したハードウェア構成は例示である。従って、エミュレーションサーバ1内でのハードウェアの増減(例えば任意のブロックの追加や省略),分割,任意の組み合わせでの統合,バスの追加又は省略等は適宜行なわれてもよい。   The blocks 1a to 1g described above are connected to be communicable with each other via a bus. The above-described hardware configuration of the emulation server 1 is an example. Therefore, hardware increase / decrease in the emulation server 1 (for example, addition or omission of arbitrary blocks), division, integration in an arbitrary combination, addition or omission of buses, etc. may be appropriately performed.

〔1−4〕エミュレータの構成
次に、図5〜図19を参照しながら、本実施形態に係るエミュレーションサーバ1の構成について説明する。図5は、一実施形態に係るエミュレータ2により再現される仮想装置3の構成例を示す図であり、図6は、図5に示すキュー処理部40の動作例を説明する図である。
[1-4] Configuration of Emulator Next, the configuration of the emulation server 1 according to the present embodiment will be described with reference to FIGS. FIG. 5 is a diagram illustrating a configuration example of the virtual device 3 reproduced by the emulator 2 according to the embodiment, and FIG. 6 is a diagram illustrating an operation example of the queue processing unit 40 illustrated in FIG.

仮想装置3は、エミュレーションの対象装置1000を再現したものである。仮想装置3は、図5に示すように、1以上(例えば1つ)の仮想(疑似)CPU10,複数(例えば3つ)の仮想(疑似)デバイス20−1〜20−3,仮想メモリ30,及びキュー処理部40をそなえる。   The virtual device 3 is a reproduction of the target device 1000 for emulation. As shown in FIG. 5, the virtual device 3 includes one or more (for example, one) virtual (pseudo) CPUs 10, a plurality (for example, three) of virtual (pseudo) devices 20-1 to 20-3, a virtual memory 30, And a queue processing unit 40.

仮想CPU10は、実際のプログラム(FW)を実行する仮想的なCPUである。仮想デバイス20−1〜20−3(以下の説明において仮想デバイス20−1〜20−3を区別しない場合には単に仮想デバイス20という)は、対象装置1000(仮想装置3)内部の各デバイスの動作を疑似的に再現する仮想的なデバイスである。仮想CPU10及び仮想デバイス20は、対象装置1000に実装されるCPU及びデバイスと同様の機能や性能を持つように設定され、エミュレーションサーバ1のCPU1aのリソースを用いて実現される。   The virtual CPU 10 is a virtual CPU that executes an actual program (FW). Virtual devices 20-1 to 20-3 (in the following description, when virtual devices 20-1 to 20-3 are not distinguished, they are simply referred to as virtual devices 20) are the devices in the target device 1000 (virtual device 3). It is a virtual device that simulates the operation. The virtual CPU 10 and the virtual device 20 are set so as to have the same functions and performance as the CPU and device mounted on the target apparatus 1000, and are realized using the resources of the CPU 1a of the emulation server 1.

仮想メモリ30は、エミュレーションサーバ1のメモリ1bのリソース(例えばエミュレーション領域4(図3参照))を用いて実現される仮想的なメモリである。仮想CPU10及び仮想デバイス20は、仮想メモリ30に対してアクセス、つまりデータの読み出しや書き込みを行なうことができる。このように、仮想CPU10及び仮想デバイス20は、仮想メモリ30の記憶領域を共用する複数の仮想処理部の一例である。なお、これら複数の仮想処理部は対象装置1000がそなえる複数の対象処理部に対応するものである。   The virtual memory 30 is a virtual memory that is realized by using resources of the memory 1b of the emulation server 1 (for example, the emulation area 4 (see FIG. 3)). The virtual CPU 10 and the virtual device 20 can access the virtual memory 30, that is, read and write data. Thus, the virtual CPU 10 and the virtual device 20 are an example of a plurality of virtual processing units that share the storage area of the virtual memory 30. Note that the plurality of virtual processing units correspond to the plurality of target processing units provided in the target device 1000.

キュー処理部40は、各仮想CPU10及び仮想デバイス20から仮想メモリ30へのリード/ライトアクセスを制御するものであり、リード/ライトアクセスはキュー処理部40を経由して処理が行なわれる。   The queue processing unit 40 controls read / write access from each virtual CPU 10 and virtual device 20 to the virtual memory 30, and the read / write access is processed via the queue processing unit 40.

キュー処理部40は、例示的に、キュー格納部41,キュー制御部42,読出判定部43,及びアクセス制御部44をそなえる。   The queue processing unit 40 includes, for example, a queue storage unit 41, a queue control unit 42, a read determination unit 43, and an access control unit 44.

キュー格納部41は、仮想CPU10及び複数の仮想デバイス20の各々から発行された書き込み要求及び読み出し要求を、処理される処理順(例えば発行順)に格納(キューイング)する。キュー格納部41は、例えばCPU1aの図示しないキャッシュメモリの一部やメモリ1bの一部(例えばエミュレーション領域4)等の記憶領域により実現される。   The queue storage unit 41 stores (queues) write requests and read requests issued from each of the virtual CPU 10 and the plurality of virtual devices 20 in the processing order (for example, issue order) to be processed. The queue storage unit 41 is realized by a storage area such as a part of a cache memory (not shown) of the CPU 1a or a part of the memory 1b (for example, the emulation area 4).

キュー格納部41は、例えば図6に示すように、キュー41a及びメッセージキュー41bを複数格納することができる。キュー41aは仮想メモリ30にアクセスするアドレス(先頭アドレス)(addr),データサイズ(size),及びリード/ライトのいずれかを示すR/Wフラグ(R_FLG)を含む管理用(制御用)の情報を保持する。また、このキュー41aは、図7に示すように前後のキュー41aの書き込みポインタ(write pointer)を示すBefore_wp及びNext_wpをさらに含む。メッセージキュー41bは書き込み要求のライトデータ(W_data)を保持する。   The queue storage unit 41 can store a plurality of queues 41a and message queues 41b as shown in FIG. 6, for example. The queue 41a is management (control) information including an R / W flag (R_FLG) indicating any of an address (start address) (addr), a data size (size), and a read / write for accessing the virtual memory 30. Hold. Further, as shown in FIG. 7, the queue 41a further includes Before_wp and Next_wp indicating write pointers of the preceding and succeeding queues 41a. The message queue 41b holds write data (W_data) for a write request.

キュー制御部42は、キュー格納部41(キュー41a及びメッセージキュー41b)へのアクセス要求の登録,削除,更新等の管理(キューイング)を行なうものであり、アクセス要求をキュー格納部41に登録するQueue登録関数の一例である。   The queue control unit 42 manages (queuing) registration, deletion, update, and the like of access requests to the queue storage unit 41 (queue 41a and message queue 41b), and registers access requests in the queue storage unit 41. It is an example of a queue registration function.

ここで、仮想CPU10及び複数の仮想デバイス20は、共通するフォーマットを用いて書き込み要求及び読み出し要求を発行することができる。一例として、書き込み要求はキュー処理部40のWrite関数を呼び出す(call)ための以下のフォーマット(メッセージ)とし、読み出し要求はキュー処理部40のRead関数を呼び出すための以下のフォーマット(メッセージ)とすることができる。
・ライト:アドレス(W_addr),データサイズ(W_size),ライトデータ(W_data)
・リード:アドレス(R_addr),データサイズ(R_size),データ格納用ポインタ
Here, the virtual CPU 10 and the plurality of virtual devices 20 can issue a write request and a read request using a common format. As an example, the write request has the following format (message) for calling the call function of the queue processing unit 40 (call), and the read request has the following format (message) for calling the read function of the queue processing unit 40. be able to.
Write: address (W_addr), data size (W_size), write data (W_data)
Read: Address (R_addr), data size (R_size), data storage pointer

例えば、キュー制御部42は、仮想CPU10及び複数の仮想デバイス20の各々から書き込み要求を入力されると、ライトアドレス(W_addr),ライトのデータサイズ(Byte)(W_size)を管理用のキュー41aに登録する。このとき、キュー制御部42はキュー41aにライトフラグ(例えばR_FLG(リードフラグ) = 0)を設定する。また、キュー制御部42は、ライトデータ(W_data)をライトデータ用のメッセージキュー41bに格納する。   For example, when a write request is input from each of the virtual CPU 10 and the plurality of virtual devices 20, the queue control unit 42 stores the write address (W_addr) and the write data size (Byte) (W_size) in the management queue 41a. sign up. At this time, the queue control unit 42 sets a write flag (for example, R_FLG (read flag) = 0) in the queue 41a. Further, the queue control unit 42 stores the write data (W_data) in the message queue 41b for write data.

ここで、キュー制御部42によるキューイング(追加及び削除)の動作例を、図7及び図8を参照して説明する。   Here, an operation example of queuing (addition and deletion) by the queue control unit 42 will be described with reference to FIGS.

はじめに、図7において、キュー格納部41に先頭のリクエスト(Que_REQ0)のみが登録されている(Que_WP(キュー41aからの読み出しポインタ) = Que_REQ0)場合のキューイング(追加)例を説明する。この場合、次のアクセス要求が入力されると、キュー制御部42は、Que_REQ0のNext_wpに次のアクセスによって獲得されたポインタ(キュー41aのアドレス(addr))であるQue_REQ1のポインタを登録する。また、キュー制御部42は、Que_REQ1のBefore_wpに直前のアクセスのポインタであるQue_REQ0のポインタを登録する。そして、さらに次のアクセス要求が入力されると、キュー制御部42は、Que_REQ1のNext_wpに次のアクセスによって獲得されたポインタであるQue_REQ2のポインタを登録し、Que_REQ2のBefore_wpに直前のアクセスのポインタであるQue_REQ1のポインタを登録する。   First, referring to FIG. 7, an example of queuing (addition) when only the first request (Que_REQ0) is registered in the queue storage unit 41 (Que_WP (read pointer from the queue 41a) = Que_REQ0) will be described. In this case, when the next access request is input, the queue control unit 42 registers the pointer of Que_REQ1, which is the pointer (address (addr) of the queue 41a) acquired by the next access, in Next_wp of Que_REQ0. Further, the queue control unit 42 registers the pointer of Que_REQ0 that is the pointer of the previous access in Before_wp of Que_REQ1. When the next access request is further input, the queue control unit 42 registers the pointer of Que_REQ2, which is the pointer acquired by the next access, in Next_wp of Que_REQ1, and uses the pointer of the previous access in Before_wp of Que_REQ2. Register a Que_REQ1 pointer.

次に、図8において、キュー格納部41にQue_REQ0〜Que_REQ2が登録されており、読み出しポインタがQue_REQ1である場合のキューイング(Que_REQ0の削除)例を説明する。この場合、キュー制御部42は、Que_REQ0に係るアクセス要求(情報)を削除し(freeとし)、Before_wpにQue_REQ0のポインタを設定されたQue_REQ1について、直前の情報が削除されたためBefore_wpに“0”を設定する(Que_WP -> Before_wp = 0)。なお、読み出しポインタが示すアクセス要求に次のエントリ(Next_wp)が無い場合、Que_WP -> Before_wp= 0且つQue_WP -> Next_wp = 0の状態であるアクセス要求が先頭になる。   Next, an example of queuing (deleting Que_REQ0) when Que_REQ0 to Que_REQ2 are registered in the queue storage unit 41 and the read pointer is Que_REQ1 will be described with reference to FIG. In this case, the queue control unit 42 deletes the access request (information) relating to Que_REQ0 (free), and sets “0” to Before_wp because the previous information is deleted for Que_REQ1 in which the Que_REQ0 pointer is set in Before_wp. Set (Que_WP-> Before_wp = 0). If there is no next entry (Next_wp) in the access request indicated by the read pointer, the access request in the state of Que_WP-> Before_wp = 0 and Que_WP-> Next_wp = 0 is the first.

なお、キュー制御部42による読み出し要求のキュー格納部41への登録処理については、キュー格納部41への格納判断を読出判定部43が行なうため、後述する。   Note that the registration process of the read request to the queue storage unit 41 by the queue control unit 42 will be described later because the read determination unit 43 makes a storage determination in the queue storage unit 41.

読出判定部43は、仮想CPU10及び複数の仮想デバイス20の各々から読み出し要求を入力されると、当該読み出し要求をキュー格納部41に格納するか否かを判定し、判定結果に応じたリード処理を行なう。読出判定部43は、リード処理を行なうRead関数の一例である。   When a read request is input from each of the virtual CPU 10 and the plurality of virtual devices 20, the read determination unit 43 determines whether to store the read request in the queue storage unit 41, and read processing according to the determination result To do. The read determination unit 43 is an example of a Read function that performs read processing.

例えば、読出判定部43は、入力された読み出し要求で指示された仮想メモリ30のアドレス(R_addr)及びリードデータサイズ(R_size)から得られるエリアと、管理用のキュー41aに格納されているライトデータのエリアとが重なっているか否かを判定する。一例として、読出判定部43は、以下の判定を行ない、いずれかの条件を満たす場合に、読み出し要求のアクセス範囲がキュー格納部41内のライトデータのアクセス範囲と重なっている(Hitする)と判定する。
・(W_addr>= R_addr) && (W_addr<= R_addr + R_size)
(読み出し要求のアクセス範囲内に書き込み要求の先頭アドレスが含まれるか否か)
・(R_addr>= W_addr) && (R_addr<= W_addr + W_size)
(書き込み要求のアクセス範囲内に読み出し要求の先頭アドレスが含まれるか否か)
For example, the read determining unit 43 writes the area obtained from the address (R_addr) and read data size (R_size) of the virtual memory 30 instructed by the input read request, and the write data stored in the management queue 41a. It is determined whether or not the area overlaps. As an example, the read determination unit 43 performs the following determination, and when one of the conditions is satisfied, the access range of the read request overlaps with the access range of the write data in the queue storage unit 41 (it hits). judge.
・ (W_addr> = R_addr) && (W_addr <= R_addr + R_size)
(Whether or not the start address of the write request is included within the access range of the read request)
・ (R_addr> = W_addr) && (R_addr <= W_addr + W_size)
(Whether or not the read request start address is included in the access range of the write request)

このとき、読出判定部43は、キュー格納部41内のキュー41aから、書き込み要求のエントリつまりR_FLGが“0”であるエントリ(リクエスト)のアドレス(addr)及びサイズ(size)を、それぞれW_addr及びW_sizeとして取得する。   At this time, the read determination unit 43 obtains the address (addr) and the size (size) of the entry (request) for which the write request entry, that is, R_FLG is “0”, from the queue 41a in the queue storage unit 41, respectively. Get as W_size.

なお、読出判定部43は、キュー格納部41の格納する一以上のアクセス要求(書き込み要求)について、格納順序(処理順序)とは逆の順序、つまり最後尾のアクセス要求からBefore_wpを辿る順序で、読み出し要求のアクセス範囲と重なるか否かを判定することが好ましい。これにより、読み出し要求のアクセス範囲と重なる書き込み要求がキュー格納部41内に複数存在する場合でも、リード処理に影響を与える(最後にライト処理が行なわれる)書き込み要求を確実に特定することができる。従って、リード/ライトのアクセス競合が発生した場合でも、仮想メモリ30のデータの整合性を保つことができる。   Note that the read determination unit 43 has the one or more access requests (write requests) stored in the queue storage unit 41 in the reverse order of the storage order (processing order), that is, the order in which Before_wp is traced from the last access request. It is preferable to determine whether or not it overlaps the access range of the read request. Thus, even when there are a plurality of write requests in the queue storage unit 41 that overlap with the access range of the read request, the write request that affects the read process (the write process is performed last) can be reliably identified. . Therefore, even when a read / write access conflict occurs, the data consistency of the virtual memory 30 can be maintained.

次いで、読出判定部43は、判定の結果、重なっていない(Hitしていない)場合、読み出し要求で要求されたデータを、仮想メモリ30のアドレス(R_addr)からリードデータサイズ(R_size)分読み出し、Read関数の戻り値とする。この戻り値は、読み出し要求への応答として、要求元の仮想CPU10又は仮想デバイス20の読み出し要求で指定されたデータ格納用ポインタに格納(送信)される。なお、読出判定部43は、仮想メモリ30からのデータの読み出しを、例えばmemcpyコマンドを用いて、仮想メモリ30空間から要求元の仮想CPU10又は仮想デバイス20へのダイレクトコピーを実施することにより行なってもよい。   Next, if the result of the determination is that there is no overlap (no hit), the read determination unit 43 reads the data requested by the read request from the address (R_addr) of the virtual memory 30 by the read data size (R_size), This is the return value of the Read function. This return value is stored (transmitted) as a response to the read request in the data storage pointer designated by the read request of the requesting virtual CPU 10 or virtual device 20. The read determination unit 43 reads data from the virtual memory 30 by performing a direct copy from the virtual memory 30 space to the requesting virtual CPU 10 or virtual device 20 using, for example, a memcpy command. Also good.

なお、アクセス範囲が重なっていない場合の仮想メモリ30からのリード処理は、アクセス競合が生じないため、後述するアクセス制御部44による仮想メモリ30へのライト処理と並行して行なうことができる。   Note that the read processing from the virtual memory 30 when the access ranges do not overlap does not cause access contention, and therefore can be performed in parallel with the write processing to the virtual memory 30 by the access control unit 44 described later.

一方、読出判定部43は、判定の結果、重なっている(Hitする)場合、読み出し要求をキュー格納部41内の管理用のキュー41aに登録する。例えば読出判定部43は、入力された読み出し要求に係るリードアドレス(R_addr)及びリードデータサイズ(Byte)(R_size)を管理用のキュー41aに登録すべく、キュー制御部42に渡す。   On the other hand, the read determination unit 43 registers the read request in the management queue 41a in the queue storage unit 41 when the determination results in overlapping (hit). For example, the read determination unit 43 passes the read address (R_addr) and read data size (Byte) (R_size) relating to the input read request to the queue control unit 42 so as to register them in the management queue 41a.

このとき、読出判定部43は、読み出し要求の処理順が読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように、アクセス範囲が重なると判定した書き込み要求のポインタをキュー制御部42に通知することができる。   At this time, the read determination unit 43 notifies the queue control unit 42 of the pointer of the write request determined that the access range overlaps so that the processing order of the read request is immediately after the write request that overlaps the read request and the access range. be able to.

次いで、読出判定部43は、キュー格納部41に登録した読み出し要求のエントリの登録ポインタ(アドレス,QueueBuffポインタ)を戻り値としてキュー制御部42から受け取り、読み出し要求に係るリード処理を待機する。読出判定部43は、キュー格納部41からアクセス制御部44によりデータ(addr,size)が読み出された際の、キュー41aのポインタをチェックする。そして、読出判定部43は、待機しているリード処理が、読み出されたキュー41aのポインタにヒットしたことを契機に、待機を解除してリード処理を実行する。なお、リード処理は、既述のように読出判定部43により仮想メモリ30からリードデータが読み出され、Read関数の戻り値として要求元に返される。   Next, the read determination unit 43 receives the registration pointer (address, QueueBuff pointer) of the entry of the read request registered in the queue storage unit 41 as a return value from the queue control unit 42, and waits for a read process related to the read request. The read determination unit 43 checks the pointer of the queue 41 a when data (addr, size) is read from the queue storage unit 41 by the access control unit 44. Then, the read determination unit 43 releases the standby and executes the read process when the read process waiting is hit with the pointer of the read queue 41a. In the read process, as described above, the read determination unit 43 reads the read data from the virtual memory 30 and returns it to the request source as a return value of the Read function.

なお、アクセス範囲が重なっている場合、仮想メモリ30からのリード処理においてアクセス競合が生じる可能性があるため、リード処理中はアクセス制御部44による仮想メモリ30へのライト処理が抑止される。例えば読出判定部43は、キュー制御部42からの戻り値の登録ポインタについて、リード処理実行中を示すフラグ(R_EXEC)を有効にし、R_EXECが有効の間、アクセス制御部44によるライト処理を待機させることができる。   If the access ranges overlap, there may be an access conflict in the read process from the virtual memory 30, and therefore the write process to the virtual memory 30 by the access control unit 44 is suppressed during the read process. For example, the read determination unit 43 enables the flag (R_EXEC) indicating that the read process is being executed for the registration pointer of the return value from the queue control unit 42, and waits for the write process by the access control unit 44 while R_EXEC is valid. be able to.

読出判定部43による処理の詳細及び動作例については、図15,図16,図18,及び図19を参照しながら後述する。   Details of processing performed by the read determination unit 43 and an operation example will be described later with reference to FIGS. 15, 16, 18, and 19.

ここで、キュー制御部42の説明に戻る。キュー制御部42は、上述のように読出判定部43において読み出し要求のアクセス範囲がキュー格納部41内の書き込み要求のアクセス範囲と重なると判定されると、読み出し要求をキュー格納部41に格納する。これにより、仮想メモリ30の重複するエリアへのライト処理が完了してからリード処理が実行されるため、リードデータの整合性を保つことができる。   Here, the description returns to the queue control unit 42. When the read determination unit 43 determines that the access range of the read request overlaps the access range of the write request in the queue storage unit 41 as described above, the queue control unit 42 stores the read request in the queue storage unit 41. . As a result, the read process is executed after the write process to the overlapping area of the virtual memory 30 is completed, so that the consistency of the read data can be maintained.

例えば、キュー制御部42は、読出判定部43から渡されるリードアドレス(R_addr)及びリードデータサイズ(Byte)(R_size)と、リードフラグ(例えばR_FLG(リードフラグ) = 1)とを管理用のキュー41aに登録する。このとき、キュー制御部42は、読出判定部43から読み出し要求に係るデータとともにキュー41aのポインタを通知されると、通知されたポインタのアクセス要求とその次のアクセス要求との間に、読み出し要求に係るエントリ(リクエスト)を挿入することができる。   For example, the queue control unit 42 uses the read address (R_addr) and the read data size (Byte) (R_size) passed from the read determination unit 43 and the read flag (for example, R_FLG (read flag) = 1) as a management queue. 41a is registered. At this time, when the queue control unit 42 is notified of the pointer of the queue 41a together with the data related to the read request from the read determination unit 43, the read request is issued between the notified pointer access request and the next access request. An entry (request) related to can be inserted.

以下、キュー制御部42によるキュー格納部41(キュー41a)への読み出し要求の挿入動作例を、図9及び図10を参照して説明する。   Hereinafter, an example of an operation of inserting a read request into the queue storage unit 41 (queue 41a) by the queue control unit 42 will be described with reference to FIGS.

図9において、リードのリクエスト(Que_REQ3)のアクセス要求が、キュー格納部41内のキュー41aにおけるQue_REQ1のアクセス範囲にHitしている場合の、Que_REQ3のアクセス要求の挿入例を説明する。なお、キュー制御部42は、読出判定部43からQue_REQ1のポインタを通知されているものとする。この場合、例えばキュー制御部42は、図10に示すように、Que_REQ1とその次のQue_REQ2との間に読み出し要求に係るQue_REQ3を挿入する。   9, an example of inserting an access request for Que_REQ3 when the access request for the read request (Que_REQ3) is hit in the access range of Que_REQ1 in the queue 41a in the queue storage unit 41 will be described. It is assumed that the queue control unit 42 has been notified of the Que_REQ1 pointer from the read determination unit 43. In this case, for example, as illustrated in FIG. 10, the queue control unit 42 inserts Que_REQ3 related to the read request between Que_REQ1 and the next Que_REQ2.

具体的には、キュー制御部42は、HitしたQue_REQ1のNext_wpに読み出し要求に係るQue_REQ3のポインタを登録する。また、キュー制御部42は、Que_REQ3のBefore_wpにHitしたQue_REQ1のポインタを登録し、Que_REQ3のNext_wpにQue_REQ1の直後(Que_REQ1のNext_wpに登録されていた)Que_REQ2のポインタを登録する。さらに、キュー制御部42は、Que_REQ2のBefore_wpに読み出し要求に係るQue_REQ3のポインタを登録する。   Specifically, the queue control unit 42 registers the pointer of Que_REQ3 related to the read request in Next_wp of the hit Que_REQ1. Further, the queue control unit 42 registers the pointer of Que_REQ1 hit in Before_wp of Que_REQ3, and registers the pointer of Que_REQ2 immediately after Que_REQ1 (registered in Next_wp of Que_REQ1) in Next_wp of Que_REQ3. Further, the queue control unit 42 registers the pointer of Que_REQ3 related to the read request in Before_wp of Que_REQ2.

このように、キュー制御部42は、アクセス範囲が重なると判定された書き込み要求の直後に読み出し要求を格納(挿入)することで、リード処理の待機時間を最小限に留めることができ、リード処理の高速化を図ることができる。   As described above, the queue control unit 42 can store (insert) the read request immediately after the write request determined to have overlapping access ranges, thereby minimizing the waiting time for the read process. Can be speeded up.

キュー制御部42による処理の詳細及び動作例については、図13及び図14を参照しながら後述する。   Details of processing performed by the queue control unit 42 and an operation example will be described later with reference to FIGS. 13 and 14.

以上のように、キュー制御部42及び読出判定部43は、読み出し要求について、当該読み出し要求に係るアクセス範囲がキュー格納部41の格納する1以上の書き込み要求に係るアクセス範囲と重なるか否かを判定する読出制御部の一例であるといえる。具体的には、この読出制御部は、判定の結果、重ならない場合、読み出し要求に係る読み出し処理を実行するのである。   As described above, for the read request, the queue control unit 42 and the read determination unit 43 determine whether or not the access range related to the read request overlaps the access range related to one or more write requests stored in the queue storage unit 41. It can be said that this is an example of a read control unit for determination. Specifically, this read control unit executes a read process related to a read request when the determination results in no overlap.

このように、一実施形態に係るエミュレーションサーバ1によれば、キュー格納部41に読み出し要求のエリアにHitする書き込み要求が無い場合、読み出し要求をキュー格納部41に格納せずにリード処理を行なうことができる。従って、リード処理の高速化を図ることができ、仮想装置3の性能低下を抑制することができる。   As described above, according to the emulation server 1 according to the embodiment, when there is no write request to hit in the read request area in the queue storage unit 41, the read process is performed without storing the read request in the queue storage unit 41. be able to. Accordingly, it is possible to increase the speed of the read process and suppress the performance degradation of the virtual device 3.

なお、キュー格納部41への読み出し要求の挿入位置の判断は、読出判定部43が行なってもよいしキュー制御部42が行なってもよい。   Note that the determination of the insertion position of the read request to the queue storage unit 41 may be performed by the read determination unit 43 or the queue control unit 42.

アクセス制御部44は、キュー格納部41に格納されたキューについて、処理順(例えばアクセス要求の発行順)にキュー41a及びメッセージキュー41b(W_addr,W_size,W_data)から情報を読み出しライト処理を実行する。例えば、アクセス制御部44は、キュー格納部41から先頭のエントリ(アクセス要求)を読み出し、ライトフラグが有効(例えばR_FLG(リードフラグ) = 0)である場合、先頭のメッセージキュー41bを読み出す。そして、アクセス制御部44は、メッセージキュー41b内のライトデータサイズ(W_size)分のライトデータを仮想メモリ30のアドレス(W_addr)に転送する。   The access control unit 44 reads information from the queue 41a and the message queue 41b (W_addr, W_size, W_data) in the processing order (for example, the order in which the access requests are issued) for the queue stored in the queue storage unit 41, and executes the write process. . For example, the access control unit 44 reads the head entry (access request) from the queue storage unit 41, and reads the head message queue 41b when the write flag is valid (for example, R_FLG (read flag) = 0). Then, the access control unit 44 transfers write data for the write data size (W_size) in the message queue 41b to the address (W_addr) of the virtual memory 30.

このように、アクセス制御部44は、キュー格納部41の格納順に書き込み要求を読み出し、ライト処理を行なうことで、1つのライト処理が完了しない限り、他のスレッド(Thread)が仮想メモリ30にアクセスできないように排他制御することができる。なお、仮想CPU10や仮想デバイス20から書き込み要求の送信によって呼び出されるWrite関数は、キュー格納部41へ書き込むだけの突き放し型である。従って、読み出し完了(return)を待つRead関数とは異なり、書き込み要求がキュー格納部41にキューイングされても、仮想装置3の性能(動作速度)の低下には影響を与えない。   In this way, the access control unit 44 reads out the write requests in the order in which they are stored in the queue storage unit 41 and performs the write process so that another thread (Thread) accesses the virtual memory 30 unless one write process is completed. Exclusive control is possible so that it cannot be done. Note that the Write function called by sending a write request from the virtual CPU 10 or the virtual device 20 is a push-out type that only writes to the queue storage unit 41. Therefore, unlike a Read function that waits for a read completion (return), even if a write request is queued in the queue storage unit 41, the performance (operation speed) of the virtual device 3 is not affected.

なお、キュー格納部41から読み出された情報については、例えばキュー格納部41又はアクセス制御部44によりキュー41a及びメッセージキュー41bから削除される。或いは、メッセージキュー41b内のライトアドレスについては、キュー格納部41から読み出されたデータがメッセージキュー41bから自動で削除されるようにしてもよい。   Information read from the queue storage unit 41 is deleted from the queue 41a and the message queue 41b by the queue storage unit 41 or the access control unit 44, for example. Alternatively, for the write address in the message queue 41b, the data read from the queue storage unit 41 may be automatically deleted from the message queue 41b.

また、キュー格納部41のキュー41aにアクセス要求が格納されていない状態で、リード処理実行中の読み出し要求がある場合、リード処理のアクセス範囲と重なる書き込み要求が入力されると、キュー制御部42により、当該書き込み要求はキュー41aに格納される。この場合においても、この書き込み要求はアクセス制御部44により読み出されライト処理が実行される。しかし、ライト処理の実行の際に、書き込み要求に係るアクセス範囲がリード処理実行中のアクセス範囲にHitした場合は、アクセス制御部44は、リード処理の完了後にライト処理を実行する。   Further, when there is no access request stored in the queue 41a of the queue storage unit 41 and there is a read request during execution of read processing, if a write request that overlaps the read processing access range is input, the queue control unit 42 Thus, the write request is stored in the queue 41a. Even in this case, the write request is read by the access control unit 44 and the write process is executed. However, when executing the write process, if the access range related to the write request hits the access range during the read process, the access control unit 44 executes the write process after the read process is completed.

さらに、アクセス制御部44は、キュー41aから読み出した要求が読み出し要求である場合、当該読み出し要求に係るリード処理を実行させるため、キュー41aのポインタを読出判定部43に渡す。   Further, when the request read from the queue 41 a is a read request, the access control unit 44 passes the pointer of the queue 41 a to the read determination unit 43 in order to execute a read process related to the read request.

以上のように、キュー制御部42及びアクセス制御部44は、キュー格納部41の格納する1以上の要求(書き込み要求/読み出し要求)を処理順に読み出し所定の処理を実行する実行部の一例であるといえる。具体的には、この実行部は、キュー格納部41から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なると判断した場合、当該読み出し処理が完了するまで当該書き込み要求に対する所定の処理の実行を待機するのである。   As described above, the queue control unit 42 and the access control unit 44 are an example of an execution unit that reads one or more requests (write request / read request) stored in the queue storage unit 41 in the processing order and executes a predetermined process. It can be said. Specifically, when the execution unit determines that the access range related to the write request read from the queue storage unit 41 overlaps the access range related to the read request during the execution of the read process, the execution unit completes the read process. It waits for execution of a predetermined process in response to the write request.

このように、キュー制御部42及びアクセス制御部44によれば、リード処理の完了後にキュー格納部41から読み出したライト処理が実行されるため、リード/ライトの排他処理を適切に行なうことができる。従って、仮想メモリ30におけるリード/ライトデータの整合性を保つことができる。   As described above, according to the queue control unit 42 and the access control unit 44, the write process read from the queue storage unit 41 is executed after the completion of the read process. Therefore, the read / write exclusive process can be appropriately performed. . Therefore, the consistency of read / write data in the virtual memory 30 can be maintained.

アクセス制御部44による処理の詳細及び動作例については、図17,図18を参照しながら後述する。   Details of processing performed by the access control unit 44 and an operation example will be described later with reference to FIGS. 17 and 18.

〔1−5〕エミュレーションサーバの動作例
次に、上述の如く構成されたエミュレーションサーバ1の動作例を、図11〜図19を参照して説明する。
[1-5] Operation Example of Emulation Server Next, an operation example of the emulation server 1 configured as described above will be described with reference to FIGS.

はじめに、図11及び図12に示すシーケンス図を参照して、エミュレーションサーバ1によるエミュレータ2(仮想装置3)の全体の動作例について説明する。なお、前提として、キュー格納部41にはアクセス要求が存在しない(実行待ちのアクセス要求が無い)場合を想定する。   First, an overall operation example of the emulator 2 (virtual device 3) by the emulation server 1 will be described with reference to sequence diagrams shown in FIGS. As a premise, it is assumed that there is no access request in the queue storage unit 41 (no access request waiting for execution).

まず、図11に示すように、仮想デバイス20によるライトアクセスと同じ範囲に対して仮想CPU10がリードアクセスを行なった場合を説明する。   First, as shown in FIG. 11, a case where the virtual CPU 10 performs a read access to the same range as the write access by the virtual device 20 will be described.

図11に示すように、仮想デバイス20によるWrite関数CALLにより、キュー制御部42が書き込み要求をキュー格納部41(キュー41a及びメッセージキュー41b)に積む(登録する)(処理T1)。次いで、アクセス制御部44(スレッド)は、キュー格納部41のキュー41aからアクセス要求(この場合書き込み要求)を読み出し(処理T2)、R_EXEC等のチェックを行なう。そして、アクセス制御部44は、読み出した書き込み要求と同じ範囲に対するリード処理が実行されていないか否かを判断する。R_EXEC等のチェックがOKであれば(競合するリード処理が無ければ)、アクセス制御部44は、仮想デバイス20のライト処理を実行する(処理T3)。また、キュー制御部42は、仮想デバイス20にキュー41aへの書き込み要求の登録が完了したことを通知する(処理T4)。   As shown in FIG. 11, the queue control unit 42 loads (registers) a write request in the queue storage unit 41 (queue 41a and message queue 41b) by the Write function CALL by the virtual device 20 (process T1). Next, the access control unit 44 (thread) reads an access request (write request in this case) from the queue 41a of the queue storage unit 41 (process T2), and checks R_EXEC and the like. Then, the access control unit 44 determines whether or not a read process for the same range as the read write request has been performed. If the check of R_EXEC or the like is OK (there is no conflicting read process), the access control unit 44 executes the write process of the virtual device 20 (process T3). In addition, the queue control unit 42 notifies the virtual device 20 that the registration of the write request to the queue 41a is completed (process T4).

一方、仮想CPU10によるRead関数CALLが発生すると、読出判定部43は、キュー格納部41を確認する(処理T5)。確認の結果、キュー41aにおけるライト処理中の書き込み要求のアクセス範囲がリードアクセスと重なる場合、読出判定部43は、キュー制御部42を介して、読み出し要求をキュー格納部41のライト処理に係るエントリの直後に挿入する(処理T6)。   On the other hand, when the Read function CALL is generated by the virtual CPU 10, the read determination unit 43 confirms the queue storage unit 41 (Process T5). As a result of the confirmation, when the access range of the write request during the write process in the queue 41a overlaps with the read access, the read determination unit 43 sends the read request to the entry related to the write process of the queue storage unit 41 via the queue control unit 42. Is inserted immediately after (processing T6).

アクセス制御部44では、ライト処理が完了すると(処理T7)、キュー制御部42を介して、キュー41a内のライト処理に係るエントリが削除されて更新され(処理T8)、次のエントリ(アクセス要求)が読み出される(処理T9)。アクセス制御部44は、次のアクセス要求が読み出し要求である(R_FLGが立っている)場合、読出判定部43に読み出したエントリが読み出し要求であることを通知する(処理T10)。なお、アクセス要求が読み出し要求である(R_FLGが立っている)ため、アクセス制御部44は、リード処理の完了を待たずに、キュー制御部42を介してキュー41a内のリード処理に係るエントリを削除して更新し(処理T11)、次のエントリを読み出す。   In the access control unit 44, when the write process is completed (process T7), the entry related to the write process in the queue 41a is deleted and updated via the queue control unit 42 (process T8), and the next entry (access request) ) Is read (process T9). When the next access request is a read request (R_FLG is set), the access control unit 44 notifies the read determination unit 43 that the read entry is a read request (process T10). Note that since the access request is a read request (R_FLG is set), the access control unit 44 does not wait for the completion of the read process, and does not wait for the completion of the read process, and enters an entry related to the read process in the queue 41a. Delete and update (process T11), and read the next entry.

読出判定部43は、アクセス制御部44から通知された読み出し要求について、EXECフラグをセットし(処理T12)、リード処理を実行する(処理T13)。リード処理が完了すると(処理T14)、読出判定部43は、EXECフラグをクリアし(処理T15)、処理が終了する。   The read determination unit 43 sets an EXEC flag for the read request notified from the access control unit 44 (process T12) and executes a read process (process T13). When the read process is completed (process T14), the read determination unit 43 clears the EXEC flag (process T15), and the process ends.

次に、図12に示すように、仮想デバイス20によるリードアクセスと同じ範囲に対して仮想CPU10がライトアクセスを行なった場合を説明する。   Next, as shown in FIG. 12, a case where the virtual CPU 10 performs a write access to the same range as the read access by the virtual device 20 will be described.

図12に示すように、仮想デバイス20によるRead関数CALLが発生すると、読出判定部43は、キュー格納部41を確認する(処理T21)。確認の結果、キュー41a内にアクセス要求が存在しない(リードアクセスのアクセス範囲と重なるライトアクセスが無い)ため、読出判定部43は、EXECフラグをセットし(処理T22)、リード処理を実行する(処理T23)。   As shown in FIG. 12, when the Read function CALL is generated by the virtual device 20, the read determination unit 43 checks the queue storage unit 41 (Process T21). As a result of the confirmation, there is no access request in the queue 41a (there is no write access overlapping the read access access range), so the read determination unit 43 sets the EXEC flag (process T22) and executes the read process ( Process T23).

一方、仮想CPU10によるWrite関数CALLにより、キュー制御部42が書き込み要求のキューをキュー格納部41に積む(登録する)(処理T24)。次いで、アクセス制御部44(スレッド)は、キュー格納部41からキューを読み出し(処理T25)、R_EXEC等のチェックを行ない、読み出したキューと同じ範囲に対するリード処理が実行されていないか否かを判断する。しかし、処理T22において、ライトアクセスと同じ範囲に対するリードアクセスについてR_EXECフラグがセットされているため、R_EXEC等のチェックはNGとなる(競合するリード処理がある)(処理T26)。なお、キュー制御部42は、仮想CPU10にキュー41aへの書き込み要求の登録が完了したことを通知する(処理T27)。   On the other hand, by the write function CALL by the virtual CPU 10, the queue control unit 42 loads (registers) a queue of write requests in the queue storage unit 41 (process T24). Next, the access control unit 44 (thread) reads the queue from the queue storage unit 41 (process T25), checks R_EXEC, etc., and determines whether read processing for the same range as the read queue is not executed. To do. However, since the R_EXEC flag is set for read access to the same range as the write access in process T22, the check of R_EXEC or the like becomes NG (there is a conflicting read process) (process T26). The queue control unit 42 notifies the virtual CPU 10 that the registration of the write request to the queue 41a has been completed (process T27).

リード処理が完了すると(処理T28)、読出判定部43は、EXECフラグをクリアする(処理T29)。R_EXECフラグがクリアされたため、アクセス制御部44(スレッド)は、R_EXEC等のチェックを行ない、チェックがOKとなれば(競合するリード処理が無ければ)、仮想CPU10のライト処理を実行する(処理T30)。アクセス制御部44では、ライト処理が完了すると(処理T31)、キュー制御部42を介して、キュー格納部41内のライト処理に係るエントリが削除されて更新され(処理T32)、処理が終了する。   When the read process is completed (process T28), the read determination unit 43 clears the EXEC flag (process T29). Since the R_EXEC flag is cleared, the access control unit 44 (thread) checks R_EXEC and the like, and if the check is OK (if there is no conflicting read process), the write process of the virtual CPU 10 is executed (process T30). ). In the access control unit 44, when the write process is completed (process T31), the entry related to the write process in the queue storage unit 41 is deleted and updated via the queue control unit 42 (process T32), and the process ends. .

〔1−5−1〕Write関数の動作例
次に、図13に示すフローチャートに従って、Write関数の動作例を説明する。
[1-5-1] Example of Write Function Operation Next, an example of the Write function operation will be described with reference to the flowchart shown in FIG.

仮想CPU10又は仮想デバイス20は、仮想メモリ30に書き込むデータとして、上述したWrite関数を呼び出すためのフォーマットの書き込み要求(メッセージ)を生成し、キュー処理部40へ送信する。キュー処理部40は、受信した書き込み要求に基づき以下に示すWrite関数を実行し(ステップS1)、キュー制御部42によるキュー格納部41へのライトアクセスのQueue登録関数を呼び出す。   The virtual CPU 10 or the virtual device 20 generates a write request (message) in a format for calling the above-described Write function as data to be written in the virtual memory 30, and transmits it to the queue processing unit 40. The queue processing unit 40 executes the following Write function based on the received write request (step S1), and calls the queue registration function for write access to the queue storage unit 41 by the queue control unit 42.

Write_p = Que登録(W_addr, W_size, *W_data, 0, 0)
但し、Que登録の引数は、左から順にライトアドレス,ライトデータサイズ,ライトデータ,ポインタ,リードフラグ(R_FLG)である。
Write_p = Que registration (W_addr, W_size, * W_data, 0, 0)
However, Que registration arguments are a write address, a write data size, write data, a pointer, and a read flag (R_FLG) in order from the left.

〔1−5−2〕Queue登録関数の動作例
次に、図14に示すフローチャートに従って、Queue登録関数の動作例を説明する。
[1-5-2] Operation Example of Queue Registration Function Next, an operation example of the Queue registration function will be described with reference to the flowchart shown in FIG.

Queue登録関数は、Write関数又はRead関数の実行により、キュー格納部41への書き込み要求又は読み出し要求の追加や挿入の際に、キュー制御部42により実行される。Queue登録関数が起動されると、キュー制御部42は、呼出元から値を入力される(ステップS11)。例えばキュー制御部42は、キュー41a及びメッセージキュー41bに設定される、先頭アドレス,データサイズ,ライトデータ,読み出し要求を挿入するポインタ,及びR/Wフラグの値を取得する。   The queue registration function is executed by the queue control unit 42 when a write request or a read request is added to or inserted into the queue storage unit 41 by executing the Write function or the Read function. When the queue registration function is activated, the queue control unit 42 receives a value from the caller (step S11). For example, the queue control unit 42 acquires the head address, data size, write data, pointer for inserting a read request, and the value of the R / W flag set in the queue 41a and the message queue 41b.

次いで、キュー制御部42は、登録するアクセス要求がリード/ライトのいずれかを判断するため、R_FLG == 0であるか否かを判断する(ステップS12)。R_FLG == 0である場合、つまり書き込み要求である場合(ステップS12のYesルート)、キュー制御部42は、Global変数であるwp(書き込みポインタ)が示す領域に、書き込み要求の情報を設定してキュー41aに登録する(ステップS13)。具体的には、キュー制御部42は、wpが示すエントリのaddr,size,R_FLGに、それぞれ書き込み要求に係るアドレス,サイズ,R/Wフラグを設定する。   Next, the queue control unit 42 determines whether or not R_FLG == 0 in order to determine whether the access request to be registered is read / write (step S12). If R_FLG == 0, that is, if it is a write request (Yes route in step S12), the queue control unit 42 sets the write request information in the area indicated by wp (write pointer) which is a Global variable. Register in the queue 41a (step S13). Specifically, the queue control unit 42 sets an address, a size, and an R / W flag relating to a write request in addr, size, and R_FLG of the entry indicated by wp, respectively.

また、キュー制御部42は、メッセージキュー41bにライトデータサイズ分のライトデータ(W_data)を格納し(ステップS14)、Next_wpの領域を確保、つまりキュー41aの次の領域を確保する(ステップS15)。キュー制御部42は、Next_wp != 0でなくなるまでステップS15の処理を繰り返し(ステップS16及びステップS16のNoルート)、Next_wpの領域を確保できたら(ステップS16のYesルート)、ステップS17に移行する。   Further, the queue control unit 42 stores the write data (W_data) for the write data size in the message queue 41b (step S14), and secures the Next_wp area, that is, the next area of the queue 41a (step S15). . The queue control unit 42 repeats the process of step S15 until Next_wp! = 0 is not satisfied (No route of step S16 and step S16). When the Next_wp area is secured (Yes route of step S16), the process proceeds to step S17. .

ステップS17では、キュー制御部42は、wpが示すエントリのNext_wpに確保したNext_wpを設定し、当該Next_wpが示すエントリのBefore_wpに現在のwpを設定し、現在のwpの値をNext_wpの値に更新する(次のキュー41aに切り替える)。そして、キュー制御部42は、戻りとしてwpを返し、Queue登録関数の処理が終了する。   In step S17, the queue control unit 42 sets Next_wp reserved in Next_wp of the entry indicated by wp, sets the current wp in Before_wp of the entry indicated by the Next_wp, and updates the current wp value to the value of Next_wp. (Switch to the next queue 41a). Then, the queue control unit 42 returns wp as a return, and the processing of the Queue registration function ends.

一方、ステップS12において、R_FLG == 0ではない場合、つまり読み出し要求である場合(ステップS12のNoルート)、キュー制御部42は、Read_p(読み出しポインタ)の領域を確保、つまり読み出し要求に係る情報を格納(挿入)する領域を確保する(ステップS18)。キュー制御部42は、Read_p != 0でなくなるまでステップS18の処理を繰り返し(ステップS19及びステップS19のNoルート)、Read_pの領域を確保できたら(ステップS19のYesルート)、ステップS20に移行する。   On the other hand, if R_FLG == 0 in step S12, that is, if it is a read request (No route in step S12), the queue control unit 42 secures an area for Read_p (read pointer), that is, information related to the read request. An area for storing (inserting) is secured (step S18). The queue control unit 42 repeats the process of step S18 until Read_p! = 0 is not satisfied (No route of step S19 and step S19). When the Read_p area is secured (Yes route of step S19), the queue control unit 42 proceeds to step S20. .

ステップS20では、キュー制御部42は、Read_pが示す領域に読み出し要求の情報を設定してキュー41aに登録(挿入)するとともに、キュー41aに登録したことによる前後のアクセス要求のNext_wp及びBefore_wpを変更する。具体的には、キュー制御部42は、Read_pが示すエントリのaddr,size,R_FLGに、それぞれ読み出し要求に係るアドレス,サイズ,R/Wフラグを設定する。また、キュー制御部42は、Read_pが示すエントリのNext_wp,Before_wpと、挿入したアクセス要求の前後のエントリNext_wp,Before_wpを変更する(図9及び図10参照)。そして、キュー制御部42は、戻り値としてRead_pを返し、Queue登録関数の処理が終了する。   In step S20, the queue control unit 42 sets the read request information in the area indicated by Read_p and registers (inserts) the information in the queue 41a, and changes Next_wp and Before_wp of the access requests before and after registering in the queue 41a. To do. Specifically, the queue control unit 42 sets the address, size, and R / W flag related to the read request in the addr, size, and R_FLG of the entry indicated by Read_p, respectively. Further, the queue control unit 42 changes the Next_wp and Before_wp of the entry indicated by Read_p and the entries Next_wp and Before_wp before and after the inserted access request (see FIGS. 9 and 10). Then, the queue control unit 42 returns Read_p as a return value, and the processing of the Queue registration function ends.

〔1−5−3〕Read関数の動作例
次に、図15及び図16に示すフローチャート、並びに図18に示す図に従って、Read関数の動作例を説明する。
[1-5-3] Operation Example of Read Function Next, an operation example of the Read function will be described with reference to the flowcharts illustrated in FIGS. 15 and 16 and the diagram illustrated in FIG.

仮想CPU10又は仮想デバイス20は、仮想メモリ30からデータを読み出す際に、上述したRead関数を呼び出すためのフォーマットの読み出し要求(メッセージ)を生成し、キュー処理部40へ送信する。キュー処理部40は、主に読出判定部43により以下に示すRead関数の処理を実行する。   When the virtual CPU 10 or the virtual device 20 reads data from the virtual memory 30, the virtual CPU 10 or the virtual device 20 generates a format read request (message) for calling the above-described Read function, and transmits the request to the queue processing unit 40. The queue processing unit 40 executes the following Read function processing mainly by the read determination unit 43.

はじめに、読出判定部43は、読み出し要求から読み出しの先頭アドレス及びデータサイズを取得する(ステップS21)。そして、読出判定部43は、リード処理を要求した仮想CPU10又は仮想デバイス20(Device(Read_Req_DEV))のリード処理を、対応するデバイスのReadExecに登録する(ステップS22,図18の符号43a及びA1の“1”参照)。   First, the read determination unit 43 acquires the read start address and data size from the read request (step S21). Then, the read determination unit 43 registers the read process of the virtual CPU 10 or the virtual device 20 (Device (Read_Req_DEV)) that requested the read process in ReadExec of the corresponding device (Step S22, reference numerals 43a and A1 in FIG. 18). Refer to “1”).

次いで、読出判定部43は、Global変数であるwp(ライトポインタ)(この場合、キュー41aの最後尾のエントリを示すポインタ)の値をrp(読み出しポインタ)に設定し(ステップS23)、rp != 0であるか否かを判定する(ステップS24)。rp != 0である場合(ステップS24のYesルート)、読出判定部43は、rpが示すエントリについてR_FLG == 1であるか否かを判定する(ステップS25)。R_FLG == 1である場合(リード処理)(ステップS25のYesルート)、読出判定部43は、rpを直前のエントリのポインタに変更し(キュー41aを遡り)(ステップS27)、処理がステップS24に移行する。   Next, the read determination unit 43 sets the value of the global variable wp (write pointer) (in this case, a pointer indicating the last entry of the queue 41a) to rp (read pointer) (step S23). It is determined whether or not 0 (step S24). If rp! = 0 (Yes route in step S24), the read determination unit 43 determines whether or not R_FLG == 1 for the entry indicated by rp (step S25). When R_FLG == 1 (read process) (Yes route in step S25), the read determination unit 43 changes rp to the pointer of the previous entry (goes back to the queue 41a) (step S27), and the process proceeds to step S24. Migrate to

一方、R_FLG == 1ではない場合(ライト処理)(ステップS25のNoルート)、読出判定部43は、リード処理のアクセス範囲がライト処理のアクセス範囲と重なるか否かを判定する(ステップS26,図18の符号A1の“2”参照)。アクセス範囲が重ならない場合(ステップS26のNoルート)、処理がステップS27に移行する。一方、アクセス範囲が重なる場合(ステップS26のYesルート)、読出判定部43は、当該リード処理について、キュー制御部42によるキュー格納部41へのリードアクセスのQueue登録関数を呼び出す(ステップS28,図18の符号A2参照)。   On the other hand, when R_FLG == 1 is not satisfied (write process) (No route in step S25), the read determination unit 43 determines whether the access range of the read process overlaps with the access range of the write process (step S26, (Refer to reference numeral “2” in FIG. 18). If the access ranges do not overlap (No route in step S26), the process proceeds to step S27. On the other hand, when the access ranges overlap (Yes route of step S26), the read determination unit 43 calls the queue registration function of the read access to the queue storage unit 41 by the queue control unit 42 for the read process (step S28, FIG. 18 reference A2).

次いで、読出判定部43は、実行するリード処理のポインタを、対応するデバイスのR_EXECに登録する(ステップS29,図18の符号43bの“rp”及びA1の“2.1”参照)。このように、実行するリード処理のポインタを登録することで、読出判定部43は、リード処理がキュー格納部41から読み出され処理が完了したことをアクセス制御部44を介して検出することができる。なお、ReadExec43a及びR_EXEC43bは、それぞれ仮想CPU10及び仮想デバイス20の各デバイスごとに存在する。読出判定部43は、ReadExec43a及びR_EXEC43bをCPU1aのキャッシュメモリや仮想メモリ30等の記憶領域の一部に記憶することができる。   Next, the read determination unit 43 registers the pointer of the read process to be executed in R_EXEC of the corresponding device (see step S29, “rp” in reference numeral 43b in FIG. 18 and “2.1” in A1). Thus, by registering the pointer of the read process to be executed, the read determination unit 43 can detect, via the access control unit 44, that the read process is read from the queue storage unit 41 and the process is completed. it can. Note that ReadExec 43a and R_EXEC 43b exist for each device of the virtual CPU 10 and the virtual device 20, respectively. The read determination unit 43 can store ReadExec 43a and R_EXEC 43b in a part of a storage area such as the cache memory or the virtual memory 30 of the CPU 1a.

そして、読出判定部43は、アクセス制御部44によるキュー41aからの読み出し待ちを行なう(ステップS30及びステップS30のYesルート)。リード処理のアクセス要求が読み出されると(ステップS30のNoルート)、処理が図16のステップS31に移行する。   Then, the read determination unit 43 waits for reading from the queue 41a by the access control unit 44 (Yes route of step S30 and step S30). When the access request for the read process is read (No route in step S30), the process proceeds to step S31 in FIG.

図16のステップS31では、読出判定部43は、読み出し要求を発行したデバイスに対応するR_EXEC43bに対して、リード処理実行中であることを示すEXECフラグを設定する(図18の符号43bの“EXEC”,A1の“2.1”,及びA3参照)。そして、読出判定部43は、R_EXEC内のリード処理のポインタをクリア(例えば“0”を設定)し(ステップS32)、リード処理を実行する(ステップS33,図18の符号A4参照)。なお、リード処理は、例えばmemcpyコマンドにより実行し、戻り値としてリードデータをデバイスに返すことができる。   In step S31 of FIG. 16, the read determination unit 43 sets an EXEC flag indicating that the read process is being executed for the R_EXEC 43b corresponding to the device that has issued the read request (“EXEC of reference numeral 43b in FIG. 18). ", See A2.1," 2.1 ", and A3). Then, the read determination unit 43 clears the pointer of the read process in R_EXEC (for example, sets “0”) (step S32) and executes the read process (see step S33, symbol A4 in FIG. 18). The read process can be executed by, for example, a memcpy command, and read data can be returned to the device as a return value.

最後に、読出判定部43は、ReadExec43a及びR_EXEC43bをそれぞれリセット(例えば“0”を設定)し(ステップS34及びS35,図18の符号A1の“3”及びA5参照)、処理を終了する。なお、図15のステップS24において、rp != 0ではない場合、つまりキュー格納部41の先頭のエントリまで検索を行なった場合(ステップS24のNoルート)、読出判定部43は、リード処理とアクセス範囲が重なるライト処理は無いと判定する。そして、処理が図16のステップS31に移行する(図18の符号A1の“2.2”参照)。   Finally, the read determination unit 43 resets ReadExec 43a and R_EXEC 43b (for example, “0” is set) (see steps S34 and S35, “3” and A5 of reference symbol A1 in FIG. 18), and ends the process. In step S24 in FIG. 15, when rp! = 0 is not satisfied, that is, when the search is performed up to the first entry in the queue storage unit 41 (No route in step S24), the read determination unit 43 performs read processing and access. It is determined that there is no write process with overlapping ranges. Then, the process proceeds to step S31 in FIG. 16 (see “2.2” in reference numeral A1 in FIG. 18).

〔1−5−4〕アクセス処理(スレッド)の動作例
次に、図17に示すフローチャート及び図18に示す図に従って、アクセス処理(スレッド)の動作例を説明する。
[1-5-4] Operation Example of Access Process (Thread) Next, an operation example of the access process (thread) will be described with reference to the flowchart shown in FIG. 17 and the diagram shown in FIG.

アクセス制御部44は、キュー格納部41(キュー41a)から格納順にアクセス要求を読み出し、読み出したアクセス要求に対して所定の処理を実行する。   The access control unit 44 reads access requests from the queue storage unit 41 (queue 41a) in the order of storage, and executes predetermined processing on the read access requests.

はじめに、アクセス制御部44は、Global変数であるquerp(キュー41aからの読み出しポインタ)が示すアクセス要求のアドレス,サイズ及びR/Wフラグを変数に登録する(ステップS41,図18の符号B1参照)。そして、アクセス制御部44は、アクセス要求の中身が空であるか否かを判定し(ステップS42)、空である場合(ステップS42のYesルート)、処理がステップS41に移行する。一方、空ではない場合(ステップS42のNoルート)、アクセス制御部44は、アクセス要求の中身がリード処理であるか否かをR_FLGを参照して判定する(ステップS43)。   First, the access control unit 44 registers the address, size, and R / W flag of the access request indicated by the global variable querp (read pointer from the queue 41a) in the variable (see step S41, symbol B1 in FIG. 18). . Then, the access control unit 44 determines whether or not the content of the access request is empty (step S42). If it is empty (Yes route of step S42), the process proceeds to step S41. On the other hand, when it is not empty (No route in step S42), the access control unit 44 determines whether or not the content of the access request is a read process with reference to R_FLG (step S43).

一方、リード処理ではない(ライト処理である)場合(ステップS43のNoルート)、処理がステップS44に移行する。ステップS44〜48では、アクセス制御部44は、ライト処理を行なう前に、読出判定部43に対して、ライト処理のアクセス範囲と重なるリード処理が実行されているか否かを判定させる(図18の符号B2参照)。   On the other hand, when it is not a read process (a write process) (No route of step S43), the process proceeds to step S44. In steps S44 to S48, the access control unit 44 causes the read determination unit 43 to determine whether or not a read process overlapping with the access range of the write process is being performed before performing the write process (FIG. 18). Reference B2).

一例として、読出判定部43は、リード処理登録(ReadExec)しているリード処理が実行中(R_EXEC == 1)か否かを判定することができる。そして、読出判定部43は、実行中である登録情報(例えば対応するReadExec43a)と、アクセス制御部44から取得するライト処理に関する情報とを比較し、ライト処理を待機させるか否かを判定する。   As an example, the read determination unit 43 can determine whether or not the read process registered (ReadExec) is being executed (R_EXEC == 1). Then, the read determination unit 43 compares the registration information being executed (for example, the corresponding ReadExec 43a) with information related to the write process acquired from the access control unit 44, and determines whether to wait for the write process.

例えば、読出判定部43は、ステップS44において、R_EXEC43bを確認するデバイスを仮想CPU10として、仮想CPU10のEXECフラグが有効(例えば“1”)であるか否かを判定する(ステップS45)。   For example, in step S44, the read determination unit 43 determines whether or not the EXEC flag of the virtual CPU 10 is valid (for example, “1”) with the device that checks the R_EXEC 43b as the virtual CPU 10 (step S45).

EXECフラグが有効である場合(ステップS45のYesルート)、読出判定部43は、Read関数の処理と同様の手法で、ライト処理のアクセス範囲がリード処理のアクセス範囲と重なるか否かを判定する(ステップS46,図18の符号A1の“2”参照)。アクセス範囲が重ならない場合(ステップS46のNoルート)、又は、ステップS45でEXECフラグが無効である場合(ステップS45のNoルート)、読出判定部43は、仮想CPU10を他の仮想デバイス20に変更する(ステップ47)。そして、読出判定部43は、全てのデバイスについて判定を行なうまで処理を繰り返す(ステップS48及びステップS48のNoルート)。   When the EXEC flag is valid (Yes route in step S45), the read determination unit 43 determines whether the access range of the write process overlaps with the access range of the read process by the same method as the process of the Read function. (See step S46, "2" of reference A1 in FIG. 18). If the access ranges do not overlap (No route in step S46), or if the EXEC flag is invalid in step S45 (No route in step S45), the read determination unit 43 changes the virtual CPU 10 to another virtual device 20. (Step 47). Then, the read determination unit 43 repeats the process until determination is made for all devices (No route in step S48 and step S48).

なお、ステップS46においてアクセス範囲が重なる場合(ステップS46のYesルート)、EXECフラグが有効である間(リード処理中)の処理は、ステップS45のYesルート〜ステップS46のYesルートのループに入る。これにより、読出判定部43は、ライト処理を待機させることができる。   If the access ranges overlap in step S46 (Yes route in step S46), the processing while the EXEC flag is valid (during the read process) enters the loop from the Yes route in step S45 to the Yes route in step S46. Thereby, the read determination unit 43 can wait for the write process.

全てのデバイスについて判定を行なうと(ステップS48のYesルート)、処理が読出判定部43からアクセス制御部44に戻され、アクセス制御部44は、ライト処理を実行する(ステップS49,図18の符号B3参照)。例えばアクセス制御部44は、memcpyコマンドを用いて、メッセージキュー41b(バッファ)からライトサイズ分のライトデータを読み出して、仮想メモリ30へコピーすることができる。   If all the devices have been determined (Yes route in step S48), the process is returned from the read determination unit 43 to the access control unit 44, and the access control unit 44 executes the write process (step S49, code in FIG. 18). (See B3). For example, the access control unit 44 can read write data for the write size from the message queue 41 b (buffer) using the memcpy command and copy it to the virtual memory 30.

次いで、アクセス制御部44は、キュー制御部42に対して、ライト処理が完了したアクセス要求の削除を指示し、キュー制御部42は、当該アクセス要求をキュー格納部41から削除する(ステップS50,図8,図18の符号B4参照)。なお、ステップS43において、アクセス要求の中身がリード処理である場合(ステップS43のYesルート)、処理がステップS50に移行する。この場合、アクセス制御部44は、リード処理に係るキュー41aのポインタを読出判定部43に通知し、キュー制御部42に対して、リード処理に係るアクセス要求の削除を指示する。   Next, the access control unit 44 instructs the queue control unit 42 to delete the access request for which the write process has been completed, and the queue control unit 42 deletes the access request from the queue storage unit 41 (Step S50, (See symbol B4 in FIGS. 8 and 18). In step S43, when the content of the access request is a read process (Yes route in step S43), the process proceeds to step S50. In this case, the access control unit 44 notifies the read determination unit 43 of the pointer of the queue 41a related to the read process, and instructs the queue control unit 42 to delete the access request related to the read process.

次に、アクセス制御部44は、ステップS50でQuerpがNext_wpに更新され、Que_WPも更新されたため、新たにアクセス要求を取得する。このとき、スレッドの切り替わりが遅い場合があり得るため、アクセス制御部44は、読み出したアクセス要求のデータがリードであるならば、リード実行中を示すEXECフラグをセットする(ステップS51,S51のYesルート及びS52)。そして、ステップS52の処理が完了した場合、又は、読み出したアクセス要求のデータがライトである場合(ステップS51のNoルート)、処理がステップS41に移行する。   Next, the access control unit 44 acquires a new access request because Querp is updated to Next_wp and Que_WP is also updated in step S50. At this time, since the thread switching may be slow, if the read access request data is a read, the access control unit 44 sets an EXEC flag indicating that the read is being executed (Yes in steps S51 and S51). Route and S52). When the process of step S52 is completed, or when the read access request data is a write (No route of step S51), the process proceeds to step S41.

〔1−5−5〕EXECフラグ設定処理の動作例
次に、図19に示すフローチャートに従って、EXECフラグ設定処理の動作例を説明する。
[1-5-5] Example of EXEC Flag Setting Process Next, an example of the EXEC flag setting process will be described with reference to the flowchart shown in FIG.

図17のステップS52において、アクセス制御部44によりEXECフラグ設定処理が実行されると、読出判定部43が起動される。読出判定部43は、R_EXEC43bを確認するデバイスを仮想CPU10として(ステップS61)、仮想CPU10のrpがQue_WPと一致し、且つ“0”ではないか否かを判定する(ステップS62)。条件を満たさない場合(ステップS62のNoルート)、読出判定部43は、仮想CPU10を他の仮想デバイス20に変更し(ステップ63)、全てのデバイスについて判定を行なうまで処理を繰り返す(ステップS64及びステップS64のNoルート)。全てのデバイスについて判定を行なうと、処理が終了する。   In step S52 of FIG. 17, when the EXEC flag setting process is executed by the access control unit 44, the read determination unit 43 is activated. The read determination unit 43 sets the device that confirms the R_EXEC 43b as the virtual CPU 10 (step S61), and determines whether or not the rp of the virtual CPU 10 matches Que_WP and is not “0” (step S62). When the condition is not satisfied (No route in step S62), the read determination unit 43 changes the virtual CPU 10 to another virtual device 20 (step 63), and repeats the process until all the devices are determined (step S64 and step S64). No route in step S64). When the determination is made for all devices, the process ends.

一方、ステップS62において、条件を満たす場合(ステップS62のYesルート)、読出判定部43は、EXECフラグが有効か否かを判定し(ステップS65)、有効である場合(ステップS65のYesルート)、処理が終了する。また、EXECフラグが無効である場合には(ステップS65のNoルート)、読出判定部43は、当該EXECフラグを有効にし(ステップS66)、処理が終了する。   On the other hand, if the condition is satisfied in step S62 (Yes route in step S62), the read determination unit 43 determines whether or not the EXEC flag is valid (step S65), and if valid (Yes route in step S65). , The process ends. If the EXEC flag is invalid (No route in step S65), the read determination unit 43 validates the EXEC flag (step S66), and the process ends.

なお、上述したEXECフラグの設定処理は、アクセス制御部44が行なってもよい。   The above-described EXEC flag setting process may be performed by the access control unit 44.

〔1−6〕本実施形態の効果
本実施形態に係るエミュレーションサーバ1によれば、ハードウェアと同等の調停機能(アービタ)を設けた図2に示す仮想装置200よりも、仮想装置3の性能(処理速度)の悪化を抑えることができる。
[1-6] Effects of this Embodiment According to the emulation server 1 according to this embodiment, the performance of the virtual device 3 is higher than that of the virtual device 200 shown in FIG. 2 provided with an arbitration function (arbiter) equivalent to hardware. Deterioration of (processing speed) can be suppressed.

ここで、アービタはバス調停を行なう回路であるため、仮想CPUや仮想デバイスのいずれかのデバイスが仮想メモリへアクセスする間は、他のデバイスは仮想メモリにアクセスできず、処理が待たされる(応答速度が低下する)。ハードウェアでの調停は、1つのデバイス(CPUを含む)がバスを使用していた場合、他のデバイスはバスを使用できないように調停が行なわれる。   Here, since the arbiter is a circuit that performs bus arbitration, while either the virtual CPU or the virtual device accesses the virtual memory, the other device cannot access the virtual memory, and the process is waited for (response) Speed decreases). In the arbitration by hardware, when one device (including the CPU) uses the bus, arbitration is performed so that other devices cannot use the bus.

しかし、ソフトウェアでは、複数のプロセス(スレッド)が仮想メモリにアクセス可能である。このため、ハードウェアをソフトウェアで実現(再現)するエミュレータには、ハードウェアのような排他処理をさせることが、エミュレータによる対象装置1000の再現性の観点から好ましい。この場合、図2を用いて説明したように、仮想装置の速度低下が著しい。   However, in software, a plurality of processes (threads) can access the virtual memory. For this reason, it is preferable from the viewpoint of reproducibility of the target device 1000 by the emulator that the emulator that implements (reproduces) the hardware by software performs exclusive processing like hardware. In this case, as described with reference to FIG. 2, the speed reduction of the virtual device is significant.

これに対し、本実施形態に係るエミュレーションサーバ1によれば、各仮想処理部のメモリ調停(排他処理)を最小限に留め、単純化することができるため、速度低下を抑制でき、高速にエミュレートを行なうことができる。従って、対象装置1000を仮想モデルを用いて再現する情報処理装置における仮想モデルの性能低下を抑制することができる。また、仮想メモリ30へのアクセスの排他性が保たれるため、仮想CPU10及び仮想デバイス20のマルチスレッド化を容易に行なうことができる。   On the other hand, according to the emulation server 1 according to the present embodiment, memory arbitration (exclusive processing) of each virtual processing unit can be minimized and simplified, so that the speed reduction can be suppressed and the emulation can be performed at high speed. Rate can be done. Accordingly, it is possible to suppress the performance degradation of the virtual model in the information processing apparatus that reproduces the target device 1000 using the virtual model. In addition, since the exclusiveness of access to the virtual memory 30 is maintained, the virtual CPU 10 and the virtual device 20 can be easily multi-threaded.

さらに、エミュレーションサーバ1は、仮想装置3に書き込み要求を処理順に格納するキュー格納部41をそなえるため、仮想メモリ30へのアクセスの順序性が保証される。従って、仮想CPU10の部分についてもメモリバリアを実装することができる。   Furthermore, since the emulation server 1 includes the queue storage unit 41 that stores the write requests in the processing order in the virtual device 3, the order of access to the virtual memory 30 is guaranteed. Therefore, a memory barrier can also be mounted on the virtual CPU 10 portion.

さらに、仮想CPU10及び仮想デバイス20による仮想メモリ30へのアクセスの順序性が一定になるため、DMA(Direct Memory Access)等に起因する、メモリのデータ破壊等のバグの発見を容易にすることができる。   Furthermore, since the order of access to the virtual memory 30 by the virtual CPU 10 and the virtual device 20 is constant, it is easy to find bugs such as memory data destruction caused by DMA (Direct Memory Access) or the like. it can.

〔1−7〕適用例
上述のように、エミュレーションサーバ1は、1以上の仮想CPU10及び複数の仮想デバイス20が仮想メモリ30の同一のメモリ空間をアクセスする際の排他制御を実現することができる。このような排他制御は、例えば仮想デバイス20が仮想メモリ30を用いて仮想CPU10に割り込みを発生させる割り込み処理に用いて好適である。
[1-7] Application Example As described above, the emulation server 1 can realize exclusive control when one or more virtual CPUs 10 and a plurality of virtual devices 20 access the same memory space of the virtual memory 30. . Such exclusive control is suitable, for example, for interrupt processing in which the virtual device 20 uses the virtual memory 30 to cause the virtual CPU 10 to generate an interrupt.

以下、図20に示す仮想装置300及び図21に示す仮想装置6を参照しながら、本実施形態に係るエミュレーションサーバ1の適用例について説明する。なお、仮想装置300は図1に示す仮想装置100と基本的に同様な構成であるものとし、仮想装置6は図5及び図6等に示す仮想装置3と基本的に同様な構成であるものとする。   Hereinafter, application examples of the emulation server 1 according to the present embodiment will be described with reference to the virtual device 300 illustrated in FIG. 20 and the virtual device 6 illustrated in FIG. 21. Note that the virtual device 300 has basically the same configuration as the virtual device 100 shown in FIG. 1, and the virtual device 6 has basically the same configuration as the virtual device 3 shown in FIGS. And

図20において、符号(1)〜(6)は以下の処理である。
(1) 仮想デバイス120−1から仮想メモリ130へのライト処理
(2) 仮想デバイス120−1が仮想メモリ130からのリード処理
(3) 仮想デバイス120−2から仮想メモリ130へのライト処理
(4) 仮想デバイス120−2が仮想メモリ130からのリード処理
(5) 仮想CPU110から仮想メモリ130へのライト処理
(6) 仮想CPU110が仮想メモリ130からのリード処理
In FIG. 20, reference numerals (1) to (6) are the following processes.
(1) Write process from virtual device 120-1 to virtual memory 130 (2) Virtual device 120-1 read process from virtual memory 130 (3) Write process from virtual device 120-2 to virtual memory 130 (4 ) The virtual device 120-2 reads from the virtual memory 130 (5) The virtual CPU 110 writes to the virtual memory 130 (6) The virtual CPU 110 reads from the virtual memory 130

以下、仮想装置300が、(※1)〜(※4)の処理を行なうものとして説明する。
(※1) 仮想デバイス120−1が仮想メモリ130の“0x0F80”に“0x100 Byte”のデータを書き込むライト処理を行なう。
(※2) 仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のデータを読み出すリード処理を行なう。
(※3) 仮想デバイス120−1が仮想メモリ130の“0x1080”に“0x100 Byte”のデータを書き込むライト処理を行なう。
(※4) 仮想CPU110が仮想デバイス120−1によるデータ書き込みの完了を確認し処理する。
In the following description, it is assumed that the virtual device 300 performs the processes (* 1) to (* 4).
(* 1) The virtual device 120-1 performs a write process of writing “0x100 Byte” data to “0x0F80” of the virtual memory 130.
(* 2) The virtual device 120-2 performs a read process of reading data “0x200 Byte” from “0x2000” of the virtual memory 130.
(* 3) The virtual device 120-1 performs a write process of writing “0x100 Byte” data to “0x1080” of the virtual memory 130.
(* 4) The virtual CPU 110 confirms and processes the completion of data writing by the virtual device 120-1.

(※4)の処理のように、仮想CPU110が仮想デバイス120−1による書き込みの完了を待つ場合、仮想CPU110は、仮想デバイス120−1からの書き込み完了の割り込みを待つ。そして、仮想CPU110は、その割り込みにより割り込みハンドラに実行が移り、書き込みの完了を認識することが考えられる。   When the virtual CPU 110 waits for the completion of writing by the virtual device 120-1 as in the process of (* 4), the virtual CPU 110 waits for a writing completion interrupt from the virtual device 120-1. Then, it can be considered that the virtual CPU 110 moves to the interrupt handler due to the interrupt and recognizes the completion of the writing.

しかし、仮想デバイス120−1は(※1)及び(※3)の処理を行なうため、例えば(※1)の処理に係る割り込みハンドラ処理中に、(※3)の処理が完了する場合がある。この場合、仮想CPU110の(※1)に係る割り込み処理完了直後に(※3)に係る割り込みが発生し、再度割り込みハンドラに処理が移るということも起こり得るため、効率が悪い。   However, since the virtual device 120-1 performs the processes (* 1) and (* 3), for example, the process (* 3) may be completed during the interrupt handler process related to the process (* 1). . In this case, since the interrupt according to (* 3) may occur immediately after the completion of the interrupt process according to (* 1) of the virtual CPU 110 and the process may be transferred again to the interrupt handler, the efficiency is low.

近年のシステムでは、仮想デバイスが仮想CPUへの割り込みを発生させる前にメモリ空間に割り込み情報を書き込み、割り込み通知としてMSI(Message Signaled Interrupt)やMSI−X(MSI-eXtended)を用いるといった手法が知られている。なお、割り込み情報としては、エラーStatusやデータ転送アドレス(Scatgather等のテーブルを用いた転送等があり得るため)等が挙げられる。   In recent systems, a technique is known in which interrupt information is written into a memory space before a virtual device generates an interrupt to a virtual CPU, and MSI (Message Signaled Interrupt) or MSI-X (MSI-eXtended) is used as an interrupt notification. It has been. The interrupt information includes an error status, a data transfer address (because transfer using a table such as Scatchather is possible), and the like.

この手法では、メモリ空間に割り込み情報を書き込むため、仮想CPUは、一回の割り込みハンドラ処理の際に、或る領域にデータが書かれていたら処理が完了していると判断することで、極力、割り込み処理によるオーバヘッドを減らしている。実際のハードウェアでは、この割り込み情報のメモリ空間への書き込み中にCPUが当該データを読み出すことは、排他制御により抑止されるが、既述のように、ソフトウェアエミュレータでは可能となってしまう。   In this method, since the interrupt information is written in the memory space, the virtual CPU determines that the processing is completed if data is written in a certain area at the time of one interrupt handler process. The overhead due to interrupt processing is reduced. In actual hardware, while the interrupt information is being written into the memory space, the CPU does not allow the data to be read by the exclusive control, but as described above, it is possible in the software emulator.

例として、一回の割り込みごとに仮想デバイス120−1が割り込み情報として“8 Byte”のデータをメモリ空間Aに書き込むこととする(図20参照)。メモリ空間Aは仮想デバイス120−1に書き込み可能なメモリとして登録されており、割り込み発生ごとにメモリ空間Aにデータを書き込んだ後、Aは“8 Byte”ずつ増加するものとする。また、メモリ空間Aへのライトデータは、先頭の“2 Byte”が何の割り込みかを示す情報,次の“2 Byte”がエラー等のStatus情報,最後の“4 Byte”がデータの格納先アドレスであるとする。   As an example, assume that the virtual device 120-1 writes “8 Byte” data in the memory space A as interrupt information for each interrupt (see FIG. 20). The memory space A is registered as a writable memory in the virtual device 120-1, and A is increased by “8 Bytes” after data is written to the memory space A every time an interrupt occurs. The write data to the memory space A is the information indicating what interrupt the first “2 Byte” is, the next “2 Byte” is the status information such as an error, and the last “4 Byte” is the data storage destination Assume that it is an address.

通常の処理では、仮想装置300は例えば以下の手順で動作する。   In normal processing, the virtual device 300 operates in the following procedure, for example.

・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x0F80”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。   In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x0F80” of the virtual memory 130. Then, the virtual device 120-1 writes “8 Byte” data in the memory space A when writing is completed, generates an interrupt to the virtual CPU 110, and then sets “A = A + 8” as the next write address. ”.

・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。そして、仮想CPU110は、問題がないことを確認し処理を継続(return)する。   The virtual CPU 110 performs an interrupt process on the route (6). The virtual CPU 110 reads the data in the space (A + 0) before the update, and confirms the data at the address indicated by the space (A + 4) before the update. Then, the virtual CPU 110 confirms that there is no problem and continues (returns) the process.

・(4)の経路にて、仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のリード処理を行なう。   In the path (4), the virtual device 120-2 performs a read process from “0x2000” to “0x200 Byte” of the virtual memory 130.

・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x1080”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。   In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x1080” of the virtual memory 130. Then, the virtual device 120-1 writes “8 Byte” data in the memory space A when writing is completed, generates an interrupt to the virtual CPU 110, and then sets “A = A + 8” as the next write address. ”.

・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。そして、仮想CPU110は、問題がないことを確認し処理を継続(return)する。   The virtual CPU 110 performs an interrupt process on the route (6). The virtual CPU 110 reads the data in the space (A + 0) before the update, and confirms the data at the address indicated by the space (A + 4) before the update. Then, the virtual CPU 110 confirms that there is no problem and continues (returns) the process.

上述した手順を、一回の割り込みで複数の割り込み処理を実行するような割り込みハンドラの動作で説明すると、以下のようになる。   The above-described procedure is described as the operation of an interrupt handler that executes a plurality of interrupt processes with a single interrupt as follows.

・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x0F80”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。   In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x0F80” of the virtual memory 130. Then, the virtual device 120-1 writes “8 Byte” data in the memory space A when writing is completed, generates an interrupt to the virtual CPU 110, and then sets “A = A + 8” as the next write address. ”.

・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。   The virtual CPU 110 performs an interrupt process on the route (6). The virtual CPU 110 reads the data in the space (A + 0) before the update, and confirms the data at the address indicated by the space (A + 4) before the update.

また、仮想CPU110は、更新前の空間(A+8)のデータを読み出し、データが書かれているか否かを確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+12)で示されるアドレスのデータを確認する。そして、仮想CPU110は、更新前の空間(A+16)のデータを読み、データが書かれているか確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+20)で示されるアドレスのデータを確認する。以降、仮想CPU110は、空間(A+x(xは4の倍数))にデータ書かれている場合、同様に処理を進める。   In addition, the virtual CPU 110 reads the data in the space (A + 8) before the update, checks whether the data is written, and if not written, continues the processing (return) while the data is written. For example, the data of the address indicated by the space before update (A + 12) is confirmed. Then, the virtual CPU 110 reads the data in the space (A + 16) before the update and checks whether the data is written. If not, the process continues (returns). Check the data at the address indicated by the space (A + 20). Thereafter, the virtual CPU 110 proceeds in the same manner when data is written in a space (A + x (x is a multiple of 4)).

・(4)の経路にて、仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のリード処理を行なう。   In the path (4), the virtual device 120-2 performs a read process from “0x2000” to “0x200 Byte” of the virtual memory 130.

・(1)の経路にて、仮想デバイス120−1が仮想メモリ130の“0x1080”に“0x100 Byte”のライト処理を行なう。そして、仮想デバイス120−1は、書き込み完了時にメモリ空間Aに対し、“8 Byte”のデータを書き込み、仮想CPU110に対して割り込みを発生させた後、次のライトアドレスとして“A=A+8”を実施する。   In the path (1), the virtual device 120-1 performs a write process of “0x100 Byte” to “0x1080” of the virtual memory 130. Then, the virtual device 120-1 writes “8 Byte” data in the memory space A when writing is completed, generates an interrupt to the virtual CPU 110, and then sets “A = A + 8” as the next write address. ”.

・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出し、更新前の空間(A+4)で示されるアドレスのデータを確認する。   The virtual CPU 110 performs an interrupt process on the route (6). The virtual CPU 110 reads the data in the space (A + 0) before the update, and confirms the data at the address indicated by the space (A + 4) before the update.

また、仮想CPU110は、更新前の空間(A+8)のデータを読み出し、データが書かれているか否かを確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+12)で示されるアドレスのデータを確認する。そして、仮想CPU110は、更新前の空間(A+16)のデータを読み、データが書かれているか確認し、書かれていなければ処理を継続(return)する一方、書かれていれば更新前の空間(A+20)で示されるアドレスのデータを確認する。以降、仮想CPU110は、空間(A+x(xは4の倍数))にデータ書かれている場合、同様に処理を進める。   In addition, the virtual CPU 110 reads the data in the space (A + 8) before the update, checks whether the data is written, and if not written, continues the processing (return) while the data is written. For example, the data of the address indicated by the space before update (A + 12) is confirmed. Then, the virtual CPU 110 reads the data in the space (A + 16) before the update and checks whether the data is written. If not, the process continues (returns). Check the data at the address indicated by the space (A + 20). Thereafter, the virtual CPU 110 proceeds in the same manner when data is written in a space (A + x (x is a multiple of 4)).

このように、(※1)の処理が完了後、割り込みハンドラに処理が移る前に(※2),(※3)の処理が実行されると、(※1)の処理の割り込みで(※3)の割り込み処理も行なわれてしまう。   In this way, if the processing of (* 2) and (* 3) is executed after the processing of (* 1) is completed and before the processing moves to the interrupt handler, The interrupt process 3) is also performed.

ソフトエミュレータでは、各仮想デバイス120が別スレッド(プロセス)で動作している。従って、(※1),(※2),(※3)と処理を進めていく際に、(※3)でA+0〜A+7まで書き込めずに、A+0,A+1辺りまで書き込んだところで仮想デバイス120−1が別のスレッド(例えば仮想デバイス120−2)に切り替わることが起こり得る。   In the software emulator, each virtual device 120 operates in a separate thread (process). Therefore, when proceeding with (* 1), (* 2), (* 3), it is not possible to write A + 0 to A + 7 in (* 3), but around A + 0, A + 1 It is possible that the virtual device 120-1 is switched to another thread (for example, the virtual device 120-2) when the above is written.

こうなった場合、仮想CPU110のスレッドの順番の際に、割り込みハンドラで処理する(※3)のアドレスが違うエリアのアドレスを示すことになり、誤動作が発生することになる。   In this case, in the order of the threads of the virtual CPU 110, the address of the area (* 3) processed by the interrupt handler indicates an address of a different area, and a malfunction occurs.

これに対し、本実施形態の適用例に係る仮想装置6は、例えば以下の手順で動作する。   On the other hand, the virtual device 6 according to the application example of the present embodiment operates in the following procedure, for example.

・(1)の経路にて、仮想デバイス20−1が仮想メモリ30の“0x0F80”に“0x100 Byte”のライト処理を行なうため、キュー処理部40にライトアドレス,サイズ,及びサイズ分のライトデータを書き込む(キュー格納部41に格納する)。   In the path (1), the virtual device 20-1 performs write processing of “0x100 Byte” on “0x0F80” of the virtual memory 30, so the write data for the write address, size, and size is written to the queue processing unit 40. Is written (stored in the queue storage unit 41).

書き込みが完了すると、仮想デバイス20は、メモリ空間Aに対し、“8 Byte”のデータを書くため、キュー処理部40にメモリ空間Aのアドレス(A),サイズ(8 Byte),及びデータ(8 Byte分)を書きこむ(キュー格納部41に格納する)。そして、仮想デバイス20は、仮想CPU10に対して割り込みを発生させ、次のライトアドレスとして“A=A+8”を実施する。   When the writing is completed, the virtual device 20 writes “8 Byte” data in the memory space A, so the address (A), size (8 Byte), and data (8) of the memory space A are stored in the queue processing unit 40. Byte) is written (stored in the queue storage unit 41). Then, the virtual device 20 generates an interrupt to the virtual CPU 10 and implements “A = A + 8” as the next write address.

・(6)の経路にて、仮想CPU110が割り込み処理を行なう。仮想CPU110は、更新前の空間(A+0)のデータを読み出すため、キュー処理部40にリードアドレス(A+0),サイズ(1 Byte),及び仮想CPU10のリードデータを格納するポインタを指示し、アクセスする。   The virtual CPU 110 performs an interrupt process on the route (6). The virtual CPU 110 instructs the queue processing unit 40 to read the read address (A + 0), the size (1 byte), and the pointer for storing the read data of the virtual CPU 10 in order to read the data in the space (A + 0) before the update. And access.

その際、キュー処理部40では、仮想メモリ30にアクセスするアドレス(リードアドレス)とキュー格納部41に積まれているアドレス(ライトアドレス)からアクセス範囲が重なっていないかを確認する。重なっている場合、キュー処理部40では、リード処理がキュー格納部41に積まれ、仮想CPU10はリードの応答を待たされ、次の処理に進めなくなる。この場合、メモリ空間Aの書き込みと読み出しとが重なっている。   At this time, the queue processing unit 40 checks whether the access range overlaps from the address (read address) for accessing the virtual memory 30 and the address (write address) stored in the queue storage unit 41. If they overlap, in the queue processing unit 40, the read processing is accumulated in the queue storage unit 41, the virtual CPU 10 waits for a read response, and cannot proceed to the next processing. In this case, the writing and reading of the memory space A overlap.

キュー処理部40からリード処理が読み出されると、仮想CPU10は、仮想メモリ30のメモリ空間Aからリードを行なう。そして、仮想CPU10は、次の処理としての更新前の空間(A+4)で示されるアドレスのデータを確認するため、キュー処理部40にアドレス(A+4),サイズ(4 Byte),仮想CPU10のリードデータを格納するポインタを指示し、アクセスする。その際、仮想CPU10は、同様にキュー格納部41に積まれていないかを確認し処理を進める。このような処理手法により、仮想装置6では、仮想CPU10等により仮想メモリ30から中途半端なデータが読み出されることを抑止し、誤動作を防止することができる。   When the read process is read from the queue processing unit 40, the virtual CPU 10 reads from the memory space A of the virtual memory 30. Then, the virtual CPU 10 checks the queue processing unit 40 with the address (A + 4), size (4 bytes), virtual, in order to confirm the data of the address indicated in the space (A + 4) before update as the next processing. A pointer for storing read data of the CPU 10 is designated and accessed. At that time, the virtual CPU 10 confirms whether or not it is loaded in the queue storage unit 41 and proceeds with the processing. With such a processing method, the virtual device 6 can prevent halfway data from being read from the virtual memory 30 by the virtual CPU 10 or the like, and can prevent malfunction.

・(4)の経路にて、仮想デバイス120−2が仮想メモリ130の“0x2000”から“0x200 Byte”のリード処理を行なため、キュー処理部40にアドレス(0x2000),サイズ(0x200),及び仮想デバイス20−2がデータを格納するポインタを指示しアクセスする。キュー処理部40では、仮想メモリ30に対しアクセスするアドレス(リードアドレス)及びキュー格納部41に積まれているアドレス(ライトアドレス)からアクセス範囲が重なっていないかを確認する。重なっている場合は、キュー格納部41に仮想デバイス20−2のリード処理が積まれリードの応答を待たされ、次の処理には進めなくなる。この場合、重なっていないため処理が進む。   In the path (4), the virtual device 120-2 performs read processing from “0x2000” to “0x200 Byte” of the virtual memory 130, so that the queue processing unit 40 is addressed (0x2000), size (0x200), Then, the virtual device 20-2 designates and accesses a pointer for storing data. The queue processing unit 40 checks whether the access ranges overlap from the address (read address) for accessing the virtual memory 30 and the address (write address) stored in the queue storage unit 41. If they overlap, the queue storage unit 41 is loaded with the read process of the virtual device 20-2, waits for a read response, and cannot proceed to the next process. In this case, the process proceeds because there is no overlap.

その際、キュー処理部40での処理が仮想CPU10の処理を追い越す場合があるが、重なっていないエリアの状況であるため、特に問題は生じない。むしろ、キュー処理部40では、このような追い越しが発生することで、仮想装置6の全体的な速度低下を防止することができるのである。なお、以降の処理は、同様に進むため割愛する。   At this time, the processing in the queue processing unit 40 may overtake the processing of the virtual CPU 10, but there is no particular problem because the situation is in a non-overlapping area. Rather, the queue processing unit 40 can prevent the overall speed reduction of the virtual device 6 by causing such overtaking. Since the subsequent processing proceeds in the same manner, it is omitted.

以上のように、本実施形態の適用例においても、一実施形態と同様の効果を奏することができるほか、仮想CPU10及び仮想デバイス20の各々が別スレッドで動作するような場合において、仮想装置6全体の性能低下を抑止することができる。   As described above, in the application example of this embodiment, the same effect as that of the embodiment can be obtained, and in the case where each of the virtual CPU 10 and the virtual device 20 operates in different threads, the virtual device 6 Overall performance degradation can be suppressed.

〔2〕その他
以上、本発明の好ましい実施形態について詳述したが、本発明は、係る特定の実施形態に限定されるものではなく、本発明の趣旨を逸脱しない範囲内において、種々の変形、変更して実施することができる。
[2] Others While the preferred embodiments of the present invention have been described in detail above, the present invention is not limited to such specific embodiments, and various modifications and changes can be made without departing from the spirit of the present invention. It can be changed and implemented.

例えば、仮想装置3及び6において、キュー制御部42,読出判定部43,及びアクセス制御部44の機能は、任意の組み合わせで併合してもよく、分割してもよい。   For example, in the virtual devices 3 and 6, the functions of the queue control unit 42, the read determination unit 43, and the access control unit 44 may be combined in any combination or divided.

〔3〕付記
以上の実施形態に関し、更に以下の付記を開示する。
[3] Supplementary Notes Regarding the above embodiment, the following supplementary notes are further disclosed.

(付記1)
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置であって、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納する格納部と、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、重ならない場合、前記読み出し要求に係る読み出し処理を実行する読出制御部と、をそなえる
ことを特徴とする、情報処理装置。
(Appendix 1)
An information processing apparatus that reproduces a target device having a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
A storage unit for storing a write request to the virtual storage unit corresponding to the target storage unit issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units in the processing order;
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit, An information processing apparatus comprising: a read control unit that executes a read process related to the read request when they do not overlap.

(付記2)
前記読出制御部は、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記1記載の情報処理装置。
(Appendix 2)
The read control unit stores the read request in the storage unit when it is determined that an access range related to the read request overlaps an access range related to one or more write requests stored in the storage unit. The information processing apparatus according to attachment 1.

(付記3)
前記読出制御部は、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記2記載の情報処理装置。
(Appendix 3)
When the read control unit determines that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read requests overlaps the read request and the access range The information processing apparatus according to appendix 2, wherein the read request is stored in the storage unit immediately after a write request.

(付記4)
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行する実行部をさらにそなえ、
前記実行部は、前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なると判断した場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
ことを特徴とする、付記1〜3のいずれか1項記載の情報処理装置。
(Appendix 4)
It further includes an execution unit that reads one or more requests stored in the storage unit in a processing order and executes a predetermined process,
If the execution unit determines that the access range related to the write request read from the storage unit overlaps the access range related to the read request during the read process, the execution unit reads from the storage unit until the read process is completed 4. The information processing apparatus according to any one of appendices 1 to 3, wherein the information processing apparatus waits for execution of a predetermined process in response to a write request.

(付記5)
前記読出制御部は、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、付記1〜4のいずれか1項記載の情報処理装置。
(Appendix 5)
The read control unit searches for one or more write requests stored in the storage unit in an order reverse to the processing order, and determines whether or not the access range of the read request overlaps. The information processing apparatus according to any one of appendices 1 to 4.

(付記6)
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現するコンピュータに、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
処理を実行させることを特徴とする、エミュレーションプログラム。
(Appendix 6)
A computer that reproduces a target device that includes a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation program characterized by causing a process of executing a read process related to the read request to be executed when there is no overlap as a result of the determination.

(付記7)
前記コンピュータに、
読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
処理を実行させることを特徴とする、付記6記載のエミュレーションプログラム。
(Appendix 7)
In the computer,
Note that when it is determined that an access range related to a read request overlaps an access range related to one or more write requests stored in the storage unit, a process of storing the read request in the storage unit is executed. 6. The emulation program according to 6.

(付記8)
前記読み出し要求を格納する処理において、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記7記載のエミュレーションプログラム。
(Appendix 8)
In the process of storing the read request, when it is determined that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read request is the read request and the access The emulation program according to appendix 7, wherein the read request is stored in the storage unit immediately after a write request with overlapping ranges.

(付記9)
前記コンピュータに、
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行し、
前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なるか否かを判断し、
判断の結果、重なる場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
処理をさらに実行させることを特徴とする、付記6〜8のいずれか1項記載のエミュレーションプログラム。
(Appendix 9)
In the computer,
One or more requests stored in the storage unit are read in the order of processing, and predetermined processing is executed.
Determining whether the access range related to the write request read from the storage unit overlaps the access range related to the read request during the execution of the read process;
If the result of the determination is that there is an overlap, any one of appendices 6 to 8, wherein a process of waiting for execution of a predetermined process for the write request read from the storage unit until the read process is completed is further executed The emulation program described in the section.

(付記10)
前記判定する処理において、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、付記6〜9のいずれか1項記載のエミュレーションプログラム。
(Appendix 10)
In the determination process, the one or more write requests stored in the storage unit are searched in an order reverse to the processing order, and it is determined whether or not the access range of the read request overlaps. The emulation program according to any one of appendices 6 to 9.

(付記11)
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置におけるエミュレーション方法であって、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
ことを特徴とする、エミュレーション方法。
(Appendix 11)
An emulation method in an information processing apparatus for reproducing a target device having a target storage unit and a plurality of target processing units sharing a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation method, wherein if the result of determination is that there is no overlap, a read process related to the read request is executed.

(付記12)
読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記11記載のエミュレーション方法。
(Appendix 12)
The emulation according to appendix 11, wherein the read request is stored in the storage unit when it is determined that the access range related to the read request overlaps with an access range related to one or more write requests stored in the storage unit Method.

(付記13)
前記読み出し要求を格納する処理において、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、付記12記載のエミュレーション方法。
(Appendix 13)
In the process of storing the read request, when it is determined that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read request is the read request and the access 13. The emulation method according to appendix 12, wherein the read request is stored in the storage unit immediately after a write request having overlapping ranges.

(付記14)
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行し、
前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なるか否かを判断し、
判断の結果、重なる場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
ことを特徴とする、付記11〜13のいずれか1項記載のエミュレーション方法。
(Appendix 14)
One or more requests stored in the storage unit are read in the order of processing, and predetermined processing is executed.
Determining whether the access range related to the write request read from the storage unit overlaps the access range related to the read request during the execution of the read process;
14. The emulation method according to any one of appendices 11 to 13, wherein when the determination results in overlapping, the execution of a predetermined process for the write request read from the storage unit is waited until the read process is completed. .

(付記15)
前記判定する処理において、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、付記11〜14のいずれか1項記載のエミュレーション方法。
(Appendix 15)
In the determination process, the one or more write requests stored in the storage unit are searched in an order reverse to the processing order, and it is determined whether or not the access range of the read request overlaps. The emulation method according to any one of appendices 11 to 14.

1 エミュレーションサーバ(情報処理装置)
1a,1100 CPU
1b,1300 メモリ
1c 記憶部
1d インタフェース部
1e 入出力部
1f,1h 記録媒体
1g 読取部
2 エミュレータ
3,6,100,200,300 仮想装置
4 エミュレーション領域
5 エミュレーションプログラム
10,110 仮想CPU
20,20−1〜20−3,120,120−1〜120−3 仮想デバイス
30,130 仮想メモリ
40 キュー処理部
41 キュー格納部(格納部)
41a キュー
41b メッセージキュー
42 キュー制御部
43 読出判定部
44 アクセス制御部
140 アービタ
150 セレクタ
1000 対象装置(装置)
1200−1〜1200−3 デバイス
1400 内部バス
1 Emulation server (information processing device)
1a, 1100 CPU
1b, 1300 Memory 1c Storage unit 1d Interface unit 1e Input / output unit 1f, 1h Recording medium 1g Reading unit 2 Emulator 3, 6, 100, 200, 300 Virtual device 4 Emulation area 5 Emulation program 10, 110 Virtual CPU
20, 20-1 to 20-3, 120, 120-1 to 120-3 Virtual device 30, 130 Virtual memory 40 Queue processing unit 41 Queue storage unit (storage unit)
41a Queue 41b Message Queue 42 Queue Control Unit 43 Read Determination Unit 44 Access Control Unit 140 Arbiter 150 Selector 1000 Target Device (Device)
1200-1 to 1200-3 device 1400 internal bus

Claims (7)

対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置であって、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納する格納部と、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、重ならない場合、前記読み出し要求に係る読み出し処理を実行する読出制御部と、をそなえる
ことを特徴とする、情報処理装置。
An information processing apparatus that reproduces a target device having a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
A storage unit for storing a write request to the virtual storage unit corresponding to the target storage unit issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units in the processing order;
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit, An information processing apparatus comprising: a read control unit that executes a read process related to the read request when they do not overlap.
前記読出制御部は、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求を前記格納部に格納する
ことを特徴とする、請求項1記載の情報処理装置。
The read control unit stores the read request in the storage unit when it is determined that an access range related to the read request overlaps an access range related to one or more write requests stored in the storage unit. The information processing apparatus according to claim 1.
前記読出制御部は、読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なると判定した場合、前記読み出し要求の処理順序が前記読み出し要求とアクセス範囲の重なる書き込み要求の直後になるように前記読み出し要求を前記格納部に格納する
ことを特徴とする、請求項2記載の情報処理装置。
When the read control unit determines that the access range related to the read request overlaps with the access range related to one or more write requests stored in the storage unit, the processing order of the read requests overlaps the read request and the access range The information processing apparatus according to claim 2, wherein the read request is stored in the storage unit immediately after the write request.
前記格納部の格納する一以上の要求を処理順に読み出し所定の処理を実行する実行部をさらにそなえ、
前記実行部は、前記格納部から読み出した書き込み要求に係るアクセス範囲が、読み出し処理実行中の読み出し要求に係るアクセス範囲と重なると判断した場合、当該読み出し処理が完了するまで前記格納部から読み出した書き込み要求に対する所定の処理の実行を待機する
ことを特徴とする、請求項1〜3のいずれか1項記載の情報処理装置。
It further includes an execution unit that reads one or more requests stored in the storage unit in a processing order and executes a predetermined process,
If the execution unit determines that the access range related to the write request read from the storage unit overlaps the access range related to the read request during the read process, the execution unit reads from the storage unit until the read process is completed The information processing apparatus according to claim 1, wherein the information processing apparatus waits for execution of a predetermined process for a write request.
前記読出制御部は、前記格納部の格納する一以上の書き込み要求について、処理順とは逆の順序で検索し、前記読み出し要求のアクセス範囲と重なるか否かを判定する
ことを特徴とする、請求項1〜4のいずれか1項記載の情報処理装置。
The read control unit searches for one or more write requests stored in the storage unit in an order reverse to the processing order, and determines whether or not the access range of the read request overlaps. The information processing apparatus according to any one of claims 1 to 4.
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現するコンピュータに、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
処理を実行させることを特徴とする、エミュレーションプログラム。
A computer that reproduces a target device that includes a target storage unit and a plurality of target processing units that share a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation program characterized by causing a process of executing a read process related to the read request to be executed when there is no overlap as a result of the determination.
対象記憶部と前記対象記憶部の記憶領域を共用する複数の対象処理部とをそなえる対象装置を再現する情報処理装置におけるエミュレーション方法であって、
前記複数の対象処理部に対応する複数の仮想処理部の各々から発行される、前記対象記憶部に対応する仮想記憶部への書き込み要求を、処理される処理順に格納部に格納し、
前記仮想処理部から発行される前記仮想記憶部への読み出し要求について、当該読み出し要求に係るアクセス範囲が前記格納部の格納する一以上の書き込み要求に係るアクセス範囲と重なるか否かを判定し、
判定の結果、重ならない場合、前記読み出し要求に係る読み出し処理を実行する
ことを特徴とする、エミュレーション方法。
An emulation method in an information processing apparatus for reproducing a target device having a target storage unit and a plurality of target processing units sharing a storage area of the target storage unit,
Write requests to the virtual storage unit corresponding to the target storage unit, issued from each of the plurality of virtual processing units corresponding to the plurality of target processing units, are stored in the storage unit in the order of processing,
For a read request issued from the virtual processing unit to the virtual storage unit, determine whether the access range related to the read request overlaps the access range related to one or more write requests stored in the storage unit,
An emulation method, wherein if the result of determination is that there is no overlap, a read process related to the read request is executed.
JP2014096206A 2014-05-07 2014-05-07 Information processor, emulation program and emulation method Pending JP2015215641A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014096206A JP2015215641A (en) 2014-05-07 2014-05-07 Information processor, emulation program and emulation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014096206A JP2015215641A (en) 2014-05-07 2014-05-07 Information processor, emulation program and emulation method

Publications (1)

Publication Number Publication Date
JP2015215641A true JP2015215641A (en) 2015-12-03

Family

ID=54752511

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014096206A Pending JP2015215641A (en) 2014-05-07 2014-05-07 Information processor, emulation program and emulation method

Country Status (1)

Country Link
JP (1) JP2015215641A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851243A (en) * 2019-11-05 2020-02-28 东软集团股份有限公司 Flow access control method and device, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851243A (en) * 2019-11-05 2020-02-28 东软集团股份有限公司 Flow access control method and device, storage medium and electronic equipment
CN110851243B (en) * 2019-11-05 2022-04-12 东软集团股份有限公司 Flow access control method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
US10909012B2 (en) System having persistent memory
JP4928100B2 (en) Controller apparatus and method for improved data transfer
US10282192B1 (en) Updating device code through a bus
CN100592271C (en) Apparatus and method for high performance volatile disk drive memory access using an integrated DMA engine
JP5658197B2 (en) Computer system, virtualization mechanism, and computer system control method
WO2013170731A1 (en) Method for writing data into storage device and storage device
KR101183779B1 (en) Chipset support for binding and migrating hardware devices among heterogeneous processing units
CN109977037B (en) DMA data transmission method and system
US10459662B1 (en) Write failure handling for a memory controller to non-volatile memory
TW202225976A (en) Apparatus for virtualized registers and method and computer program product for accessing to the apparatus
Markussen et al. Smartio: Zero-overhead device sharing through pcie networking
TWI603199B (en) Capability based device driver framework
WO2022042127A1 (en) Coroutine switching method and apparatus, and device
US10831684B1 (en) Kernal driver extension system and method
JP2006268753A (en) Dma circuit and computer system
WO2019223445A1 (en) Hard disk read-write control method and apparatus, electronic device and storage medium
JP2015215641A (en) Information processor, emulation program and emulation method
US10909044B2 (en) Access control device, access control method, and recording medium containing access control program
JP2005258509A (en) Storage device
US20100312543A1 (en) Computer system for executing emulator emulating random access storage medium on virtual sequential access storage medium
JP2018520398A (en) Improved transmission of multimedia streams
JP6206524B2 (en) Data transfer device, data transfer method, and program
US20110191638A1 (en) Parallel computer system and method for controlling parallel computer system
JP2009181373A (en) Method of storing/reproducing network reception history, and information processor
JP2008097358A (en) Distributed processing system