-
Notifications
You must be signed in to change notification settings - Fork 0
/
processor.h
61 lines (43 loc) · 1.13 KB
/
processor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* processor.h
* PhoenixSim
*
* Created by Johnnie Chan on 7/11/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
*/
#ifndef __PROCESSOR_H__
#define __PROCESSOR_H__
#include <queue>
#include <string>
#include "systemc.h"
#include "electronicmessage.h"
#include "trafficgenerator.h"
#include "average_statisticsmachine.h"
#include "single_statisticsmachine.h"
namespace PhoenixSim
{
class Processor : public sc_module
{
public:
SC_HAS_PROCESS(Processor);
Processor(sc_module_name name, std::string p_generator, TrafficGeneratorParameters* p_parameters);
~Processor();
sc_in<ElectronicMessage*>* inputPort;
sc_out<ElectronicMessage*>* outputPort;
protected:
private:
static Average_StatisticsMachine networkLatency;
static Single_StatisticsMachine lastMessageTime;
static bool once;
static unsigned int currentMessageCount;
TrafficGenerator* trafficGenerator;
sc_event_queue sendMessageEvent;
void Initialize();
void MessageReceived();
void MessageTransmitted();
void SendMessage();
std::queue<ElectronicMessage*> messageQueue;
};
}
#endif // __PROCESSOR_H__