28#ifndef __SIM_WORKLOAD_HH__
29#define __SIM_WORKLOAD_HH__
36#include "enums/ByteOrder.hh"
37#include "gdbremote/signals.hh"
38#include "params/StubWorkload.hh"
39#include "params/Workload.hh"
63 : statistics::
Group(parent,
"inst"),
65 "number of arm instructions executed"),
67 "number of quiesce instructions executed")
115 panic(
"syscall() not implemented.");
121 warn(
"Unhandled workload event.");
137 template <
class T,
typename... Args>
140 const std::string &desc, Args... args)
147 std::forward<Args>(args)...);
157 template <
class T,
typename... Args>
163 panic_if(!
e,
"Failed to find symbol '%s'", lbl);
Abstract superclass for simulation objects.
loader::SymbolTable _symtab
Addr getEntry() const override
const loader::SymbolTable & symtab(ThreadContext *tc) override
ByteOrder byteOrder() const override
loader::Arch getArch() const override
bool insertSymbol(const loader::Symbol &symbol) override
StubWorkload(const StubWorkloadParams ¶ms)
ThreadContext is the external interface to all thread state for anything outside of the CPU.
virtual void event(ThreadContext *tc)
virtual void replaceThreadContext(ThreadContext *tc)
virtual const loader::SymbolTable & symtab(ThreadContext *tc)=0
virtual loader::Arch getArch() const =0
void startup() override
startup() is the final initialization call before simulation.
T * addFuncEvent(const loader::SymbolTable &symtab, const char *lbl)
virtual Addr fixFuncEventAddr(Addr addr) const
virtual bool insertSymbol(const loader::Symbol &symbol)=0
T * addFuncEventOrPanic(const loader::SymbolTable &symtab, const char *lbl, Args... args)
virtual ByteOrder byteOrder() const =0
virtual void registerThreadContext(ThreadContext *tc)
virtual SimObject * getSemihosting() const
Returns the semihosting interface if supported by the current workload.
virtual Addr getEntry() const =0
virtual void syscall(ThreadContext *tc)
bool trapToGdb(GDBSignal sig, ContextID ctx_id)
T * addFuncEvent(const loader::SymbolTable &symtab, const char *lbl, const std::string &desc, Args... args)
Add a function-based event to the given function, to be looked up in the specified symbol table.
virtual void setSystem(System *sys)
gem5::Workload::WorkloadStats stats
std::set< ThreadContext * > threads
Workload(const WorkloadParams ¶ms)
bool sendToGdb(std::string msg)
const_iterator end() const
bool insert(const Symbol &symbol)
Insert a new symbol in the table if it does not already exist.
const_iterator find(Addr address) const
Search for a symbol by its address.
This is a simple scalar statistic, like a counter.
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
#define panic(...)
This implements a cprintf based panic() function.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
const Params & params() const
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.
int ContextID
Globally unique thread context ID.
statistics::Scalar quiesce
InstStats(statistics::Group *parent)
WorkloadStats(Workload *workload)
gem5::Workload::WorkloadStats::InstStats instStats