OpenASIP
2.2
Loading...
Searching...
No Matches
src
bintools
BlocksTranslator
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
*/
42
BlocksRF::BlocksRF
(
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;
51
TTAMachine::RegisterFile::Type
type =
52
TTAMachine::RegisterFile::Type::NORMAL
;
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
}
BlocksRF.hh
BlocksRF::rf
TTAMachine::RegisterFile * rf
Definition
BlocksRF.hh:43
BlocksRF::out1
TTAMachine::RFPort * out1
Definition
BlocksRF.hh:48
BlocksRF::BlocksRF
BlocksRF(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources)
Definition
BlocksRF.cc:42
BlocksRF::in1
TTAMachine::RFPort * in1
Definition
BlocksRF.hh:47
BlocksRF::in1sock
TTAMachine::Socket * in1sock
Definition
BlocksRF.hh:49
BlocksRF::out1sock
TTAMachine::Socket * out1sock
Definition
BlocksRF.hh:50
BlocksRF::sources
std::list< std::string > sources
Definition
BlocksRF.hh:51
TTAMachine::Machine
Definition
Machine.hh:73
TTAMachine::Machine::addRegisterFile
virtual void addRegisterFile(RegisterFile &unit)
Definition
Machine.cc:236
TTAMachine::Machine::addSocket
virtual void addSocket(Socket &socket)
Definition
Machine.cc:157
TTAMachine::Port::attachSocket
virtual void attachSocket(Socket &socket)
Definition
Port.cc:191
TTAMachine::RFPort
Definition
RFPort.hh:45
TTAMachine::RegisterFile
Definition
RegisterFile.hh:47
TTAMachine::RegisterFile::Type
Type
Type of the register file indicates how the RF is used.
Definition
RegisterFile.hh:50
TTAMachine::RegisterFile::NORMAL
@ NORMAL
Used for general register allocation.
Definition
RegisterFile.hh:51
TTAMachine::Socket
Definition
Socket.hh:53
TTAMachine
Definition
Assembler.hh:48
Generated by
1.9.8