Skip to content

Commit

Permalink
Fix gcc compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukáš Plevač committed Apr 26, 2022
1 parent 6e93f4f commit ffd8b8e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
23 changes: 14 additions & 9 deletions include/simulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@

//macro for set variant to vector by variant index
#define SET_VARIANTS_BITS(VEC, X) { \
if (X == 0) VEC = VARIANTS_BITS_A; \
else if (X == 1) VEC = VARIANTS_BITS_B; \
else if (X == 2) VEC = VARIANTS_BITS_C; \
else if (X == 3) VEC = VARIANTS_BITS_D; \
else if (X == 4) VEC = VARIANTS_BITS_E; \
else if (X == 5) VEC = VARIANTS_BITS_F; \
else if (X == 6) VEC = VARIANTS_BITS_G; \
else if (X == 7) VEC = VARIANTS_BITS_H; \
else VEC = VARIANTS_BITS_ALL0; \
if (X == 0) SET_VECTOR_TO(VEC, VARIANTS_BITS_A) \
else if (X == 1) SET_VECTOR_TO(VEC, VARIANTS_BITS_B) \
else if (X == 2) SET_VECTOR_TO(VEC, VARIANTS_BITS_C) \
else if (X == 3) SET_VECTOR_TO(VEC, VARIANTS_BITS_D) \
else if (X == 4) SET_VECTOR_TO(VEC, VARIANTS_BITS_E) \
else if (X == 5) SET_VECTOR_TO(VEC, VARIANTS_BITS_F) \
else if (X == 6) SET_VECTOR_TO(VEC, VARIANTS_BITS_G) \
else if (X == 7) SET_VECTOR_TO(VEC, VARIANTS_BITS_H) \
else SET_VECTOR_TO(VEC, VARIANTS_BITS_ALL0) \
}

#define SET_VECTOR_TO(VEC, X) { \
simulation::io_vector_t tmp = X; \
VEC = tmp;\
}

#include <inttypes.h>
Expand Down
5 changes: 0 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,6 @@ struct cgploss : public Pass {
param_l_back = stoi(parsed);
}

if (param_parrents_count < 0) {
log("[ERROR] Bad value for l-back, min value is 0. using 0\n");
param_l_back = 0;
}

} else {
if (param != "cgploss") {
log("[WARNING] ignorig argument %s\n", param.c_str());
Expand Down
4 changes: 2 additions & 2 deletions tests/combinations-generate-unit/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PRIVATE_NAMESPACE_BEGIN
void assert(std::string name, simulation::io_t output, unsigned pos, bool inverted = false) {
simulation::io_t ref;

SET_VARIANTS_BITS(ref, pos);
SET_VARIANTS_BITS(ref.vec, pos);

if (inverted) {
ref.vec = ~ref.vec;
Expand Down Expand Up @@ -74,7 +74,7 @@ struct cgploss : public Pass {
log("I%d - %d - ", j, variant_counter[j]);

for (unsigned h = 0; h < SIM_BYTES_COUNT; h++) {
log("%x", test_circuic[j].byte[h]);
log("%02x", test_circuic[j].byte[h]);
}

log("\n");
Expand Down

0 comments on commit ffd8b8e

Please sign in to comment.