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

Subversion Repositories ht_tunnel

[/] [ht_tunnel/] [trunk/] [bench/] [core/] [ht_datatypes.cpp] - Blame information for rev 2

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

Line No. Rev Author Line
1 2 acastong
//ht_datatypes.cpp
2
 
3
/* ***** BEGIN LICENSE BLOCK *****
4
 * Version: MPL 1.1
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version
7
 * 1.1 (the "License"); you may not use this file except in compliance with
8
 * the License. You may obtain a copy of the License at
9
 * http://www.mozilla.org/MPL/
10
 *
11
 * Software distributed under the License is distributed on an "AS IS" basis,
12
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
 * for the specific language governing rights and limitations under the
14
 * License.
15
 *
16
 * The Original Code is HyperTransport Tunnel IP Core.
17
 *
18
 * The Initial Developer of the Original Code is
19
 * Ecole Polytechnique de Montreal.
20
 * Portions created by the Initial Developer are Copyright (C) 2005
21
 * the Initial Developer. All Rights Reserved.
22
 *
23
 * Contributor(s):
24
 *   Ami Castonguay <acastong@grm.polymtl.ca>
25
 *
26
 * Alternatively, the contents of this file may be used under the terms
27
 * of the Polytechnique HyperTransport Tunnel IP Core Source Code License
28
 * (the  "PHTICSCL License", see the file PHTICSCL.txt), in which case the
29
 * provisions of PHTICSCL License are applicable instead of those
30
 * above. If you wish to allow use of your version of this file only
31
 * under the terms of the PHTICSCL License and not to allow others to use
32
 * your version of this file under the MPL, indicate your decision by
33
 * deleting the provisions above and replace them with the notice and
34
 * other provisions required by the PHTICSCL License. If you do not delete
35
 * the provisions above, a recipient may use your version of this file
36
 * under either the MPL or the PHTICSCL License."
37
 *
38
 * ***** END LICENSE BLOCK ***** */
39
 
40
#include "ht_datatypes.h"
41
#include "../../rtl/systemc/core_synth/synth_datatypes.h"
42
 
43
void sc_trace(sc_trace_file *tf, const ControlPacketComplete& v,
44
const sc_string& NAME) {
45
        sc_trace(tf,v.packet, NAME + ".packet");
46
        sc_trace(tf,v.data_address, NAME + ".data_address");
47
        sc_trace(tf,v.error64BitExtension, NAME + ".error64BitExtension");
48
        //sc_trace(tf,v.testingTrackingNumber, NAME + ".testingTrackingNumber");
49
}
50
 
51
ostream &operator<<(ostream& out, const ControlPacketComplete &pkt){
52
        out << "Packet: " << pkt.packet << "\n";
53
        out << "DataAddress: " << pkt.data_address << "\n";
54
        out << "Error64BitExtension: " << pkt.error64BitExtension << "\n";
55
        //out << "TestingTrackingNumber: " << pkt.testingTrackingNumber << "\n";
56
        return out;
57
}
58
 
59
 
60
bool ControlPacketComplete::operator== (const ControlPacketComplete &pkt) const{
61
        return  (this->packet == pkt.packet &&
62
                this->error64BitExtension == pkt.error64BitExtension &&
63
                this->data_address == pkt.data_address /*&&
64
                this->testingTrackingNumber == pkt.testingTrackingNumber*/);
65
}
66
 
67
ControlPacketComplete::ControlPacketComplete() :
68
        //testingTrackingNumber(0),
69
        packet(),
70
        error64BitExtension(false),
71
        data_address(){
72
}
73
 
74
 
75
ControlPacketComplete::ControlPacketComplete(const ControlPacketComplete &pktCmplt) :
76
        //testingTrackingNumber(pktCmplt.testingTrackingNumber),
77
        packet(pktCmplt.packet),
78
        error64BitExtension(pktCmplt.error64BitExtension),
79
        data_address(pktCmplt.data_address){
80
}
81
 
82
ControlPacketComplete& ControlPacketComplete::operator= (const ControlPacketComplete &pktCmplt){
83
        //testingTrackingNumber = pktCmplt.testingTrackingNumber;
84
        packet = pktCmplt.packet;
85
        error64BitExtension = pktCmplt.error64BitExtension;
86
        data_address = pktCmplt.data_address;
87
        return *this;
88
}
89
 
90
 
91
ControlPacketComplete::ControlPacketComplete(const syn_ControlPacketComplete &pktCmplt) :
92
                //testingTrackingNumber(0),
93
                error64BitExtension(pktCmplt.error64BitExtension),
94
                data_address(pktCmplt.data_address)
95
{
96
        packet = ControlPacket::createPacketFromQuadWord(pktCmplt.packet);
97
}
98
 
99
///Copy Constructor from synthesis packet
100
ControlPacketComplete& ControlPacketComplete::operator=(const syn_ControlPacketComplete &pktCmplt){
101
        //testingTrackingNumber = 0;
102
        error64BitExtension = pktCmplt.error64BitExtension;
103
        data_address = pktCmplt.data_address;
104
        packet = ControlPacket::createPacketFromQuadWord(pktCmplt.packet);
105
        return *this;
106
}
107
 
108
syn_ControlPacketComplete ControlPacketComplete::generateSynControlPacketComplete(){
109
        syn_ControlPacketComplete pkt;
110
        pkt.error64BitExtension = error64BitExtension;
111
        pkt.data_address = data_address;
112
        pkt.packet = packet->getVector();
113
        return pkt;
114
}
115
 
116
ControlPacketComplete::operator syn_ControlPacketComplete() const{
117
        syn_ControlPacketComplete pkt;
118
        pkt.packet = packet->getVector();
119
        pkt.error64BitExtension = error64BitExtension;
120
        pkt.data_address = data_address;
121
        pkt.isPartOfChain = isPartOfChain;
122
        return pkt;
123
}

powered by: WebSVN 2.1.0

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