Skip to content

Class simtix::system::SingleCoreSystem

ClassList > simtix > system > SingleCoreSystem

Inherits the following classes: simtix::system::BaseSystem

Classes

Type Name
struct Config

Public Functions

Type Name
virtual int Initialize () override
Initialize all components in the system.
virtual int PeekMemory (uint8_t * data, uint64_t addr, std::size_t size) override
Peek into memory content.
virtual int PreloadMemory (const uint8_t * data, uint64_t addr, std::size_t size) override
Preload memory with data.
virtual uint64_t Run (uint64_t ticks) override
Run the system for a given number of ticks.
SingleCoreSystem (const Config & cfg)
SingleCoreSystem (const SingleCoreSystem &) = delete
virtual void TearDown () override
Tear down the system and release resources.
bool initialized () const
SingleCoreSystem & operator= (const SingleCoreSystem &) = delete
BaseSM & sm ()
const std::shared_ptr< stat::Group > stat () const
TaskDispatcher & td ()
~SingleCoreSystem ()

Public Functions inherited from simtix::system::BaseSystem

See simtix::system::BaseSystem

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

Protected Attributes

Type Name
Config cfg_
mem::NBHBCache * dcache_ = nullptr
mem::NBHBCache * icache_ = nullptr
bool initialized_ = false
mem::BankedMemory * lmem_ = nullptr
std::vector< mem::MemoryInterface * > mems_
BaseSM * sm_ = nullptr
std::shared_ptr< SingleCoreSystemStat > stat_
TaskDispatcher * td_ = nullptr
mem::XBar * xbar_ = nullptr

Public Functions Documentation

function Initialize

Initialize all components in the system.

virtual int simtix::system::SingleCoreSystem::Initialize () override

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.

Implements simtix::system::BaseSystem::Initialize


function PeekMemory

Peek into memory content.

virtual int simtix::system::SingleCoreSystem::PeekMemory (
    uint8_t * data,
    uint64_t addr,
    std::size_t size
) override

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.

Implements simtix::system::BaseSystem::PeekMemory


function PreloadMemory

Preload memory with data.

virtual int simtix::system::SingleCoreSystem::PreloadMemory (
    const uint8_t * data,
    uint64_t addr,
    std::size_t size
) override

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.

Implements simtix::system::BaseSystem::PreloadMemory


function Run

Run the system for a given number of ticks.

virtual uint64_t simtix::system::SingleCoreSystem::Run (
    uint64_t ticks
) override

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.

Implements simtix::system::BaseSystem::Run


function SingleCoreSystem [1/2]

explicit simtix::system::SingleCoreSystem::SingleCoreSystem (
    const Config & cfg
) 

function SingleCoreSystem [2/2]

simtix::system::SingleCoreSystem::SingleCoreSystem (
    const SingleCoreSystem &
) = delete

function TearDown

Tear down the system and release resources.

virtual void simtix::system::SingleCoreSystem::TearDown () override

Implements simtix::system::BaseSystem::TearDown


function initialized

inline bool simtix::system::SingleCoreSystem::initialized () const

function operator=

SingleCoreSystem & simtix::system::SingleCoreSystem::operator= (
    const SingleCoreSystem &
) = delete

function sm

inline BaseSM & simtix::system::SingleCoreSystem::sm () 

function stat

inline const std::shared_ptr< stat::Group > simtix::system::SingleCoreSystem::stat () const

function td

inline TaskDispatcher & simtix::system::SingleCoreSystem::td () 

function ~SingleCoreSystem

simtix::system::SingleCoreSystem::~SingleCoreSystem () 

Protected Attributes Documentation

variable cfg_

Config simtix::system::SingleCoreSystem::cfg_;

variable dcache_

mem::NBHBCache* simtix::system::SingleCoreSystem::dcache_;

variable icache_

mem::NBHBCache* simtix::system::SingleCoreSystem::icache_;

variable initialized_

bool simtix::system::SingleCoreSystem::initialized_;

variable lmem_

mem::BankedMemory* simtix::system::SingleCoreSystem::lmem_;

variable mems_

std::vector<mem::MemoryInterface *> simtix::system::SingleCoreSystem::mems_;

variable sm_

BaseSM* simtix::system::SingleCoreSystem::sm_;

variable stat_

std::shared_ptr<SingleCoreSystemStat> simtix::system::SingleCoreSystem::stat_;

variable td_

TaskDispatcher* simtix::system::SingleCoreSystem::td_;

variable xbar_

mem::XBar* simtix::system::SingleCoreSystem::xbar_;


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