Fix compile error
authorEddie Hung <eddie@fpgeh.com>
Wed, 7 Aug 2019 21:31:55 +0000 (14:31 -0700)
committerEddie Hung <eddie@fpgeh.com>
Wed, 7 Aug 2019 21:31:55 +0000 (14:31 -0700)
passes/pmgen/ice40_dsp.cc

index 5e87d6497530a6371c77dc303d07b5143a23c165..45d7a34dfa7c7f848c12232c744150f79661c4c6 100644 (file)
@@ -224,11 +224,11 @@ void create_ice40_dsp(ice40_dsp_pm &pm)
        pm.autoremove(st.ffH);
        pm.autoremove(st.addAB);
        if (st.ffO_lo) {
-                       SigSpec O = st.sigO.extract(0,GetSize(st.ffO_lo));
+                       SigSpec O = st.sigO.extract(0,st.ffO_lo->getParam("\\WIDTH").as_int());
                        st.ffO_lo->connections_.at("\\Q").replace(O, pm.module->addWire(NEW_ID, GetSize(O)));
        }
        if (st.ffO_hi) {
-                       SigSpec O = st.sigO.extract(16,GetSize(st.ffo_hi));
+                       SigSpec O = st.sigO.extract(16,st.ffO_hi->getParam("\\WIDTH").as_int());
                        st.ffO_hi->connections_.at("\\Q").replace(O, pm.module->addWire(NEW_ID, GetSize(O)));
        }
 }