38 lines
1.2 KiB
C
38 lines
1.2 KiB
C
|
#pragma once
|
||
|
|
||
|
#include "ratatoskrUtils/processingElement/ProcessingElementVC.h"
|
||
|
#include "utils/PacketFactoryCS.h"
|
||
|
#include "utils/GlobalResourcesCS.h"
|
||
|
|
||
|
class ProcessingElementCS : public ProcessingElementVC {
|
||
|
public:
|
||
|
std::map<dataTypeID_t, std::set<TaskCS>> neededFor;
|
||
|
std::map<std::pair<TaskCS, dataTypeID_t>, int> neededAmount;
|
||
|
std::map<TaskCS, std::set<dataTypeID_t>> needs;
|
||
|
std::map<dataTypeID_t, int> receivedData;
|
||
|
std::map<DataDestinationCS, TaskCS> destToTask;
|
||
|
std::map<TaskCS, std::set<DataDestinationCS>> taskToDest;
|
||
|
std::map<TaskCS, int> taskRepeatLeft;
|
||
|
std::map<TaskCS, int> taskStartTime;
|
||
|
std::map<TaskCS, int> taskTerminationTime;
|
||
|
std::map<DataDestinationCS, int> countLeft;
|
||
|
std::map<DataDestinationCS, int> destWait;
|
||
|
|
||
|
GlobalResourcesCS& globalResources = GlobalResourcesCS::getInstance();
|
||
|
|
||
|
PacketFactoryCS& packetFactoryCS = PacketFactoryCS::getInstance();
|
||
|
|
||
|
ProcessingElementCS(sc_module_name mn, Node& node, TrafficPool* tp):
|
||
|
ProcessingElementVC(mn, node, tp) {};
|
||
|
|
||
|
void thread() override;
|
||
|
|
||
|
void execute(TaskCS&);
|
||
|
|
||
|
void receive() override;
|
||
|
|
||
|
void startSending(TaskCS&);
|
||
|
|
||
|
void checkNeed();
|
||
|
};
|