Commit 82421a31 authored by Leonardo Solis's avatar Leonardo Solis
Browse files

removed LS and other unused-kernel comments


Former-commit-id: f41782eb
parent 109f17db
......@@ -145,97 +145,11 @@ ENABLE_K2 = YES
ENABLE_K3 = YES
ENABLE_K4 = YES
# Prng kernels
# bt prng float
ENABLE_K5 = NO
ENABLE_K6 = YES
ENABLE_K7 = NO
# bt prng ushort (check kernel36)
ENABLE_K8 = NO
# ls1 prng
ENABLE_K9 = NO
ENABLE_K10 = YES
# Replace single Krnl_Prng_Arbiter
# See kernels 31, 32, 33, 34
ENABLE_K11 = NO
# LS kernels
ENABLE_K12 = NO
# disable Krnl_LS_Arbiter
ENABLE_K13 = NO
ENABLE_K14 = NO
ENABLE_K15 = NO
# disable Krnl_LS2_Arbiter
ENABLE_K16 = NO
#ENABLE_K17 = YES
#ENABLE_K18 = YES
#ENABLE_K19 = YES
ENABLE_K20 = NO
ENABLE_K21 = NO
# disable Krnl_LS3_Arbiter
ENABLE_K22 = NO
#ENABLE_K23 = YES
#ENABLE_K24 = YES
# PRNGS in GA for LS2 and LS3
# ls2 & ls3 prng (ls1 is K9)
# replacement is K35
ENABLE_K25 = NO
ENABLE_K26 = NO
ENABLE_K27 = YES
# IA Pipeline
ENABLE_K28 = NO
ENABLE_K29 = NO
ENABLE_K30 = NO
# BT, GG, LS_ushort, LS_float arbiters
ENABLE_K31 = NO
ENABLE_K32 = NO
ENABLE_K33 = NO
ENABLE_K34 = NO
# ls123 prng
ENABLE_K35 = NO
# bt ushort_float
ENABLE_K36 = YES
# prng ls4, ls5
ENABLE_K37 = NO
ENABLE_K38 = NO
# krnl_ls4, Krnl_ls5
ENABLE_K39 = NO
ENABLE_K40 = NO
# prng ls6, ls7, ls8, ls9
ENABLE_K41 = NO
ENABLE_K42 = NO
ENABLE_K43 = NO
ENABLE_K44 = NO
# krnl_ls6, Krnl_ls7, krnl_ls8, Krnl_ls9
ENABLE_K45 = NO
ENABLE_K46 = NO
ENABLE_K47 = NO
ENABLE_K48 = NO
ifeq ($(ENABLE_K1),YES)
K1 =-DENABLE_KERNEL1
else
......@@ -260,286 +174,31 @@ else
K4 =
endif
ifeq ($(ENABLE_K5),YES)
K5 =-DENABLE_KERNEL5
else
K5 =
endif
ifeq ($(ENABLE_K6),YES)
K6 =-DENABLE_KERNEL6
else
K6 =
endif
ifeq ($(ENABLE_K7),YES)
K7 =-DENABLE_KERNEL7
else
K7 =
endif
ifeq ($(ENABLE_K8),YES)
K8 =-DENABLE_KERNEL8
else
K8 =
endif
ifeq ($(ENABLE_K9),YES)
K9 =-DENABLE_KERNEL9
else
K9 =
endif
ifeq ($(ENABLE_K10),YES)
K10 =-DENABLE_KERNEL10
else
K10 =
endif
ifeq ($(ENABLE_K11),YES)
K11 =-DENABLE_KERNEL11
else
K11 =
endif
ifeq ($(ENABLE_K12),YES)
K12 =-DENABLE_KERNEL12
else
K12 =
endif
ifeq ($(ENABLE_K13),YES)
K13 =-DENABLE_KERNEL13
else
K13 =
endif
ifeq ($(ENABLE_K14),YES)
K14 =-DENABLE_KERNEL14
else
K14 =
endif
ifeq ($(ENABLE_K15),YES)
K15 =-DENABLE_KERNEL15
else
K15 =
endif
ifeq ($(ENABLE_K16),YES)
K16 =-DENABLE_KERNEL16
else
K16 =
endif
ifeq ($(ENABLE_K17),YES)
K17 =-DENABLE_KERNEL17
else
K17 =
endif
ifeq ($(ENABLE_K18),YES)
K18 =-DENABLE_KERNEL18
else
K18 =
endif
ifeq ($(ENABLE_K19),YES)
K19 =-DENABLE_KERNEL19
else
K19 =
endif
ifeq ($(ENABLE_K20),YES)
K20 =-DENABLE_KERNEL20
else
K20 =
endif
ifeq ($(ENABLE_K21),YES)
K21 =-DENABLE_KERNEL21
else
K21 =
endif
ifeq ($(ENABLE_K22),YES)
K22 =-DENABLE_KERNEL22
else
K22 =
endif
ifeq ($(ENABLE_K23),YES)
K23 =-DENABLE_KERNEL23
else
K23 =
endif
ifeq ($(ENABLE_K24),YES)
K24 =-DENABLE_KERNEL24
else
K24 =
endif
ifeq ($(ENABLE_K25),YES)
K25 =-DENABLE_KERNEL25
else
K25 =
endif
ifeq ($(ENABLE_K26),YES)
K26 =-DENABLE_KERNEL26
else
K26 =
endif
ifeq ($(ENABLE_K27),YES)
K27 =-DENABLE_KERNEL27
else
K27 =
endif
ifeq ($(ENABLE_K28),YES)
K28 =-DENABLE_KERNEL28
else
K28 =
endif
ifeq ($(ENABLE_K29),YES)
K29 =-DENABLE_KERNEL29
else
K29 =
endif
ifeq ($(ENABLE_K30),YES)
K30 =-DENABLE_KERNEL30
else
K30 =
endif
ifeq ($(ENABLE_K31),YES)
K31 =-DENABLE_KERNEL31
else
K31 =
endif
ifeq ($(ENABLE_K32),YES)
K32 =-DENABLE_KERNEL32
else
K32 =
endif
ifeq ($(ENABLE_K33),YES)
K33 =-DENABLE_KERNEL33
else
K33 =
endif
ifeq ($(ENABLE_K34),YES)
K34 =-DENABLE_KERNEL34
else
K34 =
endif
ifeq ($(ENABLE_K35),YES)
K35 =-DENABLE_KERNEL35
else
K35 =
endif
ifeq ($(ENABLE_K36),YES)
K36 =-DENABLE_KERNEL36
else
K36 =
endif
ifeq ($(ENABLE_K37),YES)
K37 =-DENABLE_KERNEL37
else
K37 =
endif
ifeq ($(ENABLE_K38),YES)
K38 =-DENABLE_KERNEL38
else
K38 =
endif
ifeq ($(ENABLE_K39),YES)
K39 =-DENABLE_KERNEL39
else
K39 =
endif
ifeq ($(ENABLE_K40),YES)
K40 =-DENABLE_KERNEL40
else
K40 =
endif
ifeq ($(ENABLE_K41),YES)
K41 =-DENABLE_KERNEL41
else
K41 =
endif
ifeq ($(ENABLE_K42),YES)
K42 =-DENABLE_KERNEL42
else
K42 =
endif
ifeq ($(ENABLE_K43),YES)
K43 =-DENABLE_KERNEL43
else
K43 =
endif
ifeq ($(ENABLE_K44),YES)
K44 =-DENABLE_KERNEL44
else
K44 =
endif
ifeq ($(ENABLE_K45),YES)
K45 =-DENABLE_KERNEL45
else
K45 =
endif
ifeq ($(ENABLE_K46),YES)
K46 =-DENABLE_KERNEL46
else
K46 =
endif
ifeq ($(ENABLE_K47),YES)
K47 =-DENABLE_KERNEL47
else
K47 =
endif
ifeq ($(ENABLE_K48),YES)
K48 =-DENABLE_KERNEL48
else
K48 =
endif
ENABLE_KERNELS = $(K1) $(K2) $(K3) $(K4) $(K5) $(K6) $(K7) $(K8) $(K9) $(K10) \
$(K11) $(K12) $(K13) $(K14) $(K15) $(K16) $(K17) $(K18) $(K19) $(K20) \
$(K21) $(K22) $(K23) $(K24) $(K25) $(K26) $(K27) $(K28) $(K29) $(K30) \
$(K31) $(K32) $(K33) $(K34) $(K35) $(K36) $(K37) $(K38) $(K39) $(K40) \
$(K41) $(K42) $(K43) $(K44) $(K45) $(K46) $(K47) $(K48)
ENABLE_KERNELS = $(K1) $(K2) $(K3) $(K4) $(K6) $(K10) $(K27) $(K36)
# =============================
# Reproduce result (remove randomness)
......@@ -557,32 +216,10 @@ endif
# =============================
# FIxed-POint COform flag (FIPOCO)
FIXED_POINT_CONFORM=YES
#FIXED_POINT_CONFORM=NO
FIXED_POINT_INTERE=NO
FIXED_POINT_INTRAE=NO
#FIXED_POINT_LS1=YES
#FIXED_POINT_LS2=YES
#FIXED_POINT_LS3=YES
#FIXED_POINT_LS4=YES
#FIXED_POINT_LS5=YES
#FIXED_POINT_LS6=YES
#FIXED_POINT_LS7=YES
#FIXED_POINT_LS8=YES
#FIXED_POINT_LS9=YES
#FIXED_POINT_LS1=NO
#FIXED_POINT_LS2=NO
#FIXED_POINT_LS3=NO
#FIXED_POINT_LS4=NO
#FIXED_POINT_LS5=NO
#FIXED_POINT_LS6=NO
#FIXED_POINT_LS7=NO
#FIXED_POINT_LS8=NO
#FIXED_POINT_LS9=NO
SINGLE_COPY_POP_ENE=YES
SEPARATE_FGRID_INTERE=NO
ifeq ($(FIXED_POINT_CONFORM), YES)
......@@ -603,64 +240,6 @@ else
FIPOIA_FLAG=
endif
ifeq ($(FIXED_POINT_LS1), YES)
FIPOLS1_FLAG=-DFIXED_POINT_LS1
else
FIPOLS1_FLAG=
endif
ifeq ($(FIXED_POINT_LS2), YES)
FIPOLS2_FLAG=-DFIXED_POINT_LS2
else
FIPOLS2_FLAG=
endif
ifeq ($(FIXED_POINT_LS3), YES)
FIPOLS3_FLAG=-DFIXED_POINT_LS3
else
FIPOLS3_FLAG=
endif
ifeq ($(FIXED_POINT_LS4), YES)
FIPOLS4_FLAG=-DFIXED_POINT_LS4
else
FIPOLS4_FLAG=
endif
ifeq ($(FIXED_POINT_LS5), YES)
FIPOLS5_FLAG=-DFIXED_POINT_LS5
else
FIPOLS5_FLAG=
endif
ifeq ($(FIXED_POINT_LS6), YES)
FIPOLS6_FLAG=-DFIXED_POINT_LS6
else
FIPOLS6_FLAG=
endif
ifeq ($(FIXED_POINT_LS7), YES)
FIPOLS7_FLAG=-DFIXED_POINT_LS7
else
FIPOLS7_FLAG=
endif
ifeq ($(FIXED_POINT_LS8), YES)
FIPOLS8_FLAG=-DFIXED_POINT_LS8
else
FIPOLS8_FLAG=
endif
ifeq ($(FIXED_POINT_LS9), YES)
FIPOLS9_FLAG=-DFIXED_POINT_LS9
else
FIPOLS9_FLAG=
endif
ifeq ($(SINGLE_COPY_POP_ENE), YES)
COPYPOPENE_FLAG=-DSINGLE_COPY_POP_ENE
else
......@@ -673,17 +252,7 @@ else
SEP_FGRID_FLAG=
endif
FIPO_FLAG = $(FIPOCO_FLAG) \
$(FIPOIE_FLAG) $(FIPOIA_FLAG) \
$(FIPOLS1_FLAG) \
$(FIPOLS2_FLAG) \
$(FIPOLS3_FLAG) \
$(FIPOLS4_FLAG) \
$(FIPOLS5_FLAG) \
$(FIPOLS6_FLAG) \
$(FIPOLS7_FLAG) \
$(FIPOLS8_FLAG) \
$(FIPOLS9_FLAG) \
FIPO_FLAG = $(FIPOCO_FLAG) $(FIPOIE_FLAG) $(FIPOIA_FLAG) \
$(COPYPOPENE_FLAG) $(SEP_FGRID_FLAG)
# =============================
......
......@@ -113,414 +113,4 @@ void Krnl_Prng_GG_float(unsigned int Host_seed,
}
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#if 0
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_Prng_LS123_ushort(unsigned int Host_seed1,
unsigned int Host_seed2,
unsigned int Host_seed3,
unsigned int Host_seed4,
unsigned int Host_seed5,
unsigned int Host_seed6,
unsigned int Host_seed7,
unsigned int Host_seed8,
unsigned int Host_seed9,
unsigned int DockConst_pop_size){
uint lfsr[9];
lfsr[0] = Host_seed1;
lfsr[1] = Host_seed2;
lfsr[2] = Host_seed3;
lfsr[3] = Host_seed4;
lfsr[4] = Host_seed5;
lfsr[5] = Host_seed6;
lfsr[6] = Host_seed7;
lfsr[7] = Host_seed8;
lfsr[8] = Host_seed9;
bool valid = false;
while(!valid) {
bool active = true;
active = read_channel_nb_altera(chan_Arbiter_LS123_ushort_off, &valid);
ushort tmp[9];
#pragma unroll
for (uint i=0; i<9; i++){
uchar lsb[9];
lsb [i] = lfsr[i] & 0x01u;
lfsr[i] >>= 1;
lfsr[i] ^= (-lsb[i]) & 0xA3000000u;
tmp [i] = (DockConst_pop_size/MAX_UINT)*lfsr[i];
}
// To avoid having same entities undergoing LS simultaneously
if (
(tmp[0] == tmp[1]) || (tmp[0] == tmp[2]) || (tmp[0] == tmp[3]) || (tmp[0] == tmp[4]) || (tmp[0] == tmp[5]) || (tmp[0] == tmp[6]) || (tmp[0] == tmp[7]) || (tmp[0] == tmp[8]) ||
(tmp[1] == tmp[2]) || (tmp[1] == tmp[3]) || (tmp[1] == tmp[4]) || (tmp[1] == tmp[5]) || (tmp[1] == tmp[6]) || (tmp[1] == tmp[7]) || (tmp[1] == tmp[8]) ||
(tmp[2] == tmp[3]) || (tmp[2] == tmp[4]) || (tmp[2] == tmp[5]) || (tmp[2] == tmp[6]) || (tmp[2] == tmp[7]) || (tmp[2] == tmp[8]) ||
(tmp[3] == tmp[4]) || (tmp[3] == tmp[5]) || (tmp[3] == tmp[6]) || (tmp[3] == tmp[7]) || (tmp[3] == tmp[8]) ||
(tmp[4] == tmp[5]) || (tmp[4] == tmp[6]) || (tmp[4] == tmp[7]) || (tmp[4] == tmp[8]) ||
(tmp[5] == tmp[6]) || (tmp[5] == tmp[7]) || (tmp[5] == tmp[8]) ||
(tmp[6] == tmp[7]) || (tmp[6] == tmp[8]) ||
(tmp[7] == tmp[8])
) {
tmp[1] = tmp[0] + 1;
tmp[2] = tmp[1] + 2;
tmp[3] = tmp[2] + 3;
tmp[4] = tmp[3] + 4;
tmp[5] = tmp[4] + 5;
tmp[6] = tmp[5] + 6;
tmp[7] = tmp[6] + 7;
tmp[8] = tmp[7] + 8;
}
bool success = false;
ushort16 tmp123;
tmp123.s0 = tmp[0];
tmp123.s1 = tmp[1];
tmp123.s2 = tmp[2];
tmp123.s3 = tmp[3];
tmp123.s4 = tmp[4];
tmp123.s5 = tmp[5];
tmp123.s6 = tmp[6];
tmp123.s7 = tmp[7];
tmp123.s8 = tmp[8];
if(!valid) {
success = write_channel_nb_altera(chan_PRNG2GA_LS123_ushort_prng, tmp123);
}
} // End of while(active)
}
#endif
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
#if 0
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_Prng_LS_float(unsigned int Host_seed,
unsigned char DockConst_num_of_genes){
uint lfsr = Host_seed;
bool valid = false;
while(!valid) {
bool active = true;
active = read_channel_nb_altera(chan_Arbiter_LS_float_off, &valid);
for(uchar i=0; i<DockConst_num_of_genes; i++) {
float tmp;
uchar lsb;
lsb = lfsr & 0x01u;
lfsr >>= 1;
lfsr ^= (-lsb) & 0xA3000000u;
tmp = (0.999999f/MAX_UINT)*lfsr;
bool success = false;
#if defined (FIXED_POINT_LS1)
fixedpt fixpt_tmp = fixedpt_fromfloat(tmp);
if(!valid) {
success = write_channel_nb_altera(chan_PRNG2GA_LS_float_prng, *(float*) &fixpt_tmp);
}
#else
if(!valid) {
success = write_channel_nb_altera(chan_PRNG2GA_LS_float_prng, tmp);
}
#endif
}
} // End of while(active)
}
#endif
#if 0
__kernel __attribute__ ((max_global_work_dim(0)))
void Krnl_Prng_LS2_float(unsigned int Host_seed,
unsigned char DockConst_num_of_genes){
uint lfsr = Host_seed;
bool valid = false;
while(!valid) {
bool active = true;
active = read_channel_nb_altera(chan_Arbiter_LS2_float_off, &valid);