Commit b836941c authored by Leonardo Solis's avatar Leonardo Solis
Browse files

simplified IGL: handles only active&mode, but not data

parent d8a7ddab
......@@ -100,6 +100,8 @@ while(active) {
active = actmode.x;
mode = actmode.y;
//printf("Conform: %u\n", mode);
#if defined (FIXED_POINT_CONFORM)
fixedpt genotype [ACTUAL_GENOTYPE_LENGTH];
#else
......@@ -107,7 +109,36 @@ while(active) {
#endif
for (uchar i=0; i<DockConst_num_of_genes; i++) {
float fl_tmp = read_channel_altera(chan_IGL2Conform_genotype);
/*float fl_tmp = read_channel_altera(chan_IGL2Conform_genotype);*/
float fl_tmp;
switch (mode) {
case 'I':
fl_tmp = read_channel_altera(chan_IC2Conf_genotype);
break;
case 'G':
fl_tmp = read_channel_altera(chan_GG2Conf_genotype);
break;
case 0x01:
fl_tmp = read_channel_altera(chan_LS2Conf_LS1_genotype);
break;
case 0x02:
fl_tmp = read_channel_altera(chan_LS2Conf_LS2_genotype);
break;
case 0x03:
fl_tmp = read_channel_altera(chan_LS2Conf_LS3_genotype);
break;
}
if (i > 2) {
fl_tmp = fl_tmp * DEG_TO_RAD;
}
//printf("Conform: %u %u\n", mode, i);
#if defined (FIXED_POINT_CONFORM)
// convert float to fixedpt
fixedpt fx_tmp = fixedpt_fromfloat(fl_tmp);
......
......@@ -86,7 +86,7 @@ channel bool chan_GA2LS_Off3_active;
// IGL_Arbiter -> Conform
channel char2 chan_IGL2Conform_actmode __attribute__((depth(3))); // active, mode
channel float chan_IGL2Conform_genotype __attribute__((depth(3*CHAN_DEPTH_GENOTYPE )));
channel float chan_IGL2Conform_genotype __attribute__((depth(3*CHAN_DEPTH_GENOTYPE)));
channel bool chan_IGLArbiter_Off;
......
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_IGL_Arbiter(unsigned char DockConst_num_of_genes) {
void Krnl_IGL_Arbiter(/*unsigned char DockConst_num_of_genes*/) {
char active = 0x01;
......@@ -47,25 +47,37 @@ while(active) {
active = Off_valid ? 0x00 : 0x01;
char mode [3]; // mode for all LS
/*
float genotypeICGG [ACTUAL_GENOTYPE_LENGTH];
float genotype [3][ACTUAL_GENOTYPE_LENGTH];
*/
// get genotype from IC, GG, LS1, LS2, LS3
if (active == 0x01) {
//#pragma ivdep
/*
for (uchar i=0; i<DockConst_num_of_genes; i++) {
*/
if (IC_valid == true) {
bound_tmp++;
/*
if (i == 0) {bound_tmp++; }
genotypeICGG [i] = read_channel_altera(chan_IC2Conf_genotype);
*/
}
else if (GG_valid == true) {
bound_tmp++;
/*
if (i == 0) {bound_tmp++; }
genotypeICGG [i] = read_channel_altera(chan_GG2Conf_genotype);
*/
}
else{
/*
float genotype1;
float genotype2;
float genotype3;
*/
#if 0
if (LS1_end_valid == true) {
......@@ -74,55 +86,78 @@ while(active) {
genotype1 /*[i]*/ = read_channel_altera(chan_LS2Conf_LS1_genotype);
}
#endif
/*
if (LS2_end_valid == true) {
genotype2 = read_channel_altera(chan_LS2Conf_LS2_genotype);
}
if (LS3_end_valid == true) {
genotype3 = read_channel_altera(chan_LS2Conf_LS3_genotype);
}
*/
// Reorder the mode & genotype coming from LS
if (LS1_end_valid) {
if (LS1_end_valid) {
mode[0] = 0x01; bound_tmp++;
/*
genotype1 = read_channel_altera(chan_LS2Conf_LS1_genotype);
if (i == 0) {mode[0] = 0x01; bound_tmp++;}
genotype[0][i & MASK_GENOTYPE] = genotype1;
*/
if (LS2_end_valid) {
mode[1] = 0x02; bound_tmp++;
/*
if (i == 0) {mode[1] = 0x02; bound_tmp++;}
genotype[1][i & MASK_GENOTYPE] = genotype2;
*/
if (LS3_end_valid) {
mode[2] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[2] = 0x03; bound_tmp++;}
genotype[2][i & MASK_GENOTYPE] = genotype3;
*/
}
}
else {
if (LS3_end_valid) {
mode[1] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[1] = 0x03; bound_tmp++;}
genotype[1][i & MASK_GENOTYPE] = genotype3;
*/
}
}
}
else {
if (LS2_end_valid) {
mode[0] = 0x02; bound_tmp++;
/*
if (i == 0) {mode[0] = 0x02; bound_tmp++;}
genotype[0][i & MASK_GENOTYPE] = genotype2;
*/
if (LS3_end_valid) {
mode[1] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[1] = 0x03; bound_tmp++;}
genotype[1][i & MASK_GENOTYPE] = genotype3;
*/
}
}
else {
if (LS3_end_valid) {
mode[0] = 0x03; bound_tmp++;
/*
if (i == 0) {mode[0] = 0x03; bound_tmp++;}
genotype[0][i & MASK_GENOTYPE] = genotype3;
*/
}
}
}
}
/*
} // End of for-loop for (uchar i=0; i<DockConst_num_of_genes; i++) { }
*/
} // End if (active == true)
uchar bound = active ? bound_tmp : 1;
......@@ -138,11 +173,16 @@ while(active) {
char mode_tmp = Off_valid? 0x00: IC_valid? 'I': GG_valid? 'G': mode[j];
//printf("IGL: %u\n", mode_tmp);
char2 actmode = {active, mode_tmp};
write_channel_altera(chan_IGL2Conform_actmode, actmode);
/*
mem_fence(CLK_CHANNEL_MEM_FENCE);
*/
/*
for (uchar i=0; i<DockConst_num_of_genes; i++) {
float gene_tmp = (IC_valid || GG_valid)? genotypeICGG[i]: genotype[j][i & MASK_GENOTYPE];
......@@ -153,7 +193,7 @@ while(active) {
write_channel_altera(chan_IGL2Conform_genotype, gene_tmp);
}
*/
#if defined (DEBUG_KRNL_CONF_ARBITER)
printf("bound: %u, mode: %u\n", bound, mode_tmp);
#endif
......
......@@ -1060,7 +1060,9 @@ unsigned char Host_cons_limit = (unsigned char) dockpars.cons_limit;
#endif // End of ENABLE_KERNEL26
#ifdef ENABLE_KERNEL27 // Krnl_IGL_Arbiter
setKernelArg(kernel27,0, sizeof(unsigned char), &dockpars.num_of_genes);
/*
setKernelArg(kernel27,0, sizeof(unsigned char), &dockpars.num_of_genes);
*/
#endif // End of ENABLE_KERNEL27
#ifdef ENABLE_KERNEL28 //
......
......@@ -475,6 +475,23 @@ freq: 178 MHz (43 sec non-instrumented on 10runs 3ptb, 81 sec on 1stp)(instrumen
Same speedup as previous commit
>>> commit "reduced scope ls_eval_cnt"
159. `Krnl_IGL`, `Krnl_Conform`: rewrite IGL so it only controls the active and mode signals
and send it to Conform.
genotypes channels are directly connected to Conform using a mux whose
selector is the `mode` value received from IGL
IGL arg (DockConst_num_of_genes) is not needed and therefore removed.
freq: 175 MHz (instrumented freq: 183 MHz)(40 sec INSTRUMENTED on 10runs 3ptb, 77 sec on 1stp)
Non-instrumented hang on Sauron
Speedup vs i5 cpu core: 3ptb: 59/40 = 1.47x, 1stp: 84/77 = 1.09x
>>> commit "simplified IGL: handles only active&mode, but not data"
XXX, Between Conform and InterE, IntraE create a wider channel:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment