Documentation
¶
Overview ¶
Package addressmapping defines how to maps an address to a localtion.
Index ¶
- type AddressConverter
- 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 InterleavingConverter
- type Location
- type LocationItem
- type Mapper
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) 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
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