OpenASIP 2.2
Loading...
Searching...
No Matches
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
39class BlocksALU : 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
63public:
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
75private:
76};
77#endif
std::list< std::string > sources
Definition BlocksALU.hh:69
std::shared_ptr< TTAMachine::Socket > in2sock
Definition BlocksALU.hh:68
std::unique_ptr< BlocksALU > alu1
Definition BlocksALU.hh:66
std::unique_ptr< BlocksALU > alu0
Definition BlocksALU.hh:65
std::shared_ptr< TTAMachine::Socket > in1sock
Definition BlocksALU.hh:67
void ConfigurePipeline(TTAMachine::ExecutionPipeline *pipeline, int numOfOperands)
Definition BlocksALU.cc:156
TTAMachine::FunctionUnit * alu
Definition BlocksALU.hh:41
TTAMachine::HWOperation * CreateHWOp(const std::string &name, int numOfOperands)
Definition BlocksALU.cc:115
void BindPorts(TTAMachine::HWOperation *hwOp, int numOfOperands)
Definition BlocksALU.cc:130
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