Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthesis: Use ABC script from ORFS #254

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions synthesis/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package(
)

exports_files(["synth.tcl"])
exports_files(["abc.script"])

pkg_tar(
name = "yosys",
Expand Down
45 changes: 45 additions & 0 deletions synthesis/abc.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
&get -n
&st
&dch
&nf
&put
&get -n
&st
&syn2
&if -g -K 6
&synch2
&nf
&put
&get -n
&st
&syn2
&if -g -K 6
&synch2
&nf
&put
&get -n
&st
&syn2
&if -g -K 6
&synch2
&nf
&put
&get -n
&st
&syn2
&if -g -K 6
&synch2
&nf
&put
&get -n
&st
&syn2
&if -g -K 6
&synch2
&nf
&put
buffer -c
topo
stime -c
upsize -c
dnsize -c
8 changes: 8 additions & 0 deletions synthesis/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ def _synthesize_design_impl(ctx):
default_liberty_file = ctx.attr.standard_cells[StandardCellInfo].default_corner.liberty

synth_tcl = ctx.file.synth_tcl
abc_script = ctx.file.abc_script

inputs = []
inputs.extend(verilog_files)
inputs.append(verilog_flist)
inputs.append(uhdm_flist)
inputs.extend(uhdm_files)
inputs.append(synth_tcl)
inputs.append(abc_script)
inputs.append(default_liberty_file)

(tool_inputs, input_manifests) = ctx.resolve_tools(tools = [ctx.attr.yosys_tool])
Expand Down Expand Up @@ -125,6 +127,7 @@ def _synthesize_design_impl(ctx):
"OUTPUT": output_file,
"LIBERTY": default_liberty_file,
"DONT_USE_ARGS": dont_use_args,
"ABC_SCRIPT": abc_script,
}

if ctx.attr.target_clock_period_pico_seconds:
Expand Down Expand Up @@ -253,6 +256,11 @@ synthesize_rtl = rule(
allow_single_file = True,
doc = "Tcl synthesis script compatible with the environment-variable API of synth.tcl",
),
"abc_script": attr.label(
default = Label("//synthesis:abc.script"),
allow_single_file = True,
doc = "ABC script",
),
"target_clock_period_pico_seconds": attr.int(doc = "target clock period in picoseconds"),
"output_file_name": attr.string(doc = "The output file name."),
},
Expand Down
4 changes: 2 additions & 2 deletions synthesis/synth.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ set liberty $::env(LIBERTY)
dfflibmap -liberty $liberty

if { [info exists ::env(CLOCK_PERIOD) ] } {
abc -liberty $liberty -dff -g aig -D $::env(CLOCK_PERIOD) {*}$::env(DONT_USE_ARGS)
abc -liberty $liberty -dff -script $::env(ABC_SCRIPT) -g aig -D $::env(CLOCK_PERIOD) {*}$::env(DONT_USE_ARGS)
} else {
abc -liberty $liberty -dff -g aig {*}$::env(DONT_USE_ARGS)
abc -liberty $liberty -dff -script $::env(ABC_SCRIPT) -g aig {*}$::env(DONT_USE_ARGS)
}

# Remove internal only aliases for public nets and then give created instances
Expand Down
Loading