From d75b6bb3d71afb04071c8d79c38b6e5d168a1dab Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Sat, 4 Jan 2025 12:18:19 +0100 Subject: [PATCH] dfflibmap: allow gzipped liberty files --- passes/techmap/clockgate.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/passes/techmap/clockgate.cc b/passes/techmap/clockgate.cc index bdfb94170..03c436996 100644 --- a/passes/techmap/clockgate.cc +++ b/passes/techmap/clockgate.cc @@ -1,5 +1,6 @@ #include "kernel/yosys.h" #include "kernel/ff.h" +#include "kernel/gzip.h" #include "libparse.h" #include @@ -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()); + 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); merged.merge(p); - f.close(); + delete &f; } std::tie(pos_icg_desc, neg_icg_desc) = find_icgs(merged.cells, dont_use_cells);