cpldcpu / BitNetPDK

A proof-of-concept (hack) to implement neural network inference on a very tiny 8-bit microcontroller.
GNU General Public License v3.0
68 stars 6 forks source link

What's the issue with newer SDCC? IS there an upstream bug report? #1

Open spth opened 6 months ago

spth commented 6 months ago

The README mentions "Use SDCC 4.1.0 to build. Later versions create broken code". What is the problem here? Is there a corresponding ticket in the SDCC bug tracker?

cpldcpu commented 6 months ago

It's the same issue that I brought up in the free-pdk examples. I haven't been able to pinpoint the error back then.

spth commented 6 months ago

The one that turned out to be a mov vs. mov.io issue: https://github.com/free-pdk/free-pdk-examples/issues/13 ?

cpldcpu commented 6 months ago

Yeah, the compatibility-breaking change seems to have been one regarding IO instructions.

My old UART routines compiled without error, but resulted in nonfunctional code. Very annoying and difficult to debug. I solved it by reverting to an older version of SDCC. I may need to find some time to figure out how to make it compatible to the newer SDCC versions.

spth commented 6 months ago

Then the solution should be easy: in all the I/O that you do via inline asm, change the instructions used to mov.io, set0.io, etc. My recommendation: except for the few places where inline asm really provides an advantage, just use C.

cpldcpu commented 6 months ago

Just unrelated topic on this side: Any plans to migrate SDCC to git or even github? Would simplify submission of error reports significantly. Nowadays, I (and many others) have very little cross section to SVN and sourceforge and having to work with an unfamiliar system adds significant friction.

spth commented 6 months ago

AFAIK, there are no plans for a migration. But it looks like we'll get an official git mirror of the svn repo.

spth commented 6 months ago

Please check if the free-pdk examples work for you now. If yes, you can port the fixes there to here.