P
parag_paul@hotmail.com
Guest
Lets look at the following piece of test case.
Here there is a test bench which will call pli routines to updated
signals a,b. Now in the output , we are seeing that the clock will
change after some other event have happened in the 45 th ns. Is it the
duty of the simulator to see to it that there is a design clock and we
need to update it as the first event in a time cycle.Please send me a
mail if it is confusing.
My general question is that,are design clocks to be specillay declared
so, or we will have to wait till clocking blocks in SV come to help
module top(b);
int i;
bit clk;
shortint j;
shortint k;
input bit [3:0] b;
bit [3:0] a;
reg rst;
always_ff @(clk)
i <= j + k;
always_ff @(posedge clk) begin
if(rst == 0)
a <= b;
else
a <= a+1;
end
initial rst <= 0;
initial clk = 0;
always #5 clk = ~clk;
initial #100 $finish;
endmodule:top
Here there is a test bench which will call pli routines to updated
signals a,b. Now in the output , we are seeing that the clock will
change after some other event have happened in the 45 th ns. Is it the
duty of the simulator to see to it that there is a design clock and we
need to update it as the first event in a time cycle.Please send me a
mail if it is confusing.
My general question is that,are design clocks to be specillay declared
so, or we will have to wait till clocking blocks in SV come to help
module top(b);
int i;
bit clk;
shortint j;
shortint k;
input bit [3:0] b;
bit [3:0] a;
reg rst;
always_ff @(clk)
i <= j + k;
always_ff @(posedge clk) begin
if(rst == 0)
a <= b;
else
a <= a+1;
end
initial rst <= 0;
initial clk = 0;
always #5 clk = ~clk;
initial #100 $finish;
endmodule:top