Activity
-
Nagella started the topic GENERATION OF RANDOM BYTES USING RANDOM PACKAGE ONLY in the forum OSVVM 2 years, 6 months ago
HI,
I am trying to generate a random bytes to the uart transmitter module.But in the output waveform only one byte is generated throughout the simulation…below is a piece of testbench code if anything is wrong pls correct me.
note:uat_data is a input signal to the uart transmitter module.
process
variable RV:RandomPType;
variable b:std_logic_vector( 7downto 0);
begin
RV.Initseed(RV’instance_name);
wait until reset=’1′ and rising_edge(clk);
b:=RV.RandSlv(0,255,8);
uat_data<=b;
end process;
Hi Nagella
To debug your code start by reading your code out loud. Do at least 2 iterations of your process.
What we see is that you are calling InitSeed before generating each value.
Why is this a problem? Verification uses pseudo random. Each seed always produces the same sequence of values. For verification pseudo random is required so your tests are repeatable or stable. When you fix a bug, you need the same sequencing (test case) that caused the failure to run to verify the fix.
You need a loop so your InitSeed only runs once.
Jim