@@ -78,7 +78,7 @@ struct SynthQuickLogicPass : public ScriptPass {
7878 }
7979
8080 string top_opt, blif_file, edif_file, family, currmodule, verilog_file, lib_path;
81- bool abc9, inferAdder, nobram, bramTypes, dsp, ioff;
81+ bool abc9, inferAdder, nobram, bramTypes, dsp, ioff, flatten ;
8282
8383 void clear_flags () override
8484 {
@@ -95,6 +95,7 @@ struct SynthQuickLogicPass : public ScriptPass {
9595 lib_path = " +/quicklogic/" ;
9696 dsp = true ;
9797 ioff = true ;
98+ flatten = true ;
9899 }
99100
100101 void set_scratchpad_defaults (RTLIL::Design *design) {
@@ -163,6 +164,10 @@ struct SynthQuickLogicPass : public ScriptPass {
163164 ioff = false ;
164165 continue ;
165166 }
167+ if (args[argidx] == " -noflatten" ) {
168+ flatten = false ;
169+ continue ;
170+ }
166171 break ;
167172 }
168173 extra_args (args, argidx, design);
@@ -207,7 +212,8 @@ struct SynthQuickLogicPass : public ScriptPass {
207212
208213 if (check_label (" prepare" )) {
209214 run (" proc" );
210- run (" flatten" );
215+ if (flatten)
216+ run (" flatten" , " (unless -noflatten)" );
211217 if (help_mode || family == " pp3" ) {
212218 run (" tribuf -logic" , " (for pp3)" );
213219 }
0 commit comments