bronzebeard icon indicating copy to clipboard operation
bronzebeard copied to clipboard

Support for RV32EC (embedded) configuration?

Open efficacy opened this issue 1 year ago • 3 comments

I love the minimal no-nonsense approach of this project (which I found when looking for a Risc-V assembler FORTH and finding Derzforth) and it seems a great fit for embedded development on small Risc-V microcontrollers. There are now some interesting, and very low cost, Risc-V chips and development boards available which use the RV32EC configuration (rather than the fuller RV32IMAC) such as the CH32V003 "ten cent" chip which has caught a lot of media attention. I would love to be able to use bronzebeard to develop software for these as well as the more expensive Longan and SiFive boards which you support.

Would you consider adding RV32EC support in bronzebeard?

efficacy avatar Jun 13 '23 08:06 efficacy

First off, thanks for considering bronzebeard and bringing this up! I haven't looked into RV32E until today and it looks like it differs from RV32I in that it supports only 16 registers instead of the usual 32. The instruction set and other details are unchanged.

So, I'd assume that bronzebeard would already support these chips in the sense that the user would be responsible for only using valid registers (x0-x15). However, it could be useful to add a flag that enforces this constraint and throws an error if an invalid register is used.

Similarly, such a feature could probably be applied to other scenarios: (using mul on a chip without M support, etc).

theandrew168 avatar Jun 13 '23 19:06 theandrew168

I did a blinky on CH32V003 chip with bronzebeard and was successful

sahasradal avatar Jul 16 '23 20:07 sahasradal

DID a sample usart TX with bronzebeard for CH32V003 and was successful. crude code in my repository

sahasradal avatar Jul 16 '23 20:07 sahasradal