tlb

package
v4.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 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) *Comp

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.RemotePort) 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 Comp

type Comp struct {
	*sim.TickingComponent
	sim.MiddlewareHolder

	LowModule sim.RemotePort

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

Comp is a cache(TLB) that maintains some page information.

func (*Comp) Tick

func (c *Comp) Tick() bool

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

func (r *FlushReq) Clone() sim.Msg

Clone returns cloned FlushReq with different ID

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

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

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

func (r *FlushRsp) Clone() sim.Msg

Clone returns cloned FlushRsp with different ID

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

WithDst sets the destination of the request to build.

func (FlushRspBuilder) WithSrc

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

func (r *RestartReq) Clone() sim.Msg

Clone returns cloned RestartReq with different ID

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

func (r *RestartRsp) Clone() sim.Msg

Clone returns cloned RestartRsp with different ID

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

WithSrc sets the source of the request to build.

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