[Libre-soc-bugs] [Bug 523] demo program needed showing register dependencies

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Oct 30 07:09:44 GMT 2020


https://bugs.libre-soc.org/show_bug.cgi?id=523

--- Comment #7 from Jacob Lifshay <programmerjake at gmail.com> ---
As a (hopefully workable) compromise, I added support for C/C++ to the code I
wrote so we can have the simulator written in C++ and all the code for
interfacing with the Web using WebAssembly, formatting the output, and other
stuff will be written Rust.

I added a readme containing build instructions for the web:
https://salsa.debian.org/Kazan-team/power-cpu-sim/-/blob/master/README.md

To build for non-web, you still need to follow the steps up to installing a
matching version of clang.

Then, you can just run `cargo build` and the native executable is generated in
`target/debug/power-cpu-sim`, or you can just run `cargo run --
<power-cpu-sim's args>`.

All C/C++ files in the c-src directory are automatically detected and built, I
told cargo to track them as dependencies.

One issue with C++ is, since we want to support the web without tons of extra
code, a lot of the C/C++ standard libraries aren't available. I passed the
`-ffreestanding -nostdlibinc` args to clang to ensure we don't accidentally
depending on a bunch of code that won't work on the web, since I'm assuming
Luke will probably just test the non-web version when working on code.

We should have memory allocation support, but not a whole lot more.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list