K
Kenneth Brun Nielsen
Guest
A quick question from a newbie:
I have a signal toggling every 5'th time unit. How can I delay that
signal with more than 5 time units?
Eg. in the following example, I want to skew the SCK signal (read from
file) with 9 units. In my simulator (Icarus), this does not work as
intented. I assume, that the reason is, that the delay is longer than
the toggling frequency(?):
"""""""""
module test_tb;
reg MOSI, SCK, SS;
integer fd;
integer r,cycleNo;
reg SCKi;
reg SSi;
reg MOSIi;
initial
fd = $fopen("vectors.txt","r");
while (!$feof(fd))
begin
r = $fscanf(fd, " %1b %1b %1b\n",SSi,MOSIi,SCKi);
@ cycleNo;
end //while
$finish
end //module
always #5 cycleNo = cycleNo+1;
always @ (SSi) #4 SS = SSi;
always @ (MOSIi) #4 MOSI = MOSIi;
always @ (SCKi) #9 SCK = SCKi;
endmodule
"""""""
Any suggestions?
I have a signal toggling every 5'th time unit. How can I delay that
signal with more than 5 time units?
Eg. in the following example, I want to skew the SCK signal (read from
file) with 9 units. In my simulator (Icarus), this does not work as
intented. I assume, that the reason is, that the delay is longer than
the toggling frequency(?):
"""""""""
module test_tb;
reg MOSI, SCK, SS;
integer fd;
integer r,cycleNo;
reg SCKi;
reg SSi;
reg MOSIi;
initial
fd = $fopen("vectors.txt","r");
while (!$feof(fd))
begin
r = $fscanf(fd, " %1b %1b %1b\n",SSi,MOSIi,SCKi);
@ cycleNo;
end //while
$finish
end //module
always #5 cycleNo = cycleNo+1;
always @ (SSi) #4 SS = SSi;
always @ (MOSIi) #4 MOSI = MOSIi;
always @ (SCKi) #9 SCK = SCKi;
endmodule
"""""""
Any suggestions?