Closed at91rm9200 closed 2 years ago
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! Best regards, Sylvain
New documentation section: https://github.com/sylefeb/Silice/blob/master/learn-silice/Documentation.md#preprocessor-constraints
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.