OpenASIP 2.2
Loading...
Searching...
No Matches
KoskiIntegrator.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2010 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 KoskiIntegrator.cc
26 *
27 * Implementation of KoskiIntegrator class.
28 *
29 * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
30 * @note rating: red
31 */
32
33#include "Exception.hh"
34#include "KoskiIntegrator.hh"
35#include "MemoryGenerator.hh"
37#include "StringTools.hh"
38#include "NetlistBlock.hh"
40#include "FileSystem.hh"
41using std::vector;
42using std::endl;
43
46
48 AlteraIntegrator(), ipXactGen_(NULL),
49 deviceFamily_(DEFAULT_DEVICE_FAMILY_), dmemGen_(NULL) {
50}
51
52
56 ProGe::HDL hdl,
57 TCEString progeOutputDir,
58 TCEString coreEntityName,
59 TCEString outputDir,
60 TCEString programName,
61 int targetClockFreq,
62 std::ostream& warningStream,
63 std::ostream& errorStream,
64 const MemInfo& imem,
65 MemType dmemType):
66 AlteraIntegrator(machine, idf, hdl, progeOutputDir, coreEntityName,
67 outputDir, programName, targetClockFreq, warningStream,
68 errorStream, imem, dmemType),
69 ipXactGen_(new IPXactFileGenerator(coreEntityName, this)),
70 deviceFamily_(DEFAULT_DEVICE_FAMILY_), dmemGen_(NULL) {
71}
72
73
75
76 if (ipXactGen_ != NULL) {
77 delete ipXactGen_;
78 }
79 if (dmemGen_ != NULL) {
80 delete dmemGen_;
81 }
82}
83
86
87 return PIN_TAG_;
88}
89
90
91bool
93
94 return false;
95}
96
97
103
106 MemInfo dmem, TTAMachine::FunctionUnit& lsuArch,
107 std::vector<std::string> lsuPorts) {
108 if (dmem.type == ONCHIP) {
109 if (dmemGen_ == NULL) {
110 TCEString initFile = programName() + "_" + dmem.asName + ".mif";
111 // onchip mem size is scalable, use value from adf's Address Space
112 int addrw = dmem.portAddrw;
113 dmemGen_ =
115 dmem.mauWidth, dmem.widthInMaus, addrw, initFile,
116 this, warningStream(), errorStream());
117 ipXactGen_->addMemInitFile(initFile);
118 dmemGen_->addLsu(lsuArch, lsuPorts);
119 }
120 } else {
121 TCEString msg = "Unsupported data memory type";
122 InvalidData exc(__FILE__, __LINE__, "KoskiIntegrator",
123 msg);
124 throw exc;
125 }
126
127 return *dmemGen_;
128}
129
130void
131KoskiIntegrator::printInfo(std::ostream& stream) const {
132
133 stream
134 << "Integrator name: KoskiIntegrator" << endl
135 << "---------------------------------" << endl
136 << "Integrates TTA core to Koski flow compatible IP-block. "
137 << "Processor must have a HIBIs-LSU. " << endl
138 << "Creates an IP-XACT description of the created IP." << endl
139 << "This integrator works with Altera tools and FPGAs." << endl
140 << "Supported instruction memory types are 'onchip' and 'vhdl_array."
141 << endl << "Supported data memory type is 'onchip'." << endl
142 << "FPGA device family can be changed. Default device family is "
143 << DEFAULT_DEVICE_FAMILY_ << endl << endl;
144}
145
148
149 return deviceFamily_;
150}
151
152void
154
155 deviceFamily_ = devFamily;
156}
157
160 return "";
161}
162
165 return "";
166}
167
168int
170 return 1;
171}
TTAMachine::Machine * machine
the architecture definition of the estimated processor
@ ONCHIP
MemoryGenerator * dmemGen_
virtual void printInfo(std::ostream &stream) const
virtual TCEString pinTag() const
virtual int targetClockFrequency() const
static const TCEString DEFAULT_DEVICE_FAMILY_
TCEString deviceFamily_
virtual TCEString deviceFamily() const
virtual TCEString deviceSpeedClass() const
static const TCEString PIN_TAG_
ProjectFileGenerator * ipXactGen_
virtual ~KoskiIntegrator()
virtual bool chopTaggedSignals() const
virtual TCEString devicePackage() const
virtual void setDeviceFamily(TCEString devFamily)
virtual ProjectFileGenerator * projectFileGenerator() const
virtual MemoryGenerator & dmemInstance(MemInfo dmem, TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)
void addLsu(TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)
std::ostream & warningStream() const
TCEString programName() const
std::ostream & errorStream() const
void addMemInitFile(const TCEString &memInit)
HDL
HDLs supported by ProGe.
Definition ProGeTypes.hh:40
MemType type
TCEString asName