-
Notifications
You must be signed in to change notification settings - Fork 9
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
Subtype resolution is not finding subtype when defined in another pkg file in another library #81
Comments
Can you provide the example VHDL code you're using to investigate it? Please note: |
I understand that the linking of types and objects is experimental. So far the linking of types has been very useful, and it just seems that some edge cases have issues. Are you open to me reporting more issues if I encounter them? I cannot share the specific code I am using, but I created a very basic example of what causes the issue. It looks like its just an issue if a subtype is part of a different package file. Placing one of the package files in a different library didn't impact this error. This may actually be an issue now due to #78 adding resolution of record types. pkg_file1.vhd:
pkg_file2.vhd
dut.vhd
|
Yes please report them here. I'm currently trying to bring (py)GHDL and pyVHDLModel again into sync. There are 1 or 2 bugs and the current working branch doesn't pass all tests in pyGHDL + pyVHDLModel. I'll try to answer your questions and try to support you, but I'm not sure how responsive I can be. I have now 2 weeks of vacation and some Python projects need attention. Some need more code (like this) - which is ok - others need hard debugging because GitHub changed their infrastructure and broke my pipelines (that's unplanned and nasty debugging work). |
Is there a typo? I think one of them should be For me it looks like the "importing" is not correct. If the name of language entity isn't found and not present in the namespace, it feels like When this is checked, you can go on to see how the namespaces are looked up for the specific name. If it's not filled correctly, it needs to be investigated what "all" finds. |
I updated the question to align all names. I found the root cause though, which was related to using |
I like the PR. Please accept the minor update to it and I can merge it. |
/python3.11/site-packages/pyVHDLModel/init.py", line 845, in _LinkItems
subtype = package._namespace.FindSubtype(element._subtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/python3.11/site-packages/pyVHDLModel/Namespace.py", line 116, in FindSubtype
raise KeyError(f"Subtype '{subtypeSymbol._name._identifier}' not found in '{self._name}'.")
KeyError: "Subtype 'Subtype_Name' not found in 'pkg_file1'."
Subtype_Name is used in pkg_file1 but is defined in pkg_file2. I am still working through on how it searches for the subtype and why _parentNamespace might be None. Any suggestions on if this is expected to work? Or if not any thoughts on how it could work/be implemented?
The text was updated successfully, but these errors were encountered: