P4080 SEC4.0 Job Descriptor to copy random numbers to system RAM

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

P4080 SEC4.0 Job Descriptor to copy random numbers to system RAM

Jump to solution
1,084 Views
jameshorton
Contributor II

I've tried several attempts to create a job desciptor for a Job Ring that would create 8 bytes of random data (via the RNG algorithm) and move it to system RAM. I keep getting errors. 

 

Attempt #1

-----------------

header            B0800005

Seq Out PTR F8000008

RAM Addr      05008000

RNG Alg         82500000

MOVE             6A220008

 

Resulting Status Word (JD + Status)

------------------------------

50004000  --that's where I put the JD and the intput ring was pointing there ok

4000040B -- Somethings wrong with the RNG command?

 

Also the SSTA is a 00000401

 

 

Attempt #2

See attached file

Original Attachment has been moved to: jd_rng_notes.txt.zip

Labels (1)
Tags (2)
1 Solution
571 Views
lunminliang
NXP Employee
NXP Employee

Question has been submitted as SR to technical support and ticket closed. Sharing below the comment of ticket for more community members reference:

You are using a strange data type code  (0x22) in store commands. Please find below valid RNG job descriptors:

### rnggen_1

[00] B0800006       jobhdr: stidx=0 len=6

[01] 12820004           ld: ccb1-datasz len=4 offs=0 imm

[02] 00000020               data:0x00000020

[03] 82500000    operation: cls1-op rng (SH0) generate random

[04] 60300020      fifostr: msg len=32

[05] 00004020               ptr->@0x00004020

If the SEC4 is going to be doing other things, this will be a better examples:

### rnggen_2

[00] B8800303       shrhdr: stidx=0 share=always len=3

[01] 82500000    operation: cls1-op rng (SH0) generate random

[02] 68340020   seqfifostr: rng-ref len=32

OR

### rnggen_3

[00] B0800008       jobhdr: stidx=0 len=8

[01] 10FA0008           ld: ind-nfifo len=8 offs=0 imm

[02] 42F30000               <nfifo_entry: pad->class1 type=msg/rsvd0F

ptype=rnd

[03] 00000400                               extlen=1024>

[04] 16860800           ld: deco-ctrl len=0 offs=8 imm -auto-nfifo-entries

[05] 7A920400         move: ififo->class1-alnblk -> ofifo, len=1024 (aux_ls)

[06] 60300400      fifostr: msg len=1024

[07] 00004400               ptr->@0x00004400

Note: #3 use the Info FIFO's "pad block" source for random data.

View solution in original post

2 Replies
572 Views
lunminliang
NXP Employee
NXP Employee

Question has been submitted as SR to technical support and ticket closed. Sharing below the comment of ticket for more community members reference:

You are using a strange data type code  (0x22) in store commands. Please find below valid RNG job descriptors:

### rnggen_1

[00] B0800006       jobhdr: stidx=0 len=6

[01] 12820004           ld: ccb1-datasz len=4 offs=0 imm

[02] 00000020               data:0x00000020

[03] 82500000    operation: cls1-op rng (SH0) generate random

[04] 60300020      fifostr: msg len=32

[05] 00004020               ptr->@0x00004020

If the SEC4 is going to be doing other things, this will be a better examples:

### rnggen_2

[00] B8800303       shrhdr: stidx=0 share=always len=3

[01] 82500000    operation: cls1-op rng (SH0) generate random

[02] 68340020   seqfifostr: rng-ref len=32

OR

### rnggen_3

[00] B0800008       jobhdr: stidx=0 len=8

[01] 10FA0008           ld: ind-nfifo len=8 offs=0 imm

[02] 42F30000               <nfifo_entry: pad->class1 type=msg/rsvd0F

ptype=rnd

[03] 00000400                               extlen=1024>

[04] 16860800           ld: deco-ctrl len=0 offs=8 imm -auto-nfifo-entries

[05] 7A920400         move: ififo->class1-alnblk -> ofifo, len=1024 (aux_ls)

[06] 60300400      fifostr: msg len=1024

[07] 00004400               ptr->@0x00004400

Note: #3 use the Info FIFO's "pad block" source for random data.

571 Views
fmajeric
Contributor III

Hello,

I've just read your answer.

I tried to generate a simple random number @0x10000170 . But when I load the Job Descriptor Base Address into the Input Job Ring Register,

I haven't a Random number at the address  @0x10000170...

### rnggen_1

[00] B0800006       jobhdr: stidx=0 len=6

[01] 12820004           ld: ccb1-datasz len=4 offs=0 imm

[02] 00000020               data:0x00000020

[03] 82500000    operation: cls1-op rng (SH0) generate random

[04] 60300020      fifostr: msg len=32

[05] 10000170       ptr->@0x10000170

... what is the problem with this descriptor ?

What I don't make well ?

Please, could you help me ?

Fabien.

0 Kudos