The tutorial code does not work as-is for my CuV1 with IOv2.
I received the following errors:
Issues detected in alchitry_top.luc: Error at line 41 offset 4: Failed to resolve signal “result” Error at line 42 offset 20: Failed to resolve signal “result”
Those lines were:
result = io_dip[1] * io_dip[0]
io_led = $build(result, 3)
Copilot said " the error you’re seeing is due to a missing signal declaration for result
. In Lucid, every signal must be explicitly declared before it’s used, even temporary ones created inside an always
block."
And then told me to add “sig result[8]” before the always.
It cleared that error but the second one, i.e. “Error at line 43 offset 20: The array “result” can’t be split evenly” remained.
Then Copilot told me: " Ah, now we’re bumping into a classic Lucid quirk. That error means the $build(result, 3)
statement is trying to split the result
array into 3 equal parts — but the math doesn’t work out."
And told me to change the previously added to "sig result[24]
This worked. Why didn’t the tutorial code work without making this change?
Are you looking at this tutorial? Io Element
It talks about the result
signal in the section titled Math
Did you just miss that or is something else unclear?
Thanks for your reply. Yes, I must have missed that line.