addressmapping

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package addressmapping defines how to maps an address to a localtion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressConverter

type AddressConverter interface {
	ConvertExternalToInternal(external uint64) uint64
	ConvertInternalToExternal(internal uint64) uint64
}

AddressConverter can translate the address between two domains

type Builder

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

Builder can build default address mappers.

func MakeBuilder

func MakeBuilder() Builder

func (Builder) Build

func (b Builder) Build() Mapper

Build builds a default memory mapper.

func (Builder) WithBurstLength

func (b Builder) WithBurstLength(n int) Builder

WithBurstLength sets the number of access (each access manipulates the amount of data that equals the bus width) that takes place as one group.

func (Builder) WithBusWidth

func (b Builder) WithBusWidth(n int) Builder

WithBusWidth sets the number of bits can be transferred out of the banks at the same time.

func (Builder) WithNumBank

func (b Builder) WithNumBank(n int) Builder

WithNumBank sets the number of banks in each bank group.

func (Builder) WithNumBankGroup

func (b Builder) WithNumBankGroup(n int) Builder

WithNumBankGroup sets the number of bank groups in each rank.

func (Builder) WithNumChannel

func (b Builder) WithNumChannel(n int) Builder

WithNumChannel sets the channels that the memory controller controls.

func (Builder) WithNumCol

func (b Builder) WithNumCol(n int) Builder

WithNumCol sets the number of columns in each DRAM array.

func (Builder) WithNumRank

func (b Builder) WithNumRank(n int) Builder

WithNumRank sets the number of ranks in each channel.

func (Builder) WithNumRow

func (b Builder) WithNumRow(n int) Builder

WithNumRow sets the number of rows in each DRAM array.

type DefaultMapper

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

DefaultMapper implements the default address mapping scheme.

func (DefaultMapper) Map

func (m DefaultMapper) Map(addr uint64) Location

type InterleavingConverter

type InterleavingConverter struct {
	InterleavingSize    uint64
	TotalNumOfElements  int
	CurrentElementIndex int
	Offset              uint64
}

InterleavingConverter is an address converter that can converts the address from an continuous address space to interleaved addresses.

For example, DRAM is divided into multiple banks, the internal address of each bank starts from 0, while the global address is continuous. In this case, we can use the InterleavingConverter to convert the external addresses from/ to internal addresses.

func (InterleavingConverter) ConvertExternalToInternal

func (c InterleavingConverter) ConvertExternalToInternal(external uint64) uint64

ConvertExternalToInternal converts from external address to internal address

func (InterleavingConverter) ConvertInternalToExternal

func (c InterleavingConverter) ConvertInternalToExternal(internal uint64) uint64

ConvertInternalToExternal converts from internal address to external address

type Location

type Location struct {
	Channel   uint64
	Rank      uint64
	BankGroup uint64
	Bank      uint64
	Row       uint64
	Column    uint64
}

A Location determines where to find the data to access.

type LocationItem

type LocationItem int

An LocationItem is a field of the location.

const (
	LocationItemInvalid LocationItem = iota
	LocationItemChannel
	LocationItemRank
	LocationItemBankGroup
	LocationItemBank
	LocationItemRow
	LocationItemColumn
)

A list of all location items

type Mapper

type Mapper interface {
	Map(addr uint64) Location
}

Mapper can map from an address to a location.

Jump to

Keyboard shortcuts

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