TWI466025B - A method of simulating a sequential processor using a parallel processor - Google Patents

A method of simulating a sequential processor using a parallel processor Download PDF

Info

Publication number
TWI466025B
TWI466025B TW097121066A TW97121066A TWI466025B TW I466025 B TWI466025 B TW I466025B TW 097121066 A TW097121066 A TW 097121066A TW 97121066 A TW97121066 A TW 97121066A TW I466025 B TWI466025 B TW I466025B
Authority
TW
Taiwan
Prior art keywords
processor
interrupt
instruction
simulating
sequential
Prior art date
Application number
TW097121066A
Other languages
Chinese (zh)
Other versions
TW200951821A (en
Original Assignee
Nat Univ Chung Cheng
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 Nat Univ Chung Cheng filed Critical Nat Univ Chung Cheng
Priority to TW097121066A priority Critical patent/TWI466025B/en
Publication of TW200951821A publication Critical patent/TW200951821A/en
Application granted granted Critical
Publication of TWI466025B publication Critical patent/TWI466025B/en

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

使用平行處理機模擬循序處理機之方法Method of simulating a sequential processor using a parallel processor

本發明是有關於一種使用平行處理機模擬循序處理機之方法,尤指一種可快速、有效及正確進行所需之中斷模擬者。The present invention relates to a method of simulating a sequential processor using a parallel processor, and more particularly to an interrupt simulator that can be performed quickly, efficiently, and correctly.

一般使用A處理器1(真實處理器)以模擬B處理器2(虛擬處理器)時,如第1圖所示,其必須使用數個A處理器1上的指令以模擬一個B處理器2上的指令,而在真實的B處理器2上,中斷只可能發生在一個指令之前或者一個指令之後,但由於A處理器1使用n個A處理器1的指令模擬一個B處理器2的指令;因此,中斷可能會發生在一個虛擬的B處理器2指令的中間,第1圖中虛線部份係代表此中斷對於B處理器2而言包括的是不正常及正常的中斷發生情況,因為A處理器1模擬B處理器2的運行時,A處理器1必須完整的模擬完B處理器2的指令以後,才能讓中斷發生。且由於B處理器2上的一個指令在虛擬中斷發生時只可以有二種情況:1.這個指令完全還未被執行。When using A processor 1 (real processor) to simulate B processor 2 (virtual processor), as shown in Fig. 1, it must use several instructions on A processor 1 to simulate a B processor 2 The instruction on the real, on the real B processor 2, the interrupt can only occur before an instruction or after an instruction, but because the A processor 1 uses the instructions of the n A processor 1 to simulate a B processor 2 instruction Therefore, the interrupt may occur in the middle of a virtual B processor 2 instruction, and the dotted line in Figure 1 represents that the interrupt includes an abnormal and normal interrupt occurrence for the B processor 2 because When the A processor 1 simulates the operation of the B processor 2, the A processor 1 must completely simulate the execution of the B processor 2 command before the interrupt can occur. And because an instruction on the B processor 2 can only have two cases when a virtual interrupt occurs: 1. This instruction has not been executed yet.

2.這個指令已經完全執行完畢。2. This instruction has been fully executed.

所以使用A處理器1以模擬B處理器2時,必須保證中斷在一個虛擬的B處理器2指令之後或者之前發生。So when using A processor 1 to emulate B processor 2, it must be ensured that the interrupt occurs after or before a virtual B processor 2 instruction.

而目前解決這個問題最常見的方法如第2圖所 示,所有的中斷事件先暫時不處理,等到某些適當的時間點的時候才允許(檢查)中斷的發生,而此種方法主要的缺點是在真實的B處理器2上,中斷是可以隨時發生的,但使用A處理器1虛擬出B處理器2時,中斷只能在特定的時間點發生,因此A處理器1所虛擬出來的B處理器2與真實的B處理器2並非完全等價。The most common way to solve this problem is as shown in Figure 2. It is shown that all interrupt events are temporarily not processed, and the interrupt is allowed to be (checked) at some appropriate time. The main disadvantage of this method is that on the real B processor 2, the interrupt can be made at any time. Occurs, but when using the A processor 1 to virtualize the B processor 2, the interrupt can only occur at a specific point in time, so the B processor 2 virtualized by the A processor 1 and the real B processor 2 are not completely equal. price.

第二種方法如第3圖所示,使用roll back機制,當中斷發生時,系統會roll back到一個最近的checkpoint,當中斷發生的時候,馬上將B處理器2的狀態還原到checkpoint時候的狀態,隨後可以馬上處理中斷,或者以單步執行/模擬的技巧,執行到指令9以後再開始處理中斷;但是此種做法的主要缺點在於模擬的速度可能因此變慢許多,其次建立checkpoint的數量與位置(例如:在for loop中該在哪個地方建立check point)非常難以決定。The second method, as shown in Figure 3, uses the roll back mechanism. When an interrupt occurs, the system rolls back to a recent checkpoint. When the interrupt occurs, the state of the B processor 2 is immediately restored to the checkpoint. State, then interrupts can be processed immediately, or in a single-step execution/simulation technique, after execution of instruction 9 and then start processing interrupts; but the main disadvantage of this approach is that the speed of the simulation may be much slower, and the number of checkpoints is second. It is very difficult to decide with the location (for example: where to set up the check point in the for loop).

而第三種方法如第4圖所示,係使用特殊設計的VLIW處理器以做為A處理器1,由於VLIW可以在一個clock cycle的時間內完成數個指令,因此可以將B處理器上的指令用一個VLIW的指令來完成,如此可以保證在模擬B處理器2的執行時,中斷只會發生在任意相鄰的二個虛擬B處理器指令之間,而此種作法最主要的缺點在於硬體設計成本非常的高。The third method, as shown in Figure 4, uses a specially designed VLIW processor as the A processor 1. Since the VLIW can complete several instructions in one clock cycle, the B processor can be used. The instruction is completed with a VLIW instruction. This ensures that during the execution of the analog B processor 2, the interrupt will only occur between any two adjacent virtual B processor instructions, and the main disadvantage of this method. The hardware design cost is very high.

本發明之主要目的係在於,可快速、有效及正確進 行所需之中斷模擬。The main purpose of the present invention is to make it fast, effective and correct. The interrupt simulation required for the line.

為達上述之目的,本發明係一種使用平行處理機(此平行處理機也可為循序處理機)模擬循序處理機之方法,係當一個裝置或虛擬裝置(device/virtual device)產生中斷需要第二處理器執行時,會先由第一處理器查詢symbol table或藉由重組譯工程重新計算中斷點該設置於何;再由第一處理器上之中斷管理單元(interrupt management unit)設定一個中斷點(breakpoint),而該中斷點係為第一處理器目前正用以模擬第二處理器指令之最後一道指令位置;而當第一處理器執行至步驟二所述之指令時,該第一處理器則開始模擬第二處理器處理之中斷行為。In order to achieve the above object, the present invention is a method for simulating a sequential processor using a parallel processor (this parallel processor can also be a sequential processor), which is required when a device or virtual device (device/virtual device) generates an interrupt. When the second processor executes, the first processor queries the symbol table or recalculates the interrupt point by reorganizing the translation project; and then sets an interrupt by the interrupt management unit on the first processor. Breakpoint, which is the last instruction position that the first processor is currently using to simulate the second processor instruction; and when the first processor executes the instruction to step two, the first The processor then begins to simulate the interrupt behavior of the second processor processing.

請參閱『第5圖』所示,係本發明之處理方法示意圖。如圖所示:本發明係一種使用平行處理機模擬循序處理機之方法。Please refer to FIG. 5, which is a schematic diagram of the processing method of the present invention. As shown in the figure: The present invention is a method of simulating a sequential processor using a parallel processor.

步驟一:當一個裝置/虛擬裝置5(device/virtual device)產生中斷需要第二處理器4執行時,會先由第一處理器查詢symbol table6(或藉由重組譯工程重新計算得知),而該symbol table6中係記載第二處理器4之指令係由那些第一處理器3之指令所模擬。Step 1: When a device/virtual device 5 (storage device) generates an interrupt and needs to be executed by the second processor 4, the first processor first queries the symbol table 6 (or recalculated by recombination engineering). The instructions in the symbol table 6 that describe the second processor 4 are simulated by the instructions of the first processor 3.

步驟二:由第一處理器3上之中斷管理單元7(interrupt management unit)設定一個中斷點71(breakpoint),而該中斷點71係為第一處理器3目前 正用以模擬第二處理器4指令之最後一道指令位置。Step 2: A breakpoint 71 is set by the interrupt management unit 7 on the first processor 3, and the breakpoint 71 is the current processor 3 It is being used to simulate the last instruction position of the second processor 4 instruction.

步驟三:當第一處理器3執行至步驟二所述之指令時(本實施例中為指令9執行完以後),該第一處理器3則開始模擬第二處理器4處理之中斷行為。Step 3: When the first processor 3 executes the instruction described in the second step (after the execution of the instruction 9 in this embodiment), the first processor 3 starts to simulate the interrupt behavior of the processing by the second processor 4.

如此,可使本發明於多個核心上運行的模擬器時,可使模擬器之各主要元件(如:數個cpu、數個device、每個CPU上所可能產生的例外(exception)狀況、非常見之狀況等等)達到快速、有效及正確進行所需之中斷模擬,以保證模擬的正確性。In this way, when the emulator running on multiple cores of the present invention can make the main components of the emulator (such as: several cpu, several devices, exceptions that may be generated on each CPU, Very common conditions, etc.) To achieve the required interrupt simulation quickly, efficiently and correctly to ensure the correctness of the simulation.

綜上所述,本發明使用平行處理機模擬循序處理機之方法可有效改善習用之種種缺點,可快速、有效及正確進行所需之中斷模擬,進而使本發明之產生能更進步、更實用、更符合消費者使用之所須,確已符合發明專利申請之要件,爰依法提出專利申請。In summary, the method of using the parallel processor to simulate the sequential processor can effectively improve various shortcomings of the prior art, and can quickly, effectively and correctly perform the required interrupt simulation, thereby making the invention more progressive and practical. It is more in line with the needs of consumers, and it has indeed met the requirements of the invention patent application, and has filed a patent application according to law.

惟以上所述者,僅為本發明之較佳實施例而已,當不能以此限定本發明實施之範圍;故,凡依本發明申請專利範圍及發明說明書內容所作之簡單的等效變化與修飾,皆應仍屬本發明專利涵蓋之範圍內。However, the above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto; therefore, the simple equivalent changes and modifications made in accordance with the scope of the present invention and the contents of the invention are modified. All should remain within the scope of the invention patent.

(習用部分)(customized part)

A處理器‧‧‧1A processor ‧‧1

B處理器‧‧‧2B processor ‧‧2

(本發明部分)(part of the invention)

第一處理器‧‧‧3First processor ‧‧3

第二處理器‧‧‧4Second processor ‧‧4

虛擬裝置‧‧‧5Virtual device ‧‧5

symbol table‧‧‧6Symbol table‧‧‧6

中斷管理單元‧‧‧7Interrupt management unit ‧‧7

中斷點‧‧‧71Break point ‧‧‧71

第1圖,係習用之虛擬指令執行示意圖。Figure 1 is a schematic diagram of the execution of virtual instructions.

第2圖,係習用critical section之處理示意圖。Figure 2 is a schematic diagram of the processing of the critical section.

第3圖,係習用roll back機制之處理示意圖。Figure 3 is a schematic diagram of the processing of the custom roll back mechanism.

第4圖,係習用VLIW處理器之處理示意圖。Figure 4 is a schematic diagram of the processing of a conventional VLIW processor.

第5圖,係本發明之處理方法示意圖。Fig. 5 is a schematic view showing the treatment method of the present invention.

第一處理器‧‧‧3First processor ‧‧3

第二處理器‧‧‧4Second processor ‧‧4

虛擬裝置‧‧‧5Virtual device ‧‧5

symbol table‧‧‧6Symbol table‧‧‧6

中斷管理單元‧‧‧7Interrupt management unit ‧‧7

中斷點‧‧‧71Break point ‧‧‧71

Claims (3)

一種使用平行處理機模擬循序處理機之方法,其包括:步驟一:當一個虛擬裝置(virtual device)產生中斷需要第二處理器執行時,會先由第一處理器查詢symbol table或藉由重組譯工程重新計算得知;步驟二:由第一處理器上之中斷管理單元(interrupt management unit)設定一個中斷點(breakpoint),而該中斷點係為第一處理器目前正用以模擬第二處理器指令之最後一道指令位置;以及步驟三:當第一處理器執行至步驟二所述之指令時,該第一處理器則開始模擬第二處理器處理之中斷行為。A method for simulating a sequential processor using a parallel processor includes the following steps: Step 1: When a virtual device generates an interrupt and needs to be executed by the second processor, the first processor queries the symbol table or reorganizes The translation project recalculates; step 2: a breakpoint is set by an interrupt management unit on the first processor, and the interrupt point is currently used by the first processor to simulate the second The last instruction location of the processor instruction; and step three: when the first processor executes the instruction to step two, the first processor begins to simulate the interrupt behavior of the second processor processing. 依申請專利範圍第1項所述之使用平行處理機模擬循序處理機之方法,其中,該symbol table中係記載第二處理器之指令係由那些第一處理器之指令所進行模擬。The method for simulating a sequential processor by using a parallel processor according to the first aspect of the patent application, wherein the symbol table records that the instructions of the second processor are simulated by the instructions of the first processor. 依申請專利範圍第1項所述之使用平行處理機模擬循序處理機之方法,其中,該重組譯工程係重新計算第二處理器之指令係由那些第一處理器之指令所進行模擬。The method for simulating a sequential processor using a parallel processor according to claim 1 of the scope of the patent application, wherein the recombination engineering recalculates the instructions of the second processor by the instructions of the first processor.
TW097121066A 2008-06-06 2008-06-06 A method of simulating a sequential processor using a parallel processor TWI466025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW097121066A TWI466025B (en) 2008-06-06 2008-06-06 A method of simulating a sequential processor using a parallel processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW097121066A TWI466025B (en) 2008-06-06 2008-06-06 A method of simulating a sequential processor using a parallel processor

Publications (2)

Publication Number Publication Date
TW200951821A TW200951821A (en) 2009-12-16
TWI466025B true TWI466025B (en) 2014-12-21

Family

ID=44871862

Family Applications (1)

Application Number Title Priority Date Filing Date
TW097121066A TWI466025B (en) 2008-06-06 2008-06-06 A method of simulating a sequential processor using a parallel processor

Country Status (1)

Country Link
TW (1) TWI466025B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200710727A (en) * 2005-09-09 2007-03-16 Benq Corp Program execution tracking method, system and machine-readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200710727A (en) * 2005-09-09 2007-03-16 Benq Corp Program execution tracking method, system and machine-readable storage medium

Also Published As

Publication number Publication date
TW200951821A (en) 2009-12-16

Similar Documents

Publication Publication Date Title
US9098653B2 (en) Verifying processor-sparing functionality in a simulation environment
Parasyris et al. Gemfi: A fault injection tool for studying the behavior of applications on unreliable substrates
JP4472615B2 (en) Programmable device modeling method and apparatus
JP2005011342A5 (en)
Schmidt et al. Checkpoint/restart and beyond: Resilient high performance computing with FPGAs
US10698805B1 (en) Method and system for profiling performance of a system on chip
de Aguiar Geissler et al. Soft error injection methodology based on QEMU software platform
US9760663B2 (en) Automatic generation of properties to assist hardware emulation
JP2018081400A5 (en)
Ferraretto et al. Simulation-based fault injection with QEMU for speeding-up dependability analysis of embedded software
US20120197625A1 (en) Data-dependency-Oriented Modeling Approach for Efficient Simulation of OS Preemptive Scheduling
Kranitis et al. Optimal periodic testing of intermittent faults in embedded pipelined processor applications
TW201506786A (en) System and method for debugging procedure
Kantrowitz et al. Functional Verification of a Multiple-issue, Pipelined, Superscalar Alpha Processor - the Alpha 21164 CPU Chip
TWI466025B (en) A method of simulating a sequential processor using a parallel processor
JP6249827B2 (en) Simulation apparatus and simulation program
CN112329369B (en) Method for debugging software on chip simulation model
CN107329869B (en) Simulation method and device of system on chip
Campagna et al. An hybrid architecture to detect transient faults in microprocessors: an experimental validation
Ko et al. Hardware-in-the-loop simulation for CPU/GPU heterogeneous platforms
JP2828590B2 (en) Microprogram verification method
US8914274B1 (en) Method and system for instruction set simulation with concurrent attachment of multiple debuggers
Kolan et al. Post-silicon validation of the ibm power9 processor
Carlisle IV et al. Dynamic robust single-event upset simulator
Fidalgo et al. A modified debugging infrastructure to assist real time fault injection campaigns

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees