Commit d525ab8d authored by lvs's avatar lvs
Browse files

pipes status turned from bool into ints

parent bf2f00b6
......@@ -347,16 +347,31 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
// Read energy
float energyIA_IC_rx;
float energyIE_IC_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_IC_rx = read_channel_nb_altera(chan_Intrae2StoreIC_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreIC_intrae, &energyIA_IC_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
/*
energyIE_IC_rx = read_channel_nb_altera(chan_Intere2StoreIC_intere, &inter_valid);
*/
......@@ -613,16 +628,30 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
// Read energy
float energyIA_GG_rx;
float energyIE_GG_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_GG_rx = read_channel_nb_altera(chan_Intrae2StoreGG_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreGG_intrae, &energyIA_GG_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
/*
energyIE_GG_rx = read_channel_nb_altera(chan_Intere2StoreGG_intere, &inter_valid);
*/
......@@ -724,6 +753,7 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
float2 evalenergy_tmp7;
float2 evalenergy_tmp8;
float2 evalenergy_tmp9;
/*
bool ls1_done = false;
bool ls2_done = false;
bool ls3_done = false;
......@@ -733,7 +763,18 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
bool ls7_done = false;
bool ls8_done = false;
bool ls9_done = false;
*/
int ls1_done = 1;
int ls2_done = 1;
int ls3_done = 1;
int ls4_done = 1;
int ls5_done = 1;
int ls6_done = 1;
int ls7_done = 1;
int ls8_done = 1;
int ls9_done = 1;
/*
while( (ls1_done == false) ||
(ls2_done == false) ||
(ls3_done == false) ||
......@@ -743,57 +784,94 @@ void Krnl_GA(__global float* restrict GlobPopulationCurrent,
(ls7_done == false) ||
(ls8_done == false) ||
(ls9_done == false)
*/
while( (ls1_done != 0) ||
(ls2_done != 0) ||
(ls3_done != 0) ||
(ls4_done != 0) ||
(ls5_done != 0) ||
(ls6_done != 0) ||
(ls7_done != 0) ||
(ls8_done != 0) ||
(ls9_done != 0)
)
{
/*
if (ls1_done == false) {
*/
if (ls1_done != 0) {
/*
evalenergy_tmp1 = read_channel_nb_altera(chan_LS2GA_LS1_evalenergy, &ls1_done);
*/
ls1_done = read_pipe(chan_LS2GA_LS1_evalenergy, &evalenergy_tmp1);
}
/*
else if (ls2_done == false) {
*/
else if (ls2_done != 0) {
/*
evalenergy_tmp2 = read_channel_nb_altera(chan_LS2GA_LS2_evalenergy, &ls2_done);
*/
ls2_done = read_pipe(chan_LS2GA_LS2_evalenergy, &evalenergy_tmp2);
}
/*
else if (ls3_done == false) {
*/
else if (ls3_done != 0) {
/*
evalenergy_tmp3 = read_channel_nb_altera(chan_LS2GA_LS3_evalenergy, &ls3_done);
*/
ls3_done = read_pipe(chan_LS2GA_LS3_evalenergy, &evalenergy_tmp3);
}
/*
else if (ls4_done == false) {
*/
else if (ls4_done != 0) {
/*
evalenergy_tmp4 = read_channel_nb_altera(chan_LS2GA_LS4_evalenergy, &ls4_done);
*/
ls4_done = read_pipe(chan_LS2GA_LS4_evalenergy, &evalenergy_tmp4);
}
/*
else if (ls5_done == false) {
*/
else if (ls5_done != 0) {
/*
evalenergy_tmp5 = read_channel_nb_altera(chan_LS2GA_LS5_evalenergy, &ls5_done);
*/
ls5_done = read_pipe(chan_LS2GA_LS5_evalenergy, &evalenergy_tmp5);
}
/*
else if (ls6_done == false) {
*/
else if (ls6_done != 0) {
/*
evalenergy_tmp6 = read_channel_nb_altera(chan_LS2GA_LS6_evalenergy, &ls6_done);
*/
ls6_done = read_pipe(chan_LS2GA_LS6_evalenergy, &evalenergy_tmp6);
}
/*
else if (ls7_done == false) {
*/
else if (ls7_done != 0) {
/*
evalenergy_tmp7 = read_channel_nb_altera(chan_LS2GA_LS7_evalenergy, &ls7_done);
*/
ls7_done = read_pipe(chan_LS2GA_LS7_evalenergy, &evalenergy_tmp7);
}
/*
else if (ls8_done == false) {
*/
else if (ls8_done != 0) {
/*
evalenergy_tmp8 = read_channel_nb_altera(chan_LS2GA_LS8_evalenergy, &ls8_done);
*/
ls8_done = read_pipe(chan_LS2GA_LS8_evalenergy, &evalenergy_tmp8);
}
/*
else if (ls9_done == false) {
*/
else if (ls9_done != 0) {
/*
evalenergy_tmp9 = read_channel_nb_altera(chan_LS2GA_LS9_evalenergy, &ls9_done);
*/
......
......@@ -28,6 +28,7 @@ void Krnl_IGL_Arbiter(/*unsigned char DockConst_num_of_genes*/) {
*/
while(active) {
/*
bool Off_valid = false;
bool IC_valid = false;
bool GG_valid = false;
......@@ -40,6 +41,19 @@ while(active) {
bool LS7_end_valid = false;
bool LS8_end_valid = false;
bool LS9_end_valid = false;
*/
int Off_valid = 1;
int IC_valid = 1;
int GG_valid = 1;
int LS1_end_valid = 1;
int LS2_end_valid = 1;
int LS3_end_valid = 1;
int LS4_end_valid = 1;
int LS5_end_valid = 1;
int LS6_end_valid = 1;
int LS7_end_valid = 1;
int LS8_end_valid = 1;
int LS9_end_valid = 1;
bool Off_active;
bool IC_active;
......@@ -54,6 +68,7 @@ while(active) {
bool LS8_end_active;
bool LS9_end_active;
/*
while (
(Off_valid == false) &&
(IC_valid == false) &&
......@@ -67,6 +82,20 @@ while(active) {
(LS7_end_valid == false) &&
(LS8_end_valid == false) &&
(LS9_end_valid == false)
*/
while (
(Off_valid != 0) &&
(IC_valid != 0) &&
(GG_valid != 0) &&
(LS1_end_valid != 0) &&
(LS2_end_valid != 0) &&
(LS3_end_valid != 0) &&
(LS4_end_valid != 0) &&
(LS5_end_valid != 0) &&
(LS6_end_valid != 0) &&
(LS7_end_valid != 0) &&
(LS8_end_valid != 0) &&
(LS9_end_valid != 0)
){
/*
Off_active = read_channel_nb_altera(chan_IGLArbiter_Off, &Off_valid);
......@@ -97,7 +126,11 @@ while(active) {
}
uchar bound_tmp = 0;
/*
active = Off_valid ? 0x00 : 0x01;
*/
active = (Off_valid == 0)? 0x00 : 0x01;
char mode [9]; // mode for all LS
// Determine "mode" value
......@@ -1322,8 +1355,11 @@ while(active) {
// Send "mode" to Conform
for (uchar j=0; j<bound; j++) {
/*
char mode_tmp = Off_valid? 0x00: IC_valid? 'I': GG_valid? 'G': mode[j];
*/
char mode_tmp = (Off_valid == 0)? 0x00: (IC_valid == 0)? 'I': (GG_valid == 0)? 'G': mode[j];
char2 actmode = {active, mode_tmp};
/*
write_channel_altera(chan_IGL2Conform_actmode, actmode);
......
......@@ -26,12 +26,21 @@ void Krnl_LS(
while(valid) {
bool active;
/*
bool valid_active= false;
*/
int valid_active= 1;
float current_energy;
/*
bool valid_energy = false;
*/
int valid_energy = 1;
/*
while( (valid_active == false) && (valid_energy == false)) {
*/
while( (valid_active != 0) && (valid_energy != 0)) {
/*
active = read_channel_nb_altera(chan_GA2LS_Off1_active, &valid_active);
current_energy = read_channel_nb_altera(chan_GA2LS_LS1_energy, &valid_energy);
......@@ -39,7 +48,10 @@ while(valid) {
valid_active = read_pipe(chan_GA2LS_Off1_active, &active);
valid_energy = read_pipe(chan_GA2LS_LS1_energy, &current_energy);
}
/*
valid = active || valid_energy;
*/
valid = active || (valid_energy == 0);
if (valid) {
......@@ -227,16 +239,30 @@ while(valid) {
float energyIA_LS_rx;
float energyIE_LS_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_LS_rx = read_channel_nb_altera(chan_Intrae2StoreLS_LS1_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreLS_LS1_intrae, &energyIA_LS_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
/*
energyIE_LS_rx = read_channel_nb_altera(chan_Intere2StoreLS_LS1_intere, &inter_valid);
*/
......
......@@ -25,12 +25,20 @@ void Krnl_LS2(
while(valid) {
bool active;
/*
bool valid_active = false;
*/
int valid_active= 1;
float current_energy;
/*
bool valid_energy = false;
*/
int valid_energy = 1;
/*
while( (valid_active == false) && (valid_energy == false)) {
*/
while( (valid_active != 0) && (valid_energy != 0)) {
/*
active = read_channel_nb_altera(chan_GA2LS_Off2_active, &valid_active);
current_energy = read_channel_nb_altera(chan_GA2LS_LS2_energy, &valid_energy);
......@@ -38,7 +46,10 @@ while(valid) {
valid_active = read_pipe(chan_GA2LS_Off2_active, &active);
valid_energy = read_pipe(chan_GA2LS_LS2_energy, &current_energy);
}
/*
valid = active || valid_energy;
*/
valid = active || (valid_energy == 0);
if (valid) {
......@@ -230,16 +241,30 @@ while(valid) {
float energyIA_LS_rx;
float energyIE_LS_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_LS_rx = read_channel_nb_altera(chan_Intrae2StoreLS_LS2_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreLS_LS2_intrae, &energyIA_LS_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
/*
energyIE_LS_rx = read_channel_nb_altera(chan_Intere2StoreLS_LS2_intere, &inter_valid);
*/
......
......@@ -25,12 +25,21 @@ void Krnl_LS3(
while(valid) {
bool active;
/*
bool valid_active = false;
*/
int valid_active= 1;
float current_energy;
/*
bool valid_energy = false;
*/
int valid_energy = 1;
/*
while( (valid_active == false) && (valid_energy == false)) {
*/
while( (valid_active != 0) && (valid_energy != 0)) {
/*
active = read_channel_nb_altera(chan_GA2LS_Off3_active, &valid_active);
current_energy = read_channel_nb_altera(chan_GA2LS_LS3_energy, &valid_energy);
......@@ -38,7 +47,10 @@ while(valid) {
valid_active = read_pipe(chan_GA2LS_Off3_active, &active);
valid_energy = read_pipe(chan_GA2LS_LS3_energy, &current_energy);
}
/*
valid = active || valid_energy;
*/
valid = active || (valid_energy == 0);
if (valid) {
......@@ -230,16 +242,30 @@ while(valid) {
float energyIA_LS_rx;
float energyIE_LS_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_LS_rx = read_channel_nb_altera(chan_Intrae2StoreLS_LS3_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreLS_LS3_intrae, &energyIA_LS_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
/*
energyIE_LS_rx = read_channel_nb_altera(chan_Intere2StoreLS_LS3_intere, &inter_valid);
*/
......
......@@ -25,12 +25,21 @@ void Krnl_LS4(
while(valid) {
bool active;
/*
bool valid_active = false;
*/
int valid_active= 1;
float current_energy;
/*
bool valid_energy = false;
*/
int valid_energy = 1;
/*
while( (valid_active == false) && (valid_energy == false)) {
*/
while( (valid_active != 0) && (valid_energy != 0)) {
/*
active = read_channel_nb_altera(chan_GA2LS_Off4_active, &valid_active);
current_energy = read_channel_nb_altera(chan_GA2LS_LS4_energy, &valid_energy);
......@@ -38,7 +47,10 @@ while(valid) {
valid_active = read_pipe(chan_GA2LS_Off4_active, &active);
valid_energy = read_pipe(chan_GA2LS_LS4_energy, &current_energy);
}
/*
valid = active || valid_energy;
*/
valid = active || (valid_energy == 0);
if (valid) {
......@@ -230,16 +242,30 @@ while(valid) {
float energyIA_LS_rx;
float energyIE_LS_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_LS_rx = read_channel_nb_altera(chan_Intrae2StoreLS_LS4_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreLS_LS4_intrae, &energyIA_LS_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
inter_valid = read_pipe(chan_Intere2StoreLS_LS4_intere, &energyIE_LS_rx);
}
}
......
......@@ -25,12 +25,21 @@ void Krnl_LS5(
while(valid) {
bool active;
/*
bool valid_active = false;
*/
int valid_active= 1;
float current_energy;
/*
bool valid_energy = false;
*/
int valid_energy = 1;
/*
while( (valid_active == false) && (valid_energy == false)) {
*/
while( (valid_active != 0) && (valid_energy != 0)) {
/*
active = read_channel_nb_altera(chan_GA2LS_Off5_active, &valid_active);
current_energy = read_channel_nb_altera(chan_GA2LS_LS5_energy, &valid_energy);
......@@ -38,7 +47,10 @@ while(valid) {
valid_active = read_pipe(chan_GA2LS_Off5_active, &active);
valid_energy = read_pipe(chan_GA2LS_LS5_energy, &current_energy);
}
/*
valid = active || valid_energy;
*/
valid = active || (valid_energy == 0);
if (valid) {
......@@ -231,16 +243,30 @@ while(valid) {
float energyIA_LS_rx;
float energyIE_LS_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;
/*
while( (intra_valid == false) || (inter_valid == false)) {
*/
while( (intra_valid != 0) || (inter_valid != 0)) {
/*
if (intra_valid == false) {
*/
if (intra_valid != 0) {
/*
energyIA_LS_rx = read_channel_nb_altera(chan_Intrae2StoreLS_LS5_intrae, &intra_valid);
*/
intra_valid = read_pipe(chan_Intrae2StoreLS_LS5_intrae, &energyIA_LS_rx);
}
/*
else if (inter_valid == false) {
*/
else if (inter_valid != 0) {
/*
energyIE_LS_rx = read_channel_nb_altera(chan_Intere2StoreLS_LS5_intere, &inter_valid);
*/
......
......@@ -25,12 +25,21 @@ void Krnl_LS6(
while(valid) {
bool active;
/*
bool valid_active = false;
*/
int valid_active= 1;
float current_energy;
/*
bool valid_energy = false;
*/
int valid_energy = 1;
/*
while( (valid_active == false) && (valid_energy == false)) {
*/
while( (valid_active != 0) && (valid_energy != 0)) {
/*
active = read_channel_nb_altera(chan_GA2LS_Off6_active, &valid_active);
current_energy = read_channel_nb_altera(chan_GA2LS_LS6_energy, &valid_energy);
......@@ -38,7 +47,10 @@ while(valid) {
valid_active = read_pipe(chan_GA2LS_Off6_active, &active);
valid_energy = read_pipe(chan_GA2LS_LS6_energy, &current_energy);
}
/*
valid = active || valid_energy;
*/
valid = active || (valid_energy == 0);
if (valid) {
......@@ -229,16 +241,30 @@ while(valid) {
float energyIA_LS_rx;
float energyIE_LS_rx;
/*
bool intra_valid = false;
bool inter_valid = false;
*/
int intra_valid = 1;
int inter_valid = 1;