4#include "MessageCategories.hpp"
10 const ConsumerParameterSet * p) :
12 num_producers_(p->num_producers),
13 consumer_log_(node, message_categories::INFO,
"Consumer Info Messages")
19 for(uint32_t i = 0; i < num_producers_; ++i) {
20 std::stringstream str;
21 str <<
"producer" << i <<
"_go_port";
34void Consumer::signalNextProducer_()
37 producer_go_port_[current_producer_]->send();
39 if(current_producer_ == num_producers_) {
40 current_producer_ = 0;
44void Consumer::receiveData_(
const uint32_t & dat)
47 "Somehow, data wasn't cleared in this consumer: " <<
getName());
54 signalNextProducer_();
57void Consumer::dataArrived_()
#define sparta_assert(...)
Simple variadic assertion that will throw a sparta_exception if the condition fails.
#define SPARTA_EXPECT_FALSE(x)
A macro for hinting to the compiler a particular condition should be considered most likely false.
#define CREATE_SPARTA_HANDLER_WITH_DATA(clname, meth, dataT)
#define CREATE_SPARTA_HANDLER(clname, meth)
File that defines the StartupEvent class.
static const char * name
Name of this resource. Required by sparta::ResourceFactory.
Cycle currentCycle() const
Get the current cycle (uses current tick from the Scheduler)
const Clock * getClock() const
std::string getName() const
SignalOutPort is used for transferring a simple signal to another module.
StartupEvent is a simple class for scheduling a starting event on the Scheduler. It does not support ...
Node in a composite tree representing a sparta Tree item.
void schedule()
Schedule this event with its pre-set delay using the pre-set Clock.
void clearValid()
Clear the validity of this object.
bool isValid() const
Is this value valid.
Macros for handling exponential backoff.