# US 2009/0271748 A1 · Method and apparatus for simulating behavioral constructs using indeterminate values

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2009/0271748 A1
- Document ID: US20090271748A1
- Status: Published application
- Kind: A1
- Application number: 12/109,589
- Filed: 2008-04-25
- Published: 2009-10-29
- Earliest claimed: 2008-04-25
- Assignees: Synopsys, Inc.
- Inventors: Guillermo Maturana; Arturo Salz; Joseph T. Buck
- Web page: https://patentgrep.com/patent/US20090271748A1

## CPC

- G06F 30/33: Design verification, e.g. functional simulation or model checking
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

One embodiment of the present invention provides a system that simulates behavioral constructs of a register transfer level design using indeterminate values. The system may receive hardware description language code which includes a construct that behaves differently depending on the value of an expression, e.g., the construct may execute different portions of code based on the value of a control expression, or it may store data in different storage locations based on the value of an index expression, etc. In response to determining that the expression's value is indeterminate, the system can execute two or more alternatives that are controlled by the expression, and then merge the results in some prescribed way. An embodiment of the present invention can enable a user to reduce the discrepancy between the results generated by a register transfer level simulation and the results generated by the associated gate level simulation.

## Claims

### Claim 1

A method for executing HDL (hardware description language) code, the method comprising:
receiving HDL code which describes an RTL (register transfer level) design, wherein the HDL code includes a conditional statement which determines an output variable's value, and wherein the conditional statement uses a control expression to determine whether to execute a first set of HDL statements to determine the output variable's value, or whether to execute a second set of HDL statements to determine the output variable's value; and
in response to determining that the control expression's value is indeterminate,
executing the first set of HDL statements to determine a first temporary-value which is associated with the output variable,
executing the second set of HDL statements to determine a second temporary-value which is associated with the output variable,
determining the output variable's value using the first temporary-value and the second temporary-value, and
storing the output variable's value.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining the output variable's value includes using a user-selectable merge-function to merge the first temporary-value and the second temporary-value.

### Claim 3 (depends on 2)

The method of claim 2, wherein the user-selectable merge-function performs a bit-by-bit merge of the first temporary-value and the second temporary-value.

### Claim 4 (depends on 1)

The method of claim 1, wherein the method is performed when:
an HDL interpreter interprets the HDL code;
a computer executes object code which is generated by compiling the HDL code; or
the computer executes the object code which is generated by:
using a pre-compiler to modify the HDL code; and
compiling the modified HDL code.

### Claim 5 (depends on 1)

The method of claim 1, wherein the conditional statement is one of:
an “if” statement; or
a “case” statement.

### Claim 6

A method for executing HDL (hardware description language) code, the method comprising:
receiving HDL code which describes an RTL (register transfer level) design, wherein the HDL code includes an HDL statement which uses a ternary operator to determine an output variable's value, and wherein the ternary operator uses a control expression to determine whether to evaluate a first HDL expression to determine the output variable's value, or whether to evaluate a second HDL expression to determine the output variable's value;
receiving a user-selectable merge-function; and
in response to determining that the control expression's value is indeterminate,
determining the output variable's value using the user-selectable merge-function, and
storing the output variable's value.

### Claim 7 (depends on 6)

The method of claim 6, wherein the user-selectable merge-function sets the output variable's value to a special value which indicates that the output variable's value is indeterminate.

### Claim 8 (depends on 6)

The method of claim 6, wherein determining the output variable's value includes:
evaluating the first HDL expression to obtain a first value;
evaluating the second HDL expression to obtain a second value; and
using the user-selectable merge-function to merge the first value and the second value.

### Claim 9 (depends on 6)

The method of claim 6, wherein the method is performed when:
an HDL interpreter interprets the HDL code;
a computer executes object code which is generated by compiling the HDL code; or
the computer executes the object code which is generated by:
using a pre-compiler to modify the HDL code; and
compiling the modified HDL code.

### Claim 10

A method for executing HDL (hardware description language) code, the method comprising:
receiving HDL code which describes an RTL (register transfer level) design, wherein the HDL code uses an index expression to determine a storage location, and wherein the HDL code stores a first value in the storage location; and
in response to determining that the index expression's value is indeterminate,
selecting a candidate index-value for the index expression,
determining a candidate storage-location using the candidate index-value,
determining a merged value using the first value and a second value currently stored at the candidate storage-location, and
storing the merged value at the candidate storage-location.

### Claim 11 (depends on 10)

The method of claim 10, wherein determining the merged value includes using a user-selectable merge-function to merge the first value and the second value.

### Claim 12 (depends on 11)

The method of claim 11, wherein the user-selectable merge-function performs a bit-by-bit merge of the first value and the second value.

### Claim 13 (depends on 10)

The method of claim 10, wherein the method is performed when:
an HDL interpreter interprets the HDL code;
a computer executes object code which is generated by compiling the HDL code; or
the computer executes the object code which is generated by:
using a pre-compiler to modify the HDL code; and
compiling the modified HDL code.

### Claim 14

A method for executing HDL (hardware description language) code, the method comprising:
receiving HDL code which describes an RTL (register transfer level) design, wherein the HDL code assigns an input variable's value to an output variable if a clock variable's value changes from a first clock-value to a second clock-value, and wherein the HDL code does not change the output variable's value if the clock variable's value does not change from the first clock-value to the second clock-value; and
in response to determining that the clock variable's value changed from the first clock-value to an indeterminate value or from an indeterminate value to the second clock-value,
determining the output variable's value by merging the input variable's value and the output variable's current value, and
storing the output variable's value.

### Claim 15 (depends on 14)

The method of claim 14, wherein determining the output variable's value includes using a user-selectable merge-function to merge the first value and the second value.

### Claim 16 (depends on 15)

The method of claim 15, wherein the user-selectable merge-function performs a bit-by-bit merge of the first value and the second value.

### Claim 17 (depends on 14)

The method of claim 14, wherein the method is performed when:
an HDL interpreter interprets the HDL code;
a computer executes object code which is generated by compiling the HDL code; or
the computer executes the object code which is generated by:
using a pre-compiler to modify the HDL code; and
compiling the modified HDL code.

### Claim 18

A method for executing HDL (hardware description language) code, the method comprising:
receiving HDL code which describes an RTL (register transfer level) design, wherein the HDL code determines an output variable's value, and wherein the HDL code includes an HDL construct which executes different portions of the HDL code based on a control expression's value;
in response to determining that the control expression's value is indeterminate, assigning a special value to the output variable which indicates that the output variable's value is indeterminate, wherein the special value is assigned to the output variable even if the different portions of HDL code would have assigned the same value to the output variable; and
storing the output variable's value.

### Claim 19 (depends on 18)

The method of claim 18, wherein the method is performed when:
an HDL interpreter interprets the HDL code;
a computer executes object code which is generated by compiling the HDL code; or
the computer executes the object code which is generated by:
using a pre-compiler to modify the HDL code; and
compiling the modified HDL codes.

### Claim 20 (depends on 18)

The method of claim 18, wherein the HDL code includes one of:
an “if” statement;
a “case” statement; or
a statement which includes a ternary operator.
