OpenASIP 2.2
Loading...
Searching...
No Matches
BlocksMUL.hh
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2021 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 BlocksMUL.hh
26 *
27 * Declaration of BlocksMUL Class.
28 * This class resembles a single output in the Blocks architecture.
29 *
30 * @author Maarten Molendijk 2020 (m.j.molendijk@tue.nl)
31 * @author Kanishkan Vadivel 2021 (k.vadivel@tue.nl)
32 */
33
34#ifndef BLOCKS_MUL_HH
35#define BLOCKS_MUL_HH
36
37#include "BlocksFU.hh"
38
39class BlocksMUL : public BlocksFU {
40public:
43 TTAMachine::Machine& mach, const std::string& name,
44 std::list<std::string> sources,
45 std::shared_ptr<TTAMachine::Socket> in1sock,
46 std::shared_ptr<TTAMachine::Socket> in2sock);
48 while (!ops.empty()) {
49 delete ops.back();
50 ops.pop_back();
51 }
52 }
53
54private:
56 TTAMachine::ExecutionPipeline* pipeline, int numOfOperands);
57 void BindPorts(TTAMachine::HWOperation* hwOp, int numOfOperands);
59 const std::string& name, int numOfOperands);
60};
61
62/**
63 * This class is a wrapper for BlocksMUL
64 * class to group two units both representing a different output of the same
65 * Blocks Unit.
66 */
68public:
69 // Smart pointers for automated memory management
70 std::unique_ptr<BlocksMUL> mul0;
71 std::unique_ptr<BlocksMUL> mul1;
72 std::shared_ptr<TTAMachine::Socket> in1sock;
73 std::shared_ptr<TTAMachine::Socket> in2sock;
74 std::list<std::string> sources;
75
77 TTAMachine::Machine& mach, const std::string& name,
78 std::list<std::string> sources, bool usesOut0, bool usesOut1);
79
80private:
81};
82#endif
std::shared_ptr< TTAMachine::Socket > in2sock
Definition BlocksFU.hh:65
std::shared_ptr< TTAMachine::Socket > in1sock
Definition BlocksFU.hh:64
std::string name
Definition BlocksFU.hh:68
std::vector< TTAMachine::HWOperation * > ops
Definition BlocksFU.hh:59
std::list< std::string > sources
Definition BlocksFU.hh:67
std::shared_ptr< TTAMachine::Socket > in1sock
Definition BlocksMUL.hh:72
std::shared_ptr< TTAMachine::Socket > in2sock
Definition BlocksMUL.hh:73
std::list< std::string > sources
Definition BlocksMUL.hh:74
std::unique_ptr< BlocksMUL > mul0
Definition BlocksMUL.hh:70
std::unique_ptr< BlocksMUL > mul1
Definition BlocksMUL.hh:71
void ConfigurePipeline(TTAMachine::ExecutionPipeline *pipeline, int numOfOperands)
Definition BlocksMUL.cc:139
TTAMachine::HWOperation * CreateHWOp(const std::string &name, int numOfOperands)
Definition BlocksMUL.cc:98
TTAMachine::FunctionUnit * mul
Definition BlocksMUL.hh:41
void BindPorts(TTAMachine::HWOperation *hwOp, int numOfOperands)
Definition BlocksMUL.cc:113