Closed natalieagus closed 4 weeks ago
This is actually three bugs.
First, you are correct. The loop count should be 9.
Second, the initial error was a bug in the driver check where it would look only at the most recent write to a signal instead of all writes. Since sub_value
was conditionally written in an if statement, it thought it wasn't guaranteed to have a value even though it has a default value.
These two were fixed in commit https://github.com/alchitry/Alchitry-Labs-V2/commit/6ffd35331f5136df71971a5fc72258da90efa176
The last issue is a bigger one and I opened a new bug report, #18, with it.
I tried to use
binToDec
component and met this syntax error:Since it's a component file and read-only, I can't directly modify it. The error in
binToDec.luc
won't show up unless we instantiate DIGITS, e.g: inalchitryTop.luc
:Attempt to fix
I tried to move the definitions of the signals outside and initialise their values (I call this
binToDecV1
), and it works well on simulation, but not on compilation.This is the bug reported during build, something about "Function "pow" should always be constant but didn't have a value!"
Here's the problematic line:
It was fine for build in Lucid V1, line 57.
Other bugs
The need for "instantiating"
scale
andsub_value
?If I were to comment out these two lines to match
bin_to_dec.luc
in Lucid V1:I will get this error:
I thought that since
scale
andsub_value
is always defined whenever it is used, it shouldn't give out this error.Innermost repeat index bug
The original
binToDec.luc
component has this clause towards the end,I believe it should be
repeat(i, 9, 9, -1)
to loop for each possible value (starting from 9).