OpenASIP 2.2
Loading...
Searching...
No Matches
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
38namespace 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}
const std::string & instanceName() const
const std::string & moduleName() const
void addOutOperand(TTAMachine::FUPort *port)
virtual ~GeneratableFUNetlistBlock()=default
GeneratableFUNetlistBlock(const std::string &moduleName, const std::string instanceName, NetlistGenerator &generator)
void addInOperand(TTAMachine::FUPort *port, int id)
virtual NetlistPort * port(const std::string &portName, bool partialMatch=true)
void mapLoadPort(const NetlistPort &port, NetlistPort &loadPort)
void mapNetlistPort(const TTAMachine::Port &adfPort, NetlistPort &netlistPort)
std::string name() const
Definition FUGen.hh:54
@ BIT
One bit.
Definition ProGeTypes.hh:47
@ BIT_VECTOR
Several bits.
Definition ProGeTypes.hh:48
@ OUT
Output port.
Definition ProGeTypes.hh:54
@ IN
Input port.
Definition ProGeTypes.hh:53