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

Fixes for reverting SigSpec helper functions

This commit is contained in:
Eddie Hung 2019-08-14 10:22:33 -07:00
parent 2f04beeeb5
commit aad97168b0
2 changed files with 14 additions and 10 deletions

View file

@ -155,9 +155,9 @@ void create_ice40_dsp(ice40_dsp_pm &pm)
// If we have a signed multiply-add, then perform sign extension // If we have a signed multiply-add, then perform sign extension
// TODO: Need to check CD[31:16] is sign extension of CD[15:0]? // TODO: Need to check CD[31:16] is sign extension of CD[15:0]?
if (st.addAB->getParam("\\A_SIGNED").as_bool() && st.addAB->getParam("\\B_SIGNED").as_bool()) if (st.addAB->getParam("\\A_SIGNED").as_bool() && st.addAB->getParam("\\B_SIGNED").as_bool())
pm.module->connect(O[-1], O[-2]); pm.module->connect(O[32], O[31]);
else else
cell->setPort("\\CO", O[-1]); cell->setPort("\\CO", O[32]);
O.remove(O_width-1); O.remove(O_width-1);
} }
else else

View file

@ -206,10 +206,12 @@ match ffO_lo
endmatch endmatch
code code
SigSpec O = sigOused.extract(0,std::min(16,param(ffO_lo, \WIDTH).as_int())); if (ffO_lo) {
O.remove_const(); SigSpec O = sigOused.extract(0,std::min(16,param(ffO_lo, \WIDTH).as_int()));
if (!includes(port(ffO_lo, \D).to_sigbit_set(), O.to_sigbit_set())) O.remove_const();
reject; if (!includes(port(ffO_lo, \D).to_sigbit_set(), O.to_sigbit_set()))
reject;
}
endcode endcode
match ffO_hi match ffO_hi
@ -220,10 +222,12 @@ match ffO_hi
endmatch endmatch
code code
SigSpec O = sigOused.extract_end(16); if (ffO_hi) {
O.remove_const(); SigSpec O = sigOused.extract_end(16);
if (!includes(port(ffO_hi, \D).to_sigbit_set(), O.to_sigbit_set())) O.remove_const();
reject; if (!includes(port(ffO_hi, \D).to_sigbit_set(), O.to_sigbit_set()))
reject;
}
endcode endcode
code clock clock_pol sigO sigCD code clock clock_pol sigO sigCD