Development Tools User’s Guide
253
Intel
®
IXP2400/IXP2800 Network Processors
Transactor
fprintf( file_name, fmt, ... ):
Analogous to the C command fprintf, except that the
first argument is a file name, not a file pointer. If the log file
corresponding to the file name was not previously open, it is
automatically opened by this call.
hex_str( state_name ):
returns a hexidecimal string representing the current state value
is_valid_state( state_name ):
Returns 1 if the specified state_name currently exists
otherwise it returns 0
log2( int ):
Returns the base 2 log of the specified number. Fractional amounts are
rounded up to the next whole number.
printf( fmt, ... )
: Analogous to the C printf command.
project_dir()
:
Returns a string representing the directory where the .vmp file existed to
create this simulation model
rand( bound1, bound2 ):
Returns a random integer between the two specified bounds
(inclusive). If bound2 is not specified, it defaults to 0. If neither bound is
specified, a random 32-bit result is returned
read_only_val( var_name ):
Some system variables (e.g. sim.time) are defined with
"read-only" protection. As a result, they can't be directly embedded in a
C expression. The read_only_val function enables read-only variables to
be read by returning the variable value.
rec_error( fmt, ... ):
Analogous to the "printf" function, but also registers a simulation
error.
seed():
Returns the current seed for random number generation.
sprintf( format_string, ... ):
Analogous to the C "sprintf" function, except that the
format_string argument expects a variable of type "string".
srand( number ):
Sets the seed for random number generation.
state( string ):
Returns the predefined model state value that maps to the specified text
string. If no mapping is found, an error is flagged.
state_type( var_name ):
Returns the numerically specified state type if the specified state
name was previously defined. It returns 0 if the state is undefined. The
argument may be either a quoted or unquoted name. The numeric values
for the state types are as follow
•
Signal = 1
•
Flip-Flop=2
•
Latch=3
•
Tristate Node=4
•
Array=5
•
FIFO=6
•
Control Store=7
•
Ucode Register=8
•
Delay Element=9
•
System State=10