[#73220] add signals duplicates in child scopes
This commit is contained in:
parent
05fdfca5b1
commit
a45f521ca2
|
|
@ -257,8 +257,8 @@ void VerilatedSaif::recursivelyPrintScopes(uint32_t scopeIndex) {
|
||||||
bool anyNetValid{true};
|
bool anyNetValid{true};
|
||||||
|
|
||||||
//NOTE: for now only care about NET, also PORT will be added
|
//NOTE: for now only care about NET, also PORT will be added
|
||||||
for (auto& childSignalCode : saifScope.childSignalCodes) {
|
for (auto& [code, signalName] : saifScope.childSignals) {
|
||||||
ActivityVar& activity = m_activity.at(childSignalCode);
|
ActivityVar& activity = m_activity.at(code);
|
||||||
for (size_t i = 0; i < activity.width; i++) {
|
for (size_t i = 0; i < activity.width; i++) {
|
||||||
auto& bit = activity.bits[i];
|
auto& bit = activity.bits[i];
|
||||||
if (bit.lastVal && activity.lastTime < m_time) {
|
if (bit.lastVal && activity.lastTime < m_time) {
|
||||||
|
|
@ -280,7 +280,7 @@ void VerilatedSaif::recursivelyPrintScopes(uint32_t scopeIndex) {
|
||||||
|
|
||||||
printIndent();
|
printIndent();
|
||||||
printStr("(");
|
printStr("(");
|
||||||
printStr(activity.name.c_str());
|
printStr(signalName);
|
||||||
if (activity.width > 1) {
|
if (activity.width > 1) {
|
||||||
printStr("[");
|
printStr("[");
|
||||||
printStr(std::to_string(activity.lsb + i).c_str());
|
printStr(std::to_string(activity.lsb + i).c_str());
|
||||||
|
|
@ -451,6 +451,9 @@ void VerilatedSaif::popPrefix() {
|
||||||
|
|
||||||
void VerilatedSaif::declare(uint32_t code, const char* name, const char* wirep, bool array,
|
void VerilatedSaif::declare(uint32_t code, const char* name, const char* wirep, bool array,
|
||||||
int arraynum, bool bussed, int msb, int lsb) {
|
int arraynum, bool bussed, int msb, int lsb) {
|
||||||
|
assert(m_currentScope >= 0);
|
||||||
|
m_scopes.at(m_currentScope).childSignals.emplace_back(code, name);
|
||||||
|
|
||||||
// check if already declared to avoid duplicates
|
// check if already declared to avoid duplicates
|
||||||
if (m_activity.count(code)) {
|
if (m_activity.count(code)) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -478,9 +481,6 @@ void VerilatedSaif::declare(uint32_t code, const char* name, const char* wirep,
|
||||||
finalName += ']';
|
finalName += ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(m_currentScope >= 0);
|
|
||||||
m_scopes.at(m_currentScope).childSignalCodes.emplace_back(code);
|
|
||||||
|
|
||||||
m_activity.emplace(code, ActivityVar{
|
m_activity.emplace(code, ActivityVar{
|
||||||
finalName,
|
finalName,
|
||||||
static_cast<uint32_t>(lsb),
|
static_cast<uint32_t>(lsb),
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ struct ActivityVar {
|
||||||
struct SaifScope {
|
struct SaifScope {
|
||||||
std::string scopeName{};
|
std::string scopeName{};
|
||||||
std::vector<int32_t> childScopesIndices{};
|
std::vector<int32_t> childScopesIndices{};
|
||||||
std::vector<uint32_t> childSignalCodes{};
|
std::vector<std::pair<uint32_t, const char*>> childSignals{};
|
||||||
int32_t parentScopeIndex{-1};
|
int32_t parentScopeIndex{-1};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue