From ee38c323cd23dc141e9b22f8259e84683480acff Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Mon, 18 Sep 2023 11:49:12 -0700 Subject: [PATCH 1/3] Give don't use cells to Yosys. Signed-off-by: Tim Ansell --- synthesis/build_defs.bzl | 7 +++++++ synthesis/synth.tcl | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/synthesis/build_defs.bzl b/synthesis/build_defs.bzl index 14b1b460..383acae4 100644 --- a/synthesis/build_defs.bzl +++ b/synthesis/build_defs.bzl @@ -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: diff --git a/synthesis/synth.tcl b/synthesis/synth.tcl index 969a6298..a02c9681 100644 --- a/synthesis/synth.tcl +++ b/synthesis/synth.tcl @@ -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 From c02c72f1aefc3bcf9feb1a34df9b40cceed26420 Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Tue, 19 Sep 2023 18:06:51 -0700 Subject: [PATCH 2/3] Upgrade the version of `abc`. Signed-off-by: Tim Ansell --- .../edu_berkeley_abc/bundled.BUILD.bazel | 25 ++++++++++++++++--- .../edu_berkeley_abc/edu_berkeley_abc.bzl | 6 ++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/dependency_support/edu_berkeley_abc/bundled.BUILD.bazel b/dependency_support/edu_berkeley_abc/bundled.BUILD.bazel index fbeab05f..607c39e1 100644 --- a/dependency_support/edu_berkeley_abc/bundled.BUILD.bazel +++ b/dependency_support/edu_berkeley_abc/bundled.BUILD.bazel @@ -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", @@ -134,6 +135,7 @@ 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", @@ -141,6 +143,7 @@ cc_library( "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", @@ -148,6 +151,7 @@ cc_library( "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", @@ -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", @@ -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", @@ -402,6 +410,7 @@ 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", @@ -409,7 +418,6 @@ cc_library( "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", @@ -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", @@ -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", @@ -1204,6 +1219,8 @@ cc_library( ), deps = [ "@org_gnu_readline//:readline", + "@net_zlib//:zlib", + # FIXME: This needs bz2lib? ], visibility = ["//visibility:public"], ) diff --git a/dependency_support/edu_berkeley_abc/edu_berkeley_abc.bzl b/dependency_support/edu_berkeley_abc/edu_berkeley_abc.bzl index 3bd23028..7a53a074 100644 --- a/dependency_support/edu_berkeley_abc/edu_berkeley_abc.bzl +++ b/dependency_support/edu_berkeley_abc/edu_berkeley_abc.bzl @@ -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"), ) From 204b8a21a88cbb6af800cad53c0f4b60b252df14 Mon Sep 17 00:00:00 2001 From: Tim Ansell Date: Tue, 19 Sep 2023 18:25:30 -0700 Subject: [PATCH 3/3] Upgrade Yosys version. Signed-off-by: Tim Ansell --- dependency_support/at_clifford_yosys/at_clifford_yosys.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl b/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl index f995f490..f0309d11 100644 --- a/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl +++ b/dependency_support/at_clifford_yosys/at_clifford_yosys.bzl @@ -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"),