OpenASIP  2.0
BlocksLSU.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 BlocksLSU.hh
26  *
27  * Declaration of BlocksLSU 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_LSU_HH
35 #define BLOCKS_LSU_HH
36 
37 #include <memory>
38 
39 #include "BlocksFU.hh"
40 
41 class BlocksLSU : public BlocksFU {
42 public:
44  BlocksLSU(
45  TTAMachine::Machine& mach, const std::string& name,
46  std::list<std::string> sources, TTAMachine::AddressSpace& asData,
47  std::shared_ptr<TTAMachine::Socket> in1sock,
48  std::shared_ptr<TTAMachine::Socket> in2sock);
50  while (!ops.empty()) {
51  delete ops.back();
52  ops.pop_back();
53  }
54  }
55 
56 private:
57  void ConfigurePipeline(
58  TTAMachine::ExecutionPipeline* pipeline, bool isLoadOp);
59  void BindPorts(TTAMachine::HWOperation* hwOp, bool isLoadOp);
60  TTAMachine::HWOperation* CreateHWLoadOp(const std::string& name);
61  TTAMachine::HWOperation* CreateHWStoreOp(const std::string& name);
62 };
63 
64 /* Declaration of BlocksLSUPair Class. This class is a wrapper for BlocksLSU
65  * class to group two units both representing a different output of the same
66  * Blocks Unit.
67  */
69 public:
70  // Smart pointers for automated memory management
71  std::unique_ptr<BlocksLSU> lsu0;
72  std::unique_ptr<BlocksLSU> lsu1;
73  std::shared_ptr<TTAMachine::Socket> in1sock;
74  std::shared_ptr<TTAMachine::Socket> in2sock;
75  std::list<std::string> sources;
76 
78  TTAMachine::Machine& mach, const std::string& name,
79  std::list<std::string> sources, TTAMachine::AddressSpace& asData,
80  bool usesOut0, bool usesOut1);
81 
82 private:
83 };
84 #endif
BlocksLSUPair::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksLSU.hh:74
BlocksLSU::ConfigurePipeline
void ConfigurePipeline(TTAMachine::ExecutionPipeline *pipeline, bool isLoadOp)
Definition: BlocksLSU.cc:151
BlocksFU::ops
std::vector< TTAMachine::HWOperation * > ops
Definition: BlocksFU.hh:59
TTAMachine::HWOperation
Definition: HWOperation.hh:52
TTAMachine::AddressSpace
Definition: AddressSpace.hh:51
BlocksLSUPair
Definition: BlocksLSU.hh:68
BlocksFU.hh
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
BlocksFU::in2sock
std::shared_ptr< TTAMachine::Socket > in2sock
Definition: BlocksFU.hh:65
BlocksLSUPair::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksLSU.hh:73
BlocksLSU
Definition: BlocksLSU.hh:41
BlocksFU::sources
std::list< std::string > sources
Definition: BlocksFU.hh:67
BlocksLSUPair::sources
std::list< std::string > sources
Definition: BlocksLSU.hh:75
BlocksLSUPair::BlocksLSUPair
BlocksLSUPair(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, TTAMachine::AddressSpace &asData, bool usesOut0, bool usesOut1)
Definition: BlocksLSU.cc:79
BlocksFU
Definition: BlocksFU.hh:43
BlocksLSU::BlocksLSU
BlocksLSU(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources, TTAMachine::AddressSpace &asData, std::shared_ptr< TTAMachine::Socket > in1sock, std::shared_ptr< TTAMachine::Socket > in2sock)
Definition: BlocksLSU.cc:47
BlocksLSU::lsu
TTAMachine::FunctionUnit * lsu
Definition: BlocksLSU.hh:43
BlocksLSUPair::lsu1
std::unique_ptr< BlocksLSU > lsu1
Definition: BlocksLSU.hh:72
BlocksFU::name
std::string name
Definition: BlocksFU.hh:68
BlocksLSU::CreateHWLoadOp
TTAMachine::HWOperation * CreateHWLoadOp(const std::string &name)
Definition: BlocksLSU.cc:103
TTAMachine::ExecutionPipeline
Definition: ExecutionPipeline.hh:55
BlocksLSU::~BlocksLSU
~BlocksLSU()
Definition: BlocksLSU.hh:49
BlocksLSUPair::lsu0
std::unique_ptr< BlocksLSU > lsu0
Definition: BlocksLSU.hh:71
BlocksLSU::CreateHWStoreOp
TTAMachine::HWOperation * CreateHWStoreOp(const std::string &name)
Definition: BlocksLSU.cc:116
BlocksLSU::BindPorts
void BindPorts(TTAMachine::HWOperation *hwOp, bool isLoadOp)
Definition: BlocksLSU.cc:132
TTAMachine::Machine
Definition: Machine.hh:73
BlocksFU::in1sock
std::shared_ptr< TTAMachine::Socket > in1sock
Definition: BlocksFU.hh:64