Random Number Descriptor

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Random Number Descriptor

Jump to solution
620 Views
apoorvabhatia
Contributor III

Hi,

This is the RNG descriptor that I have written:

/*****************************************

*----- Random Number descriptor -----*

*****************************************/

/* Header

*  1011 0000 1000 0000 0000 0000 0000 0111

*  ++++-+-- Header                    +-- 7 words in descriptor

*/ 

#define RNG_DESC1  0xB0800006

/* Load Data size register

*  0001 0010 1000 0010 0000 0000 0000 0100

*  Data: 0x0000 0010

* Loading the data size register with the size of the key to be generated

* Length : 16 bytes

*/

#define RNG_DESC2 0x12820004

#define RNG_DESC3 0x00000010

/* operation

*  1000 0010 0101 0000 1000 0000 0000 0000

* operation: class1-op rng (SH0) generate random, state handle: 0, normal (non-deterministic mode)

*/

#define RNG_DESC4 0x82500800

// Wait for Class 1 done

#define RNG_DESC5 0xA3000201

/* FIFO Store

*  0110 0000 0011 0000 0000 0000 0001 0000

* fifostore: msg len=16

*/

#define RNG_DESC6 0x60300010

#define RNG_DESC7 0x00000000 // assign the memory address to this in the main program where you call it

/***************MY CODE*************************************/

Now, it shows an error in the output ring: 0x40000504
which means that the fifth descriptor (#define RNG_DESC5 0xA3000201) is wrong. Basically i want to wait till the random number has been generated.

Can someone please help me with this? (i also tried 0xA2000001 which has been used in the SDK during instatntiation for similar purpose but still the same error is given)

Thanks.

Tags (2)
0 Kudos
1 Solution
469 Views
apoorvabhatia
Contributor III

Well, I was able to generate the random number. We don't need the wait command while generation. It was needed during instantiation because the key registers were being loaded.

View solution in original post

0 Kudos
1 Reply
470 Views
apoorvabhatia
Contributor III

Well, I was able to generate the random number. We don't need the wait command while generation. It was needed during instantiation because the key registers were being loaded.

0 Kudos