Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Files | Classes | Macros | Functions | Variables
Memory

Files

file  arraystorage.cpp
 
file  arraystorage.h
 
file  basememory.cpp
 
file  basememory.h
 
file  ext_erase.h
 
file  arraystorage.cpp
 
file  mapstorage.h
 
file  memory.h
 
file  memorypower.cpp
 
file  storage.h
 

Classes

class  ArrayStorage
 
class  BaseMemory
 
struct  ext_erase
 
class  MapStorage
 
struct  Memory
 This class models a generic memory. Depending on the configuration it can be used as ROM, IO, SRAM or SDRAM, in conjunction with the SoCRocket MCTRL. More...
 
class  MemoryPower
 
class  Storage
 

Macros

#define SR_HAS_MEMORYSTORAGE_GENERATOR(type, factory, isinstance)
 
#define SR_HAS_MEMORYSTORAGE(type)
 

Functions

 SR_HAS_MEMORYSTORAGE (ArrayStorage)
 
 SR_HAS_MEMORYSTORAGE (MapStorage)
 
 SR_HAS_MODULE (Memory)
 
 MemoryPower::GC_HAS_CALLBACKS ()
 
 MemoryPower::MemoryPower (sc_module_name name, MEMDevice::device_type type=MEMDevice::SRAM, uint32_t banks=4, uint32_t bsize=128, uint32_t bits=32, uint32_t cols=16, bool pow_mon=false)
 
 MemoryPower::~MemoryPower ()
 
void MemoryPower::power_model ()
 Calculate power/energy values from normalized input data. More...
 
gs::cnf::callback_return_type MemoryPower::swi_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Switching power callback. More...
 
gs::cnf::callback_return_type MemoryPower::dyn_reads_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 32-bit-reads counter callback More...
 
gs::cnf::callback_return_type MemoryPower::dyn_writes_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 32-bit-writes counter callback More...
 
gs::cnf::callback_return_type MemoryPower::dyn_reads_write_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 32-bit-reads counter callback, write More...
 
gs::cnf::callback_return_type MemoryPower::dyn_writes_write_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 32-bit-writes counter callback, write More...
 
 ArrayStorage::ArrayStorage (sc_core::sc_module_name mn)
 
 ArrayStorage::~ArrayStorage ()
 
void ArrayStorage::set_size (const uint32_t &size)
 
void ArrayStorage::write (const uint32_t &addr, const uint8_t &byte)
 
uint8_t ArrayStorage::read (const uint32_t &addr) const
 
void ArrayStorage::erase (const uint32_t &start, const uint32_t &end)
 
void ArrayStorage::write_block (const uint32_t &addr, const uint8_t *ptr, const uint32_t &len)
 
void ArrayStorage::read_block (const uint32_t &addr, uint8_t *ptr, const uint32_t &len) const
 
uint8_tArrayStorage::get_dmi_ptr ()
 
bool ArrayStorage::allow_dmi_rw ()
 
 BaseMemory::BaseMemory ()
 
 BaseMemory::~BaseMemory ()
 
void BaseMemory::set_storage (std::string implementation, uint32_t size)
 
uint8_t BaseMemory::read (const uint32_t &addr)
 
void BaseMemory::write (const uint32_t &addr, const uint8_t &byte)
 
uint8_t BaseMemory::read_dbg (const uint32_t &addr)
 
void BaseMemory::write_dbg (const uint32_t &addr, const uint8_t &byte)
 
void BaseMemory::erase (const uint32_t &start, const uint32_t &end)
 
void BaseMemory::erase_dbg (const uint32_t &start, const uint32_t &end)
 
void BaseMemory::write_block (const uint32_t &addr, uint8_t *data, const uint32_t &len)
 
void BaseMemory::write_block_dbg (const uint32_t &addr, const uint8_t *data, const uint32_t &len)
 
void BaseMemory::read_block (const uint32_t &addr, uint8_t *data, const uint32_t &len)
 
void BaseMemory::read_block_dbg (const uint32_t &addr, uint8_t *data, const uint32_t &len) const
 
 MapStorage::MapStorage (sc_core::sc_module_name mn)
 
 MapStorage::~MapStorage ()
 
void MapStorage::set_size (const uint32_t &size)
 
void MapStorage::write (const uint32_t &addr, const uint8_t &byte)
 
uint8_t MapStorage::read (const uint32_t &addr) const
 
void MapStorage::erase (const uint32_t &start, const uint32_t &end)
 
void MapStorage::read_block (const uint32_t &addr, uint8_t *ptr, const uint32_t &len) const
 
void MapStorage::write_block (const uint32_t &addr, const uint8_t *ptr, const uint32_t &len)
 
 Memory::~Memory ()
 Destructor. More...
 
void Memory::before_end_of_elaboration ()
 
void Memory::start_of_simulation ()
 SystemC start of simulation callback. More...
 
void Memory::end_of_simulation ()
 SystemC end of simulation. More...
 
gs::cnf::callback_return_type Memory::m_reads_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 read counter callback More...
 
gs::cnf::callback_return_type Memory::m_writes_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 write counter callback More...
 
void Memory::b_transport (tlm::tlm_generic_payload &gp, sc_time &delay)
 TLM 2.0 blocking transport function. More...
 
unsigned int Memory::transport_dbg (tlm::tlm_generic_payload &gp)
 TLM 2.0 debug transport function. More...
 
bool Memory::get_direct_mem_ptr (tlm::tlm_generic_payload &trans, tlm::tlm_dmi &dmi_data)
 

Variables

bool MemoryPower::m_pow_mon
 Power monitoring. More...
 
gs::cnf::cnf_api * MemoryPower::m_api
 GreenControl API Pointer. More...
 
gs::gs_param_array MemoryPower::m_performance_counters
 Performance Counter Array. More...
 
gs::gs_param_array MemoryPower::power
 Performance counter to store transaction byte reads. More...
 
sr_param< doubleMemoryPower::sta_power_norm
 Normalized static power input. More...
 
sr_param< doubleMemoryPower::int_power_norm
 Normalized internal power input (activation independent) More...
 
sr_param< doubleMemoryPower::dyn_read_energy_norm
 Normalized read access energy. More...
 
sr_param< doubleMemoryPower::dyn_write_energy_norm
 Normalized write access energy. More...
 
sr_param< doubleMemoryPower::sta_power
 Static power of module. More...
 
sr_param< doubleMemoryPower::int_power
 Internal power of module. More...
 
sr_param< doubleMemoryPower::swi_power
 Switching power of module. More...
 
sr_param< sc_core::sc_time > MemoryPower::power_frame_starting_time
 Power frame starting time. More...
 
sr_param< doubleMemoryPower::dyn_read_energy
 Dynamic energy per read access. More...
 
sr_param< doubleMemoryPower::dyn_write_energy
 Dynamic energy per write access. More...
 
sr_param< uint64_tMemoryPower::dyn_reads
 Number of reads from memory (read & reset by monitor) More...
 
sr_param< uint64_tMemoryPower::dyn_writes
 Number of writes to memory (read & reset by monitor) More...
 

Detailed Description

Macro Definition Documentation

#define SR_HAS_MEMORYSTORAGE (   type)
Value:
sc_core::sc_object *create_##type(sc_core::sc_module_name mn) { \
return new type(mn); \
} \
bool isinstance_of_##type(sc_core::sc_object *obj) { \
return dynamic_cast<type *>(obj) != NULL; \
} \
SR_HAS_MEMORYSTORAGE_GENERATOR(type, create_##type, isinstance_of_##type);
#define SR_HAS_MEMORYSTORAGE_GENERATOR(type, factory, isinstance)
Definition: storage.h:21
#define SR_HAS_MEMORYSTORAGE_GENERATOR (   type,
  factory,
  isinstance 
)
Value:
static SrModuleRegistry __sr_module_registry_##type##__("MemoryStorage", #type, &factory, &isinstance, __FILE__); \
volatile SrModuleRegistry *__sr_module_registry_##type = &__sr_module_registry_##type##__;
Definition: sr_registry.h:28

Function Documentation

bool ArrayStorage::allow_dmi_rw ( )
virtual

Reimplemented from Storage.

ArrayStorage::ArrayStorage ( sc_core::sc_module_name  mn)
explicit
void Memory::b_transport ( tlm::tlm_generic_payload &  gp,
sc_time &  delay 
)

TLM 2.0 blocking transport function.

References v::debug, v::error, setup::name, srAnalyse, srWarn, start, and v::uint32.

Referenced by Memory::Memory().

BaseMemory::BaseMemory ( )
void Memory::before_end_of_elaboration ( )
gs::cnf::callback_return_type MemoryPower::dyn_reads_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

32-bit-reads counter callback

References MemoryPower::dyn_reads, GC_RETURN_OK, and BaseMemory::reads32.

Referenced by MemoryPower::MemoryPower().

gs::cnf::callback_return_type MemoryPower::dyn_reads_write_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

32-bit-reads counter callback, write

References MemoryPower::dyn_reads, GC_RETURN_OK, and BaseMemory::reads32.

Referenced by MemoryPower::MemoryPower().

gs::cnf::callback_return_type MemoryPower::dyn_writes_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

32-bit-writes counter callback

References MemoryPower::dyn_writes, GC_RETURN_OK, and BaseMemory::writes32.

Referenced by MemoryPower::MemoryPower().

gs::cnf::callback_return_type MemoryPower::dyn_writes_write_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

32-bit-writes counter callback, write

References MemoryPower::dyn_writes, GC_RETURN_OK, and BaseMemory::writes32.

Referenced by MemoryPower::MemoryPower().

void Memory::end_of_simulation ( )

SystemC end of simulation.

References setup::name, and v::report.

void ArrayStorage::erase ( const uint32_t start,
const uint32_t end 
)
virtual

Implements Storage.

void MapStorage::erase ( const uint32_t start,
const uint32_t end 
)
virtual

Implements Storage.

void BaseMemory::erase ( const uint32_t start,
const uint32_t end 
)

References BaseMemory::erase_dbg().

Referenced by AHBMem::clear_mem(), and AHBMem::dorst().

Here is the call graph for this function:

void BaseMemory::erase_dbg ( const uint32_t start,
const uint32_t end 
)

References Storage::erase(), and BaseMemory::m_storage.

Referenced by BaseMemory::erase().

Here is the call graph for this function:

MemoryPower::GC_HAS_CALLBACKS ( )
bool Memory::get_direct_mem_ptr ( tlm::tlm_generic_payload &  trans,
tlm::tlm_dmi &  dmi_data 
)
uint8_t * ArrayStorage::get_dmi_ptr ( )
virtual

Reimplemented from Storage.

gs::cnf::callback_return_type Memory::m_reads_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

read counter callback

References GC_RETURN_OK.

gs::cnf::callback_return_type Memory::m_writes_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)

write counter callback

References GC_RETURN_OK.

MapStorage::MapStorage ( sc_core::sc_module_name  mn)
explicit
MemoryPower::MemoryPower ( sc_module_name  name,
MEMDevice::device_type  type = MEMDevice::SRAM,
uint32_t  banks = 4,
uint32_t  bsize = 128,
uint32_t  bits = 32,
uint32_t  cols = 16,
bool  pow_mon = false 
)
void MemoryPower::power_model ( )

Calculate power/energy values from normalized input data.

References CLKDevice::clock_cycle, MemoryPower::dyn_read_energy, MemoryPower::dyn_read_energy_norm, MemoryPower::dyn_write_energy, MemoryPower::dyn_write_energy_norm, MEMDevice::get_bsize(), MemoryPower::int_power, MemoryPower::int_power_norm, MemoryPower::m_pow_mon, MemoryPower::sta_power, and MemoryPower::sta_power_norm.

Here is the call graph for this function:

uint8_t ArrayStorage::read ( const uint32_t addr) const
virtual

Implements Storage.

uint8_t MapStorage::read ( const uint32_t addr) const
virtual

Implements Storage.

Referenced by MapStorage::read_block().

uint8_t BaseMemory::read ( const uint32_t addr)

References BaseMemory::read_dbg(), BaseMemory::reads, and BaseMemory::reads32.

Here is the call graph for this function:

void ArrayStorage::read_block ( const uint32_t addr,
uint8_t ptr,
const uint32_t len 
) const
virtual

Implements Storage.

void MapStorage::read_block ( const uint32_t addr,
uint8_t ptr,
const uint32_t len 
) const
virtual

Implements Storage.

References i, and MapStorage::read().

Here is the call graph for this function:

void BaseMemory::read_block ( const uint32_t addr,
uint8_t data,
const uint32_t len 
)

References BaseMemory::read_block_dbg(), BaseMemory::reads, and BaseMemory::reads32.

Referenced by AHBMem::exec_func().

Here is the call graph for this function:

void BaseMemory::read_block_dbg ( const uint32_t addr,
uint8_t data,
const uint32_t len 
) const

References BaseMemory::m_storage, and Storage::read_block().

Referenced by BaseMemory::read_block(), and BaseMemory::scireg_read().

Here is the call graph for this function:

uint8_t BaseMemory::read_dbg ( const uint32_t addr)

References BaseMemory::m_storage, and Storage::read().

Referenced by BaseMemory::read().

Here is the call graph for this function:

void ArrayStorage::set_size ( const uint32_t size)
virtual

Implements Storage.

void MapStorage::set_size ( const uint32_t size)
virtual

Implements Storage.

void BaseMemory::set_storage ( std::string  implementation,
uint32_t  size 
)

References SrModuleRegistry::create_object_by_name(), BaseMemory::m_storage, Storage::set_size(), and srError.

Referenced by AHBMem::before_end_of_elaboration().

Here is the call graph for this function:

SR_HAS_MEMORYSTORAGE ( MapStorage  )
SR_HAS_MEMORYSTORAGE ( ArrayStorage  )
SR_HAS_MODULE ( Memory  )
void Memory::start_of_simulation ( )

SystemC start of simulation callback.

gs::cnf::callback_return_type MemoryPower::swi_power_cb ( gs::gs_param_base &  changed_param,
gs::cnf::callback_type  reason 
)
unsigned int Memory::transport_dbg ( tlm::tlm_generic_payload &  gp)

TLM 2.0 debug transport function.

References v::debug, setup::name, and v::uint32.

void ArrayStorage::write ( const uint32_t addr,
const uint8_t byte 
)
virtual

Implements Storage.

Referenced by usi.shell.console.Console::interact().

void MapStorage::write ( const uint32_t addr,
const uint8_t byte 
)
virtual
void BaseMemory::write ( const uint32_t addr,
const uint8_t byte 
)

References BaseMemory::write_dbg(), BaseMemory::writes, and BaseMemory::writes32.

Referenced by usi.shell.console.Console::interact().

Here is the call graph for this function:

void ArrayStorage::write_block ( const uint32_t addr,
const uint8_t ptr,
const uint32_t len 
)
virtual

Implements Storage.

void MapStorage::write_block ( const uint32_t addr,
const uint8_t ptr,
const uint32_t len 
)
virtual

Implements Storage.

References i, and MapStorage::write().

Here is the call graph for this function:

void BaseMemory::write_block ( const uint32_t addr,
uint8_t data,
const uint32_t len 
)

References BaseMemory::write_block_dbg(), BaseMemory::writes, and BaseMemory::writes32.

Referenced by AHBMem::exec_func().

Here is the call graph for this function:

void BaseMemory::write_block_dbg ( const uint32_t addr,
const uint8_t data,
const uint32_t len 
)

References BaseMemory::m_storage, and Storage::write_block().

Referenced by BaseMemory::scireg_write(), and BaseMemory::write_block().

Here is the call graph for this function:

void BaseMemory::write_dbg ( const uint32_t addr,
const uint8_t byte 
)

References BaseMemory::m_storage, and Storage::write().

Referenced by BaseMemory::write(), and AHBMem::writeByteDBG().

Here is the call graph for this function:

ArrayStorage::~ArrayStorage ( )
BaseMemory::~BaseMemory ( )

References BaseMemory::m_storage.

MapStorage::~MapStorage ( )
Memory::~Memory ( )

Destructor.

MemoryPower::~MemoryPower ( )

Variable Documentation

sr_param<double> MemoryPower::dyn_read_energy

Dynamic energy per read access.

Referenced by MemoryPower::power_model(), and MemoryPower::swi_power_cb().

sr_param<double> MemoryPower::dyn_read_energy_norm

Normalized read access energy.

Referenced by MemoryPower::power_model().

sr_param<uint64_t> MemoryPower::dyn_reads

Number of reads from memory (read & reset by monitor)

Referenced by MemoryPower::dyn_reads_cb(), MemoryPower::dyn_reads_write_cb(), and MemoryPower::MemoryPower().

sr_param<double> MemoryPower::dyn_write_energy

Dynamic energy per write access.

Referenced by MemoryPower::power_model(), and MemoryPower::swi_power_cb().

sr_param<double> MemoryPower::dyn_write_energy_norm

Normalized write access energy.

Referenced by MemoryPower::power_model().

sr_param<uint64_t> MemoryPower::dyn_writes

Number of writes to memory (read & reset by monitor)

Referenced by MemoryPower::dyn_writes_cb(), MemoryPower::dyn_writes_write_cb(), and MemoryPower::MemoryPower().

sr_param<double> MemoryPower::int_power

Internal power of module.

Referenced by MemoryPower::power_model().

sr_param<double> MemoryPower::int_power_norm

Normalized internal power input (activation independent)

Referenced by MemoryPower::power_model().

gs::cnf::cnf_api* MemoryPower::m_api

GreenControl API Pointer.

gs::gs_param_array MemoryPower::m_performance_counters

Performance Counter Array.

bool MemoryPower::m_pow_mon

Power monitoring.

Referenced by MemoryPower::MemoryPower(), and MemoryPower::power_model().

gs::gs_param_array MemoryPower::power

Performance counter to store transaction byte reads.

Performance counter to store the transaction byte writes ***************************************************** Power Modeling Parameters Parameter array for power data output

sr_param<sc_core::sc_time> MemoryPower::power_frame_starting_time

Power frame starting time.

Referenced by MemoryPower::swi_power_cb().

sr_param<double> MemoryPower::sta_power

Static power of module.

Referenced by MemoryPower::power_model().

sr_param<double> MemoryPower::sta_power_norm

Normalized static power input.

Referenced by MemoryPower::power_model().

sr_param<double> MemoryPower::swi_power

Switching power of module.

Referenced by MemoryPower::MemoryPower(), and MemoryPower::swi_power_cb().