[Libre-soc-dev] daily kan-ban update 01sep2020

Luke Kenneth Casson Leighton lkcl at lkcl.net
Tue Sep 1 16:46:26 BST 2020


you are not going to believe what the bug is that has gone unnoticed for 5
months in CR handling.

the simulator constructs fields from the operand such as BC, FXM and so
on.  these are bit-accessible via slices so it is possible to do BO[1] and
so on.

CR tests are usually done "if CR[BC+32] " and of course BC, being 5 bits,
goes into a SelectableInt of size 5, because the BC field in the opcode is
5 bits. this has the unintended sideeffect of making any operations modulo
32.

any number plus 32 modulo 32 (because it of course fits into 5 bits) is the
original number.

argh.

on and off i must have been hunting for this bug for 5 days.

i have an interim "adequate" hack/solution that will do the job.  the
"correct" solution is to do the arithmetic at the correct bitwidth or
convert to integers.

l.



-- 
---
crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68


More information about the Libre-soc-dev mailing list