Documentation
¶
Index ¶
- func GetCacheLineID(addr uint64, blockSizeAsPowerOf2 uint64) (cacheLineID, offset uint64)
- type BankedLowModuleFinder
- type Block
- type Directory
- type DirectoryImpl
- func (d *DirectoryImpl) FindVictim(addr uint64) *Block
- func (d *DirectoryImpl) GetSets() []Set
- func (d *DirectoryImpl) Lookup(reqAddr uint64) *Block
- func (d *DirectoryImpl) Reset()
- func (d *DirectoryImpl) TotalSize() uint64
- func (d *DirectoryImpl) Visit(block *Block)
- func (d *DirectoryImpl) WayAssociativity() int
- type FlushReq
- type FlushRsp
- type InterleavedLowModuleFinder
- type LRUVictimFinder
- type LowModuleFinder
- type MSHR
- type MSHREntry
- type MSHRImpl
- type ProcessMSHRReturnEvent
- type ReadCompleteEvent
- type ReadForEvictEvent
- type ReadFromMSHREvent
- type SendEvent
- type Set
- type SetBankCycleLeftToZeroEvent
- type SingleLowModuleFinder
- type VictimFinder
- type WriteCompleteEvent
- type WriteFromBottomCompleteEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCacheLineID ¶
Types ¶
type BankedLowModuleFinder ¶
BankedLowModuleFinder defines the lower level modules by address banks
func NewBankedLowModuleFinder ¶
func NewBankedLowModuleFinder(bankSize uint64) *BankedLowModuleFinder
type Block ¶
type Block struct { Tag uint64 WayID int SetID int CacheAddress uint64 IsValid bool IsDirty bool ReadCount int IsLocked bool DirtyMask []bool }
A Block of a cache is the information that is associated with a cache line
type Directory ¶
type Directory interface { Lookup(address uint64) *Block FindVictim(address uint64) *Block Visit(block *Block) TotalSize() uint64 WayAssociativity() int GetSets() []Set Reset() }
A Directory stores the information about what is stored in the cache.
type DirectoryImpl ¶
type DirectoryImpl struct { NumSets int NumWays int BlockSize int Sets []Set // contains filtered or unexported fields }
A DirectoryImpl is the default implementation of a Directory
The directory can translate from the request address (can be either virtual address or physical address) to the cache based address.
func NewDirectory ¶
func NewDirectory( set, way, blockSize int, victimFinder VictimFinder, ) *DirectoryImpl
NewDirectory returns a new directory object
func (*DirectoryImpl) FindVictim ¶ added in v1.1.5
func (d *DirectoryImpl) FindVictim(addr uint64) *Block
FindVictim returns a block that can be used to stored data at address addr.
If it is valid, the cache controller need to decide what to do to evict the the data in the block
func (*DirectoryImpl) GetSets ¶ added in v1.1.5
func (d *DirectoryImpl) GetSets() []Set
GetSets returns all the sets in a directory
func (*DirectoryImpl) Lookup ¶
func (d *DirectoryImpl) Lookup(reqAddr uint64) *Block
Lookup finds the block that stores the reqAddr. If the reqAddr is valid in the cache, return the block information. Otherwise, return nil
func (*DirectoryImpl) Reset ¶
func (d *DirectoryImpl) Reset()
Reset will mark all the blocks in the directory invalid
func (*DirectoryImpl) TotalSize ¶
func (d *DirectoryImpl) TotalSize() uint64
TotalSize returns the maximum number of bytes can be stored in the cache
func (*DirectoryImpl) Visit ¶ added in v1.1.5
func (d *DirectoryImpl) Visit(block *Block)
Visit moves the block to the end of the LRUQueue
func (*DirectoryImpl) WayAssociativity ¶
func (d *DirectoryImpl) WayAssociativity() int
WayAssociativity returns the number of ways per set in the cache.
type FlushReq ¶ added in v1.1.5
FlushReq is the request send to a cache unit to request it to flush all the cache lines.
func NewFlushReq ¶ added in v1.1.5
func NewFlushReq(time akita.VTimeInSec, src, dst akita.Port) *FlushReq
NewFlushReq creates a new flush request
type FlushRsp ¶ added in v1.1.5
FlushRsp is the respond sent from the a cache unit for finishing a cache flush
func NewFlushRsp ¶ added in v1.1.5
NewFlushRsp creates a new flush response
type InterleavedLowModuleFinder ¶
type InterleavedLowModuleFinder struct { UseAddressSpaceLimitation bool LowAddress uint64 HighAddress uint64 InterleavingSize uint64 LowModules []akita.Port ModuleForOtherAddresses akita.Port }
InterleavedLowModuleFinder helps find the low module when the low modules maintains interleaved address space
func NewInterleavedLowModuleFinder ¶
func NewInterleavedLowModuleFinder(interleavingSize uint64) *InterleavedLowModuleFinder
NewInterleavedLowModuleFinder creates a new finder for interleaved lower modules
type LRUVictimFinder ¶ added in v1.1.5
type LRUVictimFinder struct { }
LRUVictimFinder evicts the least recently used block to evict
func NewLRUVictimFinder ¶ added in v1.1.5
func NewLRUVictimFinder() *LRUVictimFinder
NewLRUVictimFinder returns a newly constructed lru evictor
func (*LRUVictimFinder) FindVictim ¶ added in v1.1.5
func (e *LRUVictimFinder) FindVictim(set *Set) *Block
FindVictim returns the least recently used block in a set
type LowModuleFinder ¶
LowModuleFinder helps a cache unit or a akita to find the low module that should hold the data at a certain address
type MSHR ¶
type MSHR interface { Query(addr uint64) *MSHREntry Add(addr uint64) *MSHREntry Remove(addr uint64) *MSHREntry AllEntries() []*MSHREntry IsFull() bool }
MSHR is an interface that controls MSHR entries
type MSHREntry ¶
type MSHREntry struct { Requests []interface{} Block *Block ReadReq *mem.ReadReq DataReady *mem.DataReadyRsp Data []byte }
MSHREntry is an entry in MSHR
type MSHRImpl ¶
type MSHRImpl struct { *akita.ComponentBase CapacityInNumEntries int // contains filtered or unexported fields }
MSHRImpl is a default implementation of MSHR
func (*MSHRImpl) Add ¶
Add creats a new entry in the mshr. The Address passed in needs to be the block ID.
func (*MSHRImpl) AllEntries ¶ added in v1.1.5
AllEntries returns all the MSHREntries that are currently in the MSHR
type ProcessMSHRReturnEvent ¶
ProcessMSHRReturnEvent is an event to let the cache to process the requests associate with an MSHREntry
func NewProcessMSHRReturnEvent ¶
func NewProcessMSHRReturnEvent( time akita.VTimeInSec, handler akita.Handler, ) *ProcessMSHRReturnEvent
NewProcessMSHRReturnEvent creates a new ProcessMSHRReturnEvent
type ReadCompleteEvent ¶
A ReadCompleteEvent marks the completion of a cache read
func NewReadCompleteEvent ¶
func NewReadCompleteEvent( time akita.VTimeInSec, handler akita.Handler, ) *ReadCompleteEvent
NewReadCompleteEvent creates a new ReadCompleteEvent
type ReadForEvictEvent ¶
type ReadForEvictEvent struct { *akita.EventBase DataReady *mem.DataReadyRsp EvictBlock *Block NewBlock *Block ReadBottomReq *mem.ReadReq }
A ReadForEvictEvent marks the completion of a cache read. The data read is going to be written to the low module
func NewReadForEvictEvent ¶
func NewReadForEvictEvent( time akita.VTimeInSec, handler akita.Handler, ) *ReadForEvictEvent
NewReadForEvictEvent creates a new ReadForEvictEvent
type ReadFromMSHREvent ¶
ReadFromMSHREvent will respond data ready to the sender with the data that has not been written into the cache storage
func NewReadFromMSHREvent ¶
func NewReadFromMSHREvent( time akita.VTimeInSec, handler akita.Handler, ) *ReadFromMSHREvent
NewReadFromMSHREvent creates a new ReadFromMSHREvent
type SendEvent ¶
SendEvent triggers a cache to check its buffer and send requests out.
func NewSendEvent ¶
func NewSendEvent( time akita.VTimeInSec, handler akita.Handler, ) *SendEvent
NewSendEvent creates a new SendEvent
type SetBankCycleLeftToZeroEvent ¶
type SetBankCycleLeftToZeroEvent struct { *akita.EventBase // contains filtered or unexported fields }
func NewSetBankCycleLeftToZeroEvent ¶
func NewSetBankCycleLeftToZeroEvent( time akita.VTimeInSec, handler akita.Handler, bankNum int, ) *SetBankCycleLeftToZeroEvent
type SingleLowModuleFinder ¶
SingleLowModuleFinder is used when a unit is connected with only one low module
type VictimFinder ¶ added in v1.1.5
A VictimFinder decides with block should be evicted
type WriteCompleteEvent ¶
type WriteCompleteEvent struct { *akita.EventBase WriteReq *mem.WriteReq Block *Block Offset uint64 }
A WriteCompleteEvent marks the completion of a write completion
func NewWriteCompleteEvent ¶
func NewWriteCompleteEvent( time akita.VTimeInSec, handler akita.Handler, ) *WriteCompleteEvent
NewWriteCompleteEvent creates a new WriteCompleteEvent
type WriteFromBottomCompleteEvent ¶
type WriteFromBottomCompleteEvent struct { *akita.EventBase DataReadyRsp *mem.DataReadyRsp ReadReq *mem.ReadReq Block *Block }
WriteFromBottomCompleteEvent is the event that represents a cache write operation triggered by a DataReadyRsp from the bottom
func NewWriteFromBottomCompleteEvent ¶
func NewWriteFromBottomCompleteEvent( time akita.VTimeInSec, handler akita.Handler, ) *WriteFromBottomCompleteEvent
NewWriteFromBottomCompleteEvent creates a new WriteCompleteEvent