The present invention relates in general to the field of simulating and verifying the logical correctness of a digital circuit design on a register-transfer level and in particular to verifying a register-transfer level, design of an execution unit.
Modern execution units have a complex structure and implement a very large instruction set. For example, floating-point units (FPUs) of IBM system z9 and z10 implement more then 330 instructions with 21 different instruction formats and over ten different precisions. To ensure maximum reliability of such execution units, verification has to cover as much of the relevant state space as possible.
Typically, simulation is used to verify sequences of instructions executed in a model simulation environment. To make full use of the limited time available, realistic and interesting test cases as well as high simulation performance are essential. However, current simulation methods lack at least one of these characteristics.
Generally, there are the following existing approaches so the simulation of an execution unit. A first approach is test case generation using random number generators. A simple program generates input vectors that are then simulated in a simulation environment with a software-based model simulator. However this creates no realistic test scenarios, uses no knowledge about data formats, architecture, etc and only low simulation performance can be achieved.
A second approach is test case generation using architecture test case generators. A sophisticated program implemented in a high-level programming language such as C/C++ generates test cases that take into account all necessary aspects of the underlying processor architecture. The resulting test cases are then simulated in a simulation environment, with a software-based model simulator. However the test case generation is slow and also only low simulation performance can be achieved.
In the Patent Application Publication US 2009/0070717 A1 “Method and system for generation coverage data for a switch frequency of HDL or VHDL signals” by Deutschle et al a method and system for generating coverage data for a switch frequency of HDL or VHDL signals is disclosed. The disclosed method and system for generating coverage data for a switch frequency of HDL or VHDL signals are using a filtering algorithm or filtering rules for signals occurring in the HDL or VHDL hardware description model that is present at the register-transfer level. The method for generating coverage data for a switch frequency of hardware description language (HDL) signals, comprises the steps of providing a HDL hardware description model, within a register transfer level, providing a filtering algorithm for signals occurring in the HDL hardware description model, extracting signals from the HDL hardware description model, according to the filtering algorithm in order to get relevant signals, performing a simulation process on a compiled representation of the HDL hardware description model, performing a checking routine for the relevant signals in every cycle and storing the relevant signals in a data base.
Usually, the drivers, monitors, and checkers of the simulation environments are also written in high-level programming languages and thus are separate from the simulation model. This degrades simulation performance even further.
Using so-called hardware accelerators (e.g., AWAN machines) instead of software-based model simulators would improve the simulation performance drastically. However, this approach does not work well with the existing software-based test case generators and separate drives, monitors, and checkers. The simulation process would be slowed down and any potential performance benefit would be negated.
In one illustrative embodiment, a method, in a data processing system, is provided for verifying a register-transfer level design of an execution unit. The illustrative embodiment generates a set of instruction records associated with a test case The illustrative embodiment stores the set of instruction records in a buffer. For each instruction record in the set of instruction records associated with the test case, the illustrative embodiment: retrieves the instruction record from the buffer; sends the instruction record to both a reference model, and an execution unit in the data processing system, wherein the reference model is reference for a register-transfer level design and wherein the execution unit is a new register-transfer level design to be verified; executes separately, by the reference model and the execution unit, the instruction record; sends separately, by the reference model and the execution unit, results of the execution of the instruction record to a result checker in the data processing system; compares the results of the execution of the instruction record from both the reference model and the execution unit; responsive to a mismatch in the results, indicates a failure of the test case to the test case generator; stops the verification of the test case; and outputs all data associated with the test case from the buffer for analysis.
In other illustrative embodiments, a computer program product comprising a computer useable or readable medium having a computer readable program is provided. The computer readable program, when executed on a computing device, causes the computing device to perform various ones, and combinations of, the operations outlined above with regard to the method illustrative embodiment.
In yet another illustrative embodiment, a data processing system is provided. The data processing system may comprise one or more processors and a memory coupled to the one or more processors. The memory may comprise instructions which, when executed by the one or more processors, cause the one or more processors to perform various ones, and combinations of, the operations outlined above with regard to the method illustrative embodiment.
These and other features and advantages of the present invention will be described in, or will become apparent to those of ordinary skill in the art in view of, the following detailed description of the example embodiments of the present invention.
A preferred embodiment of the invention, as described in detail below, is shown in the drawings, in which
It will be readily understood that the components of the present invention, as generally described and illustrated in the Figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the apparatus, system, and method of the present invention, as presented in the Figures, is not intended to limit the scope of the invention, as claimed, but merely representative of selected embodiments of the invention.
Reference throughout this specification to “a select embodiment,” “one embodiment,” or “an embodiment” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of the phrases “a select embodiment,” “in one embodiment,” or “in an embodiment” in various places throughout this specification are not necessarily referring to the same embodiment.
The illustrated embodiment of the invention will be best understood by reference to the drawings, wherein like part are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain select embodiments of devices, systems, and processes that are consistent with the invention as claimed herein.
Referring to
According to the invention the test case generator 10, the driver 20, the reference model 30 for the execution unit 40 and the result checker 50 are written in a hardware description language, and compiled directly in a simulation model of the simulation environment 1. The driver 20 uses test case data produced by the test case generator 10 to feed the execution unit 40, like a floating-point unit (FPU), fixed-point unit (FixPU) or any other data manipulating unit, and the reference model 30. When results are available from both the execution unit. 40 and the reference model 30, the result checker 50 compares both results and flags an error if there is a difference.
Like the execution unit 40, the test case generator 10, the driver 20, the reference model 30, and the result checker 50 are implemented in a synthesizable hardware description language such as Very High Speed Integrated Circuits Hardware Description Language (VHDL) and are inserted into the design, i.e., the sources from which the simulation model 1 is compiled, as VHDL modules. Embodiments of the inventive simulation environment 1 are not limited to running on hardware accelerators such as the ANAN machines. They can also be executed using software-based model simulators, e.g., the IBM MESA simulator and, with minor changes, field-programmable gate array (FPGA) chips.
Referring to
The generation of instruction records, which form the instruction stream that is simulated, is decoupled from their issue to the driver 20, from where they are issued to the execution unit 40 and the reference model 30. Thus, the generation of instruction records and the storing of these instruction records into the buffer 140 run in parallel to the actual execution of the corresponding instructions in the execution unit 40 and the reference model 30.
The test case generator 10 has a simple interface to the user, i.e., a verification engineer, and the driver 20. The user provides a list 112 of valid instructions and can set certain parameters to configure the test case generation. The driver 20 requests the next instruction record via “get next” instruction, for example. Furthermore, it can request older instruction records in order to support so-called stalls, rejects, kills, and flushes, which require certain instructions of the instruction stream to be re-issued.
In each simulation cycle, the instruction generator 110 randomly selects an instruction based on a so-called valid instruction list 112 that contains all valid instructions along with their probabilities. Referring to
The valid instruction list 112 can be changed without recompiling the simulation model 1, which usually is a very time-consuming step. By modifying the valid instruction list 112, the user is able to easily target specific scenarios.
The instruction generator 110 contains knowledge about memory/general-purpose-register (GPR) input operands an instruction requires. After randomly selecting a valid instruction, the instruction generator 110 sends the corresponding data format information to the data generator 130. The instruction generator 110 sends the instruction's so-called operation code (opcode) to the generation control block 120.
When a new test case begins, the instruction generator 110 automatically produces one load instruction for each register in the execution unit 40, e.g., for the floating-point registers in a floating point unit. This initializes both the execution unit 40 and the reference model 30 to the same state and provides an easy way to store the initial register values in the buffer 140.
Referring to
A data format comprises an instruction format, a precision, and a number domain. The instruction formats are defined in the processor architecture and specify the number of operands, usually between zero and three, the order of these operands, and their location, e.g. memory, FPR, GPR, etc. The precision defines the length of an operand, e.g., short with 32 bits, long with 64 bits, and extended with 128 bits, by controlling the multiplexer 137. The number domain specifies how the operand data is encoded, e.g., binary fixed-point, binary-coded decimal (BCD), binary floating-point (BFP), hexadecimal floating-point (RFP), decimal floating-point (DFP). But not all combinations of instruction format, precision, and number domain are valid.
The user can control the data generator 130 through a set of probabilities, e.g., the probability of generating a zero, a positive number, an infinity, etc.; the probability of reusing register addresses; the probability of instruction-specific rounding modes. The probabilities are set via sticks 70 that are loaded into the simulation model 1 at runtime.
The generation control block 120 combines the instruction's operation code generated by the instruction generator 110 and the information provided by the data generator 130 into an instruction record. The instruction record is a set of all processor-architecture-level information associated with an instruction. The instruction record contains all information the driver needs to drive the execution unit 40 and the reference model 30.
For example, the instruction record comprises an operation code providing the instruction's operation code as defined by the processor architecture, memory/GPR operands providing memory/GPR operands for the instruction, register address providing addresses of the registers used by the instruction, further fields providing further instruction-specific input data as defined by the processor architecture, if required, and control registers providing settings of control register that are relevant for the instruction, e.g., IEEE exception enable bits and rounding modes, if required.
The generation control block 120 contains a counter 160 that counts how many instructions records have been stored into the buffer 140. Each cycle, until the pre-defined number of instructions per test case is reached, the generation control block 120 stores a new instruction record into the buffer 140 and increments the counter 160. Once all instructions of the current test case have been generated, i.e., the counter 160 equals the pre-defined number of instructions per test case, the generation control block 120 does not store further instruction records and waits until the next test case begins. When a new test case begins, the counter 160 is reset to zero.
The buffer 140 stores the generated instruction records. Each of the instruction records can be written by the generation control block 120 and read by the issue control block 150 at the same time. The number of entries in the buffer 140 is the product of the pre-defined number of instructions per test case and a pre-defined number of test cases. This allows the buffer 140 to store not only the current test case but also a certain number of test cases generated and simulated before the current one. This is essential when investigating fails that are caused by instructions or events in previous test cases.
The issue control block 150 is the interface of the test case generator 10 to the driver 20. The issue control block 150 contains a counter 170 that gives the index of the next instruction record to be given to the driver 20. When the driver 20 signals “get next”, the issue control block 150 sends the next instruction record plus its index and a “last” flag, and increments the counter 170. When the driver 20 needs to re-issue previous instructions, e.g., due to a kill or a flush, the driver 20 signals “resume” along with the index of the required instruction record. The issue control block 150 sets its counter 170 to this index and returns the corresponding instruction record plus index and “last” flag. When the last instruction has successfully completed its execution in both execution unit 40 and reference model 30, the driver 20 signals “finish”, the issue control Nock 150 resets it counter 170 to zero, and the test case generator 10 begins generating the next test case.
If the result checker 50 sees a mismatch between the results of execution unit 40 and reference model 30, or an error occurs in the execution unit 40, the driver 20 will signal “fail”. This causes the test case generator 10 to raise a certain internal, fail signal and stop modifying the buffer 140 for a pre-defined number of cycles. A small, external fail collect program, which is triggered in an interval that matches the pre-defined number of cycles, monitors the internal fail signal. If the signal is active, the test case generator 10 reads out all data in the buffer 140, i.e., the current test case and a certain number of previous test cases, and writes this data into a file. After waiting the pre-defined number of cycles, the test case generator 10 lowers its internal fail signal and begins generating the next test case.
Since the external fail collect program is only called in a certain interval, the performance impact is minimal. The data contained in the file written by the fail collect program allows the user to reproduce and analyze failing test cases in another, software-based simulation environment, which could reuse parts of the simulation environment 1 described herein.
Referring to
Furthermore,
The medium can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device) or a propagation medium. Examples of a computer-readable medium include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk, and an optical disk. Current examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W), and DVD. The data processing system 706 suitable for storing and/or executing program code 704 will include at least one processor 708 coupled directly or indirectly to memory elements 710 through a system bus 712. The memory elements 710 can include local memory 734 employed during actual execution of the program code, bulk storage 716, and cache memories 718 which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution. Input/output or I/O devices 720 (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers.
Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modems, and Ethernet cards, are just a few of the currently available types of network adapters.
Embodiments of the present invention achieve advantageously a very high simulation performance and thus high coverage of state space. The test case generator is able to produce realistic test scenarios that can be controlled by user-defined settings. These user-defined settings can be modified at runtime. Test case generator, driver, reference model, and result checker are separated blocks, which allows easy reuse. Failing test cases can be reproduced in other, software-based simulation environments.
Number | Date | Country | Kind |
---|---|---|---|
09179697 | Dec 2009 | EP | regional |
Number | Name | Date | Kind |
---|---|---|---|
6701489 | Lam | Mar 2004 | B1 |
6925405 | Adir et al. | Aug 2005 | B2 |
6931611 | Martin et al. | Aug 2005 | B2 |
6993736 | Syed et al. | Jan 2006 | B2 |
7133816 | Adir et al. | Nov 2006 | B2 |
7143376 | Eccles | Nov 2006 | B1 |
7437692 | Oberlaender | Oct 2008 | B2 |
7464015 | Iwashita | Dec 2008 | B2 |
7478346 | Hsu et al. | Jan 2009 | B2 |
7561999 | Iwamoto et al. | Jul 2009 | B2 |
7865793 | Letz et al. | Jan 2011 | B2 |
8055492 | Adir | Nov 2011 | B2 |
20030115562 | Martin et al. | Jun 2003 | A1 |
20050102572 | Oberlaender | May 2005 | A1 |
20050149805 | Syed et al. | Jul 2005 | A1 |
20050149898 | Hakewill et al. | Jul 2005 | A1 |
20070157134 | Cheng et al. | Jul 2007 | A1 |
20080028347 | Hiraoglu et al. | Jan 2008 | A1 |
20090070717 | Deutschle et al. | Mar 2009 | A1 |
20090241074 | Tanimoto | Sep 2009 | A1 |
Entry |
---|
Adir et al., Genesys-Pro: Innovations in Test Program Generation for Functional processor Verification, IEEE Design and Test of Computers, pp. 84-93, Mar. 2004. |
Watanabe et al., An SPU Reference Model for Simulation, Random Test Generation and Verification, Asia and South Pacific Conference on Design Automation, pp. 860-866, Jan. 2006. |
Adir et al., Adaptive Test Program Generation: Planning for the Unplanned, Seventh IEEE International High Level Design Validation and Test Workshop, pp. 83-88, Oct. 2002. |
Ghosh, Indradeep, “High Level Test Generation for Custom Hardware: An Industrial Perspective”, IEEE, Proceedings of the 14th Asian Test Symposium (ATS '05), 2005, 1 page. |
Murray, David, “Synthesizable Verification IP Speeds Design Cycle”, EE Times, 2003, 10 pages. |
Oddos, Yann et al., “MYGEN: Automata-Based On-line Test Generator for Assertion-Based Verification”, Great Lakes Symposium on VLSI, Proceedings of the 19th ACM Great Lakes Symposium on VLSI, Boston Area, MA, USA, Session: Testing, 2009, pp. 75-80. |
Zhang, Liang et al., “A Framework for Automatic Design Validation of RTL Circuits Using ATPG and Observability-Enhanced Tag Coverage”, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 25, No. 11, Nov. 2006, pp. 2526-2538. |
Zhigang, Yin et al., “A Novel RTL Behavioral Description Based ATPG Method”, Journal of Computer Science and Technology, May 2003, vol. 18, No. 3, pp. 308-317. |
Number | Date | Country | |
---|---|---|---|
20110154110 A1 | Jun 2011 | US |