You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several issues with the generation of loops in the ETISS Backend:
Generated while and do ... while statements do not have curly braces. If coverage is enabled the only line in the loop body will be like cp.code() += "etiss_coverage_count(1, 5154);\n"; leading to unexpected behaior Solution: easy fix possible by adding missing {, }
break statements are always considered static, even if their execution actually depends on a non-static if statement Solution: Fix would be to either declare a breaks/continues as non-static or keep track if the staticness of all Contionals...
Loops are classified as static even if they may conditionally exit early via a break or continue statements Solution: Needs to analyze loop body in addition to loop condition
parser splits up For loops in multiple statements (count_var delarator (+ count_var initializer) + actual Loop statement) which means that a non-static Loops will still have a statically-generated count_var (e.g. i) which of course breaks the simulation Solution: More difficult to handle as the behav.Loop does not know about his predecessor when is is being visited. We would either need to move the initialization statements into the behav.Loop class (self.init_exprs) or have to detect this one-layer earlier
The easiert workaround is of course to disable static loops entirely, but this is not a long-term solution...
There are several issues with the generation of loops in the ETISS Backend:
whileanddo ... whilestatements do not have curly braces. If coverage is enabled the only line in the loop body will be likecp.code() += "etiss_coverage_count(1, 5154);\n";leading to unexpected behaiorSolution: easy fix possible by adding missing
{,}breakstatements are always considered static, even if their execution actually depends on a non-static if statementSolution: Fix would be to either declare a breaks/continues as non-static or keep track if the staticness of all Contionals...
breakorcontinuestatementsSolution: Needs to analyze loop body in addition to loop condition
i) which of course breaks the simulationSolution: More difficult to handle as the behav.Loop does not know about his predecessor when is is being visited. We would either need to move the initialization statements into the behav.Loop class (self.init_exprs) or have to detect this one-layer earlier
The easiert workaround is of course to disable static loops entirely, but this is not a long-term solution...