|
<< Click to Display Table of Contents >> 2.9 Transactor Clock Domains and Waveform Code Generation |
![]() ![]()
|
Inside each timing diagram there may be one unclocked process and several clocked processes. A clocked process is created for each clocking domain in the diagram to drive signals and trigger parameters (Delays, Samples, Holds, Setups, Markers) that are synchronous with the given clock. Each domain will run in parallel (concurrently) once the diagram is started.
Typically, there will only be one clock domain in a timing diagram. But, if you have multiple domains in the diagram, then it’s important to know what is placed in each domain if you have looping or blocking parameters. For example, a Marker loop that is attached to the falling edge of CLK will only loop around items that are also in the CLK_neg clock domain. Items that are in the unclocked domain wouldn't get placed into this loop. Also, items that can potentially block a process (Samples, Markers, Sensitive Edges) will only block the clock domain that they are placed in. The following sections will go into more detail on how blocking and looping constructs work.
Overview of Graphical constructs and their clock domains:
Construct Type |
Clocking Domain |
Signals |
Clock and Edge of signal (Signal Properties dialog) |
Sensitive Edge |
Clock and Edge of signal that contains sensitive edge |
Samples |
A sample's clock domain is the process that triggers it. See the table below to determine a sample's triggering process. |
Delays attached to edge |
If not unclocked, then Clock and Edge in Delay dialog. Otherwise, the starting edge of the delay sets the clock domain. |
Setups |
Signal and edge that is pointed to by the Setup |
Holds |
Signal and edge that is pointed to by the Hold |
Markers attached to edge |
The relative edge sets the clock domain |
Markers attached to time |
Unclocked |
Waveform Code Generation:
The code that is generated for a waveform depends on three things: how it is drawn, the clocking domain, and the Default Delay After Clock Edge control in the Diagram Settings dialog.
|
|
|
|
|
|
|
|
|
// Synchronize to clocking signal if necessary. @(posedge CLK0); #5; tbench.SIG0_driver <= 1'b0; |
Below is an example of a timing diagram WaveformTest with both a clocked and an unclocked signal. The Default Delay After Clock Edge setting for the diagram is Fixed 0ns. The Stimulus and Results diagram shows the behavior of the test bench during simulation. Notice that the edges on the clocked_sig have moved to the positive edge of the clk signal in the simulated results, and the edges on the unclocked_sig generate code as they are drawn in the original transactor diagram.

Output Clocks (Clock generators)
When creating a clocked test bench with TestBencher, there is usually either one timing diagram that has an output clock or the clock is generated in the MUT code. All of the other timing diagrams use an input clock. This makes it easier to synchronize the transactions during simulation. If you choose a system clock when during the project creation, then TestBencher will create a diagram called SysClock_generator.btim to generate the clock, and also add an input clock to the template diagram (see Step 1: Create a New Project).

Each output clock has its own process that generates the clock during a simulation. This clocking process is in addition to any unclocked or clocked processes that are used to synchronize signals and parameters. The clock generation process will take into account as many of the Clock Properties as are supported by the generation language.
Blocking Constructs (Sensitive Edges, Samples, and Markers)
There are three different types of constructs that can be used to block the execution of a clock domain.
|