Skip to content

Commit

Permalink
Merge pull request #188 from mithro/dont-use-args
Browse files Browse the repository at this point in the history
Give don't use cells to Yosys.
  • Loading branch information
QuantamHD authored Sep 20, 2023
2 parents d0e855a + 204b8a2 commit af98f9a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dependency_support/at_clifford_yosys/at_clifford_yosys.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def at_clifford_yosys():
http_archive,
name = "at_clifford_yosys",
urls = [
"https://github.com/YosysHQ/yosys/archive/refs/tags/yosys-0.26.zip",
"https://github.com/YosysHQ/yosys/archive/35a05686c4e9987441ac298f5d631f1785e272fd.zip",
],
sha256 = "700fdd8d8ca8a7020f9fc15fec16377db58e928a28a6eb7d30ef72b6ea0782aa",
strip_prefix = "yosys-yosys-0.26",
sha256 = "766da0b9f7e0aeb61ea6ab3d504e2a5328fc21d60f936d0e74f0af7c97120ba4",
strip_prefix = "yosys-35a05686c4e9987441ac298f5d631f1785e272fd",
build_file = Label("@rules_hdl//dependency_support:at_clifford_yosys/bundled.BUILD.bazel"),
patches = [
Label("@rules_hdl//dependency_support:at_clifford_yosys/yosys.patch"),
Expand Down
25 changes: 21 additions & 4 deletions dependency_support/edu_berkeley_abc/bundled.BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ cc_library(
"src/aig/gia/giaCSat2.c",
"src/aig/gia/giaCSat3.c",
"src/aig/gia/giaCSatOld.c",
"src/aig/gia/giaCSatP.c",
"src/aig/gia/giaCTas.c",
"src/aig/gia/giaCex.c",
"src/aig/gia/giaClp.c",
Expand Down Expand Up @@ -134,20 +135,23 @@ cc_library(
"src/aig/gia/giaResub.c",
"src/aig/gia/giaResub2.c",
"src/aig/gia/giaResub3.c",
"src/aig/gia/giaResub6.c",
"src/aig/gia/giaRetime.c",
"src/aig/gia/giaRex.c",
"src/aig/gia/giaSat3.c",
"src/aig/gia/giaSatEdge.c",
"src/aig/gia/giaSatLE.c",
"src/aig/gia/giaSatLut.c",
"src/aig/gia/giaSatMap.c",
"src/aig/gia/giaSatSyn.c",
"src/aig/gia/giaSatoko.c",
"src/aig/gia/giaScl.c",
"src/aig/gia/giaScript.c",
"src/aig/gia/giaShow.c",
"src/aig/gia/giaShrink.c",
"src/aig/gia/giaShrink6.c",
"src/aig/gia/giaShrink7.c",
"src/aig/gia/giaSif.c",
"src/aig/gia/giaSim.c",
"src/aig/gia/giaSim2.c",
"src/aig/gia/giaSimBase.c",
Expand All @@ -165,8 +169,11 @@ cc_library(
"src/aig/gia/giaSwitch.c",
"src/aig/gia/giaTim.c",
"src/aig/gia/giaTis.c",
"src/aig/gia/giaTranStoch.c",
"src/aig/gia/giaTransduction.cpp",
"src/aig/gia/giaTruth.c",
"src/aig/gia/giaTsim.c",
"src/aig/gia/giaTtopt.cpp",
"src/aig/gia/giaUnate.c",
"src/aig/gia/giaUtil.c",
"src/aig/hop/hopBalance.c",
Expand Down Expand Up @@ -297,6 +304,7 @@ cc_library(
"src/base/abci/abcNpnSave.c",
"src/base/abci/abcNtbdd.c",
"src/base/abci/abcOdc.c",
"src/base/abci/abcOrchestration.c",
"src/base/abci/abcOrder.c",
"src/base/abci/abcPart.c",
"src/base/abci/abcPrint.c",
Expand Down Expand Up @@ -402,14 +410,14 @@ cc_library(
"src/base/io/ioWriteBook.c",
"src/base/io/ioWriteCnf.c",
"src/base/io/ioWriteDot.c",
"src/base/io/ioWriteEdgelist.c",
"src/base/io/ioWriteEqn.c",
"src/base/io/ioWriteGml.c",
"src/base/io/ioWriteList.c",
"src/base/io/ioWritePla.c",
"src/base/io/ioWriteSmv.c",
"src/base/io/ioWriteVerilog.c",
"src/base/main/libSupport.c",
"src/base/main/main.c",
"src/base/main/mainFrame.c",
"src/base/main/mainInit.c",
"src/base/main/mainLib.c",
Expand Down Expand Up @@ -972,6 +980,7 @@ cc_library(
"src/proof/cec/cecSat.c",
"src/proof/cec/cecSatG.c",
"src/proof/cec/cecSatG2.c",
"src/proof/cec/cecSatG3.c",
"src/proof/cec/cecSeq.c",
"src/proof/cec/cecSim.c",
"src/proof/cec/cecSolve.c",
Expand Down Expand Up @@ -1162,25 +1171,31 @@ cc_library(
],
hdrs = [
"src/base/abc/abc.h",
"src/base/main/main.h",
"src/misc/util/abc_global.h",
],
copts = [
"-O2",
"-Wno-dangling-else",
"-Wno-empty-body",
"-Wno-format-overflow",
"-Wno-implicit-int-float-conversion",
"-Wno-maybe-uninitialized", # This is possibly concerning.
"-Wno-misleading-indentation",
"-Wno-non-virtual-dtor",
"-Wno-nonnull",
"-Wno-self-assign",
"-Wno-sign-compare",
"-Wno-sometimes-uninitialized", # This is possibly concerning.
"-Wno-strict-aliasing",
"-Wno-string-plus-char",
"-Wno-stringop-overflow",
"-Wno-tautological-constant-out-of-range-compare", # cnf_reader.c
"-Wno-unknown-warning-option", # Clang and GCC warn differently.
"-Wno-unused-but-set-variable",
"-Wno-unused-function",
"-Wno-unused-variable",
"-Wno-write-strings",
"-Wno-maybe-uninitialized", # This is possibly concerning.
"-Wno-sometimes-uninitialized", # This is possibly concerning.
"-Wno-unknown-warning-option", # Clang and GCC warn differently.
],
defines = [
"LIN64",
Expand All @@ -1204,6 +1219,8 @@ cc_library(
),
deps = [
"@org_gnu_readline//:readline",
"@net_zlib//:zlib",
# FIXME: This needs bz2lib?
],
visibility = ["//visibility:public"],
)
6 changes: 3 additions & 3 deletions dependency_support/edu_berkeley_abc/edu_berkeley_abc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def edu_berkeley_abc():
http_archive,
name = "edu_berkeley_abc",
urls = [
"https://github.com/berkeley-abc/abc/archive/fdf08d2aad5f1c49d3f0e6778137a9b8a99100b2.tar.gz", # 2012-12-16
"https://github.com/berkeley-abc/abc/archive/0d579a430d57e5b864a62407aac2da0faba7c3b0.tar.gz",
],
strip_prefix = "abc-fdf08d2aad5f1c49d3f0e6778137a9b8a99100b2",
sha256 = "6450938cb694b256db0dc43221bb6cfc9a73858e04bfe28faa710b24c3f5fcb8",
strip_prefix = "abc-0d579a430d57e5b864a62407aac2da0faba7c3b0",
sha256 = "9ea3d8b7a104a2394e8967c93b3faaa12c3444a8901c11786494119b8088a1d9",
build_file = Label("@rules_hdl//dependency_support:edu_berkeley_abc/bundled.BUILD.bazel"),
)
7 changes: 7 additions & 0 deletions synthesis/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,19 @@ def _synthesize_design_impl(ctx):
args.add_all("-l", [log_file]) # put output in log file
args.add_all("-c", [synth_tcl]) # run synthesis tcl script

dont_use_args = ""
or_config = ctx.attr.standard_cells[StandardCellInfo].open_road_configuration
if or_config:
for dont_use_pattern in or_config.do_not_use_cell_list:
dont_use_args += " -dont_use {} ".format(dont_use_pattern)

script_env_files = {
"FLIST": verilog_flist,
"UHDM_FLIST": uhdm_flist,
"TOP": ctx.attr.top_module,
"OUTPUT": output_file,
"LIBERTY": default_liberty_file,
"DONT_USE_ARGS": dont_use_args,
}

if ctx.attr.target_clock_period_pico_seconds:
Expand Down
4 changes: 2 additions & 2 deletions synthesis/synth.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ set liberty $::env(LIBERTY)
dfflibmap -liberty $liberty

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

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

0 comments on commit af98f9a

Please sign in to comment.