Reading values of I/Os at certain times from verilog

Guest
Hi guys,

I'm trying to implement a testbench in verilog to measure the
periodicity of an unknown pseudo-random number generator.

Right now, the only ideas I have involve writing the values of the
output samples onto a text file and trying to analyse the repetition
from there.

Is there perhaps, a system task that allows me to obtain the value of
an output at a certain simulation time?

Thanks!
 
On Nov 14, 11:30 am, melvin...@gmail.com wrote:
Hi guys,

I'm trying to implement a testbench in verilog to measure the
periodicity of an unknown pseudo-random number generator.

Right now, the only ideas I have involve writing the values of the
output samples onto a text file and trying to analyse the repetition
from there.

Is there perhaps, a system task that allows me to obtain the value of
an output at a certain simulation time?

Thanks!
You could certainly only write samples to the text file at given
times,
but I'm guessing that what you really want is to go back and get the
value at a particular time without re-running the simulation, and
without knowing the time you want to sample beforehand?

In that case you need to look at the dataflow which is essentially
along the same idea as the text file with your sample values. This
file can usually be exported in a usable non-proprietary format.
Graphic tools like the ModelSim wave viewer also support searching
for patterns in the dataflow record.

Of course you could also write a testbench that records a set of
samples near the beginning of time and looks for the same samples
to repeat later, then when you detect the repeated pattern you can
just write out the simulation time value.
 
On Nov 14, 6:13 pm, gabor <ga...@alacron.com> wrote:
On Nov 14, 11:30 am, melvin...@gmail.com wrote:

Hi guys,

I'm trying to implement a testbench in verilog to measure the
periodicity of an unknown pseudo-random number generator.

Right now, the only ideas I have involve writing the values of the
output samples onto a text file and trying to analyse the repetition
from there.

Is there perhaps, a system task that allows me to obtain the value of
an output at a certain simulation time?

Thanks!

You could certainly only write samples to the text file at given
times,
but I'm guessing that what you really want is to go back and get the
value at a particular time without re-running the simulation, and
without knowing the time you want to sample beforehand?

In that case you need to look at the dataflow which is essentially
along the same idea as the text file with your sample values.  This
file can usually be exported in a usable non-proprietary format.
Graphic tools like the ModelSim wave viewer also support searching
for patterns in the dataflow record.

Of course you could also write a testbench that records a set of
samples near the beginning of time and looks for the same samples
to repeat later, then when you detect the repeated pattern you can
just write out the simulation time value.
Thanks for the reply.

Indeed, currently, my approach is to append each sample to a text file
every clock cycle and at the same time check every clock cycle whether
the current output matches the first output and then check the next
clock cycle whether the current output matches the second output and
so on until there is a complete match.

I'm curious about what you mean by dataflow? I've read a little about
vcd and such things, but I don't exactly know what you mean.

Thanks!
Melvin
 

Welcome to EDABoard.com

Sponsor

Back
Top