Skip to content

Class simtix::system::BaseSystem

ClassList > simtix > system > BaseSystem

Base class for all system implementations. More...

  • #include <system.h>

Inherited by the following classes: simtix::system::SingleCoreSystem

Public Functions

Type Name
BaseSystem () = default
virtual int Initialize () = 0
Initialize all components in the system.
virtual int PeekMemory (uint8_t * data, uint64_t addr, std::size_t size) = 0
Peek into memory content.
virtual int PreloadMemory (const uint8_t * data, uint64_t addr, std::size_t size) = 0
Preload memory with data.
virtual uint64_t Run (uint64_t ticks) = 0
Run the system for a given number of ticks.
virtual void TearDown () = 0
Tear down the system and release resources.
virtual ~BaseSystem () = default

Detailed Description

The BaseSystem class provide an abstract interface for system-level operations, such as memory management, initialization, and simulation.

Public Functions Documentation

function BaseSystem

simtix::system::BaseSystem::BaseSystem () = default

function Initialize

Initialize all components in the system.

virtual int simtix::system::BaseSystem::Initialize () = 0

Returns:

0 if successful, non-zero otherwise. After the system is instantiated, the simulator should use this method to initialize all the components in the system.


function PeekMemory

Peek into memory content.

virtual int simtix::system::BaseSystem::PeekMemory (
    uint8_t * data,
    uint64_t addr,
    std::size_t size
) = 0

Parameters:

  • data Pointer to the buffer to store the memory content.
  • addr Starting address in memory.
  • size Size of the memory region to peek.

Returns:

0 if successful, non-zero otherwise.

During or after simulation, simulator can use this method to peek the memory content. This is useful for dumping the memory to check the simulation result.


function PreloadMemory

Preload memory with data.

virtual int simtix::system::BaseSystem::PreloadMemory (
    const uint8_t * data,
    uint64_t addr,
    std::size_t size
) = 0

Parameters:

  • data Pointer to the data to preload.
  • addr Starting address in memory.
  • size Size of the data to preload.

Returns:

0 if successful, non-zero otherwise.

Simulator can preload the memory with this method. Note that this can only be called after the system is initialized.


function Run

Run the system for a given number of ticks.

virtual uint64_t simtix::system::BaseSystem::Run (
    uint64_t ticks
) = 0

Parameters:

  • ticks Number of ticks to run.

Returns:

Remaining ticks if the system halts early, otherwise 0.

Run a given number of ticks. This method can stop early when the system halts normally because there is not any busy component. The return value indicates the remaining ticks, that is, if the system stops earlier, the returned value would be positive.


function TearDown

Tear down the system and release resources.

virtual void simtix::system::BaseSystem::TearDown () = 0


function ~BaseSystem

virtual simtix::system::BaseSystem::~BaseSystem () = default


The documentation for this class was generated from the following file projects/simtix/include/simtix/system.h