Skip to content

Commit

Permalink
Undo Liberty stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy committed Nov 19, 2024
1 parent e4095bf commit 5eaf627
Show file tree
Hide file tree
Showing 19 changed files with 0 additions and 571 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,6 @@ endif
+cd tests/fmt && bash run-test.sh
# +cd tests/cxxrtl && bash run-test.sh
+cd tests/liberty && bash run-test.sh
+cd tests/liberty_verilog && bash run-test.sh
ifeq ($(ENABLE_FUNCTIONAL_TESTS),1)
+cd tests/functional && bash run-test.sh
endif
Expand Down
59 changes: 0 additions & 59 deletions frontends/liberty/liberty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -545,12 +545,8 @@ struct LibertyFrontend : public Frontend {
std::map<std::string, std::tuple<int, int, bool>> global_type_map;
parse_type_map(global_type_map, parser.ast);

string leakage_power_unit = "";
for (auto cell : parser.ast->children)
{
if (cell->id == "leakage_power_unit")
leakage_power_unit = cell->value;

if (cell->id != "cell" || cell->args.size() != 1)
continue;

Expand All @@ -562,8 +558,6 @@ struct LibertyFrontend : public Frontend {
RTLIL::Module *module = new RTLIL::Module;
std::string cell_name = RTLIL::escape_id(cell->args.at(0));
module->name = cell_name;
if (leakage_power_unit != "")
module->attributes["\\leakage_power_unit"] = leakage_power_unit;

if (flag_lib)
module->set_bool_attribute(ID::blackbox);
Expand All @@ -580,12 +574,6 @@ struct LibertyFrontend : public Frontend {

for (auto node : cell->children)
{
if (node->id == "area")
module->attributes["\\area"] = node->value;

if (node->id == "cell_leakage_power")
module->attributes["\\LeakagePower"] = node->value;

if (node->id == "pin" && node->args.size() == 1) {
const LibertyAst *dir = node->find("direction");
if (!dir || (dir->value != "input" && dir->value != "output" && dir->value != "inout" && dir->value != "internal"))
Expand Down Expand Up @@ -648,52 +636,6 @@ struct LibertyFrontend : public Frontend {
if (dir->value == "output" || dir->value == "inout")
wire->port_output = true;
}

if (node->id == "bundle" && node->args.size() == 1)
{
if (!flag_lib)
log_error("Error in cell %s: bundle interfaces are only supported in -lib mode.\n", log_id(cell_name));

const LibertyAst *dir = node->find("direction");

if (dir == nullptr) {
const LibertyAst *pin = node->find("pin");
if (pin != nullptr)
dir = pin->find("direction");
}

if (!dir || (dir->value != "input" && dir->value != "output" && dir->value != "inout" && dir->value != "internal"))
log_error("Missing or invalid direction for bundle %s on cell %s.\n", node->args.at(0).c_str(), log_id(module->name));

if (dir->value == "internal")
continue;

const LibertyAst *members = node->find("members");

if (!members)
log_error("Missing members for bundle %s on cell %s.\n", node->args.at(0).c_str(), log_id(module->name));

for (auto member : members->args)
{
Wire *wire = module->addWire(RTLIL::escape_id(member));

if (dir && dir->value == "inout") {
wire->port_input = true;
wire->port_output = true;
}

if (dir && dir->value == "input") {
wire->port_input = true;
continue;
}

if (dir && dir->value == "output")
wire->port_output = true;

if (flag_lib)
continue;
}
}
}

if (!flag_lib)
Expand Down Expand Up @@ -830,4 +772,3 @@ skip_cell:;
} LibertyFrontend;

YOSYS_NAMESPACE_END

62 changes: 0 additions & 62 deletions tests/liberty/bundledef.lib

This file was deleted.

5 changes: 0 additions & 5 deletions tests/liberty/bundledef.lib.filtered.ok

This file was deleted.

2 changes: 0 additions & 2 deletions tests/liberty/bundledef.lib.verilogsim.ok

This file was deleted.

100 changes: 0 additions & 100 deletions tests/liberty/parenfunc.lib

This file was deleted.

23 changes: 0 additions & 23 deletions tests/liberty/parenfunc.lib.filtered.ok

This file was deleted.

15 changes: 0 additions & 15 deletions tests/liberty/parenfunc.lib.verilogsim.ok

This file was deleted.

55 changes: 0 additions & 55 deletions tests/liberty/strangecolons.lib

This file was deleted.

10 changes: 0 additions & 10 deletions tests/liberty/strangecolons.lib.filtered.ok

This file was deleted.

Empty file.
3 changes: 0 additions & 3 deletions tests/liberty_verilog/.gitignore

This file was deleted.

Loading

0 comments on commit 5eaf627

Please sign in to comment.