Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SJulianS committed Jun 3, 2024
1 parent 0d10cc1 commit cee86e1
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 81 deletions.
5 changes: 3 additions & 2 deletions src/netlist/gate_library/gate_library_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace hal
}

GateType* gt = lib->create_gate_type(name, {GateTypeProperty::combinational, GateTypeProperty::power});
if (auto res = gt->create_pin("O", PinDirection::output, PinType::ground); res.is_error())
if (auto res = gt->create_pin("O", PinDirection::output, PinType::power); res.is_error())
{
return ERR_APPEND(res.get_error(), "could not prepare gate library '" + lib->get_name() + "': failed to create output pin 'O' for gate type 'HAL_VDD'");
}
Expand Down Expand Up @@ -136,7 +136,8 @@ namespace hal
std::vector<std::filesystem::path> retval;
for (const auto& lib_dir : utils::get_gate_library_directories())
{
if (!std::filesystem::exists(lib_dir)) continue;
if (!std::filesystem::exists(lib_dir))
continue;
for (const auto& lib_path : utils::RecursiveDirectoryRange(lib_dir))
retval.push_back(lib_path.path());
}
Expand Down
7 changes: 4 additions & 3 deletions src/netlist/gate_library/gate_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,20 +393,24 @@ namespace hal
if (ascending)
{
for (auto it = pins.begin(); it != pins.end(); ++it)
{
if (auto res = assign_pin_to_group(pin_group, *it, delete_empty_groups); res.is_error())
{
assert(delete_pin_group(pin_group));
return ERR(res.get_error());
}
}
}
else
{
for (auto it = pins.rbegin(); it != pins.rend(); ++it)
{
if (auto res = assign_pin_to_group(pin_group, *it, delete_empty_groups); res.is_error())
{
assert(delete_pin_group(pin_group));
return ERR(res.get_error());
}
}
}

return OK(pin_group);
Expand Down Expand Up @@ -462,12 +466,9 @@ namespace hal
return false;
}

bool removed_pins = false;

std::vector<GatePin*> pins_copy = pin_group->get_pins();
for (auto* pin : pins_copy)
{
removed_pins = true;
if (auto res = create_pin_group(pin->get_name(), {pin}, pin->get_direction(), pin->get_type(), true, 0, false); res.is_error())
{
log_warning("gate", "{}", res.get_error().get());
Expand Down
Loading

0 comments on commit cee86e1

Please sign in to comment.