24.03.2013 Views

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

ModelSim SE User's Manual - Electrical and Computer Engineering

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

`timescale 1 ps / 1 ps<br />

module testbench;<br />

reg clk0;<br />

initial begin<br />

clk0 = 1;<br />

forever begin<br />

#20 clk0 = ~clk0;<br />

end<br />

end<br />

initial begin<br />

$init_signal_driver("clk0", "/testbench/uut/blk1/clk", , , 1);<br />

$init_signal_driver("clk0", "/testbench/uut/blk2/clk", 100, 1);<br />

end<br />

...<br />

endmodule<br />

$init_signal_driver UM-431<br />

The above example creates a local clock (clk0) <strong>and</strong> connects it to two clocks within the<br />

design hierarchy. The .../blk1/clk will match local clk0 <strong>and</strong> a message will be displayed.<br />

The .../blk2/clk will match the local clk0 but be delayed by 100 ps. For the second call to<br />

work, the .../blk2/clk must be a VHDL based signal, because if it were a Verilog net a 100<br />

ps inertial delay would consume the 40 ps clock period. Verilog nets are limited to only<br />

inertial delays <strong>and</strong> thus the setting of 1 (transport delay) would be ignored.<br />

<strong>ModelSim</strong> <strong>SE</strong> User’s <strong>Manual</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!