-
Notifications
You must be signed in to change notification settings - Fork 0
/
electronicmessage.h
74 lines (49 loc) · 1.62 KB
/
electronicmessage.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
61
62
63
64
65
66
67
68
69
70
71
72
/*
* electronicmessage.h
* PhoenixSim
*
* Created by Johnnie Chan on 6/6/11.
* Copyright 2011 Johnnie Chan. All rights reserved.
*
*/
#ifndef __ELECTRONICMESSAGE_H__
#define __ELECTRONICMESSAGE_H__
#include <string>
#include <ostream>
#include "systemc.h"
#include "address.h"
namespace PhoenixSim
{
class ElectronicMessage;
void sc_trace (sc_trace_file *tf, const ElectronicMessage &v, const std::string &NAME);
void sc_trace (sc_trace_file *tf, const ElectronicMessage* v, const std::string &NAME);
std::ostream& operator <<(std::ostream& os, ElectronicMessage const &v);
class Payload
{
};
class ElectronicMessage
{
public:
ElectronicMessage();
int messageId; // value of -1 will be considered a NULL message
// enumeration of message ID begins at 0
int sequenceId;
bool messageComplete;
std::string messageType;
int messageSize; // size of message, in units of bits
Address sourceAddress;
Address destinationAddress;
int virtualChannelId;
sc_time beginTime;
sc_time endTime;
Payload* data;
bool operator ==(const ElectronicMessage & rhs) const;
bool operator !=(const ElectronicMessage & rhs) const;
virtual ElectronicMessage& operator =(const ElectronicMessage& rhs);
friend void sc_trace (sc_trace_file *tf, const ElectronicMessage &v, const std::string &NAME);
friend void sc_trace (sc_trace_file *tf, const ElectronicMessage *v, const std::string &NAME);
friend std::ostream& operator <<(std::ostream& os, ElectronicMessage const &v);
bool IsNullMessage() const;
};
}
#endif // __ELECTRONICMESSAGE_H__