master
kaqu 1 year ago
parent a8266a11db
commit b9b3f82faa
  1. 7
      libmodules/bfloat16nncore.py
  2. 2
      software/source/bfloat16nnlib.c

@ -201,8 +201,7 @@ class bfloat16NeuralNetworkCore(Module, AutoCSR, AutoDoc, ModuleDoc):
NextValue(self.Loader_Delay, self.Loader_Delay + 1), # Increment
)
)
"""
fpu.fsqrt
"""
fpu.fmadd
fpu.fmsub
fpu.fnmadd
@ -212,14 +211,14 @@ class bfloat16NeuralNetworkCore(Module, AutoCSR, AutoDoc, ModuleDoc):
"""
Loader_fsm.act("Loader_EXEC1",
NextValue(self.b16Status.storage[5], True), # Current status added
NextValue(fpu.fdiv, True), # This command requested
NextValue(fpu.fsqrt, True), # This command requested
NextValue(fpu.fready, False), # Engage trigger
NextState("Loader_EXEC2")
)
Loader_fsm.act("Loader_EXEC2",
NextValue(self.b16Status.storage[6], True), # Current status added
If(fpu.fready,
NextValue(fpu.fdiv, False), # Clear command request
NextValue(fpu.fsqrt, False), # Clear command request
NextValue(self.b16Result.storage, fpu.fresult[16:32]), # Pick result (little endian, high word!)
NextValue(self.b16Status.storage[15], True), # Indicate readyness ...
NextValue(self.bReady, True), # Indicate readyness (LED on!)

@ -121,7 +121,7 @@ int key_eval(void)
for(i=0, ui32ptr = (uint32_t *)DRAMDATABASE;i<DRAMDATASIZE;i++) // Setup test data
*ui32ptr++ = i+1;
ui16ptr = (uint16_t *)(DRAMDATABASE + 0 * sizeof(float));
*ui16ptr++ = f2ui16(1.0);
*ui16ptr++ = f2ui16(4.0);
*ui16ptr++ = f2ui16(2.0);
*ui16ptr++ = f2ui16(3.0);
if(fpgaload((uint32_t *)DRAMDATABASE, 512)) {

Loading…
Cancel
Save