Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Public Member Functions | Public Attributes | List of all members
AHBMem Class Reference

#include <ahbmem.h>

Inheritance diagram for AHBMem:
Collaboration diagram for AHBMem:

Public Member Functions

 GC_HAS_CALLBACKS ()
 
 SC_HAS_PROCESS (AHBMem)
 
 AHBMem (const ModuleName nm, uint16_t haddr_=0, uint16_t hmask_=0, AbstractionLayer ambaLayer=amba::amba_LT, uint32_t slave_id=0, bool cacheable=1, uint32_t wait_states=0, bool pow_mon=false)
 Constructor for the test bench memory class. More...
 
 ~AHBMem ()
 Destructor. More...
 
void init_generics ()
 Initialize generics. More...
 
void dorst ()
 Reset callback. More...
 
void clear_mem ()
 Delete memory content. More...
 
bool get_direct_mem_ptr (tlm::tlm_generic_payload &trans, tlm::tlm_dmi &dmi_data)
 
void writeByteDBG (const uint32_t addr, const uint8_t byte)
 Method to write a byte into the memory. More...
 
uint32_t exec_func (tlm::tlm_generic_payload &gp, sc_time &delay, bool debug=false)
 Encapsulated functionality. More...
 
sc_core::sc_time get_clock ()
 Returns clock cycle time from child. More...
 
void start_of_simulation ()
 Called by scheduler at start of simulation. More...
 
void power_model ()
 Calculate power/energy values from normalized input data. More...
 
gs::cnf::callback_return_type sta_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Static power callback. More...
 
gs::cnf::callback_return_type int_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Internal power callback. More...
 
gs::cnf::callback_return_type swi_power_cb (gs::gs_param_base &changed_param, gs::cnf::callback_type reason)
 Dynamic/Switching power callback. More...
 
void before_end_of_elaboration ()
 Creates the memory backend. More...
 
void end_of_simulation ()
 Generates execution statistic at end of simulation. More...
 
- Public Member Functions inherited from AHBSlave<>
 SC_HAS_PROCESS (AHBSlave)
 
 AHBSlave (ModuleName mn, uint8_t hindex, uint8_t vendor, uint8_t device, uint8_t version, uint8_t irq, AbstractionLayer ambaLayer, BAR bar0=BAR(), BAR bar1=BAR(), BAR bar2=BAR(), BAR bar3=BAR())
 
 ~AHBSlave ()
 
virtual void b_transport (tlm::tlm_generic_payload &gp, sc_time &delay)
 TLM blocking transport functions. More...
 
virtual uint32_t transport_dbg (tlm::tlm_generic_payload &gp)
 TLM debug transport function. More...
 
virtual tlm::tlm_sync_enum nb_transport_fw (tlm::tlm_generic_payload &trans, tlm::tlm_phase &phase, sc_core::sc_time &delay)
 TLM non-blocking transport function. More...
 
void requestThread ()
 Accept new transaction (busy or not) More...
 
void responseThread ()
 Thread for interfacing functional part of the model in AT mode. More...
 
virtual void transport_statistics (tlm::tlm_generic_payload &gp) throw ()
 Collect common transport statistics. More...
 
virtual void print_transport_statistics (const char *name) const throw ()
 Print common transport statistics. More...
 
- Public Member Functions inherited from AHBDevice< BaseModule< DefaultBase > >
 AHBDevice (ModuleName mn, uint32_t hindex, uint8_t vendorid, uint16_t deviceid, uint8_t version, uint8_t irq, BAR bar0, BAR bar1=BAR(), BAR bar2=BAR(), BAR bar3=BAR())
 
 AHBDevice (ModuleName mn)
 
void init (uint32_t hindex, uint8_t vendorid, uint16_t deviceid, uint8_t version, uint8_t irq, BAR bar0, BAR bar1=BAR(), BAR bar2=BAR(), BAR bar3=BAR())
 
void init_ahb_generics ()
 
virtual ~AHBDevice ()
 Empty destructor. More...
 
virtual const uint16_t get_ahb_device_id () const throw ()
 Returns the device id. More...
 
virtual const uint8_t get_ahb_vendor_id () const throw ()
 Returns the vendor id. More...
 
virtual const uint32_tget_ahb_device_info () throw ()
 
virtual const uint32_t get_ahb_base_addr_ () const throw ()
 
virtual sc_dt::uint64 get_ahb_base_addr () throw ()
 
virtual const uint32_t get_ahb_size_ () const throw ()
 
virtual sc_dt::uint64 get_ahb_size () throw ()
 
virtual const AMBADeviceType get_ahb_bar_type (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_base (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_mask (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_addr (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_size (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_bar_relative_addr (uint32_t bar, uint32_t addr) const throw ()
 
const bool get_ahb_bar_prefetchable (uint32_t bar) const throw ()
 
const bool get_ahb_bar_cachable (uint32_t bar) const throw ()
 
virtual const uint32_t get_ahb_hindex () const throw ()
 Returns the bus id of the module (hindex) More...
 
virtual void print_ahb_device_info (char *name) const
 Prints the device info of the device. More...
 
- Public Member Functions inherited from BaseModule< DefaultBase >
 BaseModule (ModuleName mn)
 
virtual ~BaseModule ()
 
virtual void init_registers ()
 
virtual void init_counters ()
 
virtual void init_power ()
 
- Public Member Functions inherited from AHBDeviceBase
virtual ~AHBDeviceBase ()
 Empty destructor. More...
 
- Public Member Functions inherited from CLKDevice
 SR_HAS_SIGNALS (CLKDevice)
 
 CLKDevice ()
 
virtual ~CLKDevice ()
 
virtual void onrst (const bool &value, const sc_core::sc_time &time)
 
virtual void onclk (const sc_core::sc_time &value, const sc_core::sc_time &time)
 
void set_clk (sc_core::sc_clock &clk)
 
void set_clk (sc_core::sc_time period)
 
void set_clk (double period, sc_core::sc_time_unit base)
 
virtual void clkcng ()
 
- Public Member Functions inherited from BaseMemory
 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

sr_param< doublesta_power_norm
 Power Modeling Parameters. More...
 
sr_param< doubleint_power_norm
 Normalized internal power input (activation independent) More...
 
sr_param< doubledyn_read_energy_norm
 Normalized read access energy. More...
 
sr_param< doubledyn_write_energy_norm
 Normalized write access energy. More...
 
gs::gs_param_array power
 Parameter array for power data output. More...
 
sr_param< doublesta_power
 Static power of module. More...
 
sr_param< doubleint_power
 Dynamic power of module (activation independent) More...
 
sr_param< doubleswi_power
 Switching power of module. More...
 
sr_param< sc_core::sc_time > power_frame_starting_time
 Power frame starting time. More...
 
sr_param< doubledyn_read_energy
 Dynamic energy per read access. More...
 
sr_param< doubledyn_write_energy
 Dynamic energy per write access. More...
 
sr_param< uint64_tdyn_reads
 Number of reads from memory (read & reset by monitor) More...
 
sr_param< uint64_tdyn_writes
 Number of writes to memory (read & reset by monitor) More...
 
- Public Attributes inherited from AHBSlave<>
::amba::amba_slave_socket< 32 > ahb
 
tlm_utils::peq_with_get
< tlm::tlm_generic_payload > 
m_RequestPEQ
 Event queues for AT mode. More...
 
tlm_utils::peq_with_get
< tlm::tlm_generic_payload > 
m_ResponsePEQ
 
- Public Attributes inherited from CLKDevice
signal< bool >::in rst
 Reset input signal. More...
 
signal< sc_core::sc_time >::in clk
 Clock input signal. More...
 
- Public Attributes inherited from BaseMemory
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...
 

Additional Inherited Members

- Protected Attributes inherited from AHBSlave<>
sr_param< uint64_tm_reads
 Stores the number of Bytes read from the device. More...
 
sr_param< uint64_tm_writes
 Stores the number of Bytes written from the device. More...
 
- Protected Attributes inherited from AHBDevice< BaseModule< DefaultBase > >
uint32_t m_register [8]
 Impementation of the device register file. More...
 
ParameterArray g_bars
 
ParameterArray g_bar0
 
ParameterArray g_bar1
 
ParameterArray g_bar2
 
ParameterArray g_bar3
 
sr_param< uint32_tg_hindex
 
sr_param< uint8_tg_hvendorid
 
sr_param< uint16_tg_hdeviceid
 
sr_param< uint8_tg_hversion
 
sr_param< uint8_tg_hirq
 
sr_param< uint32_tg_bar0haddr
 
sr_param< uint32_tg_bar0hmask
 
sr_param< uint32_tg_bar0htype
 
sr_param< boolg_bar0hcacheable
 
sr_param< boolg_bar0hprefetchable
 
sr_param< uint32_tg_bar1haddr
 
sr_param< uint32_tg_bar1hmask
 
sr_param< uint32_tg_bar1htype
 
sr_param< boolg_bar1hcacheable
 
sr_param< boolg_bar1hprefetchable
 
sr_param< uint32_tg_bar2haddr
 
sr_param< uint32_tg_bar2hmask
 
sr_param< uint32_tg_bar2htype
 
sr_param< boolg_bar2hcacheable
 
sr_param< boolg_bar2hprefetchable
 
sr_param< uint32_tg_bar3haddr
 
sr_param< uint32_tg_bar3hmask
 
sr_param< uint32_tg_bar3htype
 
sr_param< boolg_bar3hcacheable
 
sr_param< boolg_bar3hprefetchable
 
- Protected Attributes inherited from BaseModule< DefaultBase >
ParameterAPIm_api
 Internal module gs param api instance. More...
 
ParameterArray m_generics
 Configuration generic container. More...
 
ParameterArray m_counters
 Performance counter container. More...
 
ParameterArray m_power
 Power counters container. More...
 
- Protected Attributes inherited from CLKDevice
sc_core::sc_time clock_cycle
 
- Protected Attributes inherited from BaseMemory
Storagem_storage
 

Member Function Documentation

void AHBMem::clear_mem ( )
inline

Delete memory content.

References BaseMemory::erase(), and AHBDevice< BaseModule< DefaultBase > >::get_ahb_size().

Here is the call graph for this function:

AHBMem::GC_HAS_CALLBACKS ( )
AHBMem::SC_HAS_PROCESS ( AHBMem  )

Member Data Documentation

sr_param<double> AHBMem::dyn_read_energy

Dynamic energy per read access.

Referenced by power_model(), and swi_power_cb().

sr_param<double> AHBMem::dyn_read_energy_norm

Normalized read access energy.

Referenced by power_model().

sr_param<uint64_t> AHBMem::dyn_reads

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

Referenced by exec_func(), and swi_power_cb().

sr_param<double> AHBMem::dyn_write_energy

Dynamic energy per write access.

Referenced by power_model(), and swi_power_cb().

sr_param<double> AHBMem::dyn_write_energy_norm

Normalized write access energy.

Referenced by power_model().

sr_param<uint64_t> AHBMem::dyn_writes

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

Referenced by exec_func(), and swi_power_cb().

sr_param<double> AHBMem::int_power

Dynamic power of module (activation independent)

Referenced by AHBMem(), and power_model().

sr_param<double> AHBMem::int_power_norm

Normalized internal power input (activation independent)

Referenced by power_model().

gs::gs_param_array AHBMem::power

Parameter array for power data output.

sr_param<sc_core::sc_time> AHBMem::power_frame_starting_time

Power frame starting time.

Referenced by swi_power_cb().

sr_param<double> AHBMem::sta_power

Static power of module.

Referenced by AHBMem(), and power_model().

sr_param<double> AHBMem::sta_power_norm

Power Modeling Parameters.

Normalized static power input

Referenced by power_model().

sr_param<double> AHBMem::swi_power

Switching power of module.

Referenced by AHBMem(), and swi_power_cb().


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