Go to the documentation of this file.
30 #include "debug/Loader.hh"
31 #include "params/KernelWorkload.hh"
35 _loadAddrMask(
p.load_addr_mask), _loadAddrOffset(
p.load_addr_offset),
36 commandLine(
p.command_line)
38 if (
params().object_file ==
"") {
39 inform(
"No kernel set for full system simulation. "
40 "Assuming you know what you're doing.");
46 "Could not load kernel file %s",
params().object_file);
71 if (extras_addrs.empty())
72 extras_addrs.resize(
p.extras.size(),
MaxAddr);
73 fatal_if(
p.extras.size() != extras_addrs.size(),
74 "Additional kernel objects, not all load addresses specified\n");
75 for (
int ker_idx = 0; ker_idx <
p.extras.size(); ker_idx++) {
76 const std::string &obj_name =
p.extras[ker_idx];
77 const bool raw = extras_addrs[ker_idx] !=
MaxAddr;
79 fatal_if(!obj,
"Failed to build additional kernel object '%s'.\n",
92 auto mapper = [
this](
Addr a) {
95 if (
params().object_file !=
"") {
100 "Kernel is mapped to invalid location (not memory). "
101 "start (%#x) - end (%#x) %#x:%#x\n",
114 if (extras_addrs.empty())
116 for (
int idx = 0; idx <
extras.size(); idx++) {
117 const Addr load_addr = extras_addrs[idx];
140 KernelWorkloadParams::create()
MemoryImage & offset(Addr by)
Loader::MemoryImage image
bool write(const PortProxy &proxy) const
MemoryImage & move(std::function< Addr(Addr)> mapper)
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
ObjectFile * createObjectFile(const std::string &fname, bool raw)
void unserialize(CheckpointIn &cp) override
Unserialize an object.
virtual MemoryImage buildImage() const =0
void serialize(const std::string &base, CheckpointOut &cp) const
Loader::SymbolTable kernelSymtab
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
const SymbolTable & symtab() const
const Params & params() const
Addr _loadAddrOffset
Offset that should be used for binary/symbol loading.
Loader::ObjectFile * kernelObj
void unserialize(const std::string &base, CheckpointIn &cp, Symbol::Binding default_binding=Symbol::Binding::Global)
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
void serialize(CheckpointOut &cp) const override
Serialize an object.
KernelWorkloadParams Params
std::ostream CheckpointOut
bool insert(const Symbol &symbol)
std::vector< Loader::ObjectFile * > extras
KernelWorkload(const Params &p)
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
bool isMemAddr(Addr addr) const
Check if a physical address is within a range of a memory that is part of the global address map.
Addr _loadAddrMask
Mask that should be anded for binary/symbol loading.
Generated on Wed Sep 30 2020 14:02:14 for gem5 by doxygen 1.8.17