Exemple #1
0
void core2(void){
	// Initialisation(s)
	communicationInit();
	fifoInit(FIFO_Head_broadcastOutput_en__1, 32*sizeof(char), NULL, 0);
	cache_wbInv(FIFO_Head_broadcastOutput_en__1, 32*sizeof(char));

	// Begin the execution loop 
	while(1){
		busy_barrier();
		cache_inv(FIFO_Head_broadcastOutput_en__1, 32*sizeof(char));
		fifoPop(init_out__runningTotal__5, FIFO_Head_broadcastOutput_en__1, 32*sizeof(char), NULL, 0);
		cache_wbInv(accumulateMatrices_0_init_ru__0, 32*sizeof(char));
		sendStart(7); // Core2 > Core7: accumulateMatrices_0_init_ru__0 
		sendEnd(); // Core2 > Core7: accumulateMatrices_0_init_ru__0 
		receiveStart(); // Core5 > Core2: accumulateMatrices_2_init_ru__0 
		receiveEnd(5); // Core5 > Core2: accumulateMatrices_2_init_ru__0 
		cache_inv(accumulateMatrices_2_init_ru__0, 32*sizeof(char));
		receiveStart(); // Core7 > Core2: explode_generateMatrices_sta__0 
		receiveEnd(7); // Core7 > Core2: explode_generateMatrices_sta__0 
		cache_inv(explode_generateMatrices_sta__0, 32*sizeof(char));
		add(8/*rows*/,8/*columns*/,init_out__runningTotal__0,startArray_16__inputArray__0,output__input_16__0); // accumulateMatrices_2
		cache_inv(init_out__runningTotal__0, 8*sizeof(long));
		cache_inv(startArray_16__inputArray__0, 8*sizeof(long));
		cache_wbInv(accumulateMatrices_2__implod__0, 32*sizeof(char));
		sendStart(7); // Core2 > Core7: accumulateMatrices_2__implod__0 
		sendEnd(); // Core2 > Core7: accumulateMatrices_2__implod__0 
		receiveStart(); // Core7 > Core2: broadcastOutput__broadcastOu__3 
		receiveEnd(7); // Core7 > Core2: broadcastOutput__broadcastOu__3 
		cache_inv(broadcastOutput__broadcastOu__3, 32*sizeof(char));
		fifoPush(output1_24__end_in__0, FIFO_Head_broadcastOutput_en__3, 32*sizeof(char), NULL, 0);
		cache_wbInv(FIFO_Head_broadcastOutput_en__3, 32*sizeof(char));
		cache_inv(output1_24__end_in__0, 8*sizeof(long));
	}
}
Exemple #2
0
void GraphicBoard::connectToPlayers(Player *player1, Player* player2)
{
    connect(this, SIGNAL(chooseLetterFirst(QPair<QPair<int,int>, QChar>)),
            player1, SLOT(onLetterChosen(QPair<QPair<int,int>,QChar>)));
    connect(this, SIGNAL(chooseLetterSecond(QPair<QPair<int,int>, QChar>)),
            player2, SLOT(onLetterChosen(QPair<QPair<int,int>,QChar>)));
    connect(this, SIGNAL(pushLetterFirst(QPair<int,int>)),
            player1, SLOT(onLetterPushed(QPair<int,int>)));
    connect(this, SIGNAL(pushLetterSecond(QPair<int,int>)),
            player2, SLOT(onLetterPushed(QPair<int,int>)));
    connect(this, SIGNAL(commitWordFirst()), player1, SLOT(onWordCommited()));
    connect(this, SIGNAL(commitWordSecond()), player2, SLOT(onWordCommited()));
    connect(this, SIGNAL(giveUpFirst()), player1, SLOT(sendEnd()));
    connect(this, SIGNAL(giveUpSecond()), player2, SLOT(sendEnd()));

}
void sendChannel1()
{
    sendHeader(1);
    //analog inputs
    for(uint8_t i=0;i < sizeOfArray(channel1);i++) {
        AnalogInputs::Name name = pgm::read(&channel1[i]);
        uint16_t v = AnalogInputs::getRealValue(name);
        printUInt(v);
        printD();
    }

    for(uint8_t i=0;i<MAX_BANANCE_CELLS;i++) {
        printUInt(TheveninMethod::getReadableRthCell(i));
        printD();
    }

    printUInt(TheveninMethod::getReadableBattRth());
    printD();

    printUInt(TheveninMethod::getReadableWiresRth());
    printD();

    printUInt(Monitor::getChargeProcent());
    printD();
    printUInt(Monitor::getETATime());
    printD();

    sendEnd();
}
Exemple #4
0
void MailSender::sendMail()
{
    if (!_mail)
        return;

    sendHeader();
    sendContent();
    sendEnd();
}
Exemple #5
0
void sendChannel3()
{
    sendHeader(3);
    printUInt(StackInfo::getNeverUsedStackSize());
    printD();
    printUInt(StackInfo::getFreeStackSize());
    printD();
    sendEnd();
}
void sendChannel3()
{
    sendHeader(3);
#ifdef    ENABLE_STACK_INFO //ENABLE_SERIAL_LOG
    printUInt(StackInfo::getNeverUsedStackSize());
    printD();
    printUInt(StackInfo::getFreeStackSize());
    printD();
#endif
    sendEnd();
}
Exemple #7
0
bool MailSender::sendMail()
{
    if (!_mail)
        return false;

    if (!sendHeader())
    	return false;
    if (!sendContent())
    	return false;
    if (!sendEnd())
    	return false;
    return true;
}
Exemple #8
0
void core6(void){
	// Initialisation(s)
	communicationInit();

	// Begin the execution loop 
	while(1){
		busy_barrier();
		receiveStart(); // Core7 > Core6: broadcastArrayB__multiplyMat__2 
		receiveEnd(7); // Core7 > Core6: broadcastArrayB__multiplyMat__2 
		cache_inv(broadcastArrayB__multiplyMat__2, 67108864*sizeof(char));
		receiveStart(); // Core0 > Core6: explode_generateMatricies_ar__4 
		receiveEnd(0); // Core0 > Core6: explode_generateMatricies_ar__4 
		cache_inv(explode_generateMatricies_ar__4, 8388608*sizeof(char));
		multiply(4096/*rowsA*/,4096/*columnsA*/,4096/*rowsB*/,4096/*columnsB*/,arrayA_6291456__arrayA__0,arrayBOut_50331648__arrayB__0,output__arrayC_6291456__0); // multiplyMatricies_3
		cache_inv(arrayA_6291456__arrayA__0, 2097152*sizeof(long));
		cache_inv(arrayBOut_50331648__arrayB__0, 16777216*sizeof(long));
		cache_wbInv(multiplyMatricies_3__implode__0, 8388608*sizeof(char));
		sendStart(7); // Core6 > Core7: multiplyMatricies_3__implode__0 
		sendEnd(); // Core6 > Core7: multiplyMatricies_3__implode__0 
	}
}
void sendChannel2(bool adc)
{
    sendHeader(2);
    ANALOG_INPUTS_FOR_ALL(it) {
        uint16_t v;
        if(adc) v = AnalogInputs::getAvrADCValue(it);
        else    v = AnalogInputs::getRealValue(it);
        printUInt(v);
        printD();
    }
    printUInt(Balancer::balance);
    printD();

    uint16_t pidV=0;
#ifdef ENABLE_GET_PID_VALUE
    pidV = hardware::getPIDValue();
#endif
    printUInt(pidV);
    printD();
    sendEnd();
}
Exemple #10
0
void core2(void){
	// Initialisation(s)
	communicationInit();

	// Begin the execution loop 
	while(1){
		busy_barrier();
		receiveStart(); // Core0 > Core2: explode_generateMatrices_arr__6 
		receiveEnd(0); // Core0 > Core2: explode_generateMatrices_arr__6 
		cache_inv(explode_generateMatrices_arr__6, 32*sizeof(char));
		receiveStart(); // Core7 > Core2: explode_generateMatrices_arr__10 
		receiveEnd(7); // Core7 > Core2: explode_generateMatrices_arr__10 
		cache_inv(explode_generateMatrices_arr__10, 32*sizeof(char));
		add(8/*rowsA*/,8/*columnsA*/,arrayA_40__arrayA__0,arrayB_40__arrayB__0,arrayC__arrayC_40__0); // addMatrices_5
		cache_inv(arrayA_40__arrayA__0, 8*sizeof(long));
		cache_inv(arrayB_40__arrayB__0, 8*sizeof(long));
		cache_wbInv(addMatrices_5__implode_displ__0, 32*sizeof(char));
		sendStart(7); // Core2 > Core7: addMatrices_5__implode_displ__0 
		sendEnd(); // Core2 > Core7: addMatrices_5__implode_displ__0 
	}
}
Exemple #11
0
void sendChannel2(bool adc)
{
    sendHeader(2);
    FOR_ALL_INPUTS(it) {
        uint16_t v;
        if(adc) v = AnalogInputs::getAvrADCValue(it);
        else    v = AnalogInputs::getRealValue(it);
        printUInt(v);
        printD();
    }
    printUInt(Balancer::balance_);
    printD();

    uint16_t pidV=0;
#ifdef ENABLE_GET_PID_VALUE
    pidV = hardware::getPIDValue();
#endif
//    printUInt(pidV);
    printUInt(TheveninMethod::idebug_);
    printD();
    sendEnd();
}
Exemple #12
0
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));
	}
}
Exemple #13
0
main(int ac, char **av)
{
    int i;
    int on = 1;
    char *hostname = 0;
    struct hostent *hostent;
    int host;			/* net order. */
    short port = -1;		/* host order. */
    int setFD = 0;
    int sockFD;
    struct sockaddr_in saddr;
    int reqOOB = 0;
    int putOOB = 0;
    int delay = 5;
    int doEnd = 0;
    int doWrite = 0;
    int writeSize = 0;

    program = av[0];

    signal(SIGIO, sigIO);


    for (i = 1; i < ac; i++) {
	if (!strcmp("-fd", av[i])) {
	    if (++i >= ac) {
		printf("Missing number for -fd option.\n");
		Usage();
	    }
	    setFD = atoi(av[i]);
	    if (setFD <= 2) {
		printf("%s: %d: file descriptor must be at least 3.\n",
		       program, setFD);
		Usage();
	    }
	} else if (!strcmp("-end", av[i])) {
	    doEnd = 1;
	} else if (!strcmp("-delay", av[i])) {
	    if (++i >= ac) {
		printf("%s: Missing time for -delay option.\n", program);
		Usage();
	    }
	    delay = atoi(av[i]);
	    if (delay < 0) {
		printf("%s: %s: delay must be at least 0 seconds.\n", program,
		       av[i]);
		Usage();
	    }
	} else if (!strcmp("-write", av[i])) {
	    doWrite = 1;
	    if (++i >= ac) {
		printf("%s: Missing size for -write option.\n", program);
		Usage();
	    }
	    writeSize = atoi(av[i]);
	    if (writeSize < 1) {
		printf("%s: %s: Write size must be at least 1 byte.\n",
		       program, av[i]);
		Usage();
	    }
	} else if (!strcmp("-oob", av[i])) {
	    reqOOB = 1;
	} else if (!strcmp("-soob", av[i])) {
	    putOOB = 1;
	} else {
	    if (!hostname) {
		hostname = av[i];
	    } else if (port == -1) {
		port = atoi(av[i]);
		if (port <= 0) {
		    printf("%s: %s: port must be at least 1\n", program,
			   av[i]);
		    Usage();
		}
	    } else {
		printf("%s: %s: Unknown argument.\n", program, av[i]);
	    }
	}
    }

    if (!hostname) {
	printf("%s: Missing hostname and port.\n", program);
	Usage();
    }
    if (port == -1) {
	printf("%s: Missing port.\n", program);
	Usage();
    }

    if (writeSize == 0 && doEnd == 0 && putOOB == 0) {
	printf("%s: Missing action.\n", program);
	Usage();
    }

    if (!setFD) {
	setFD = 31;
	printf("%s: Using default socket of %d.\n", program, setFD);
    }

    if (!(hostent = gethostbyname(hostname))) {
	printf("%s: Failed to find host entry for %s.\n", program, hostname);
	exit(1);
    }

    memcpy((void *)&host, (const void *)hostent->h_addr, sizeof(host));

    OpenFDs(setFD);

    /* Connect to server. */
    sockFD = socket(AF_INET, SOCK_STREAM, 0);
    if (sockFD < 0) {
	Die(0, "socket");
    }
    printf("%s: Using socket at file descriptor %d.\n", program, sockFD);

    memset((void *)&saddr, 0, sizeof(saddr));
    saddr.sin_family = AF_INET;
    saddr.sin_addr.s_addr = host;	/* already in network byte order. */
    saddr.sin_port = htons(port);

    if (connect(sockFD, (struct sockaddr *)&saddr, sizeof(saddr)) < 0) {
	assert(0);
    }


    if (doEnd) {
	sendEnd(sockFD);
    } else if (putOOB) {
	Log("Will send OOB in 2 seconds.\n");
	sleep(2);
	sendOOB(sockFD);
	Log("Sent OOB, sleeping for 5 seconds.\n");
	sleep(5);
	Log("Sent OOB, exiting.\n");
    } else {
	IOMGR_Initialize();
	sendTest(sockFD, delay, reqOOB, writeSize);
    }
    close(sockFD);
}