How do I create a clock with random starting phase?

Here is my code. I need that every time inject_tv is called, it will restart clock clk3_84m_0 for a unknown number of cycles, but with a random delay. Clk3_84m_0 shall change only until next time the event is called upon.

How can I achieve that?

Thanks in advance.

module mytest;

event start_clk_0; always @ (start_clk_0) begin clk3_84m_0

Reply to
Mr. Ken
Loading thread data ...

Why not assign a random value to a variable and then use a for loop to insert that number of much smaller (picosecond) delays.

for example: `timescale 1 ns / 1 ps

. . .

integer i; reg [16:0] r_shift;

. . . r_shift Thanks in advance.

Reply to
Gabor

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.