M
masoodtahir
Guest
I have an input clock coming into a verilog module. I can find out
from the simulation that it is 300ps (from one rising edge to the
next). My question is, inside the module which has this input clock,
is there a way to capture this clock period into an integer variable?
something like:
always @(posedge clk) time1 = $current_time
always @(negedge clk) time2 = $current_time
always @(posedge clk) clk_period = (time2 - time1)*2;
If there exists a variable something like $current_time, what is the
name of the variable? Or is there some other way that this can be
done? I will appreciate a sample verilog code.
from the simulation that it is 300ps (from one rising edge to the
next). My question is, inside the module which has this input clock,
is there a way to capture this clock period into an integer variable?
something like:
always @(posedge clk) time1 = $current_time
always @(negedge clk) time2 = $current_time
always @(posedge clk) clk_period = (time2 - time1)*2;
If there exists a variable something like $current_time, what is the
name of the variable? Or is there some other way that this can be
done? I will appreciate a sample verilog code.