Technical data
List processing
518
-
Using Tcl ModelSim EE/PLUS Reference Manual
List processing
In Tcl a "list" is a set of strings in curly braces separated by spaces. Several Tcl
commands are available for creating lists, indexing into lists, appending to lists,
getting the length of lists and shifting lists. These commands are:
Two other commands,
lsearch
and
lsort,
are also available for list manipulation.
See the Tcl man pages (Main window:
Help > Tcl Man Pages
) for more
information on these commands.
See also the Model
Sim
Tcl command:
lecho
(p324)
VSIM Tcl commands
These additional VSIM commands enhance the interface between Tcl and
Model
Sim
, Only brief descriptions are provided here; for more information and
command syntax see the "Simulator Command Reference" (p245).
Command s
y
ntax Description
lappend
var_name val1 val2 ... appends val1, val2, etc. to list var_name
lindex
list_name index return the index-th element of list_name; the first element is 0
linsert
list_name index val1 val2 ... inserts val1, val2, etc. just before the index-th element of
list_name
list
val1, val2 ... returns a Tcl list consisting of val1, val2, etc.
llength
list_name returns the number of elements in list_name
lrange
list_name first last returns a sublist of list_name, from index first to index last;
first or last may be "end", which refers to the last element in
the list
lreplace
list_name first last val1, val2, ... replaces elements first through last with val1, val2, etc.
Command Description
alias
(p275) creates a new Tcl procedure that evaluates the specified
commands; used to create a user-defined alias