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

Subversion Repositories ht_tunnel

[/] [ht_tunnel/] [tags/] [START/] [bench/] [core/] [ht_datatypes.h] - Blame information for rev 3

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 acastong
//ht_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
///Includes all types necessary for control packets
40
/**
41
        @file ht_datatypes.h
42
        @author Ami Castonguay
43
*/
44
 
45
 
46
#ifndef HT_DATATYPES_H
47
#define HT_DATATYPES_H
48
 
49
#ifndef SC_USER_DEFINED_MAX_NUMBER_OF_PROCESSES
50
#define SC_USER_DEFINED_MAX_NUMBER_OF_PROCESSES
51
#define SC_VC6_MAX_NUMBER_OF_PROCESSES 20
52
#endif
53
#include <systemc.h>
54
 
55
#include "../../rtl/systemc/core_synth/constants.h"
56
 
57
/**
58
        The number of spaces for DirectRoute adress are reserved in the CSR
59
*/
60
//#define DIRECTROUTE_SPACES 2
61
 
62
 
63
 
64
 
65
 
66
#include "ControlPacket.h"
67
#include "PacketContainer.h"
68
 
69
//Also include all other packet type for
70
//convenience
71
#include "RequestPacket.h"
72
#include "ResponsePacket.h"
73
#include "InfoPacket.h"
74
#include "ReservedPacket.h"
75
 
76
struct syn_ControlPacketComplete;
77
 
78
///Group of often used signal that includes a packet
79
/**
80
        Includes the packet, the VC, the adresse of the data buffer,.
81
        and if there is a data packet associated with the control packet
82
*/
83
class ControlPacketComplete {
84
 
85
public:
86
 
87
        ///The actual control packet
88
        PacketContainer packet;
89
 
90
        ///If the packet was received with a 64 bit address extension
91
        bool error64BitExtension;
92
 
93
        /// = 1 if the packet belongs to a chain. 
94
        /**This variable is different from the
95
         chain bit in the control packets because it is = 1 if the packet is the
96
         last in the chain, while the chain bit = 0 in that case
97
        */
98
        bool isPartOfChain;
99
 
100
        ///The adress of the data packet associated, if any
101
        sc_uint<BUFFERS_ADDRESS_WIDTH> data_address;
102
 
103
        ///Default Constructor
104
        ControlPacketComplete();
105
 
106
        ///Copy Constructor
107
        ControlPacketComplete(const ControlPacketComplete &pktCmplt);
108
 
109
        ///Copy Constructor from synthesis packet
110
        ControlPacketComplete(const syn_ControlPacketComplete &pktCmplt);
111
 
112
        syn_ControlPacketComplete generateSynControlPacketComplete();
113
 
114
        ControlPacketComplete& operator= (const ControlPacketComplete &pktCmplt);
115
 
116
        ControlPacketComplete& operator= (const syn_ControlPacketComplete &pktCmplt);
117
 
118
        ///Default Constructor
119
        ~ControlPacketComplete(){}
120
 
121
        ///Check if two structs have identical content
122
        bool operator== (const ControlPacketComplete &) const;
123
 
124
        operator syn_ControlPacketComplete() const;
125
 
126
        ///Check if two structs have different content
127
        inline bool operator!= (const ControlPacketComplete &test) const {return !(*this == test);}
128
 
129
        ///To output the content of the struct
130
        friend ostream &operator<<(ostream&, const ControlPacketComplete &);
131
};
132
 
133
/**
134
        To allow the ht_ctl_pcktcomplete to be traced and be
135
        used as an sc_signal
136
*/
137
extern
138
void sc_trace(sc_trace_file *tf, const ControlPacketComplete& v,
139
const sc_string& NAME);
140
 
141
#endif

powered by: WebSVN 2.1.0

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