cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Participant
Participant
350 Views
Registered: ‎01-12-2018

drand48 in hls

Jump to solution

Hi,

I am trying to compile a function that uses drand48() function to generate uniformly distributed pseudo-random numbers, but when I tried to accelerated this function I get the next error

function 'drand48' has no function body.

Is there any available function in sdsoc/hls to generate uniformly distributed numbers over the interval [0.0,1.0) ?

 

Thanks,

Jorge

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Mentor
Mentor
338 Views
Registered: ‎04-26-2015

Re: drand48 in hls

Jump to solution

Generating uniformly distributed numbers over a range is trivial; a simple counter will do that. For something that looks random, a linear feedback shift register is both inexpensive and easy to implement - but not really random. For true randomness, you can build a circuit that deliberately "fails" timing (can't do this in HLS, have to use HDL) and with suitable processing this can deliver genuinely random numbers.

View solution in original post

0 Kudos
1 Reply
Highlighted
Mentor
Mentor
339 Views
Registered: ‎04-26-2015

Re: drand48 in hls

Jump to solution

Generating uniformly distributed numbers over a range is trivial; a simple counter will do that. For something that looks random, a linear feedback shift register is both inexpensive and easy to implement - but not really random. For true randomness, you can build a circuit that deliberately "fails" timing (can't do this in HLS, have to use HDL) and with suitable processing this can deliver genuinely random numbers.

View solution in original post

0 Kudos