M
mrfirmware
Guest
I'm trying to testbench a PCIe endpoint device. Each PCIe packet that
requires a completion from the endpoint device must receive the
completion packet within a specified time limit. When I initiate the
request (send the packet to the endpoint) I would like to record the
current simulation time, e.g. req[trn_id].give_up_time = $realtime +
20ms, and then spawn a task waiting for the completion to come back or
else bail out when simulator-time exceeds give_up_time.
My problem is, I cannot programatically determine how many realtime
ticks make up 20ms. I suppose I could grab the output of string from
$printtimescale and parse it for the units but that seems a bit
clunky. Am I missing something obvious here?
Thanks,
- Mark
requires a completion from the endpoint device must receive the
completion packet within a specified time limit. When I initiate the
request (send the packet to the endpoint) I would like to record the
current simulation time, e.g. req[trn_id].give_up_time = $realtime +
20ms, and then spawn a task waiting for the completion to come back or
else bail out when simulator-time exceeds give_up_time.
My problem is, I cannot programatically determine how many realtime
ticks make up 20ms. I suppose I could grab the output of string from
$printtimescale and parse it for the units but that seems a bit
clunky. Am I missing something obvious here?
Thanks,
- Mark