3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-25 16:42:35 +00:00

Merge branch 'YosysHQ:main' into main

This commit is contained in:
Akash Levy 2025-07-15 00:04:28 -04:00 committed by GitHub
commit 082adf8684
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1574 additions and 143 deletions

View file

@ -392,9 +392,21 @@ static void find_cell_sr(std::vector<const LibertyAst *> cells, IdString cell_ty
continue;
if (!parse_next_state(cell, ff->find("next_state"), cell_next_pin, cell_next_pol, cell_enable_pin, cell_enable_pol))
continue;
if (!parse_pin(cell, ff->find("preset"), cell_set_pin, cell_set_pol) || cell_set_pol != setpol)
if (!parse_pin(cell, ff->find("preset"), cell_set_pin, cell_set_pol))
continue;
if (!parse_pin(cell, ff->find("clear"), cell_clr_pin, cell_clr_pol) || cell_clr_pol != clrpol)
if (!parse_pin(cell, ff->find("clear"), cell_clr_pin, cell_clr_pol))
continue;
if (!cell_next_pol) {
// next_state is negated
// we later propagate this inversion to the output,
// which requires the swap of set and reset
std::swap(cell_set_pin, cell_clr_pin);
std::swap(cell_set_pol, cell_clr_pol);
}
if (cell_set_pol != setpol)
continue;
if (cell_clr_pol != clrpol)
continue;
std::map<std::string, char> this_cell_ports;
@ -432,12 +444,14 @@ static void find_cell_sr(std::vector<const LibertyAst *> cells, IdString cell_ty
for (size_t pos = value.find_first_of("\" \t"); pos != std::string::npos; pos = value.find_first_of("\" \t"))
value.erase(pos, 1);
if (value == ff->args[0]) {
// next_state negation propagated to output
this_cell_ports[pin->args[0]] = cell_next_pol ? 'Q' : 'q';
if (cell_next_pol)
found_noninv_output = true;
found_output = true;
} else
if (value == ff->args[1]) {
// next_state negation propagated to output
this_cell_ports[pin->args[0]] = cell_next_pol ? 'q' : 'Q';
if (!cell_next_pol)
found_noninv_output = true;

View file

@ -26,6 +26,11 @@
#include <vector>
#include <set>
/**
* This file is likely to change in the near future.
* Rely on it in your plugins at your own peril
*/
namespace Yosys
{
struct LibertyAst