Closed avelure closed 4 months ago
There seems to be some discrepancies for the checking of pureness. In the MWE below the functionality is the same, for the function calls
test
,test2
andtest3
, butproc
calls an impure function to fetch the shared variable value and thus gets away without an error.
I've fixed this so the code above now produces an error but it's quite easily defeated by changing the order so that the "proc" bodies come after the "test" bodies. I noticed ModelSim has exactly the same behaviour though.
I also notice that the pureness check creates an error even with
--relaxed
. I guess it should be possible to just mark the function as impure when it is encountered and add a warning with--relaxed
? There is a few instances of this issue in UVVM that needs to be fixed.
Yes it should be fine, I've changed this.
Another thing; I don't know how much the impure functions affects performance, but maybe it would be useful to warn the user about impure functions that don't need to be impure. I can create a new issue if you think it is useful and doable to implement.
At the moment no, the pureness isn't used by the code generator. Although it ought to be possible to optimise, say, two calls to F(3)
to a single call and then reuse the result.
There seems to be some discrepancies for the checking of pureness. In the MWE below the functionality is the same, for the function calls
test
,test2
andtest3
, butproc
calls an impure function to fetch the shared variable value and thus gets away without an error.I also notice that the pureness check creates an error even with
--relaxed
. I guess it should be possible to just mark the function as impure when it is encountered and add a warning with--relaxed
? There is a few instances of this issue in UVVM that needs to be fixed.Another thing; I don't know how much the impure functions affects performance, but maybe it would be useful to warn the user about impure functions that don't need to be impure. I can create a new issue if you think it is useful and doable to implement.