3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-19 05:35:47 +00:00

Merge branch 'YosysHQ:main' into main

This commit is contained in:
Akash Levy 2025-11-18 11:48:04 -05:00 committed by GitHub
commit a90a5e10d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 32 additions and 122 deletions

View file

@ -158,7 +158,6 @@ extern "C" {
void yosys_atexit()
{
RTLIL::OwningIdString::collect_garbage(false);
#if defined(YOSYS_ENABLE_READLINE) || defined(YOSYS_ENABLE_EDITLINE)
if (!yosys_history_file.empty()) {
#if defined(YOSYS_ENABLE_READLINE)

View file

@ -248,15 +248,14 @@ struct IdStringCollector {
int64_t RTLIL::OwningIdString::gc_ns;
int RTLIL::OwningIdString::gc_count;
void RTLIL::OwningIdString::collect_garbage(bool trace)
void RTLIL::OwningIdString::collect_garbage()
{
int64_t start = PerformanceTimer::query();
#ifndef YOSYS_NO_IDS_REFCNT
IdStringCollector collector;
if (trace)
for (auto &[idx, design] : *RTLIL::Design::get_all_designs()) {
collector.trace(*design);
}
for (auto &[idx, design] : *RTLIL::Design::get_all_designs()) {
collector.trace(*design);
}
int size = GetSize(global_id_storage_);
for (int i = static_cast<int>(StaticId::STATIC_ID_END); i < size; ++i) {
RTLIL::IdString::Storage &storage = global_id_storage_.at(i);

View file

@ -574,7 +574,7 @@ struct RTLIL::OwningIdString : public RTLIL::IdString {
}
// Collect all non-owning references.
static void collect_garbage(bool trace = true);
static void collect_garbage();
static int64_t garbage_collection_ns() { return gc_ns; }
static int garbage_collection_count() { return gc_count; }
@ -1734,6 +1734,8 @@ public:
operator std::vector<RTLIL::SigChunk>() const;
operator std::vector<RTLIL::SigBit>() const { return to_sigbit_vector(); }
const RTLIL::SigBit &at(int offset, const RTLIL::SigBit &defval) { return offset < size() ? (*this)[offset] : defval; }
RTLIL::SigBit& at(int offset) { return (*this)[offset]; }
RTLIL::SigBit at(int offset) const { return (*this)[offset]; }
[[nodiscard]] Hasher hash_into(Hasher h) const {
Hasher::hash_t val;

View file

@ -263,6 +263,7 @@ void yosys_shutdown()
delete yosys_design;
yosys_design = NULL;
RTLIL::OwningIdString::collect_garbage();
for (auto f : log_files)
if (f != stderr)