OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_c/] [synfull/] [traffic-generator/] [src/] [netstream/] [messages.h] - Blame information for rev 54

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 54 alirezamon
/*
2
 * messages.h
3
 *
4
 *  Created on: Dec 13, 2009
5
 *      Author: sam
6
 */
7
 
8
#ifndef MESSAGES_H_
9
#define MESSAGES_H_
10
 
11
#include "socketstream.h"
12
#include <stdint.h>
13
 
14
#define INVALID_MESSAGE -1
15
#define INITIALIZE_REQ  0
16
#define INITIALIZE_RES  1
17
#define STEP_REQ                2
18
#define STEP_RES                3
19
#define INJECT_REQ      4
20
#define INJECT_RES      5
21
#define EJECT_REQ               6
22
#define EJECT_RES               7
23
#define QUIT_REQ                8
24
#define QUIT_RES                9
25
 
26
struct StreamMessage
27
{
28
    int size;
29
    int type;
30
    StreamMessage() :
31
        size(-1), type(INVALID_MESSAGE)
32
    {
33
    }
34
 
35
    /*
36
     * Message sending function.
37
     */
38
    friend SocketStream& operator<<(SocketStream& os, StreamMessage& msg);
39
 
40
    /*
41
     * Message receiving function. Use this function if you don't know the message type in advance
42
     * NOTE: must destroy msg using Message::destroy(Message*)
43
     */
44
    friend SocketStream& operator>>(SocketStream& is, StreamMessage*& msg);
45
 
46
    /*
47
     * Message receiving function. Use this function if you know the message type in advance
48
     */
49
    friend SocketStream& operator>>(SocketStream& is, StreamMessage& msg);
50
 
51
    static void destroy(StreamMessage* msg);
52
};
53
 
54
struct InitializeReqMsg: StreamMessage
55
{
56
    InitializeReqMsg()
57
    {
58
        size = sizeof(InitializeReqMsg);
59
        type = INITIALIZE_REQ;
60
    }
61
};
62
 
63
struct InitializeResMsg: StreamMessage
64
{
65
    InitializeResMsg()
66
    {
67
        size = sizeof(InitializeResMsg);
68
        type = INITIALIZE_RES;
69
    }
70
};
71
 
72
struct StepReqMsg: StreamMessage
73
{
74
        StepReqMsg()
75
    {
76
        size = sizeof(StepReqMsg);
77
        type = STEP_REQ;
78
    }
79
};
80
 
81
struct StepResMsg: StreamMessage
82
{
83
        StepResMsg()
84
    {
85
        size = sizeof(StepResMsg);
86
        type = STEP_RES;
87
    }
88
};
89
 
90
struct InjectReqMsg: StreamMessage
91
{
92
        InjectReqMsg()
93
    {
94
        size = sizeof(InjectReqMsg);
95
        type = INJECT_REQ;
96
    }
97
        int source;
98
        int dest;
99
        int id;
100
        int packetSize;
101
        int network;
102
        int cl;
103
        int miss_pred;
104
        int msgType;
105
        int coType;
106
        unsigned long long address;
107
};
108
 
109
struct InjectResMsg: StreamMessage
110
{
111
        InjectResMsg()
112
    {
113
        size = sizeof(InjectResMsg);
114
        type = INJECT_RES;
115
    }
116
};
117
 
118
struct EjectReqMsg: StreamMessage
119
{
120
        EjectReqMsg()
121
    {
122
        size = sizeof(EjectReqMsg);
123
        type = EJECT_REQ;
124
    }
125
};
126
 
127
struct EjectResMsg: StreamMessage
128
{
129
        EjectResMsg()
130
    {
131
        size = sizeof(EjectResMsg);
132
        type = EJECT_RES;
133
    }
134
        int id;
135
        int remainingRequests;
136
        int source;
137
        int dest;
138
        int packetSize;
139
        int network;
140
        int cl;
141
        int miss_pred;
142
 
143
};
144
 
145
struct QuitReqMsg: StreamMessage
146
{
147
        QuitReqMsg()
148
    {
149
        size = sizeof(QuitReqMsg);
150
        type = QUIT_REQ;
151
    }
152
};
153
 
154
struct QuitResMsg: StreamMessage
155
{
156
        QuitResMsg()
157
    {
158
        size = sizeof(QuitResMsg);
159
        type = QUIT_RES;
160
    }
161
};
162
 
163
#endif /* MESSAGES_H_ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.