3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-20 06:05:50 +00:00

Merge nice gzip refactor

This commit is contained in:
Akash Levy 2025-03-20 16:47:12 -07:00
commit 95f489beec
23 changed files with 719 additions and 575 deletions

View file

@ -1,5 +1,6 @@
#include "kernel/yosys.h"
#include "kernel/ff.h"
#include "kernel/gzip.h"
#include "libparse.h"
#include <optional>
@ -308,13 +309,12 @@ struct ClockgatePass : public Pass {
if (!liberty_files.empty()) {
LibertyMergedCells merged;
for (auto path : liberty_files) {
std::ifstream f;
f.open(path.c_str());
if (f.fail())
std::istream* f = uncompressed(path);
if (f->fail())
log_cmd_error("Can't open liberty file `%s': %s\n", path.c_str(), strerror(errno));
LibertyParser p(f);
LibertyParser p(*f);
merged.merge(p);
f.close();
delete f;
}
std::tie(pos_icg_desc, neg_icg_desc) =
find_icgs(merged.cells, dont_use_cells);

View file

@ -19,6 +19,7 @@
#include "kernel/yosys.h"
#include "kernel/sigtools.h"
#include "kernel/gzip.h"
#include "libparse.h"
#include <string.h>
#include <errno.h>
@ -630,13 +631,12 @@ struct DfflibmapPass : public Pass {
LibertyMergedCells merged;
for (auto path : liberty_files) {
std::ifstream f;
f.open(path.c_str());
if (f.fail())
std::istream* f = uncompressed(path);
if (f->fail())
log_cmd_error("Can't open liberty file `%s': %s\n", path.c_str(), strerror(errno));
LibertyParser p(f);
LibertyParser p(*f);
merged.merge(p);
f.close();
delete f;
}
find_cell(merged.cells, ID($_DFF_N_), false, false, false, false, false, false, dont_use_cells);