PandA-2024.02
technology_flow_step.cpp
Go to the documentation of this file.
1 /*
2  *
3  * _/_/_/ _/_/ _/ _/ _/_/_/ _/_/
4  * _/ _/ _/ _/ _/_/ _/ _/ _/ _/ _/
5  * _/_/_/ _/_/_/_/ _/ _/_/ _/ _/ _/_/_/_/
6  * _/ _/ _/ _/ _/ _/ _/ _/ _/
7  * _/ _/ _/ _/ _/ _/_/_/ _/ _/
8  *
9  * ***********************************************
10  * PandA Project
11  * URL: http://panda.dei.polimi.it
12  * Politecnico di Milano - DEIB
13  * System Architectures Group
14  * ***********************************************
15  * Copyright (C) 2004-2024 Politecnico di Milano
16  *
17  * This file is part of the PandA framework.
18  *
19  * The PandA framework is free software; you can redistribute it and/or modify
20  * it under the terms of the GNU General Public License as published by
21  * the Free Software Foundation; either version 3 of the License, or
22  * (at your option) any later version.
23  *
24  * This program is distributed in the hope that it will be useful,
25  * but WITHOUT ANY WARRANTY; without even the implied warranty of
26  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27  * GNU General Public License for more details.
28  *
29  * You should have received a copy of the GNU General Public License
30  * along with this program. If not, see <http://www.gnu.org/licenses/>.
31  *
32  */
41 #include "technology_flow_step.hpp"
43 
45 #include "design_flow_graph.hpp"
46 #include "design_flow_manager.hpp"
47 
49 #include "string_manipulation.hpp"
51 
52 const std::string TechnologyFlowStep::EnumToName(const TechnologyFlowStep_Type technology_flow_step_type)
53 {
54  switch(technology_flow_step_type)
55  {
57  return "FixCharacterization";
58 #if HAVE_CIRCUIT_BUILT
59  case TechnologyFlowStep_Type::LOAD_BUILTIN_TECHNOLOGY:
60  return "LoadBuiltinTechnology";
61 #endif
63  return "LoadDefaultTechnology";
65  return "LoadDeviceTechnology";
67  return "LoadFileTechnology";
69  return "LoadTechnology";
71  return "WriteTechnology";
72  default:
74  }
75  return "";
76 }
77 
79 {
80  return "Technology::" + STR(static_cast<int>(technology_flow_step_type));
81 }
82 
84 {
86 }
87 
88 std::string TechnologyFlowStep::GetName() const
89 {
90  return "Technology::" + EnumToName(technology_flow_step_type);
91 }
92 
94  const DesignFlowStep::RelationshipType relationship_type)
95 {
96  const auto design_flow_graph = design_flow_manager.lock()->CGetDesignFlowGraph();
97  const auto step_factory = GetPointer<const TechnologyFlowStepFactory>(CGetDesignFlowStepFactory());
98  const auto step_types = ComputeTechnologyRelationships(relationship_type);
99  for(const auto& step_type : step_types)
100  {
101  vertex technology_flow_step = design_flow_manager.lock()->GetDesignFlowStep(ComputeSignature(step_type));
102  const DesignFlowStepRef design_flow_step =
103  technology_flow_step ? design_flow_graph->CGetDesignFlowStepInfo(technology_flow_step)->design_flow_step :
104  step_factory->CreateTechnologyFlowStep(step_type);
105  steps.insert(design_flow_step);
106  }
107 }
108 
109 DesignFlowStepFactoryConstRef TechnologyFlowStep::CGetDesignFlowStepFactory() const
110 {
111  return design_flow_manager.lock()->CGetDesignFlowStepFactory("Technology");
112 }
113 
115  const DesignFlowManagerConstRef _design_flow_manager,
116  const TechnologyFlowStep_Type _technology_flow_step_type,
117  const ParameterConstRef _parameters)
118  : DesignFlowStep(_design_flow_manager, _parameters),
119  technology_flow_step_type(_technology_flow_step_type),
120  TM(_TM),
121  target(_target)
122 {
123 }
124 
126 {
127  return true;
128 }
RelationshipType
The relationship type.
The base class for design step.
static const std::string EnumToName(const TechnologyFlowStep_Type technology_flow_step_type)
Given a technology flow step type, return the name of the type.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
Definition: exceptions.hpp:292
std::string GetName() const override
Return the name of this design step.
void ComputeRelationships(DesignFlowStepSet &steps, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory() const override
Return the factory to create this type of steps.
virtual const CustomUnorderedSet< TechnologyFlowStep_Type > ComputeTechnologyRelationships(const DesignFlowStep::RelationshipType relationship_type) const =0
Return the set of analyses in relationship with this design step.
TechnologyFlowStep(const technology_managerRef _TM, const generic_deviceRef target, const DesignFlowManagerConstRef design_flow_manager, const TechnologyFlowStep_Type technology_flow_step_type, const ParameterConstRef parameters)
Constructor.
Classes to describe design flow graph.
static const std::string ComputeSignature(const TechnologyFlowStep_Type technology_flow_step_type)
Compute the signature of a technology flow step.
const technology_managerRef TM
The technology manager.
Factory for technology flow step.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
Definition: graph.hpp:1303
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
std::string GetSignature() const override
Return a unified identifier of this design step.
TechnologyFlowStep_Type technology_flow_step_type
The type of step.
Wrapper of design_flow.
TechnologyFlowStep_Type
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
refcount< T > lock() const
Definition: refcount.hpp:212
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
Definition: refcount.hpp:94
Base class for technology flow steps.
const generic_deviceRef target
The target device.

Generated on Mon Feb 12 2024 13:02:51 for PandA-2024.02 by doxygen 1.8.13