Skip to content

Commit

Permalink
Synthesis: Insert tie cells during synthesis
Browse files Browse the repository at this point in the history
This commit adds following changes to the synthesis script:
* defined all `x` values as `0`s
* split multi-bit nets to single bit ones
* run extra optimization after `x` values are resolved.
* map constant 0/1s to tap cells during synthesis.
These steps are similar to the ORFS synthesis.

Signed-off-by: Maciej Dudek <[email protected]>
  • Loading branch information
mtdudek committed Dec 18, 2023
1 parent 7a510f1 commit 2d34443
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions synthesis/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ def _synthesize_design_impl(ctx):
if ctx.attr.target_clock_period_pico_seconds:
script_env_files["CLOCK_PERIOD"] = str(ctx.attr.target_clock_period_pico_seconds)

if or_config.tie_low_port:
script_env_files["TIELO_CELL_AND_PORT"] = str(or_config.tie_low_port)

if or_config.tie_high_port:
script_env_files["TIEHI_CELL_AND_PORT"] = str(or_config.tie_high_port)

env = {
"YOSYS_DATDIR": yosys_runfiles_dir + "/at_clifford_yosys/techlibs/",
"ABC": yosys_runfiles_dir + "/edu_berkeley_abc/abc",
Expand Down
18 changes: 17 additions & 1 deletion synthesis/synth.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,22 @@ if { [info exists ::env(CLOCK_PERIOD) ] } {
abc -liberty $liberty -dff -g aig {*}$::env(DONT_USE_ARGS)
}

setundef -zero
splitnets
opt_clean -purge

if {[info exists ::env(TIEHI_CELL_AND_PORT)] && [info exists ::env(TIELO_CELL_AND_PORT)]} {
hilomap \
-hicell {*}[split $::env(TIEHI_CELL_AND_PORT) "/"] \
-locell {*}[split $::env(TIELO_CELL_AND_PORT) "/"]
} elseif { [info exists ::env(TIEHI_CELL_AND_PORT)] } {
hilomap \
-hicell {*}$::env(TIEHI_CELL_AND_PORT)
} elseif { [info exists ::env(TIELO_CELL_AND_PORT)] } {
hilomap \
-locell {*}$::env(TIELO_CELL_AND_PORT)
}

# Remove internal only aliases for public nets and then give created instances
# useful names. At this stage it is anything generated by the techmapping
# passes.
Expand All @@ -101,7 +117,7 @@ if { [info exists ::env(STATS_JSON) ] } {
read_liberty -lib -ignore_miss_func $liberty
ltp -noff $top

yosys log -n Flop count:\
yosys log -n Flop count:\
yosys select -count t:*__df* t:DFF* t:*_DFF* t:*_SDFF* t:*_ADFF* t:*dff

set base_liberty [file tail $liberty]
Expand Down

0 comments on commit 2d34443

Please sign in to comment.