From c7e8d416008a51331118c8d6225dc9f69cb1233e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Wed, 16 Oct 2024 11:42:47 +0200 Subject: [PATCH] read_liberty: Set `area` `capacitance` attributes --- frontends/liberty/liberty.cc | 8 ++++++++ kernel/constids.inc | 2 ++ 2 files changed, 10 insertions(+) diff --git a/frontends/liberty/liberty.cc b/frontends/liberty/liberty.cc index e183cbf10..5f85be702 100644 --- a/frontends/liberty/liberty.cc +++ b/frontends/liberty/liberty.cc @@ -571,6 +571,10 @@ struct LibertyFrontend : public Frontend { if (flag_wb) module->set_bool_attribute(ID::whitebox); + const LibertyAst *area = cell->find("area"); + if (area) + module->attributes[ID::area] = area->value; + for (auto &attr : attributes) module->attributes[attr] = 1; @@ -662,6 +666,10 @@ struct LibertyFrontend : public Frontend { RTLIL::Wire *wire = module->wires_.at(RTLIL::escape_id(node->args.at(0))); log_assert(wire); + const LibertyAst *capacitance = node->find("capacitance"); + if (capacitance) + wire->attributes[ID::capacitance] = capacitance->value; + if (dir && dir->value == "inout") { wire->port_input = true; wire->port_output = true; diff --git a/kernel/constids.inc b/kernel/constids.inc index d1bbb8eda..d68e2dfe6 100644 --- a/kernel/constids.inc +++ b/kernel/constids.inc @@ -274,3 +274,5 @@ X(X) X(xprop_decoder) X(Y) X(Y_WIDTH) +X(area) +X(capacitance)