diff --git a/techlibs/gatemate/gatemate_foldinv.cc b/techlibs/gatemate/gatemate_foldinv.cc index 20fbbf8a3..752f8aac0 100644 --- a/techlibs/gatemate/gatemate_foldinv.cc +++ b/techlibs/gatemate/gatemate_foldinv.cc @@ -34,26 +34,6 @@ struct LUTType { IdString output_param; }; -static const dict lut_types = { - {ID(CC_LUT2), {{ - {ID(I0), {0, ID(INIT)}}, - {ID(I1), {1, ID(INIT)}}, - }, ID(INIT)}}, - {ID(CC_L2T4), {{ - {ID(I0), {0, ID(INIT_L00)}}, - {ID(I1), {1, ID(INIT_L00)}}, - {ID(I2), {0, ID(INIT_L01)}}, - {ID(I3), {1, ID(INIT_L01)}}, - }, ID(INIT_L10)}}, - {ID(CC_L2T5), {{ - {ID(I0), {0, ID(INIT_L02)}}, - {ID(I1), {1, ID(INIT_L02)}}, - {ID(I2), {0, ID(INIT_L03)}}, - {ID(I3), {1, ID(INIT_L03)}}, - {ID(I4), {0, ID(INIT_L20)}}, - }, ID(INIT_L20)}}, -}; - struct FoldInvWorker { FoldInvWorker(Module *module) : module(module), sigmap(module) {}; Module *module; @@ -64,6 +44,27 @@ struct FoldInvWorker { // Mapping from inverter input to inverter dict inverter_input; + const dict lut_types = { + {ID(CC_LUT2), {{ + {ID(I0), {0, ID(INIT)}}, + {ID(I1), {1, ID(INIT)}}, + }, ID(INIT)}}, + {ID(CC_L2T4), {{ + {ID(I0), {0, ID(INIT_L00)}}, + {ID(I1), {1, ID(INIT_L00)}}, + {ID(I2), {0, ID(INIT_L01)}}, + {ID(I3), {1, ID(INIT_L01)}}, + }, ID(INIT_L10)}}, + {ID(CC_L2T5), {{ + {ID(I0), {0, ID(INIT_L02)}}, + {ID(I1), {1, ID(INIT_L02)}}, + {ID(I2), {0, ID(INIT_L03)}}, + {ID(I3), {1, ID(INIT_L03)}}, + {ID(I4), {0, ID(INIT_L20)}}, + }, ID(INIT_L20)}}, + }; + + void find_inverted_bits() { for (auto cell : module->selected_cells()) {