OpenASIP  2.0
BlocksRF.cc
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 BlocksRF.cc
26  *
27  * Implementation of BlocksRF Class.
28  *
29  * @author Maarten Molendijk 2020 (m.j.molendijk@tue.nl)
30  * @author Kanishkan Vadivel 2021 (k.vadivel@tue.nl)
31  */
32 #include "BlocksRF.hh"
33 
34 using namespace TTAMachine;
35 /**
36  * Default blocks Regierfile model
37  *
38  * @param mach The TTA machine where the RF needs to be added.
39  * @param name The name of the RF.
40  * @param sources A list of sources that are attached to this unit's input.
41  */
43  Machine& mach, const std::string& name, std::list<std::string> sources) {
44  // Rf property constants
45  unsigned int size = 16;
46  // fixed for now, TODO: needs to be variable for mixed precision?
47  unsigned int width = 32;
48  unsigned int maxReads = 1;
49  unsigned int maxWrites = 1;
50  unsigned int guardLatency = 0;
53 
54  rf = new RegisterFile(
55  name, size, width, maxReads, maxWrites, guardLatency, type);
56  this->sources = sources;
57  in1 = new RFPort("in1", *rf);
58  out1 = new RFPort("out1", *rf);
59  mach.addRegisterFile(*rf);
60 
61  // Create sockets
62  in1sock = new Socket(name + "_in1t");
63  out1sock = new Socket(name + "_out1");
64  mach.addSocket(*in1sock);
65  mach.addSocket(*out1sock);
66  in1->attachSocket(*in1sock);
67  out1->attachSocket(*out1sock);
68 }
TTAMachine::RFPort
Definition: RFPort.hh:45
TTAMachine::Machine::addRegisterFile
virtual void addRegisterFile(RegisterFile &unit)
Definition: Machine.cc:236
TTAMachine::Socket
Definition: Socket.hh:53
NORMAL
@ NORMAL
Definition: tceopgen.cc:45
BlocksRF.hh
TTAMachine::RegisterFile::Type
Type
Type of the register file indicates how the RF is used.
Definition: RegisterFile.hh:50
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
TTAMachine
Definition: Assembler.hh:48
TTAMachine::Machine::addSocket
virtual void addSocket(Socket &socket)
Definition: Machine.cc:157
TTAMachine::Machine
Definition: Machine.hh:73
BlocksRF::BlocksRF
BlocksRF(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources)
Definition: BlocksRF.cc:42