That's the code:
module flipflop (input logic clk, reset,
input logic [7:0] qin,
output logic [7:0] qout);
timeunit 1ns;
always @(posedge clk or posedge reset)
if (reset)
qout = '0;
else
qout = qin;
endmodule
testbench:
module testflop ();
timeunit 1ns;
timeprecision 100ps;
logic reset;
logic [7:0] qin,qout;
// ---- clock generator code begin------
`define PERIOD 10
logic clk = 1'b1;
always
#(`PERIOD/2)clk = ~clk;
// ---- clock generator code end------
flipflop DUV(.*);
default clocking cb @(posedge clk);
default input #1step output #4;
input qout;
output reset, qin;
endclocking
initial
begin
cb.qin <= '0;
cb.reset <= 0;
##2 cb.reset <= 1;
##3 cb.reset <= 0;
for (int i = 1; i < 8; i++)
begin
##1 cb.qin <= i;
end
##3;
$finish();
end
endmodule
And this is the waveform:
I can see the #4ns skew for outputs, but I cannot see the #1step
skew for the input.
What's wrong?
Is the #1step
supposed to be equal to the timeprecision
?