cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
2,462 Views
Registered: ‎02-10-2018

PRBS with seed

Hello,

 

i read :

https://www.xilinx.com/search/site-keyword-search.html?searchKeywords=xapp884.zip

 

https://forums.xilinx.com/t5/Embedded-Development-Tools/Random-seed-without-Linux-OS/m-p/325109/highlight/true#M27322

 

I need to do random generation in Programmable Logic. Pseudo random is sufficient, no need of true random.

I want do it on Zynq (Zedboard), but compatibilty with Zynq/Virtex Ultrascale+ would be appreciated.

 

Simulation must be possible. I can't simulate with the second link (or don't know how). But it works well on target.

 

I will instanciate many random blocks. So i need to specify a different seed for each instance. There is no seed in the first link (PRBS).

 

To make it simply, i need a PRBS with a seed parameter on at least 8 bits. I could get 256 instances. More than 8 bits would be appreciated.

 

Could anyone help?

 

Thank you.

0 Kudos
3 Replies
Highlighted
Moderator
Moderator
2,453 Views
Registered: ‎07-30-2007

For xapp884 couldn't you just redo the reset:

 

always @(posedge CLK) begin

if(RST == 1'b 1) begin

prbs_reg <= {POLY_LENGHT{1'b1}};

DATA_OUT <= {NBITS{1'b1}};

end

 

to something like:

 

always @(posedge CLK) begin

if(RST == 1'b 1) begin

prbs_reg <= SEED;

DATA_OUT <=  {NBITS{1'b1}};

end

 

You would have to provide a seed of the right length.

 




----------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution
----------------------------------------------------------------------------


0 Kudos
Highlighted
Visitor
Visitor
2,441 Views
Registered: ‎02-10-2018

It sounds good. I could get up to 2^512 2^63 instances. I think it will be enough.

I will make a testbench to verify if it works well.

 

Thank you @roym.

0 Kudos
Highlighted
Visitor
Visitor
2,326 Views
Registered: ‎02-10-2018


@roym wrote:

For xapp884 couldn't you just redo the reset:

 

@always @(posedge CLK) begin

if(RST == 1'b 1) begin

prbs_reg <= {POLY_LENGHT{1'b1}};

DATA_OUT <= {NBITS{1'b1}};

end

 

to something like:

 

@always @(posedge CLK) begin

if(RST == 1'b 1) begin

prbs_reg <= SEED;

DATA_OUT <=  {NBITS{1'b1}};

end

 

You would have to provide a seed of the right length.

 


Finally, it doesn't really works.

I made a first test with 10 instances and output on 8 bits. About 8000 clk after reset, all instances gave "00".

To verify if this was random or a correlation, i made a second test with 100 instances. And again, all gave "00".

 

This happens several times from the beginning to 8000 clk. And it also happens with "FF".

 

So this method induces correlations between instances.

 

Anyone has something else?

 

0 Kudos