wdb check

Return true if file is a readable binfile.


Usage:

wdb check fname


Parameters:

fname

The name of the binary file to check


Example:

set ok [wdb check "test.wdb"]

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 ?-analyze? ?-dump dumpmode? ?-generateStats? ?-noCollapse? ?-nogcd? ?-noop? ?-noSkipDupl? ?-nozip? ?-ptime ptime? ?-skipLeadX? ?-vcd? ?fname?


Parameters:

-analyze (optional)

Create analyze output.

-dump dumpmode (optional default is NULL)

Create dump output.

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

-noop (optional)

Create noop output.

-noSkipDupl (optional)

Do not skip duplicate values.

-nozip (optional)

Do not compress whole database.

-ptime ptime (optional default is -1)

Create ptime output.

-skipLeadX (optional)

Ignore leading 'X' values.

-vcd (optional)

Create text vcd file output.

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 info

Get verbose description about binfile.


Usage:

wdb info fname


Parameters:

fname

The name of the binary file


Example:

set info [wdb info "test.wdb"]

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 read

Parse a VCD file into memory and return the name of the new Tcl command for accessing the created in-memory WDB database.


Usage:

wdb read ?-from from? ?-noCollapse? ?-nogcd? ?-noSkipDupl? ?-skipLeadX? ?-to to? fname


Parameters:

-from from (optional default is 0)

Skip data until from

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

-skipLeadX (optional)

Ignore leading 'X' values.

-to to (optional default is 0)

Stop parsing at to

fname

Name of the VCD file to read.


Example:

set wdb [wdb read -from 0 -to 1000 "test.vcd"]

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

Create a new reader on the given database. Multiple readers can be created. Each reader should be freed with $rdr free command.


Usage:

$wdb reader


Parameters:

No parameters.


Example:

set rdr [$wdb reader]

$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