mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-26 07:43:42 +00:00
Merge branch 'main' of https://github.com/alaindargelas/yosys
This commit is contained in:
commit
1768c25f0b
5 changed files with 18 additions and 14 deletions
|
@ -1532,7 +1532,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
|
||||||
FOREACH_PARAMETER_OF_NETLIST(nl, mi, param_name, param_value) {
|
FOREACH_PARAMETER_OF_NETLIST(nl, mi, param_name, param_value) {
|
||||||
module->avail_parameters(RTLIL::escape_id(param_name));
|
module->avail_parameters(RTLIL::escape_id(param_name));
|
||||||
const TypeRange *tr = nl->GetTypeRange(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;
|
SetIter si;
|
||||||
|
@ -2232,7 +2233,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
|
||||||
if (is_blackbox(inst->View())) {
|
if (is_blackbox(inst->View())) {
|
||||||
FOREACH_PARAMETER_OF_INST(inst, mi2, param_name, param_value) {
|
FOREACH_PARAMETER_OF_INST(inst, mi2, param_name, param_value) {
|
||||||
const TypeRange *tr = inst->View()->GetTypeRange(param_name) ;
|
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,28 +106,28 @@ static std::pair<std::optional<ClockGateCell>, std::optional<ClockGateCell>>
|
||||||
if (pin->id != "pin" || pin->args.size() != 1)
|
if (pin->id != "pin" || pin->args.size() != 1)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (auto clk = pin->find("clock_gate_clock_pin")) {
|
if (pin->find("clock_gate_clock_pin")) {
|
||||||
if (!icg_interface.clk_in_pin.empty()) {
|
if (!icg_interface.clk_in_pin.empty()) {
|
||||||
log_warning("Malformed liberty file - multiple clock_gate_clock_pin in cell %s\n",
|
log_warning("Malformed liberty file - multiple clock_gate_clock_pin in cell %s\n",
|
||||||
cell_name.c_str());
|
cell_name.c_str());
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
icg_interface.clk_in_pin = RTLIL::escape_id(pin->args[0]);
|
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()) {
|
if (!icg_interface.clk_out_pin.empty()) {
|
||||||
log_warning("Malformed liberty file - multiple clock_gate_out_pin in cell %s\n",
|
log_warning("Malformed liberty file - multiple clock_gate_out_pin in cell %s\n",
|
||||||
cell_name.c_str());
|
cell_name.c_str());
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
icg_interface.clk_out_pin = RTLIL::escape_id(pin->args[0]);
|
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()) {
|
if (!icg_interface.ce_pin.empty()) {
|
||||||
log_warning("Malformed liberty file - multiple clock_gate_enable_pin in cell %s\n",
|
log_warning("Malformed liberty file - multiple clock_gate_enable_pin in cell %s\n",
|
||||||
cell_name.c_str());
|
cell_name.c_str());
|
||||||
continue;
|
continue;
|
||||||
} else
|
} else
|
||||||
icg_interface.ce_pin = RTLIL::escape_id(pin->args[0]);
|
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]));
|
icg_interface.tie_lo_pins.push_back(RTLIL::escape_id(pin->args[0]));
|
||||||
} else {
|
} else {
|
||||||
const LibertyAst *dir = pin->find("direction");
|
const LibertyAst *dir = pin->find("direction");
|
||||||
|
|
|
@ -116,7 +116,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
|
||||||
|
|
||||||
if (tree.kind == LibertyExpression::Kind::EMPTY) {
|
if (tree.kind == LibertyExpression::Kind::EMPTY) {
|
||||||
if (!warned_cells.count(cell_name)) {
|
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);
|
warned_cells.insert(cell_name);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -135,7 +135,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
|
||||||
// position that gives better diagnostics here.
|
// position that gives better diagnostics here.
|
||||||
if (!pin_names.count(ff_output)) {
|
if (!pin_names.count(ff_output)) {
|
||||||
if (!warned_cells.count(cell_name)) {
|
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);
|
warned_cells.insert(cell_name);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -184,7 +184,7 @@ static bool parse_next_state(const LibertyAst *cell, const LibertyAst *attr, std
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!warned_cells.count(cell_name)) {
|
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);
|
warned_cells.insert(cell_name);
|
||||||
}
|
}
|
||||||
return false;
|
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.
|
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) {
|
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 {
|
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;
|
return false;
|
||||||
|
|
|
@ -13,6 +13,8 @@ module _80_lcu_han_carlson (P, G, CI, CO);
|
||||||
(* force_downto *)
|
(* force_downto *)
|
||||||
reg [WIDTH-1:0] p, g;
|
reg [WIDTH-1:0] p, g;
|
||||||
|
|
||||||
|
wire [1023:0] _TECHMAP_DO_ = "proc; opt -fast";
|
||||||
|
|
||||||
always @* begin
|
always @* begin
|
||||||
i = 0;
|
i = 0;
|
||||||
p = P;
|
p = P;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
verific -sv -lib <<EOF
|
import -sv -lib <<EOF
|
||||||
module TEST_CELL(input clk, input a, input b, output reg c);
|
module TEST_CELL(input clk, input a, input b, output reg c);
|
||||||
parameter PATH = "DEFAULT";
|
parameter PATH = "DEFAULT";
|
||||||
always @(posedge clk) begin
|
always @(posedge clk) begin
|
||||||
|
@ -11,14 +11,14 @@ end
|
||||||
endmodule
|
endmodule
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
verific -sv <<EOF
|
import -sv <<EOF
|
||||||
module top(input clk, input a, input b, output c, output d);
|
module top(input clk, input a, input b, output c, output d);
|
||||||
TEST_CELL #(.PATH("TEST")) test1(.clk(clk),.a(a),.b(1'b1),.c(c));
|
TEST_CELL #(.PATH("TEST")) test1(.clk(clk),.a(a),.b(1'b1),.c(c));
|
||||||
TEST_CELL #(.PATH("DEFAULT")) test2(.clk(clk),.a(a),.b(1'bx),.c(d));
|
TEST_CELL #(.PATH("DEFAULT")) test2(.clk(clk),.a(a),.b(1'bx),.c(d));
|
||||||
endmodule
|
endmodule
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
verific -import top
|
import -import top
|
||||||
hierarchy -top top
|
hierarchy -top top
|
||||||
stat
|
stat
|
||||||
select -assert-count 2 t:TEST_CELL
|
select -assert-count 2 t:TEST_CELL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue