OpenCores
URL https://opencores.org/ocsvn/ht_tunnel/ht_tunnel/trunk

Subversion Repositories ht_tunnel

[/] [ht_tunnel/] [tags/] [START/] [rtl/] [systemc/] [core_synth/] [synth_datatypes.h] - Blame information for rev 19

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 acastong
//synth_datatypes.h
2
/* ***** BEGIN LICENSE BLOCK *****
3
 * Version: MPL 1.1
4
 *
5
 * The contents of this file are subject to the Mozilla Public License Version
6
 * 1.1 (the "License"); you may not use this file except in compliance with
7
 * the License. You may obtain a copy of the License at
8
 * http://www.mozilla.org/MPL/
9
 *
10
 * Software distributed under the License is distributed on an "AS IS" basis,
11
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
 * for the specific language governing rights and limitations under the
13
 * License.
14
 *
15
 * The Original Code is HyperTransport Tunnel IP Core.
16
 *
17
 * The Initial Developer of the Original Code is
18
 * Ecole Polytechnique de Montreal.
19
 * Portions created by the Initial Developer are Copyright (C) 2005
20
 * the Initial Developer. All Rights Reserved.
21
 *
22
 * Contributor(s):
23
 *   Ami Castonguay <acastong@grm.polymtl.ca>
24
 *
25
 * Alternatively, the contents of this file may be used under the terms
26
 * of the Polytechnique HyperTransport Tunnel IP Core Source Code License
27
 * (the  "PHTICSCL License", see the file PHTICSCL.txt), in which case the
28
 * provisions of PHTICSCL License are applicable instead of those
29
 * above. If you wish to allow use of your version of this file only
30
 * under the terms of the PHTICSCL License and not to allow others to use
31
 * your version of this file under the MPL, indicate your decision by
32
 * deleting the provisions above and replace them with the notice and
33
 * other provisions required by the PHTICSCL License. If you do not delete
34
 * the provisions above, a recipient may use your version of this file
35
 * under either the MPL or the PHTICSCL License."
36
 *
37
 * ***** END LICENSE BLOCK ***** */
38
 
39
#ifndef SYNTH_DATATYPES_H
40
#define SYNTH_DATATYPES_H
41
 
42
///Types used in the synthesized design
43
/**
44
        @file synth_datatypes.h
45
        @author Ami Castonguay
46
        @description Datatypes that can be used for synthesis
47
*/
48
 
49
 
50
#ifndef SC_USER_DEFINED_MAX_NUMBER_OF_PROCESSES
51
#define SC_USER_DEFINED_MAX_NUMBER_OF_PROCESSES
52
#define SC_VC6_MAX_NUMBER_OF_PROCESSES 20
53
#endif
54
 
55
#include <systemc.h>
56
 
57
#include "ht_type_include.h"
58
#include "constants.h"
59
#include "synth_control_packet.h"
60
 
61
///Group of often used signal that includes a packet
62
/**
63
        Includes the packet, the VC, the adresse of the data buffer,.
64
        and if there is a data packet associated with the control packet
65
*/
66
struct syn_ControlPacketComplete {
67
 
68
public:
69
 
70
        ///The actual control packet
71
        sc_bv<64> packet;
72
 
73
        ///If the packet was received with a 64 bit address extension
74
        bool error64BitExtension;
75
 
76
        /// = 1 if the packet belongs to a chain. 
77
        /**This variable is different from the
78
         chain bit in the control packets because it is = 1 if the packet is the
79
         last in the chain, while the chain bit = 0 in that case
80
        */
81
        bool isPartOfChain;
82
 
83
        ///The adress of the data packet associated, if any
84
        sc_uint<BUFFERS_ADDRESS_WIDTH> data_address;
85
 
86
 
87
#ifdef SYSTEMC_SIM
88
 
89
        ///Constructor for the struct
90
        syn_ControlPacketComplete();
91
 
92
        ///Check if two structs have identical content
93
        bool operator== (const syn_ControlPacketComplete &) const;
94
 
95
        ///Check if two structs have different content
96
        inline bool operator!= (const syn_ControlPacketComplete &test) const {return !(*this == test);}
97
 
98
#endif
99
};
100
 
101
///Group of often used signal that includes a response packet
102
/**
103
        Includes the packet, the VC, the adresse of the data buffer,.
104
        and if there is a data packet associated with the control packet
105
*/
106
struct syn_ResponseControlPacketComplete {
107
 
108
public:
109
 
110
        ///The actual control packet
111
        sc_bv<32> packet;
112
 
113
        ///The adress of the data packet associated, if any
114
        sc_uint<BUFFERS_ADDRESS_WIDTH> data_address;
115
 
116
 
117
#ifdef SYSTEMC_SIM
118
 
119
        ///Constructor for the struct
120
        syn_ResponseControlPacketComplete();
121
 
122
        ///Check if two structs have identical content
123
        bool operator== (const syn_ResponseControlPacketComplete &) const;
124
 
125
        ///Check if two structs have different content
126
        inline bool operator!= (const syn_ResponseControlPacketComplete &test) const {return !(*this == test);}
127
 
128
#endif
129
};
130
 
131
#ifdef SYSTEMC_SIM
132
 
133
///To initialize (reset content to zeros and falses) the syn_ControlPacketComplete struct
134
void initialize_syn_ControlPacketComplete(syn_ControlPacketComplete &pkt);
135
///To initialize (reset content to zeros and falses) the syn_ResponseControlPacketComplete struct
136
void initialize_syn_ResponseControlPacketComplete(syn_ResponseControlPacketComplete &pkt);
137
 
138
#else
139
 
140
///To initialize (reset content to zeros and falses) the struct
141
void initialize_syn_ControlPacketComplete(syn_ControlPacketComplete &pkt){
142
        pkt.packet = sc_bv<64>(0);
143
        pkt.error64BitExtension = sc_bit(false);
144
        pkt.isPartOfChain = sc_bit(false);
145
        pkt.data_address = sc_uint<BUFFERS_ADDRESS_WIDTH>(0);
146
}
147
 
148
///To initialize (reset content to zeros and falses) the struct
149
void initialize_syn_ResponseControlPacketComplete(syn_ResponseControlPacketComplete &pkt){
150
        pkt.packet = sc_bv<32>(0);
151
        pkt.data_address = sc_uint<BUFFERS_ADDRESS_WIDTH>(0);
152
}
153
#endif
154
 
155
/**
156
        Also, for synthesis, include actual functions
157
*/
158
#ifdef SYSTEMC_SIM
159
///To trace syn_ControlPacketComplete signals
160
void sc_trace(sc_trace_file *tf, const syn_ControlPacketComplete& v,
161
const sc_string& NAME);
162
///To trace syn_ResponseControlPacketComplete signals
163
void sc_trace(sc_trace_file *tf, const syn_ResponseControlPacketComplete& v,
164
const sc_string& NAME);
165
 
166
///To output to a stream structures
167
//@{
168
ostream &operator<<(ostream& out, const syn_ControlPacketComplete &pkt);
169
ostream &operator<<(ostream& out, const syn_ResponseControlPacketComplete &pkt);
170
ostream &operator<<(ostream &out,const PacketCommand &cmd);
171
ostream &operator<<(ostream &out,const PacketType &type);
172
ostream &operator<<(ostream &out,const VirtualChannel &vc);
173
ostream &operator<<(ostream &out,const ResponseError &re);
174
//@}
175
#endif
176
 
177
#endif

powered by: WebSVN 2.1.0

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