Documentation ¶
Overview ¶
Package addressmapping defines how to maps an address to a localtion.
Index ¶
- type Builder
- func (b Builder) Build() Mapper
- func (b Builder) WithBurstLength(n int) Builder
- func (b Builder) WithBusWidth(n int) Builder
- func (b Builder) WithNumBank(n int) Builder
- func (b Builder) WithNumBankGroup(n int) Builder
- func (b Builder) WithNumChannel(n int) Builder
- func (b Builder) WithNumCol(n int) Builder
- func (b Builder) WithNumRank(n int) Builder
- func (b Builder) WithNumRow(n int) Builder
- type DefaultMapper
- type Location
- type LocationItem
- type Mapper
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) WithBurstLength ¶
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 ¶
WithBusWidth sets the number of bits can be transferred out of the banks at the same time.
func (Builder) WithNumBank ¶
WithNumBank sets the number of banks in each bank group.
func (Builder) WithNumBankGroup ¶
WithNumBankGroup sets the number of bank groups in each rank.
func (Builder) WithNumChannel ¶
WithNumChannel sets the channels that the memory controller controls.
func (Builder) WithNumCol ¶
WithNumCol sets the number of columns in each DRAM array.
func (Builder) WithNumRank ¶
WithNumRank sets the number of ranks in each channel.
func (Builder) WithNumRow ¶
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