This invention relates to simulating a logic design comprised of combinatorial logic and state logic.
Logic designs for computer chips typically include combinatorial elements and state elements. Combinatorial elements, such as AND gates and OR gates, combine two or more logic states to produce an output. State elements, such as latches and flip-flops (FFs), hold a logic state for a period of time, usually until receipt of an external clock signal.
Computer languages exist which allow designers to simulate logic designs, including combinatorial and state elements, prior to forming the logic on silicon. Examples of such languages include Verilog and Very High-Level Design Language (VHDL). Using these languages, a designer can write code to simulate a logic design, then execute the code in order to determine if the logic design performs properly.
Standard computer languages may also be used to simulate a logic design.
Referring to
In operation, process 10 selects (101), in response to a logic designer's input, graphic elements to generate a block diagram representation of a logic design. The graphics elements are selected from a graphics library and may include combinatorial logic and state logic elements. Graphics elements in the library may be definable or may have predefined functions. For example, the library may contain software objects that perform the function of a flip flop (FF) or a latch. The library may also contain graphics elements that are undefined, i.e., that have no code associated with them.
Each block in the block diagram may represent individual elements or combinations of elements. For example,
Once the graphical representation of the logic design has been completed (e.g.,
Referring to
Process 10 receives (106) intermediate computer code that is written by the logic designer. The computer code is “intermediate” in the sense that it is an application-specific code, from which simulation code, such as C++ or Verilog, may be generated. In one embodiment, the intermediate computer code includes a netlist that defines logic elements and the interconnections of those elements.
The intermediate code is entered by the designer for each graphic element. For example, the designer may select a graphic element and, using an interactive tool, enter computer code to define the combinatorial (or state) logic represented by that element. The designer may use software objects from the library, such as FFs, latches, AND gates, etc., in the intermediate code. Several objects may be combined within a single graphic element by writing intermediate computer code to effect the combination. For example, an array of FFs may be produced by combining objects from the library via the intermediate code. Graphic element 30 (
When designing the logic, the logic designer is constrained by process 10 to represent combinatorial logic and state logic using separate graphic elements. Representing the design using separate state logic and combinatorial logic elements ensures that each separate logic element will achieve its desired state with one iteration, making cycle-based simulation (defined below) possible. Accordingly, process 10 performs (107) an error check to determine if the intermediate code written by the designer includes state logic in combinatorial graphic elements, or vice versa. If a state logic element contains combinatorial logic or a combinatorial logic element contains state logic, process 10 issues (108) an error message to the designer. The error message may define the problem (i.e., interleaved combinatorial and state logic) and the graphic element that contains the problem. In this embodiment, process 10 requires the designer to correct the problem before process 10 proceeds further. To correct such a problem, the logic designer places the combinatorial logic and the state logic in different graphic elements (i.e., blocks).
Assuming that there are no problems with the design, or that the problems have been corrected, process 10 generates simulation code for the design. In this embodiment, process 10 generates either Verilog computer code or C++ computer code from the intermediate computer code. However, the simulation code is not limited to generating only these two types of simulation code. Any other type of suitable code, an example of which is VHDL, may be generated.
Generally speaking, the designer may select, e.g., via a graphical user interface (GUI) (not shown), which computer code (C++ or Verilog) process 10 will generate. The type of simulation desired may dictate the computer code that process 10 will generate, as described below.
In more detail, two types of logic simulations include cycle-based simulations and event-driven simulations. An event-driven simulation converges on an output of the logic design through multiple cycles. Convergence requires several passes through “logic cones” defined by the computer code.
Referring to
The syntax of some simulation languages, such as Verilog, is particularly amenable to event-driven simulations, since they interleave state and combinatorial logic. By contrast, C++ can be used to effect cycle-based simulations. Cycle-based simulations assume that the computer code is ordered correctly, meaning that each logic cone can be traced, with only one iteration, to provide an output. Thus, cycle-based simulations require only a single pass through a logic cone in order to determine its output.
As a result, cycle-based simulators are faster, e.g., an order of magnitude faster, than event-driven simulators (since cycle-based simulators require only one pass, versus multiple passes, through a logic cone). So, for example, on a platform, such as an Intel® Pentium® III microprocessor running at 700 MHz (megahertz), simulating 100 cycles of a complex logic design with an event-driven model might take 10 seconds, whereas performing the same simulation using a cycle-based simulator might take 1 second.
For the foregoing reasons, cycle-based simulations are generally preferred over event-driven simulations. Since separating the combinatorial logic from the state logic facilitates cycle-based simulations, process 10 provides a significant advantage to logic designers.
Referring back to
After process 10 generates (110) the Verilog code, process 10 runs (111) the Verilog code through an event-driven simulator program. The event-driven simulator program runs, and provides inputs (e.g., clock signals), to the Verilog code to generate a simulation of the operation of the logic design. To obtain an output of the logic design using the event-driven simulation, more than one pass through each logic cone defined by the Verilog code may be required.
If process 10 decides (109) to generate C++ code from the intermediate code (based, e.g., on an input from the logic designer), process 10 generates (112a) a topology of each graphic element of the logic design based on the intermediate code. In more detail, process 10 traces the logic gates through the intermediate code for each graphic element in order to determine how the logic gates are connected to one another. Essentially, process 10 obtains a gate topology from the intermediate code.
Process 10 identifies (113) clock domains in the topology. In this context, a clock domain comprises a set of logic elements (gates) that are triggered in response to the same clock pulse. For example, referring to
Once the clock domains are identified, process 10 determines (114a) the order in which the logic gates are to be simulated. This is referred to as “code ordering”, since the order in which the gates are simulated dictates the order of the resulting C++ code. Process 10 performs code ordering by tracing through each clock domain separately and assigning numerical values to the logic gates.
Referring to
Occasional renumbering may be required, resulting in branches whose gates are not sequentially numbered. This does not present a problem, so long as the assigned number of a child branch is higher than the assigned number of a parent branch. By way of example, assume that there are two starting points (trunks) for clock domain 64. These two starting points are gates 50 and 51. Since both are starting points, they are both assigned number “1”. Further assume that branch 72 is first traced starting with gate 51, resulting in gate 51 being assigned a “1”, gate 52 being assigned a “2”, gate 55 being assigned a “3”, and so forth. When branch 72 is retraced starting at gate 50 through path 73, gate 55 is renumbered “4”, gate 56 is renumbered “5”, and so forth. This may occur as often as necessary in order to ensure that each branch is numbered correctly.
Following the numbering, process 10 examines each clock domain and extracts, from each clock domain, the logic gates numbered “1”. These gates are stored in an area of a database. Once this is done, process 10 examines each clock domain and extracts, from each domain, the logic gates numbered “2”. These gates are stored in another area of the database. This is repeated then, for each set of logic gates numbered “3”, “4”, etc., until sets of all numbered logic gates are stored in different areas of the database. Using this database, process 10 generates simulation code (in this embodiment, C++ code) for the logic gates.
In more detail, for the set of logic gates assigned number “1”, process 10 generates C++ code. That is, process 10 defines the connections of the “1” gates, their states, clocks, and other dependencies in C++ code. Following the C++ code for the set of logic gates assigned number “1”, process 10 generates C++ code to simulate the set of logic gates assigned number “2”. Following the C++ code for the set of logic gates assigned number “2”, process 10 generates C++ code to simulate the set of logic gates assigned number “3”. This is repeated in sequence until C++ code is generated for all sets of logic gates (e.g., “4”, “5”, etc.) in the database.
The C++ simulation code may be generated from the intermediate code using a translation program (not shown) and referencing a database (not shown) that correlates the connections and functions specified in the intermediate code to C++ code. Any parameters or values included in the intermediate code are identified and applied to the C++ code.
After process 10 generates the C++ code, process 10 may run (115) the C++ code through a cycle-based simulator program (this path is indicated by the dotted line in
In some instances, a C++ compiler may be unable to compile the C++ code due to its size (i.e., the generated C++ code may be too long for a standard C++ compiler). In these instances, further processing may be required. This processing includes dividing (116) the C++ code into segments based on the numbered logic gates; writing (117) the divided C++ code into separate C++ files and batch files, and compiling the separate C++ files. Thus, in order to use a standard compiler, process 10 compiles C++ code for each set of numbered logic gates. The compiled C++ code may then be run through the cycle-based simulator program separately.
The states of each logic gate are stored in a database as well. Process 10 takes advantage of C++ inheritance capabilities to enable the C++ compiler to handle the large numbers of states that may result from a given logic model. That is, the state of an initial logic gate may be defined as a C++ class. The states of logic gates that depend from the initial logic gate may refer back to the state of the initial logic gate without actually including data for the state of the initial logic gate. This way, if the state of a subsequent gate depends on the state of a preceding gate, it is possible to obtain the state of the preceding gate without actually adding more data to the database.
Keeping the combinatorial logic and state logic separate according to process 10 makes it possible to identify clock domains and, thus, to perform cycle-based simulations. The advantages of cycle-based simulations are noted above.
Another advantage to keeping combinatorial and state logic separate is that it facilitates manual review of logic designs. Representing the different logic types (e.g., state and combinatorial) in different colors further facilitates the manual review. For example,
Additionally, by explicitly calling-out state logic elements while in the design environment, it is relatively easy to develop heuristic tools for providing time/size guidance for a given set of design parameters, such as operating frequency and/or chip area.
Process 10, however, is not limited to use with the hardware and software of
Each such program may be implemented in a high level procedural or object-oriented programming language to communicate with a computer system. However, the programs can be implemented in assembly or machine language. The language may be a compiled or an interpreted language.
Each computer program may be stored on an article of manufacture, such as a storage medium or device (e.g., CD-ROM, hard disk, or magnetic diskette), that is readable by a general or special purpose programmable machine for configuring and operating the machine when the storage medium or device is read by the machine to perform process 10. Process 10 may also be implemented as a machine-readable storage medium, configured with a computer program, where, upon execution, instructions in the computer program cause the machine to operate in accordance with process 10.
The invention is not limited to the specific embodiments set forth above. For example, process 10 is not limited to simulating only combinatorial and state logic elements. Other logic elements may be simulated. Process 10 is not limited to the computer languages set forth above, e.g., Verilog, C++, and VHDL. It may be implemented using any appropriate computer language. Process 10 is also not limited to the order set forth in
Other embodiments not described herein are also within the scope of the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4703435 | Darringer et al. | Oct 1987 | A |
4970664 | Kaiser et al. | Nov 1990 | A |
5128871 | Schmitz | Jul 1992 | A |
5212650 | Hooper et al. | May 1993 | A |
5220512 | Watkins et al. | Jun 1993 | A |
5258919 | Yamanouchi et al. | Nov 1993 | A |
5267175 | Hooper | Nov 1993 | A |
5278769 | Bair et al. | Jan 1994 | A |
5287289 | Kageyama et al. | Feb 1994 | A |
5297053 | Pease et al. | Mar 1994 | A |
5301318 | Mittal | Apr 1994 | A |
5371851 | Pieper et al. | Dec 1994 | A |
5384710 | Lam et al. | Jan 1995 | A |
5475605 | Lin | Dec 1995 | A |
5493507 | Shinde et al. | Feb 1996 | A |
5506788 | Cheng et al. | Apr 1996 | A |
5513119 | Moore et al. | Apr 1996 | A |
5544067 | Rostoker et al. | Aug 1996 | A |
5553002 | Dangelo et al. | Sep 1996 | A |
5568397 | Yamashita et al. | Oct 1996 | A |
5598347 | Iwasaki | Jan 1997 | A |
5603015 | Kurosawa et al. | Feb 1997 | A |
5604894 | Pickens et al. | Feb 1997 | A |
5629857 | Brennan | May 1997 | A |
5650947 | Okumura | Jul 1997 | A |
5663662 | Kurosawa | Sep 1997 | A |
5666289 | Watkins | Sep 1997 | A |
5673198 | Lawman et al. | Sep 1997 | A |
5685006 | Shiraishi | Nov 1997 | A |
5694579 | Razdan et al. | Dec 1997 | A |
5706476 | Giramma | Jan 1998 | A |
5717928 | Campmas et al. | Feb 1998 | A |
5724250 | Kerzman et al. | Mar 1998 | A |
5757655 | Shih et al. | May 1998 | A |
5809283 | Vaidyanathan et al. | Sep 1998 | A |
5828581 | Matumura | Oct 1998 | A |
5831869 | Ellis et al. | Nov 1998 | A |
5841663 | Sharma et al. | Nov 1998 | A |
5852564 | King et al. | Dec 1998 | A |
5889677 | Yasuda et al. | Mar 1999 | A |
5892678 | Tokunoh et al. | Apr 1999 | A |
5892682 | Hasley et al. | Apr 1999 | A |
5903469 | Ho | May 1999 | A |
5911061 | Tochio et al. | Jun 1999 | A |
5933356 | Rostoker et al. | Aug 1999 | A |
5937190 | Gregory et al. | Aug 1999 | A |
5963724 | Mantooth et al. | Oct 1999 | A |
5974242 | Damarla et al. | Oct 1999 | A |
6044211 | Jain | Mar 2000 | A |
6053947 | Parson | Apr 2000 | A |
6066179 | Allan | May 2000 | A |
6077304 | Kasuya | Jun 2000 | A |
6106568 | Beausang et al. | Aug 2000 | A |
6117183 | Teranishi et al. | Sep 2000 | A |
6120549 | Goslin et al. | Sep 2000 | A |
6132109 | Gregory et al. | Oct 2000 | A |
6135647 | Balakrishnan et al. | Oct 2000 | A |
6152612 | Liao et al. | Nov 2000 | A |
6161211 | Southgate | Dec 2000 | A |
6178541 | Joly et al. | Jan 2001 | B1 |
6205573 | Hasegawa | Mar 2001 | B1 |
6208954 | Houtchens | Mar 2001 | B1 |
6216256 | Inoue et al. | Apr 2001 | B1 |
6219822 | Gristede et al. | Apr 2001 | B1 |
6223148 | Stewart et al. | Apr 2001 | B1 |
6226780 | Bahra et al. | May 2001 | B1 |
6233540 | Schaumont et al. | May 2001 | B1 |
6233723 | Pribetich | May 2001 | B1 |
6234658 | Houldsworth | May 2001 | B1 |
6236956 | Mantooth et al. | May 2001 | B1 |
6260179 | Ohsawa et al. | Jul 2001 | B1 |
6272671 | Fakhry | Aug 2001 | B1 |
6275973 | Wein | Aug 2001 | B1 |
6292931 | Dupenloup | Sep 2001 | B1 |
6298468 | Zhen | Oct 2001 | B1 |
6311309 | Southgate | Oct 2001 | B1 |
6324678 | Dangelo et al. | Nov 2001 | B1 |
6327693 | Cheng et al. | Dec 2001 | B1 |
6353806 | Gehlot | Mar 2002 | B1 |
6353915 | Deal et al. | Mar 2002 | B1 |
6360356 | Eng | Mar 2002 | B1 |
6366874 | Lee et al. | Apr 2002 | B1 |
6378115 | Sakurai | Apr 2002 | B1 |
6381563 | O'Riordan et al. | Apr 2002 | B1 |
6381565 | Nakamura | Apr 2002 | B1 |
6389379 | Lin et al. | May 2002 | B1 |
6401230 | Ahanessians et al. | Jun 2002 | B1 |
6421816 | Ishikura | Jul 2002 | B1 |
6438729 | Ho | Aug 2002 | B1 |
6438731 | Segal | Aug 2002 | B1 |
6440780 | Kimura et al. | Aug 2002 | B1 |
6449762 | McElvain | Sep 2002 | B1 |
6457164 | Hwang et al. | Sep 2002 | B1 |
6473885 | Wallace | Oct 2002 | B1 |
6477683 | Killian et al. | Nov 2002 | B1 |
6477688 | Wallace | Nov 2002 | B1 |
6477689 | Mandell et al. | Nov 2002 | B1 |
6480985 | Reynolds et al. | Nov 2002 | B1 |
6487698 | Andreev et al. | Nov 2002 | B1 |
6490545 | Peng | Dec 2002 | B1 |
6505328 | Van Ginneken et al. | Jan 2003 | B1 |
6505341 | Harris et al. | Jan 2003 | B1 |
6516456 | Garnett et al. | Feb 2003 | B1 |
6519742 | Falk | Feb 2003 | B1 |
6519755 | Anderson | Feb 2003 | B1 |
6523156 | Cirit | Feb 2003 | B1 |
6539536 | Singh et al. | Mar 2003 | B1 |
RE38059 | Yano et al. | Apr 2003 | E |
6546528 | Sasaki et al. | Apr 2003 | B1 |
6574787 | Anderson | Jun 2003 | B1 |
6591407 | Kaufman et al. | Jul 2003 | B1 |
6643836 | Wheeler et al. | Nov 2003 | B1 |
6708321 | Wheeler et al. | Mar 2004 | B1 |
6721925 | Wheeler et al. | Apr 2004 | B1 |
6745160 | Ashar et al. | Jun 2004 | B1 |
20010018758 | Tanaka et al. | Aug 2001 | A1 |
20020023256 | Seawright | Feb 2002 | A1 |
20020038447 | Kim et al. | Mar 2002 | A1 |
20020042904 | Ito et al. | Apr 2002 | A1 |
20020046386 | Skoll et al. | Apr 2002 | A1 |
20020049957 | Hosono et al. | Apr 2002 | A1 |
20020059054 | Bade et al. | May 2002 | A1 |
20020112221 | Ferreri et al. | Aug 2002 | A1 |
20020138244 | Meyer | Sep 2002 | A1 |
20020166100 | Meding | Nov 2002 | A1 |
20030004699 | Choi et al. | Jan 2003 | A1 |
20030005396 | Chen et al. | Jan 2003 | A1 |
20030016206 | Taitel | Jan 2003 | A1 |
20030016246 | Singh | Jan 2003 | A1 |
20030036871 | Fuller et al. | Feb 2003 | A1 |
20030046051 | Wheeler et al. | Mar 2003 | A1 |
20030046053 | Wheeler et al. | Mar 2003 | A1 |
20030046054 | Wheeler et al. | Mar 2003 | A1 |
20030046640 | Wheeler et al. | Mar 2003 | A1 |
20030046642 | Wheeler et al. | Mar 2003 | A1 |
20030046648 | Wheeler et al. | Mar 2003 | A1 |
20030046649 | Wheeler et al. | Mar 2003 | A1 |
20030177455 | Kaufman et al. | Sep 2003 | A1 |
20040143801 | Waters et al. | Jul 2004 | A1 |
Number | Date | Country |
---|---|---|
0 404 482 | Dec 1990 | EP |
0 433 066 | Jun 1991 | EP |
0 720 233 | Jul 1996 | EP |
0 901 088 | Mar 1999 | EP |
1 065 611 | Jan 2001 | EP |
58-060559 | Apr 1983 | JP |
03-225523 | Oct 1991 | JP |
07-049890 | Feb 1995 | JP |
08-314892 | Nov 1996 | JP |
2001-068994 | Mar 2001 | JP |
WO 9837475 | Aug 1998 | WO |
WO 9855879 | Dec 1998 | WO |
WO 9939268 | Aug 1999 | WO |
WO 0065492 | Nov 2000 | WO |
Number | Date | Country | |
---|---|---|---|
20030046052 A1 | Mar 2003 | US |