OpenASIP  2.0
AlmaIFIntegrator.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2016 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 AlmaIFIntegrator.hh
26  *
27  * Declaration of AlmaIFIntegrator class.
28  */
29 
30 #ifndef TTA_ALMAIF_INTEGRATOR_HH
31 #define TTA_ALMAIF_INTEGRATOR_HH
32 
33 #include "PlatformIntegrator.hh"
34 #include "TCEString.hh"
35 #include "ProGeTypes.hh"
38 
39 
41 public:
42 
44 
48  ProGe::HDL hdl,
49  TCEString progeOutputDir,
50  TCEString entityName,
51  TCEString outputDir,
53  int targetClockFreq,
54  std::ostream& warningStream,
55  std::ostream& errorStream,
56  const MemInfo& imem,
57  MemType dmemType,
58  bool syncReset);
59 
60  virtual ~AlmaIFIntegrator();
61 
63  virtual bool integrateCore(const ProGe::NetlistBlock& cores, int coreId);
64  virtual void printInfo(std::ostream& stream) const;
65  virtual TCEString deviceFamily() const;
66  virtual void setDeviceFamily(TCEString devFamily);
67  virtual TCEString devicePackage() const;
68  virtual TCEString deviceSpeedClass() const;
69  virtual int targetClockFrequency() const;
70  virtual TCEString pinTag() const;
71  virtual bool chopTaggedSignals() const;
72 
74 
75 
76 
77 
78 protected:
79 
80  virtual MemoryGenerator& imemInstance(MemInfo imem, int coreId);
81 
83  MemInfo dmem,
84  TTAMachine::FunctionUnit& lsuArch,
85  std::vector<std::string> lsuPorts);
86 
87 
88 
89 private:
90  void addMemoryPorts(
91  const TCEString as_name, int data_width, int addr_width,
92  const bool isShared, const bool overrideAsWidth);
93  void addMemoryPorts(
94  const TCEString as_name, int mem_count, int data_width,
95  int addr_width, int strb_width, const bool overrideAsWidth);
96 
97  void initAlmaifBlock();
98  void addAlmaifFiles();
99  void copyPlatformFile(const TCEString inputPath,
100  std::vector<TCEString>& fileList, bool isScript = false) const;
101  TCEString axiAddressWidth() const;
102  void findMemories();
103  void exportUnconnectedPorts(int coreId);
104  void connectCoreMemories(MemInfo mem, TCEString mem_name,
105  TCEString mem_block_name, bool seconds);
106  void addPortToGroup(ProGe::NetlistPortGroup* port_group,
107  const ProGe::Direction dir, const TCEString name,
108  const TCEString width);
109  void addPortToAlmaIFBlock(const TCEString name,
110  const TCEString width,
111  const ProGe::Direction dir,
112  const TCEString core_name = "");
113  void addPortToAlmaIFBlock(const TCEString name,
114  const int width,
115  const ProGe::Direction dir,
116  const TCEString core_name = "");
119 
120  static const TCEString DMEM_NAME;
121  static const TCEString PMEM_NAME;
122  static const TCEString AXI_AS_NAME;
123  static const TCEString ALMAIF_MODULE;
124  static const TCEString DEFAULT_DEVICE;
125 
127  static const int DEFAULT_LOCAL_MEMORY_WIDTH;
128 
130  std::map<TCEString, MemoryGenerator*> dmemGen_;
131  std::map<TCEString, ProGe::NetlistPort*> almaif_ttacore_ports;
132 
134 
137 
139 
141 
144  std::string secondDmemName_;
147  std::string secondPmemName_;
150 
155  bool dmem_dram_ = false;
156  bool imem_dp_ = false;
157 };
158 
159 #endif
AlmaIFIntegrator::accelInstantiator_
HDLTemplateInstantiator accelInstantiator_
Definition: AlmaIFIntegrator.hh:149
AlmaIFIntegrator::DEFAULT_LOCAL_MEMORY_WIDTH
static const int DEFAULT_LOCAL_MEMORY_WIDTH
Definition: AlmaIFIntegrator.hh:127
AlmaIFIntegrator::AXI_AS_NAME
static const TCEString AXI_AS_NAME
Definition: AlmaIFIntegrator.hh:122
AlmaIFIntegrator::printInfo
virtual void printInfo(std::ostream &stream) const
Definition: AlmaIFIntegrator.cc:1099
ProGe::NetlistBlock
Definition: NetlistBlock.hh:61
AlmaIFIntegrator::devicePackage
virtual TCEString devicePackage() const
Definition: AlmaIFIntegrator.cc:1132
HDLTemplateInstantiator
Definition: HDLTemplateInstantiator.hh:45
DefaultProjectFileGenerator.hh
AlmaIFIntegrator::hasSeparateLocalMemory_
bool hasSeparateLocalMemory_
Definition: AlmaIFIntegrator.hh:152
AlmaIFIntegrator::axiMasterPortGroup
ProGe::NetlistPortGroup * axiMasterPortGroup()
Definition: AlmaIFIntegrator.cc:753
AlmaIFIntegrator::deviceFamily
virtual TCEString deviceFamily() const
Definition: AlmaIFIntegrator.cc:1119
AlmaIFIntegrator::secondDmemName_
std::string secondDmemName_
Definition: AlmaIFIntegrator.hh:144
MemInfo
Definition: MemoryGenerator.hh:67
AlmaIFIntegrator::setDeviceFamily
virtual void setDeviceFamily(TCEString devFamily)
Definition: AlmaIFIntegrator.cc:1125
AlmaIFIntegrator::secondPmemAddrw_
int secondPmemAddrw_
Definition: AlmaIFIntegrator.hh:148
AlmaIFIntegrator::dmem_dram_
bool dmem_dram_
Definition: AlmaIFIntegrator.hh:155
AlmaIFIntegrator::syncReset_
bool syncReset_
Definition: AlmaIFIntegrator.hh:153
HDLTemplateInstantiator.hh
AlmaIFIntegrator::secondDmemAddrw_
int secondDmemAddrw_
Definition: AlmaIFIntegrator.hh:146
AlmaIFIntegrator::chopTaggedSignals
virtual bool chopTaggedSignals() const
Definition: AlmaIFIntegrator.cc:1114
AlmaIFIntegrator::secondPmemDataw_
int secondPmemDataw_
Definition: AlmaIFIntegrator.hh:148
AlmaIFIntegrator::deviceSpeedClass
virtual TCEString deviceSpeedClass() const
Definition: AlmaIFIntegrator.cc:1137
AlmaIFIntegrator::secondDmemDataw_
int secondDmemDataw_
Definition: AlmaIFIntegrator.hh:145
TCEString.hh
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
AlmaIFIntegrator::findMemories
void findMemories()
Definition: AlmaIFIntegrator.cc:112
AlmaIFIntegrator::pmemInfo_
MemInfo pmemInfo_
Definition: AlmaIFIntegrator.hh:140
AlmaIFIntegrator::axiAddressWidth
TCEString axiAddressWidth() const
Definition: AlmaIFIntegrator.cc:237
AlmaIFIntegrator::dmemInstance
virtual MemoryGenerator & dmemInstance(MemInfo dmem, TTAMachine::FunctionUnit &lsuArch, std::vector< std::string > lsuPorts)
Definition: AlmaIFIntegrator.cc:1016
ProGe::NetlistPortGroup
Definition: NetlistPortGroup.hh:53
ProjectFileGenerator
Definition: ProjectFileGenerator.hh:41
AlmaIFIntegrator::broadcast_pmem_
bool broadcast_pmem_
Definition: AlmaIFIntegrator.hh:154
PlatformIntegrator::progeBlock
const ProGe::NetlistBlock & progeBlock() const
Definition: PlatformIntegrator.cc:530
AlmaIFIntegrator::axiSlavePortGroup
ProGe::NetlistPortGroup * axiSlavePortGroup()
Definition: AlmaIFIntegrator.cc:714
AlmaIFIntegrator::almaif_ttacore_ports
std::map< TCEString, ProGe::NetlistPort * > almaif_ttacore_ports
Definition: AlmaIFIntegrator.hh:131
AlmaIFIntegrator::imem_dp_
bool imem_dp_
Definition: AlmaIFIntegrator.hh:156
PlatformIntegrator::idf
const IDF::MachineImplementation * idf() const
Definition: PlatformIntegrator.cc:304
AlmaIFIntegrator::addPortToAlmaIFBlock
void addPortToAlmaIFBlock(const TCEString name, const TCEString width, const ProGe::Direction dir, const TCEString core_name="")
Definition: AlmaIFIntegrator.cc:679
AlmaIFIntegrator::dmemInfo_
MemInfo dmemInfo_
Definition: AlmaIFIntegrator.hh:140
AlmaIFIntegrator
Definition: AlmaIFIntegrator.hh:40
AlmaIFIntegrator::addPortToGroup
void addPortToGroup(ProGe::NetlistPortGroup *port_group, const ProGe::Direction dir, const TCEString name, const TCEString width)
Definition: AlmaIFIntegrator.cc:698
AlmaIFIntegrator::dmemHandled_
bool dmemHandled_
Definition: AlmaIFIntegrator.hh:143
PlatformIntegrator::machine
const TTAMachine::Machine * machine() const
Definition: PlatformIntegrator.cc:297
ProGeTypes.hh
AlmaIFIntegrator::deviceFamily_
TCEString deviceFamily_
Definition: AlmaIFIntegrator.hh:135
AlmaIFIntegrator::pinTag
virtual TCEString pinTag() const
Definition: AlmaIFIntegrator.cc:1147
AlmaIFIntegrator::deviceName_
TCEString deviceName_
Definition: AlmaIFIntegrator.hh:136
AlmaIFIntegrator::connectCoreMemories
void connectCoreMemories(MemInfo mem, TCEString mem_name, TCEString mem_block_name, bool seconds)
Definition: AlmaIFIntegrator.cc:553
AlmaIFIntegrator::PMEM_NAME
static const TCEString PMEM_NAME
Definition: AlmaIFIntegrator.hh:121
AlmaIFIntegrator::exportUnconnectedPorts
void exportUnconnectedPorts(int coreId)
Definition: AlmaIFIntegrator.cc:969
AlmaIFIntegrator::addMemoryPorts
void addMemoryPorts(const TCEString as_name, int data_width, int addr_width, const bool isShared, const bool overrideAsWidth)
Definition: AlmaIFIntegrator.cc:778
AlmaIFIntegrator::addAlmaifFiles
void addAlmaifFiles()
Definition: AlmaIFIntegrator.cc:817
AlmaIFIntegrator::secondPmem_
bool secondPmem_
Definition: AlmaIFIntegrator.hh:142
AlmaIFIntegrator::AlmaIFIntegrator
AlmaIFIntegrator()
Definition: AlmaIFIntegrator.cc:61
DefaultProjectFileGenerator
Definition: DefaultProjectFileGenerator.hh:43
AlmaIFIntegrator::copyPlatformFile
void copyPlatformFile(const TCEString inputPath, std::vector< TCEString > &fileList, bool isScript=false) const
Definition: AlmaIFIntegrator.cc:877
PlatformIntegrator::programName
TCEString programName() const
Definition: PlatformIntegrator.cc:133
MemType
MemType
Definition: MemoryGenerator.hh:57
AlmaIFIntegrator::imemGen_
MemoryGenerator * imemGen_
Definition: AlmaIFIntegrator.hh:129
AlmaIFIntegrator::DEFAULT_DEVICE
static const TCEString DEFAULT_DEVICE
Definition: AlmaIFIntegrator.hh:124
AlmaIFIntegrator::DEFAULT_RESERVED_PRIVATE_MEM_SIZE
static const int DEFAULT_RESERVED_PRIVATE_MEM_SIZE
Definition: AlmaIFIntegrator.hh:126
AlmaIFIntegrator::~AlmaIFIntegrator
virtual ~AlmaIFIntegrator()
Definition: AlmaIFIntegrator.cc:96
AlmaIFIntegrator::initAlmaifBlock
void initAlmaifBlock()
Definition: AlmaIFIntegrator.cc:272
TCEString
Definition: TCEString.hh:53
PlatformIntegrator::warningStream
std::ostream & warningStream() const
Definition: PlatformIntegrator.cc:271
PlatformIntegrator.hh
AlmaIFIntegrator::ALMAIF_MODULE
static const TCEString ALMAIF_MODULE
Definition: AlmaIFIntegrator.hh:123
AlmaIFIntegrator::hasMinimalDebugger_
bool hasMinimalDebugger_
Definition: AlmaIFIntegrator.hh:151
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
AlmaIFIntegrator::dmemGen_
std::map< TCEString, MemoryGenerator * > dmemGen_
Definition: AlmaIFIntegrator.hh:130
AlmaIFIntegrator::integrateCore
virtual bool integrateCore(const ProGe::NetlistBlock &cores, int coreId)
Definition: AlmaIFIntegrator.cc:892
PlatformIntegrator
Definition: PlatformIntegrator.hh:65
AlmaIFIntegrator::almaifBlock_
ProGe::NetlistBlock * almaifBlock_
Definition: AlmaIFIntegrator.hh:133
AlmaIFIntegrator::pmemHandled_
bool pmemHandled_
Definition: AlmaIFIntegrator.hh:143
AlmaIFIntegrator::projectFileGenerator
virtual ProjectFileGenerator * projectFileGenerator() const
Definition: AlmaIFIntegrator.cc:1152
AlmaIFIntegrator::integrateProcessor
virtual void integrateProcessor(const ProGe::NetlistBlock *progeBlock)
Definition: AlmaIFIntegrator.cc:205
PlatformIntegrator::errorStream
std::ostream & errorStream() const
Definition: PlatformIntegrator.cc:278
AlmaIFIntegrator::imemInstance
virtual MemoryGenerator & imemInstance(MemInfo imem, int coreId)
Definition: AlmaIFIntegrator.cc:981
ProGe::Direction
Direction
Direction of the port.
Definition: ProGeTypes.hh:52
AlmaIFIntegrator::fileGen_
DefaultProjectFileGenerator * fileGen_
Definition: AlmaIFIntegrator.hh:138
AlmaIFIntegrator::secondPmemName_
std::string secondPmemName_
Definition: AlmaIFIntegrator.hh:147
IDF::MachineImplementation
Definition: MachineImplementation.hh:54
AlmaIFIntegrator::DMEM_NAME
static const TCEString DMEM_NAME
Definition: AlmaIFIntegrator.hh:120
TTAMachine::Machine
Definition: Machine.hh:73
AlmaIFIntegrator::targetClockFrequency
virtual int targetClockFrequency() const
Definition: AlmaIFIntegrator.cc:1142
MemoryGenerator
Definition: MemoryGenerator.hh:85
AlmaIFIntegrator::secondDmem_
bool secondDmem_
Definition: AlmaIFIntegrator.hh:142