OpenASIP  2.0
HWBlockImplementation.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 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 HWBlockImplementation.hh
26  *
27  * Declaration of HWBlockImplementation class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #ifndef TTA_HW_BLOCK_IMPLEMENTATION_HH
34 #define TTA_HW_BLOCK_IMPLEMENTATION_HH
35 
36 #include <string>
37 #include <vector>
38 
39 #include "Exception.hh"
40 #include "DBTypes.hh"
41 
42 namespace HDB {
43 
44 class BlockImplementationFile;
45 
46 /**
47  * Base class for FUImplementation and RFImplementation.
48  */
50 public:
52  const std::string& moduleName,
53  const std::string& clkPort,
54  const std::string& rstPort,
55  const std::string& glockPort);
56 
58 
59  virtual ~HWBlockImplementation();
60 
61  bool hasID() const;
62  void setID(RowID id);
63  RowID id() const;
64 
65  void setModuleName(const std::string& name);
66  std::string moduleName() const;
67  void setClkPort(const std::string& name);
68  std::string clkPort() const;
69  void setRstPort(const std::string& name);
70  std::string rstPort() const;
71  void setGlockPort(const std::string& name);
72  std::string glockPort() const;
73 
75 
77  int implementationFileCount() const;
78  BlockImplementationFile& file(int index) const;
79 
80 private:
81  /// Vector type for BlockImplementationFile.
82  typedef std::vector<BlockImplementationFile*> FileTable;
83 
84  /// Name of the module.
85  std::string moduleName_;
86  /// Name of the clock port.
87  std::string clkPort_;
88  /// Name of the reset port.
89  std::string rstPort_;
90  /// Name of the global lock port.
91  std::string glockPort_;
92  /// Contains the block implementation files.
94  /// Tells whether the implementation has an ID.
95  bool hasID_;
96 
97  /// ID of the implementation.
99 };
100 }
101 
102 #endif
HDB::HWBlockImplementation::rstPort_
std::string rstPort_
Name of the reset port.
Definition: HWBlockImplementation.hh:89
HDB::HWBlockImplementation::clkPort
std::string clkPort() const
Definition: HWBlockImplementation.cc:175
HDB::HWBlockImplementation::moduleName_
std::string moduleName_
Name of the module.
Definition: HWBlockImplementation.hh:85
HDB::HWBlockImplementation::file
BlockImplementationFile & file(int index) const
Definition: HWBlockImplementation.cc:267
HDB
Definition: CostDatabase.hh:49
HDB::HWBlockImplementation::HWBlockImplementation
HWBlockImplementation(const std::string &moduleName, const std::string &clkPort, const std::string &rstPort, const std::string &glockPort)
Definition: HWBlockImplementation.cc:52
Exception.hh
HDB::HWBlockImplementation::FileTable
std::vector< BlockImplementationFile * > FileTable
Vector type for BlockImplementationFile.
Definition: HWBlockImplementation.hh:82
HDB::HWBlockImplementation::~HWBlockImplementation
virtual ~HWBlockImplementation()
Definition: HWBlockImplementation.cc:94
HDB::HWBlockImplementation::implementationFileCount
int implementationFileCount() const
Definition: HWBlockImplementation.cc:254
RowID
int RowID
Type definition of row ID in relational databases.
Definition: DBTypes.hh:37
HDB::HWBlockImplementation::setClkPort
void setClkPort(const std::string &name)
Definition: HWBlockImplementation.cc:164
HDB::HWBlockImplementation::files_
FileTable files_
Contains the block implementation files.
Definition: HWBlockImplementation.hh:93
HDB::HWBlockImplementation::setGlockPort
void setGlockPort(const std::string &name)
Definition: HWBlockImplementation.cc:208
HDB::BlockImplementationFile
Definition: BlockImplementationFile.hh:44
HDB::HWBlockImplementation::hasID_
bool hasID_
Tells whether the implementation has an ID.
Definition: HWBlockImplementation.hh:95
HDB::HWBlockImplementation::rstPort
std::string rstPort() const
Definition: HWBlockImplementation.cc:197
DBTypes.hh
HDB::HWBlockImplementation::addImplementationFile
void addImplementationFile(BlockImplementationFile *file)
Definition: HWBlockImplementation.cc:230
HDB::HWBlockImplementation::id_
RowID id_
ID of the implementation.
Definition: HWBlockImplementation.hh:98
HDB::HWBlockImplementation::clkPort_
std::string clkPort_
Name of the clock port.
Definition: HWBlockImplementation.hh:87
HDB::HWBlockImplementation::setModuleName
void setModuleName(const std::string &name)
Definition: HWBlockImplementation.cc:142
HDB::HWBlockImplementation
Definition: HWBlockImplementation.hh:49
HDB::HWBlockImplementation::glockPort_
std::string glockPort_
Name of the global lock port.
Definition: HWBlockImplementation.hh:91
HDB::HWBlockImplementation::setID
void setID(RowID id)
Definition: HWBlockImplementation.cc:116
HDB::HWBlockImplementation::id
RowID id() const
Definition: HWBlockImplementation.cc:128
HDB::HWBlockImplementation::moduleName
std::string moduleName() const
Definition: HWBlockImplementation.cc:153
HDB::HWBlockImplementation::setRstPort
void setRstPort(const std::string &name)
Definition: HWBlockImplementation.cc:186
HDB::HWBlockImplementation::glockPort
std::string glockPort() const
Definition: HWBlockImplementation.cc:219
HDB::HWBlockImplementation::removeImplementationFile
void removeImplementationFile(const BlockImplementationFile &file)
Definition: HWBlockImplementation.cc:241
HDB::HWBlockImplementation::hasID
bool hasID() const
Definition: HWBlockImplementation.cc:105