3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-30 16:03:17 +00:00

Merge pull request #4834 from YosysHQ/emil/gzip-refactor

Memory-efficient zlib usage across Liberty file consumers
This commit is contained in:
KrystalDelusion 2025-03-21 10:01:00 +13:00 committed by GitHub
commit b06a661913
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 714 additions and 536 deletions

View file

@ -23,6 +23,7 @@
#include "kernel/celltypes.h"
#include "passes/techmap/libparse.h"
#include "kernel/cost.h"
#include "kernel/gzip.h"
#include "libs/json11/json11.hpp"
USING_YOSYS_NAMESPACE
@ -347,13 +348,12 @@ statdata_t hierarchy_worker(std::map<RTLIL::IdString, statdata_t> &mod_stat, RTL
void read_liberty_cellarea(dict<IdString, cell_area_t> &cell_area, string liberty_file)
{
std::ifstream f;
f.open(liberty_file.c_str());
std::istream* f = uncompressed(liberty_file.c_str());
yosys_input_files.insert(liberty_file);
if (f.fail())
if (f->fail())
log_cmd_error("Can't open liberty file `%s': %s\n", liberty_file.c_str(), strerror(errno));
LibertyParser libparser(f);
f.close();
LibertyParser libparser(*f);
delete f;
for (auto cell : libparser.ast->children)
{