I'm enjoying your FemtoRV/TUTORIALS/FROM_BLINKER_TO_RISCV tutorial!
I came up with a few multiplication subroutine variants. This one, for example, simulates fine with run.sh but does not yield the expected LED outputs on the IceStick. I have had no problems with previous exercises and examples.
`include "riscv_assembly.v"
integer START_ = 0;
integer MUL_ = 20;
integer MUL_LOOP_ = 28;
integer MUL_DONE_ = 44;
initial begin
Label(START_);
// 3 x 4 = 12 = 0b1100
LI(a0,3);
LI(a1,4);
CALL(LabelRef(MUL_));
EBREAK();
// multiply function
Label(MUL_);
LI(a2,0); // result
LI(a3,0); // 1..a1
Label(MUL_LOOP_);
BEQ(a3,a1,LabelRef(MUL_DONE_));
ADD(a2,a2,a0); // result += a0
ADDI(a3,a3,1);
J(LabelRef(MUL_LOOP_));
Label(MUL_DONE_);
MV(a0,a2);
RET();
endASM();
end
However, running this on the IceStick does not yield the expected LED pattern. Actually, no LEDs are lit at all.
I can provide the complete step14_mul_func.v if necessary, but it's literally just the assembly code section that has changed from step14.v, changed to the listing above.
I'm enjoying your FemtoRV/TUTORIALS/FROM_BLINKER_TO_RISCV tutorial!
I came up with a few multiplication subroutine variants. This one, for example, simulates fine with
run.sh
but does not yield the expected LED outputs on the IceStick. I have had no problems with previous exercises and examples.The output of:
is:
which is the expected result.
However, running this on the IceStick does not yield the expected LED pattern. Actually, no LEDs are lit at all.
I can provide the complete
step14_mul_func.v
if necessary, but it's literally just the assembly code section that has changed fromstep14.v
, changed to the listing above.