OpenASIP  2.0
BlocksALU.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 BlocksALU.hh
26  *
27  * Declaration of BlocksALU 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_ALU_HH
35 #define BLOCKS_ALU_HH
36 
37 #include "BlocksFU.hh"
38 
39 class BlocksALU : public BlocksFU {
40 public:
42  BlocksALU(
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 
63 public:
64  // Smart pointers for automated memory management
65  std::unique_ptr<BlocksALU> alu0;
66  std::unique_ptr<BlocksALU> alu1;
67  std::shared_ptr<TTAMachine::Socket> in1sock;
68  std::shared_ptr<TTAMachine::Socket> in2sock;
69  std::list<std::string> sources;
70 
72  TTAMachine::Machine& mach, const std::string& name,
73  std::list<std::string> sources, bool usesOut0, bool usesOut1);
74 
75 private:
76 };
77 #endif
BlocksFU::ops
std::vector< TTAMachine::HWOperation * > ops
Definition: BlocksFU.hh:59
BlocksALUPair::sources
std::list< std::string > sources
Definition: BlocksALU.hh:69
BlocksALU::~BlocksALU
~BlocksALU()
Definition: BlocksALU.hh:47
TTAMachine::HWOperation
Definition: HWOperation.hh:52
BlocksFU.hh
BlocksALUPair::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksALU.hh:67
BlocksALUPair::alu1
std::unique_ptr< BlocksALU > alu1
Definition: BlocksALU.hh:66
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
BlocksFU::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksFU.hh:65
BlocksALU::BlocksALU
BlocksALU(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: BlocksALU.cc:47
BlocksALU::CreateHWOp
TTAMachine::HWOperation * CreateHWOp(const std::string &name, int numOfOperands)
Definition: BlocksALU.cc:115
BlocksALU
Definition: BlocksALU.hh:39
BlocksALUPair::alu0
std::unique_ptr< BlocksALU > alu0
Definition: BlocksALU.hh:65
BlocksFU::sources
std::list< std::string > sources
Definition: BlocksFU.hh:67
BlocksFU
Definition: BlocksFU.hh:43
BlocksALUPair
Definition: BlocksALU.hh:62
BlocksFU::name
std::string name
Definition: BlocksFU.hh:68
BlocksALU::ConfigurePipeline
void ConfigurePipeline(TTAMachine::ExecutionPipeline *pipeline, int numOfOperands)
Definition: BlocksALU.cc:156
BlocksALUPair::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksALU.hh:68
TTAMachine::ExecutionPipeline
Definition: ExecutionPipeline.hh:55
BlocksALU::BindPorts
void BindPorts(TTAMachine::HWOperation *hwOp, int numOfOperands)
Definition: BlocksALU.cc:130
BlocksALU::alu
TTAMachine::FunctionUnit * alu
Definition: BlocksALU.hh:41
TTAMachine::Machine
Definition: Machine.hh:73
BlocksFU::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksFU.hh:64
BlocksALUPair::BlocksALUPair
BlocksALUPair(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, bool usesOut0, bool usesOut1)
Definition: BlocksALU.cc:90