OpenASIP 2.2
Loading...
Searching...
No Matches
NetlistFactories.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 NetlistFactories.hh
26 *
27 * Declaration of NetlistFactories class.
28 *
29 * Collection of factories for creating netlist ports, port groups and blocks.
30 *
31 * Created on: 25.5.2015
32 * @author Henry Linjamäki 2015 (henry.linjamaki-no.spam-tut.fi)
33 * @note rating: red
34 */
35
36#ifndef NETLISTFACTORIES_HH
37#define NETLISTFACTORIES_HH
38
39#include <map>
40#include <utility>
41
42#include "Machine.hh"
44
45#include "SignalTypes.hh"
46#include "SignalGroupTypes.hh"
47#include "NetlistPort.hh"
48#include "NetlistPortGroup.hh"
49
50namespace ProGe {
51
52/*
53 * Factory that creates prototype ports by given signal (group) types.
54 */
56public:
59 const IDF::MachineImplementation& impl);
60 virtual ~PortFactory();
61
62 NetlistPort* createPort(SignalType type, Direction direction = IN) const;
64
65 static NetlistPort* create(SignalType type, Direction direction = IN);
67 static void initializeContext(
69 const IDF::MachineImplementation& impl);
70 static PortFactory* instance();
71
72 static NetlistPort* clockPort(Direction direction = IN);
73 static NetlistPort* resetPort(Direction direction = IN);
74
75private:
77
78 void registerPort(SignalType, const NetlistPort* port);
79 void registerPort(const NetlistPort* port);
80 void registerPorts();
82 SignalGroupType type,
83 const NetlistPortGroup* portGroup);
84 void registerPortGroup(const NetlistPortGroup* portGroup);
85 void registerPortGroups();
86
87 typedef std::map<SignalType, const NetlistPort*>
89 typedef std::map<SignalGroupType, const NetlistPortGroup*>
91
92 /// The creation context.
93 /*const TTAMachine::Machine* machine_;*/
94 /// The creation context.
95 /*const IDF::MachineImplementation* implementation_;*/
96 /// Registered NetlistPort prototypes.
98 /// Registered NetlistPortGroup prototypes.
100
101 /// Singleton instance of the factory.
103 /// The creation context for singleton instance.
105 /// The creation context for singleton instance.
107};
108
109} /* namespace ProGe */
110
111
112
113#endif /* NETLISTFACTORIES_HH */
TTAMachine::Machine * machine
the architecture definition of the estimated processor
static NetlistPort * resetPort(Direction direction=IN)
std::map< SignalGroupType, const NetlistPortGroup * > PortGroupPrototypeContainer
PortPrototypeContainer portPrototypes_
The creation context.
static const IDF::MachineImplementation * staticImplementation_
The creation context for singleton instance.
PortGroupPrototypeContainer portGroupPrototypes_
Registered NetlistPortGroup prototypes.
static NetlistPort * create(SignalType type, Direction direction=IN)
void registerPort(SignalType, const NetlistPort *port)
static PortFactory * instance_
Singleton instance of the factory.
static const TTAMachine::Machine * staticMachine_
The creation context for singleton instance.
NetlistPort * createPort(SignalType type, Direction direction=IN) const
NetlistPortGroup * createPortGroup(SignalGroupType type) const
static void initializeContext(const TTAMachine::Machine &machine, const IDF::MachineImplementation &impl)
std::map< SignalType, const NetlistPort * > PortPrototypeContainer
static NetlistPort * clockPort(Direction direction=IN)
void registerPortGroup(SignalGroupType type, const NetlistPortGroup *portGroup)
static PortFactory * instance()
Definition FUGen.hh:54
Direction
Direction of the port.
Definition ProGeTypes.hh:52
@ IN
Input port.
Definition ProGeTypes.hh:53