Documentation ¶
Overview ¶
Package memory holds an interface for main memory emulation, similar to akita.mem.Storage
TODO: TEMPORARY PACKAGE. The contained files should be moved to vemulator when a larger refactor is possible.
Index ¶
Constants ¶
const ( // RowBytes describes the byte length of a cache row. RowBytes uint64 = 16 // RowAlignMask is used to align an address to a row boundary. RowAlignMask uint64 = ^(RowBytes - 1) )
Variables ¶
This section is empty.
Functions ¶
func LoadPrograms ¶
LoadPrograms writes the LOAD prog headers to the provided storage.
Types ¶
type BasicMem ¶
type BasicMem struct {
// contains filtered or unexported fields
}
BasicMem is a memory unit that also contains an HTIF.
func NewBasicMem ¶
NewBasicMem returns a new instance of HTIFMem, containing a MemWrapper core and barrier used to trigger HTIF requests.
type Cache32 ¶
type Cache32 struct {
// contains filtered or unexported fields
}
Cache32 is a set-associative cache that can read in 32-bit chunks.
This implementation is not intended to be written to by the CPU core. The use of dynamic structures is restricted for performance.
func NewCache32 ¶
NewCache32 creates a new instance of Cache32
type Loader ¶
type Loader interface { Load(store Loadable) Entry() uint64 // TODO: This should not be part of this interface. The HTIF (and similar // functionality) should be broken out into a separate module. ToHostAddr() uint64 }
Loader loads a program into memory. Each implementation makes different assumptions regarding the layout of the elf in memory.
type Mem ¶
type Mem interface { Read(addr uint64, len uint64) ([]byte, error) Write(addr uint64, data []byte) error }
Mem is the most basic interface to a memory unit.
type SpikeLoad ¶
SpikeLoad loads a program into memory.
This implementation assumes that the elf was compiled to run on the Spike ISA simulator.
func NewSpikeLoad ¶
NewSpikeLoad initializes a new loader for the given elf path.
func (SpikeLoad) ToHostAddr ¶
ToHostAddr retrieves the tohost interface memory address.