-
Notifications
You must be signed in to change notification settings - Fork 49
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
const variables #65
Comments
A large part of this is figuring out how to make the place and route tools not fail on these 'const' paths once they are there... Need to structure code as to be able to use PNR specific things settings for turning off timing on certain paths False paths , multi paths, async domains ... something |
Also const is a good keyword idea But I want to make sure it's not confuse: Maybe getting at const vs constexpr ? |
Can you use const variables to calculate other const variables? |
nextpnr info on constraining clocks (and lack of clocks?) |
Looks like nextpnr can't false path certain logic So will probably need to have the slow per frame logic as 'a slow other clock domain' and the default behavior will be to not time the comb paths between |
I realize now that I have been confusing the simple request for "const meaning don't generate registers" with a more complex set of functionality that is specific to our project Victor I plan to create issues that break down how to use const as the last step in more advanced functionality and not make this issue more complicated than it needs to be @suarezvictor |
Ok outlining what needs to happen in order to implement this issue: @suarezvictor "Const means no regs for that variable". A consequence of removing registers along variable/wires means now previously separate chunks of combinatorial logic are no longer separate and can form long delay paths. The PipelineC tool wont be able to pipeline these regions if they become part of the design critical path. The tool will likely get stuck iterating forever or end failing to meet timing in that case. Adding 'const' shouldn't ever make your design not meet timing/make pnr fail. :-/ The user can work around this issue by adding their own registers around the 'const' usage to fix the paths PipelineC can't, but it's not something to assume of people.
Finally - I think 'const' variables in general makes sense for 1) false paths. But I dont think const is the best way to communicate 2) "the path is timed but very very slow clock" because paths between clock domains is something pipelinec already has concepts for. In the issues listed under 2) the missing support can be added and I think we can get close to what 'const' variables is trying to do without fully implementing false paths which sadly nextpnr doesnt support right now. |
I understand the complexity and thank you take the time to address it. However I doubt it's only useful for graphics projects. I think this would apply to any kind of computations using nested loops. Think of iterative matrix computation for example. While you calculate let's say columns, rows are fixed. I think many concrete examples will appear where some data changes at high speed while other data remains constant till the end of the fast computation. |
I think its worth it to note @suarezvictor I said With that said, I am open to something intentionally less friendly perhaps something like a There are already So maybe some thought into if that is confusing? |
Also if we can't settle on a keyword can always try a pragma |
Per #68 there is a The real work is then propogating this ASYNC (or volatile or whatever its called) across logic. As I said earlier |
As of ccd0e81 As seen in the many comments - this did spawn several related issues of future work still. |
for variables declared as const, never generate registers for the pipeline (just wires)
This will ease the job of the synth tool and be easier than tracking if the variables changes (and makes syntax and purpose of functions more clear)
The text was updated successfully, but these errors were encountered: