-
Notifications
You must be signed in to change notification settings - Fork 82
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
Possible preprocessor problem. #232
Comments
Hello Bernd, Sorry, you stumbled on one of the very few breaking changes I had to make thus far (I try very hard not to introduce any). The fix is very simple but requires a code change: algorithm main(
$$if ICESTICK then
output uint5 leds, inout uint8 pmod
$$else
output uint5 leds
$$end
) {
while (1) {
}
} The rule is that you can freely have preprocessor if-then-else between the '(' and ')' of the algorithm (or unit) in/out declaration, and between the '{' and '}' of the algorithm block. However there should not be an if-then-else enclosing and repeating these parentheses and braces. I had to introduce this constraint when implementing the new preprocessor (that allows instantiation time preprocessing). There is a technical constraint there that the preprocessor has to be able to extract a 'simple' form of the algorithm or unit, free of top level if-then-else. I was hopeful no one would encounter this breaking change, but you just prove me wrong ;-) I'll revise the documentation and try to clarify the error message. Thanks for the report! |
Hello Sylvain, thank you for the explanation. Regards, Bernd. |
Hello Sylvain,
the following source for the icestick results in a preprocessor error. This worked with an earlier Silice version from May 2022.
Regards, Bernd.
The text was updated successfully, but these errors were encountered: