OpenASIP  2.0
GeneratableFUNetlistBlock.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2017 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 GeneratableFUNetlistBlock.hh
26  *
27  * Declaration of GeneratableFUNetlistBlock.
28  *
29  * @author Lasse Lehtonen 2017 (lasse.lehtonen-no.spam-tut.fi)
30  */
31 
32 #pragma once
33 
34 #include "FUPort.hh"
35 #include "NetlistBlock.hh"
36 #include "NetlistGenerator.hh"
37 
38 namespace ProGe {
39 
41  public:
43  const std::string instanceName, NetlistGenerator& generator)
45 
46  virtual ~GeneratableFUNetlistBlock() = default;
47 
49  (void) id;
50  NetlistPort* dataPort =
51  new NetlistPort("data_" + port->name() + "_in",
52  std::to_string(port->width()), BIT_VECTOR, IN, *this);
53  NetlistPort* loadPort = new NetlistPort(
54  "load_" + port->name() + "_in", "1", BIT, IN, *this);
55  generator_.mapLoadPort(*dataPort, *loadPort);
56  generator_.mapNetlistPort(*port, *dataPort);
57  }
59  NetlistPort* dataPort =
60  new NetlistPort("data_" + port->name() + "_out",
61  std::to_string(port->width()), BIT_VECTOR, OUT, *this);
62  generator_.mapNetlistPort(*port, *dataPort);
63  }
64 
65  private:
67  };
68 }
ProGe::GeneratableFUNetlistBlock::addInOperand
void addInOperand(TTAMachine::FUPort *port, int id)
Definition: GeneratableFUNetlistBlock.hh:48
ProGe::NetlistGenerator::mapLoadPort
void mapLoadPort(const NetlistPort &port, NetlistPort &loadPort)
Definition: NetlistGenerator.cc:1691
ProGe::NetlistBlock
Definition: NetlistBlock.hh:61
ProGe::BIT_VECTOR
@ BIT_VECTOR
Several bits.
Definition: ProGeTypes.hh:48
ProGe::GeneratableFUNetlistBlock::generator_
NetlistGenerator & generator_
Definition: GeneratableFUNetlistBlock.hh:66
ProGe::BaseNetlistBlock::instanceName
const std::string & instanceName() const
Definition: BaseNetlistBlock.cc:135
ProGe::GeneratableFUNetlistBlock::addOutOperand
void addOutOperand(TTAMachine::FUPort *port)
Definition: GeneratableFUNetlistBlock.hh:58
TTAMachine::FUPort
Definition: FUPort.hh:46
ProGe::GeneratableFUNetlistBlock
Definition: GeneratableFUNetlistBlock.hh:40
NetlistBlock.hh
ProGe::BIT
@ BIT
One bit.
Definition: ProGeTypes.hh:47
ProGe::NetlistPort::name
std::string name() const
Definition: NetlistPort.cc:283
ProGe::GeneratableFUNetlistBlock::GeneratableFUNetlistBlock
GeneratableFUNetlistBlock(const std::string &moduleName, const std::string instanceName, NetlistGenerator &generator)
Definition: GeneratableFUNetlistBlock.hh:42
ProGe::OUT
@ OUT
Output port.
Definition: ProGeTypes.hh:54
ProGe::NetlistGenerator
Definition: NetlistGenerator.hh:84
ProGe
Definition: FUGen.hh:54
FUPort.hh
ProGe::NetlistPort
Definition: NetlistPort.hh:70
ProGe::BaseNetlistBlock::moduleName
const std::string & moduleName() const
Definition: BaseNetlistBlock.cc:140
ProGe::GeneratableFUNetlistBlock::~GeneratableFUNetlistBlock
virtual ~GeneratableFUNetlistBlock()=default
ProGe::NetlistBlock::port
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
Definition: NetlistBlock.cc:97
ProGe::BaseNetlistBlock::NetlistPort
friend class NetlistPort
Definition: BaseNetlistBlock.hh:61
ProGe::IN
@ IN
Input port.
Definition: ProGeTypes.hh:53
NetlistGenerator.hh
ProGe::NetlistGenerator::mapNetlistPort
void mapNetlistPort(const TTAMachine::Port &adfPort, NetlistPort &netlistPort)
Definition: NetlistGenerator.cc:1650