|
<< Click to Display Table of Contents >> (TBench) 2.3 Extract Signal Names and setup the Clock |
![]() ![]()
|
Next we will extract the signal names, types, and size from the port information contained in the mymut.v file.
Extract MUT ports into Diagram
|
|
Convert the CLK signal into a SynaptiCAD Clock Signal:
The Extract MUT Ports function imports all the port signals into SynaptiCAD Signals. However, we would like the clock to draw itself based on a frequency. To do this we need to covert the CLK signal into a CLK clock.
|
|
Set the default Clock Signal to make a cycle based test bench
Next set the Clock signal and Edge for all of the signals in the diagram so that the test bench will be cycle-based instead of time-based (this means the test bench stimulus will change after waiting on clock transitions instead of time delays).
|
|
|
|
|
|
Examine the difference between a cycle-based and time-based test bench:
Following is a code example of the difference between a cycle-based and time-based test bench. Both of these code segments were exported from the diagram you will be drawing in the next step. Signals with the same clocking signal and edge type will be driven by a common process in the generated code. We call a process of this type a Clocked Sequence. All the unclocked signals are driven by the Unclocked Sequence. This means that when a diagram contains signals with different clocking signals, a separate sequence process will be created for each clocking signal/edge type. Clocked Sequences are named based on the clocking signal and the edge type, so for this example, the clocked sequence that contains the code on the right will be called CLK_pos.
Time Based Code |
Cycle-based Code |
#137; FRAME_driver <= 1'b0 #3; WRITE_driver <= 1'b0 ADDR_driver <= 8'h00 #100; WRITE_driver <= 1'b1 IRDY_driver <= 1'b0; ADDR_driver <= 8'hxx DATA_driver <= 8'hAA #100; FRAME_driver <= 1'b1 IRDY_driver <= 1'b1; DATA_driver <= 8'hzz #101; |
repeat (2) begin @(posedge CLK); end FRAME_driver <= 1'b0;
WRITE_driver <= 1'b0; ADDR_driver <= 8'h00; @(posedge CLK); WRITE_driver <= 1'b1; IRDY_driver <= 1'b0; ADDR_driver <= 8'hxx; DATA_driver <= 8'hAA; @(posedge CLK); FRAME_driver <= 1'b1; IRDY_driver <= 1'b1; DATA_driver <= 8'hzz; @(posedge CLK); |