OpenASIP  2.0
BlocksIMM.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 BlocksIMM.cc
26  *
27  * Implementation of BlocksIMM Class.
28  *
29  * @author Maarten Molendijk 2020 (m.j.molendijk@tue.nl)
30  * @author Kanishkan Vadivel 2021 (k.vadivel@tue.nl)
31  */
32 
33 #include "BlocksIMM.hh"
34 
35 using namespace TTAMachine;
36 
37 /**
38  * BlocksIMM with default instructions
39  *
40  * @param mach The TTA machine where the IU needs to be added.
41  * @param name The name of the IU.
42  * @param sources A list of sources that are attached to this unit's input.
43  */
45  Machine& mach, const std::string& name, std::list<std::string> sources) {
46  // IU property constants
47  unsigned int size = 1;
48  unsigned int width = 32;
49  unsigned int maxReads = 1;
50  unsigned int guardLatency = 1;
51  Machine::Extension ext = Machine::Extension::ZERO;
52 
53  // Create object
54  iu = new ImmediateUnit(name, size, width, maxReads, guardLatency, ext);
55  this->sources = sources;
56  out0 = new RFPort("out0", *iu);
57  mach.addImmediateUnit(*iu);
58 
59  // Create sockets
60  out0sock = new Socket(name + "_out0");
61  mach.addSocket(*out0sock);
62  out0->attachSocket(*out0sock);
63 }
TTAMachine::RFPort
Definition: RFPort.hh:45
TTAMachine::Machine::addImmediateUnit
virtual void addImmediateUnit(ImmediateUnit &unit)
Definition: Machine.cc:224
TTAMachine::Socket
Definition: Socket.hh:53
BlocksIMM::BlocksIMM
BlocksIMM(TTAMachine::Machine &mach, const std::string &name, std::list< std::string > sources)
Definition: BlocksIMM.cc:44
TTAMachine::Machine::Extension
Extension
Definition: Machine.hh:80
TTAMachine
Definition: Assembler.hh:48
BlocksIMM.hh
TTAMachine::Machine::addSocket
virtual void addSocket(Socket &socket)
Definition: Machine.cc:157
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50