VIRTUTECH CONFIDENTIAL Previous - Up - Next
g-cache
- Provided by
-
g-cache
- Class Hierarchy
-
conf-object → log-object → g-cache
- Interfaces Implemented
-
log_object, timing_model
- Description
-
g-cache is an in-order 'flat' cache model with the following features: configurable number of lines, line size, associativity; indexing/tagging on physical/virtual addresses; configurable policies for write-allocate and write-back; random, cyclic and lru replacement policies; several caches can be connected in chain; a single cache can be connected to several processors; support for a simple MESI protocol between caches.
Attributes
- Attributes inherited from class conf-object
-
attributes, classname, component, iface, name, object_id, queue
- Attributes inherited from class log-object
-
access_count, log_buffer, log_buffer_last, log_buffer_size, log_group_mask, log_groups, log_level, log_type_mask
- Attribute List
-
- config_assoc
- Optional attribute; read/write access; type: Integer.
Cache associativity. Note that the total number of lines divided by the associativity must be a power of 2. (default is 4).
- config_block_STC
- Optional attribute; read/write access; type: Integer.
Prevent the cache from using the STCs. Read the 'Cache Simulation' chapter in Simics User Guide for more information(0: STC usage allowed, 1: STC usage blocked; default is 0).
- config_line_number
- Optional attribute; read/write access; type: Integer.
Number of lines in the cache (default is 128)
- config_line_size
- Optional attribute; read/write access; type: Integer.
Cache line size (must be a power of 2, default is 32). If you plan to use the STC in combination to improve the cache performance, this value must be greater or equal to the instruction_profile_line_size.
- config_replacement_policy
- Optional attribute; read/write access; type: String.
Replacement policy ("random", "LRU" or "cyclic", default is "random").
- config_seed
- Optional attribute; read/write access; type: Integer.
Seed for random replacement policy, default is 0).
- config_virtual_index
- Optional attribute; read/write access; type: Integer.
Address used to compute the set in the cache (0: physical, 1: virtual; default is 0).
- config_virtual_tag
- Optional attribute; read/write access; type: Integer.
Address used to compute the tag of the cache line (0: physical, 1: virtual; default is 0).
- config_write_allocate
- Optional attribute; read/write access; type: Integer.
Write allocation policy (0: non-write allocate, 1: write-allocate, default is 0).
- config_write_back
- Optional attribute; read/write access; type: Integer.
Write policy (0: write-through, 1: write-back, default is 0).
- cpus
- Required attribute; read/write access; type: n|o|[o+].
cpus that can send transactions to the cache.
- higher_level_caches
- Optional attribute; read/write access; type: [o*].
Higher level caches that need to receive invalidates during MESI snooping (MESI protocol).
- lines
- Optional attribute; read/write access; type: [[iiii]*]; integer indexed; indexed type: [iiii].
Content of the cache lines
- lines_last_used
- Optional attribute; read/write access; type: [i*]; integer indexed; indexed type: Integer.
Last used timestamp for the cache lines
- next_line_in_set
- Optional attribute; read/write access; type: [i*]; integer indexed; indexed type: Integer.
Next line used for replacement in a given set.
- penalty_read
- Optional attribute; read/write access; type: Integer.
Stall penalty (in cycles) for any incoming read transaction.A cache-hit on read will only suffer a 'read' penalty (default is 0). Note that if you set this to a non-zero value, the simulation won't be able to use the STCs.
- penalty_read_next
- Optional attribute; read/write access; type: Integer.
Stall penalty (in cycles) for a read transaction issued by the cache to the next level cache. A cache miss on read will have a penalty for 'read' (incoming transaction) + 'read-next' (line fetch transaction) + any penalty set by the next caches. (default is 0)
- penalty_write
- Optional attribute; read/write access; type: Integer.
Stall penalty (in cycles) for any incoming write transaction. A cache-hit on write (in a write-back cache) will only suffer a 'write' penalty (default is 0). Note that if you set this to a non-zero value, the simulation won't be able to use the STCs.
- penalty_write_next
- Optional attribute; read/write access; type: Integer.
Stall penalty (in cycles) for a write transactions issued by the cache to the next level cache. In a write-back cache, a cache miss on read triggering a copy-back transaction will have a penalty for 'read', 'write-next' (copy-back transaction) and 'read-next' (line fetch transaction). In write-through cache, a write transaction will always have at least a penalty for 'write' and 'write-next' (write-through transaction). (default is 0).
- profilers
- Optional attribute; read/write access; type: [o|n*]; integer indexed; indexed type: Object or Nil.
Profilers connected to the cache.
- snoopers
- Optional attribute; read/write access; type: [o*].
Caches listening on the bus (MESI protocol).
- stat_copy_back
- Optional attribute; read/write access; type: Integer.
Number of copy-back transactions initiated by the cache.
- stat_data_read
- Optional attribute; read/write access; type: Integer.
Number of cacheable data read transactions (may be underestimated if the STCs are used, see Simics User Guide for more information).
- stat_data_read_miss
- Optional attribute; read/write access; type: Integer.
Number of cacheable data read transactions that missed in the cache.
- stat_data_write
- Optional attribute; read/write access; type: Integer.
Number of cacheable data write transactions (may be underestimated if the STCs are used, see Simics User Guide for more information).
- stat_data_write_miss
- Optional attribute; read/write access; type: Integer.
Number of cacheable data write transactions that missed in the cache (write-through caches report a correct miss value but all writes are sent to the next level).
- stat_dev_data_read
- Optional attribute; read/write access; type: Integer.
Number of device data read transactions (DMA).
- stat_dev_data_write
- Optional attribute; read/write access; type: Integer.
Number of device data write transactions (DMA).
- stat_inst_fetch
- Optional attribute; read/write access; type: Integer.
Number of cacheable instruction fetches (may be underestimated if the STCs are used, see Simics User Guide for more information).
- stat_inst_fetch_miss
- Optional attribute; read/write access; type: Integer.
Number of cacheable instruction fetches that missed in the cache.
- stat_lost_stall_cycles
- Optional attribute; read/write access; type: Integer.
Stall cycles lost due to non-stallable transactions.
- stat_mesi_exclusive_to_shared
- Optional attribute; read/write access; type: Integer.
Number of Exclusive to Shared transitions in MESI protocol.
- stat_mesi_invalidate
- Optional attribute; read/write access; type: Integer.
Number of lines invalidated in MESI protocol.
- stat_mesi_modified_to_shared
- Optional attribute; read/write access; type: Integer.
Number of Modified to Shared transitions in MESI protocol.
- stat_transaction
- Optional attribute; read/write access; type: Integer.
Total number of transactions seen by the cache.
- stat_uc_data_read
- Optional attribute; read/write access; type: Integer.
Number of uncacheable data read transactions.
- stat_uc_data_write
- Optional attribute; read/write access; type: Integer.
Number of uncacheable data write transactions.
- stat_uc_inst_fetch
- Optional attribute; read/write access; type: Integer.
Number of uncacheable inst fetch transactions.
- timing_model
- Optional attribute; read/write access; type: Object or Nil.
Object listening on transactions coming from the cache (line fetch, copy-back).
Command List
- Commands defined by interface log_object
-
log, log-group, log-level, log-size, log-type
- Commands
-
Command Descriptions
-
<g-cache>.add-profiler
- Synopsis
-
<g-cache>.add-profiler ["type"] ["profiler"]
- Description
-
Add a profiler of the given 'type' to the cache. If a 'profiler' is passed as argument, it will be used instead of a newly created object.
-
<g-cache>.info
- Synopsis
-
<g-cache>.info
- Description
-
Print configuration information for the cache.
-
<g-cache>.remove-profiler
- Synopsis
-
<g-cache>.remove-profiler ["type"]
- Description
-
Remove the profiler of a given 'type' from the cache.
-
<g-cache>.reset-cache-lines
- Synopsis
-
<g-cache>.reset-cache-lines
- Description
-
Reset all the cache lines to their default values.
-
<g-cache>.reset-statistics
- Synopsis
-
<g-cache>.reset-statistics
- Description
-
Reset the cache statistics.
-
<g-cache>.statistics
- Synopsis
-
<g-cache>.statistics
- Description
-
Print the current value of the cache statistics (this will flush the STC counters to report correct values).
-
<g-cache>.status
- Synopsis
-
<g-cache>.status [-cycle]
- Description
-
Print the cache lines status. -cycle prints the last cycle each cache line was accessed (if LRU replacement policy is active). A '<' marks the next line to be replaced (if cyclic replacement policy is active).
VIRTUTECH CONFIDENTIAL Previous - Up - Next