mirror of https://github.com/YosysHQ/yosys.git
dfflibmap: fix resetval clobber
This commit is contained in:
parent
22c15a7ecd
commit
332ea782eb
|
|
@ -272,17 +272,18 @@ static void find_cell(std::vector<const LibertyAst *> cells, IdString cell_type,
|
||||||
if (!parse_next_state(cell, ff->find("next_state"), cell_next_pin, cell_next_pol, cell_enable_pin, cell_enable_pol) || (has_enable && (cell_enable_pin.empty() || cell_enable_pol != enapol)))
|
if (!parse_next_state(cell, ff->find("next_state"), cell_next_pin, cell_next_pol, cell_enable_pin, cell_enable_pol) || (has_enable && (cell_enable_pin.empty() || cell_enable_pol != enapol)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
bool cell_rstval = rstval;
|
||||||
if (has_reset && !cell_next_pol) {
|
if (has_reset && !cell_next_pol) {
|
||||||
// next_state is negated
|
// next_state is negated
|
||||||
// we later propagate this inversion to the output,
|
// we later propagate this inversion to the output,
|
||||||
// which requires the negation of the reset value
|
// which requires the negation of the reset value
|
||||||
rstval = !rstval;
|
cell_rstval = !rstval;
|
||||||
}
|
}
|
||||||
if (has_reset && rstval == false) {
|
if (has_reset && cell_rstval == false) {
|
||||||
if (!parse_pin(cell, ff->find("clear"), cell_rst_pin, cell_rst_pol) || cell_rst_pol != rstpol)
|
if (!parse_pin(cell, ff->find("clear"), cell_rst_pin, cell_rst_pol) || cell_rst_pol != rstpol)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (has_reset && rstval == true) {
|
if (has_reset && cell_rstval == true) {
|
||||||
if (!parse_pin(cell, ff->find("preset"), cell_rst_pin, cell_rst_pol) || cell_rst_pol != rstpol)
|
if (!parse_pin(cell, ff->find("preset"), cell_rst_pin, cell_rst_pol) || cell_rst_pol != rstpol)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue