module test;
timeunit 1ns;
timeprecision 100ps;
bit [15:0] clk;
realtime delay=0.5ns; // 1GHz
always begin
for(int i =0; i <16; i++) begin
fork
#delay clk[i] =~ clk[i]; // 1 Ghz clock for 16
// i am getting phase shifting for all the clock
join
end
end
initial
begin
#2ms;
$finish;
end
endmodule
any alternate best way to generate multiple clocks for the above scenario w/O phase shifting? thanks
It’s not clear why you are using a for loop. What do you want the 16 clocks to look like if not identical values? Also, using a fork/join block with one statement makes no sense. It is the same as using a begin/end.
always begin
#delay clk =~ clk; // 1 Ghz clock for 16
end
This assumes al 16 bits of clk toggle the same. It’s not even clear why clk needs to be 16 bits of al bits are alway the same value. You can connect the same bit of a single bit-clock to each DUT.