vm

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2019 License: MIT Imports: 7 Imported by: 8

Documentation

Overview

Package vm provides the models for address translations

Index

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

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 PageMigrationInfo struct {
	GpuReqToVAddrMap map[uint64][]uint64
}

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

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

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

type PageTableImpl struct {
	sync.Mutex
	// contains filtered or unexported fields
}

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

func NewTLBTracer(w io.Writer) *TLBTracer

NewTLBTracer produce a new TLBTracer, injecting the dependency of a writer.

func (*TLBTracer) Func

func (t *TLBTracer) Func(ctx *akita.HookCtx)

Func prints the tlb trace information.

type TranslationReq

type TranslationReq struct {
	akita.MsgMeta
	VAddr uint64
	PID   ca.PID
	GPUID uint64
}

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

Build creats a new TranslationReq

func (TranslationReqBuilder) WithDst added in v1.3.0

WithDst sets the destination of the request to build.

func (TranslationReqBuilder) WithGPUID added in v1.3.0

WithGPUID sets the GPU ID of the request to build.

func (TranslationReqBuilder) WithPID added in v1.3.0

WithPID sets the virtual address of the request to build.

func (TranslationReqBuilder) WithSendTime added in v1.3.0

WithSendTime sets the send time of the request to build.:w

func (TranslationReqBuilder) WithSrc added in v1.3.0

WithSrc sets the source of the request to build.

func (TranslationReqBuilder) WithVAddr added in v1.3.0

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

Build creats a new TranslationRsp

func (TranslationRspBuilder) WithDst added in v1.3.0

WithDst sets the destination of the respond to build.

func (TranslationRspBuilder) WithPage added in v1.3.0

WithPage sets the page of the respond to build.

func (TranslationRspBuilder) WithRspTo added in v1.3.0

WithRspTo sets the request ID of the respond to build.

func (TranslationRspBuilder) WithSendTime added in v1.3.0

WithSendTime sets the send time of the message to build.

func (TranslationRspBuilder) WithSrc added in v1.3.0

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.
tlb
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL