SynaptiCAD Tutorials

(TBench) 1.2 Hex and Binary State Values

(TBench) 1.2 Hex and Binary State Values

Previous topic Next topic  

(TBench) 1.2 Hex and Binary State Values

Previous topic Next topic  

SynaptiCAD's timing diagram editing environments use a language independent bus format for hexadecimal and binary bus values so that one diagram can generate a valid test benches for both VHDL and Verilog simulators. During test bench generation, single-bit signals generate code that matches the graphical state.

Buses (multi-bit signals) use one of two methods to generate code. First, if a segments value begins with a 'b or 'h then it is assumed that the number is a binary or hexadecimal number and the number will be translated to the appropriate VHDL or Verilog bus value (regardless of the radix of the signal). If the extended state value does not start with 'b or 'h then the value is written out as it was entered, without any translation. This means that if a state has a value of 10 and a radix of Hexadecimal, the effective value of the segment is 16 decimal. And if a state has a value of 10 with a radix of Binary, the effective value of the segment is 2 decimal.

Set the size and radix of the VirtualBus bus signal:

Double click on the VirtualBus signal name to open the Signal Properties dialog.

Make it an 8 bit bus by typing 7 into the MSB box and 0 into the LSB box.

Set the Radix to binary.

Also notice that Export Signal is checked so the signal will be exported and that it has a direction of output so it will drive the model under test.

sig_properties_export_vb

Close the Signal Properties dialog.

Setting the values in a virtual bus waveform:

Select the first waveform segment of VirtualBus by clicking on it. A selected segment has a box around it.

diagram2-hdlStimulus-selectedSegment

Click on the HEX button  at the top of the window to open the Edit Bus State dialog box. The Edit Bus State dialog box can also be opened by double-clicking on the selected segment.

hexButton

Type 'b11101110 into the Virtual edit box (this is an 8-bit binary number).

Press ALT-N (or press the Next button) two times to advance to the next valid segment

edit_bus_state_binary_value

Type 'hA into the Virtual edit box (this is  an 8-bit hexadecimal number equal to 00001010 in binary). The program automatically left pads missing bits with zeros.

edit_bus_state_hex_value

Press OK to close the Edit Bus State dialog. The waveform should look like the following.

virtual_bus_finished