
252
Development Tools User’s Guide
Intel
®
IXP2400/IXP2800 Network Processors
Transactor
—
40
print the error, increment sim.error_count and halt simulation and command line/script
file execution if any is in progress
—
100
print the error, increment sim.error_count, halt all execution and then exit the
simulator. The default value is 40
•
sim.halt
: This state is normally 0. If the user sets it to 1, the model halts (if running) at the
end of the current cycle. This is useful in watch statements when it is desired for the model to
be halted when a specific condition has been met. This state must be reset to 0 in order to
continue running the model.
•
sim.show_hidden_states:
This state is normally 0. Enable this state to see internal
simulation states that are not usually useful/relevant to user simulation.
•
sim.time
: Represents current simulation time. This variable is read-only.
8.6
Predefined C Functions
The Vmod Simulation Console has a number of predefined C functions, which may prove useful
when performing simulations
cmd( quoted_cmd_string )
Executes the quoted_cmd_string as a simulation command. This
allows non-C commands to be embedded inside C commands
def_syn( syn_var, mapping_state )
: Declares a synonym state that is associated to the
specified mapping state name. The mapping state specification may
include a C bit specification so that the synonym maps to a subset bit
field of the mapping state. For example:
— a.
// synonyms "cmd_bus" to entire state, "chip.i.cmd_bus"
def_syn( cmd_bus, chip.i.cmd_bus );
— b.
// synonyms "xfer_reg" to "chip.i.cmd_bus[53:48]" def_syn(
xfer_reg, cmd_bus(53:48) )
;
env_var( char *environment_variable )
: Returns 1 if the specified environment
variable exists; otherwise it returns 0.
expect_err( error_code, error_cnt, compare_cnt )
: This function is for
automated QA testing and is not intended for general use. If compare_cnt
= 0, the function records error_cnt as the current outstanding expected
error count for the specified error code. If compare_cnt = 1, the function
compares the current outstanding error count for the specified error code
against the specified error_cnt value. If the comparison fails, an error is
generated.
field( state_name, field_msb, field_lsb )
: Returns the value of the data field
defined by the input arguments. This function is provided for backward
compatibility only. The preferred method is to append a "( int msb, int
lsb )" function argument list to the state name.
field_insert( state_name, insertion_data, field_msb, field_lsb ):
Inserts the insertion_data into the specified state at the specified bit field.
The insertion_data must be <= 32 bits. The function returns 1 if
successful, otherwise 0. This function is provided for backward
compatibility only. The preferred method is to append a "( int msb, int
lsb )" function argument list to the state name you're assigning to.