Documentation
¶
Overview ¶
Package mem and its subpackages provide definitions for memoy systems.
Index ¶
- Constants
- type AccessReq
- type AccessRsp
- type DataReadyRsp
- type DataReadyRspBuilder
- func (b DataReadyRspBuilder) Build() *DataReadyRsp
- func (b DataReadyRspBuilder) WithData(data []byte) DataReadyRspBuilder
- func (b DataReadyRspBuilder) WithDst(dst akita.Port) DataReadyRspBuilder
- func (b DataReadyRspBuilder) WithRspTo(id string) DataReadyRspBuilder
- func (b DataReadyRspBuilder) WithSendTime(t akita.VTimeInSec) DataReadyRspBuilder
- func (b DataReadyRspBuilder) WithSrc(src akita.Port) DataReadyRspBuilder
- type ReadReq
- type ReadReqBuilder
- func (b ReadReqBuilder) Build() *ReadReq
- func (b ReadReqBuilder) CanWaitForCoalesce() ReadReqBuilder
- func (b ReadReqBuilder) WithAddress(address uint64) ReadReqBuilder
- func (b ReadReqBuilder) WithByteSize(byteSize uint64) ReadReqBuilder
- func (b ReadReqBuilder) WithDst(dst akita.Port) ReadReqBuilder
- func (b ReadReqBuilder) WithPID(pid ca.PID) ReadReqBuilder
- func (b ReadReqBuilder) WithSendTime(t akita.VTimeInSec) ReadReqBuilder
- func (b ReadReqBuilder) WithSrc(src akita.Port) ReadReqBuilder
- type Storage
- type WriteBuffer
- type WriteDoneRsp
- type WriteDoneRspBuilder
- func (b WriteDoneRspBuilder) Build() *WriteDoneRsp
- func (b WriteDoneRspBuilder) WithDst(dst akita.Port) WriteDoneRspBuilder
- func (b WriteDoneRspBuilder) WithRspTo(id string) WriteDoneRspBuilder
- func (b WriteDoneRspBuilder) WithSendTime(t akita.VTimeInSec) WriteDoneRspBuilder
- func (b WriteDoneRspBuilder) WithSrc(src akita.Port) WriteDoneRspBuilder
- type WriteReq
- type WriteReqBuilder
- func (b WriteReqBuilder) Build() *WriteReq
- func (b WriteReqBuilder) CanWaitForCoalesce() WriteReqBuilder
- func (b WriteReqBuilder) WithAddress(address uint64) WriteReqBuilder
- func (b WriteReqBuilder) WithData(data []byte) WriteReqBuilder
- func (b WriteReqBuilder) WithDirtyMask(mask []bool) WriteReqBuilder
- func (b WriteReqBuilder) WithDst(dst akita.Port) WriteReqBuilder
- func (b WriteReqBuilder) WithPID(pid ca.PID) WriteReqBuilder
- func (b WriteReqBuilder) WithSendTime(t akita.VTimeInSec) WriteReqBuilder
- func (b WriteReqBuilder) WithSrc(src akita.Port) WriteReqBuilder
Constants ¶
const ( KB uint64 = 1 << (10 * iota) MB GB TB )
For capacity
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessReq ¶
AccessReq abstracts read and write requests that are sent to the cache modules or memory controllers.
type DataReadyRsp ¶
type DataReadyRsp struct { akita.MsgMeta RespondTo string // The ID of the request it replies Data []byte }
A DataReadyRsp is the respond sent from the lower module to the higher module that carries the data loaded.
func (*DataReadyRsp) GetRespondTo ¶
func (r *DataReadyRsp) GetRespondTo() string
GetRespondTo returns the ID if the request that the respond is resonding to.
func (*DataReadyRsp) Meta ¶
func (r *DataReadyRsp) Meta() *akita.MsgMeta
Meta returns the meta data attached to each message.
type DataReadyRspBuilder ¶
type DataReadyRspBuilder struct {
// contains filtered or unexported fields
}
DataReadyRspBuilder can build data ready responds.
func (DataReadyRspBuilder) Build ¶
func (b DataReadyRspBuilder) Build() *DataReadyRsp
Build creates a new DataReadyRsp
func (DataReadyRspBuilder) WithData ¶
func (b DataReadyRspBuilder) WithData(data []byte) DataReadyRspBuilder
WithData sets the data of the request to build.
func (DataReadyRspBuilder) WithDst ¶
func (b DataReadyRspBuilder) WithDst(dst akita.Port) DataReadyRspBuilder
WithDst sets the destination of the request to build.
func (DataReadyRspBuilder) WithRspTo ¶
func (b DataReadyRspBuilder) WithRspTo(id string) DataReadyRspBuilder
WithRspTo sets ID of the request that the respond to build is replying to.
func (DataReadyRspBuilder) WithSendTime ¶
func (b DataReadyRspBuilder) WithSendTime( t akita.VTimeInSec, ) DataReadyRspBuilder
WithSendTime sets the send time of the request to build.
func (DataReadyRspBuilder) WithSrc ¶
func (b DataReadyRspBuilder) WithSrc(src akita.Port) DataReadyRspBuilder
WithSrc sets the source of the request to build.
type ReadReq ¶
type ReadReq struct { akita.MsgMeta Address uint64 AccessByteSize uint64 PID ca.PID CanWaitForCoalesce bool }
A ReadReq is a request sent to a memory controller to fetch data
func (*ReadReq) GetAddress ¶
GetAddress returns the address that the request is accessing
func (*ReadReq) GetByteSize ¶
GetByteSize returns the number of byte that the request is accessing.
type ReadReqBuilder ¶
type ReadReqBuilder struct {
// contains filtered or unexported fields
}
ReadReqBuilder can build read requests.
func (ReadReqBuilder) CanWaitForCoalesce ¶
func (b ReadReqBuilder) CanWaitForCoalesce() ReadReqBuilder
CanWaitForCoalesce allow the request to build to wait for coalesce.
func (ReadReqBuilder) WithAddress ¶
func (b ReadReqBuilder) WithAddress(address uint64) ReadReqBuilder
WithAddress sets the address of the request to build.
func (ReadReqBuilder) WithByteSize ¶
func (b ReadReqBuilder) WithByteSize(byteSize uint64) ReadReqBuilder
WithByteSize sets the byte size of the request to build.
func (ReadReqBuilder) WithDst ¶
func (b ReadReqBuilder) WithDst(dst akita.Port) ReadReqBuilder
WithDst sets the destination of the request to build.
func (ReadReqBuilder) WithPID ¶
func (b ReadReqBuilder) WithPID(pid ca.PID) ReadReqBuilder
WithPID sets the PID of the request to build.
func (ReadReqBuilder) WithSendTime ¶
func (b ReadReqBuilder) WithSendTime(t akita.VTimeInSec) ReadReqBuilder
WithSendTime sets the send time of the request to build.
func (ReadReqBuilder) WithSrc ¶
func (b ReadReqBuilder) WithSrc(src akita.Port) ReadReqBuilder
WithSrc sets the source of the request to build.
type Storage ¶
A Storage keeps the data of the guest system.
A storage is an abstraction of all different type of storage including registers, main memory, and hard drives.
The storage implementation manages the storage in units. The unit can is similar to the concept of page in mmemory management. For the units that it not touched by Read and Write function, no memory will be allocated.
func NewStorage ¶
NewStorage creates a storage object with the specified capacity
type WriteBuffer ¶
type WriteBuffer interface { Tick(now akita.VTimeInSec) bool CanEnqueue() bool Enqueue(write *WriteReq) Query(read *ReadReq) *WriteReq SetWriteCombineGranularity(size uint64) }
WriteBuffer is a place where the write can be transferred at a later time.
func NewWriteBuffer ¶
func NewWriteBuffer(capacity int, port akita.Port) WriteBuffer
NewWriteBuffer creates and returns a default write buffer
type WriteDoneRsp ¶
A WriteDoneRsp is a respond sent from the lower module to the higher module to mark a previous requests is completed successfully.
func (*WriteDoneRsp) GetRespondTo ¶
func (r *WriteDoneRsp) GetRespondTo() string
GetRespondTo returns the ID of the request that the respond is responding to.
func (*WriteDoneRsp) Meta ¶
func (r *WriteDoneRsp) Meta() *akita.MsgMeta
Meta returns the meta data accociated with the message.
type WriteDoneRspBuilder ¶
type WriteDoneRspBuilder struct {
// contains filtered or unexported fields
}
WriteDoneRspBuilder can build data ready responds.
func (WriteDoneRspBuilder) Build ¶
func (b WriteDoneRspBuilder) Build() *WriteDoneRsp
Build creates a new WriteDoneRsp
func (WriteDoneRspBuilder) WithDst ¶
func (b WriteDoneRspBuilder) WithDst(dst akita.Port) WriteDoneRspBuilder
WithDst sets the destination of the request to build.
func (WriteDoneRspBuilder) WithRspTo ¶
func (b WriteDoneRspBuilder) WithRspTo(id string) WriteDoneRspBuilder
WithRspTo sets ID of the request that the respond to build is replying to.
func (WriteDoneRspBuilder) WithSendTime ¶
func (b WriteDoneRspBuilder) WithSendTime( t akita.VTimeInSec, ) WriteDoneRspBuilder
WithSendTime sets the send time of the message to build.
func (WriteDoneRspBuilder) WithSrc ¶
func (b WriteDoneRspBuilder) WithSrc(src akita.Port) WriteDoneRspBuilder
WithSrc sets the source of the request to build.
type WriteReq ¶
type WriteReq struct { akita.MsgMeta Address uint64 Data []byte DirtyMask []bool PID ca.PID CanWaitForCoalesce bool }
A WriteReq is a request sent to a memory controller to write data
func (*WriteReq) GetAddress ¶
GetAddress returns the address that the request is accessing
func (*WriteReq) GetByteSize ¶
GetByteSize returns the number of byte that the request is writing.
type WriteReqBuilder ¶
type WriteReqBuilder struct {
// contains filtered or unexported fields
}
WriteReqBuilder can build read requests.
func (WriteReqBuilder) Build ¶
func (b WriteReqBuilder) Build() *WriteReq
Build creates a new WriteReq
func (WriteReqBuilder) CanWaitForCoalesce ¶
func (b WriteReqBuilder) CanWaitForCoalesce() WriteReqBuilder
CanWaitForCoalesce allow the request to build to wait for coalesce.
func (WriteReqBuilder) WithAddress ¶
func (b WriteReqBuilder) WithAddress(address uint64) WriteReqBuilder
WithAddress sets the address of the request to build.
func (WriteReqBuilder) WithData ¶
func (b WriteReqBuilder) WithData(data []byte) WriteReqBuilder
WithData sets the data of the request to build.
func (WriteReqBuilder) WithDirtyMask ¶
func (b WriteReqBuilder) WithDirtyMask(mask []bool) WriteReqBuilder
WithDirtyMask sets the dirty mask of the request to build.
func (WriteReqBuilder) WithDst ¶
func (b WriteReqBuilder) WithDst(dst akita.Port) WriteReqBuilder
WithDst sets the destination of the request to build.
func (WriteReqBuilder) WithPID ¶
func (b WriteReqBuilder) WithPID(pid ca.PID) WriteReqBuilder
WithPID sets the PID of the request to build.
func (WriteReqBuilder) WithSendTime ¶
func (b WriteReqBuilder) WithSendTime(t akita.VTimeInSec) WriteReqBuilder
WithSendTime sets the send time of the message to build.
func (WriteReqBuilder) WithSrc ¶
func (b WriteReqBuilder) WithSrc(src akita.Port) WriteReqBuilder
WithSrc sets the source of the request to build.
Directories
¶
Path | Synopsis |
---|---|
Package acceptancetests provides utility data structure definitions for writing memory system acceptance tests.
|
Package acceptancetests provides utility data structure definitions for writing memory system acceptance tests. |
Package cache provides the basic commonly used utility data structures for cache implementation.
|
Package cache provides the basic commonly used utility data structures for cache implementation. |
writeback
Package writeback implement a writeback cache.=
|
Package writeback implement a writeback cache.= |
Package idealmemcontroller provides an implementation of an ideal memory controller, which has a fix latency and unlimited concurrency.
|
Package idealmemcontroller provides an implementation of an ideal memory controller, which has a fix latency and unlimited concurrency. |
Package trace provides a tracer that can trace memory system tasks.
|
Package trace provides a tracer that can trace memory system tasks. |
Package vm provides the models for address translations
|
Package vm provides the models for address translations |
addresstranslator
Package addresstranslator implements a component that can forward the translated read and write request to the bottom memory unit.
|
Package addresstranslator implements a component that can forward the translated read and write request to the bottom memory unit. |
mmu
Package mmu provides a Memory Management Unit implementation.
|
Package mmu provides a Memory Management Unit implementation. |
tlb
Package tlb provides a TLB component implementation.
|
Package tlb provides a TLB component implementation. |
tlb/internal
Package internal provides the definition required for defining TLB.
|
Package internal provides the definition required for defining TLB. |