From ebd7f2b366a9d71b94ffcfd521d0611c55d7362d Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Mon, 2 Dec 2024 09:54:24 +0100 Subject: [PATCH 1/5] techlibs: add _TECHMAP_DO_ to Han-Carlson adder --- techlibs/common/choices/han-carlson.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/techlibs/common/choices/han-carlson.v b/techlibs/common/choices/han-carlson.v index 2ddcf75e9..0ce8ee207 100644 --- a/techlibs/common/choices/han-carlson.v +++ b/techlibs/common/choices/han-carlson.v @@ -13,6 +13,8 @@ module _80_lcu_han_carlson (P, G, CI, CO); (* force_downto *) reg [WIDTH-1:0] p, g; + wire [1023:0] _TECHMAP_DO_ = "proc; opt -fast"; + always @* begin i = 0; p = P; From 6b006e5f6147eef2324acb53c2b7fc1402d5b0d6 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Mon, 2 Dec 2024 10:07:01 +0100 Subject: [PATCH 2/5] clockgate: reduce build warnings --- passes/techmap/clockgate.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/passes/techmap/clockgate.cc b/passes/techmap/clockgate.cc index 940884353..468181991 100644 --- a/passes/techmap/clockgate.cc +++ b/passes/techmap/clockgate.cc @@ -106,28 +106,28 @@ static std::pair, std::optional> if (pin->id != "pin" || pin->args.size() != 1) continue; - if (auto clk = pin->find("clock_gate_clock_pin")) { + if (pin->find("clock_gate_clock_pin")) { if (!icg_interface.clk_in_pin.empty()) { log_warning("Malformed liberty file - multiple clock_gate_clock_pin in cell %s\n", cell_name.c_str()); continue; } else icg_interface.clk_in_pin = RTLIL::escape_id(pin->args[0]); - } else if (auto gclk = pin->find("clock_gate_out_pin")) { + } else if (pin->find("clock_gate_out_pin")) { if (!icg_interface.clk_out_pin.empty()) { log_warning("Malformed liberty file - multiple clock_gate_out_pin in cell %s\n", cell_name.c_str()); continue; } else icg_interface.clk_out_pin = RTLIL::escape_id(pin->args[0]); - } else if (auto en = pin->find("clock_gate_enable_pin")) { + } else if (pin->find("clock_gate_enable_pin")) { if (!icg_interface.ce_pin.empty()) { log_warning("Malformed liberty file - multiple clock_gate_enable_pin in cell %s\n", cell_name.c_str()); continue; } else icg_interface.ce_pin = RTLIL::escape_id(pin->args[0]); - } else if (auto se = pin->find("clock_gate_test_pin")) { + } else if (pin->find("clock_gate_test_pin")) { icg_interface.tie_lo_pins.push_back(RTLIL::escape_id(pin->args[0])); } else { const LibertyAst *dir = pin->find("direction"); From fd05f73d50477149e48595caff5ad7d8ac80eb06 Mon Sep 17 00:00:00 2001 From: Lofty Date: Mon, 2 Dec 2024 14:17:28 +0000 Subject: [PATCH 3/5] dfflibmap: demote some warnings to debug --- passes/techmap/dfflibmap.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/passes/techmap/dfflibmap.cc b/passes/techmap/dfflibmap.cc index 8af4f6a04..b6c340c00 100644 --- a/passes/techmap/dfflibmap.cc +++ b/passes/techmap/dfflibmap.cc @@ -116,7 +116,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std if (tree.kind == LibertyExpression::Kind::EMPTY) { if (!warned_cells.count(cell_name)) { - log_warning("Invalid expression '%s' in next_state attribute of cell '%s' - skipping.\n", expr.c_str(), cell_name.c_str()); + log_debug("Invalid expression '%s' in next_state attribute of cell '%s' - skipping.\n", expr.c_str(), cell_name.c_str()); warned_cells.insert(cell_name); } return false; @@ -135,7 +135,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std // position that gives better diagnostics here. if (!pin_names.count(ff_output)) { if (!warned_cells.count(cell_name)) { - log_warning("Inference failed on expression '%s' in next_state attribute of cell '%s' because it does not contain ff output '%s' - skipping.\n", expr.c_str(), cell_name.c_str(), ff_output.c_str()); + log_debug("Inference failed on expression '%s' in next_state attribute of cell '%s' because it does not contain ff output '%s' - skipping.\n", expr.c_str(), cell_name.c_str(), ff_output.c_str()); warned_cells.insert(cell_name); } return false; @@ -184,7 +184,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std } if (!warned_cells.count(cell_name)) { - log_warning("Inference failed on expression '%s' in next_state attribute of cell '%s' because it does not evaluate to an enable flop - skipping.\n", expr.c_str(), cell_name.c_str()); + log_debug("Inference failed on expression '%s' in next_state attribute of cell '%s' because it does not evaluate to an enable flop - skipping.\n", expr.c_str(), cell_name.c_str()); warned_cells.insert(cell_name); } return false; @@ -220,10 +220,10 @@ static bool parse_pin(const LibertyAst *cell, const LibertyAst *attr, std::strin For now, we'll simply produce a warning to let the user know something is up. */ if (pin_name.find_first_of("^*|&") == std::string::npos) { - log_warning("Malformed liberty file - cannot find pin '%s' in cell '%s' - skipping.\n", pin_name.c_str(), cell->args[0].c_str()); + log_debug("Malformed liberty file - cannot find pin '%s' in cell '%s' - skipping.\n", pin_name.c_str(), cell->args[0].c_str()); } else { - log_warning("Found unsupported expression '%s' in pin attribute of cell '%s' - skipping.\n", pin_name.c_str(), cell->args[0].c_str()); + log_debug("Found unsupported expression '%s' in pin attribute of cell '%s' - skipping.\n", pin_name.c_str(), cell->args[0].c_str()); } return false; From 912b38eedb0fe0f8a89e06295670fda33b92c486 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 2 Dec 2024 15:45:12 +0100 Subject: [PATCH 4/5] verific: Handle crash when using empty box option --- frontends/verific/verific.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 38ebfe4f2..afa3a92c9 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -1471,7 +1471,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma FOREACH_PARAMETER_OF_NETLIST(nl, mi, param_name, param_value) { module->avail_parameters(RTLIL::escape_id(param_name)); const TypeRange *tr = nl->GetTypeRange(param_name) ; - module->parameter_default_values[RTLIL::escape_id(param_name)] = verific_const(tr->GetTypeName(), param_value, nl); + const char* type_name = (tr) ? tr->GetTypeName() : nullptr; + module->parameter_default_values[RTLIL::escape_id(param_name)] = verific_const(type_name, param_value, nl); } SetIter si; @@ -2171,7 +2172,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma if (is_blackbox(inst->View())) { FOREACH_PARAMETER_OF_INST(inst, mi2, param_name, param_value) { const TypeRange *tr = inst->View()->GetTypeRange(param_name) ; - cell->setParam(RTLIL::escape_id(param_name), verific_const(tr->GetTypeName(), param_value, inst->View())); + const char* type_name = (tr) ? tr->GetTypeName() : nullptr; + cell->setParam(RTLIL::escape_id(param_name), verific_const(type_name, param_value, inst->View())); } } From 3914c21286f188526087acc827e5a5895541f329 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Mon, 2 Dec 2024 20:07:07 -0500 Subject: [PATCH 5/5] verific->import fix for new test case --- tests/verific/blackbox.ys | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/verific/blackbox.ys b/tests/verific/blackbox.ys index fbf689e3d..0f9a47d1a 100644 --- a/tests/verific/blackbox.ys +++ b/tests/verific/blackbox.ys @@ -1,4 +1,4 @@ -verific -sv -lib <