addressmapping

package
v4.0.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 0 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 Builder

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

Builder can build default address mappers.

func MakeBuilder

func MakeBuilder() Builder

MakeBuilder creates a new builder with default configurations.

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

Map returns the location (i.e., channel, rank, bank-group, bank, row, col) that can find the given 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