-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
269 additions
and
276 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
docs/pages/documentation/atomsim/atomsim_developers_guide.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
AtomSim Developer's Guide | ||
########################## | ||
|
||
AtomSim Code Structure | ||
======================= | ||
|
||
AtomSim is designed in a modular fashion to allow portability across platforms not just limited to RISC-V Atom. Checkout | ||
:ref:`AtomSim architecture<atomsim_arch>`. The source code for atomsim is located under ``RVATOM/sim`` folder. Atomsim | ||
comprises of an interactive frontend (implemented in ``interactive.cpp``), middle-end (implemented in ``simstate.cpp``) | ||
and a backends for different *soctargets* (implemened in ``backend_<soctarget>.cpp``). All AtomSim backends are | ||
implemented as a child-class of the *Backend* template class (implemented in ``backend.hpp``). The backend class | ||
implements the RTL facing side of AtomSim and is responsible for reading register values and driving any signals through | ||
the *Testbench* class (implemented in ``testbench.hpp``). | ||
|
||
Adding a New Backend to AtomSim | ||
================================ | ||
|
||
- Adding new backend involves adding a new backend class that extends the *Backend* class (in ``backend.hpp``). | ||
- All soctarget backends must override all the methods marked with ``[** OVERRIDE **]`` comment in the *Backend* class | ||
(parent) as bare-minimum. | ||
- The methods marked with ``[** MAY OVERRIDE **]`` can optionally be overriden in child classes depending on the intended | ||
functionality. | ||
- To allow AtomSim to *peek* and *poke* into SoC memory, user must override the ``fetch()`` and ``store()`` methods. | ||
- The backend may optioanlly use the testbench class from (``testbench.hpp``) to implement the low-level RTL facing | ||
functionality. | ||
- Users can use the *BitbangUART* class is provided in the ``bitbang_uart.cpp`` to emulate a UART device being connected | ||
to SoC. Additioanlly, the *Vuart* class is provided in ``vuart.cpp`` can be used to interface with linux serial ports. | ||
- Users may intend to not simulate the whole SoC in RTL and therefore they can create their own C++ modules to emulate | ||
some functionality and call them from their backends. One example of this is the :ref:`AtomBones<soctarget-atombones>` | ||
soctarget which only simulates the processor in RTL, everything else like memories (implemented in ``memory.cpp``), | ||
uart, etc. is emulated in C++. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.