@@ -156,7 +156,7 @@ struct AbcModuleState {
156
156
int map_autoidx = 0 ;
157
157
std::vector<gate_t > signal_list;
158
158
dict<RTLIL::SigBit, int > signal_map;
159
- FfInitVals initvals;
159
+ FfInitVals & initvals;
160
160
bool had_init = false ;
161
161
bool did_run_abc = false ;
162
162
@@ -171,7 +171,8 @@ struct AbcModuleState {
171
171
172
172
std::string tempdir_name;
173
173
174
- AbcModuleState (const AbcConfig &config) : config(config) {}
174
+ AbcModuleState (const AbcConfig &config, FfInitVals &initvals)
175
+ : config(config), initvals(initvals) {}
175
176
176
177
int map_signal (const AbcSigMap &assign_map, RTLIL::SigBit bit, gate_type_t gate_type = G(NONE), int in1 = -1, int in2 = -1, int in3 = -1, int in4 = -1);
177
178
void mark_port (const AbcSigMap &assign_map, RTLIL::SigSpec sig);
@@ -775,7 +776,6 @@ struct abc_output_filter
775
776
void AbcModuleState::abc_module (RTLIL::Design *design, RTLIL::Module *module , AbcSigMap &assign_map, const std::vector<RTLIL::Cell*> &cells,
776
777
bool dff_mode, std::string clk_str)
777
778
{
778
- initvals.set (&assign_map, module );
779
779
map_autoidx = autoidx++;
780
780
781
781
if (clk_str != " $" )
@@ -2146,6 +2146,8 @@ struct AbcPass : public Pass {
2146
2146
2147
2147
AbcSigMap assign_map;
2148
2148
assign_map.set (mod);
2149
+ FfInitVals initvals;
2150
+ initvals.set (&assign_map, mod);
2149
2151
2150
2152
for (auto wire : mod->wires ())
2151
2153
if (wire->port_id > 0 )
@@ -2155,7 +2157,7 @@ struct AbcPass : public Pass {
2155
2157
std::vector<RTLIL::Cell*> cells = mod->selected_cells ();
2156
2158
assign_cell_connection_ports (mod, {&cells}, assign_map);
2157
2159
2158
- AbcModuleState state (config);
2160
+ AbcModuleState state (config, initvals );
2159
2161
state.abc_module (design, mod, assign_map, cells, dff_mode, clk_str);
2160
2162
state.extract (assign_map, design, mod);
2161
2163
state.finish ();
@@ -2178,8 +2180,6 @@ struct AbcPass : public Pass {
2178
2180
dict<RTLIL::Cell*, pool<RTLIL::SigBit>> cell_to_bit, cell_to_bit_up, cell_to_bit_down;
2179
2181
dict<RTLIL::SigBit, pool<RTLIL::Cell*>> bit_to_cell, bit_to_cell_up, bit_to_cell_down;
2180
2182
2181
- FfInitVals initvals;
2182
- initvals.set (&assign_map, mod);
2183
2183
for (auto cell : all_cells)
2184
2184
{
2185
2185
clkdomain_t key;
@@ -2319,7 +2319,7 @@ struct AbcPass : public Pass {
2319
2319
assign_cell_connection_ports (mod, cell_sets, assign_map);
2320
2320
}
2321
2321
for (auto &it : assigned_cells) {
2322
- AbcModuleState state (config);
2322
+ AbcModuleState state (config, initvals );
2323
2323
state.clk_polarity = std::get<0 >(it.first );
2324
2324
state.clk_sig = assign_map (std::get<1 >(it.first ));
2325
2325
state.en_polarity = std::get<2 >(it.first );
0 commit comments