This invention relates to logic simulation.
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.
Logic simulation includes storing a first state to identify in a simulation of a logic design whether a node included in the logic design has a logic high value Logic simulation also includes storing a second state to identify in simulation of the logic design whether the node has a logic low value and storing a third state to identify in simulation of the logic design whether the node has an undefined state. The logic simulation determines an output of the node in simulation of the logic design based on the first state, the second state, and the third state.
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 and execute the code in order to determine if the logic design performs properly.
In simulating the logic design, the code can perform two state simulation and/or four state simulation. In two state simulation, the code models two logic states: one and zero. In four state simulation, the code models the one and zero logic states handled during two state simulation, an undefined state, and a high impedance state. Two state simulation can quickly execute and detect errors in high and low logic states in the logic design while four state simulation can detect design problems when signals in the logic design are not initialized (e.g., are undefined) or driven by other logic (e.g., have high impedance).
Standard computer languages may also be used to simulate a logic design. One example of a standard computer language that may be used is C++.
Referring to
By using three state simulation, the process 100 can model a state at a node in the block diagram as a logic high (e.g., a one), as a logic low (e.g., a zero), or as an undefined value. (A logic high may be a zero if a logic low is a one.) In this way, the process 100 can perform simulation as in a traditional two state simulation with logic high and low states while detecting undefined states (improperly reset or improperly initialized designs) quickly, accurately, and early in the logic design and simulation process. Upon detection of an undefined state, the logic designer can change the logic design so as to get the state properly initialized, and so forth.
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 102 (e.g.,
The process 100 writes 106 a design wirelist in computer code that simulates the logic design with each of the graphic elements.
Referring to
For example, the process 100 may include receiving intermediate computer code (e.g., an application-specific code such as C++ or Verilog) for each graphic element written by the logic designer. Assuming that there are no problems in the design or that the problems have been corrected, the process 100 may generate standard simulation code for the design in any kind of computer code, such as C++, Verilog, VHDL, and other similar codes.
Once the process 100 has computer code that simulates the logic design, the process 100 performs 108 three state simulation initialization checks for the logic elements included in the logic design. In executing the code in the simulation, the process 100 checks each tri-state signal (those signals on wires that connect tri-state drivers as tagged in the code) to make sure that two (or more) drivers are not driving at the same time on any bit of a tri-state signal. The process 100 checks every bit position of the tri-state signal, e.g., each wire driving a logic device, to make sure that at least one tri-state driver is enabled, e.g., that a signal exists on the wire. Any bit of the signal that is not driven by one driver is flagged as not being driven or as multiply driven.
Referring to
The tri-state process 400 may store state information in a database. If the code is in a language with inheritance capabilities such as C++, the tri-state process 400 can enable the code compiler to handle the large number of states that may result from a given logic model. That is, the state of an initial logic gate may be defined as a class (e.g., a C++ class). The states of the 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.
When the tri-state process 400 encounters 404 a tri-state signal in the code, the tri-state process 400 determines 406 if two (or more) drivers are driving any bit of the signal. If so, then a potential contention exists on the wire line, so the output of the tri-state signal has an undefined state. The tri-state process 400 sets 408 the undefined bit for that signal, indicating an undefined state for that signal. The tri-state process 400 continues 410 executing the code. Alternatively, the tri-state process 400 may terminate or suspend the simulation upon detection of the undefined state and issue 412 an error message to the logic designer as described above. The logic designer fixes the problem and the tri-state process 400 can resume simulation of the logic design at the point of termination or at the beginning of the code.
If two (or more) drivers do not drive the signal, then the tri-state process 400 determines 414 if any source drives the signal. If not, then the tri-state process 400 can deduce on the fly that the signal has a high impedance state. The tri-state process 400 may not hold information in a bit on the high impedance state, but, if it does, it sets 416 a high-impedance bit for that signal. Whether the tri-state process 400 sets a high impedance bit or not, the tri-state process 400 may continue 410 executing the code or may issue 412 an error message as described above.
If less than two drivers but more than zero drivers drive the signal, then one driver drives the signal. The tri-state process 400 sets 418 the appropriate one of the logic high and logic low states for the signal, logic high for a signal state of one and logic low for a signal state of zero. The tri-state process 400 continues 410 executing the code as described above.
Referring again to
If the checks were successful, then the process 100 may perform 112 another check or checks, such as four state simulation. Four state simulation typically involves simulating the logic design using four bits to represent four logic states: logic high, logic low, undefined, and high impedance. Performing four state simulation can help refine the initialization model deemed successful under the previously performed three state simulation. The process 100 need not perform the four state simulation or any other checks after three state simulation.
The process 100 can also determine 114 if the four state simulation was successful. In other words, the process 100 determines if any states are tagged as undefined and/or as high impedance. This check can be performed, for example, after the four state simulation. If the checks were unsuccessful, then the process 100 ends until another design is entered as described above. If the checks were successful, then the process ends 116, indicating that the logic design is properly initialized.
In executing the code during simulation, the process 100 performs logic computations, e.g., AND operations for AND gates, and attempts to store results of the logic computations in memory. Memory is typically divided into pages (sometimes called virtual memory pages), each page including a defined amount of data (usually expressed in bytes) corresponding to code. If a page is write-protected, then the process 100 cannot write the result to memory, resulting in an error.
The process 100 may use the fact that pages can be write-protected to handle forced results. A result is forced if the logic designer, typically for purposes of simulation, defines the result to be a particular value regardless of the actual result of a logic computation.
While executing the code, the process 100 could check each node to determine if the node has a forced value. This determination, however, can slow down the simulation and use valuable processing resources. Instead, the process 100 may identify forced nodes while writing the design wirelist and set access rights for the page or pages including those forced nodes as write-protected. Then, when the process 100 executes the code, forced nodes may be identified by an attempt to write to a write-protected memory page rather than by a slower node-by-node evaluation of forced values.
Referring to
The force process 500 may perform 502 a logic computation and attempt 504 to store the result of the logic computation in memory. If storage cannot occur for some reason, the force process 500 generates an exception indicating an error condition. If the force process 500 does not generate an exception in attempting to store the result in the memory page, then the force process 500 stores 506 the result in memory and continues 508 executing the code.
If the force process 500 does generate an exception, then the force process 500 calls or executes an exception handler to interrogate the system to determine the reason for the exception. A plurality of exception handlers may be available to the force process 500, each exception handler capable of handling a particular type of exception, e.g., write access errors, invalid memory address, etc. Typically, exception handlers are accessed in a predetermined order, where the exception is passed from one exception handler to the next until the exception reaches the exception handler capable of handling that particular type of exception. In this example, the force process 500 first passes the exception to a first exception handler capable of handling write access errors.
The first exception handler determines 510 if the exception was generated because of a write access problem. If not, then the first exception handler passes 512 the exception to the next exception handler according to the predetermined order. This exception handler either handles the exception or passes the exception to the next exception handler, and so on until the exception reaches the appropriate exception handler and is handled.
If the error was generated because of a write access problem, then the first exception handler handles the exception. The first exception handler knows which instruction in the code caused the exception because the instruction that caused the force process 500 to generate the exception is usually included in the exception. The first exception handler stores 514 this instruction, as yet unexecuted, at the top of a non-write protected memory page. This memory page is typically a memory page that does not include any of the code being executed by the process 100 and may be a page set aside for use by the first exception handler. Immediately following this instruction in the memory page, the first exception handler inserts 516 an illegal instruction that will always generate an exception when executed. The first exception handler also unprotects 518 the original write-protected memory page where the force process 500 tried to store the result.
The force process 500 then redirects code execution to start execution 520 at the top of the memory page used by the first exception handler. The originally failed instruction executes and because the original memory page is no longer write-protected, the force process 500 can write the result to the original memory page. In this way, the force process 500 can execute the instruction as if the artificially forced value was not present and therefore simulate operation of the logic design as it would actually be executed in hardware to increase the chances of finding initialization errors during this simulation.
The memory page continues executing with the illegal instruction, which generates an exception. This exception passes to an exception handler that determines 522 if the force process 500 wrote to the original memory page.
If the force process 500 did store the result in the original memory page, then the force process 500 concludes that the value at that node is forced because the page was write-protected, indicating that at least one value stored in that page is forced, and because the result changed from that stored value. Thus, the force process 500 rewrites 524 the original value (the presumably forced value) back into the original memory page.
The force process 500 also re-protects 526 the original memory page so as to catch any later attempts to overwrite a forced value stored in the original memory page.
After re-protecting the original memory page, the force process 500 starts 528 executing code at the original memory page at the instruction following the instruction that generated the original exception.
If the force process 500 did not store the result in the original memory page, then the force process 500 concludes that the value at that node is not forced. In other words, an exception was properly generated because the force process 500 attempted to write the result into a write-protected memory page, but the page was write-protected for a reason other than because the result at that node is forced, e.g., another node value mapped to that page is forced. The force process 500 thus leaves the page as is, re-protects 526 the original memory page, and starts 528 executing code at the original memory page at the instruction following the instruction that generated the original exception.
Thus, in this scenario where the exception was properly generated but the value was determined to not be forced, the force process 500 performed some ultimately unnecessary operations, particularly those involving the additional memory page. However, as memory pages are usually quite small (on the order a few kilobytes) and as not many nodes are forced in logic designs (if any are at all), the computation in the force process 500 is typically much less than the computation involved in checking every node for a forced value.
The process 100, the tri-state process 400, and the force process 500, however, are 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 the process 100. The process 100, the tri-state process 400, and the force process 500 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 the process 100, the tri-state process 400, and the force process 500.
The invention is not limited to the specific embodiments set forth above. For example, the process 100 is not limited to simulating only combinatorial and state logic elements. Other logic elements may be simulated. The process 100, the tri-state process 400, and the force process 500 are not limited to the computer languages set forth above, e.g., Verilog, C++, and VHDL. It may be implemented using any appropriate computer language. Elements of the processes presented may be executed in a different order than that shown to produce an acceptable result.
Other embodiments not described herein are also within the scope of the following claims.
Number | Name | Date | Kind |
---|---|---|---|
4587625 | Marino et al. | May 1986 | A |
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 |
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 |
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 |
5734581 | Butts et al. | Mar 1998 | A |
5757655 | Shih et al. | May 1998 | A |
5796623 | Butts et al. | Aug 1998 | A |
5809283 | Vaidyanathan et al. | Sep 1998 | A |
5812414 | Butts et al. | Sep 1998 | A |
5819072 | Bushard et al. | Oct 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 |
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 |
6002861 | Butts et al. | Dec 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 | Griestede 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 |
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 |
6466898 | Chan | Oct 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 |
6484295 | McBride 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 |
6594803 | Weber et al. | Jul 2003 | B1 |
6604065 | Blomgren et al. | Aug 2003 | B1 |
6643836 | Wheeler et al. | Nov 2003 | B1 |
6718522 | McBride et al. | Apr 2004 | B1 |
6856950 | Abts et al. | Feb 2005 | B1 |
7031897 | Blomgren et al. | Apr 2006 | 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 |
20030046052 | Wheeler et al. | Mar 2003 | A1 |
20030046648 | Wheeler et al. | Mar 2003 | A1 |
20030177455 | Kaufman et al. | Sep 2003 | 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 | |
---|---|---|---|
20030046053 A1 | Mar 2003 | US |