vm

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 6 Imported by: 0

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

type PageMigrationInfo struct {
	GpuReqToVAddrMap map[uint64][]uint64
}

type PageMigrationReqToDriver

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

func NewPageMigrationReqToDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *PageMigrationReqToDriver

func (*PageMigrationReqToDriver) Meta

Meta returns the meta data associated with the message.

type PageMigrationRspFromDriver

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

func NewPageMigrationRspFromDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *PageMigrationRspFromDriver

func (*PageMigrationRspFromDriver) Meta

Meta returns the meta data associated with the message.

type PageTable

type PageTable interface {
	Insert(page Page)
	Remove(pid ca.PID, vAddr uint64)
	Find(pid ca.PID, Addr uint64) (Page, bool)
	Update(page Page)
}

A PageTable holds the a list of pages.

func NewPageTable

func NewPageTable(log2PageSize uint64) 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) *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

func (r *TranslationReq) Meta() *akita.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

Build creats a new TranslationReq

func (TranslationReqBuilder) WithDst

WithDst sets the destination of the request to build.

func (TranslationReqBuilder) WithGPUID

WithGPUID sets the GPU ID of the request to build.

func (TranslationReqBuilder) WithPID

WithPID sets the virtual address of the request to build.

func (TranslationReqBuilder) WithSendTime

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

func (TranslationReqBuilder) WithSrc

WithSrc sets the source of the request to build.

func (TranslationReqBuilder) WithVAddr

WithVAddr sets the virtual address of the request to build.

type TranslationRsp

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

func (r *TranslationRsp) Meta() *akita.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

Build creats a new TranslationRsp

func (TranslationRspBuilder) WithDst

WithDst sets the destination of the respond to build.

func (TranslationRspBuilder) WithPage

WithPage sets the page of the respond to build.

func (TranslationRspBuilder) WithRspTo

WithRspTo sets the request ID of the respond to build.

func (TranslationRspBuilder) WithSendTime

WithSendTime sets the send time of the message to build.

func (TranslationRspBuilder) WithSrc

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