OpenASIP  2.0
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 
39 class BlocksMUL : public BlocksFU {
40 public:
42  BlocksMUL(
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 
54 private:
55  void ConfigurePipeline(
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  */
68 public:
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 
80 private:
81 };
82 #endif
BlocksFU::ops
std::vector< TTAMachine::HWOperation * > ops
Definition: BlocksFU.hh:59
BlocksMUL
Definition: BlocksMUL.hh:39
BlocksMULPair::BlocksMULPair
BlocksMULPair(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, bool usesOut0, bool usesOut1)
Definition: BlocksMUL.cc:73
TTAMachine::HWOperation
Definition: HWOperation.hh:52
BlocksMUL::BindPorts
void BindPorts(TTAMachine::HWOperation *hwOp, int numOfOperands)
Definition: BlocksMUL.cc:113
BlocksFU.hh
BlocksMULPair
Definition: BlocksMUL.hh:67
BlocksMUL::CreateHWOp
TTAMachine::HWOperation * CreateHWOp(const std::string &name, int numOfOperands)
Definition: BlocksMUL.cc:98
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
BlocksMUL::mul
TTAMachine::FunctionUnit * mul
Definition: BlocksMUL.hh:41
BlocksMULPair::mul0
std::unique_ptr< BlocksMUL > mul0
Definition: BlocksMUL.hh:70
BlocksFU::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksFU.hh:65
BlocksMUL::ConfigurePipeline
void ConfigurePipeline(TTAMachine::ExecutionPipeline *pipeline, int numOfOperands)
Definition: BlocksMUL.cc:139
BlocksMUL::~BlocksMUL
~BlocksMUL()
Definition: BlocksMUL.hh:47
BlocksMULPair::mul1
std::unique_ptr< BlocksMUL > mul1
Definition: BlocksMUL.hh:71
BlocksMULPair::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksMUL.hh:73
BlocksMUL::BlocksMUL
BlocksMUL(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, std::shared_ptr< TTAMachine::Socket > in1sock, std::shared_ptr< TTAMachine::Socket > in2sock)
Definition: BlocksMUL.cc:47
BlocksFU::sources
std::list< std::string > sources
Definition: BlocksFU.hh:67
BlocksFU
Definition: BlocksFU.hh:43
BlocksFU::name
std::string name
Definition: BlocksFU.hh:68
TTAMachine::ExecutionPipeline
Definition: ExecutionPipeline.hh:55
BlocksMULPair::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksMUL.hh:72
BlocksMULPair::sources
std::list< std::string > sources
Definition: BlocksMUL.hh:74
TTAMachine::Machine
Definition: Machine.hh:73
BlocksFU::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksFU.hh:64