@@ -171,10 +171,13 @@ def header(
171
171
memfile .write (' // Acknowledge interrupt to all quadrants\n ' )
172
172
for _ , group in enumerate (groups ):
173
173
addr = tc .dev .APB_BASE + tc .ctl_addr (group , tc .dev .REG_CTL )
174
+ memfile .write (f' *((volatile uint32_t *) 0x{ addr :08x} ) &= ' )
174
175
if oneshot > 0 and not tc .dev .REQUIRE_ONESHOT_CLEAR :
175
- memfile .write (f' *((volatile uint32_t *) 0x{ addr :08x} ) &= ~(1<<12);\n ' )
176
+ memfile .write ('~(1<<12);\n ' )
177
+ elif any (state .streaming ):
178
+ memfile .write ('~((1<<12) | (1<<14) | 1);\n ' )
176
179
else :
177
- memfile .write (f' *((volatile uint32_t *) 0x { addr :08x } ) &= ~((1<<12) | 1);\n ' )
180
+ memfile .write (' ~((1<<12) | 1);\n ' )
178
181
memfile .write ('\n ' )
179
182
if embedded_code and not state .measure_energy :
180
183
memfile .write (' CNN_COMPLETE; // Signal that processing is complete\n ' )
@@ -627,12 +630,18 @@ def main(
627
630
' for (i = 0; i < 100; i++)\n '
628
631
' cnn_load_weights(); // Load kernels\n '
629
632
' CNN_COMPLETE;\n \n '
630
- ' printf("Measuring input loading...\\ n");\n '
631
- ' MXC_TMR_Delay(MXC_TMR0, 500000);\n '
632
- ' CNN_START;\n '
633
- ' for (i = 0; i < 100; i++)\n '
634
- ' load_input(); // Load data input\n '
635
- ' CNN_COMPLETE;\n \n ' )
633
+ ' MXC_TMR_Delay(MXC_TMR0, 500000);\n ' )
634
+ if not fifo :
635
+ memfile .write (' printf("Measuring input loading...\\ n");\n '
636
+ ' CNN_START;\n '
637
+ ' for (i = 0; i < 100; i++)\n '
638
+ ' load_input(); // Load data input\n '
639
+ ' CNN_COMPLETE;\n \n ' )
640
+ else :
641
+ memfile .write (' printf("Skipping input loading (using FIFO)...\\ n");\n '
642
+ ' CNN_START;\n '
643
+ ' MXC_TMR_Delay(MXC_TMR0, 10); // Dummy delay displays as 0\n '
644
+ ' CNN_COMPLETE;\n \n ' )
636
645
else :
637
646
memfile .write (' cnn_load_weights(); // Load kernels\n ' )
638
647
if state .verify_kernels :
@@ -687,8 +696,8 @@ def main(
687
696
else :
688
697
memfile .write (' cnn_wait();\n \n ' )
689
698
else :
690
- memfile .write (' printf("Measuring input load + inference... \\ n" );\n '
691
- ' MXC_TMR_Delay(MXC_TMR0, 500000 );\n '
699
+ memfile .write (' MXC_TMR_Delay(MXC_TMR0, 500000 );\n '
700
+ ' printf("Measuring input load + inference... \\ n" );\n '
692
701
' CNN_START; // Allow capture of processing time\n '
693
702
' for (i = 0; i < 100; i++) {\n ' )
694
703
if not fifo :
0 commit comments