The Sparta Modeling Framework
Loading...
Searching...
No Matches
sparta::memory::SimpleMemoryMap::Mapping Struct Reference

Represents a mapping between an input address and output address for use in a destination BlockingMemoryIF. More...

#include <SimpleMemoryMap.hpp>

Collaboration diagram for sparta::memory::SimpleMemoryMap::Mapping:

Public Member Functions

 Mapping (addr_t _start, addr_t _end, BlockingMemoryIF *_memif, addr_t _dest_off)
 construct a mapping using the same values received from SimpleMemoryMap::addMapping
 
addr_t mapAddress (addr_t input) const noexcept
 Maps an input address to the address-space for the destination memory interface.
 
bool contains (addr_t a) const noexcept
 Returns true if a is in the range [start,end)
 
bool overlaps (addr_t a, addr_t b) const noexcept
 Returns true if any part of the range [a,b) is shared with range [start,end)
 

Public Attributes

const addr_t start
 Beginning of the mapping input range (inclusive)
 
const addr_t end
 End of the mapping input address range (exclusive)
 
const addr_t dest_off
 Offset into destination memory interface. This is an offset from 0 which is received when the input address equals start.
 
BlockingMemoryIF *const memif
 Memory interface mapped to (after add/sub are applied to address)
 

Detailed Description

Represents a mapping between an input address and output address for use in a destination BlockingMemoryIF.

Definition at line 61 of file SimpleMemoryMap.hpp.

Constructor & Destructor Documentation

◆ Mapping()

sparta::memory::SimpleMemoryMap::Mapping::Mapping ( addr_t  _start,
addr_t  _end,
BlockingMemoryIF _memif,
addr_t  _dest_off 
)
inline

construct a mapping using the same values received from SimpleMemoryMap::addMapping

Definition at line 67 of file SimpleMemoryMap.hpp.

Member Function Documentation

◆ contains()

bool sparta::memory::SimpleMemoryMap::Mapping::contains ( addr_t  a) const
inlinenoexcept

Returns true if a is in the range [start,end)

Parameters
aAddress to test in the range

Definition at line 122 of file SimpleMemoryMap.hpp.

◆ mapAddress()

addr_t sparta::memory::SimpleMemoryMap::Mapping::mapAddress ( addr_t  input) const
inlinenoexcept

Maps an input address to the address-space for the destination memory interface.

Definition at line 114 of file SimpleMemoryMap.hpp.

◆ overlaps()

bool sparta::memory::SimpleMemoryMap::Mapping::overlaps ( addr_t  a,
addr_t  b 
) const
inlinenoexcept

Returns true if any part of the range [a,b) is shared with range [start,end)

Parameters
aStart (inclusive) of test range
eEnd (exclusive) of test range

Definition at line 132 of file SimpleMemoryMap.hpp.

Member Data Documentation

◆ dest_off

const addr_t sparta::memory::SimpleMemoryMap::Mapping::dest_off

Offset into destination memory interface. This is an offset from 0 which is received when the input address equals start.

Value to add to incoming address to remap. This exists in addition to subtract so that mappings equal to + or - the entire address space can be done.

Definition at line 102 of file SimpleMemoryMap.hpp.

◆ end

const addr_t sparta::memory::SimpleMemoryMap::Mapping::end

End of the mapping input address range (exclusive)

Definition at line 91 of file SimpleMemoryMap.hpp.

◆ memif

BlockingMemoryIF* const sparta::memory::SimpleMemoryMap::Mapping::memif

Memory interface mapped to (after add/sub are applied to address)

Definition at line 108 of file SimpleMemoryMap.hpp.

◆ start

const addr_t sparta::memory::SimpleMemoryMap::Mapping::start

Beginning of the mapping input range (inclusive)

Value to subtract from incoming address to remap. This will always be <= the incoming address because it is the start of the mapping in the input address space.

Add this number to memif first because result will always be >= 0

Definition at line 86 of file SimpleMemoryMap.hpp.


The documentation for this struct was generated from the following file: