Building RISC-V Atom
Clone the repository
$ git clone https://github.com/saursin/riscv-atom.git $ cd riscv-atom # switch to riscv-atom directory
All the commands are executed from the root directory unless explicitly mentioned. We’ll refer to this root directory as
Edit Config.mk file and provide paths appropriately
RISC-V Atom environment variables
RVATOMenvironment variable must point to root of riscv-atom directory for the tools & scripts to work properly.
RVATOM_LIBenvironment variable must point to the
RVATOM/sw/libfolder. This variable is used by the compile scripts to locate libcatom.
RVATOM/sourceme script is provided that you can source everytime you work with the project.
This can be done as follows:
$ source sourceme
With this method, everytime you open a new terminal, you have to source the
sourceme file. You can optionally append the aforementioned
.bashrc to source it automatically everytime you open a new terminl.
$ echo "source <rvatom-path>/sourceme" >> ~/.bashrc
In the above command replace
rvatom-path with the path to your RISC-V atom directory.
Building the Simulator
Let’s build AtomSim simulator for
$ make soctarget=atombones
This will create
RVATOM/sim/run directories for Atomsim build files and runtime files respectively.
You can find the Atomsim executable in the former directory.
Assuming you’ve sourced the
RVATOM/sourceme file, try the following command to verify the build.
$ atomsim --help AtomSim v_._ Interactive RTL Simulator for Atom based systems [ atombones ] Usage: atomsim [OPTION...] input ...