0% found this document useful (0 votes)
29 views4 pages

Quick Reference

This document provides a quick reference to the e language, including its predefined types, operators, statements, and constructs for packages, ports, constraints, loops, and invoking methods. It defines syntax for structs and units along with their members and methods.

Uploaded by

PM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views4 pages

Quick Reference

This document provides a quick reference to the e language, including its predefined types, operators, statements, and constructs for packages, ports, constraints, loops, and invoking methods. It defines syntax for structs and units along with their members and methods.

Uploaded by

PM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

e Language Quick Reference Ports Struct and Unit Members Checks Actions

November 2003
This card contains selected e constructs. For complete e syntax, see port-name: dir [buffer_port | simple_port] of data-type is instance; check that bool-expr [ else dut_error( ... ) ];
the e Language Reference.
port-name: dir event_port is instance;
Abbreviations: Loops Actions
keep [soft] port_inst.attribute() == value;
arg - argument inst - instance
keep bind(inst-name1, inst-name2 |external |empty | undefined); for i from expr [ down ] to expr [step expr] [do] { action; ... };
bool - boolean num - number
for each [struct-type] (list-item) [ using index (index-name) ]
enum - enumerated TCM - time-consuming method
in [reverse] list [do] { action; ... };
expr - expression TE - temporal expression Encapsulation Statements, Struct and Unit Members for each [line] [(line-name)] in file file-name [do] {action; ... };
package package-name; [package] type type; while bool-expr [do] { action; ... };
Predefined Types break; continue;
package | protected | private struct-member-definition;
bit // unsigned integer with value 0 or 1 (default: 0)
Constraints Struct and Unit Members Invoking Methods and TCMs Actions
byte // unsigned integer in the range 0-255 (default: 0)
int // 32-bit signed integer (default: 0) keep [soft] bool-expr; // for example, keep field1 <= MY_MAX TCM2()@event-name is { TCM1(); method();}; // calling methods

uint // 32-bit unsigned integer (default: 0) keep [soft] field-name in [range]; // example: keep field1 in [0..256] method1() is { method2(); method3(); }; // calling methods

int | uint ( bits: n | bytes: n ) // n-bit or n-byte signed int or uint keep bool-expr1 => bool-expr2; // bool-expr1 implies bool-expr2 method() is { start TCM();}; // starting a TCM on a separate thread

bool // one-bit boolean (0 = FALSE, 1 = TRUE) (default: FALSE) keep [soft] field-name in list; Note: A TCM can only be called from another TCM. However, a TCM
can be started from a regular method or from another TCM.
list [ (key: field-name) ] of type keep list.is_all_iterations( field-name );
// a list of elements of the specified type (default: empty)
keep list1.is_a_permutation( list2 ); Operators
string // strings are enclosed in quotes: “my string” (default: NULL) keep list[index].field-name constraint-expr;
Operator precedence is left to right, top to bottom in the list
Type Conversion keep for each ( item ) in list { [soft] bool-expr; ... };
[ ] list indexing [..] list slicing
expr = expr.as_a( type ) keep all of {constraint-expr; ... };
[:] bit slicing f() method or routine call
keep soft bool-expr == select { weight : value; ... };
User-Defined Types Statements . field selection in range list
keep [soft] gen ( item-a ) before ( item-b );
struct struct-type [ like base-struct-type ] { struct members }; {... ; ...} list concatenation %{... , ...} bit concatenation
keep gen-item.reset_soft(); // ignore soft constraints on gen-item
unit unit-type [ like base-unit-type ] { unit members }; ~ bitwise not !, not boolean not
keep field-name.hdl_path() == “string” ; //field-name is unit instance
type type-name : [u]int ( bits: n | bytes: n ); // defines a scalar type +, - unary positive, negative *, /, % multiply, divide, modulus
keep soft bool-expr == select { weight : value; ... };
type type-name : [ name [=n], ... ]; // defines an enumerated type +, - plus, minus >>, << shift right, shift left
keep gen_before_subtypes(determinant-field: field, ...);
extend type-name : [ name [=n], ... ]; // extends an enumerated type <, <=, >, >= boolean is [not] a subtype identification
comparison
extend struct-type|unit-type { additional struct or unit members }; Predefined Methods of All Structs Struct and Unit Members
// extends a struct or unit ==, != boolean equal, not equal ===,!== Verilog 4-state compare
run() extract() check() finalize() ~, !~ string matching &, |, ^ bitwise and, or, xor
Struct and Unit Members init() pre_generate() post_generate() &&, and boolean and ||, or boolean or
fields constraints when conditions copy() do_print() print_line() quit() !, not boolean not => boolean implication
methods and TCMs cover groups events a ? b : c conditional “if a then b, else c”
Methods and TCMs Struct and Unit Members
temporal struct|unit members preprocessor directives
regular-method( [arg : type, ...] ) [: return-type] is { action; ... }; Simulator Interface Statements and Unit Members
Fields Struct and Unit Members TCM([arg : type, ...] ) [: return-type] @event-name is { action; ... }; verilog function ’HDL-path’(params) : n; // n is result size in bits
[!][%]field-name : type; // ! = do not generate, % = physical field method(arg : type, ... ) [: return-type] [@event-name] is verilog import file-name; // statement only
also|first|only { action; ... };
field-name[n] : list of type; // creates a list with n elements verilog task ’HDL-path’(params);
field-name : unit-type is instance; // for units only, not structs Variable Declarations and Assignments Actions verilog time Verilog-timescale; // statement only

var var-name : type; var var-name : = value; vhdl driver ’HDL-path’ using option, …; // unit member only
Conditional Extensions using When Struct and Unit Members
var-name = expr ; // e.g. field-name=expr, var-name=method() vhdl function ’designator’ using option, …;
type enum-type: [name1, name2, ...]; vhdl procedure ’identifier’ using option, …;
struct|unit struct-type|unit-type { Conditional Procedures Actions
field-name : enum-type; vhdl time VHDL-timescale; // statement only
when name1 struct-type|unit-type { additional members }; if bool-expr [ then ] { action; ... }
}; [ else if bool-expr [ then ] { action; ... } ] [ else { action; ... } ] ; Generation On the Fly Actions
extend name1 struct-type|unit-type { ... };
case { bool-expr[:] { action; ... } ; [ default[:] { action; ... } ;] }; gen gen-item [keeping { [soft] constraint-bool-expr ; ... }];
case expr { value[:] { action; ... } ; [ default[:] { action; ... } ;] };
Events Predefined Routines Actions List Pseudo-Methods
event event-name [ is [only] TE]; // struct or unit member Deep Copy and Compare Routines Selected List Actions
emit [struct-inst.]event-name; // action deep_copy(expr : struct-type) : struct-type add[0](list-item : list-type) add[0](list : list)
deep_compare[_physical](inst1: struct-type, inst2: struct-type, clear() delete(index : int)
Predefined Events max-diffs: int): list of string
pop[0]() : list-type push[0](list-item : list-type)
sys.any struct-inst.quit
Output Routines insert(index : int, list : list | list-item : list-type)
Temporal Struct and Unit Members out (“string”, expr, ...); out ( struct-inst );
Selected List Expressions
on event-name { action; ... } ; outf ( “string %c ...”, expr ); // c is a conversion code: s, d, x, b, o, u
size() : int top[0]() : list-type
expect|assume [rule-name is [only ]] TE Selected Configuration Routines reverse() : list sort(expr : expr) : list
[ else dut_error( “string”, expr, ... ) ];
Note: Categories for these routines are listed in “Configuration sum(expr : int) : int count (expr : bool) : int
Commands” in the Specman Elite Quick Reference. exists(index : int) : bool has(expr : bool) : bool
Temporal Expressions (TEs)
set_config( category, option, option-value ) is_empty() : bool is_a_permutation(list: list) : bool
Basic Temporal Expressions
get_config( category, option ); all(expr : bool) : list all_indices(expr : bool) : list of int
@[struct-inst.]event-name // event instance
change|fall|rise(’HDL-path’) @sim // simulator callback annotation Selected Arithmetic Routines first(expr : bool) : list-type last(expr : bool) : list-type

change|fall|rise(expr) true(bool-expr) cycle min|max ( x: int, y: int): int abs(x: int): int first_index(expr : bool) : int last_index(expr : bool) : int

ipow(x: int, y: int): int isqrt(x: int): int key(key-expr : expr) : list-item key_index(key-expr : expr) : int
Boolean Temporal Expressions
odd|even (x: int): bool div_round_up(x: int, y: int): int max(expr : int) : list-type max_value(expr : int) : int | uint
TE1 and TE2 TE1 or TE2 not TE fail TE
min(expr : int) : list-type min_value(expr : int) : int | uint
Complex Temporal Expressions Bitwise Routines
swap(small : int, large : int) : list of bit
TE @[struct-inst.]event-name // explicit sampling expr.bitwise_and|or|xor|nand|nor|xnor(expr: int|uint): bit
crc_8|32(from-byte : int, num-bytes : int) : int
{ TE; TE; ... } // sequence
Selected String Routines unique(expr : expr) : list
TE1 => TE2 // if TE1, then TE2 follows
appendf(format, expr, ...): string append(expr, ...): string
TE exec { action; ... } // execute when TE succeeds Coverage Groups and Items Struct and Unit Members
expr. to_string(): string bin|dec|hex(expr, ...): string
[ n ] [ * TE ] // fixed repeat
str_join(list: list of string, separator: string): string cover cover-group [ using [also] cover-group-options ] is [empty]
{ ... ; [ [n]..[m] ] [ * TE ]; TE; ... } // first match repeat [also] {
str_match(str: string, regular-expr: string): bool item item-name [: type = expr ] [ using [also] cover-item-options ];
~[ [n]..[m] ] [ * TE ] // true match repeat
str_replace(str:string, regular-expr:string, replacement:string):string cross item-name1, item-name2, ... ; transition item-name;
delay(expr) detach(TE) };
str_split(str: string, regular-expr: string): list of string
consume( @[struct-inst.]event-name ) To enable coverage, extend the global struct as follows:
Selected Operating System Interface Routines setup_test() is also {set_config(cover, mode, cover-mode)}
Time-Consuming Actions
system(“command”): int date_time(): string
Coverage Group Options
wait [[until] TE]; sync [TE]; output_from(“command”): list of string
text = string weight = uint no_collect radix = DEC|HEX|BIN
output_from_check(“command”): list of string
Lock and Release, Sempahores Predefined Structs and Methods count_only global when = bool-expr
get_symbol(UNIX-environment-variable: string) : string
struct struct-type { struct struct-type { external=surecov agent_options=SureCov options
files.write_string_list(file-name: string, list: list of string)
locker-expr: locker; sem-expr: semaphore;
TCM() @event-name is { TCM() @event-name is { Coverage Item Options
locker-expr.lock(); sem-expr.up();
Stopping a Test text = string when = bool-expr weight = uint
... ... stop_run(); // stops the simulator and invokes test finalization
no_collect radix=DEC|HEX|BIN name name
locker-expr.release(); }; sem-expr.down(); };
}; }; On-the-Fly Memory Management at_least = num ignore | illegal = cover-item-bool-expr
do_otf_gc() no_trace ranges=range( [ n..m ], sub-bucket-name,
Packing and Unpacking Pseudo-Methods sub-bucket-size, at-least-number );

expr = pack( pack-options, expr, … )


Preprocessor Directives Statements, Struct Members or Actiors per_instance agent_options=SureCov options

unpack( pack-options, value-expr, target-expr [ , target-expr, ... ] ) #define [‘]macro-name [ replacement ] Copyright (c) 2000-2004 Verisity Design, Inc.
#if[n]def [‘]macro-name then {string} [ #else {string} ] ; 2041 Landings Drive, Mountain View, CA 94043
Printing Action (650) 934-6800
http://www.verisity.com
print expr[,…] [using print-options] ;
Specman Elite Simulator-Related Commands Configuration Commands
Quick Reference
November 2003 show functions // Verilog and VHDL config category -option = value;
This card contains selected Specman Elite commands and show tasks [and functions] // Verilog Category Options
procedures. For more information, see the Specman Elite Command
Reference. show procedures // VHDL print radix, title, window, raw, items, list_from,
list_is_horizontal, list_lines, list_starts_on_right,
show subprograms // VHDL
Abbreviations: dir - directory expr - expression list_grouping, list_of_bit_in_hex, list_index_radix,
inst - instance num - number show defines [ -v ] [ -e ] [ " [`]macro-name" ] // Verilog defines list_end_flag, full, source_lines, line_size
cover at_least_multiplier, grading_formula, show_mode,
General Help Starting Specman Elite or the Specview GUI verbose_interface, sorted, max_int_buckets,
help command [syntax] apropos command [syntax] Starting Specman Elite in Text Mode absolute_max_buckets, max_gui_buckets, mode,
test_name, run_name, tag_name, dir, file_name,
Specview Help button Specview Vadvisor button specman [ -p[re_commands] commands … ] show_file_names, show_sub_holes,
[ -c[ommands] commands … ] show_instances_only, show_partial_grade,
Creating an HDL Stub File Example: ranking_cost, ranking_precision, gui_sync_mode,
specman -p "config print -radix = HEX" -p "load top" check_illegal_immediately, hole_color,
write stubs -verilog | -qvh | -ncvhdl | -spd [file-name] // Starts Specman Elite, sets print radix to hex, and loads top.e illegal_bucket_color, chart_colors
specman -command “load top.e; write stubs -verilog” gen seed, default_max_list_size, reorder_fields,
// creates stub file named specman.v for most Verilog simulators Starting the Specview GUI absolute_max_list_size, max_depth, max_structs,
specman -command “load top.e; write stubs -qvh my_stub.vhd” specview [ -p[re_commands] commands … ] warn, resolve_cycles, check_unsatisfied_cons
// creates stub file for ModelSim VHDL named my_stub.vhd [ -c[ommands] commands … ] [ integrated-executable parameters ]
gui auto_scroll
Example:
Compiler Script run tick_max, error_command, exit_on,
specview xl_specman +gui -s xor.v specman.v
use_manual_tick
// Starts Specview along with the Verilog-XL GUI, loads the xor.v
%sn_compile.sh memory gc_threshold, gc_increment, max_size,
// file and the specman.v stubs file
// use with no arguments to display compiler script options absolute_max_size, print_msg, retain_trace_structs
%sn_compile.sh top.e Running from Compiled Executables misc warn, pre_specman_path, post_specman_path,
// create an executable named “top” with compiled top.e module short_is_signed
%specsim [-pre-commands command ...] [-commands command ... ]
[ integrated-executable parameters ] debug watch_list_items
NC Simulator or ModelSim // General way to pass pre-commands to a compiled executable
%sn_compile.sh top.e -sim ncvlog wave working_mode, auto_refresh, register_structs,
NC Simulator: use_wave, stub_message_len, stub_output,
// creates a Specman Elite executable named “ncvlog_top” that
% ncvlog_top -s file1.v file2.v specman.v stub_errors, stub_events, event_data, stub_integers,
// includes the compiled top.e module and NC Simulator (Verilog)
// Invokes an executable named ncvlog_top to start Specman Elite stub_strings, stub_strings_len, stub_booleans,
%sn_compile.sh top.e -shlib // with NC Simulator, and load Verilog files file1.v and file2.v list_items, thread_code_line, hierarchy_name, port,
// creates a library that includes top.e and ModelSim dump_file, timeout
NC Simulator:
%specsim -p "@batch.ecom" ncvlog_top -s file1.v file2.v specman.v show config [ category [ option ]]
VCS
// Same as above, but with optional pre-commands
%sn_compile.sh -sim vcs -vcs_flags “file1.v ... specman.v” top.e write config [ to ] file-name
ModelSim:
// creates a Specman Elite executable named “vcs_top” that read config [ from ] file-name
% specsim -p "@batch.ecom" vsim -keepstdout top < batch.do
// includes VCS, compiled top.e and Verilog source files
VCS:
Test Phase Commands
Incremental Compilation Command Sequence % specsim -p "@batch.ecom" vcs_cpu_top -s -i batch.cmd
test [ -option = value…] setup_test generate [-option = value…]
1. sn_compile.sh -e my_dir -t . first.e Using a Specman Elite Command File
2. sn_compile.sh -s my_dir/first -t . next.e start [-option = value…] run [ -option = value…]
3. sn_compile.sh -s my_dir/next -t . last.e @file-name [parameter ...] extract check finalize_test
Example:
Switching between Specman Elite and Simulator Prompts // Contents of my_batch.ecom file: Test Phase Command Options
load <1>;
<Cntl>-<Return> // switch from simulator prompt to Specman Elite seed = n | random default_max_list_size = n
out(“<2> is <3>”);
// in text mode (no simulator GUI is being used) max_depth = n absolute_max_list_size = n
Execute my_batch.ecom:
$sn ; // switch from Verilog-XL or VCS to Specman Elite Specman> @my_batch my_code Today Wednesday max_structs = n warn = TRUE | FALSE
sn // switch from ModelSim to Specman Elite Result:
call sn // switch from NC Simulator to Specman Elite Loads my_code.e, prints Today is Wednesday reorder_fields = TRUE | FALSE
<Return> // switch from Specman Elite back to the simulator resolve_cycles = TRUE | FALSE
Record Commands check_unsatisfied_cons = TRUE | FALSE
Specman Elite Commands from Simulator Prompt record start [ -dir = dir-name ][ -comment = "comment-text"]
Verilog-XL or VCS: $sn(“command”); ModelSim: sn “command”
NC Simulator: call sn {“command”}
Saving and Restoring the State Show Modules Command Managing Breakpoints
delete break [ last | id-number | "pattern" ]
load file-name … reload [ -nokeep ] show modules
disable break [ last | id-number | "pattern" ]
save file-name
Log Commands enable break [ last | id-number | "pattern" ]
restore [-override] [ -nokeep ] [file-name]
set log file-name set log off show breakpoint
Coverage Commands
Shell Commands Setting and Managing Watches
read cover file-name | -merge -file = file-name [l]watch expr [-radix = DEC|HEX|BIN] [-items = value] [#thread-id]
write cover [-merge] file-name shell shell-command
update watch watch-id [radix = DEC|HEX|BIN]
clear cover [-items = value|default]
Print and Report Commands
show cover [-kind = full|summary|spreadsheet ] show watch delete watch [watch-id]
[-file = file-name ] [-contributors[= num]] [-window] Note: print and report can also be used in e code as actions.
[struct-type[.cover-group[(inst)][.item-name]]] print expr, … [using print-options] Setting Traces
show cover -tests report list-expr, {[headers]}, expr,… [using print-options] [l]trace [once] [on] call [extension] [struct-wild-card.]method-wild-
card [@module-name] [#[thread-handle]] [if bool-expr]
show cover -def [struct-name[.event-name[.item-name]]] Note: Use the show config print command to display print options.
Examples: [l]trace [once] [on] return [extension] [struct-wild-card.]method-
show cover -new -cross = (struct-type.cover-group.item-name, ...)
print sys.packets using radix=HEX wild-card [@module-name] [#[thread-handle]] [if bool-expr]
[-interval = (struct-type.event-name, [struct-type.event-name | next])]
[-only_simultaneous] [-win] report sys.packets, {"Addr \t Indx"; "%d \t %d"},.address,index [l]trace [once] [on] line [line-number] [@module-name] [if bool-expr]
show cover -unique_buckets file_name tree [struct-inst | list-expr] // display the contents of a struct or list [l]trace [once] [on] special-event-name [special-wild-card]
[@module-name] [#[thread-handle]] [if bool-expr]
include cover[_tests] full-run-name [on|off]
Generation Debugger Commands trace [once] [on] change expr
rank cover [-sort_only] [-recover] [-window] [-file=file_name]
[-initial_list=file_name] [item-wild-cards] col[lect] generation [off] trace [on] packing trace [on] reparse
show gen [-instance inst-name[.field-name]]
Waveform-Related Commands Special Events and Special Wild Cards
Source Code Debugger Commands Special Event Name Special Wild Card
set wave [ -mode=working-mode ] viewer
tcm_start struct-wild-card.tcm-wild-card
wave [ -when [ = when-regular-expr ] ] continue [to breakpoint-syntax] step_anywhere
[ -field[s] [ = fields-regular-expr ] ] tcm_end struct-wild-card.tcm-wild-card
step next finish abort
[ -event[s] [ -event_data=event-data ] ] [ -thread[s] tcm_call struct-wild-card.tcm-wild-card
[ -code_line=bool ] ] expr In the next two sections, the #thread-handle option can only be used
with the “l” (local) form of the command (e.g. lbreak, but not break). tcm_return struct-wild-card.tcm-wild-card
wave event [ -data=data-option ] [ struct-type.event-type ] The special events and special wild cards used as options for some tcm_wait struct-wild-card.tcm-wild-card
wave out of the commands are listed separately at the end.
tcm_state struct-wild-card.tcm-wild-card
Memory Commands Setting Breakpoints call struct-wild-card.method-wild-card
[l]break [once] [on] call [extension] return struct-wild-card.method-wild-card
show memory [-recursive] [struct-type | unit-type] [struct-wild-card.]method-wild-card [@module-name]
[#[thread-handle] [if bool-expr] sim_read signal-name-wild-card
who is [-full] struct-expr // show paths for all pointers to a struct
[l]break [once] [on] [return] [extension] sim_write signal-name-wild-card

Event Commands [struct-wild-card.]method-wild-card [@module-name] output text wild-card


[#[thread-handle]] [if bool-expr]
collect events [event-name [,…]] [on | off] [l]break [once] [on] line [line-number] [@module-name] Command-Line Mode Debugging Commands
echo events [event-name [,…]] [ on | off ] [#[thread-handle]] [if bool-expr]
show stack // show the calls stack for the current thread
delete events [l]break [once] [on] special-event-name [special-wild-card]
show threads // show all threads
[@module-name] [#[thread-handle]] [if bool-expr]
show events [event-name | [ num [..[num] ] ]
show thread source // show the e source for the current thread
[l]break [once] [on] event [[struct-wild-card.]event-wild-card]
show event definitions [event-name, …]
[@module-name] [#[thread-handle]] [if bool-expr] show thread tree // show the full tree of calls for the current thread
show events -chart [time-value | -prev | -next | -beginning | -end]
break [once] [on] change expr show thread #thread-handle
[event-name, …]
break [once] [on] error
Show Pack and Unpack Commands break [once] [on] interrupt Copyright (c) 2000-2004 Verisity Design, Inc.
break [once] [on] simulator 2041 Landings Drive, Mountain View, CA 94043
show pack(options: pack_options, expr, ...)
(650) 934-6800
show unpack(options: pack_options, value-expr, target-expr, ... ) break [on] alloc [memory-size] http://www.verisity.com

You might also like