Math Operation(Subtraction CAAM)

cancel
Showing results for 
Search instead for 
Did you mean: 

Math Operation(Subtraction CAAM)

216 Views
apoorvabhatia
Contributor III

HI,

I am trying to subtract 'one' from a number that I loaded in the Math register0. For that purpose I am using the following descriptor command.

#define RNG_DESC6 0xA820C008

But it seems nothing is happening. No subtraction is taking place.

Can somebody please help me with that?

Thanks! :smileyhappy:

Tags (3)
0 Kudos
6 Replies

65 Views
Yuri
NXP TechSupport
NXP TechSupport

   Please try OFFSET = 0 in LOAD operation.


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

65 Views
apoorvabhatia
Contributor III

Hi,

Actually the offset that I have used is 0 and length as 4.

#define RNG_DESC4 0x16080004

0 Kudos

65 Views
Yuri
NXP TechSupport
NXP TechSupport

   I am afraid  when i.MX 6 Series is in the Open configuration, the boot ROM does not

initialize neither the RNG nor CAAM in whole. Please check CAAM initialization, in particular -
CAAM clocks. 


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

65 Views
Yuri
NXP TechSupport
NXP TechSupport

The descriptor looks correctly. How the result (math resister 0 ) is checked after operation ?


Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

65 Views
apoorvabhatia
Contributor III

I am storing the math register value using the following store command:

#define RNG_DESC12 0x56080004

#define RNG_DESC13 0x00000000 // to be assigned during code

Also, I have provided an unconditional jump to the Math operation again and again (which is working fine) and finally the following Jump (break from the loop) based on the result being negative. For that I am using:

#define RNG_DESC9 0xA0000803

But neither is the Jump taking place nor the value of math register seems to be decreasing.

Hope I have made my doubt clear.

To clarify what I am trying to do , following is the set of my descriptor commands:

/* Header

13 words in descriptor

*/ 

#define RNG_DESC1  0xB080000D

/* 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

//Load 1 Million to Math Register0

#define RNG_DESC4 0x16080004

#define RNG_DESC5 0x00000000 //assigned during program

// Math operation

#define RNG_DESC6 0xA820C004

/* Jump

*

*  1010.0001.0000.0000.0000.1000.1000.0100 FC (-4), FB(-5), 0xA00008FB

*

* Jump to last descriptor command if result is negative

*/

#define RNG_DESC7 0xA0000805

/* Algorithm 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_DESC8 0x82500800

/* FIFO Store

*

*  0110 0000 0011 0000 0000 0000 0001 0000

*

* fifostore: msg len=16

*/

#define RNG_DESC9 0x60300010

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

/* Jump

*

*  1010.0001.0000.0000.0000.1000.1000.0100 FC (-4), FB(-5), F9(-7) 0xA00008FB

*

* Jump to RNG_DESC6

*/

#define RNG_DESC11 0xA00000FB

/* Store Math Register 0 value

*

*  0101. 0,11,0,.  0, 000 1000,0000 0100, 0000 0100

*

* store: len= 4bytes

*/

#define RNG_DESC12 0x56080004

#define RNG_DESC13 0x00000000 // to be assigned during code

0 Kudos

65 Views
apoorvabhatia
Contributor III

Any help will be appreciated. I am quite stuck at this problem past 1 week!

0 Kudos