OpenASIP 2.2
Loading...
Searching...
No Matches
ProGeUI.cc
Go to the documentation of this file.
1/*
2 Copyright (c) 2002-2011 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 ProGeUI.cc
26 *
27 * Implementation of ProGeUI class.
28 *
29 * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30 * @author Esa Määttä 2007 (esa.maatta-no.spam-tut.fi)
31 * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
32 * @author Pekka Jääskeläinen 2011
33 * @author Vinogradov Viacheslav(added Verilog generating) 2012
34 * @note rating: red
35 */
36
37#include <fstream>
38#include <string>
39#include <vector>
40#include <cmath>
41
42#include "ProGeUI.hh"
43#include "ProGeTypes.hh"
44#include "ProcessorGenerator.hh"
45#include "TestBenchBlock.hh"
46
47#include "Machine.hh"
48#include "ADFSerializer.hh"
49#include "ControlUnit.hh"
51#include "FUPort.hh"
52
53#include "BinaryEncoding.hh"
54#include "BEMSerializer.hh"
55#include "BEMGenerator.hh"
56#include "BEMValidator.hh"
57
59#include "IDFSerializer.hh"
60#include "IDFValidator.hh"
61
63#include "Environment.hh"
64#include "FileSystem.hh"
65
68
69#include "MathTools.hh"
70#include "Netlist.hh"
71#include "NetlistBlock.hh"
72#include "PlatformIntegrator.hh"
75#include "KoskiIntegrator.hh"
76#include "AvalonIntegrator.hh"
77#include "AlmaIFIntegrator.hh"
78
79#include "ProGeTools.hh"
80
81using namespace IDF;
82using std::string;
83using std::vector;
84
85
86
87namespace ProGe {
88
89const std::string ProGeUI::DEFAULT_ENTITY_STR = "tta0";
90
91/**
92 * The constructor.
93 */
95 machine_(NULL), bem_(NULL), idf_(NULL), plugin_(NULL), pluginFile_(""),
96 entityName_(DEFAULT_ENTITY_STR) {
97}
98
99
100/**
101 * The destructor.
102 */
104 if (machine_ != NULL) {
105 delete machine_;
106 }
107 if (bem_ != NULL) {
108 delete bem_;
109 }
110 if (idf_ != NULL) {
111 delete idf_;
112 }
113 if (plugin_ != NULL) {
114 delete plugin_;
115 }
116}
117
118
119/**
120 * Loads machine from the given ADF file.
121 *
122 * @param adfFile The ADF file.
123 * @exception SerializerException If the file cannot be read or is erroneous.
124 * @exception ObjectStateLoadingException If the machine cannot be
125 * constructed.
126 */
127void
128ProGeUI::loadMachine(const std::string& adfFile) {
129 ADFSerializer serializer;
130 serializer.setSourceFile(adfFile);
131 machine_ = serializer.readMachine();
132}
133
134/**
135 * Loads the binary encoding from the given BEM file.
136 *
137 * @param bemFile The BEM file.
138 * @exception SerializerException If the file cannot be read or is erroneous.
139 * @exception ObjectStateLoadingException If the object model cannot be
140 * constructed.
141 */
142void
143ProGeUI::loadBinaryEncoding(const std::string& bemFile) {
144 BEMSerializer serializer;
145 serializer.setSourceFile(bemFile);
146 bem_ = serializer.readBinaryEncoding();
147}
148
149/**
150 * Loads the machine implementation from the given IDF file.
151 *
152 * @param idfFile The IDF file.
153 * @exception SerializerException If the file cannot be read or is erroneous.
154 * @exception ObjectStateLoadingException If the object model cannot be
155 * constructed.
156 */
157void
158ProGeUI::loadMachineImplementation(const std::string& idfFile) {
159 IDFSerializer serializer;
160 serializer.setSourceFile(idfFile);
161 idf_ = serializer.readMachineImplementation();
162}
163
164void
168
169void
173
174void
178
179/**
180 * Loads the given processor configuration.
181 *
182 * @param configurationFile The PCF file.
183 * @exception UnreachableStream If the PCF file cannot be read.
184 * @exception SerializerException If some files defined in PCF cannot be
185 * read or is erroneous.
186 * @exception ObjectStateLoadingException If some of the object models cannot
187 * be constructed.
188 */
189void
190ProGeUI::loadProcessorConfiguration(const std::string& configurationFile) {
191 std::ifstream fileStream(configurationFile.c_str());
192 if (!fileStream.good()) {
193 string errorMsg = "Unable to read the PCF from '" +
194 configurationFile + "'.";
195 throw UnreachableStream(__FILE__, __LINE__, __func__, errorMsg);
196 }
197
198 ProcessorConfigurationFile pcf(fileStream);
199 pcf.setPCFDirectory(FileSystem::directoryOfPath(configurationFile));
200
201 // load machine
202 try {
203 string adfFile = pcf.architectureName();
204 ADFSerializer serializer;
205 serializer.setSourceFile(adfFile);
206 machine_ = serializer.readMachine();
207 } catch (const KeyNotFound&) {
208 }
209
210 // load BEM
211 try {
212 string bemFile = pcf.encodingMapName();
213 BEMSerializer serializer;
214 serializer.setSourceFile(bemFile);
215 bem_ = serializer.readBinaryEncoding();
216 } catch (const KeyNotFound&) {
217 }
218
219 // load IDF
220 try {
221 string idfFile = pcf.implementationName();
222 IDFSerializer serializer;
223 serializer.setSourceFile(idfFile);
224 idf_ = serializer.readMachineImplementation();
225 } catch (const KeyNotFound&) {
226 }
227}
228
229/**
230 * Loads the given IC/decoder generator plugin.
231 *
232 * @param pluginFile The file that implements the plugin.
233 * @param pluginName Name of the plugin.
234 * @exception FileNotFound If the module is not found.
235 * @exception DynamicLibraryException If the module cannot be opened.
236 * @exception InvalidData If the machine or BEM is not loaded yet.
237 */
238void
240 const std::string& pluginFile, const std::string& pluginName) {
241 pluginFile_ = pluginFile;
242
243 checkIfNull(machine_, "ADF not loaded");
244 if (bem_ == NULL) {
245 string errorMsg = "BEM not loaded";
246 throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
247 }
248
249 // initialize the plugin tool
250 vector<string> pluginPaths = Environment::icDecoderPluginPaths();
251 for (vector<string>::const_iterator iter = pluginPaths.begin();
252 iter != pluginPaths.end(); iter++) {
253 try {
255 } catch (const FileNotFound&) {
256 }
257 }
258
259 try {
260 pluginTool_.registerModule(pluginFile);
261 } catch (const FileNotFound&) {
262 string errorMsg = "Plugin file '" + pluginFile + "' doesn't exist";
263 throw FileNotFound(__FILE__, __LINE__, __func__, errorMsg);
264 }
265
266 ICDecoderGeneratorPlugin* (*creator)(
269 "create_generator_plugin_" + pluginName, creator, pluginFile);
270 plugin_ = creator(*machine_, *bem_);
271 assert(plugin_ != NULL);
272}
273
274/**
275 * Generates the processor with the loaded data.
276 *
277 * @param imemWidthInMAUs Width of the instruction memory in MAUs.
278 * @param language The language to generate.
279 * @param dstDirectory The destination directory.
280 * @param sharedDstDirectory The destination directory for VHDL files.
281 * @param entityString The string that is used as the top level entity name
282 * and to differentiate the entity and package names in
283 * processor-specific HDL files.
284 * @param errorStream Stream where error messages are written.
285 * @param warningStream Stream where warning messages are written.
286 * @exception InvalidData If ADF or IDF is not loaded.
287 * @exception IOException If an IO exception occurs.
288 * @exception DynamicLibraryException If the default plugin cannot be opened.
289 * @exception InvalidData If HDB or IDF is erroneous or if BEM is not
290 * compatible with the machine.
291 * @exception IllegalMachine If the machine is illegal.
292 * @exception OutOfRange If the given instruction memory width is not
293 * positive.
294 * @exception InstanceNotFound Something missing from HDB.
295 * @exception IllegalParameters IC/Decoder plugin parameter not recognized
296 */
297void
299 const ProGeOptions& options, int imemWidthInMAUs,
300 std::ostream& errorStream = std::cerr,
301 std::ostream& warningStream = std::cerr,
302 std::ostream& verboseStream = std::cerr) {
303 entityName_ = options.entityName;
304
305 checkIfNull(machine_, "ADF not loaded");
306
307 generateIDF(options, verboseStream);
308
309 if (bem_ == NULL) {
310 BEMGenerator generator(*machine_);
311 bem_ = generator.generate();
312 }
313
314 // validate IDF against machine
315 IDFValidator idfValidator(*idf_, *machine_);
316 if (!idfValidator.validate()) {
317 string errorMsg = idfValidator.errorMessage(0);
318 throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
319 }
320
321 // validate BEM against machine
322 BEMValidator bemValidator(*bem_, *machine_);
323 if (!bemValidator.validate()) {
324 string errorMsg("");
325 if (bemValidator.errorCount() > 0) {
326 errorMsg = bemValidator.errorMessage(0);
327 }
328 throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
329 } else if (bemValidator.warningCount() > 0) {
330 for (int i = 0; i < bemValidator.warningCount(); i++) {
331 warningStream << bemValidator.warningMessage(i) << std::endl;
332 }
333 }
334
335 if (plugin_ == NULL) {
338 string errorMsg = "IC/decoder generator plugin not defined";
339 throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
340 } else {
343
344 // set plugin parameters
345 for (unsigned i = 0; i < idf_->icDecoderParameterCount(); i++) {
349 }
351 }
352 }
353 // remove unconnected sockets (if any) before generation
355 *machine_, warningStream);
356
357 try {
359 options, *machine_, *idf_, *plugin_, imemWidthInMAUs, errorStream,
360 warningStream, verboseStream);
361 } catch (Exception& e) {
362 std::cerr << e.errorMessage() << std::endl;
363 }
364}
365
366/**
367 * Generates a test bench for simulating.
368 *
369 * @param dstDir Destination directory for the test bench.
370 * @param progeOutDir ProGe output directory.
371 *
372 * @exception InvalidData If Machine or implementation not loaded.
373 */
374void
376 const ProGe::HDL language,
377 const std::string& dstDir,
378 const std::string& progeOutDir) {
379
380 checkIfNull(machine_, "ADF not loaded");
381 checkIfNull(idf_, "IDF not loaded");
382
383 if (language == Verilog) {
384 // Note: deprecated legacy test bench. Still used since the new test
385 // bench does not yet support generation for verilog.
387 tbGen.generate(
388 language, *machine_, *idf_, dstDir, progeOutDir, entityName_);
389 } else {
390 // New test bench generation to be replacing the old one. WIP and
391 // first used to generate test benches for TTA processors.
392 try {
393 TestBenchBlock coreTestbench(
396 coreTestbench.write(Path(progeOutDir), language);
397 } catch (Exception& e) {
398 // There is one case the new test bench can not handle: same data
399 // address spaces shared by two LSUs.
401 tbGen.generate(
402 language, *machine_, *idf_, dstDir, progeOutDir, entityName_);
403 }
404 }
405}
406
407/**
408 * Generates vhdl compilation and simulation scripts.
409 *
410 * @param dstDir Destination directory for the scripts.
411 * @param progeOutDir ProGe output directory.
412 * @param progeOutDir Shared HDL output directory.
413 * @param testBenchDir Directory where a test bench is stored.
414 */
415void
417 const ProGe::HDL language, const std::string& dstDir,
418 const std::string& progeOutDir, const std::string& sharedOutDir,
419 const std::string& testBenchDir, const std::string& simulationRuntime) {
421 language, *idf_, dstDir, progeOutDir, sharedOutDir, testBenchDir,
422 entityName_, simulationRuntime);
423 sGen.generateAll();
424}
425
426/**
427 * Checks if given pointer is NULL.
428 *
429 * Throws a InvalidData exception if given pointer is NULL and sets given
430 * error message as exceptions error message.
431 *
432 * @param nullPointer Some pointer.
433 * @param errorMsg Error message for the InvalidData exception.
434 */
435void
436ProGeUI::checkIfNull(void* nullPointer, const std::string& errorMsg) {
437 if (nullPointer == NULL) {
438 throw InvalidData(__FILE__, __LINE__, __func__, errorMsg);
439 }
440}
441
442void
444 std::ostream& warningStream, std::ostream& errorStream,
445 std::string progeOutDir, std::string sharedOutputDir,
446 const std::string& platformIntegrator, const std::string& coreEntityName,
447 const std::string& programName, const std::string& deviceFamily,
448 const std::string& deviceName, MemType imem, MemType dmem, HDL language,
449 int fmax, bool syncReset, bool generateIntegratedTestbench) {
450 string platformDir = progeOutDir + FileSystem::DIRECTORY_SEPARATOR +
451 "platform";
452
453 MemInfo imemInfo;
454 imemInfo.type = imem;
455 readImemParameters(imemInfo);
456
457 PlatformIntegrator* integrator = NULL;
458 // TODO: append new integrators here
459 if (platformIntegrator == "Stratix2DSP") {
460 integrator = new Stratix2DSPBoardIntegrator(
461 machine_, idf_, language, progeOutDir, coreEntityName,
462 platformDir, programName, fmax, warningStream, errorStream,
463 imemInfo, dmem);
464 } else if (platformIntegrator == "KoskiIntegrator") {
465 integrator = new KoskiIntegrator(
466 machine_, idf_, language, progeOutDir, coreEntityName,
467 platformDir, programName, fmax, warningStream, errorStream,
468 imemInfo, dmem);
469 } else if (platformIntegrator == "AvalonIntegrator") {
470 integrator = new AvalonIntegrator(
471 machine_, idf_, language, progeOutDir, coreEntityName,
472 platformDir, programName, fmax, warningStream, errorStream,
473 imemInfo, dmem);
474 } else if (platformIntegrator == "Stratix3DevKit") {
475 integrator = new Stratix3DevKitIntegrator(
476 machine_, idf_, language, progeOutDir, coreEntityName,
477 platformDir, programName, fmax, warningStream, errorStream,
478 imemInfo, dmem);
479 } else if (platformIntegrator == "AlmaIFIntegrator") {
480 integrator = new AlmaIFIntegrator(
481 machine_, idf_, language, progeOutDir, coreEntityName,
482 platformDir, programName, fmax, warningStream, errorStream,
483 imemInfo, dmem, syncReset, generateIntegratedTestbench);
484 } else {
485 string errorMsg = "Unknown platform integrator: "
486 + platformIntegrator;
487 InvalidData exc(__FILE__, __LINE__, __func__, errorMsg);
488 throw exc;
489 }
490 if (!deviceFamily.empty()) {
491 integrator->setDeviceFamily(deviceFamily);
492 }
493 if (!deviceName.empty()) {
494 integrator->setDeviceName(deviceName);
495 }
496
497 if (FileSystem::absolutePathOf(sharedOutputDir) !=
498 FileSystem::absolutePathOf(progeOutDir)) {
499 integrator->setSharedOutputDir(sharedOutputDir);
500 }
501
502 const NetlistBlock& ttaToplevel = generator_.processorTopLevel();
503
504 try {
505 integrator->integrateProcessor(&ttaToplevel);
506 } catch (Exception& e) {
507 delete integrator;
508 throw e;
509 }
510 delete integrator;
511}
512
513void
515 imem.mauWidth = bem_->width();
516 // imem width in MAUs is fixed to 1 in ProGe
517 imem.widthInMaus = 1;
520
521 int lastAddr = machine_->controlUnit()->addressSpace()->end();
522 imem.asAddrw = MathTools::requiredBits(lastAddr);
524}
525
526void
528 const ProGeOptions& options, std::ostream& verboseStream) {
529 std::ostream nullstream(0);
530 std::ostream& verbose =
531 Application::increasedVerbose() ? verboseStream : nullstream;
532
533 if (!idf_) {
534 verbose << "IDF not set, trying automated generation.\n";
536 }
537
538 std::vector<std::string> handledFUs;
539
540 // Prefill the handledFUs with values from the .idf-file
541 for (auto&& fu : machine_->functionUnitNavigator()) {
542 if (idf_->hasFUImplementation(fu->name()) ||
543 idf_->hasFUGeneration(fu->name())) {
544 handledFUs.emplace_back(fu->name());
545 }
546 }
547
548 std::vector<IDF::FUGenerated::Info> infos =
550 //! Checking only operations that ADF has instead of them all
551 // would be faster.
552 std::vector<IDF::FUGenerated::DAGOperation> dagops =
554
555 auto already_handled = [&](const std::string& name) {
556 return std::find(handledFUs.begin(), handledFUs.end(), name) !=
557 handledFUs.end();
558 };
559
560 auto select_hdb_implementations = [&]() {
561 for (auto&& fu : machine_->functionUnitNavigator()) {
562 if (already_handled(fu->name())) {
563 continue;
564 }
565 verbose << " select implementation for " << fu->name() << "... ";
567 new IUImplementationLocation("", -1, fu->name());
569 options, *fu, *loc, verbose)) {
570 verbose << "OK (selected " << loc->id() << " from "
571 << loc->hdbFile() << ")\n";
573 handledFUs.emplace_back(fu->name());
574 } else {
575 verbose << "FAIL\n";
576 }
577 }
578 };
579
580 auto generate_implementations = [&]() {
581 for (auto&& fu : machine_->functionUnitNavigator()) {
582 if (already_handled(fu->name())) {
583 continue;
584 }
585 verbose << " generate implementation for " << fu->name()
586 << "... ";
587 IDF::FUGenerated fug(fu->name());
589 options, *fu, fug, infos, dagops)) {
590 verbose << "OK\n";
591 idf_->addFuGeneration(fug);
592 handledFUs.emplace_back(fug.name());
593 } else {
594 verbose << "FAIL\n";
595 }
596 }
597 };
598
599 // Create or select FUs.
600 if (options.preferHDLGeneration) {
601 generate_implementations();
602 select_hdb_implementations();
603 } else {
604 select_hdb_implementations();
605 generate_implementations();
606 }
607
608 // IUs.
609 for (auto&& iu : machine_->immediateUnitNavigator()) {
610 if (idf_->hasIUImplementation(iu->name())) {
611 continue;
612 }
613 verbose << " select implementation for " << iu->name() << "... ";
615 new IUImplementationLocation("", -1, iu->name());
616 if (ProGeTools::checkForSelectableIU(options, *iu, *loc, verbose)) {
617 verbose << "OK (selected " << loc->id() << " from "
618 << loc->hdbFile() << ")\n";
620 } else {
621 verbose << "FAIL\n";
622 }
623 }
624
625 // RFs.
626 for (auto&& rf : machine_->registerFileNavigator()) {
627 if (idf_->hasRFImplementation(rf->name())) {
628 continue;
629 }
630 verbose << " select implementation for " << rf->name() << "... ";
632 new RFImplementationLocation("", -1, rf->name());
633 if (ProGeTools::checkForSelectableRF(options, *rf, *loc, verbose)) {
634 verbose << "OK (selected " << loc->id() << " from "
635 << loc->hdbFile() << ")\n";
637 } else {
638 verbose << "FAIL\n";
639 }
640 }
641
642 // IC/Decoder plugin.
644 idf_->setICDecoderPluginName("DefaultICDecoder");
645 idf_->setICDecoderPluginFile("DefaultICDecoderPlugin.so");
646 }
647 // Set parameters based on argList given in command line.
648 // Overrides the matching .idf-file params with the command line params.
649 for (auto&& kvp : options.icdArgList) {
650 idf_->setICDecoderParameter(kvp.first, kvp.second);
651 }
652
653 // If ICDecoder parameters are not given, give some defaults based
654 // on the GCU's latency.
655 if (idf_->icDecoderParameterCount() == 0) {
656 int delaySlots = machine_->controlUnit()->delaySlots();
657 if (delaySlots == 3) {
658 // Happy old slow default machine.
659 } else if (delaySlots == 2) {
660 idf_->setICDecoderParameter("bypassinstructionregister", "yes");
661 } else {
662 throw std::runtime_error(
663 "Cannot decide ICDecoder parameters for " +
664 std::to_string(delaySlots) + "-stage GCU.");
665 }
666 }
667}
668
669} // end of namespace ProGe
670
#define __func__
#define assert(condition)
static MachInfoCmdLineOptions options
Definition MachInfo.cc:46
TTAMachine::Machine * readMachine()
static bool increasedVerbose()
BinaryEncoding * generate()
BinaryEncoding * readBinaryEncoding()
std::string errorMessage(int index) const
int errorCount() const
std::string warningMessage(int index) const
int warningCount() const
virtual ObjectState * saveState() const
virtual int width(const TCEString &templateName) const
static std::vector< std::string > icDecoderPluginPaths(bool libraryPathsOnly=false)
std::string errorMessage() const
Definition Exception.cc:123
static std::string absolutePathOf(const std::string &pathName)
static const std::string DIRECTORY_SEPARATOR
static std::string directoryOfPath(const std::string fileName)
Definition FileSystem.cc:79
std::string errorMessage(int index) const
std::string name() const
MachineImplementation * readMachineImplementation()
std::string icDecoderPluginName() const
void setICDecoderParameter(const std::string &name, const std::string &value)
void setICDecoderPluginFile(const std::string &file)
void addIUImplementation(RFImplementationLocation *implementation)
void addRFImplementation(RFImplementationLocation *implementation)
bool hasIUImplementation(const std::string &unitName) const
bool hasFUGeneration(const std::string &name) const
std::string icDecoderPluginFile() const
bool hasRFImplementation(const std::string &unitName) const
std::string icDecoderParameterValue(const std::string &name) const
std::string icDecoderParameterName(unsigned param) const
void addFUImplementation(FUImplementationLocation *implementation)
virtual ObjectState * saveState() const
void setICDecoderPluginName(const std::string &name)
bool hasFUImplementation(const std::string &unitName) const
void addFuGeneration(const FUGenerated &fug)
static int requiredBits(unsigned long int number)
virtual void integrateProcessor(const ProGe::NetlistBlock *progeBlock)=0
virtual void setDeviceFamily(TCEString devFamily)=0
void setSharedOutputDir(const TCEString &sharedDir)
void setDeviceName(TCEString devName)
void importSymbol(const std::string &symbolName, T *&target, const std::string &module)
void addSearchPath(const std::string &searchPath)
void registerModule(const std::string &module)
void generate(const ProGe::HDL language, const TTAMachine::Machine &mach, const IDF::MachineImplementation &implementation, const std::string &dstDirectory, const std::string &progeOutDir, const std::string &entityStr="tta0")
void setParameter(const std::string &name, const std::string &value)
TTAMachine::Machine * machine_
The loaded machine.
Definition ProGeUI.hh:107
void generateIDF(const ProGeOptions &options, std::ostream &verboseStream)
Definition ProGeUI.cc:527
static const std::string DEFAULT_ENTITY_STR
Definition ProGeUI.hh:134
void loadBinaryEncoding(const BinaryEncoding &bem)
Definition ProGeUI.cc:170
ProcessorGenerator generator_
Definition ProGeUI.hh:132
std::string entityName_
Name of the toplevel entity.
Definition ProGeUI.hh:130
void generateScripts(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir, const std::string &sharedOutDir, const std::string &testBenchDir, const std::string &simulationRuntime)
Definition ProGeUI.cc:416
void loadICDecoderGeneratorPlugin(const std::string &pluginFile, const std::string &pluginName)
Definition ProGeUI.cc:239
void readImemParameters(MemInfo &imem) const
Definition ProGeUI.cc:514
BinaryEncoding * bem_
The loaded binary encoding map.
Definition ProGeUI.hh:120
void loadMachineImplementation(const IDF::MachineImplementation &idf)
Definition ProGeUI.cc:175
std::string pluginFile_
The plugin file.
Definition ProGeUI.hh:128
PluginTools pluginTool_
Tool for loading plugin.
Definition ProGeUI.hh:124
void generateProcessor(const ProGeOptions &options, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
Definition ProGeUI.cc:298
virtual ~ProGeUI()
Definition ProGeUI.cc:103
void generateTestBench(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir)
Definition ProGeUI.cc:375
IDF::MachineImplementation * idf_
The loaded machine implementation.
Definition ProGeUI.hh:122
void integrateProcessor(std::ostream &warningStream, std::ostream &errorStream, std::string progeOutDir, std::string sharedOutputDir, const std::string &platformIntegrator, const std::string &coreEntityName, const std::string &programName, const std::string &deviceFamily, const std::string &deviceName, MemType imem, MemType dmem, HDL language, int fmax, bool syncReset, bool generateIntegratedTestbench)
Definition ProGeUI.cc:443
void loadProcessorConfiguration(const std::string &configurationFile)
Definition ProGeUI.cc:190
ICDecoderGeneratorPlugin * plugin_
The loaded IC/decoder generator plugin.
Definition ProGeUI.hh:126
void loadMachine(const TTAMachine::Machine &adf)
Definition ProGeUI.cc:165
void checkIfNull(void *nullPointer, const std::string &errorMsg)
Definition ProGeUI.cc:436
const ProGeContext & generatorContext() const
static void removeUnconnectedSockets(TTAMachine::Machine &machine, std::ostream &warningStream)
const NetlistBlock & processorTopLevel() const
void generateProcessor(const ProGeOptions &options, const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, ICDecoderGeneratorPlugin &plugin, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
virtual void write(const Path &targetBaseDir, HDL targetLang=VHDL) const override
void setPCFDirectory(const std::string &path)
virtual ULongWord end() const
virtual bool isShared() const
virtual int width() const
virtual TCEString name() const
SpecialRegisterPort * returnAddressPort() const
virtual AddressSpace * addressSpace() const
virtual RegisterFileNavigator registerFileNavigator() const
Definition Machine.cc:450
virtual FunctionUnitNavigator functionUnitNavigator() const
Definition Machine.cc:380
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition Machine.cc:416
virtual ControlUnit * controlUnit() const
Definition Machine.cc:345
void setSourceFile(const std::string &fileName)
UnitImplementationLocation IUImplementationLocation
UnitImplementationLocation RFImplementationLocation
bool checkForSelectableIU(const ProGeOptions &options, TTAMachine::ImmediateUnit &iu, IDF::IUImplementationLocation &loc, std::ostream &verbose)
bool checkForGeneratableFU(const ProGeOptions &options, TTAMachine::FunctionUnit &fu, IDF::FUGenerated &fug, const std::vector< IDF::FUGenerated::Info > &infos, const std::vector< IDF::FUGenerated::DAGOperation > dagops)
Definition ProGeTools.cc:59
bool checkForSelectableFU(const ProGeOptions &options, TTAMachine::FunctionUnit &fu, IDF::FUImplementationLocation &loc, std::ostream &verbose)
bool checkForSelectableRF(const ProGeOptions &options, TTAMachine::RegisterFile &rf, IDF::RFImplementationLocation &loc, std::ostream &verbose)
std::vector< IDF::FUGenerated::Info > createFUGeneratableOperationInfos(const ProGeOptions &options, std::ostream &verbose)
std::vector< IDF::FUGenerated::DAGOperation > generateableDAGOperations(const std::vector< IDF::FUGenerated::Info > infos, std::ostream &verbose)
Definition FUGen.hh:54
HDL
HDLs supported by ProGe.
Definition ProGeTypes.hh:40
@ Verilog
Verilog.
Definition ProGeTypes.hh:42
MemType type
TCEString asName