Skip to content
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

Bugfix to enable monitoring aliased vars #675

Merged
merged 7 commits into from
May 2, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/lava/magma/core/process/ports/ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,9 +646,16 @@ def create_implicit_var_port(var: Var) -> "ImplicitVarPort":
vp.process = var.process
# VarPort name could shadow existing attribute
if hasattr(var.process, vp.name):
raise AssertionError(
"Name of implicit VarPort might conflict"
" with existing attribute.")
found_unique_name = False
AlessandroPierro marked this conversation as resolved.
Show resolved Hide resolved
name = ""
i = 0
# Find a unique name
while not found_unique_name:
i += 1
name = vp.name + "_" + str(i)
if not hasattr(var.process, vp.name):
found_unique_name = True
vp.name = name
setattr(var.process, vp.name, vp)
var.process.var_ports.add_members({vp.name: vp})

Expand Down