rogger201
Newbie level 6
Hello,
I am writing a testbench in which I am giving the inputs to my module. These inputs include a clock, reset , data and shift_data value that go to my DUT.
I am trying to make use of
The first input of reset messes up my results. If I make
change to
Then my simuation results seem to be fine. Also, when i change repeat(2) @(posedge clock) to repeat (1) @(posedge clock), the result is correct but it misses some data if its different. So how does repeat work? What value are we supposed to specify?
The fact that its changing every time, does that mean my DUT is not coded correctly?
I am writing a testbench in which I am giving the inputs to my module. These inputs include a clock, reset , data and shift_data value that go to my DUT.
I am trying to make use of
Code:
always begin
#1 clock = ~clock;
end
initial begin
reset = 1'b0; //its a negedge triggered block
shift_reg = 8'b10000001;
repeat (2) @(posedge clock);
reset = 1'b1;
data = 8'b11111111;
sel = 2'b00;
repeat (2) @(posedge clock);
reset = 1'b1;
data = 8'b00001111;
sel = 2'b00;
repeat (2) @(posedge clock);
......
repeat (2) @(posedge clock);
$finish;
end
The first input of reset messes up my results. If I make
Code:
reset = 1'b1;
data = 8'b11111111;
sel = 2'b00;
repeat (2) @(posedge clock);
change to
Code:
reset = 1'b1;
data = 8'b11111111;
sel = 2'b00;
#2;
Then my simuation results seem to be fine. Also, when i change repeat(2) @(posedge clock) to repeat (1) @(posedge clock), the result is correct but it misses some data if its different. So how does repeat work? What value are we supposed to specify?
The fact that its changing every time, does that mean my DUT is not coded correctly?