[LSQ] Proposal for LSQ Generator Refactoring, Improvements, and Documentation #264
Replies: 4 comments
-
I think it's a good idea to start from what @qianxu1998 provided and slowly move to a more modular system! From a software perspective, I expect that having the code generation made out of string concatenation can be suboptimal for maintainability. Maybe jinja can be an alternative? (TLDR: Python templating engine that dynamically generates text files using placeholders and control structures). @qianxu1998 did you consider this possibility when starting the project? |
Beta Was this translation helpful? Give feedback.
-
Thank you for the suggestions. I agree that using a template engine is the right approach. To clarify, this project was not initiated by me. As mentioned in the pull request description, the core logic (specifically in lsq_core.py) remains nearly identical to the original version. My contribution was focused on adding the necessary integration logic. During wrapper generation, I aimed to reuse the existing structure to avoid restructuring the entire codebase. That said, I agree that a complete restructuring would be beneficial for improving code clarity and extensibility. |
Beta Was this translation helpful? Give feedback.
-
Just a heads up for @pcineverdies, we should be starting a student project on this in the next term, though we are going to use our new approval process for it also. My thoughts for moving forward-
|
Beta Was this translation helpful? Give feedback.
-
Good morning everyone! I have a question related to the LSQ implementation. I wonder if @qianxu1998, @Jiahui17 or @murphe67 can give me some insights about my issues. In Dynamatic as it has been since 2018, we allocate the group in the LSQ thanks to the cmerges, which follow the order of the BBs in the program's CFG. I tend to say that, as a consequence of this, at most 1 group allocation can be done for a LSQ in one clock cycle (I am referring here to allocations related to different groups connected to the same LSQ). Do you have any idea whether the LSQ is robust enough to support allocations of different groups in the same clock cycle? Does it even make sense in the context of the LSQ? My question arises as one of the features of Fast Token Delivery is the - so called - Straight To The Queue which allows to speed up group allocations. However, in some "safe" scenarios, the algorithm of the paper would allow multiple group allocations in the same clock cycle. Yesterday me and @rpirayadi had a |
Beta Was this translation helpful? Give feedback.
-
[LSQ] Proposal for LSQ Generator Refactoring, Improvements, and Documentation
Introduction
Thanks to Hailin (@bertwhl) and Jiantao (@qianxu1998), now we can generate LSQs with substantially better area and frequency (#211). Yet, a few main things are missing:
There are a few minor things to improve as well, besides the points above:
Code Organization Idea
One possible way to organize the directory would be (I am improvising here):
Now, everything is in one file; the FIFO logic, dependency checking logic, and the logic that instantiates the rest of the LSQ components (group allocator, etc) are in one function.
It would be great if we could:
lsq_*.py
).Integration Idea
We can incrementally create the subcomponents in
experimental/tools/lsq-generator-python
and eventually graduate it to non-experimental.Remarks
What do you think? Anything to add?
Beta Was this translation helpful? Give feedback.
All reactions