$wdb reader

new reader subcommand.


Usage:

$wdb reader


Parameters:

No parameters.


Example:

set rdr [$wdb reader]

$wread foreach

Iterate over object of given type. Evaluate body with loop variable set to current object. 'varitem' is the combination of variables and groups.

$wread foreach clone

Loop over clones.


Usage:

$wread 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]}

$wread foreach group

Loop over groups.


Usage:

$wread 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]}

$wread foreach member

Loop over member.


Usage:

$wread 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 {}

$wread foreach scope

Loop over scopes.


Usage:

$wread 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]}

$wread foreach variable

Loop over scopes.


Usage:

$wread 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]}

$wread foreach varitem

Loop over variable items.


Usage:

$wread 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]}

$wread calcZoom

set new from/to range for zoom.


Usage:

$wread 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

$wread clonecreate

create a new clone.


Usage:

$wread clonecreate varid


Parameters:

varid

Variable referenced from clone.


Example:

set c [$rdr clonecreate $varid]

$wread clonedelete

delete a clone or all clones.


Usage:

$wread clonedelete ?varid?


Parameters:

varid (optional)

Clone to delete.


Example:

$rdr clonedelete $c

$wread date

return date string from header.


Usage:

$wread date


Parameters:

No parameters.


Example:

set str [$rdr date]

$wread DUTscope

get current scope to design under test.


Usage:

$wread DUTscope


Parameters:

No parameters.


Example:

set dutScopeId [$rdr DUTscope]

$wread DUTtopName

get current top module name of design under test.


Usage:

$wread DUTtopName


Parameters:

No parameters.


Example:

set topName [$rdr DUTtopName]

$wread firsttime

return the smallest (first) time in wdb.


Usage:

$wread firsttime


Parameters:

No parameters.


Example:

set t [$rdr firsttime]

$wread free

Free all memory used by given reader and remove TCL command.


Usage:

$wread free


Parameters:

No parameters.


Example:

$rdr free

$wread group

return the value at the given time. It is an error if the given 'varId' is not a vector.


Usage:

$wread group time varId


Parameters:

time

Current time.

varId

Variable ID.


Example:

set v [$rdr group $time $varid]

$wread groupbuild

Create groups for variables with same basename.


Usage:

$wread 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 WreadNullScopeId)

Scope of group.

-type vartype (optional default is WdbVarInvalid)

Type of group.


Example:

$rdr groupbuild -scope $scopeid -type reg -hidemember on -rangedown on

$wread groupcreate

create a new group.


Usage:

$wread 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 WreadNullScopeId)

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]]

$wread groupdelete

delete a group or all groups.


Usage:

$wread groupdelete ?varid?


Parameters:

varid (optional)

Group to delete.


Example:

$rdr groupdelete $g

$wread groupfind

Find a group by name.


Usage:

$wread groupfind name


Parameters:

name

Name of the group.


Example:

$rdr groupfind Grp1

$wread groupredefine

redefine a given group


Usage:

$wread 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]

$wread grouprename

rename a given group.


Usage:

$wread grouprename varid name


Parameters:

name

New name of group.

varid

Group to delete.


Example:

$rdr grouprename $g "newname"

$wread isscopeid

return true if id is a valid scopeid.


Usage:

$wread isscopeid scopeid


Parameters:

scopeid

Scope ID.


Example:

if {[$rdr isscopeid $varid]} {
    # ...
}

$wread isvarid

return true if id is a valid varid.


Usage:

$wread isvarid varid


Parameters:

varid

Variable or member ID.


Example:

if {[$rdr isvarid $varid]} {
    # ...
}

$wread lasttime

return the biggest (last) time in wdb.


Usage:

$wread lasttime


Parameters:

No parameters.


Example:

set t [$rdr lasttime]

$wread member

return the value at the given time. It is an error if the given 'varId' is not a vector.


Usage:

$wread member time varId


Parameters:

time

Current time.

varId

Variable ID.


Example:

set v [$rdr member $time $varid]

$wread memvar

Return var id of the given group member variable.


Usage:

$wread memvar memid


Parameters:

memid

Group member variable ID.


Example:

set memvarid [$rdr memvar $vmid]

$wread 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:

$wread 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]]

$wread 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:

$wread 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"]

$wread pix2time

return time for given pix index by from and to time and pixelcnt.


Usage:

$wread 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]

$wread 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:

$wread 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]]

$wread 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:

$wread 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"]

$wread real

return the value at the given time. It is an error if the given 'varId' is not a real.


Usage:

$wread real time varId


Parameters:

time

Current time.

varId

Variable ID.


Example:

set v [$rdr real $time $varid]

$wread scalar

return the value at the given time. It is an error if the given 'varId' is not a scalar.


Usage:

$wread scalar time varId


Parameters:

time

Current time.

varId

Variable ID.


Example:

set v [$rdr scalar $time $varid]

$wread 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:

$wread scopedown ?scopeid?


Parameters:

scopeid (optional)

Scope ID.


Example:

set downScopeId [$rdr scopedown $scopeid]

$wread scopefind

search the scope with given name below the given parent scopeid.

If there is no scope found an empty list "{}" is returned.


Usage:

$wread scopefind ?scopeid? name


Parameters:

name

Name of scope.

scopeid (optional)

Scope ID.


Example:

set scopeId [$rdr scopefind "top"]
set scopeId [$rdr scopefind $scopeid "foo"]

$wread 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:

$wread 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"]

$wread scopename

return name of given scope.


Usage:

$wread scopename scopeid


Parameters:

scopeid

Scope ID.


Example:

set name [$rdr scopename $scopeid]

$wread scopenamepath

Return path of scopenames. Empty names are ignored.


Usage:

$wread scopenamepath ?-fromDUT? scopeid


Parameters:

-fromDUT (optional)

Scope path from DUT.

scopeid

Start scope ID.


Example:

set newscopeid [$rdr scopenamepath $scopeid]

$wread scopepath

Return of path of scopeids.


Usage:

$wread scopepath ?-fromDUT? scopeid


Parameters:

-fromDUT (optional)

Scope path from DUT.

scopeid

Start scope ID.


Example:

set newscopeid [$rdr scopepath $scopeid]

$wread scopeTreeModel

Create a new module list object.


Usage:

$wread scopeTreeModel


Parameters:

No parameters.


Example:

set scopeTreeModel [$rdr scopeTreeModel]

$wread scopetype

return type of given scope.


Usage:

$wread scopetype scopeid


Parameters:

scopeid

Scope ID.


Example:

set type [$rdr scopetype $scopeid]

$wread scopeup

return the scope id of the parent scope of given scope.


Usage:

$wread scopeup scopeid


Parameters:

scopeid

Scope ID.


Example:

set upScopeId [$rdr scopeup $scopeid]

$wread setDUT

set scope and topname to design under test.


Usage:

$wread setDUT scopeid topName


Parameters:

scopeid

Start scope ID.

topName

Name of top design module.


Example:

$rdr setDUT $scopeid "top"

$wread signalTreeModel

Create a new module list object.


Usage:

$wread signalTreeModel


Parameters:

No parameters.


Example:

set signalTreeModel [$rdr signalTreeModel $scopeId]

$wread signo

return the signal number of the given variable.


Usage:

$wread signo varid


Parameters:

varid

Variable ID.


Example:

set signo [$rdr signo $varid]

$wread str2time

return time step in relation to timescale.


Usage:

$wread 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]

$wread str2varid

Try to convert a string to varId.


Usage:

$wread str2varid str


Parameters:

str

The source string


Example:

set varid [$rdr str2varid $str]

$wread time2pix

return pix index for given time scaled by from and to time and pixelcnt.


Usage:

$wread 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]

$wread time2str

return time step scaled with time factor and unit of timescale.


Usage:

$wread time2str ?-fraction? ?-timescale? time


Parameters:

-fraction (optional)

do not try to use shortest string.

-timescale (optional)

do not try to use shortest string.

time

time step which should be converted.


Example:

set str [$rdr time2str 42]

$wread timescale

return timescale string from header.


Usage:

$wread timescale


Parameters:


Example:

set str [$rdr timescale]

$wread 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:

$wread 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.
}

$wread valtype

return the value type of the given variable.


Usage:

$wread valtype varid


Parameters:

varid

Variable ID.


Example:

set valtype [$rdr valtype $varid]

$wread value

return the value at the given time. It is an error if the given 'varId' is not a vector.


Usage:

$wread value time varId


Parameters:

time

Current time.

varId

Variable ID.


Example:

set v [$rdr value $time $varid]

$wread varaliasfind

find alias and return it’s id.


Usage:

$wread 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"]

$wread varaliasinstname

return the inst name of the given alias.


Usage:

$wread varaliasinstname varid


Parameters:

varid

Variable ID.


Example:

set iname [$rdr varaliasinstname $varid]

$wread varaliastype

return the aliastype of the given variable.


Usage:

$wread varaliastype varid


Parameters:

varid

Variable ID.


Example:

set type [$rdr varaliastype $varid]

$wread varbit

Return the bit of the given vector member variable. It is an error if 'vmid' is not a member variable.


Usage:

$wread varbit varid


Parameters:

varid

Variable ID.


Example:

set mem [$rdr varbit $vmid]

$wread 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:

$wread varbus varid


Parameters:

varid

Variable member ID.


Example:

set varid [$rdr varbus $vmid]

$wread vardir

return the direction of a variable.


Usage:

$wread vardir varid


Parameters:

varid

Variable ID.


Example:

set d [$rdr vardir $varid]

$wread vardirset

set the direction of a variable.


Usage:

$wread vardirset varid dir


Parameters:

dir

Set the direction.

varid

Variable ID.


Example:

$rdr vardirset $varid in

$wread varfind

find var and return it’s id.


Usage:

$wread varfind scopeid name


Parameters:

name

Name of variable.

scopeid

Scope ID.


Example:

set newVid [$rdr varfind $scopeid "foo"]

$wread varhaschanges

Return true if variable id has value changes.


Usage:

$wread varhaschanges varid


Parameters:

varid

Variable ID.


Example:

if {[$rdr varhaschanges $varid]} {
    # ...
}

$wread varhasmem

return true if variable id has member variable (e.g. vector or group).


Usage:

$wread varhasmem varid


Parameters:

varid

Variable ID or member ID.


Example:

if {[$rdr varhasmem $varid]} {
    # ...
}

$wread varhasvectormem

Return true if variable group id contains vector members.


Usage:

$wread varhasvectormem varid


Parameters:

varid

Variable ID.


Example:

if {[$rdr varhasvectormem $varid]} {
    # ...
}

$wread varhide

return the hide flag of a variable.


Usage:

$wread varhide varid


Parameters:

varid

Variable ID.


Example:

set h [$rdr varhide $varid]

$wread varhideset

return the hide flag of a variable or set it.


Usage:

$wread varhideset varid hide


Parameters:

hide

Set the hide flag on or off.

varid

Variable ID.


Example:

$rdr varhideset $varid true

$wread varid2str

Try to convert a varId to string.


Usage:

$wread varid2str varId


Parameters:

varId

The varid which should be converted.


Example:

set str [$rdr varid2str $varId]

$wread varismem

Return true if variable id is a member variable.


Usage:

$wread varismem varid


Parameters:

varid

Variable ID or member ID.


Example:

if {[$rdr varismem $varid]} {
    # ...
}

$wread varmem

Return member index for given member variable. It is an error if 'vmid' is not a member variable.


Usage:

$wread 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]

$wread varname

return the name of the given variable.


Usage:

$wread varname varid


Parameters:

varid

Variable ID.


Example:

set name [$rdr varname $varid]

$wread varscope

Return the scope containing of the given variable.


Usage:

$wread varscope varid


Parameters:

varid

Variable ID.


Example:

set scope [$rdr varscope $varid]

$wread vartype

return the type of the given variable.


Usage:

$wread vartype varid


Parameters:

varid

Variable ID.


Example:

set type [$rdr vartype $varid]

$wread varwidth

return the width of the given variable.


Usage:

$wread varwidth varid


Parameters:

varid

Variable ID.


Example:

set width [$rdr varwidth $varid]

$wread vector

return the value at the given time. It is an error if the given 'varId' is not a vector.


Usage:

$wread vector time varId


Parameters:

time

Current time.

varId

Variable ID.


Example:

set v [$rdr vector $time $varid]

$wread version

return version string from header.


Usage:

$wread version


Parameters:

No parameters.


Example:

set str [$rdr version]