Skip to content

Commit

Permalink
Fix for non-standard latches (parallaxsw#151)
Browse files Browse the repository at this point in the history
* latch_3port

* Smallfixes

* Review amendments

* Smallfix

* Add comments to describe cases
  • Loading branch information
akashlevy authored Dec 19, 2024
1 parent ec00954 commit adfafa9
Show file tree
Hide file tree
Showing 5 changed files with 715 additions and 9 deletions.
26 changes: 17 additions & 9 deletions liberty/LibertyReader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3959,21 +3959,29 @@ LibertyReader::seqPortNames(LibertyGroup *group,
bool &has_size,
int &size)
{
int i = 0;
out_name = nullptr;
out_inv_name = nullptr;
size = 1;
has_size = false;
for (LibertyAttrValue *value : *group->params()) {
if (i == 0)
out_name = value->stringValue();
else if (i == 1)
out_inv_name = value->stringValue();
else if (i == 2) {
size = static_cast<int>(value->floatValue());
if (group->params()->size() == 2) {
// out_port, out_port_inv
out_name = group->firstName();
out_inv_name = group->secondName();
}
else if (group->params()->size() == 3) {
LibertyAttrValue *third_value = (*group->params())[2];
if (third_value->isFloat()) {
// out_port, out_port_inv, bus_size
out_name = group->firstName();
out_inv_name = group->secondName();
size = static_cast<int>(third_value->floatValue());
has_size = true;
}
i++;
else {
// in_port (ignored), out_port, out_port_inv
out_name = group->secondName();
out_inv_name = third_value->stringValue();
}
}
}

Expand Down
Loading

0 comments on commit adfafa9

Please sign in to comment.