File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,9 @@ def _synthesize_design_impl(ctx):
109109 inputs .append (default_liberty_file )
110110 inputs .extend (additional_liberty_files )
111111
112+ if ctx .file .early_techmap :
113+ inputs .append (ctx .file .early_techmap )
114+
112115 yosys_runfiles_dir = ctx .executable .yosys_tool .path + ".runfiles"
113116
114117 log_file = ctx .actions .declare_file ("{}_yosys_output.log" .format (ctx .attr .name ))
@@ -181,6 +184,9 @@ def _synthesize_design_impl(ctx):
181184 "YOSYS_DATDIR" : yosys_runfiles_dir + "/at_clifford_yosys/techlibs/" ,
182185 }
183186
187+ if ctx .file .early_techmap :
188+ script_env_files ["EARLY_TECHMAP" ] = ctx .file .early_techmap
189+
184190 for k , v in script_env_files .items ():
185191 if type (v ) == "File" :
186192 env [k ] = v .path
@@ -393,6 +399,11 @@ synthesize_rtl = rule(
393399 executable = True ,
394400 cfg = "exec" ,
395401 ),
402+ "early_techmap" : attr .label (
403+ allow_single_file = True ,
404+ mandatory = False ,
405+ doc = "verilog/system verilog file for early techmap process"
406+ ),
396407 },
397408)
398409
Original file line number Diff line number Diff line change 99# LIBERTY = liberty file for the target technology library
1010# OUTPUT = verilog file for synthesis output
1111# STATS_JSON = json file for structured stats output
12+ # EARLY_TECHMAP = verilog/system verilog file for early techmap process
1213
1314yosys -import
1415
@@ -56,6 +57,11 @@ foreach src $srcs {
5657# generic synthesis
5758set top $::env(TOP)
5859hierarchy -check -top $top
60+
61+ if { [info exists ::env(EARLY_TECHMAP)]} {
62+ techmap -map $::env(EARLY_TECHMAP)
63+ }
64+
5965# Move proc_mux at the end of `yosys proc` to avoid inferred latches.
6066# See https://github.com/YosysHQ/yosys/issues/3456
6167# Ideally the bug would be solved in UHDM/Yosys.
You can’t perform that action at this time.
0 commit comments