@@ -98,13 +98,17 @@ struct SynthPass : public ScriptPass {
9898 log (" mapping library in the `techmap` step. this option can be\n " );
9999 log (" repeated.\n " );
100100 log (" \n " );
101+ log (" -relativeshare\n " );
102+ log (" use paths relative to share directory for source locations\n " );
103+ log (" where possible (experimental).\n " );
104+ log (" \n " );
101105 log (" The following commands are executed by this synthesis command:\n " );
102106 help_script ();
103107 log (" \n " );
104108 }
105109
106110 string top_module, fsm_opts, memory_opts, abc;
107- bool autotop, flatten, noalumacc, nofsm, noabc, noshare, flowmap, booth, hieropt;
111+ bool autotop, flatten, noalumacc, nofsm, noabc, noshare, flowmap, booth, hieropt, relative_share ;
108112 int lut;
109113 std::vector<std::string> techmap_maps;
110114
@@ -124,6 +128,7 @@ struct SynthPass : public ScriptPass {
124128 flowmap = false ;
125129 booth = false ;
126130 hieropt = false ;
131+ relative_share = false ;
127132 abc = " abc" ;
128133 techmap_maps.clear ();
129134 }
@@ -211,6 +216,11 @@ struct SynthPass : public ScriptPass {
211216 hieropt = true ;
212217 continue ;
213218 }
219+ if (args[argidx] == " -relativeshare" ) {
220+ relative_share = true ;
221+ log_experimental (" synth -relativeshare" );
222+ continue ;
223+ }
214224 break ;
215225 }
216226 extra_args (args, argidx, design);
@@ -239,6 +249,10 @@ struct SynthPass : public ScriptPass {
239249 else
240250 hieropt_flag = hieropt ? " -hier" : " " ;
241251
252+ std::string techmap_cmd = " techmap" ;
253+ if (relative_share)
254+ techmap_cmd += " -relativeshare" ;
255+
242256 if (check_label (" begin" )) {
243257 if (help_mode) {
244258 run (" hierarchy -check [-top <top> | -auto-top]" );
@@ -268,9 +282,9 @@ struct SynthPass : public ScriptPass {
268282 run (" peepopt" );
269283 run (" opt_clean" );
270284 if (help_mode)
271- run (" techmap -map +/cmp2lut.v -map +/cmp2lcu.v" , " (if -lut)" );
285+ run (techmap_cmd + " -map +/cmp2lut.v -map +/cmp2lcu.v" , " (if -lut)" );
272286 else if (lut)
273- run (stringf (" techmap -map +/cmp2lut.v -map +/cmp2lcu.v -D LUT_WIDTH=%d" , lut));
287+ run (stringf (" %s -map +/cmp2lut.v -map +/cmp2lcu.v -D LUT_WIDTH=%d" , techmap_cmd , lut));
274288 if (booth || help_mode)
275289 run (" booth" , " (if -booth)" );
276290 if (!noalumacc)
@@ -287,22 +301,22 @@ struct SynthPass : public ScriptPass {
287301 run (" memory_map" );
288302 run (" opt -full" );
289303 if (help_mode) {
290- run (" techmap " , " (unless -extra-map)" );
291- run (" techmap -map +/techmap.v -map <inject>" , " (if -extra-map)" );
304+ run (techmap_cmd , " (unless -extra-map)" );
305+ run (techmap_cmd + " -map +/techmap.v -map <inject>" , " (if -extra-map)" );
292306 } else {
293307 std::string techmap_opts;
294308 if (!techmap_maps.empty ())
295309 techmap_opts += " -map +/techmap.v" ;
296310 for (auto fn : techmap_maps)
297311 techmap_opts += stringf (" -map %s" , fn.c_str ());
298- run (" techmap " + techmap_opts);
312+ run (techmap_cmd + techmap_opts);
299313 }
300314 if (help_mode) {
301- run (" techmap -map +/gate2lut.v" , " (if -noabc and -lut)" );
315+ run (techmap_cmd + " -map +/gate2lut.v" , " (if -noabc and -lut)" );
302316 run (" clean; opt_lut" , " (if -noabc and -lut)" );
303317 run (" flowmap -maxlut K" , " (if -flowmap and -lut)" );
304318 } else if (noabc && lut) {
305- run (stringf (" techmap -map +/gate2lut.v -D LUT_WIDTH=%d" , lut));
319+ run (stringf (" %s -map +/gate2lut.v -D LUT_WIDTH=%d" , techmap_cmd , lut));
306320 run (" clean; opt_lut" );
307321 } else if (flowmap) {
308322 run (stringf (" flowmap -maxlut %d" , lut));
0 commit comments