My small tip:
If you want real delays, use a high-speed clock and a counter. Remember to only trigger counter on pulses, so use a two-level approach with a pulse generator in between.
For example, if you use a 100MHz clock as a basis, use the clock edge to trigger a pulse. Then use the pulse to increase the counter.
Then you can add in different modules that are started at different counter values (E.g. 0, 1, 5, 11, whatever..). It will give you a 10ns resolution on delays between the modules.
If you don't understand any of this, I can post some example code once I get back to my PC.
Edit: Here is a code segment that uses a clock clk and a counter clk_slow_cnt to trigger a pulse clk_slow_ena in order to output a slower clock clk_slow.
Code:
always @(posedge clk) // Counter with enable out
begin
if (Reset==1'b0)
begin
clk_slow_ena<=1'b0;
clk_slow_cnt<=6'b000000;
end
else
begin
if (clk_slow_cnt==6'd32)
begin
clk_slow_ena<=1'b1; // only high for single cycle
clk_slow_cnt<=6'b000000;
end
else
begin
clk_slow_ena<=1'b0;
clk_slow_cnt<=clk_slow_cnt+6'b000001; // Slow clock is 1/64th of fast
end
end
end
always @ (negedge clk)
if (Reset==1'b0)
begin
clk_slow=1'b0;
end
else if (clk_slow_ena==1'b1)
begin
clk_slow=~clk_slow;
end
This works nicely and I have been using it for some time. You can then use clk_slow_cnt or another clock to trigger different events that needs to happen at different phases/times in the clk_slow period.