52 if (
params().dtb_filename !=
"") {
53 inform(
"Loading DTB file: %s at address %#x\n",
params().dtb_filename,
58 if (!dtb_file->addBootCmdLine(
60 warn(
"couldn't append bootargs to DTB file: %s\n",
64 dtb_file->buildImage().offset(
params().dtb_addr)
72 warn(
"No DTB file specified\n");
93 const std::string dmesg_output =
name() +
".dmesg";
94 if (
params().exit_on_kernel_panic) {
96 "panic",
"Kernel panic in simulated system.",
97 dmesg_output,
params().on_panic
106 const std::string dmesg_output =
name() +
".dmesg";
107 if (
params().exit_on_kernel_oops) {
109 "oops_exit",
"Kernel oops in simulated system.",
110 dmesg_output,
params().on_oops
113 "Failed to find kernel symbol 'oops_exit'");
120 if (
params().bootloader_filename !=
"") {
121 Addr bootloader_paddr_offset =
params().bootloader_addr;
124 auto renamedBootloaderSymbolTable = \
126 bootloader_paddr_offset
127 )->functionSymbols()->rename(
128 [](
const std::string &
name) {
129 return "bootloader." +
name;
139 if (
params().object_file !=
"") {
142 auto renamedKernelSymbolTable = \
144 [](
const std::string &
name) {
145 return "kernel." +
name;
155 if (
params().bootloader_filename !=
"") {
156 Addr bootloader_addr_offset =
params().bootloader_addr;
162 inform(
"Loaded bootloader \'%s\' at 0x%llx\n",
163 params().bootloader_filename,
164 bootloader_addr_offset);
166 inform(
"Bootloader is not specified.\n");
173 if (
params().object_file !=
"") {
174 Addr kernel_paddr_offset =
params().kernel_addr;
180 inform(
"Loaded kernel \'%s\' at 0x%llx\n",
182 kernel_paddr_offset);
184 inform(
"Kernel is not specified.\n");
192 if (
params().dtb_filename !=
"") {
195 dtb_file->buildImage().offset(
params().dtb_addr)
199 inform(
"Loaded DTB \'%s\' at 0x%llx\n",
207 inform(
"DTB file is not specified.\n");
214 const std::string dmesg_output =
name() +
".dmesg";
215 if (
params().exit_on_kernel_panic) {
218 dmesg_output,
params().on_panic
226 const std::string dmesg_output =
name() +
".dmesg";
227 if (
params().exit_on_kernel_oops) {
230 dmesg_output,
params().on_oops
const std::string commandLine
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
virtual std::string name() const
PCEvent * kernelPanicPcEvent
Event to halt the simulator if the kernel calls panic() or oops_exit()
void addExitOnKernelPanicEvent()
void serialize(CheckpointOut &checkpoint) const override
Serialize an object.
loader::SymbolTable kernelSymbolTable
void unserialize(CheckpointIn &checkpoint) override
Unserialize an object.
PCEvent * kernelOopsPcEvent
void loadKernelSymbolTable()
void startup() override
startup() is the final initialization call before simulation.
loader::ObjectFile * kernel
void loadBootloaderSymbolTable()
loader::ObjectFile * bootloader
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
void addExitOnKernelOopsEvent()
loader::SymbolTable bootloaderSymbolTable
void startup() override
startup() is the final initialization call before simulation.
void initState() override
initState() is called on each SimObject when not restoring from a checkpoint.
PCEvent * kernelOopsPcEvent
void addExitOnKernelOopsEvent()
void addExitOnKernelPanicEvent()
PCEvent * kernelPanicPcEvent
Event to halt the simulator if the kernel calls panic() or oops_exit()
void invoke(ThreadContext *tc, const StaticInstPtr &inst=nullStaticInstPtr) override
PortProxy physProxy
Port to physical memory used for writing object files into ram at boot.
void startup() override
startup() is the final initialization call before simulation.
virtual MemoryImage buildImage() const =0
MemoryImage & offset(Addr by)
bool write(const PortProxy &proxy) const
const SymbolTable & symtab() const
SymbolTablePtr functionSymbols() const
Generates a new symbol table containing only function symbols.
void unserialize(const std::string &base, CheckpointIn &cp, Symbol::Binding default_binding=Symbol::Binding::Global)
Populate the table by unserializing a checkpoint.
SymbolTablePtr offset(Addr addr_offset) const
Generate a new table by applying an offset to the symbols of the current table.
void serialize(const std::string &base, CheckpointOut &cp) const
Serialize the table's contents.
bool insert(const Symbol &symbol)
Insert a new symbol in the table if it does not already exist.
This implements an image file format to support loading and modifying flattened device tree blobs for...
const Params & params() const
virtual void startup()
startup() is the final initialization call before simulation.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
SymbolTable debugSymbolTable
Global unified debugging symbol table (for target).
ObjectFile * createObjectFile(const std::string &fname, bool raw)
Copyright (c) 2024 Arm Limited All rights reserved.
std::ostream CheckpointOut
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.