-
Notifications
You must be signed in to change notification settings - Fork 0
/
routerbuffer.h
57 lines (42 loc) · 1.04 KB
/
routerbuffer.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
/*
* routerbuffer.h
* PhoenixSim
*
* Created by Johnnie Chan on 6/9/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
*/
#ifndef __ROUTERBUFFER_H__
#define __ROUTERBUFFER_H__
#include <list>
#include "systemc.h"
#include "electronicmessage.h"
#include "orion/ORION_Array.h"
#include "OrionPowerParams.h"
namespace PhoenixSim
{
SC_MODULE(RouterBuffer)
{
sc_in<bool>* pop;
sc_out<bool>* ready;
sc_in<ElectronicMessage*>* inputPort;
sc_out<ElectronicMessage*>* outputPort;
SC_HAS_PROCESS(RouterBuffer);
RouterBuffer(sc_module_name name, sc_time p_clockPeriod, int p_bufferDepth, int p_bufferWidth, const COrionPowerParams& powerParams);
~RouterBuffer();
double GetCumulativePower(){return energy_;};
private:
std::list<ElectronicMessage*> queuedItems;
sc_time clockPeriod;
int bufferDepth;
int bufferWidth;
int creditsRemaining;
sc_event dataReady;
void PushOntoQueue();
void ModifyOutput();
void PopOffQueue();
ORION_Array* power_;
double energy_;
};
}
#endif // __ROUTERBUFFER_H__