29#ifndef __BASE_LOADER_MEMORY_IMAGE_HH__
30#define __BASE_LOADER_MEMORY_IMAGE_HH__
34#include <initializer_list>
58 const uint8_t *_data,
size_t _size) :
71 "Segment outside the bounds of the image data");
82 const uint8_t *
data =
nullptr;
118 for (
auto &
seg: segs)
139 max = std::max(max,
seg.base +
seg.size);
148 min = std::min(min,
seg.base);
165static inline std::ostream &
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
This object is a proxy for a port or other object which implements the functional response protocol,...
MemoryImage(const Segment &seg)
const std::vector< Segment > & segments() const
void addSegments(std::initializer_list< Segment > segs)
MemoryImage & offset(Addr by)
std::vector< Segment > _segments
void addSegment(const Segment &seg)
bool contains(Addr addr) const
MemoryImage & mask(Addr m)
bool write(const PortProxy &proxy) const
bool writeSegment(const Segment &seg, const PortProxy &proxy) const
MemoryImage(std::initializer_list< Segment > segs)
MemoryImage & move(std::function< Addr(Addr)> mapper)
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
static std::ostream & operator<<(std::ostream &os, const MemoryImage::Segment &seg)
std::shared_ptr< ImageFileData > ImageFileDataPtr
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void ccprintf(cp::Print &print)
Segment(const std::string &_name, Addr _base, size_t _size)
Segment(const std::string &_name, const ImageFileDataPtr &_ifd)
Segment(const std::string &_name, Addr _base, const ImageFileDataPtr &_ifd, Addr offset, size_t _size)
Segment(const std::string &_name, Addr _base, const uint8_t *_data, size_t _size)