OpenASIP  2.0
NetlistTools.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2015 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 NetlistTools.hh
26  *
27  * Declaration of NetlistTools class.
28  *
29  * Created on: 5.5.2015
30  * @author: Henry Linjamäki (henry.linjamaki-no.spam-tut.fi)
31  * @note rating: red
32  */
33 
34 #ifndef NETLISTTOOLS_HH
35 #define NETLISTTOOLS_HH
36 
37 #include <cstddef>
38 #include <utility>
39 #include <string>
40 #include <map>
41 
42 #include "ProGeTypes.hh"
43 #include "SignalTypes.hh"
44 
45 namespace ProGe {
46 
47 class BaseNetlistBlock;
48 class Netlist;
49 class NetlistPort;
50 class NetlistPortGroup;
51 
52 class NetlistTools {
53 public:
54 
55  static std::pair<const BaseNetlistBlock*, size_t> commonParent(
56  const BaseNetlistBlock& b1,
57  const BaseNetlistBlock& b2);
58  static void addPrefixToPortNames(
59  NetlistPortGroup& portGroup, const std::string& prefix);
60  static void addPrefixToPortName(
61  NetlistPort& port,const std::string& prefix);
62  static size_t renamePorts(
63  NetlistPortGroup& portGroup,
64  std::map<SignalType, const std::string>&& renameRules);
65  static std::string getUniqueInstanceName(
66  const BaseNetlistBlock& within,
67  const std::string& basename);
68 
69  static const BaseNetlistBlock* parent(const BaseNetlistBlock& block);
70  static const BaseNetlistBlock* parent(const BaseNetlistBlock* block);
71  static Direction mirror(Direction direction);
72  static NetlistPort* mirror(NetlistPort* port);
73 
74 };
75 
76 } /* namespace ProGe */
77 
78 #endif /* NETLISTTOOLS_HH */
ProGe::BaseNetlistBlock
Definition: BaseNetlistBlock.hh:59
ProGe::NetlistTools::parent
static const BaseNetlistBlock * parent(const BaseNetlistBlock &block)
Definition: NetlistTools.cc:182
ProGe::NetlistTools::renamePorts
static size_t renamePorts(NetlistPortGroup &portGroup, std::map< SignalType, const std::string > &&renameRules)
Definition: NetlistTools.cc:128
ProGe::NetlistPortGroup
Definition: NetlistPortGroup.hh:53
ProGe::NetlistTools::commonParent
static std::pair< const BaseNetlistBlock *, size_t > commonParent(const BaseNetlistBlock &b1, const BaseNetlistBlock &b2)
Definition: NetlistTools.cc:59
SignalTypes.hh
ProGe::NetlistTools::addPrefixToPortName
static void addPrefixToPortName(NetlistPort &port, const std::string &prefix)
Definition: NetlistTools.cc:117
ProGeTypes.hh
ProGe::NetlistTools
Definition: NetlistTools.hh:52
ProGe
Definition: FUGen.hh:54
ProGe::NetlistTools::mirror
static Direction mirror(Direction direction)
Definition: NetlistTools.cc:202
ProGe::NetlistTools::addPrefixToPortNames
static void addPrefixToPortNames(NetlistPortGroup &portGroup, const std::string &prefix)
Definition: NetlistTools.cc:106
ProGe::NetlistPort
Definition: NetlistPort.hh:70
ProGe::Direction
Direction
Direction of the port.
Definition: ProGeTypes.hh:52
ProGe::NetlistTools::getUniqueInstanceName
static std::string getUniqueInstanceName(const BaseNetlistBlock &within, const std::string &basename)
Definition: NetlistTools.cc:155