OpenASIP  2.0
ProGeUI.hh
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.hh
26  *
27  * Declaration 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 2008 (otto.esko-no.spam-tut.fi)
32  * @author Pekka Jääskeläinen 2011
33  * @note rating: red
34  */
35 
36 #ifndef TTA_PROGE_UI_HH
37 #define TTA_PROGE_UI_HH
38 
39 #include <string>
40 
41 #include "TCEString.hh"
42 #include "ProcessorGenerator.hh"
43 #include "ProGeTypes.hh"
45 #include "Exception.hh"
46 #include "PluginTools.hh"
47 #include "MemoryGenerator.hh"
48 #include "ProGeOptions.hh"
49 
50 
51 namespace TTAMachine {
52  class Machine;
53 }
54 
55 namespace IDF {
56  class MachineImplementation;
57 }
58 
59 class BinaryEncoding;
60 
61 namespace ProGe {
62 
63 /**
64  * Base class for user intefaces of ProGe.
65  */
66 class ProGeUI {
67 public:
68  virtual ~ProGeUI();
69 
70  ProGeUI();
71  void generateProcessor(
72  const ProGeOptions& options, int imemWidthInMAUs,
73  std::ostream& errorStream, std::ostream& warningStream,
74  std::ostream& verboseStream);
75  void generateTestBench(
76  const ProGe::HDL language,
77  const std::string& dstDir,
78  const std::string& progeOutDir);
79  void generateScripts(
80  const ProGe::HDL language,
81  const std::string& dstDir,
82  const std::string& progeOutDir,
83  const std::string& sharedOutDir,
84  const std::string& testBenchDir,
85  const std::string& simulationRuntime);
86  void loadMachine(const TTAMachine::Machine& adf);
87  void loadBinaryEncoding(const BinaryEncoding& bem);
89 protected:
90  void loadMachine(const std::string& adfFile);
91  void loadBinaryEncoding(const std::string& bemFile);
92  void loadMachineImplementation(const std::string& idfFile);
93  void loadProcessorConfiguration(const std::string& configurationFile);
95  const std::string& pluginFile, const std::string& pluginName);
96 
97  void integrateProcessor(
98  std::ostream& warningStream,
99  std::ostream& errorStream,
100  std::string progeOutDir,
101  std::string sharedOutputDir,
102  const std::string& platformIntegrator,
103  const std::string& coreEntityName,
104  const std::string& programName,
105  const std::string& deviceFamily,
106  const std::string& deviceName,
107  MemType imem,
108  MemType dmem,
109  HDL language,
110  int fmax,
111  bool syncReset);
112 
113  /// The loaded machine.
115 
116 private:
117  void checkIfNull(void* nullPointer, const std::string& errorMsg);
118 
119  void readLSUParameters(MemInfo& dmem) const;
120 
121  void readImemParameters(MemInfo& imem) const;
122 
123  void generateIDF(const ProGeOptions& options,
124  std::ostream& verboseStream);
125 
126  /// The loaded binary encoding map.
128  /// The loaded machine implementation.
130  /// Tool for loading plugin.
132  /// The loaded IC/decoder generator plugin.
134  /// The plugin file.
135  std::string pluginFile_;
136  /// Name of the toplevel entity
137  std::string entityName_;
138 
140 
141  static const std::string DEFAULT_ENTITY_STR;
142 };
143 }
144 
145 #endif
BinaryEncoding
Definition: BinaryEncoding.hh:61
ProGe::ProGeUI::integrateProcessor
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)
Definition: ProGeUI.cc:443
Exception.hh
PluginTools
Definition: PluginTools.hh:53
MemInfo
Definition: MemoryGenerator.hh:67
ProGe::ProGeUI
Definition: ProGeUI.hh:66
ProGe::ProGeUI::entityName_
std::string entityName_
Name of the toplevel entity.
Definition: ProGeUI.hh:137
ProGe::ICDecoderGeneratorPlugin
Definition: ICDecoderGeneratorPlugin.hh:68
MemoryGenerator.hh
ProGeOptions
Definition: ProGeOptions.hh:41
ProGe::ProGeUI::loadProcessorConfiguration
void loadProcessorConfiguration(const std::string &configurationFile)
Definition: ProGeUI.cc:190
ProGe::ProGeUI::generator_
ProcessorGenerator generator_
Definition: ProGeUI.hh:139
ProGe::ProGeUI::~ProGeUI
virtual ~ProGeUI()
Definition: ProGeUI.cc:103
ProGe::ProGeUI::pluginFile_
std::string pluginFile_
The plugin file.
Definition: ProGeUI.hh:135
ICDecoderGeneratorPlugin.hh
TCEString.hh
ProGe::ProGeUI::plugin_
ICDecoderGeneratorPlugin * plugin_
The loaded IC/decoder generator plugin.
Definition: ProGeUI.hh:133
ProGe::ProGeUI::generateTestBench
void generateTestBench(const ProGe::HDL language, const std::string &dstDir, const std::string &progeOutDir)
Definition: ProGeUI.cc:375
ProGe::ProGeUI::loadICDecoderGeneratorPlugin
void loadICDecoderGeneratorPlugin(const std::string &pluginFile, const std::string &pluginName)
Definition: ProGeUI.cc:239
ProGe::ProGeUI::generateScripts
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
ProcessorGenerator.hh
ProGe::ProGeUI::DEFAULT_ENTITY_STR
static const std::string DEFAULT_ENTITY_STR
Definition: ProGeUI.hh:141
ProGe::ProGeUI::machine_
TTAMachine::Machine * machine_
The loaded machine.
Definition: ProGeUI.hh:114
ProGeTypes.hh
ProGe::ProGeUI::readImemParameters
void readImemParameters(MemInfo &imem) const
Definition: ProGeUI.cc:514
PluginTools.hh
ProGe::ProGeUI::readLSUParameters
void readLSUParameters(MemInfo &dmem) const
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
MemType
MemType
Definition: MemoryGenerator.hh:57
ProGe::ProGeUI::idf_
IDF::MachineImplementation * idf_
The loaded machine implementation.
Definition: ProGeUI.hh:129
ProGe::ProGeUI::loadBinaryEncoding
void loadBinaryEncoding(const BinaryEncoding &bem)
Definition: ProGeUI.cc:170
ProGe::ProGeUI::loadMachineImplementation
void loadMachineImplementation(const IDF::MachineImplementation &idf)
Definition: ProGeUI.cc:175
ProGe
Definition: FUGen.hh:54
ProGe::ProGeUI::bem_
BinaryEncoding * bem_
The loaded binary encoding map.
Definition: ProGeUI.hh:127
ProGe::ProGeUI::loadMachine
void loadMachine(const TTAMachine::Machine &adf)
Definition: ProGeUI.cc:165
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
TTAMachine
Definition: Assembler.hh:48
ProGeOptions.hh
ProGe::ProGeUI::ProGeUI
ProGeUI()
Definition: ProGeUI.cc:94
ProGe::ProGeUI::pluginTool_
PluginTools pluginTool_
Tool for loading plugin.
Definition: ProGeUI.hh:131
ProGe::ProcessorGenerator
Definition: ProcessorGenerator.hh:74
ProGe::ProGeUI::generateProcessor
void generateProcessor(const ProGeOptions &options, int imemWidthInMAUs, std::ostream &errorStream, std::ostream &warningStream, std::ostream &verboseStream)
Definition: ProGeUI.cc:298
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
IDF
Definition: DSDBManager.hh:54
ProGe::ProGeUI::generateIDF
void generateIDF(const ProGeOptions &options, std::ostream &verboseStream)
Definition: ProGeUI.cc:527
TTAMachine::Machine
Definition: Machine.hh:73
ProGe::ProGeUI::checkIfNull
void checkIfNull(void *nullPointer, const std::string &errorMsg)
Definition: ProGeUI.cc:436