Documentation ¶
Overview ¶
Package vm provides the models for address translations
Index ¶
- type PID
- type Page
- type PageMigrationInfo
- type PageMigrationReqToDriver
- type PageMigrationRspFromDriver
- type PageTable
- type TLBTracer
- type TranslationReq
- type TranslationReqBuilder
- func (b TranslationReqBuilder) Build() *TranslationReq
- func (b TranslationReqBuilder) WithDeviceID(deviceID uint64) TranslationReqBuilder
- func (b TranslationReqBuilder) WithDst(dst sim.Port) TranslationReqBuilder
- func (b TranslationReqBuilder) WithPID(pid PID) TranslationReqBuilder
- func (b TranslationReqBuilder) WithSendTime(t sim.VTimeInSec) TranslationReqBuilder
- func (b TranslationReqBuilder) WithSrc(src sim.Port) TranslationReqBuilder
- func (b TranslationReqBuilder) WithVAddr(vAddr uint64) TranslationReqBuilder
- type TranslationRsp
- type TranslationRspBuilder
- func (b TranslationRspBuilder) Build() *TranslationRsp
- func (b TranslationRspBuilder) WithDst(dst sim.Port) TranslationRspBuilder
- func (b TranslationRspBuilder) WithPage(page Page) TranslationRspBuilder
- func (b TranslationRspBuilder) WithRspTo(rspTo string) TranslationRspBuilder
- func (b TranslationRspBuilder) WithSendTime(t sim.VTimeInSec) TranslationRspBuilder
- func (b TranslationRspBuilder) WithSrc(src sim.Port) TranslationRspBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Page ¶
type Page struct { PID PID PAddr uint64 VAddr uint64 PageSize uint64 Valid bool DeviceID 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 ¶
PageMigrationInfo records the information required for the driver to perform a page migration.
type PageMigrationReqToDriver ¶
type PageMigrationReqToDriver struct { sim.MsgMeta StartTime sim.VTimeInSec EndTime sim.VTimeInSec MigrationInfo *PageMigrationInfo CurrAccessingGPUs []uint64 PID PID CurrPageHostGPU uint64 PageSize uint64 RespondToTop bool }
PageMigrationReqToDriver is a req to driver from MMU to start page migration process
func NewPageMigrationReqToDriver ¶
func NewPageMigrationReqToDriver( time sim.VTimeInSec, src, dst sim.Port, ) *PageMigrationReqToDriver
NewPageMigrationReqToDriver creates a PageMigrationReqToDriver.
func (*PageMigrationReqToDriver) Meta ¶
func (m *PageMigrationReqToDriver) Meta() *sim.MsgMeta
Meta returns the meta data associated with the message.
type PageMigrationRspFromDriver ¶
type PageMigrationRspFromDriver struct { sim.MsgMeta StartTime sim.VTimeInSec EndTime sim.VTimeInSec VAddr []uint64 RspToTop bool }
PageMigrationRspFromDriver is a rsp from driver to MMU marking completion of migration
func NewPageMigrationRspFromDriver ¶
func NewPageMigrationRspFromDriver( time sim.VTimeInSec, src, dst sim.Port, ) *PageMigrationRspFromDriver
NewPageMigrationRspFromDriver creates a new PageMigrationRspFromDriver.
func (*PageMigrationRspFromDriver) Meta ¶
func (m *PageMigrationRspFromDriver) Meta() *sim.MsgMeta
Meta returns the meta data associated with the message.
type PageTable ¶
type PageTable interface { Insert(page Page) Remove(pid PID, vAddr uint64) Find(pid PID, Addr uint64) (Page, bool) Update(page Page) }
A PageTable holds the a list of pages.
func NewPageTable ¶
NewPageTable creates a new PageTable.
type TLBTracer ¶
type TLBTracer struct {
// contains filtered or unexported fields
}
A TLBTracer write logs for what happened in a TLB
func NewTLBTracer ¶
func NewTLBTracer(w io.Writer, timeTeller sim.TimeTeller) *TLBTracer
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 ¶
func (r *TranslationReq) Meta() *sim.MsgMeta
Meta returns the meta data associated with the message.
type TranslationReqBuilder ¶
type TranslationReqBuilder struct {
// contains filtered or unexported fields
}
TranslationReqBuilder can build translation requests
func (TranslationReqBuilder) Build ¶
func (b TranslationReqBuilder) Build() *TranslationReq
Build creates a new TranslationReq
func (TranslationReqBuilder) WithDeviceID ¶
func (b TranslationReqBuilder) WithDeviceID(deviceID uint64) TranslationReqBuilder
WithDeviceID sets the GPU ID of the request to build.
func (TranslationReqBuilder) WithDst ¶
func (b TranslationReqBuilder) WithDst(dst sim.Port) TranslationReqBuilder
WithDst sets the destination of the request to build.
func (TranslationReqBuilder) WithPID ¶
func (b TranslationReqBuilder) WithPID(pid PID) TranslationReqBuilder
WithPID sets the virtual address of the request to build.
func (TranslationReqBuilder) WithSendTime ¶
func (b TranslationReqBuilder) WithSendTime( t sim.VTimeInSec, ) TranslationReqBuilder
WithSendTime sets the send time of the request to build.:w
func (TranslationReqBuilder) WithSrc ¶
func (b TranslationReqBuilder) WithSrc(src sim.Port) TranslationReqBuilder
WithSrc sets the source of the request to build.
func (TranslationReqBuilder) WithVAddr ¶
func (b TranslationReqBuilder) WithVAddr(vAddr uint64) TranslationReqBuilder
WithVAddr sets the virtual address of the request to build.
type TranslationRsp ¶
type TranslationRsp struct { sim.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) GetRspTo ¶
func (r *TranslationRsp) GetRspTo() string
GetRspTo returns the request ID that the respond is responding to.
func (*TranslationRsp) Meta ¶
func (r *TranslationRsp) Meta() *sim.MsgMeta
Meta returns the meta data associated with the message.
type TranslationRspBuilder ¶
type TranslationRspBuilder struct {
// contains filtered or unexported fields
}
TranslationRspBuilder can build translation requests
func (TranslationRspBuilder) Build ¶
func (b TranslationRspBuilder) Build() *TranslationRsp
Build creates a new TranslationRsp
func (TranslationRspBuilder) WithDst ¶
func (b TranslationRspBuilder) WithDst(dst sim.Port) TranslationRspBuilder
WithDst sets the destination of the respond to build.
func (TranslationRspBuilder) WithPage ¶
func (b TranslationRspBuilder) WithPage(page Page) TranslationRspBuilder
WithPage sets the page of the respond to build.
func (TranslationRspBuilder) WithRspTo ¶
func (b TranslationRspBuilder) WithRspTo(rspTo string) TranslationRspBuilder
WithRspTo sets the request ID of the respond to build.
func (TranslationRspBuilder) WithSendTime ¶
func (b TranslationRspBuilder) WithSendTime( t sim.VTimeInSec, ) TranslationRspBuilder
WithSendTime sets the send time of the message to build.
func (TranslationRspBuilder) WithSrc ¶
func (b TranslationRspBuilder) WithSrc(src sim.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. |