void consoleProcess() { uint32_t inBytes = fifoSize(&rxFifo); if(inBytes > 0) { uint32_t newLine = 0; for(int32_t index = 0; index < inBytes; index++){ if(fifoPeek(&rxFifo, index) == '\n') { newLine = index + 1; break; } } if(newLine > sizeof(cmdBuff)) { newLine = sizeof(cmdBuff) - 1; } if(newLine) { uint8_t *pBuf = (uint8_t *)cmdBuff; while(newLine--){ *pBuf++ = fifoPop(&rxFifo); } *(pBuf - 1) = 0; // String terminator const command_t *command = commands; while(command->commandStr != NULL) { if(strcmp(command->commandStr, cmdBuff) == 0) { command->fn(0, NULL); break; } command++; } if(command->commandStr == NULL) { putStr("Unknown command\n"); helpFn(1, NULL); } } } }
static void putChars() { Bool ok; Uns8 c; // // keep sending characters whilst the TX fifo is not empty // if (!Tx.empty) { ok = fifoPop(&Tx, &c); if (ok) { writeOutput(&c, 1); } } if (Tx.empty) { // // Generate an interrupt if enabled // eval_interrupts(); } else { if (BHM_DIAG_HIGH) bhmMessage("F", PREFIX, "Tx.empty is false !!!"); } }
void core7(void){ // Initialisation(s) communicationInit(); fifoInit(FIFO_Head_generateMatrices_e__0, 4*sizeof(char), NULL, 0); cache_wbInv(FIFO_Head_generateMatrices_e__0, 4*sizeof(char)); // Begin the execution loop while(1){ busy_barrier(); receiveStart(); // Core2 > Core7: accumulateMatrices_0_init_ru__0 receiveEnd(2); // Core2 > Core7: accumulateMatrices_0_init_ru__0 cache_inv(accumulateMatrices_0_init_ru__0, 32*sizeof(char)); cache_inv(FIFO_Head_generateMatrices_e__0, 4*sizeof(char)); fifoPop(init_out__countIn__0, FIFO_Head_generateMatrices_e__0, 4*sizeof(char), NULL, 0); cache_wbInv(generateMatrices_init_countI__0, 4*sizeof(char)); sendStart(0); // Core7 > Core0: generateMatrices_init_countI__0 sendEnd(); // Core7 > Core0: generateMatrices_init_countI__0 receiveStart(); // Core0 > Core7: generateMatrices__explode_ge__0 receiveEnd(0); // Core0 > Core7: generateMatrices__explode_ge__0 cache_inv(generateMatrices__explode_ge__0, 256*sizeof(char)); // Fork explode_generateMatrices_startArray { cache_wb(startArray__inputArray__0, 64*sizeof(long)); memcpy((void*)(startArray_8__inputArray__0+0),(void*)( startArray__inputArray__0+8), 8*sizeof(long)); memcpy((void*)(startArray_16__inputArray__0+0),(void*)( startArray__inputArray__0+16), 8*sizeof(long)); memcpy((void*)(startArray_24__inputArray__0+0),(void*)( startArray__inputArray__0+24), 8*sizeof(long)); memcpy((void*)(startArray_40__inputArray__0+0),(void*)( startArray__inputArray__0+40), 8*sizeof(long)); memcpy((void*)(startArray_48__inputArray__0+0),(void*)( startArray__inputArray__0+48), 8*sizeof(long)); memcpy((void*)(startArray_56__inputArray__0+0),(void*)( startArray__inputArray__0+56), 8*sizeof(long)); } cache_wb(((char*)startArray__inputArray__0) + 0, 32); cache_wb(((char*)startArray__inputArray__0) + 128, 32); cache_inv(startArray__inputArray__0, 64*sizeof(long)); cache_wbInv(explode_generateMatrices_sta__7, 32*sizeof(char)); sendStart(3); // Core7 > Core3: explode_generateMatrices_sta__7 sendEnd(); // Core7 > Core3: explode_generateMatrices_sta__7 cache_wbInv(explode_generateMatrices_sta__3, 32*sizeof(char)); sendStart(6); // Core7 > Core6: explode_generateMatrices_sta__3 sendEnd(); // Core7 > Core6: explode_generateMatrices_sta__3 cache_wbInv(explode_generateMatrices_sta__6, 32*sizeof(char)); sendStart(0); // Core7 > Core0: explode_generateMatrices_sta__6 sendEnd(); // Core7 > Core0: explode_generateMatrices_sta__6 cache_wbInv(explode_generateMatrices_sta__1, 32*sizeof(char)); sendStart(4); // Core7 > Core4: explode_generateMatrices_sta__1 sendEnd(); // Core7 > Core4: explode_generateMatrices_sta__1 cache_wbInv(explode_generateMatrices_sta__4, 32*sizeof(char)); sendStart(1); // Core7 > Core1: explode_generateMatrices_sta__4 sendEnd(); // Core7 > Core1: explode_generateMatrices_sta__4 cache_wbInv(explode_generateMatrices_sta__0, 32*sizeof(char)); sendStart(2); // Core7 > Core2: explode_generateMatrices_sta__0 sendEnd(); // Core7 > Core2: explode_generateMatrices_sta__0 cache_wbInv(explode_generateMatrices_sta__5, 32*sizeof(char)); sendStart(5); // Core7 > Core5: explode_generateMatrices_sta__5 sendEnd(); // Core7 > Core5: explode_generateMatrices_sta__5 add(8/*rows*/,8/*columns*/,init_out__runningTotal__5,startArray_0__inputArray__0,output__input_0__0); // accumulateMatrices_0 cache_inv(init_out__runningTotal__5, 8*sizeof(long)); cache_inv(startArray_0__inputArray__0, 8*sizeof(long)); receiveStart(); // Core5 > Core7: accumulateMatrices_1__implod__0 receiveEnd(5); // Core5 > Core7: accumulateMatrices_1__implod__0 cache_inv(accumulateMatrices_1__implod__0, 32*sizeof(char)); receiveStart(); // Core2 > Core7: accumulateMatrices_2__implod__0 receiveEnd(2); // Core2 > Core7: accumulateMatrices_2__implod__0 cache_inv(accumulateMatrices_2__implod__0, 32*sizeof(char)); receiveStart(); // Core1 > Core7: accumulateMatrices_3__implod__0 receiveEnd(1); // Core1 > Core7: accumulateMatrices_3__implod__0 cache_inv(accumulateMatrices_3__implod__0, 32*sizeof(char)); receiveStart(); // Core4 > Core7: accumulateMatrices_4__implod__0 receiveEnd(4); // Core4 > Core7: accumulateMatrices_4__implod__0 cache_inv(accumulateMatrices_4__implod__0, 32*sizeof(char)); receiveStart(); // Core0 > Core7: accumulateMatrices_5__implod__0 receiveEnd(0); // Core0 > Core7: accumulateMatrices_5__implod__0 cache_inv(accumulateMatrices_5__implod__0, 32*sizeof(char)); receiveStart(); // Core6 > Core7: accumulateMatrices_6__implod__0 receiveEnd(6); // Core6 > Core7: accumulateMatrices_6__implod__0 cache_inv(accumulateMatrices_6__implod__0, 32*sizeof(char)); receiveStart(); // Core3 > Core7: accumulateMatrices_7__implod__0 receiveEnd(3); // Core3 > Core7: accumulateMatrices_7__implod__0 cache_inv(accumulateMatrices_7__implod__0, 32*sizeof(char)); // Join implode_broadcastOutput_input { cache_wb(output__input_0__0, 8*sizeof(long)); memcpy((void*)(output__input__0+8),(void*)( output__input_8__0+0), 8*sizeof(long)); memcpy((void*)(output__input__0+16),(void*)( output__input_16__0+0), 8*sizeof(long)); memcpy((void*)(output__input__0+24),(void*)( output__input_24__0+0), 8*sizeof(long)); cache_wb(output__input_32__0, 8*sizeof(long)); memcpy((void*)(output__input__0+40),(void*)( output__input_40__0+0), 8*sizeof(long)); memcpy((void*)(output__input__0+48),(void*)( output__input_48__0+0), 8*sizeof(long)); memcpy((void*)(output__input__0+56),(void*)( output__input_56__0+0), 8*sizeof(long)); } cache_wb(((char*)output__input_0__0) + 0, 32); cache_inv(output__input_0__0, 8*sizeof(long)); cache_inv(output__input_8__0, 8*sizeof(long)); cache_inv(output__input_16__0, 8*sizeof(long)); cache_inv(output__input_24__0, 8*sizeof(long)); cache_wb(((char*)output__input_32__0) + 0, 32); cache_inv(output__input_32__0, 8*sizeof(long)); cache_inv(output__input_40__0, 8*sizeof(long)); cache_inv(output__input_48__0, 8*sizeof(long)); cache_inv(output__input_56__0, 8*sizeof(long)); // Broadcast broadcastOutput { cache_wb(output__input__0, 64*sizeof(long)); memcpy((void*)(output1_8__end_in__0+0),(void*)( output__input__0+0), 8*sizeof(long)); memcpy((void*)(output1_40__end_in__0+0),(void*)( output__input__0+8), 8*sizeof(long)); memcpy((void*)(output1_32__end_in__0+0),(void*)( output__input__0+16), 8*sizeof(long)); memcpy((void*)(output1_16__end_in__0+0),(void*)( output__input__0+24), 8*sizeof(long)); memcpy((void*)(output1_0__end_in__0+0),(void*)( output__input__0+32), 8*sizeof(long)); memcpy((void*)(output1_24__end_in__0+0),(void*)( output__input__0+40), 8*sizeof(long)); memcpy((void*)(output1_48__end_in__0+0),(void*)( output__input__0+48), 8*sizeof(long)); memcpy((void*)(output1_56__end_in__0+0),(void*)( output__input__0+56), 8*sizeof(long)); } cache_wb(((char*)output__input__0) + 0, 256); cache_inv(output__input__0, 64*sizeof(long)); cache_wbInv(broadcastOutput__broadcastOu__0, 32*sizeof(char)); sendStart(1); // Core7 > Core1: broadcastOutput__broadcastOu__0 sendEnd(); // Core7 > Core1: broadcastOutput__broadcastOu__0 cache_wbInv(broadcastOutput__broadcastOu__3, 32*sizeof(char)); sendStart(2); // Core7 > Core2: broadcastOutput__broadcastOu__3 sendEnd(); // Core7 > Core2: broadcastOutput__broadcastOu__3 cache_wbInv(broadcastOutput__broadcastOu__7, 32*sizeof(char)); sendStart(5); // Core7 > Core5: broadcastOutput__broadcastOu__7 sendEnd(); // Core7 > Core5: broadcastOutput__broadcastOu__7 cache_wbInv(broadcastOutput__broadcastOu__5, 32*sizeof(char)); sendStart(6); // Core7 > Core6: broadcastOutput__broadcastOu__5 sendEnd(); // Core7 > Core6: broadcastOutput__broadcastOu__5 cache_wbInv(broadcastOutput__broadcastOu__1, 32*sizeof(char)); sendStart(3); // Core7 > Core3: broadcastOutput__broadcastOu__1 sendEnd(); // Core7 > Core3: broadcastOutput__broadcastOu__1 cache_wbInv(broadcastOutput__broadcastOu__4, 32*sizeof(char)); sendStart(4); // Core7 > Core4: broadcastOutput__broadcastOu__4 sendEnd(); // Core7 > Core4: broadcastOutput__broadcastOu__4 cache_wbInv(broadcastOutput__displayMatr__0, 256*sizeof(char)); sendStart(0); // Core7 > Core0: broadcastOutput__displayMatr__0 sendEnd(); // Core7 > Core0: broadcastOutput__displayMatr__0 fifoPush(output1_56__end_in__0, FIFO_Head_broadcastOutput_en__0, 32*sizeof(char), NULL, 0); cache_wbInv(FIFO_Head_broadcastOutput_en__0, 32*sizeof(char)); cache_inv(output1_56__end_in__0, 8*sizeof(long)); fifoPush(output1_8__end_in__0, FIFO_Head_broadcastOutput_en__6, 32*sizeof(char), NULL, 0); cache_wbInv(FIFO_Head_broadcastOutput_en__6, 32*sizeof(char)); cache_inv(output1_8__end_in__0, 8*sizeof(long)); } }