I finally got everything set-up in such a way that NEORV32, when compiled within the Litex framework, works on the ULX3S!
Here are a few notes about this PR, which is not perfect by any means...
The machine registers have been added. They substitute the base NEORV32 ones by the Litex ones.
There are some style warnings due to the comments.
The bsp.adb saw a few changes due to the difference in the machine registers. I followed the setup used in the C code examples used by Litex.
I modified the linker so that everything would fall into RAM and ROM would not get used. This is a bit counter intuitive, so let me explain.
The core does allow for RAM & ROM at the specified regions, there is no issue there.
The CPU starts executing RAM at address 0x40000000. The _startup code was in the ROM region, therefore, nothing was being executed correctly.
The way I upload the kernel to the board is by uploading it via serial when the board resets and it starts executing immediately after the load. Therefore, putting everything into RAM just makes it work :)
Maybe I could change the _startup region to go into RAM and the rest could be left as is... But I have not tested it and I would also prefer to hear if you have any feedback on the mater.
The MTIME addresses had to be changed in the configure.in file. I updated the values as per the latest documentation of the NEORV32 core.
The base MTIME address values may have changed from when you started adding support to the NEORV32. The CPU does sometimes see some breaking changes. I am using version 1.9.7 of the NEORV32 softcore (the one currently in use by Litex)
The code is formatted in the default manner that Emacs formats it. It is not as clean nor as pretty as they style you are using for the Ada files...
Could I ask you if it is fine if you format them/style them? I did not find a gnat pretty or gnatpp command in the repository to format the files...
I hope these changes are fine by you. The leds are blinking and the UART works :)
Hi Gabriele,
I finally got everything set-up in such a way that NEORV32, when compiled within the Litex framework, works on the ULX3S!
Here are a few notes about this PR, which is not perfect by any means...
bsp.adb
saw a few changes due to the difference in the machine registers. I followed the setup used in the C code examples used by Litex.configure.in
file. I updated the values as per the latest documentation of the NEORV32 core.gnat pretty
orgnatpp
command in the repository to format the files...I hope these changes are fine by you. The leds are blinking and the UART works :)
Best regards, Fer