OpenASIP  2.0
AutomagicTools.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 AutomagicTools.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 Automagic {
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 }
Automagic::createFUGeneratableOperationInfos
std::vector< IDF::FUGenerated::Info > createFUGeneratableOperationInfos(const ProGeOptions &options, std::ostream &verbose)
Definition: AutomagicTools.cc:305
IDF::UnitImplementationLocation
Definition: UnitImplementationLocation.hh:48
Automagic::checkForSelectableFU
bool checkForSelectableFU(const ProGeOptions &options, TTAMachine::FunctionUnit &fu, IDF::FUImplementationLocation &loc, std::ostream &verbose)
Definition: AutomagicTools.cc:348
HDB::BlockImplementationFile::Format
Format
Format of the file.
Definition: BlockImplementationFile.hh:47
ProGeOptions
Definition: ProGeOptions.hh:41
Automagic::languageMatches
bool languageMatches(HDB::BlockImplementationFile::Format format, ProGe::HDL language)
Automagic::dagLatency
int dagLatency(const OperationDAG &dag, const std::unordered_map< std::string, int > &maxOpLatency)
Definition: AutomagicTools.cc:233
ImmediateUnit.hh
Automagic::canGenerateFromDAG
bool canGenerateFromDAG(const OperationDAG &dag, const std::vector< IDF::FUGenerated::Info > infos, std::vector< IDF::FUGenerated::Info > *subops)
Definition: AutomagicTools.cc:193
FUGenerated.hh
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
IDF::FUGenerated
Definition: FUGenerated.hh:41
OperationDAGNode
Definition: OperationDAGNode.hh:45
OperationDAG.hh
OperationDAG
Definition: OperationDAG.hh:43
Automagic::checkForSelectableRF
bool checkForSelectableRF(const ProGeOptions &options, TTAMachine::RegisterFile &rf, IDF::RFImplementationLocation &loc, std::ostream &verbose)
Definition: AutomagicTools.cc:417
ComponentImplementationSelector.hh
Automagic::checkForSelectableIU
bool checkForSelectableIU(const ProGeOptions &options, TTAMachine::ImmediateUnit &iu, IDF::IUImplementationLocation &loc, std::ostream &verbose)
Definition: AutomagicTools.cc:491
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
Automagic::generateableDAGOperations
std::vector< IDF::FUGenerated::DAGOperation > generateableDAGOperations(const std::vector< IDF::FUGenerated::Info > infos, std::ostream &verbose)
Definition: AutomagicTools.cc:140
Automagic::findInOptionList
bool findInOptionList(const std::string &option, std::vector< std::string > list, bool enableAll=true)
Definition: AutomagicTools.cc:123
Automagic::maxLatencyToNode
int maxLatencyToNode(const OperationDAG &dag, OperationDAGNode &node, const std::unordered_map< std::string, int > &maxOpLatency, bool allowDifference=true)
Definition: AutomagicTools.cc:273
Automagic::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: AutomagicTools.cc:58
RegisterFile.hh
ProGe::HDL
HDL
HDLs supported by ProGe.
Definition: ProGeTypes.hh:40
Automagic::findHDBPath
std::string findHDBPath(std::string name)
Definition: AutomagicTools.cc:335
Automagic
Definition: AutomagicTools.hh:43
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
Automagic::nodeLatency
int nodeLatency(OperationDAGNode &node, const std::unordered_map< std::string, int > &maxOpLatency)
Definition: AutomagicTools.cc:250
ProGeOptions.hh
FunctionUnit.hh
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50