Documentation
¶
Overview ¶
Package vm provides the models for address translations
Index ¶
- type DefaultPageTableFactory
- type Page
- type PageMigrationInfo
- type PageMigrationReqToDriver
- type PageMigrationRspFromDriver
- type PageTable
- type PageTableFactory
- type PageTableImpl
- type TLBTracer
- type TranslationReq
- type TranslationReqBuilder
- func (b TranslationReqBuilder) Build() *TranslationReq
- func (b TranslationReqBuilder) WithDst(dst akita.Port) TranslationReqBuilder
- func (b TranslationReqBuilder) WithGPUID(gpuID uint64) TranslationReqBuilder
- func (b TranslationReqBuilder) WithPID(pid ca.PID) TranslationReqBuilder
- func (b TranslationReqBuilder) WithSendTime(t akita.VTimeInSec) TranslationReqBuilder
- func (b TranslationReqBuilder) WithSrc(src akita.Port) TranslationReqBuilder
- func (b TranslationReqBuilder) WithVAddr(vAddr uint64) TranslationReqBuilder
- type TranslationRsp
- type TranslationRspBuilder
- func (b TranslationRspBuilder) Build() *TranslationRsp
- func (b TranslationRspBuilder) WithDst(dst akita.Port) TranslationRspBuilder
- func (b TranslationRspBuilder) WithPage(page Page) TranslationRspBuilder
- func (b TranslationRspBuilder) WithRspTo(rspTo string) TranslationRspBuilder
- func (b TranslationRspBuilder) WithSendTime(t akita.VTimeInSec) TranslationRspBuilder
- func (b TranslationRspBuilder) WithSrc(src akita.Port) TranslationRspBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultPageTableFactory ¶
type DefaultPageTableFactory struct {
Log2PageSize uint64
}
DefaultPageTableFactory builds PageTableImpl
func (DefaultPageTableFactory) Build ¶
func (f DefaultPageTableFactory) Build() PageTable
Build returns a default page table implementation
type Page ¶
type Page struct { PID ca.PID PAddr uint64 VAddr uint64 PageSize uint64 Valid bool GPUID uint64 Unified bool IsMigrating bool IsPinned bool }
A Page is an entry in the page table, maintaining the information about how to translate a virtual address to a physical address
type PageMigrationInfo ¶ added in v1.6.0
type PageMigrationReqToDriver ¶ added in v1.2.2
type PageMigrationReqToDriver struct { akita.MsgMeta StartTime akita.VTimeInSec EndTime akita.VTimeInSec MigrationInfo *PageMigrationInfo CurrAccessingGPUs []uint64 PID ca.PID CurrPageHostGPU uint64 PageSize uint64 RespondToTop bool }
PageMigrationReqToDriver is a req to driver from MMU to start page migration process
func NewPageMigrationReqToDriver ¶ added in v1.2.2
func NewPageMigrationReqToDriver( time akita.VTimeInSec, src, dst akita.Port, ) *PageMigrationReqToDriver
func (*PageMigrationReqToDriver) Meta ¶ added in v1.3.0
func (m *PageMigrationReqToDriver) Meta() *akita.MsgMeta
Meta returns the meta data associated with the message.
type PageMigrationRspFromDriver ¶ added in v1.2.2
type PageMigrationRspFromDriver struct { akita.MsgMeta StartTime akita.VTimeInSec EndTime akita.VTimeInSec VAddr []uint64 RspToTop bool }
PageMigrationRspFromDriver is a rsp from driver to MMU marking completion of migration
func NewPageMigrationRspFromDriver ¶ added in v1.2.2
func NewPageMigrationRspFromDriver( time akita.VTimeInSec, src, dst akita.Port, ) *PageMigrationRspFromDriver
func (*PageMigrationRspFromDriver) Meta ¶ added in v1.3.0
func (m *PageMigrationRspFromDriver) Meta() *akita.MsgMeta
Meta returns the meta data associated with the message.
type PageTable ¶
type PageTable interface { InsertPage(page *Page) RemovePage(vAddr uint64) FindPage(vAddr uint64) *Page GetNumPages() int GetAllPages() *list.List }
A PageTable holds the meta-data of the pages.
type PageTableFactory ¶
type PageTableFactory interface {
Build() PageTable
}
A PageTableFactory builds PageTables
type PageTableImpl ¶
PageTableImpl is the default implementation of a Page Table
func (*PageTableImpl) FindPage ¶
func (pt *PageTableImpl) FindPage(vAddr uint64) *Page
FindPage returns the page that contains the given virtual address. This function returns nil if the page is not found.
func (*PageTableImpl) GetAllPages ¶ added in v1.7.0
func (pt *PageTableImpl) GetAllPages() *list.List
GetAllPages returns a list that hold all the pages
func (*PageTableImpl) GetNumPages ¶ added in v1.5.0
func (pt *PageTableImpl) GetNumPages() int
GetNumPages returns the number of page table entries
func (*PageTableImpl) InsertPage ¶
func (pt *PageTableImpl) InsertPage(page *Page)
InsertPage put a new page into the PageTable
func (*PageTableImpl) RemovePage ¶
func (pt *PageTableImpl) RemovePage(vAddr uint64)
RemovePage removes the entry in the page table that contains the target address.
type TLBTracer ¶
type TLBTracer struct {
// contains filtered or unexported fields
}
A TLBTracer write logs for what happened in a TLB
func NewTLBTracer ¶
NewTLBTracer produce a new TLBTracer, injecting the dependency of a writer.
type TranslationReq ¶
A TranslationReq asks the receiver component to translate the request.
func (*TranslationReq) Meta ¶ added in v1.3.0
func (r *TranslationReq) Meta() *akita.MsgMeta
Meta returns the meta data associated with the message.
type TranslationReqBuilder ¶ added in v1.3.0
type TranslationReqBuilder struct {
// contains filtered or unexported fields
}
TranslationReqBuilder can build translation requests
func (TranslationReqBuilder) Build ¶ added in v1.3.0
func (b TranslationReqBuilder) Build() *TranslationReq
Build creats a new TranslationReq
func (TranslationReqBuilder) WithDst ¶ added in v1.3.0
func (b TranslationReqBuilder) WithDst(dst akita.Port) TranslationReqBuilder
WithDst sets the destination of the request to build.
func (TranslationReqBuilder) WithGPUID ¶ added in v1.3.0
func (b TranslationReqBuilder) WithGPUID(gpuID uint64) TranslationReqBuilder
WithGPUID sets the GPU ID of the request to build.
func (TranslationReqBuilder) WithPID ¶ added in v1.3.0
func (b TranslationReqBuilder) WithPID(pid ca.PID) TranslationReqBuilder
WithPID sets the virtual address of the request to build.
func (TranslationReqBuilder) WithSendTime ¶ added in v1.3.0
func (b TranslationReqBuilder) WithSendTime( t akita.VTimeInSec, ) TranslationReqBuilder
WithSendTime sets the send time of the request to build.:w
func (TranslationReqBuilder) WithSrc ¶ added in v1.3.0
func (b TranslationReqBuilder) WithSrc(src akita.Port) TranslationReqBuilder
WithSrc sets the source of the request to build.
func (TranslationReqBuilder) WithVAddr ¶ added in v1.3.0
func (b TranslationReqBuilder) WithVAddr(vAddr uint64) TranslationReqBuilder
WithVAddr sets the virtual address of the request to build.
type TranslationRsp ¶ added in v1.3.0
type TranslationRsp struct { akita.MsgMeta RespondTo string // The ID of the request it replies Page Page }
A TranslationRsp is the respond for a TranslationReq. It carries the physical address.
func (*TranslationRsp) Meta ¶ added in v1.3.0
func (r *TranslationRsp) Meta() *akita.MsgMeta
Meta returns the meta data associated with the message.
type TranslationRspBuilder ¶ added in v1.3.0
type TranslationRspBuilder struct {
// contains filtered or unexported fields
}
TranslationRspBuilder can build translation requests
func (TranslationRspBuilder) Build ¶ added in v1.3.0
func (b TranslationRspBuilder) Build() *TranslationRsp
Build creats a new TranslationRsp
func (TranslationRspBuilder) WithDst ¶ added in v1.3.0
func (b TranslationRspBuilder) WithDst(dst akita.Port) TranslationRspBuilder
WithDst sets the destination of the respond to build.
func (TranslationRspBuilder) WithPage ¶ added in v1.3.0
func (b TranslationRspBuilder) WithPage(page Page) TranslationRspBuilder
WithPage sets the page of the respond to build.
func (TranslationRspBuilder) WithRspTo ¶ added in v1.3.0
func (b TranslationRspBuilder) WithRspTo(rspTo string) TranslationRspBuilder
WithRspTo sets the request ID of the respond to build.
func (TranslationRspBuilder) WithSendTime ¶ added in v1.3.0
func (b TranslationRspBuilder) WithSendTime( t akita.VTimeInSec, ) TranslationRspBuilder
WithSendTime sets the send time of the message to build.
func (TranslationRspBuilder) WithSrc ¶ added in v1.3.0
func (b TranslationRspBuilder) WithSrc(src akita.Port) TranslationRspBuilder
WithSrc sets the source of the respond to build.
Directories
¶
Path | Synopsis |
---|---|
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. |
Package mmu provides a Memory Management Unit implementation.
|
Package mmu provides a Memory Management Unit implementation. |
Package tlb provides a TLB component implementation.
|
Package tlb provides a TLB component implementation. |
internal
Package internal provides the definition required for defining TLB.
|
Package internal provides the definition required for defining TLB. |