3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-20 12:53:39 +00:00

Merge pull request #2168 from whitequark/assert-unused-exprs

Use (and ignore) the expression provided to log_assert in NDEBUG builds
This commit is contained in:
clairexen 2020-06-25 18:21:51 +02:00 committed by GitHub
commit c7d71f436d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 46 additions and 43 deletions

View file

@ -741,7 +741,7 @@ void prep_xaiger(RTLIL::Module *module, bool dff)
if (ys_debug(1))
toposort.analyze_loops = true;
bool no_loops YS_ATTRIBUTE(unused) = toposort.sort();
bool no_loops = toposort.sort();
if (ys_debug(1)) {
unsigned i = 0;
@ -1453,7 +1453,7 @@ void reintegrate(RTLIL::Module *module, bool dff_mode)
for (auto driver_cell : bit_drivers.at(it.first))
for (auto user_cell : it.second)
toposort.edge(driver_cell, user_cell);
bool no_loops YS_ATTRIBUTE(unused) = toposort.sort();
bool no_loops = toposort.sort();
log_assert(no_loops);
for (auto ii = toposort.sorted.rbegin(); ii != toposort.sorted.rend(); ii++) {

View file

@ -409,11 +409,11 @@ static void map_sr_to_arst(IdString from, IdString to)
if (!cell_mappings.count(from) || cell_mappings.count(to) > 0)
return;
char from_clk_pol YS_ATTRIBUTE(unused) = from[8];
char from_clk_pol = from[8];
char from_set_pol = from[9];
char from_clr_pol = from[10];
char to_clk_pol YS_ATTRIBUTE(unused) = to[6];
char to_rst_pol YS_ATTRIBUTE(unused) = to[7];
char to_clk_pol = to[6];
char to_rst_pol = to[7];
char to_rst_val = to[8];
log_assert(from_clk_pol == to_clk_pol);
@ -455,9 +455,9 @@ static void map_adff_to_dff(IdString from, IdString to)
if (!cell_mappings.count(from) || cell_mappings.count(to) > 0)
return;
char from_clk_pol YS_ATTRIBUTE(unused) = from[6];
char from_clk_pol = from[6];
char from_rst_pol = from[7];
char to_clk_pol YS_ATTRIBUTE(unused) = to[6];
char to_clk_pol = to[6];
log_assert(from_clk_pol == to_clk_pol);