OpenASIP  2.0
IPXactInterface.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2011 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file IPXactInterface.cc
26  *
27  * Implementation of IPXactInterface class.
28  *
29  * @author Otto Esko 2011 (otto.esko-no.spam-tut.fi)
30  * @note rating: red
31  */
32 #include "IPXactInterface.hh"
34 using std::pair;
35 
37  instanceName_(""), busMode_(IPXactModel::INVALID), busType_("","","",""),
38  busAbstractionType_("","","",""), interfaceMap_() {
39 }
40 
42 
43  for (unsigned int i = 0; i < interfaceMap_.size(); i++) {
44  delete interfaceMap_.at(i);
45  }
46 }
47 
50  return instanceName_;
51 }
52 
55 
56  return busType_;
57 }
58 
61 
62  return busAbstractionType_;
63 }
64 
67 
68  assert(busMode_ != IPXactModel::INVALID && "Bus mode not set!");
69  return busMode_;
70 }
71 
74 
75  return interfaceMap_;
76 }
77 
78 void
80  const TCEString& actualSignal,
81  const TCEString& busSignal) {
82 
83  SignalMapping* signalMap = new SignalMapping(
84  pair<TCEString,TCEString>(actualSignal, busSignal));
85  interfaceMap_.push_back(signalMap);
86 }
87 
88 void
90 
91  instanceName_ = name;
92 }
93 
94 void
96 
97  busMode_ = mode;
98 }
99 
100 void
102  const TCEString& vendor,
103  const TCEString& library,
104  const TCEString& name,
105  const TCEString& version) {
106 
107  busType_.vendor = vendor;
108  busType_.library = library;
109  busType_.name = name;
110  busType_.version = version;
111 }
112 
113 void
115  const TCEString& vendor,
116  const TCEString& library,
117  const TCEString& name,
118  const TCEString& version) {
119 
120  busAbstractionType_.vendor = vendor;
121  busAbstractionType_.library = library;
122  busAbstractionType_.name = name;
123  busAbstractionType_.version = version;
124 }
125 
IPXactInterface::instanceName
virtual TCEString instanceName() const
Definition: IPXactInterface.cc:49
IPXactInterface::setInstanceName
void setInstanceName(const TCEString &name)
Definition: IPXactInterface.cc:89
mode
mode
Definition: tceopgen.cc:45
IPXact::Vlnv
Definition: Vlnv.hh:41
IPXactInterface::addSignalMapping
virtual void addSignalMapping(const TCEString &actualSignal, const TCEString &busSignal)
Definition: IPXactInterface.cc:79
IPXactInterface::busMode_
IPXactModel::BusMode busMode_
Bus mode.
Definition: IPXactInterface.hh:87
IPXactInterface::busAbstractionType_
IPXact::Vlnv busAbstractionType_
Vendor,Library,Name,Version of the bus abstraction type.
Definition: IPXactInterface.hh:91
IPXactInterface::busMode
virtual IPXactModel::BusMode busMode() const
Definition: IPXactInterface.cc:66
PlatInt::SignalMappingList
std::vector< SignalMapping * > SignalMappingList
Definition: PlatformIntegratorTypes.hh:44
IPXactInterface::IPXactInterface
IPXactInterface()
Definition: IPXactInterface.cc:36
IPXactModel
Definition: IPXactModel.hh:47
IPXactInterface::instanceName_
TCEString instanceName_
Instance Name.
Definition: IPXactInterface.hh:85
IPXactInterface::busAbstractionType
virtual IPXact::Vlnv busAbstractionType() const
Definition: IPXactInterface.cc:60
IPXactInterface::interfaceMap_
PlatInt::SignalMappingList interfaceMap_
Mapping of actual port names and interface port names.
Definition: IPXactInterface.hh:93
IPXact::Vlnv::version
TCEString version
Entity version.
Definition: Vlnv.hh:62
IPXactInterface::busType
virtual IPXact::Vlnv busType() const
Definition: IPXactInterface.cc:54
PlatInt::SignalMapping
std::pair< TCEString, TCEString > SignalMapping
Definition: PlatformIntegratorTypes.hh:42
IPXact::Vlnv::vendor
TCEString vendor
Vendor name.
Definition: Vlnv.hh:56
IPXactModel::INVALID
@ INVALID
Definition: IPXactModel.hh:51
assert
#define assert(condition)
Definition: Application.hh:86
IPXact::Vlnv::library
TCEString library
Library name.
Definition: Vlnv.hh:58
IPXactInterface::setBusMode
void setBusMode(IPXactModel::BusMode mode)
Definition: IPXactInterface.cc:95
IPXactModel::BusMode
BusMode
Definition: IPXactModel.hh:50
IPXactInterface::setBusType
void setBusType(const TCEString &vendor, const TCEString &library, const TCEString &name, const TCEString &version)
Definition: IPXactInterface.cc:101
IPXactInterface::busType_
IPXact::Vlnv busType_
Vendor,Library,Name,Version of the bus type.
Definition: IPXactInterface.hh:89
TCEString
Definition: TCEString.hh:53
IPXactInterface::interfaceMapping
virtual const PlatInt::SignalMappingList & interfaceMapping() const
Definition: IPXactInterface.cc:73
IPXactInterface::~IPXactInterface
virtual ~IPXactInterface()
Definition: IPXactInterface.cc:41
IPXact::Vlnv::name
TCEString name
Entity name.
Definition: Vlnv.hh:60
IPXactInterface::setBusAbsType
void setBusAbsType(const TCEString &vendor, const TCEString &library, const TCEString &name, const TCEString &version)
Definition: IPXactInterface.cc:114
IPXactInterface.hh