3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-06 01:24:10 +00:00

clockgate: reduce errors to warnings

This commit is contained in:
Emil J. Tywoniak 2024-11-18 18:32:18 +01:00
parent 983c54c75f
commit 4d96cbec75

View file

@ -107,22 +107,25 @@ static std::pair<std::optional<ClockGateCell>, std::optional<ClockGateCell>>
continue; continue;
if (auto clk = pin->find("clock_gate_clock_pin")) { if (auto clk = pin->find("clock_gate_clock_pin")) {
if (!icg_interface.clk_in_pin.empty()) if (!icg_interface.clk_in_pin.empty()) {
log_error("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());
else continue;
} 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 (auto gclk = pin->find("clock_gate_out_pin")) {
if (!icg_interface.clk_out_pin.empty()) if (!icg_interface.clk_out_pin.empty()) {
log_error("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());
else continue;
} 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 (auto en = pin->find("clock_gate_enable_pin")) {
if (!icg_interface.ce_pin.empty()) if (!icg_interface.ce_pin.empty()) {
log_error("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());
else continue;
} 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 (auto se = 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]));
@ -131,20 +134,27 @@ static std::pair<std::optional<ClockGateCell>, std::optional<ClockGateCell>>
if (dir->value == "internal") if (dir->value == "internal")
continue; continue;
log_error("Malformed liberty file - extra pin %s in cell %s\n", log_warning("Malformed liberty file - extra pin %s in cell %s\n",
pin->args[0].c_str(), cell_name.c_str()); pin->args[0].c_str(), cell_name.c_str());
continue;
} }
} }
if (icg_interface.clk_in_pin.empty()) if (icg_interface.clk_in_pin.empty()) {
log_error("Malformed liberty file - missing clock_gate_clock_pin in cell %s", log_warning("Malformed liberty file - missing clock_gate_clock_pin in cell %s",
cell_name.c_str()); cell_name.c_str());
if (icg_interface.clk_out_pin.empty()) continue;
log_error("Malformed liberty file - missing clock_gate_out_pin in cell %s", }
if (icg_interface.clk_out_pin.empty()) {
log_warning("Malformed liberty file - missing clock_gate_out_pin in cell %s",
cell_name.c_str()); cell_name.c_str());
if (icg_interface.ce_pin.empty()) continue;
log_error("Malformed liberty file - missing clock_gate_enable_pin in cell %s", }
if (icg_interface.ce_pin.empty()) {
log_warning("Malformed liberty file - missing clock_gate_enable_pin in cell %s",
cell_name.c_str()); cell_name.c_str());
continue;
}
double area = 0; double area = 0;
const LibertyAst *ar = cell->find("area"); const LibertyAst *ar = cell->find("area");
@ -179,11 +189,11 @@ static std::pair<std::optional<ClockGateCell>, std::optional<ClockGateCell>>
std::optional<ClockGateCell> pos; std::optional<ClockGateCell> pos;
std::optional<ClockGateCell> neg; std::optional<ClockGateCell> neg;
if (best_pos) { if (best_pos) {
log("Selected rising edge ICG %s\n", best_pos->name.c_str()); log("Selected rising edge ICG %s from Liberty file\n", best_pos->name.c_str());
pos.emplace(*best_pos); pos.emplace(*best_pos);
} }
if (best_neg) { if (best_neg) {
log("Selected falling edge ICG %s\n", best_neg->name.c_str()); log("Selected falling edge ICG %s from Liberty file\n", best_neg->name.c_str());
neg.emplace(*best_neg); neg.emplace(*best_neg);
} }
return std::make_pair(pos, neg); return std::make_pair(pos, neg);