Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Public Member Functions | Public Attributes | Protected Attributes | List of all members
BaseMemory Class Reference

#include <basememory.h>

Inheritance diagram for BaseMemory:
Collaboration diagram for BaseMemory:

Public Member Functions

 BaseMemory ()
 
 ~BaseMemory ()
 
void set_storage (std::string implementation, uint32_t size)
 
uint8_t read (const uint32_t &addr)
 
uint8_t read_dbg (const uint32_t &addr)
 
void write (const uint32_t &addr, const uint8_t &byte)
 
void write_dbg (const uint32_t &addr, const uint8_t &byte)
 
void write_block (const uint32_t &addr, uint8_t *data, const uint32_t &len)
 
void write_block_dbg (const uint32_t &addr, const uint8_t *data, const uint32_t &len)
 
void read_block (const uint32_t &addr, uint8_t *data, const uint32_t &len)
 
void read_block_dbg (const uint32_t &addr, uint8_t *data, const uint32_t &len) const
 
void erase (const uint32_t &start, const uint32_t &end)
 
void erase_dbg (const uint32_t &start, const uint32_t &end)
 
virtual scireg_ns::scireg_response scireg_get_region_type (scireg_ns::scireg_region_type &t) const
 Get the region_type of this region: More...
 
virtual scireg_ns::scireg_response scireg_read (scireg_ns::vector_byte &v, sc_dt::uint64 size, sc_dt::uint64 offset=0) const
 Read a vector of "size" bytes at given offset in this region: More...
 
virtual scireg_ns::scireg_response scireg_write (const scireg_ns::vector_byte &v, sc_dt::uint64 size, sc_dt::uint64 offset=0)
 Write a vector of "size" bytes at given offset in this region: More...
 
virtual sc_dt::uint64 scireg_get_bit_width () const
 Get bit width and byte width of this region. More...
 
virtual sc_dt::uint64 scireg_get_low_pos () const
 If this region is a register field, these functions return low bit and high bit positions: More...
 
virtual sc_dt::uint64 scireg_get_high_pos () const
 
virtual scireg_ns::scireg_response scireg_get_dmi_granted (bool &granted, sc_dt::uint64 size, sc_dt::uint64 offset=0) const
 Query to see if DMI access has been granted to this region. "size" and offset can be used to constrain the range. More...
 
- Public Member Functions inherited from scireg_ns::scireg_region_if
 scireg_region_if ()
 
virtual ~scireg_region_if ()
 
virtual scireg_response scireg_get_bit_attributes (vector_byte &v, scireg_bit_attributes_type t, sc_dt::uint64 size, sc_dt::uint64 offset=0) const
 Get bit attributes of type "t" into "v". "size" represents number of bytes returned, offset can be used to constrain the range. More...
 
virtual scireg_response scireg_get_string_attribute (const char *&s, scireg_string_attribute_type t) const
 Get string attributes of type "t" associated with this region. The returned string is assigned to "s". More...
 
virtual sc_dt::uint64 scireg_get_byte_width () const
 
virtual scireg_response scireg_get_child_regions (std::vector< scireg_mapped_region > &mapped_regions, sc_dt::uint64 size=sc_dt::uint64(-1), sc_dt::uint64 offset=0) const
 
virtual scireg_response scireg_get_parent_regions (std::vector< scireg_region_if * > &v) const
 Get parent regions of this region. More...
 
virtual scireg_response scireg_add_callback (scireg_callback &cb)
 Add/Delete Callback objects associated with this region. More...
 
virtual scireg_response scireg_remove_callback (scireg_callback &cb)
 
virtual scireg_response scireg_get_target_sockets (std::vector< sc_core::sc_object * > &v) const
 Get SC TLM2 Target socket associated with this region. More...
 
virtual scireg_response scireg_get_parent_modules (std::vector< sc_core::sc_module * > &v) const
 Get parent SystemC modules associated with this region. More...
 
virtual scireg_response scireg_get_value_info (std::vector< scireg_value_info > &v) const
 Get a vector of value_info objects for this region. More...
 

Public Attributes

unsigned long long reads
 byte read count More...
 
unsigned long long writes
 byte write count More...
 
unsigned long long reads32
 word (4 bytes) read count More...
 
unsigned long long writes32
 word (4 bytes) write count More...
 

Protected Attributes

Storagem_storage
 

Member Function Documentation

virtual sc_dt::uint64 BaseMemory::scireg_get_bit_width ( ) const
inlinevirtual

Get bit width and byte width of this region.

Reimplemented from scireg_ns::scireg_region_if.

virtual scireg_ns::scireg_response BaseMemory::scireg_get_dmi_granted ( bool granted,
sc_dt::uint64  size,
sc_dt::uint64  offset = 0 
) const
inlinevirtual

Query to see if DMI access has been granted to this region. "size" and offset can be used to constrain the range.

Reimplemented from scireg_ns::scireg_region_if.

References scireg_ns::SCIREG_UNSUPPORTED.

virtual sc_dt::uint64 BaseMemory::scireg_get_high_pos ( ) const
inlinevirtual

Reimplemented from scireg_ns::scireg_region_if.

virtual sc_dt::uint64 BaseMemory::scireg_get_low_pos ( ) const
inlinevirtual

If this region is a register field, these functions return low bit and high bit positions:

Reimplemented from scireg_ns::scireg_region_if.

virtual scireg_ns::scireg_response BaseMemory::scireg_get_region_type ( scireg_ns::scireg_region_type t) const
inlinevirtual

Get the region_type of this region:

Reimplemented from scireg_ns::scireg_region_if.

References scireg_ns::SCIREG_MEMORY, and scireg_ns::SCIREG_SUCCESS.

virtual scireg_ns::scireg_response BaseMemory::scireg_read ( scireg_ns::vector_byte v,
sc_dt::uint64  size,
sc_dt::uint64  offset = 0 
) const
inlinevirtual

Read a vector of "size" bytes at given offset in this region:

Reimplemented from scireg_ns::scireg_region_if.

References offset, read_block_dbg(), and scireg_ns::SCIREG_SUCCESS.

Here is the call graph for this function:

virtual scireg_ns::scireg_response BaseMemory::scireg_write ( const scireg_ns::vector_byte v,
sc_dt::uint64  size,
sc_dt::uint64  offset = 0 
)
inlinevirtual

Write a vector of "size" bytes at given offset in this region:

Reimplemented from scireg_ns::scireg_region_if.

References offset, scireg_ns::SCIREG_SUCCESS, and write_block_dbg().

Here is the call graph for this function:

Member Data Documentation

Storage* BaseMemory::m_storage
protected
unsigned long long BaseMemory::reads

byte read count

Referenced by BaseMemory(), read(), and read_block().

unsigned long long BaseMemory::reads32
unsigned long long BaseMemory::writes

byte write count

Referenced by BaseMemory(), write(), and write_block().

unsigned long long BaseMemory::writes32

The documentation for this class was generated from the following files: