Transaction-Level Modeling Framework for Space Applications
Instruction cache implementation for TrapGen LEON3 simulator. More...
#include <ivectorcache.h>
Public Member Functions | |
GC_HAS_CALLBACKS () | |
void | mem_write (unsigned int address, unsigned char *data, unsigned int len, sc_core::sc_time *t, unsigned int *debug, bool is_dbg, bool &cacheable) |
unsigned int | check_mode () |
Returns the mode bits of the cache. More... | |
t_cache_type | get_cache_type () |
Returns type of cache implementing this interface. More... | |
void | start_of_simulation () |
void | power_model () |
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... | |
ivectorcache (ModuleName name, mmu_cache_if *_mmu_cache, mem_if *_tlb_adaptor, unsigned int mmu_en, unsigned int sets, unsigned int setsize, unsigned int setlock, unsigned int linesize, unsigned int repl, unsigned int lram, unsigned int lramstart, unsigned int lramsize, bool pow_mon) | |
Constructor of data cache. More... | |
~ivectorcache () | |
Public Member Functions inherited from vectorcache | |
virtual bool | mem_read (unsigned int address, unsigned int asi, unsigned char *data, unsigned int len, sc_core::sc_time *t, unsigned int *debug, bool is_dbg, bool &cacheable, bool is_lock) |
Read from cache. More... | |
virtual void | mem_write (unsigned int address, unsigned int asi, unsigned char *data, unsigned int len, sc_core::sc_time *t, unsigned int *debug, bool is_dbg, bool &cacheable, bool is_lock) |
Write through cache. More... | |
virtual unsigned int | read_config_reg (sc_core::sc_time *t) |
Read cache configuration register (ASI 0x2) More... | |
virtual void | read_cache_tag (unsigned int address, unsigned int *data, sc_core::sc_time *t) |
Read data cache tags (ASI 0xe) More... | |
virtual void | write_cache_tag (unsigned int address, unsigned int *data, sc_core::sc_time *t) |
Write data cache tags (ASI 0xe) More... | |
virtual void | read_cache_entry (unsigned int address, unsigned int *data, sc_core::sc_time *t) |
Read data cache entries/data (ASI 0xf) More... | |
virtual void | write_cache_entry (unsigned int address, unsigned int *data, sc_core::sc_time *t) |
Write data cache entries/data (ASI 0xf) More... | |
virtual void | flush (sc_core::sc_time *t, unsigned int *debug, bool is_dbg) |
Flush cache. More... | |
virtual void | snoop_invalidate (const t_snoop &snoop, const sc_core::sc_time &delay) |
Snooping function (invalidates cache line(s)) More... | |
virtual void | dbg_out (unsigned int line) |
Display of cache lines for debug. More... | |
void | clkcng (sc_core::sc_time &clk) |
Helper functions for definition of clock cycle. More... | |
void | end_of_simulation () |
More... | |
Public Member Functions inherited from cache_if | |
virtual | ~cache_if () |
Public Member Functions inherited from mem_if | |
virtual | ~mem_if () |
Public Attributes | |
sr_param< double > | sta_power_norm |
Normalized static power input for logic. More... | |
sr_param< double > | int_power_norm |
Normalized internal power input for logic (activation independent) More... | |
sr_param< double > | sta_itag_power_norm |
Normalized static power input for itag ram (dp) More... | |
sr_param< double > | sta_idata_power_norm |
Normalized static power input for idata ram (sp) More... | |
sr_param< double > | int_itag_power_norm |
Normalized internal power input for itag ram (dp) More... | |
sr_param< double > | int_idata_power_norm |
Normalized internal power input for idata ram (sp) More... | |
sr_param< double > | dyn_itag_read_energy_norm |
Normalized read access energy for itag ram (dp) More... | |
sr_param< double > | dyn_itag_write_energy_norm |
Normalized write access energy for itag ram (dp) More... | |
sr_param< double > | dyn_idata_read_energy_norm |
Normalized read access energy for idata ram (sp) More... | |
sr_param< double > | dyn_idata_write_energy_norm |
Normalized write access energy for idata ram (sp) More... | |
gs::gs_param_array | power |
Parameter array for power output (dcache controller) More... | |
sr_param< double > | sta_power |
Static power of module. More... | |
sr_param< double > | int_power |
Internal dynamic power (activation independent) More... | |
sr_param< double > | swi_power |
Switching power. More... | |
sr_param< sc_core::sc_time > | power_frame_starting_time |
Power frame starting time. More... | |
gs::gs_param_array | itag |
Parameter array for power output of itag ram. More... | |
sr_param< double > | dyn_tag_read_energy |
Dynamic energy per itag read access. More... | |
sr_param< double > | dyn_tag_write_energy |
Dynamic energy per itag write access. More... | |
gs::gs_param_array | idata |
Parameter array for power output of idata ram. More... | |
sr_param< double > | dyn_data_read_energy |
Dynamic energy per idata read access. More... | |
sr_param< double > | dyn_data_write_energy |
Dynamic energy per idata write access. More... | |
Additional Inherited Members | |
Public Types inherited from cache_if | |
enum | t_cache_type { icache, dcache, nocache } |
Data type describing type of cache implementing this interface. More... | |
Protected Member Functions inherited from vectorcache | |
unsigned | get_tag (unsigned address) |
Address parsing one-liners. More... | |
unsigned | get_idx (unsigned address) |
unsigned | get_offset (unsigned address) |
unsigned | get_address (unsigned tag, unsigned idx, unsigned offset) |
unsigned int | offset2valid (unsigned int offset, unsigned int len=4) |
Transforms a cache-line offset into a valid mask. More... | |
unsigned int | replacement_selector (unsigned int idx, unsigned int mode) |
Returns number of the way to be refilled - depending on replacement strategy. More... | |
void | lru_update (unsigned int idx, unsigned int set_select) |
Updates the lru counters for every cache hit. More... | |
void | lrr_update (unsigned int idx, unsigned int set_select) |
Updates the lrr bits for every line replacement. More... | |
std::vector< t_cache_line > ::iterator | lookup_line (unsigned idx, unsigned way) |
int | locate_line (unsigned const tag, unsigned const idx, unsigned const offset, unsigned const len, sc_core::sc_time *delay) |
More... | |
int | update_line (unsigned const tag, unsigned const idx, unsigned const offset, unsigned const way, unsigned const len, unsigned char *const data, sc_core::sc_time *delay, unsigned *debug, bool &cacheable, bool is_dbg) |
More... | |
int | allocate_line (unsigned const tag, unsigned const idx, unsigned const offset, unsigned const len, unsigned char *const data, sc_core::sc_time *delay, unsigned *debug, bool &cacheable, bool is_dbg) |
More... | |
vectorcache (ModuleName name, mmu_cache_if *_mmu_cache, mem_if *_tlb_adaptor, unsigned int mmu_en, unsigned int burst_en, bool new_linefetch_en, unsigned int sets, unsigned int setsize, unsigned int setlock, unsigned int linesize, unsigned int repl, unsigned int lram, unsigned int lramstart, unsigned int lramsize, bool pow_mon) | |
Constructor of data cache. More... | |
virtual | ~vectorcache () |
More... | |
Protected Attributes inherited from vectorcache | |
mmu_cache_if * | m_mmu_cache |
Pointer to the class with the amba interface. More... | |
mem_if * | m_tlb_adaptor |
Pointer to the class with the mmu interface. More... | |
unsigned int | CACHE_CONFIG_REG |
std::vector< t_cache_line > * | cache_mem |
The actual cache memory. More... | |
unsigned int | m_burst_en |
Indicates whether the cache can be put in burst mode or not. More... | |
bool | m_new_linefetch_en |
unsigned int | m_pseudo_rand |
Pseudo-random pointer. More... | |
unsigned int | m_sets |
Number of cache ways (000: direct mapped, 001: 2x, 010: 3x, 011: 4x) More... | |
unsigned int | m_setsize |
Size of cache way in kB = 2^m_waysize. More... | |
unsigned int | m_setlock |
Cache line locking. More... | |
unsigned int | m_linesize |
Size of cache line in words = 2^m_linesize. More... | |
unsigned int | m_wordsperline |
Number of words per cache line. More... | |
unsigned int | m_bytesperline |
Number of bytes per cache line. More... | |
unsigned int | m_offset_bits |
Number of bits for addressing the line offset. More... | |
unsigned int | m_number_of_vectors |
Number of lines in the cache. More... | |
unsigned int | m_idx_bits |
Address bits used for index. More... | |
unsigned int | m_tag_bits |
Address bits used for tag. More... | |
unsigned int | m_repl |
Replacement strategy. More... | |
unsigned int | m_mmu_en |
MMU enabled. More... | |
int | m_max_lru |
LRU counter maximum. More... | |
unsigned int | m_lram |
Local ram present. More... | |
unsigned int | m_lramstart |
Start address of localram (8 MSBs) More... | |
unsigned int | m_lramsize |
Size of localram. More... | |
gs::cnf::cnf_api * | m_api |
GreenControl API container. More... | |
gs::gs_param_array | m_performance_counters |
Open a namespace for performance counting in the greencontrol realm. More... | |
gs::gs_param< unsigned long long * > | rhits |
Counter for read hits. More... | |
sr_param< uint64_t > | rmisses |
Counter for read misses. More... | |
gs::gs_param< unsigned long long * > | whits |
Counter for write hits. More... | |
sr_param< uint64_t > | wmisses |
Counter for write misses. More... | |
sr_param< uint64_t > | bypassops |
Counter for bypass operations. More... | |
bool | m_pow_mon |
Enable power monitoring. More... | |
sr_param< uint64_t > | dyn_tag_reads |
Number of tag ram reads (monitor read & reset) More... | |
sr_param< uint64_t > | dyn_tag_writes |
Number of tag ram writes (monitor read & reset) More... | |
sr_param< uint64_t > | dyn_data_reads |
Number of data ram reads (monitor read & reset) More... | |
sr_param< uint64_t > | dyn_data_writes |
Number of data ram writes (monitor read & reset) More... | |
sc_core::sc_time | m_hit_read_response_delay |
Timing parameters. More... | |
sc_core::sc_time | m_miss_read_response_delay |
sc_core::sc_time | m_write_response_delay |
sc_core::sc_time | clockcycle |
Clock cycle time. More... | |
Instruction cache implementation for TrapGen LEON3 simulator.
|
inline |
Constructor of data cache.
name | SystemC module name |
mmu_cache | Pointer to top-level class of cache subsystem (mmu_cache) for access to AHB bus interface |
tlb_adaptor | Pointer to memory management unit |
sets | Number of cache sets |
setsize | Size of a cache set (in kbytes) |
linesize | Size of a cache line (in bytes) |
repl | Cache replacement strategy |
lram | Local RAM configured |
lramstart | The 8 MSBs of the local ram start address (16MB segment) |
lramsize | Size of local ram (size in kbyte = 2^lramsize) |
References int_power, usi.cci.callback::pre_read, sta_power, and swi_power.
|
inline |
ivectorcache::GC_HAS_CALLBACKS | ( | ) |
Dynamic energy per idata read access.
Referenced by power_model(), and swi_power_cb().
Dynamic energy per idata write access.
Referenced by power_model(), and swi_power_cb().
Normalized read access energy for idata ram (sp)
Referenced by power_model().
Normalized write access energy for idata ram (sp)
Referenced by power_model().
Normalized read access energy for itag ram (dp)
Referenced by power_model().
Normalized write access energy for itag ram (dp)
Referenced by power_model().
Dynamic energy per itag read access.
Referenced by power_model(), and swi_power_cb().
Dynamic energy per itag write access.
Referenced by power_model(), and swi_power_cb().
gs::gs_param_array ivectorcache::idata |
Parameter array for power output of idata ram.
Normalized internal power input for idata ram (sp)
Referenced by power_model().
Normalized internal power input for itag ram (dp)
Referenced by power_model().
Internal dynamic power (activation independent)
Referenced by ivectorcache(), and power_model().
Normalized internal power input for logic (activation independent)
Referenced by power_model().
gs::gs_param_array ivectorcache::itag |
Parameter array for power output of itag ram.
gs::gs_param_array ivectorcache::power |
Parameter array for power output (dcache controller)
sr_param<sc_core::sc_time> ivectorcache::power_frame_starting_time |
Power frame starting time.
Referenced by swi_power_cb().
Normalized static power input for idata ram (sp)
Referenced by power_model().
Normalized static power input for itag ram (dp)
Referenced by power_model().
Static power of module.
Referenced by ivectorcache(), and power_model().
Switching power.
Referenced by ivectorcache(), and swi_power_cb().