scoreboard.c
void scoreboard_writeTracedUnit( stScoreboardCPU* a_pThis, FILE* fp) {
	if (a_pThis->pTracedUnit->Busy == true) {
		char nameFi[4] = {0};
		char nameFj[4] = {0};
		char nameFk[4] = {0};
		char nameQj[MAX_LENGTH_OF_FU_NAME] = {0};
		char nameQk[MAX_LENGTH_OF_FU_NAME] = {0};
		char nameRj[4] = {0};
		char nameRk[4] = {0};
		sprintf(nameFi, "F%d", (uint8_t)a_pThis->pTracedUnit->Fi);
		sprintf(nameFj, "F%d", (uint8_t)a_pThis->pTracedUnit->Fj);
		sprintf(nameFk, "F%d", (uint8_t)a_pThis->pTracedUnit->Fk);
		if (a_pThis->pTracedUnit->Qj == NULL) {
			strcpy(nameQj, "-");
		} else {
			sprintf(nameQj, "%s", a_pThis->pTracedUnit->Qj->fuName);
		}
		if (a_pThis->pTracedUnit->Qk == NULL) {
			strcpy(nameQk, "-");
		} else {
			sprintf(nameQk, "%s", a_pThis->pTracedUnit->Qk->fuName);
		}
		(a_pThis->pTracedUnit->Rj)? strcpy(nameRj, "Yes"): strcpy(nameRj, "No");
		(a_pThis->pTracedUnit->Rk) ? strcpy(nameRk, "Yes") : strcpy(nameRk, "No");
		fprintf(fp, "%d %s %s %s %s %s %s %s %s\n", a_pThis->cycle, a_pThis->pTracedUnit->fuName, nameFi, nameFj, nameFk, nameQj, nameQk, nameRj, nameRk);
	}
}
/* this function writes to the traceunit file in the right format */
this function writes to the traceunit file in the right format
this function writes to the traceunit file in the right format
void scoreboard_writeTracedUnit( stScoreboardCPU* a_pThis, FILE* fp) {
	if (a_pThis->pTracedUnit->Busy == true) {
		char nameFi[4] = {0};
		char nameFj[4] = {0};
		char nameFk[4] = {0};
		char nameQj[MAX_LENGTH_OF_FU_NAME] = {0};
		char nameQk[MAX_LENGTH_OF_FU_NAME] = {0};
		char nameRj[4] = {0};
		char nameRk[4] = {0};
		sprintf(nameFi, "F%d", (uint8_t)a_pThis->pTracedUnit->Fi);
		sprintf(nameFj, "F%d", (uint8_t)a_pThis->pTracedUnit->Fj);
		sprintf(nameFk, "F%d", (uint8_t)a_pThis->pTracedUnit->Fk);
		if (a_pThis->pTracedUnit->Qj == NULL) {
			strcpy(nameQj, "-");
		} else {
			sprintf(nameQj, "%s", a_pThis->pTracedUnit->Qj->fuName);
		}
		if (a_pThis->pTracedUnit->Qk == NULL) {
			strcpy(nameQk, "-");
		} else {
			sprintf(nameQk, "%s", a_pThis->pTracedUnit->Qk->fuName);
		}
		(a_pThis->pTracedUnit->Rj)? strcpy(nameRj, "Yes"): strcpy(nameRj, "No");
		(a_pThis->pTracedUnit->Rk) ? strcpy(nameRk, "Yes") : strcpy(nameRk, "No");
		fprintf(fp, "%d %s %s %s %s %s %s %s %s\n", a_pThis->cycle, a_pThis->pTracedUnit->fuName, nameFi, nameFj, nameFk, nameQj, nameQk, nameRj, nameRk);
	}
}
void scoreboard_writeTracedUnit ( stScoreboardCPU * a_pThis , FILE * fp ) { if ( a_pThis -> pTracedUnit -> Busy == true ) { char nameFi [ 4 ] = { 0 } ; char nameFj [ 4 ] = { 0 } ; char nameFk [ 4 ] = { 0 } ; char nameQj [ MAX_LENGTH_OF_FU_NAME ] = { 0 } ; char nameQk [ MAX_LENGTH_OF_FU_NAME ] = { 0 } ; char nameRj [ 4 ] = { 0 } ; char nameRk [ 4 ] = { 0 } ; sprintf ( nameFi , " " , ( uint8_t ) a_pThis -> pTracedUnit -> Fi ) ; sprintf ( nameFj , " " , ( uint8_t ) a_pThis -> pTracedUnit -> Fj ) ; sprintf ( nameFk , " " , ( uint8_t ) a_pThis -> pTracedUnit -> Fk ) ; if ( a_pThis -> pTracedUnit -> Qj == NULL ) { strcpy ( nameQj , " " ) ; } else { sprintf ( nameQj , " " , a_pThis -> pTracedUnit -> Qj -> fuName ) ; } if ( a_pThis -> pTracedUnit -> Qk == NULL ) { strcpy ( nameQk , " " ) ; } else { sprintf ( nameQk , " " , a_pThis -> pTracedUnit -> Qk -> fuName ) ; } ( a_pThis -> pTracedUnit -> Rj ) ? strcpy ( nameRj , " " ) : strcpy ( nameRj , " " ) ; ( a_pThis -> pTracedUnit -> Rk ) ? strcpy ( nameRk , " " ) : strcpy ( nameRk , " " ) ; fprintf ( fp , " \n " , a_pThis -> cycle , a_pThis -> pTracedUnit -> fuName , nameFi , nameFj , nameFk , nameQj , nameQk , nameRj , nameRk ) ; } }
this function writes to the traceunit file in the right format
this function writes to the traceunit file in the right format