Max number of arguments to a kernel?


#1

Hi,

Is it possible to send more than 3 arguments from the host to the kernel?

thanks,
Mark


#2

Hi Mark,

You can have more than 3 arguments. Our limit is 4096 bytes for all of the arguments combined, with uintptr types requiring 64 bits. That should give you at least 512 arguments, if every argument was 64 bits wide.


#3

…so what would that look like in the host code? Something like
this…?

krnl.SetArg(0, uint32(msgSize))
krnl.SetMemoryArg(1,
keyBuff)
krnl.SetMemoryArg(2, pTextBuff)
krnl.SetMemoryArg(3,
cTextBuff)

krnl.Run(1, 1, 1)

josh.bohde [1] Reconfigure.io CTO
January 22

Hi
Mark,

You can have more than 3 arguments. Our limit is 4096 bytes
for all of the arguments combined, with uintptr types requiring 64 bits.
That should give you at least 512 arguments, if every argument was 64
bits wide.


Visit Topic [2] or reply
to this email to respond.

To unsubscribe from these emails, click
here [3].

Con Mobile Open 7 GB a 9 euro/4 sett navighi veloce con 7 GB di Internet e hai 200 minuti ed SMS a 12 cent. Passa a Tiscali Mobile! http://tisca.li/OPEN7GBFirma


#4

Yes, here’s an example from a fuzz test we have:

Host side:

	krnl.SetMemoryArg(0, inputBuff)
	krnl.SetArg(1, DATA_WIDTH)
	krnl.SetArg(2, burstCount)
	krnl.SetMemoryArg(3, errOutBuff)
	krnl.SetMemoryArg(4, dcountOutBuff)

Kernel Side

func Top(
    inputBuff uintptr, 
    dataWidth uint32, 
    burstCount uint32, 
    errBuff uintptr, 
    counterBuff uintptr ...)

#5

…what about the transfers from the multiple buffers via AXI? Would it be something like this?

	go func() {
		aximemory.ReadBurstUInt8(memReadAddr, memReadData, true, inputBuff, len0, firstChan)
		aximemory.ReadBurstUInt8(memReadAddr, memReadData, true, errBuffer, len1, secondChan)
		aximemory.ReadBurstUInt8(memReadAddr, memReadData, true, counterBuffer, len2, thirdChan)
	}()

#6

That should work, unless those read/writes are concurrent. If you have that, then you’ll need to use our arbitration support: https://godoc.org/github.com/ReconfigureIO/sdaccel/axi/arbitrate


#7

Thanks Josh.

I’ll take a look at that as soon as I can. I actually got it working in
non-concurrent mode using the code form as in my email.

I now have AES-128 ECB mode encryption and decryption working.