1 |
2 |
acastong |
//ReservedPacket.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 ReservedPacket_H
|
40 |
|
|
#define ReservedPacket_H
|
41 |
|
|
|
42 |
|
|
#ifndef SC_USER_DEFINED_MAX_NUMBER_OF_PROCESSES
|
43 |
|
|
#define SC_USER_DEFINED_MAX_NUMBER_OF_PROCESSES
|
44 |
|
|
#define SC_VC6_MAX_NUMBER_OF_PROCESSES 20
|
45 |
|
|
#endif
|
46 |
|
|
#include <systemc.h>
|
47 |
|
|
|
48 |
|
|
#include "ControlPacket.h"
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
///Reserved packet or invalid/unknown packet
|
52 |
|
|
/**
|
53 |
|
|
ReservedPacket is a packet which is not defined by the standard.
|
54 |
|
|
*/
|
55 |
|
|
class ReservedPacket: public ControlPacket{
|
56 |
|
|
|
57 |
|
|
public:
|
58 |
|
|
|
59 |
|
|
///Constructor with a 32 bit vector
|
60 |
|
|
/**
|
61 |
|
|
@param dWord The least significant 32 bits that represents packet
|
62 |
|
|
*/
|
63 |
|
|
ReservedPacket(const sc_bv<32> &dWord) : ControlPacket(dWord){}
|
64 |
|
|
|
65 |
|
|
///Constructor with a 64 bit vector
|
66 |
|
|
/**
|
67 |
|
|
@param qWord The 64 bits that represents packet
|
68 |
|
|
*/
|
69 |
|
|
ReservedPacket(const sc_bv<64> &qWord) : ControlPacket(qWord){}
|
70 |
|
|
|
71 |
|
|
///If the packet type is 32 bits
|
72 |
|
|
/**
|
73 |
|
|
Reserved packets are assumed to be 32 bits
|
74 |
|
|
|
75 |
|
|
@return true
|
76 |
|
|
*/
|
77 |
|
|
virtual bool isDwordPacket() const { return true;}
|
78 |
|
|
|
79 |
|
|
///If packet has data associated
|
80 |
|
|
/**
|
81 |
|
|
A reserved packet is assumed to not have any data
|
82 |
|
|
|
83 |
|
|
@return false
|
84 |
|
|
*/
|
85 |
|
|
virtual bool hasDataAssociated() const {return false;};
|
86 |
|
|
|
87 |
|
|
///Get the <code>VirtualChannel</code> of the packet
|
88 |
|
|
/**
|
89 |
|
|
To get the virtual channel of this packet
|
90 |
|
|
Packet can travel in different channels depending on their function
|
91 |
|
|
and of their attributes. Since ReservedPacket is not a valide packet,
|
92 |
|
|
VC_NONE is returned.
|
93 |
|
|
|
94 |
|
|
@return The VirtualChannel VC_NONE
|
95 |
|
|
*/
|
96 |
|
|
virtual VirtualChannel getVirtualChannel() const {return VC_NONE;}
|
97 |
|
|
|
98 |
|
|
///Get the type of this packet
|
99 |
|
|
/**
|
100 |
|
|
@return The RESERVED_TYPE PacketType
|
101 |
|
|
*/
|
102 |
|
|
virtual PacketType getPacketType() const {return RESERVED_TYPE;}
|
103 |
|
|
|
104 |
|
|
///To get the command of the packet
|
105 |
|
|
/**
|
106 |
|
|
@return RESERVED_CMD
|
107 |
|
|
*/
|
108 |
|
|
virtual PacketCommand getPacketCommand() const{return RESERVED_CMD;}
|
109 |
|
|
|
110 |
|
|
///If packet part of chain
|
111 |
|
|
/**
|
112 |
|
|
@return false
|
113 |
|
|
*/
|
114 |
|
|
virtual bool isChain() const { return false;}
|
115 |
|
|
|
116 |
|
|
///Get the length-1 of the data associated
|
117 |
|
|
/**
|
118 |
|
|
@return A 0 length.
|
119 |
|
|
*/
|
120 |
|
|
sc_uint<4> getDataLengthm1() const {return 0; }
|
121 |
|
|
|
122 |
|
|
virtual ControlPacket* getCopy() const {return new ReservedPacket(bv);};
|
123 |
|
|
|
124 |
|
|
virtual bool getPassPW() const {return false;}
|
125 |
|
|
|
126 |
|
|
};
|
127 |
|
|
|
128 |
|
|
#endif
|