If you try to call if/while with a magma value, raise a helpful error
asking you to use peek, rather than emitting bad code downstream. We
need the user to call peek in general so you can do things like
expressions (e.g. ~magma_value) which are then code generated in the
test bench. We could implicitly covert a plain magma value, but then
this would be confusing because ~magma_value wouldn't work since this
would try to instance circuits outside of a circuit definition, so for
consistency this enforces that all values referred to in the test bench
are passed through the peek logic.
If you try to call if/while with a magma value, raise a helpful error asking you to use peek, rather than emitting bad code downstream. We need the user to call
peek
in general so you can do things like expressions (e.g. ~magma_value) which are then code generated in the test bench. We could implicitly covert a plain magma value, but then this would be confusing because ~magma_value wouldn't work since this would try to instance circuits outside of a circuit definition, so for consistency this enforces that all values referred to in the test bench are passed through the peek logic.