[Not Applicable]
[Not Applicable]
[Not Applicable]
[Not Applicable]
Simulation programs are frequently used for testing integrated circuits. Integrated circuit production is characterized by high initial costs for the production of the first “copy” followed by low marginal costs for each successive copy. Testing of a design for an integrated circuit prior to production is almost imperative. There are major challenges in the area of functional verification of System-on-a-chip (SOC) design. Functional verification of the SOC design is necessary in order to verify that the integrated circuit functions are as expected and as designed. However, the design itself also needs to be tested for functional correctness. Currently, the SOC designs are implemented in High Level Hardware Specification languages such as Verilog. Verilog is a programming language defined by Open Verilog International (OVI) Corporation and now an Institute of Electrical and Electronic Engineers (IEEE) standard (IEEE-1364). The test benches for the SOC designs are also written in Verilog and are tested on Verilog simulation software.
In a conventional environment for functional verification of a system-on-a-chip design, a circuit design may be written in a hardware high level specification language, such as Verilog. The circuit design may be a very large design and may need to be tested on an emulator. The emulator may be utilized for design verification and validation since it is faster than a simulation software. The emulator may be interfaced to a host microprocessor. The test benches associated with the functional verification process performed by the emulator are often written in a language used for development of host software, such as C/C++. If the circuit design is written in a hardware high level specification language, such as Verilog, the test bench, associated with the circuit design may also be written in Verilog. However, to use the test bench with the emulator and the host microprocessor, the test bench may need to be written in C++.
It may be difficult and time consuming for the development of test benches written in both Verilog and C++. It may also be similarly difficult and time consuming for a test bench to be re-written from Verilog to C++. Another drawback is that it is difficult to maintain synchronization between the Verilog and C++ drivers as either one of them changes. As a result, both types of drivers, over a period of time, may diverge and create confusion in test bench development.
Further limitations and disadvantages of conventional and traditional approaches will become apparent to one of skill in the art, through comparison of such systems with some aspects of the present invention as set forth in the remainder of the present application with reference to the drawings.
Certain aspects of the invention may be found in a method and system for translating Verilog to C++. The method for translating may include searching for a Verilog pattern in a Verilog file and substituting the Verilog pattern with a C++ language expression, wherein the C++ language expression is associated with the same functionality as the Verilog pattern. It may be identified whether the Verilog file comprises at least one of a task library, a main driver, and a driver module. If the Verilog file comprises a task library, a Verilog task within the task library may be identified; and the Verilog task may be translated into a C++ function. If the Verilog file comprises a main driver, a C++ interface header may be inserted in the Verilog file. Any # delay statements may be removed from the Verilog file. {grave over ( )} ifdef statements in the Verilog file may be translated. {grave over ( )} symbols may be removed from the Verilog file. Any “begin” keyword in the Verilog file may be converted to a ″{″ symbol. Any “end” keyword in the Verilog file may be converted to a ″}″ symbol. Register definitions in the Verilog file may be converted into at least one C++ definition. Combinatorial assignments may be performed in the Verilog file. Any event in the Verilog file may be converted into a C++ event. Any Verilog switch in the Verilog file may be converted into at least one C++ switch. Any Verilog concat expressions in the Verilog file may be converted into C++ concat expressions. Any Verilog parameter in the Verilog file may be converted into a C++ #define. Any Verilog constant in the Verilog file may be converted into a C++ constant. Any Verilog bit access macro in the Verilog file may be converted into a C++ functional equivalent.
Another embodiment of the invention provides, a machine-readable storage, having stored thereon a computer program having at least one code section, the at least one code section executable by a machine for causing the machine to perform the steps as described above.
These and other advantages, aspects and novel features of the present invention, as well as details of an illustrated embodiment thereof, will be more fully understood from the following description and drawings.
Certain aspects of the invention may be found in a method and system for translating Verilog to C++. The method for translating may include searching for a Verilog pattern in a Verilog file and substituting the Verilog pattern with a C++ language expression, wherein the C++ language expression is associated with the same functionality as the Verilog pattern. It may be identified whether the Verilog file comprises at least one of a task library, a main driver, and a driver module. If the Verilog file comprises a task library, a Verilog task within the task library may be identified; and the Verilog task may be translated into a C++ function. If the Verilog file comprises a main driver, a C++ interface header may be inserted in the Verilog file. Any # delay statements may be removed from the Verilog file. {grave over ( )}ifdef statements in the Verilog file may be translated. {grave over ( )} symbols may be removed from the Verilog file. Any “begin” keyword in the Verilog file may be converted to a ″{″ symbol. Any “end” keyword in the Verilog file may be converted to a ″}″ symbol. Register definitions in the Verilog file may be converted into at least one C++ definition. Combinatorial assignments may be performed in the Verilog file. Any event in the Verilog file may be converted into a C++ event. Any Verilog switch in the Verilog file may be converted into at least one C++ switch. Any Verilog concat expressions in the Verilog file may be converted into C++ concat expressions. Any Verilog parameter in the Verilog file may be converted into a C++ #define. Any Verilog const in the Verilog file may be converted into a C++ const. Any Verilog bit access macro in the Verilog file may be converted into a C++ functional equivalent.
Referring now to
To use the test bench with the emulator 101 and the host processor 108, the test bench 104 in Verilog is converted to C++ test bench 106. The test bench 104 in Verilog can be converted to a test bench 106 in C++ by means of a translator as described below.
Referring now to
Referring now to
The VBScript macros that may be utilized in the Verilog to C++ translator 204 of
Referring now to
At 412, the Verilog file may be parsed for a Verilog pattern. For example, the Verilog file may be parsed for patterns from the table on
After a specific pattern is parsed at 412, at 414 the Verilog pattern may be located on a Verilog/C++ reference table, such as the reference table illustrated on
Referring now to
An embodiment of the present invention can be implemented as a file resident in the random access memory 64 of one or more computer systems 58 configured generally as described in
One skilled in the art would appreciate that the physical storage of the sets of instructions physically changes the medium upon which it is stored electrically, magnetically, or chemically so that the medium carries computer readable information.
Accordingly, the present invention may be realized in hardware, software, or a combination of hardware and software. The present invention may be realized in a centralized fashion in at least one computer system, or in a distributed fashion where different elements are spread across several interconnected computer systems. Any kind of computer system or other apparatus adapted for carrying out the methods described herein is suited. A typical combination of hardware and software may be a general-purpose computer system with a computer program that, when being loaded and executed, controls the computer system such that it carries out the methods described herein.
The present invention may also be embedded in a computer program product, which comprises all the features enabling the implementation of the methods described herein, and which when loaded in a computer system is able to carry out these methods. Computer program in the present context means any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: a) conversion to another language, code or notation; b) reproduction in a different material form.
While the present invention has been described with reference to certain embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted without departing from the scope of the present invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the present invention without departing from its scope. Therefore, it is intended that the present invention not be limited to the particular embodiment disclosed, but that the present invention will include all embodiments falling within the scope of the appended claims.
Number | Name | Date | Kind |
---|---|---|---|
6053947 | Parson | Apr 2000 | A |
6996788 | Akiba et al. | Feb 2006 | B2 |
20020083420 | Zammit et al. | Jun 2002 | A1 |
20030061580 | Greaves | Mar 2003 | A1 |
20030074640 | Mandell et al. | Apr 2003 | A1 |
20030154465 | Bollano et al. | Aug 2003 | A1 |
Number | Date | Country | |
---|---|---|---|
20050166165 A1 | Jul 2005 | US |