-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
『Help』Component Interface Name Changes Result in SpinalHDL Generating Excessive Redundant Module.v Files. #1416
Comments
Hi, Yes right. It is kinda tricky, because "clk${id}_clock" is kinda a helpless name to give to the pulled clock signal. it will make things lose information. Maybe an alternative would be to have the possibility to propose a name to something in a component ahead of time, in case it get pulled through ? |
Good morning or evening, and thank you for your response! I agree! The pull function is indeed useful in complex designs or progressive development. However, it has its drawbacks. One major issue is that the naming convention for pull is not intelligent enough—especially in lower-level cells where a more fundamental and unified identifier is essential. This naming inconsistency causes challenges in code reuse. Additionally, it seems that using pull() might interfere with the effectiveness of the stub() function (although I haven’t personally replicated this issue). Another limitation is that pull cannot be used in reverse or to pull Stream types. Ideally, having a meaningful and consistent identifier at a certain level of cells or below would be the best solution. However, implementing this may not be straightforward. |
Else, one solution would be to improve the way SpinalHDL reconise component duplication. |
Thank you! |
I would no say it is a radical change, as it would interfer in a very specific place.
Every statement / expression would need to implement a new function which would return a 64 bits hash, then we hash the whole component and compare, if there is a match with already generated component, then we can check statment / expression exactly.
I would say, the first component which generate would specify the interface by being its own, the others would remap to it. |
Hello! While writing multi-clock domain code, I discovered that referencing clock domains can cause changes in the interface names of identical components. SpinalHDL mistakenly treats these components as different modules due to the interface name variations, resulting in an inability to reuse code. To address this issue, I extracted common elements and made the following modifications to the demo code (including changes to the PhasePullClockDomains object in the Phase.scala file) to improve code reusability. However, I feel that this modification lacks elegance and may hide bugs. Therefore, I’m raising this common issue to explore a more permanent solution. ⸜(๑'ᵕ'๑)⸝⋆*Below is my code:
The text was updated successfully, but these errors were encountered: