I want to create a set of periodic tasks set with different period and execution time, in verilog module, that task will create so will operate some sorts of operation and shall be executed after certain periods...
So, In higher level language like in c
func()
{
for(;;)
}
and sleep()
I think, i would use that func() as operation and after sleep()..this func() shall be called again... is this a right way to do so in verilog?? and Can I also measure the execution time as well as period in testbench...after simulation.. any suggestion would be highly helpful
regards
Something like...
For example: this periodic task increments variable
counter
every 1.5 microsecond.Use
`timescale
with different units if you don't need nanosecond precision. For example, the previous block could be written as this:EDIT
It is important to make clear that simulated delays, denoted by
#{insert_delay}
, cannot be synthesized. They should only be used in a test bench to model delays coming from a driver. So of yourfunc()
andsleep()
are not in a testbench, they will need to be modeled as some sort of counter, that resets then countsx
number of clock pulses.