33 #include "debug/HelloExample.hh" 42 DPRINTF(HelloExample,
"Created the goodbye object\n");
53 DPRINTF(HelloExample,
"Processing the event!\n");
62 DPRINTF(HelloExample,
"Saying goodbye to %s\n", other_name);
64 message =
"Goodbye " + other_name +
"!! ";
87 if (bufferUsed < bufferSize - 1) {
89 DPRINTF(HelloExample,
"Scheduling another fillBuffer in %d ticks\n",
93 DPRINTF(HelloExample,
"Goodbye done copying!\n");
100 GoodbyeObjectParams::create()
int bufferSize
The size of the buffer we are going to fill.
int bufferUsed
The amount of the buffer we've used so far.
Tick curTick()
The current simulated tick.
const Params * params() const
EventFunctionWrapper event
An event that wraps the above function.
void fillBuffer()
Fills the buffer for one iteration.
virtual const std::string name() const
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 (...
float bandwidth
The bytes processed per tick.
void sayGoodbye(std::string name)
Called by an outside object.
GoodbyeObject(GoodbyeObjectParams *p)
void schedule(Event &event, Tick when)
char * buffer
The buffer we are putting our message in.
void processEvent()
Fill the buffer with the next chunk of data.
std::string message
The message to put into the buffer.
Abstract superclass for simulation objects.