tlb

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 6 Imported by: 2

Documentation

Overview

Package tlb provides a TLB component implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

A Builder can build TLBs

func MakeBuilder

func MakeBuilder() Builder

MakeBuilder returns a Builder

func (Builder) Build

func (b Builder) Build(name string) *TLB

Build creates a new TLB

func (Builder) WithEngine

func (b Builder) WithEngine(engine sim.Engine) Builder

WithEngine sets the engine that the TLBs to use

func (Builder) WithFreq

func (b Builder) WithFreq(freq sim.Freq) Builder

WithFreq sets the freq the TLBs use

func (Builder) WithLowModule

func (b Builder) WithLowModule(lowModule sim.Port) Builder

WithLowModule sets the port that can provide the address translation in case of tlb miss.

func (Builder) WithNumMSHREntry

func (b Builder) WithNumMSHREntry(num int) Builder

WithNumMSHREntry sets the number of mshr entry

func (Builder) WithNumReqPerCycle

func (b Builder) WithNumReqPerCycle(n int) Builder

WithNumReqPerCycle sets the number of requests per cycle can be processed by a TLB

func (Builder) WithNumSets

func (b Builder) WithNumSets(n int) Builder

WithNumSets sets the number of sets in a TLB. Use 1 for fully associated TLBs.

func (Builder) WithNumWays

func (b Builder) WithNumWays(n int) Builder

WithNumWays sets the number of ways in a TLB. Set this field to the number of TLB entries for all the functions.

func (Builder) WithPageSize

func (b Builder) WithPageSize(n uint64) Builder

WithPageSize sets the page size that the TLB works with.

type FlushReq

type FlushReq struct {
	sim.MsgMeta
	VAddr []uint64
	PID   vm.PID
}

A FlushReq asks the TLB to invalidate certain entries. It will also not block all incoming and outgoing ports

func (*FlushReq) Meta

func (r *FlushReq) Meta() *sim.MsgMeta

Meta returns the meta data associated with the message.

type FlushReqBuilder

type FlushReqBuilder struct {
	// contains filtered or unexported fields
}

FlushReqBuilder can build AT flush requests

func (FlushReqBuilder) Build

func (b FlushReqBuilder) Build() *FlushReq

Build creates a new TLBFlushReq

func (FlushReqBuilder) WithDst

func (b FlushReqBuilder) WithDst(dst sim.Port) FlushReqBuilder

WithDst sets the destination of the request to build.

func (FlushReqBuilder) WithPID

func (b FlushReqBuilder) WithPID(pid vm.PID) FlushReqBuilder

WithPID sets the pid whose entries are to be flushed

func (FlushReqBuilder) WithSendTime

func (b FlushReqBuilder) WithSendTime(
	t sim.VTimeInSec,
) FlushReqBuilder

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

func (FlushReqBuilder) WithSrc

func (b FlushReqBuilder) WithSrc(src sim.Port) FlushReqBuilder

WithSrc sets the source of the request to build.

func (FlushReqBuilder) WithVAddrs

func (b FlushReqBuilder) WithVAddrs(vAddrs []uint64) FlushReqBuilder

WithVAddrs sets the Vaddr of the pages to be flushed

type FlushRsp

type FlushRsp struct {
	sim.MsgMeta
}

A FlushRsp is a response from AT indicating flush is complete

func (*FlushRsp) Meta

func (r *FlushRsp) Meta() *sim.MsgMeta

Meta returns the meta data associated with the message.

type FlushRspBuilder

type FlushRspBuilder struct {
	// contains filtered or unexported fields
}

FlushRspBuilder can build AT flush rsp

func (FlushRspBuilder) Build

func (b FlushRspBuilder) Build() *FlushRsp

Build creates a new TLBFlushRsps.

func (FlushRspBuilder) WithDst

func (b FlushRspBuilder) WithDst(dst sim.Port) FlushRspBuilder

WithDst sets the destination of the request to build.

func (FlushRspBuilder) WithSendTime

func (b FlushRspBuilder) WithSendTime(
	t sim.VTimeInSec,
) FlushRspBuilder

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

func (FlushRspBuilder) WithSrc

func (b FlushRspBuilder) WithSrc(src sim.Port) FlushRspBuilder

WithSrc sets the source of the request to build.

type RestartReq

type RestartReq struct {
	sim.MsgMeta
}

A RestartReq is a request to TLB to start accepting requests and resume operations

func (*RestartReq) Meta

func (r *RestartReq) Meta() *sim.MsgMeta

Meta returns the meta data associated with the message.

type RestartReqBuilder

type RestartReqBuilder struct {
	// contains filtered or unexported fields
}

RestartReqBuilder can build TLB restart requests.

func (RestartReqBuilder) Build

func (b RestartReqBuilder) Build() *RestartReq

Build creates a new TLBRestartReq.

func (RestartReqBuilder) WithDst

WithDst sets the destination of the request to build.

func (RestartReqBuilder) WithSendTime

func (b RestartReqBuilder) WithSendTime(
	t sim.VTimeInSec,
) RestartReqBuilder

WithSendTime sets the send time of the request to build.

func (RestartReqBuilder) WithSrc

WithSrc sets the source of the request to build.

type RestartRsp

type RestartRsp struct {
	sim.MsgMeta
}

A RestartRsp is a response from AT indicating it has resumed working

func (*RestartRsp) Meta

func (r *RestartRsp) Meta() *sim.MsgMeta

Meta returns the meta data associated with the message.

type RestartRspBuilder

type RestartRspBuilder struct {
	// contains filtered or unexported fields
}

RestartRspBuilder can build AT flush rsp

func (RestartRspBuilder) Build

func (b RestartRspBuilder) Build() *RestartRsp

Build creates a new TLBRestartRsp

func (RestartRspBuilder) WithDst

WithDst sets the destination of the request to build.

func (RestartRspBuilder) WithSendTime

func (b RestartRspBuilder) WithSendTime(
	t sim.VTimeInSec,
) RestartRspBuilder

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

func (RestartRspBuilder) WithSrc

WithSrc sets the source of the request to build.

type TLB

type TLB struct {
	*sim.TickingComponent

	LowModule sim.Port

	Sets []internal.Set
	// contains filtered or unexported fields
}

A TLB is a cache that maintains some page information.

func (*TLB) Tick

func (tlb *TLB) Tick(now sim.VTimeInSec) bool

Tick defines how TLB update states at each cycle

Directories

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