-
Notifications
You must be signed in to change notification settings - Fork 627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Vpi Generate Scopes #4913
Fix Vpi Generate Scopes #4913
Conversation
2b7fb08
to
8eee72b
Compare
6ad2a78
to
5866d99
Compare
Just "t" here is more correct, right? I think this was because VerilatedVpioScope name() was updated to match how it's handled for module |
Check with other simulators but yes I think vpiName should be "t", vpiFullName "top.t". |
00b7620
to
2ccde93
Compare
2ccde93
to
0acc0ec
Compare
@@ -206,16 +134,6 @@ t (vpiModule) t | |||
t.outer_scope[2].inner_scope[1].arr.LENGTH (vpiParameter) t.outer_scope[2].inner_scope[1].arr.LENGTH | |||
vpiConstType=vpiBinaryConst | |||
t.outer_scope[2].inner_scope[2] (vpiGenScope) t.outer_scope[2].inner_scope[2] | |||
vpiModule: | |||
t.outer_scope[2].inner_scope[2].arr (vpiModule) t.outer_scope[2].inner_scope[2].arr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was repeated (vpiModule and vpiInternalScope), now just vpiInternalScope is needed.
@@ -38,7 +38,7 @@ std::map<int32_t, std::vector<int32_t>> iterate_over = [] { | |||
}; | |||
|
|||
std::vector<int32_t> module_options = { | |||
vpiModule, // Aldec SEGV on mixed language | |||
// vpiModule, // Aldec SEGV on mixed language |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed for iteration now that vpiInternalScope is supported
@@ -1978,13 +2004,21 @@ vpiHandle vpi_iterate(PLI_INT32 type, vpiHandle object) { | |||
return ((new VerilatedVpioVarIter{vop, true})->castVpiHandle()); | |||
} | |||
case vpiModule: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case vpiModule is the child type we want to iterate over, not the parent type. So any scope should be valid for iteration
if (i < scopename.length()) pos = i++; | ||
} | ||
} | ||
if (VL_UNLIKELY(pos == std::string::npos)) m_toplevel = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only a module can be top level, so I moved this down a class
This should be ready to merge as well now |
This gets us a lot closer to parity with Xcelium / Icarus, and only adds extra verilated code if vpi is turned on.
Addresses #3609
Depends on #4838