It looks fine in EDAPlayground.
I had to comment out the $readmemh("isort.cod",mem);
though.
As a style guide though it is more common to write:
always begin
#100 CLK = ~CLK;
end
It is correct to use blocking (=
) assignments here. You should be using non-blocking (<=
) in your edge triggered processes (always@(posedge CLK)
).
To run for 100 cycles you can do some thing like the following, at present you testbench will run forever :
initial begin
CLK = 0;
// Wait 100 ns for global reset to finish
//@(posedge globalreset_n);
@(posedge CLK);
// Add stimulus here
repeat(100) begin
@(posedge CLK);
end
$finish();
end