Reply To: GENERATION OF RANDOM BYTES USING RANDOM PACKAGE ONLY

Why OSVVM™? Forums OSVVM GENERATION OF RANDOM BYTES USING RANDOM PACKAGE ONLY Reply To: GENERATION OF RANDOM BYTES USING RANDOM PACKAGE ONLY

#2001
Jim Lewis
Member

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 data 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.

If you want to infinitely generate data use something like the following:

process
  variable RV:RandomPType;
  variable b:std_logic_vector( 7downto 0);
begin
  RV.Initseed(RV’instance_name);
  loop
    wait until reset=’1? and rising_edge(clk);
    b:=RV.RandSlv(0,255,8);
    uat_data<=b;
  end loop ;
end process;

Jim