|
<< Click to Display Table of Contents >> (TBench) 1.4 Signal Data Types and VHDL user defined types |
![]() ![]()
|
SynaptiCAD's tools use a language independent signal type so that one timing diagram can generate code for both VHDL and Verilog test benches. Double click on a signal name to open the Signal Properties dialog and the Signal Type box shows the signal's type. Below is a table that shows the translation between the types.
SynaptiCAD |
Verilog |
VHDL |
4_state |
reg |
std_logic |
4_state_vector |
reg |
std_logic_vector |
bool |
reg |
boolean |
2_state |
reg |
bit |
2_state_vector |
reg |
bit_vector |
byte |
reg |
bit_vector |
int |
integer |
integer |
unsigned_int |
integer |
natural |
real |
real |
real |
fixed_len_string |
reg |
string |
variable_len_string |
|
|
time |
time |
time |
event |
event |
|
std_logic |
|
std_logic |
std_logic_vector |
|
std_logic_vector |
std_ulogic |
|
std_ulogic |
std_ulogic_vector |
|
std_ulogic_vector |
signed_logic |
|
signed |
unsigned_logic |
|
unsigned |
actel_current_delta |
reg |
std_logic |
actel_temperature |
reg |
std_logic |
actel_voltage |
reg |
std_logic |
actel_voltage_common |
reg |
std_logic |
actel_voltage_delta |
reg |
std_logic |
The Signal Type box also supports VHDL user-defined types that can be directly entered into the box. By default all signals are assumed to have a type of std_logic and a direction of out (CLK0, SIG0, and VirtualBus will use the defaults for this tutorial). In this section you will add SIG1 and SIG2 to demonstrate signals with a standard integer type and a user defined type.
Add SIG1 and SIG2
|
|
|
Change the type of SIG1 to integer and add values to the waveform:
|
|
|
|
Change the type of SIG2 to MyColor and add values to the waveform:
Next we will add a user defined data type called MyColor. For a real VHDL simulation, the user defined type and the color value of the waveforms would have to match the code in the model under test. For instance, MyColor might be defined as: enum MyColor ={RED, GREEN, BLUE, BLACK} in the model under test code.
|
|
|
|
|