OpenASIP  2.0
ProcessorGenerator.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 ProcessorGenerator.hh
26  *
27  * Declaration of ProcessorGenerator class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @author Otto Esko 2010 (otto.esko-no.spam-tut.fi)
31  * @author Pekka Jääskeläinen 2011
32  * @author Vinogradov Viacheslav(added Verilog generating) 2012
33  * @note rating: red
34  */
35 
36 #ifndef TTA_PROCESSOR_GENERATOR_HH
37 #define TTA_PROCESSOR_GENERATOR_HH
38 
39 #include "Exception.hh"
40 #include "ProGeContext.hh"
41 #include "ProGeTypes.hh"
42 #include "TCEString.hh"
43 #include "ProGeOptions.hh"
44 
45 
46 namespace TTAMachine {
47  class Machine;
48  class FunctionUnit;
49 }
50 
51 namespace IDF {
52  class MachineImplementation;
53 }
54 
55 class BinaryEncoding;
56 class FUPortCode;
57 
58 namespace ProGe {
59 
60  class ICDecoderGeneratorPlugin;
61  class Netlist;
62  class NetlistBlock;
63  class NetlistPortGroup;
64  class ProGeContext;
65  class NetlistGenerator;
66 
67  /**
68  * Controller class of ProGe.
69  *
70  * Acts as a middle-man between user interface, netlist generator,
71  * IC/decoder
72  * plugin and HDL writers.
73  */
75  public:
77  virtual ~ProcessorGenerator();
78 
79  void generateProcessor(
82  ICDecoderGeneratorPlugin& plugin, int imemWidthInMAUs,
83  std::ostream& errorStream, std::ostream& warningStream,
84  std::ostream& verboseStream);
85 
86  static int iMemAddressWidth(const TTAMachine::Machine& mach);
87  static int
88  iMemWidth(const TTAMachine::Machine& mach, int imemWidthInMAUs);
89 
90  const NetlistBlock& processorTopLevel() const;
91  const ProGeContext& generatorContext() const;
92 
93  TCEString entityName() const;
94 
95  static void removeUnconnectedSockets(
96  TTAMachine::Machine& machine, std::ostream& warningStream);
97 
98  private:
99  void validateMachine(
100  const TTAMachine::Machine& machine, std::ostream& errorStream,
101  std::ostream& warningStream);
102  void checkIULatencies(
105  const ICDecoderGeneratorPlugin& plugin);
107  HDL language, const TTAMachine::Machine& machine,
108  int imemWidthInMAUs, const std::string& dstDirectory,
109  ICDecoderGeneratorPlugin& plugin);
110  void generateGCUOpcodesPackage(HDL language,
112  const std::string& dstDirectory);
113  static std::string coreIdString(int i);
114  static const NetlistPortGroup* instructionBus(NetlistBlock& block);
115 
119 
121  };
122 }
123 
124 #endif
BinaryEncoding
Definition: BinaryEncoding.hh:61
ProGe::NetlistBlock
Definition: NetlistBlock.hh:61
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
ProGe::ProcessorGenerator::ProcessorGenerator
ProcessorGenerator()
Definition: ProcessorGenerator.cc:114
Exception.hh
implementation
IDF::MachineImplementation * implementation
the implementation definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:61
ProGe::ProcessorGenerator::entityName
TCEString entityName() const
Definition: ProcessorGenerator.cc:524
ProGe::ICDecoderGeneratorPlugin
Definition: ICDecoderGeneratorPlugin.hh:68
ProGeOptions
Definition: ProGeOptions.hh:41
ProGe::ProcessorGenerator::processorTopLevel
const NetlistBlock & processorTopLevel() const
Definition: ProcessorGenerator.cc:510
ProGeContext.hh
FUPortCode
Definition: FUPortCode.hh:47
ProGe::ProcessorGenerator::iMemAddressWidth
static int iMemAddressWidth(const TTAMachine::Machine &mach)
Definition: ProcessorGenerator.cc:449
ProGe::ProcessorGenerator::coreTopBlock_
NetlistBlock * coreTopBlock_
Definition: ProcessorGenerator.hh:116
ProGe::ProcessorGenerator::generatorContext_
ProGeContext * generatorContext_
Definition: ProcessorGenerator.hh:118
ProGe::ProcessorGenerator::coreIdString
static std::string coreIdString(int i)
ProGe::ProcessorGenerator::checkIULatencies
void checkIULatencies(const TTAMachine::Machine &machine, const IDF::MachineImplementation &implementation, const ICDecoderGeneratorPlugin &plugin)
Definition: ProcessorGenerator.cc:390
TCEString.hh
ProGe::NetlistPortGroup
Definition: NetlistPortGroup.hh:53
ProGe::ProcessorGenerator::instructionBus
static const NetlistPortGroup * instructionBus(NetlistBlock &block)
Definition: ProcessorGenerator.cc:319
ProGe::ProcessorGenerator::iMemWidth
static int iMemWidth(const TTAMachine::Machine &mach, int imemWidthInMAUs)
Definition: ProcessorGenerator.cc:493
ProGeTypes.hh
ProGe::ProcessorGenerator::generateGCUOpcodesPackage
void generateGCUOpcodesPackage(HDL language, const TTAMachine::Machine &machine, const std::string &dstDirectory)
Definition: ProcessorGenerator.cc:306
ProGe::ProcessorGenerator::validateMachine
void validateMachine(const TTAMachine::Machine &machine, std::ostream &errorStream, std::ostream &warningStream)
Definition: ProcessorGenerator.cc:341
ProGe::ProcessorGenerator::removeUnconnectedSockets
static void removeUnconnectedSockets(TTAMachine::Machine &machine, std::ostream &warningStream)
Definition: ProcessorGenerator.cc:529
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
ProGe::ProcessorGenerator::generateGlobalsPackage
void generateGlobalsPackage(HDL language, const TTAMachine::Machine &machine, int imemWidthInMAUs, const std::string &dstDirectory, ICDecoderGeneratorPlugin &plugin)
Definition: ProcessorGenerator.cc:230
ProGe::ProcessorGenerator::~ProcessorGenerator
virtual ~ProcessorGenerator()
Definition: ProcessorGenerator.cc:119
ProGe::ProcessorGenerator::generatorContext
const ProGeContext & generatorContext() const
Definition: ProcessorGenerator.cc:519
ProGe
Definition: FUGen.hh:54
TCEString
Definition: TCEString.hh:53
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
ProGe::ProcessorGenerator::DEFAULT_ENTITY_STR
static const TCEString DEFAULT_ENTITY_STR
Definition: ProcessorGenerator.hh:120
ProGe::ProcessorGenerator::generateProcessor
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)
Definition: ProcessorGenerator.cc:130
TTAMachine
Definition: Assembler.hh:48
ProGe::ProGeContext
Definition: ProGeContext.hh:60
ProGe::ProcessorGenerator::entityStr_
TCEString entityStr_
Definition: ProcessorGenerator.hh:117
ProGeOptions.hh
ProGe::ProcessorGenerator
Definition: ProcessorGenerator.hh:74
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
IDF
Definition: DSDBManager.hh:54
TTAMachine::Machine
Definition: Machine.hh:73