46#include "debug/DirectedTest.hh"
54 directedStartEvent([this]{
wakeup(); },
"Directed tick",
56 m_requests_to_complete(
p.requests_to_complete),
57 generator(
p.generator)
59 m_requests_completed = 0;
62 for (
int i = 0;
i <
p.port_cpuPort_connection_count; ++
i) {
68 schedule(directedStartEvent, 1);
73 for (
int i = 0;
i <
ports.size();
i++)
80 assert(
ports.size() > 0);
87 if (if_name !=
"cpuPort") {
91 if (idx >=
static_cast<int>(
ports.size())) {
92 panic(
"RubyDirectedTester::getPort: unknown index %d\n", idx);
114 assert(idx >= 0 && idx <
ports.size());
123 "completed request for proc: %d addr: 0x%x\n",
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
virtual bool initiate()=0
void setDirectedTester(RubyDirectedTester *directed_tester)
virtual void performCallback(uint32_t proc, Addr address)=0
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Ports are used to interface objects to each other.
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
RubyDirectedTester * tester
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
uint64_t m_requests_to_complete
RubyDirectedTester(const Params &p)
RequestPort * getCpuPort(int idx)
EventFunctionWrapper directedStartEvent
std::vector< RequestPort * > ports
uint64_t m_requests_completed
DirectedGenerator * generator
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
RubyDirectedTesterParams Params
void hitCallback(ruby::NodeID proc, Addr addr)
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
void schedule(Event &event, Tick when)
static const Priority CPU_Tick_Pri
CPU ticks must come after other associated CPU events (such as writebacks).
#define panic(...)
This implements a cprintf based panic() function.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
std::string csprintf(const char *format, const Args &...args)
const std::string & name()