C Interpreter - Intel IXP2400 User Manual

Network processors
Table of Contents

Advertisement

The second watch format is recognized as a C function call. It is designed to allow the user to
specify some arbitrarily complex action to occur on some arbitrarily complex set of
conditions. The watch defines a watch state of the specified name that looks for state
transitions for each of the specified state names after each simulation event completes.
If 1 or more states are found to have transitioned, then the specified C statement associated
with the watch is executed; otherwise, no activity takes place.
C_statement
Enabling
8.4

C Interpreter

The C++ simulator contains a built-in C interpreter for scripting capability. This enables script files
to run a sequence of native simulator and C Interpreter commands for regression testing a model.
This help topic is designed to give a brief overview of the C Interpreter. Detailed information
regarding all of the commands supported can be found in the simulator console help. Simply enter
the word "help" at the transactor console to bring up the simulator on-line help system
The C interpreter supports:
if, while, for, break, continue, user-defined C functions and many built-in predefined C
functions (see on-line help for complete list)
all unary and binary operators
The C interpreter does not support "do {} while()" or "expr ? expr1 : expr2".
Data types supported
int: 32-bit integer defined by user in normal was (e.g. "int foo;")
vectors: user-defined unsigned word whose width is defined by the user.
A vector is defined by the following built-in C function:
def_vector( name, width );
Arbitrary bit fields of a vector can be referenced by the following syntax:
vector_name(bit_position) //references the specified bit
vector_name(hi_bit,lo_bit) //references the field bounded by hi_bit and lo_bit
inclusive
Arbitrary precision Verilog arithmetic is supported by the vector data type.
Simulation states: all model simulation states are implicitly defined as an unsigned word of width
specified by the state:
Arbitrary bit fields can be referenced in same manner as is supported by vectors. In addition, a third
argument can specify a word index, if the corresponding state is an array (e.g. "foo( 3, 2, 1 )"
references bit range [3:2] of "foo[1]").
Development Tools User's Guide
®
Intel
The user can specify a C code block as the C_statement and thus, can
further specify the exact watch trigger condition and watch function
through a set of C statements that reference specified states, or any other
simulation state.
Watches are automatically enabled when defined. Watches can be
disabled and re-enabled by depositing a zero or non-zero value to the
watch_name state (e.g. "dep watch_name = 0").
IXP2400/IXP2800 Network Processors
Transactor
249

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ixp2800

Table of Contents