You are not logged in.
Hello
I'm currently working on WARPv2 using real-time OFDM reference design ( not WARP LAB)
In the MAC code, I need to generate random numbers and it looks like rand() works like random function in standard C library.
The problem is that it looks like seed is fixed. In Linux, we can change seed using time function like srand(time(0)). However, it is not working in the WARP.
Could you let me know how to change seed (using time or whatever other method )?
Offline
Those functions are part of the Xilinx-supplied standard C library. I'm not really sure how their implementation of pseudo-random number generation works. I think we've used srand() before, seeding it with bits from the RSSI ADC when a radio is in standby (the bottom few bits of the ADC will be random-ish, reading noise on the RSSI line when the MAX2829 is idle).
Offline
rand();
srand(..);
There is a bug in the srand function in the Xilinx C lib. You need to call rand() once before calling srand. otherwise, srand will not apply the argument. Besides, I don't know, if the time(0) function gives a valid return value. I suggest using another source, e.g. noise read for randomness or dip switch vaslues for repeatability.
Offline
Thanks for your comments :)
Offline