Python API

The TimingAnalyzer class is the main application class. It is assigned to the variable taApp automatically as the interpreter is initialized. It controls most all of the GUI related functions in the main window like multiple tabs for timing diagrams, the menus, the toolbar, and the status bar. It also controls switching from the timing diagram view to the image view and other views that might be added in the future. Possibly a “transaction editor” diagram view, or “analysis reports” view.

TimingDiagram

app.get_timing_diagram(taApp)

Get the current timing diagram

This function returns a reference to the current timing diagram being displayed.

Args:
taApp: A reference to the TimingAnalyzer
Returns:
td: A reference to the displayed timing diagram
Example:
td = get_timing_diagram(taApp)
app.new_timing_diagram(taApp, dir=None, file_name=None)

Start a new timing diagram.

This function initializes a new timing diagram and displays in the a new tabbed window.

Args:

dir: specifies the directory to save the timing diagram file

file_name: Specifies the file name used for this new timing diagram.

Returns:
td: A reference to the new timing diagram
Examples:

td = new_timing_diagram(taApp)

td = new_timing_diagram(taApp, ‘scripts’, ‘PCI_Read.tim’)

commands.get_time_scale(td)

Get the time scale of the timing diagram

Args:
td: A reference of the TimingDiagram
Returns:
ts: A double that is specifies the time scale
Example:
ts = get_time_scale(td)
commands.set_end_time(td, end_time)

Sets the end time of a TimingDiagram

Args:

td: A reference to the TimingDiagram

end_time: A long that specifies the TimingDiagram end time

In the time scale set
Example:
set_end_time(td1, 1600)
commands.set_start_time(td, start_time)

Sets the start time of a TimingDiagram

Args:

td: A reference to the TimingDiagram

end_time: A long that specifies the TimingDiagram start time

In the time scale set
Example:
set_end_time(td1, 100)
commands.start_script(td)

Start script disables the Graphics functions

Args:
td: A reference to the TimingDiagram
Example:
start_script(td1)
commands.stop_script(td)

Stop script enable the Graphics functions

Args:
td: A reference to the TimingDiagram
Example:
start_script(td1)

File I/O

app.get_file_name(taApp)

Get the file name of the current timing diagram

Args:
taApp: A reference to the TimingAnalyzer
Returns:
file_name: The file name String
Example:
fn = get_file_name(taApp)
app.file_save(taApp)

Save the current timing diagram

This function save the current timing diagram using the dir and file_name.

Args:
taApp: A reference to TimingAnalyzer
Returns:
None:
Example:
file_save(taApp)
app.get_abs_file_path(taApp)

Get the absolute file path for the current timing diagram

Args:
taApp: A reference to the TimingAnalyzer
Returns:
file_dir: The directory path name String
Example:
fp = get_abs_file_path(taApp)

Signals

commands.add_digital_clock(td, name, start_state, freq, duty_cycle=50)

Add a DigitalClock to the timing diagram.

Args:

name: A string that specifies the clock name

freq: A double that specifies the frequency

start_state: A string that specifies the start state

duty_cycle: An integer that specifies the duty cycle. Optional

Returns:
dclk: A reference to the newly created DigitalClock object
Examples:

dclk = add_digital_clock(td, ‘CLK25’, 25.0e6, ‘H’)

dclk = add_digital_clock(td, ‘CLK25’, 25.0e6, ‘H’, 40)

commands.add_digital_bus(td, name, start_state, format='Hex')

Add a DigitalBus to the timing diagram

Args:

name: A string the specifies the bus name

start_state: A string that specifies the start state

format: A string that specifies the format of the data

The bus name should be in the following format: addr_bus[15:0]

The bus format should be one of the following: ‘Hex’, ‘Bin’, ‘Dec’, ‘Text’

Returns:
dbus: A reference to the newly created DigitalBus object
Examples:

dbus = add_digital_bus(td, ‘ADDR[15:0]’, ‘Z’)

dbus = add_digital_bus(td, ‘ADDR[15:0]’, ‘Z’, ‘Bin’)

commands.add_digital_signal(td, name, start_state)

Add a DigitalSignal to the timing diagram

Args:

name: A string that specifies the signal name

start_state: A string that specifies the start state

Returns:
dsig: A reference to the newly created DigitalSignal object
Example:
dsig = add_digital_signal(td, ‘ENABLE’, ‘L’)
commands.get_edit_signal_list(td)

Get the list of signals that are selected in the timing diagram

This function returns a list of selected signals from the timing diagram

Args:
td: A reference to the timing diagram
Returns:
sig_list: A list of signals selected in the timing diagram
Example:
sig_list = get_edit_signal_list(td)
commands.get_state_at_time(sig, state_time)

Get the state of the signal at give time

Args:

sig: A reference to the Signal

state_time: A long that specifies the time * 1000

Returns:
state: A string that specifies the state of the signal at the time
Example:
next_state = get_state_at_time(clk_ena, 335000)
commands.get_name(sig)

Get the name of a signal

Args:
sig: A reference that specifies the signal
Returns:
sig_name: A string that is the signal name
Example:
sig_name = get_name(clk1)
commands.get_start_state(sig)

Get the start state of a signal

Args:
sig: A reference that specifies the signal
Returns:
ss: A string that is specifies the start state of the signal
Example:
ss = get_start_state(clk1)
commands.set_rise_time(sig, rise_time)

Sets the rise time of a signal

This function sets the time of the rising transistion.

Args:

sig: A reference that specifies the signal

fall_time: A double that specifies the rise time

Example:
set_rise_time(clk1, 4)
commands.set_fall_time(sig, fall_time)

Sets the fall time of a signal

This function sets the time of the falling transistion.

Args:

sig: A reference that specifies the signal

fall_time: A double that specifies the fall time

Example:
set_fall_time(clk1, 4)

Edges

commands.add_edge(sig, edge_time, edge_state)

Add a new Edge to the specified Signal

This function adds a new Edge to the signal. The signal changes to the new state after the time specified.

Args:

sig: A reference to the signal for the new Edge

edge_time: A double that specifies when the Edge is added and the signal changes state

edge_state: A string that specifies the new state of the signal

Returns:
ed: A reference to newly created Edge
Example:
ed1 = add_edge(fast_clock, 110.0, ‘H’)
commands.add_edge_margin(sig, edge_time_min, edge_time_max, edge_state)

Add a new Edge with uncertainty to the specified Signal

This function adds a new Edge to the signal. The state changes after the max time specified. This is used to show the uncertainty in time that it takes for signal to change state.

Args:

sig: A reference to the signal for the new Edge

edge_time_min: A double that specifies when the minimum time of the Edge

edge_time_max: A double that specifies when the maximum time of the Edge

edge_state: A string that specifies the new state of the signal

Returns:
ed: A reference to newly created Edge
Example:
ed1 = add_edge_margin(clk_ena, 110.0, 114.0 ‘H’)
commands.get_edge(sig, edge_num)

Get the specific Edge from the signal

This function gets the x Edge from the signal. x is the index into the edge list stored in the signal.

Args:

sig: A reference to signal that contains the Edge

edge_num: An integer that is the index of the signal edge list

Returns:
ed: A reference to Edge stored in the edge list at index edge_num
Example:
ed = get_edge(clk_ena, 1)
commands.get_edge_list(sig)

Get the edge list from the signal

This function gets the edge list from the signal. This list contains all the Edges for the signal.

Args:
sig: A reference to signal that contains the edge list
Returns:
el: A reference to edge list
Example:
el = get_edge_list(clk_ena)
commands.get_last_state(ed)
commands.get_next_state(ed)
commands.get_pt(ed, pos, case)

Get the Edge time at the position for the minimum or maximum case

Args:

ed: A reference to the Edge

pos: An integer that specifies the edge postion. 1 or 2 or 3

case: A string that specifies the case. ‘min’ or ‘max’

Returns:
et: A long that is the time of the Edge
Examples:

et = get_pt(ed1, 1, ‘min’)

et = get+pt(ed1, 2, ‘max’)

commands.get_pt1_min(ed)

Get the Edge time at point 1 for minimum case

Args:
ed: A reference to the Edge
Returns:
et: A long that is the time of the Edge at point 1 minimum case
Examples:
et = get_pt1_min(ed1)
commands.get_pt2_min(ed)

Get the Edge time at point 2 for minimum case

Args:
ed: A reference to the Edge
Returns:
et: A long that is the time of the Edge at point 2 minimum case
Examples:
et = get_pt2_min(ed1)
commands.get_pt3_min(ed)

Get the Edge time at point 3 for minimum case

Args:
ed: A reference to the Edge
Returns:
et: A long that is the time of the Edge at point 3 minimum case
Examples:
et = get_pt3_min(ed1)

Pulse Width Labels

commands.add_pulse_width_label(td, e1, e2, label, label_pos='Center')

Add a PulseWidthLabel to the timing diagram

This functions adds a PulseWidthLabel between 2 edges in the timing diagram.

Args:

td: A reference to the timing diagram

e1: A reference to the first Edge

e2: A reference to the second Edge

label: A string that specifies the title to be displayed

label_pos: A string that specifies the position of the label

This is an optional argument. It not specified, the default is ‘Center’

‘Left’ or ‘Right’ are also valid options.

Returns:
pwl: A reference to the newly created PulseWidthLabel object
Examples:

pwl = add_pulse_width_label(td, ed1, ed2, ‘Period_Min’)

pwl = add_pulse_width_label(td, ed1, ed2, ‘Period_Min’, ‘Left’)

StateBars

commands.add_statebar(td, edge, label, line_style, xoffset, yoffset)

Add a StateBar to an Edge

This function adds a StateBar to an Edge in any signal. StateBars are vertical lines with labels that are displayed for a clock domain.

Args:

td: A reference to the TimingDiagram

edge: A reference to the Edge

label: A string that specifies the new state

line_style: A string that specifies the line style. ‘Solid’ or ‘Dashed’

xoffset: An integer that specifies the label offset in pixels horizontally

xoffset: An integer that specifies the label offset in pixels vertically

Returns:
sb: A reference to newly created StateBar.
Example:
sb = add_statebar(td, ed1, ‘WAIT’, ‘Dashed’, 0, 0)

Delays

commands.add_part_delay(td, name, min, typ, max, desc)

Add a PartDelay to file library

This function is used to add a PartDelay to the file library. This could represent specifications from a manufacturer for a part.

Args:

name: A string the specifies the name of the PartDelay

min: A double that specifies the minimum Delay time

typ: A double that specifies the typical Delay time

max: A double that specifies the maximum Delay time

desc: A string that specifies the description of the PartDelay

Returns:
pd: A reference to newly created PartDelay.
Example:
pd = add_part_delay(td, ‘tprop’, 4, 7, 9)
commands.add_delay(td, part_delay, edge_from, edge_to)

Add a Delay to the timing diagram

Args:

td: A reference to the TimingDiagram

part_delay: A reference to a PartDelay defined in the file library edge_from: An Edge that specifies the source of the Delay

edge_to: An Edge that specifies the destination of the Delay

Returns:
cnstrnt: A reference to newly created Constraint.
Example:
c1 = add_constraint(td, pc, ed1, ed2)

Constraints

commands.add_part_constraint(td, name, min, max, desc)

Add a PartConstraint to file library

This function is used to add a PartConstraint to the file library. This could represent specifications from a manufacturer for a part.

Args:

name: A string the specifies the name of the PartConstraint

min: A double that specifies the minimum constraint time

max: A double that specifies the maximum constraint time

desc: A string that specifies the description of the PartConstraint

Returns:
pc: A reference to newly created PartConstraint.
Example:
pc = add_part_constraint(td, ‘tsetup’, 4, 7)
commands.add_constraint(td, part_constraint, edge_from, edge_to)

Add a Constraint to the timing diagram

Args:

td: A reference to the TimingDiagram

part_constraint: A reference to a PartConstraint defined in the file library edge_from: An Edge that specifies the source of the Constraint

edge_to: An Edge that specifies the destination of the Constraint

Returns:
cnstrnt: A reference to newly created Constraint.
Example:
c1 = add_constraint(td, pc, ed1, ed2)

JitterMargins

commands.add_part_jitter_margin(td, name, pos_jitter, neg_jitter, desc)

Add a Part JitterMargin to the file library

Args:

td: A reference to the TimingDiagram

name: A string that specifies the name of the part jitter

pos_jitter: A double that specifies the possible positive jitter change

neg_jitter: A double that specifies the possible negative jitter change

desc: A string that specifies the description of the Part JitterMargin

Returns:
pjm: A reference to newly created Part JitterMargin.
Example:
osc1_pjm = add_part_jitter_margin(td, ‘OSC1_JITTER’, 1.2, 1.4, ‘XYZ Part Jitter’)
commands.add_jitter_margin(ed, jitter_margin)

Add a JitterMargin to an Edge

Jitter is added to an Edge. The minimum edge time is set to the edge time minus the negative jitter, and the maximum edge time to the edge time plus the positive jitter.

Args:

ed: A reference to the Edge

part_jitter_margin: A reference to a Part JitterMargin defined in the file library

Returns:
jm: A reference to newly created JitterMargin.
Example:
jm = add_jitter_margin(ed1, osc1_pjm)