wdb create
The wdb create
command creates a WDB database object
which can be accessed by the returned unique Tcl command.
If the optional file name is given a binary wdb file is created.
Otherwise the database exists only in memory.
Usage:
wdb create ?-generateStats? ?-noCollapse? ?-nogcd? ?-noSkipDupl? ?-nozip? ?-skipLeadX? ?fname?
Parameters:
-generateStats (optional)
-
Gather some statistics while creating the db.
-noCollapse (optional)
-
Do not collapse value changes at same timestep.
-nogcd (optional)
-
Do not compress storage of time steps.
-noSkipDupl (optional)
-
Do not skip duplicate values.
-nozip (optional)
-
Do not compress whole database.
-skipLeadX (optional)
-
Ignore leading 'X' values.
fname (optional)
-
Optional name of the binary file to create. One of the above options cannot be used as the filename.
Example:
set wdb1 [wdb create]
set wdb2 [wdb create test.wdb]
set wdb3 [wdb create -skipLeadX test.wdb]
wdb customdb
Restore a custom database. The custom database API must be set via the Wdb C API function WdbRegisterCustomdb().
Usage:
wdb customdb fname opts
Parameters:
fname
-
Name of the WDB file to open.
opts
-
List of string options.
Example:
set wdb [wdb customdb $fname $options]
wdb open
Restore a binary WDB file into memory and return the name of the new Tcl command for accessing the WDB database.
Usage:
wdb open fname
Parameters:
fname
-
Name of the WDB file to open.
Example:
set wdb [wdb open "test.wdb"]
wdb version
Prints the parser version number
Usage:
wdb version
Parameters:
No parameters.
Example:
wdb version
$wdb addalias
The $wdb addalias
command adds a new alias variable to the current scope.
If the width
parameter is greater than 1, a vector is defined.
Multiple aliases/variables (in different scopes) can share the
same signal id signo
.
Usage:
$wdb addalias aliastype name width signo ?iname?
Parameters:
aliastype
-
The parameter vartype can be one of the following values: pin, port, net
iname (optional)
-
Instance name (only for pin aliases).
name
-
Name of the variable.
signo
-
Signal number.
width
-
Width of the variable.
Example:
set sigNo2 [$wdb nextsigno]
$wdb addalias "port" {test[0:1]} 2 $sigNo2
$wdb adddefinitions
The $wdb adddefinitions
command reenables adding scopes, variable.
Usage:
$wdb adddefinitions
Parameters:
No parameters.
Example:
$wdb adddefinitions
$wdb addevent
Add an event. Because storing an event in wdb is currently not supported using this command creates an error.
Usage:
$wdb addevent signo
Parameters:
signo
-
Signal number.
Example:
$wdb addevent [$wdb nextsigno]
$wdb addreal
Add a real value. Because storing a real value in wdb is currently not supported using this command creates an error.
Usage:
$wdb addreal signo value
Parameters:
signo
-
Signal number.
value
-
Value.
Example:
$wdb addreal [$wdb nextsigno] 1.23
$wdb addscalar
The $wdb addscalar
command defines a new value at the current time
for the given signal signo
.
Usage:
$wdb addscalar signo value
Parameters:
signo
-
Signal number.
value
-
Possible values are: x/X, z/Z, 0, 1
Example:
$wdb addscalar $sigNo1 0
$wdb addtime
The $wdb addtime
command adds a new time mark for upcoming value changes.
Usage:
$wdb addtime time
Parameters:
time
-
Add a time.
Example:
$wdb addtime 100
$wdb addvar
The $wdb addvar
command adds a new variable to the current scope.
If the width
parameter is greater than 1, a vector is defined.
Multiple variables (in different scopes) can share the
same signal id signo
.
Usage:
$wdb addvar vartype valtype name width signo
Parameters:
name
-
Name of the variable.
signo
-
Signal number.
valtype
-
The parameter valtype can be one of the following values: scalar, vector, real
vartype
-
The parameter vartype can be one of the following values: unknown, event, integer, parameter, real, reg, supply0, supply1, time, tri, triand, trior, trireg, tri0, tri1, wand, wire, wor
width
-
Width of the variable.
Example:
set sigNo1 [$wdb nextsigno]
$wdb addvar "wire" "scalar" "clk" 1 $sigNo1
set sigNo2 [$wdb nextsigno]
$wdb addvar "reg" "vector" {test[0:1]} 2 $sigNo2
$wdb addvector
The $wdb addvector
command defines a new value at the current time
for the given signal signo
. The given width
should match
with the width defined in $wdb addvar
. The given val
string
has one character for each bit. LSB comes first.
Usage:
$wdb addvector signo value width
Parameters:
signo
-
Signal number.
value
-
Possible values are the same as described in
$wdb addscalar
. width
-
Width of the vector.
Example:
$wdb addvector $sigNo2 "1X" 2
$wdb close
The $wdb close
command writes all data, frees used memory
and deletes the $wdb
Tcl command.
Usage:
$wdb close
Parameters:
No parameters.
Example:
$wdb close
$wdb dirvar
The $wdb dirvar
command look for a variable in the current scope.
If found it sets the direction.
Usage:
$wdb dirvar name dir
Parameters:
dir
-
direction.
name
-
Name of the variable.
Example:
$wdb dirvar "foo" inout
$wdb done
The $wdb done
command marks the end of all value changes.
Usage:
$wdb done
Parameters:
No parameters.
Example:
$wdb done
$wdb dump
dump memory to file.
Usage:
$wdb dump fname
Parameters:
fname
-
The name of the dump file
Example:
$wdb dump "out.dmp"
$wdb enddefinitions
The $wdb enddefinitions
command ends the variable definitions and starts
adding value changes.
Usage:
$wdb enddefinitions
Parameters:
No parameters.
Example:
$wdb enddefinitions
$wdb findalias
The $wdb findalias
command look for a alias variable in the
the current scope.
If found it returns the signal id signo
else -1.
Usage:
$wdb findalias name type ?iname?
Parameters:
iname (optional)
-
Instance name of pin alias.
name
-
Name of the variable.
type
-
Alias type.
Example:
set sigNo2 [$wdb findalias "foo" Net]
$wdb findvar
The $wdb findvar
command look for a variable in the current scope.
If found it returns the signal id signo
else -1.
Usage:
$wdb findvar name
Parameters:
name
-
Name of the variable.
Example:
set sigNo2 [$wdb findvar "foo"]
$wdb hidevar
The $wdb hidevar
command look for a variable in the current scope.
If found it sets the hide flag.
Usage:
$wdb hidevar name h
Parameters:
h
-
Hide flag.
name
-
Name of the variable.
Example:
$wdb hidevar "foo" 1
$wdb isReady
Check if wdb is ready to create readers.
Usage:
$wdb isReady
Parameters:
No parameters.
Example:
$wdb isReady
$wdb memdump
dump memory to file.
Usage:
$wdb memdump fname
Parameters:
fname
-
The name of the dump file
Example:
$wdb memdump "out.dmp"
$wdb memory
Return memory statistics of the WDB database.
Usage:
$wdb memory
Parameters:
No parameters.
Example:
set mem [$wdb memory]
$wdb nextsigno
The $wdb nextsigno
command returns the next usable signal id.
Usage:
$wdb nextsigno
Parameters:
No parameters.
Example:
set sigNo [$wdb nextsigno]
$wdb pathscope
The $wdb pathscope
command sets the current scope as path
for upcoming variable definitions.
Usage:
$wdb pathscope ?-relative? type names
Parameters:
-relative (optional)
-
Start path as current scope.
names
-
Path of the scope names.
type
-
Type of the scope. The following scope types are possible: unknown, module, task, function, begin and fork
Example:
$wdb pathscope "module" {"ALU" "ADDER"}
$wdb reader
new reader subcommand.
Usage:
$wdb reader ?optionList?
Parameters:
optionList (optional)
-
List of string options.
Example:
set rdr [$wdb reader]
$wdb readvcd
Parse a VCD file into wdb.
Usage:
$wdb readvcd ?-from from? ?-strict? ?-to to? fname
Parameters:
-from from (optional default is 0)
-
Skip data until from
-strict (optional)
-
Enable strict mode
-to to (optional default is 0)
-
Stop parsing at to
fname
-
Name of the VCD file to read.
Example:
$wdb readvcd -from 0 -to 1000 -strict "test.vcd"
$wdb save
Save memory to binfile.
Usage:
$wdb save fname
Parameters:
fname
-
The name of the binary file
Example:
$wdb save "out.wdb"
$wdb scope
The $wdb scope
command sets the current scope for upcoming variable
definitions.
Usage:
$wdb scope type name
Parameters:
name
-
Name of the scope.
type
-
Type of the scope. The following scope types are possible: unknown, module, task, function, begin and fork
Example:
$wdb scope "module" "CPU"
$wdb setdate
The $wdb setdate
command sets the date string in the header data.
Usage:
$wdb setdate date
Parameters:
date
-
Set the given date string.
Example:
$wdb setdate "03.11.14"
$wdb settimescale
The $wdb settimescale
command sets the timescale string in the header
data.
Usage:
$wdb settimescale scale
Parameters:
scale
-
Set the given timescale string.
Example:
$wdb settimescale "1ns"
$wdb setversion
The $wdb setversion
command sets the version string in the header data.
Usage:
$wdb setversion version
Parameters:
version
-
Set the given version string.
Example:
$wdb setversion "1.3"
$wdb stats
The $wdb stats
command prints the stats collected for the wdb.
Usage:
$wdb stats ?-detailed?
Parameters:
-detailed (optional)
-
Print each signal’s stats
Example:
$wdb stats
$wdb upscope
The $wdb upscope
command sets to current scope one level up.
Usage:
$wdb upscope
Parameters:
No parameters.
Example:
$wdb upscope
$wdb writevcd
dump memory to file.
Usage:
$wdb writevcd fname
Parameters:
fname
-
The name of the dump file
Example:
$wdb writevcd "out.dmp"
$wdbRead foreach
Iterate over object of given type. Evaluate body with loop variable set to current object. 'varitem' is the combination of variables and groups.
$wdbRead foreach clone
Loop over clones.
Usage:
$wdbRead foreach clone ?scopeid? var body
Parameters:
body
-
Loop Body.
scopeid (optional)
-
Scope of clone.
var
-
Name of loop variable.
Example:
$rdr foreach clone cvar {set cname [$rdr varname $cvar]}
$rdr foreach clone $scopeid cvar {set cname [$rdr varname $cvar]}
$wdbRead foreach group
Loop over groups.
Usage:
$wdbRead foreach group ?scopeid? var body
Parameters:
body
-
Loop Body.
scopeid (optional)
-
Scope of group.
var
-
Name of loop variable.
Example:
$rdr foreach group gvar {set gname [$rdr varname $gvar]}
$rdr foreach group $scopeid gvar {set gname [$rdr varname $gvar]}
$wdbRead foreach member
Loop over member.
Usage:
$wdbRead foreach member ?-lsbfirst? ?-msbfirst? varid mvar body
Parameters:
-lsbfirst (optional)
-
LSB first.
-msbfirst (optional)
-
MSB first.
body
-
Loop Body.
mvar
-
Name of loop variable.
varid
-
Variable ID.
Example:
$rdr foreach member $varid mvar {set mname [$rdr varname $mvar]}
$rdr foreach member -lsbfirst $varid mvar {}
$rdr foreach member -msbfirst $varid mvar {}
$wdbRead foreach scope
Loop over scopes.
Usage:
$wdbRead foreach scope ?scopeid? svar body
Parameters:
body
-
Loop Body.
scopeid (optional)
-
Scope ID.
svar
-
Name of loop variable.
Example:
$rdr foreach scope svar {set sname [$rdr scopename $svar]}
$rdr foreach scope $scopeid svar {set sname [$rdr scopename $svar]}
$wdbRead foreach variable
Loop over scopes.
Usage:
$wdbRead foreach variable ?parentScopeId? vvar body
Parameters:
body
-
Loop Body.
parentScopeId (optional)
-
Scopeid ID.
vvar
-
Name of loop variable.
Example:
$rdr foreach variable vvar {set vname [$rdr varname $vvar]}
$rdr foreach variable $scopeid vvar {set vname [$rdr varname $vvar]}
$wdbRead foreach varitem
Loop over variable items.
Usage:
$wdbRead foreach varitem ?scopeid? var body
Parameters:
body
-
Loop Body.
scopeid (optional)
-
Scope of group.
var
-
Name of loop variable.
Example:
$rdr foreach varitem gvar {set gname [$rdr varname $gvar]}
$rdr foreach varitem $scopeid gvar {set gname [$rdr varname $gvar]}
$wdbRead calcZoom
set new from/to range for zoom.
Usage:
$wdbRead calcZoom fromName toName factor ?center?
Parameters:
center (optional)
-
optional center of zoom.
factor
-
zoom factor, positive is zoom in, negative is zoom out, 0 is fullfit. or use 'in', 'out' 'full' for 0.1, -0.1 and 0.
fromName
-
name of from variable.
toName
-
name of to variable.
Example:
set from 0
set to 1000
$rdr calcZoom from to 0.1 250
$wdbRead clonecreate
create a new clone.
Usage:
$wdbRead clonecreate varid
Parameters:
varid
-
Variable referenced from clone.
Example:
set c [$rdr clonecreate $varid]
$wdbRead clonedelete
delete a clone or all clones.
Usage:
$wdbRead clonedelete ?varid?
Parameters:
varid (optional)
-
Clone to delete.
Example:
$rdr clonedelete $c
$wdbRead date
return date string from header.
Usage:
$wdbRead date
Parameters:
No parameters.
Example:
set str [$rdr date]
$wdbRead DUTscope
get current scope to design under test.
Usage:
$wdbRead DUTscope
Parameters:
No parameters.
Example:
set dutScopeId [$rdr DUTscope]
$wdbRead DUTtopName
get current top module name of design under test.
Usage:
$wdbRead DUTtopName
Parameters:
No parameters.
Example:
set topName [$rdr DUTtopName]
$wdbRead firsttime
return the smallest (first) time in wdb.
Usage:
$wdbRead firsttime
Parameters:
No parameters.
Example:
set t [$rdr firsttime]
$wdbRead free
Free all memory used by given reader and remove TCL command.
Usage:
$wdbRead free
Parameters:
No parameters.
Example:
$rdr free
$wdbRead group
return the value at the given time. It is an error if the given 'varId' is not a vector.
Usage:
$wdbRead group time varId
Parameters:
time
-
Current time.
varId
-
Variable ID.
Example:
set v [$rdr group $time $varid]
$wdbRead groupbuild
Create groups for variables with same basename.
Usage:
$wdbRead groupbuild ?-hidemember hidemember? ?-rangedown rangedown? ?-scope scopeId? ?-type vartype?
Parameters:
-hidemember hidemember (optional default is zFalse)
-
Hide members contained in group.
-rangedown rangedown (optional default is zFalse)
-
Group members with range downwards.
-scope scopeId (optional default is WdbReadNullScopeId)
-
Scope of group.
-type vartype (optional default is WdbVarInvalid)
-
Type of group.
Example:
$rdr groupbuild -scope $scopeid -type reg -hidemember on -rangedown on
$wdbRead groupcreate
create a new group.
Usage:
$wdbRead groupcreate ?-autoScope? ?-expandVectors? ?-hidemember hidemember? ?-scope scope? ?-type type? name varidList
Parameters:
-autoScope (optional)
-
Derive the scope from the variable list. Uses the common scope or the null scope.
-expandVectors (optional)
-
If this flag is enabled, vectors are not expanded to their members.
-hidemember hidemember (optional default is zFalse)
-
Hide members contained in group.
-scope scope (optional default is WdbReadNullScopeId)
-
Scope of group.
-type type (optional default is WdbVarGroup)
-
Type of group.
name
-
Name of group.
varidList
-
Variables contained in group.
Example:
set g [$rdr groupcreate -scope $scopeid -hidemember on -type reg $name [list $varid]]
$wdbRead groupdelete
delete a group or all groups.
Usage:
$wdbRead groupdelete ?varid?
Parameters:
varid (optional)
-
Group to delete.
Example:
$rdr groupdelete $g
$wdbRead groupfind
Find a group by name.
Usage:
$wdbRead groupfind name
Parameters:
name
-
Name of the group.
Example:
$rdr groupfind Grp1
$wdbRead groupredefine
redefine a given group
Usage:
$wdbRead groupredefine ?-expandVectors? grpid varidList ?hidemember?
Parameters:
-expandVectors (optional)
-
If this flag is enabled, vectors are not expanded to their members.
grpid
-
Group to redefine.
hidemember (optional)
-
Hide members contained in group.
varidList
-
Variables contained in group.
Example:
$rdr groupredefine $g [list $varid]
$wdbRead grouprename
rename a given group.
Usage:
$wdbRead grouprename varid name
Parameters:
name
-
New name of group.
varid
-
Group to delete.
Example:
$rdr grouprename $g "newname"
$wdbRead isscopeid
return true if id is a valid scopeid.
Usage:
$wdbRead isscopeid scopeid
Parameters:
scopeid
-
Scope ID.
Example:
if {[$rdr isscopeid $varid]} {
# ...
}
$wdbRead isvarid
return true if id is a valid varid.
Usage:
$wdbRead isvarid varid
Parameters:
varid
-
Variable or member ID.
Example:
if {[$rdr isvarid $varid]} {
# ...
}
$wdbRead lasttime
return the biggest (last) time in wdb.
Usage:
$wdbRead lasttime
Parameters:
No parameters.
Example:
set t [$rdr lasttime]
$wdbRead member
return the value at the given time. It is an error if the given 'varId' is not a vector.
Usage:
$wdbRead member time varId
Parameters:
time
-
Current time.
varId
-
Variable ID.
Example:
set v [$rdr member $time $varid]
$wdbRead memvar
Return var id of the given group member variable.
Usage:
$wdbRead memvar memid
Parameters:
memid
-
Group member variable ID.
Example:
set memvarid [$rdr memvar $vmid]
$wdbRead nexttime
search for the next value change in given list of variables 'varIdLst' before 'time'. If multiple variables have a value change before the given 'time' the nearest is returned. If none is found until the optional 'tlimit' is reached '{}' is returned.
Usage:
$wdbRead nexttime time ?timeLimit? varIds
Parameters:
time
-
Current time.
timeLimit (optional)
-
Specify a time to stop the search.
varIds
-
List of variable IDs.
Example:
set t [$rdr nexttime 1000 [list $varid]]
$wdbRead nextvalue
search for the next value change in given list of variables 'varIdLst' before 'time', which matches the given value. If multiple variables have a value change before the given 'time' the nearest is returned. If none is found until the optional 'tlimit' is reached '{}' is returned.
Usage:
$wdbRead nextvalue time ?timeLimit? varIds value
Parameters:
time
-
Current time.
timeLimit (optional)
-
Specify a time to stop the search.
value
-
Possible values are: x/X, z/Z, 0, 1
varIds
-
List of variable IDs.
Example:
set t [$rdr nextvalue 1000 [list $varid] "101X"]
$wdbRead options
Return option string list used to create the reader.
Usage:
$wdbRead options
Parameters:
No parameters.
Example:
set str [$rdr options]
$wdbRead pix2time
return time for given pix index by from and to time and pixelcnt.
Usage:
$wdbRead pix2time from to pixelCnt pix
Parameters:
from
-
from time step.
pix
-
pixel index which should be converted into time step.
pixelCnt
-
width of drawing rectangle.
to
-
to time step.
Example:
set pix [$rdr pix2time 0 1000 100 42]
$wdbRead prevtime
search for the previous value change in given list of variables 'varIdLst' before 'time'. If multiple variables have a value change before the given 'time' the nearest is returned. If none is found until the optional 'tlimit' is reached '{}' is returned.
Usage:
$wdbRead prevtime time ?timeLimit? varIds
Parameters:
time
-
Current time.
timeLimit (optional)
-
Specify a time to stop the search.
varIds
-
List of variable IDs.
Example:
set t [$rdr prevtime 1000 [list $varid]]
$wdbRead prevvalue
search for the previous value change in given list of variables 'varIdLst' before 'time', which matches the given value. If multiple variables have a value change before the given 'time' the nearest is returned. If none is found until the optional 'tlimit' is reached '{}' is returned.
Usage:
$wdbRead prevvalue time ?timeLimit? varIds value
Parameters:
time
-
Current time.
timeLimit (optional)
-
Specify a time to stop the search.
value
-
Possible values are: x/X, z/Z, 0, 1
varIds
-
List of variable IDs.
Example:
set t [$rdr prevvalue 1000 [list $varid] "101X"]
$wdbRead real
return the value at the given time. It is an error if the given 'varId' is not a real.
Usage:
$wdbRead real time varId
Parameters:
time
-
Current time.
varId
-
Variable ID.
Example:
set v [$rdr real $time $varid]
$wdbRead scalar
return the value at the given time. It is an error if the given 'varId' is not a scalar.
Usage:
$wdbRead scalar time varId
Parameters:
time
-
Current time.
varId
-
Variable ID.
Example:
set v [$rdr scalar $time $varid]
$wdbRead scopedown
return the first scope id of one level below the given scope.
If there is no scope below given scope an empty list '{}' is returned.
If the optional 'scopeid' parameter is missing the top scope, which contains all toplevel scopes, is returned.
Usage:
$wdbRead scopedown ?scopeid?
Parameters:
scopeid (optional)
-
Scope ID.
Example:
set downScopeId [$rdr scopedown $scopeid]
$wdbRead scopefind
search the scope with given name below the given parent scopeid.
If there is no scope found an empty list "{}" is returned.
Usage:
$wdbRead scopefind ?scopeid? name
Parameters:
name
-
Name of scope.
scopeid (optional)
-
Scope ID.
Example:
set scopeId [$rdr scopefind "top"]
set scopeId [$rdr scopefind $scopeid "foo"]
$wdbRead scopefindnamepath
search the scope with given name path starting at given scope or root.
If there is no scope found an empty list "{}" is returned.
Usage:
$wdbRead scopefindnamepath ?scopeid? name
Parameters:
name
-
List of scope names.
scopeid (optional)
-
Scope ID.
Example:
set scopeId [$rdr scopefindnamepath {"top"}]
set scopeId [$rdr scopefind $scopeid "foo"]
$wdbRead scopename
return name of given scope.
Usage:
$wdbRead scopename scopeid
Parameters:
scopeid
-
Scope ID.
Example:
set name [$rdr scopename $scopeid]
$wdbRead scopenamepath
Return path of scopenames. Empty names are ignored.
Usage:
$wdbRead scopenamepath ?-fromDUT? scopeid
Parameters:
-fromDUT (optional)
-
Scope path from DUT.
scopeid
-
Start scope ID.
Example:
set newscopeid [$rdr scopenamepath $scopeid]
$wdbRead scopepath
Return of path of scopeids.
Usage:
$wdbRead scopepath ?-fromDUT? scopeid
Parameters:
-fromDUT (optional)
-
Scope path from DUT.
scopeid
-
Start scope ID.
Example:
set newscopeid [$rdr scopepath $scopeid]
$wdbRead scopeTreeModel
Create a new module list object.
Usage:
$wdbRead scopeTreeModel
Parameters:
No parameters.
Example:
set scopeTreeModel [$rdr scopeTreeModel]
$wdbRead scopetype
return type of given scope.
Usage:
$wdbRead scopetype scopeid
Parameters:
scopeid
-
Scope ID.
Example:
set type [$rdr scopetype $scopeid]
$wdbRead scopeup
return the scope id of the parent scope of given scope.
Usage:
$wdbRead scopeup scopeid
Parameters:
scopeid
-
Scope ID.
Example:
set upScopeId [$rdr scopeup $scopeid]
$wdbRead setDUT
set scope and topname to design under test.
Usage:
$wdbRead setDUT scopeid topName
Parameters:
scopeid
-
Start scope ID.
topName
-
Name of top design module.
Example:
$rdr setDUT $scopeid "top"
$wdbRead signalTreeModel
Create a new module list object.
Usage:
$wdbRead signalTreeModel
Parameters:
No parameters.
Example:
set signalTreeModel [$rdr signalTreeModel $scopeId]
$wdbRead signo
return the signal number of the given variable.
Usage:
$wdbRead signo varid
Parameters:
varid
-
Variable ID.
Example:
set signo [$rdr signo $varid]
$wdbRead str2time
return time step in relation to timescale.
Usage:
$wdbRead str2time ?-fraction? str
Parameters:
-fraction (optional)
-
allow fraction if string can be converted into timescale.
str
-
string which should be converted. Special 'first' and 'last' are allowed and return the reader limits.
Example:
set str [$rdr str2time 42ns]
$wdbRead str2varid
Try to convert a string to varId.
Usage:
$wdbRead str2varid str
Parameters:
str
-
The source string
Example:
set varid [$rdr str2varid $str]
$wdbRead time2pix
return pix index for given time scaled by from and to time and pixelcnt.
Usage:
$wdbRead time2pix from to pixelCnt time
Parameters:
from
-
from time step.
pixelCnt
-
width of drawing rectangle.
time
-
time step which should be converted into pixel index.
to
-
to time step.
Example:
set pix [$rdr time2pix 0 1000 100 42]
$wdbRead time2str
return time step scaled with time factor and unit of timescale. As default, the string is shortened if the value is divisible by 1000 (one or multiple times), e.g. 1000000ps will be converted to 1us.
Usage:
$wdbRead time2str ?-fraction? ?-timescale? time
Parameters:
-fraction (optional)
-
use fractions if the value is divisible by 100, e.g. convert 3100ns to 3.1us.
-timescale (optional)
-
disable the default shortening of the string in case the value is divisible by 1000.
time
-
time step which should be converted.
Example:
set str [$rdr time2str 42]
$wdbRead timescale
return timescale string from header.
Usage:
$wdbRead timescale
Parameters:
Example:
set str [$rdr timescale]
$wdbRead valarray
return a list with pixel strings for each variable of 'varIdLst'.
Each string is 'pixelCnt' characters long and represents the time range from 'tfrom' to 'tto'.
Each character of the pixel string contains one of the following values:
-
' ' - no values on this pixel
-
'0' - all values on this pixel are 0
-
'1' - all values on this pixel are 1
-
'B' - constant bus value (no x or z)
-
'*' - there are '0' and '1' on this pixel
-
'C' - value change in bus
-
'Z' - all values on this pixel are Z
-
'X' - all values on this pixel are X
-
'Y' - all values in the bus on this pixel are X
-
'z' - multiple values on this pixel, at least one 'Z'
-
'x' - multiple values on this pixel, at least one 'X'
Usage:
$wdbRead valarray fromTime toTime vidList pixelCount
Parameters:
fromTime
-
Start time.
pixelCount
-
Number of available pixels to display.
toTime
-
End time.
vidList
-
Number of available pixels to display.
Example:
set vidLst {}
$rdr foreach variable vid {
lappend vidLst $vid
}
set btime 1000
set etime 4000
set result [$rdr valarray $btime $etime $vidLst 80]
foreach pixStr $result {
# Each pixStr is 80 character long.
}
$wdbRead valtype
return the value type of the given variable.
Usage:
$wdbRead valtype varid
Parameters:
varid
-
Variable ID.
Example:
set valtype [$rdr valtype $varid]
$wdbRead value
return the value at the given time. It is an error if the given 'varId' is not a vector.
Usage:
$wdbRead value time varId
Parameters:
time
-
Current time.
varId
-
Variable ID.
Example:
set v [$rdr value $time $varid]
$wdbRead varaliasfind
find alias and return it’s id.
Usage:
$wdbRead varaliasfind scopeid type name ?iname?
Parameters:
iname (optional)
-
Instance name of (pin) alias.
name
-
Name of variable.
scopeid
-
Scope ID.
type
-
alias type of variable.
Example:
set newVid [$rdr varaliasfind $scopeid pin "foo"]
$wdbRead varaliasinstname
return the inst name of the given alias.
Usage:
$wdbRead varaliasinstname varid
Parameters:
varid
-
Variable ID.
Example:
set iname [$rdr varaliasinstname $varid]
$wdbRead varaliastype
return the aliastype of the given variable.
Usage:
$wdbRead varaliastype varid
Parameters:
varid
-
Variable ID.
Example:
set type [$rdr varaliastype $varid]
$wdbRead varbit
Return the bit of the given vector member variable. It is an error if 'vmid' is not a member variable.
Usage:
$wdbRead varbit varid
Parameters:
varid
-
Variable ID.
Example:
set mem [$rdr varbit $vmid]
$wdbRead varbus
return the group or vector variable to which the given member variable belongs. It is an error if 'vmid' is not a member variable.
Usage:
$wdbRead varbus varid
Parameters:
varid
-
Variable member ID.
Example:
set varid [$rdr varbus $vmid]
$wdbRead vardir
return the direction of a variable.
Usage:
$wdbRead vardir varid
Parameters:
varid
-
Variable ID.
Example:
set d [$rdr vardir $varid]
$wdbRead vardirset
set the direction of a variable.
Usage:
$wdbRead vardirset varid dir
Parameters:
dir
-
Set the direction.
varid
-
Variable ID.
Example:
$rdr vardirset $varid in
$wdbRead varfind
find var and return it’s id.
Usage:
$wdbRead varfind scopeid name
Parameters:
name
-
Name of variable.
scopeid
-
Scope ID.
Example:
set newVid [$rdr varfind $scopeid "foo"]
$wdbRead varhaschanges
Return true if variable id has value changes.
Usage:
$wdbRead varhaschanges varid
Parameters:
varid
-
Variable ID.
Example:
if {[$rdr varhaschanges $varid]} {
# ...
}
$wdbRead varhasmem
return true if variable id has member variable (e.g. vector or group).
Usage:
$wdbRead varhasmem varid
Parameters:
varid
-
Variable ID or member ID.
Example:
if {[$rdr varhasmem $varid]} {
# ...
}
$wdbRead varhasvectormem
Return true if variable group id contains vector members.
Usage:
$wdbRead varhasvectormem varid
Parameters:
varid
-
Variable ID.
Example:
if {[$rdr varhasvectormem $varid]} {
# ...
}
$wdbRead varhide
return the hide flag of a variable.
Usage:
$wdbRead varhide varid
Parameters:
varid
-
Variable ID.
Example:
set h [$rdr varhide $varid]
$wdbRead varhideset
return the hide flag of a variable or set it.
Usage:
$wdbRead varhideset varid hide
Parameters:
hide
-
Set the hide flag on or off.
varid
-
Variable ID.
Example:
$rdr varhideset $varid true
$wdbRead varid2str
Try to convert a varId to string.
Usage:
$wdbRead varid2str varId
Parameters:
varId
-
The varid which should be converted.
Example:
set str [$rdr varid2str $varId]
$wdbRead varismem
Return true if variable id is a member variable.
Usage:
$wdbRead varismem varid
Parameters:
varid
-
Variable ID or member ID.
Example:
if {[$rdr varismem $varid]} {
# ...
}
$wdbRead varmem
Return member index for given member variable. It is an error if 'vmid' is not a member variable.
Usage:
$wdbRead varmem varid
Parameters:
varid
-
Variable ID.
Example:
set found 0
$rdr foreach variable varid {
if {![$rdr varhasmem $varid]} {
continue
}
$rdr foreach member $varid vmid {
set found 1
break
}
if {$found} {
break
}
}
set mem [$rdr varmem $vmid]
$wdbRead varname
return the name of the given variable.
Usage:
$wdbRead varname varid
Parameters:
varid
-
Variable ID.
Example:
set name [$rdr varname $varid]
$wdbRead varscope
Return the scope containing of the given variable.
Usage:
$wdbRead varscope varid
Parameters:
varid
-
Variable ID.
Example:
set scope [$rdr varscope $varid]
$wdbRead vartype
return the type of the given variable.
Usage:
$wdbRead vartype varid
Parameters:
varid
-
Variable ID.
Example:
set type [$rdr vartype $varid]
$wdbRead varwidth
return the width of the given variable.
Usage:
$wdbRead varwidth varid
Parameters:
varid
-
Variable ID.
Example:
set width [$rdr varwidth $varid]
$wdbRead vector
return the value at the given time. It is an error if the given 'varId' is not a vector.
Usage:
$wdbRead vector time varId
Parameters:
time
-
Current time.
varId
-
Variable ID.
Example:
set v [$rdr vector $time $varid]
$wdbRead version
return version string from header.
Usage:
$wdbRead version
Parameters:
No parameters.
Example:
set str [$rdr version]