OpenASIP  2.0
ProGeTools.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2017 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 ProGeTools.hh
26 *
27 * Tools for automated TTA generation.
28 *
29 * @author Lasse Lehtonen 2017 (lasse.lehtonen-no.spam-tut.fi)
30 */
31 
32 #pragma once
33 
34 #include <unordered_map>
36 #include "FUGenerated.hh"
37 #include "FunctionUnit.hh"
38 #include "ImmediateUnit.hh"
39 #include "ProGeOptions.hh"
40 #include "RegisterFile.hh"
41 #include "OperationDAG.hh"
42 
43 namespace ProGeTools {
44  std::string findHDBPath(std::string name);
45 
46  bool findInOptionList(
47  const std::string& option, std::vector<std::string> list,
48  bool enableAll = true);
49 
50  std::vector<IDF::FUGenerated::DAGOperation>
51  generateableDAGOperations(const std::vector<IDF::FUGenerated::Info> infos,
52  std::ostream& verbose);
53 
54  std::vector<IDF::FUGenerated::Info> createFUGeneratableOperationInfos(
55  const ProGeOptions& options, std::ostream& verbose);
56 
59  const std::vector<IDF::FUGenerated::Info>& infos,
60  const std::vector<IDF::FUGenerated::DAGOperation> dagops);
61 
64  std::ostream& verbose);
65 
68  std::ostream& verbose);
69 
72  std::ostream& verbose);
73 
74  bool canGenerateFromDAG(const OperationDAG& dag,
75  const std::vector<IDF::FUGenerated::Info> infos,
76  std::vector<IDF::FUGenerated::Info>* subops);
77 
78  int dagLatency(const OperationDAG& dag,
79  const std::unordered_map<std::string, int>& maxOpLatency);
80  int maxLatencyToNode(
81  const OperationDAG& dag, OperationDAGNode& node,
82  const std::unordered_map<std::string, int>& maxOpLatency,
83  bool allowDifference = true);
84 
85  int nodeLatency(OperationDAGNode& node,
86  const std::unordered_map<std::string, int>& maxOpLatency);
87 
89  ProGe::HDL language);
90 }
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
ProGeTools::createFUGeneratableOperationInfos
std::vector< IDF::FUGenerated::Info > createFUGeneratableOperationInfos(const ProGeOptions &options, std::ostream &verbose)
Definition: ProGeTools.cc:306
HDB::BlockImplementationFile::Format
Format
Format of the file.
Definition: BlockImplementationFile.hh:47
ProGeOptions
Definition: ProGeOptions.hh:41
ImmediateUnit.hh
FUGenerated.hh
ProGeTools::checkForGeneratableFU
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
ProGeTools::checkForSelectableFU
bool checkForSelectableFU(const ProGeOptions &options, TTAMachine::FunctionUnit &fu, IDF::FUImplementationLocation &loc, std::ostream &verbose)
Definition: ProGeTools.cc:352
ProGeTools::dagLatency
int dagLatency(const OperationDAG &dag, const std::unordered_map< std::string, int > &maxOpLatency)
Definition: ProGeTools.cc:234
ProGeTools::nodeLatency
int nodeLatency(OperationDAGNode &node, const std::unordered_map< std::string, int > &maxOpLatency)
Definition: ProGeTools.cc:252
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
ProGeTools::languageMatches
bool languageMatches(HDB::BlockImplementationFile::Format format, ProGe::HDL language)
IDF::FUGenerated
Definition: FUGenerated.hh:41
OperationDAGNode
Definition: OperationDAGNode.hh:45
ProGeTools::checkForSelectableRF
bool checkForSelectableRF(const ProGeOptions &options, TTAMachine::RegisterFile &rf, IDF::RFImplementationLocation &loc, std::ostream &verbose)
Definition: ProGeTools.cc:422
OperationDAG.hh
OperationDAG
Definition: OperationDAG.hh:43
ProGeTools
Definition: ProGeTools.hh:43
ProGeTools::generateableDAGOperations
std::vector< IDF::FUGenerated::DAGOperation > generateableDAGOperations(const std::vector< IDF::FUGenerated::Info > infos, std::ostream &verbose)
Definition: ProGeTools.cc:142
ComponentImplementationSelector.hh
ProGeTools::checkForSelectableIU
bool checkForSelectableIU(const ProGeOptions &options, TTAMachine::ImmediateUnit &iu, IDF::IUImplementationLocation &loc, std::ostream &verbose)
Definition: ProGeTools.cc:500
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
ProGeTools::maxLatencyToNode
int maxLatencyToNode(const OperationDAG &dag, OperationDAGNode &node, const std::unordered_map< std::string, int > &maxOpLatency, bool allowDifference=true)
Definition: ProGeTools.cc:274
RegisterFile.hh
ProGeTools::findHDBPath
std::string findHDBPath(std::string name)
Definition: ProGeTools.cc:339
ProGeTools::canGenerateFromDAG
bool canGenerateFromDAG(const OperationDAG &dag, const std::vector< IDF::FUGenerated::Info > infos, std::vector< IDF::FUGenerated::Info > *subops)
Definition: ProGeTools.cc:194
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
ProGeOptions.hh
ProGeTools::findInOptionList
bool findInOptionList(const std::string &option, std::vector< std::string > list, bool enableAll=true)
Definition: ProGeTools.cc:124
FunctionUnit.hh
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50