In my project, I need two separate clocks, but one of them, bit_clk
needs to be started after a delay of 5ns. How can I do that?
`timescale 1ns/100ps
always #40 clk =~ clk;
always #5 bit_clk =~ bit_clk;
You can delay the start of a clock by using a forever
loop inside an initial
block:
`timescale 1ns/100ps
module tb;
bit clk, bit_clk;
always #40 clk =~ clk;
initial begin
#5; // Delay before starting
forever #5 bit_clk =~ bit_clk;
end
endmodule
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.