From: Miodrag Milanovic Date: Wed, 30 Mar 2022 13:55:15 +0000 (+0200) Subject: Proper scope naming from FST X-Git-Tag: yosys-0.16~13^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e47b61cc62283722f604d8f23c8b6758b22cb82;p=yosys.git Proper scope naming from FST --- diff --git a/kernel/fstdata.cc b/kernel/fstdata.cc index 6cf28625c..c99bc61c3 100644 --- a/kernel/fstdata.cc +++ b/kernel/fstdata.cc @@ -94,20 +94,16 @@ static std::string remove_spaces(std::string str) void FstData::extractVarNames() { struct fstHier *h; - intptr_t snum = 0; + std::string fst_scope_name; while ((h = fstReaderIterateHier(ctx))) { switch (h->htyp) { case FST_HT_SCOPE: { - snum++; - std::string fst_scope_name = fstReaderPushScope(ctx, h->u.scope.name, (void *)(snum)); - if (h->u.scope.typ == FST_ST_VCD_MODULE) - scopes.push_back(fst_scope_name); + fst_scope_name = fstReaderPushScope(ctx, h->u.scope.name, NULL); break; } case FST_HT_UPSCOPE: { - fstReaderPopScope(ctx); - snum = fstReaderGetCurrentScopeLen(ctx) ? (intptr_t)fstReaderGetCurrentScopeUserInfo(ctx) : 0; + fst_scope_name = fstReaderPopScope(ctx); break; } case FST_HT_VAR: { @@ -116,7 +112,7 @@ void FstData::extractVarNames() var.is_alias = h->u.var.is_alias; var.is_reg = (fstVarType)h->u.var.typ == FST_VT_VCD_REG; var.name = remove_spaces(h->u.var.name); - var.scope = scopes.back(); + var.scope = fst_scope_name; var.width = h->u.var.length; vars.push_back(var); if (!var.is_alias) diff --git a/kernel/fstdata.h b/kernel/fstdata.h index 0e9d27e2c..d8dca5fb0 100644 --- a/kernel/fstdata.h +++ b/kernel/fstdata.h @@ -60,7 +60,6 @@ private: void extractVarNames(); struct fstReaderContext *ctx; - std::vector scopes; std::vector vars; std::map handle_to_var; std::map name_to_handle;