PandA-2024.02
|
#include <InterfaceInfer.hpp>
Data Structures | |
struct | interface_info |
Public Types | |
enum | m_axi_type { m_axi_type::none, m_axi_type::direct, m_axi_type::axi_slave } |
enum | datatype { datatype::generic, datatype::ac_type } |
Public Types inherited from FrontendFlowStep | |
using | FunctionRelationship = enum { ALL_FUNCTIONS, CALLED_FUNCTIONS, CALLING_FUNCTIONS, SAME_FUNCTION, WHOLE_APPLICATION } |
The different relationship type between function analysis. More... | |
Public Types inherited from DesignFlowStep | |
enum | RelationshipType { DEPENDENCE_RELATIONSHIP, INVALIDATION_RELATIONSHIP, PRECEDENCE_RELATIONSHIP } |
The relationship type. More... | |
Public Member Functions | |
InterfaceInfer (const application_managerRef AppM, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
~InterfaceInfer () override | |
Destructor. More... | |
bool | HasToBeExecuted () const override |
Check if this step has actually to be executed. More... | |
DesignFlowStep_Status | Exec () override |
Execute this step. More... | |
Public Member Functions inherited from ApplicationFrontendFlowStep | |
ApplicationFrontendFlowStep (const application_managerRef AppM, const FrontendFlowStepType frontend_flow_step_type, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
~ApplicationFrontendFlowStep () override | |
Destructor. More... | |
std::string | GetSignature () const override |
Return the signature of this step. More... | |
std::string | GetName () const override |
Return the name of this design step. More... | |
Public Member Functions inherited from FrontendFlowStep | |
FrontendFlowStep (const application_managerRef AppM, const FrontendFlowStepType frontend_flow_step_type, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
~FrontendFlowStep () override | |
Destructor. More... | |
virtual std::string | GetKindText () const |
Return the name of the type of this frontend flow step. More... | |
DesignFlowStepFactoryConstRef | CGetDesignFlowStepFactory () const override |
Return the factory to create this type of steps. More... | |
void | PrintTreeManager (const bool before) const |
Dump the tree manager. More... | |
void | PrintInitialIR () const override |
Dump the initial intermediate representation. More... | |
void | PrintFinalIR () const override |
Dump the final intermediate representation. More... | |
Public Member Functions inherited from DesignFlowStep | |
DesignFlowStep (const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
virtual | ~DesignFlowStep () |
Destructor. More... | |
virtual void | Initialize () |
Initialize the step (i.e., like a constructor, but executed just before exec. More... | |
DesignFlowStep_Status | GetStatus () const |
Return the status of this design step. More... | |
virtual void | WriteDot (std::ostream &out) const |
Write the label for a dot graph. More... | |
bool | IsComposed () const |
Returns if this step is composed. More... | |
int | CGetDebugLevel () const |
Return the debug level of the step. More... | |
Private Member Functions | |
const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship > > | ComputeFrontendRelationships (const DesignFlowStep::RelationshipType relationship_type) const override |
Return the set of analyses in relationship with this design step. More... | |
void | ComputeRelationships (DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override |
Compute the relationships of a step with other steps. More... | |
void | ChasePointerInterfaceRecurse (CustomOrderedSet< unsigned > &Visited, tree_nodeRef ptr_var, std::list< tree_nodeRef > &writeStmt, std::list< tree_nodeRef > &readStmt, interface_info &info) |
void | ChasePointerInterface (tree_nodeRef ptr_var, std::list< tree_nodeRef > &writeStmt, std::list< tree_nodeRef > &readStmt, interface_info &info) |
void | forwardInterface (const tree_nodeRef &fnode, const tree_nodeRef &parm_node, const interface_info &info) |
void | setReadInterface (tree_nodeRef stmt, const std::string &arg_name, std::set< std::string > &operationsR, bool commonRWSignature, tree_nodeConstRef interface_datatype, const tree_manipulationRef tree_man, const tree_managerRef TM) |
void | setWriteInterface (tree_nodeRef stmt, const std::string &arg_name, std::set< std::string > &operationsW, bool commonRWSignature, tree_nodeConstRef interface_datatype, const tree_manipulationRef tree_man, const tree_managerRef TM) |
void | create_resource_Read_simple (const std::set< std::string > &operations, const interface_info &info, FunctionArchitectureRef func_arch, bool IO_port) const |
void | create_resource_Write_simple (const std::set< std::string > &operations, const interface_info &info, FunctionArchitectureRef func_arch, bool IO_port) const |
void | create_resource_array (const std::set< std::string > &operationsR, const std::set< std::string > &operationsW, const interface_info &info, FunctionArchitectureRef func_arch) const |
void | create_resource_m_axi (const std::set< std::string > &operationsR, const std::set< std::string > &operationsW, const interface_info &info, FunctionArchitectureRef func_arch) const |
void | create_resource (const std::set< std::string > &operationsR, const std::set< std::string > &operationsW, const interface_info &info, FunctionArchitectureRef func_arch) const |
Private Attributes | |
bool | already_executed |
Additional Inherited Members | |
Static Public Member Functions inherited from ApplicationFrontendFlowStep | |
static const std::string | ComputeSignature (const FrontendFlowStepType frontend_flow_step_type) |
Compute the signature of a function frontend flow step. More... | |
Static Public Member Functions inherited from FrontendFlowStep | |
static void | CreateSteps (const DesignFlowManagerConstRef design_flow_manager, const CustomUnorderedSet< std::pair< FrontendFlowStepType, FunctionRelationship >> &frontend_relationships, const application_managerConstRef application_manager, DesignFlowStepSet &relationships) |
Create the relationship steps of a step with other steps starting from already specified dependencies between frontend flow steps. More... | |
static const std::string | EnumToKindText (const FrontendFlowStepType frontend_flow_step_type) |
Given a frontend flow step type, return the name of the type. More... | |
Protected Attributes inherited from FrontendFlowStep | |
const application_managerRef | AppM |
The application manager. More... | |
const FrontendFlowStepType | frontend_flow_step_type |
The type of this step. More... | |
unsigned int | print_counter |
Print counter. More... | |
Protected Attributes inherited from DesignFlowStep | |
bool | composed |
True if this step represents a composition of design flow steps (e.g., a flow); must be set by specialized constructors. More... | |
const Wrefcount< const DesignFlowManager > | design_flow_manager |
The design flow manager. More... | |
const ParameterConstRef | parameters |
Set of input parameters. More... | |
int | debug_level |
The debug level. More... | |
const int | output_level |
The output level. More... | |
Definition at line 60 of file InterfaceInfer.hpp.
|
strong |
Enumerator | |
---|---|
generic | |
ac_type |
Definition at line 94 of file InterfaceInfer.cpp.
|
strong |
Enumerator | |
---|---|
none | |
direct | |
axi_slave |
Definition at line 87 of file InterfaceInfer.cpp.
InterfaceInfer::InterfaceInfer | ( | const application_managerRef | AppM, |
const DesignFlowManagerConstRef | design_flow_manager, | ||
const ParameterConstRef | parameters | ||
) |
Constructor.
AppM | is the application manager |
design_flow_manager | is the design flow manager |
_Param | is the set of the parameters |
Definition at line 284 of file InterfaceInfer.cpp.
References DesignFlowStep::debug_level, GET_CLASS, DesignFlowStep::parameters, and ~InterfaceInfer().
|
overridedefault |
|
private |
Definition at line 1182 of file InterfaceInfer.cpp.
References ChasePointerInterfaceRecurse(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, and INDENT_DBG_MEX.
Referenced by Exec().
|
private |
propagate design interfaces
Definition at line 885 of file InterfaceInfer.cpp.
References FrontendFlowStep::AppM, InterfaceInfer::interface_info::arg_id, tree_helper::CGetType(), cxa_demangle(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, forwardInterface(), GET_CONST_NODE, GET_INDEX_CONST_NODE, tree_helper::GetBaseVariable(), INDENT_DBG_MEX, index, InterfaceInfer::interface_info::interface_fname, tree_helper::IsPointerType(), DesignFlowStep::parameters, tree_helper::print_function_name(), STR, STR_CST_interface_parameter_keyword, THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, THROW_WARNING, tree_node::ToString(), U, and InterfaceInfer::interface_info::update().
Referenced by ChasePointerInterface().
|
overrideprivatevirtual |
Return the set of analyses in relationship with this design step.
relationship_type | is the type of relationship to be considered |
Implements FrontendFlowStep.
Definition at line 294 of file InterfaceInfer.cpp.
References ALL_FUNCTIONS, DesignFlowStep::DEPENDENCE_RELATIONSHIP, DesignFlowStep::INVALIDATION_RELATIONSHIP, DesignFlowStep::PRECEDENCE_RELATIONSHIP, THROW_UNREACHABLE, and WHOLE_APPLICATION.
|
overrideprivatevirtual |
Compute the relationships of a step with other steps.
dependencies | is where relationships will be stored |
relationship_type | is the type of relationship to be computed |
Reimplemented from FrontendFlowStep.
Definition at line 324 of file InterfaceInfer.cpp.
References FrontendFlowStep::ComputeRelationships(), TechnologyFlowStep::ComputeSignature(), DesignFlowStep::DEPENDENCE_RELATIONSHIP, DesignFlowStep::design_flow_manager, DesignFlowStep::INVALIDATION_RELATIONSHIP, LOAD_TECHNOLOGY, Wrefcount< T >::lock(), DesignFlowStep::PRECEDENCE_RELATIONSHIP, and THROW_UNREACHABLE.
|
private |
Definition at line 2475 of file InterfaceInfer.cpp.
References create_resource_array(), create_resource_m_axi(), create_resource_Read_simple(), create_resource_Write_simple(), InterfaceInfer::interface_info::name, THROW_ASSERT, and THROW_ERROR.
Referenced by Exec().
|
private |
add description and license
Definition at line 1976 of file InterfaceInfer.cpp.
References structural_manager::add_NP_functionality(), structural_manager::add_port(), structural_manager::add_port_vector(), InterfaceInfer::interface_info::alignment, FrontendFlowStep::AppM, InterfaceInfer::interface_info::arg_id, ARRAY_1D_STD_BRAM_NN_SDS, ARRAY_1D_STD_BRAM_SDS, InterfaceInfer::interface_info::bitwidth, CLOCK_PORT_NAME, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, ENCODE_FDNAME, time_info::factory(), area_info::factory(), GENERATED_COPYRIGHT, GENERATED_LICENSE, structural_manager::get_circ(), INDENT_DBG_MEX, INTERFACE_LIBRARY, NP_functionality::LIBRARY, LIBRARY_STD_FU, InterfaceInfer::interface_info::name, DesignFlowStep::parameters, RESET_PORT_NAME, structural_manager::set_top_info(), START_PORT_NAME, STR, THROW_ASSERT, U, and NP_functionality::VERILOG_GENERATOR.
Referenced by create_resource().
|
private |
add description and license
Definition at line 2144 of file InterfaceInfer.cpp.
References structural_manager::add_NP_functionality(), structural_manager::add_port(), structural_manager::add_port_vector(), FrontendFlowStep::AppM, InterfaceInfer::interface_info::arg_id, InterfaceInfer::interface_info::bitwidth, CLOCK_PORT_NAME, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DONE_PORT_NAME, ENCODE_FDNAME, EPSILON, time_info::factory(), area_info::factory(), GENERATED_COPYRIGHT, GENERATED_LICENSE, structural_manager::get_circ(), INDENT_DBG_MEX, INTERFACE_LIBRARY, NP_functionality::LIBRARY, InterfaceInfer::interface_info::name, DesignFlowStep::parameters, RESET_PORT_NAME, structural_manager::set_top_info(), START_PORT_NAME, THROW_ASSERT, U, and NP_functionality::VERILOG_GENERATOR.
Referenced by create_resource().
|
private |
add description and license
Definition at line 1685 of file InterfaceInfer.cpp.
References structural_manager::add_NP_functionality(), structural_manager::add_port(), structural_manager::add_port_vector(), InterfaceInfer::interface_info::alignment, FrontendFlowStep::AppM, InterfaceInfer::interface_info::arg_id, InterfaceInfer::interface_info::bitwidth, CLOCK_PORT_NAME, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DONE_PORT_NAME, ENCODE_FDNAME, EPSILON, time_info::factory(), area_info::factory(), GENERATED_COPYRIGHT, GENERATED_LICENSE, structural_manager::get_circ(), INDENT_DBG_MEX, INTERFACE_LIBRARY, NP_functionality::LIBRARY, InterfaceInfer::interface_info::name, DesignFlowStep::parameters, RESET_PORT_NAME, structural_manager::set_top_info(), START_PORT_NAME, U, and NP_functionality::VERILOG_GENERATOR.
Referenced by create_resource().
|
private |
add description and license
Definition at line 1824 of file InterfaceInfer.cpp.
References structural_manager::add_NP_functionality(), structural_manager::add_port(), structural_manager::add_port_vector(), InterfaceInfer::interface_info::alignment, FrontendFlowStep::AppM, InterfaceInfer::interface_info::arg_id, InterfaceInfer::interface_info::bitwidth, CLOCK_PORT_NAME, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DONE_PORT_NAME, ENCODE_FDNAME, EPSILON, time_info::factory(), area_info::factory(), GENERATED_COPYRIGHT, GENERATED_LICENSE, structural_manager::get_circ(), INDENT_DBG_MEX, INTERFACE_LIBRARY, NP_functionality::LIBRARY, InterfaceInfer::interface_info::name, DesignFlowStep::parameters, RESET_PORT_NAME, structural_manager::set_top_info(), START_PORT_NAME, U, NP_functionality::VERILOG_GENERATOR, VHDL, and NP_functionality::VHDL_GENERATOR.
Referenced by create_resource().
|
overridevirtual |
Execute this step.
Implements ApplicationFrontendFlowStep.
Definition at line 363 of file InterfaceInfer.cpp.
References InterfaceInfer::interface_info::alignment, already_executed, FrontendFlowStep::AppM, test_panda::arg, test_panda::args, BB_ENTRY, BB_EXIT, InterfaceInfer::interface_info::bitwidth, BUILTIN_SRCP, tree_helper::CGetPointedType(), tree_helper::CGetType(), ChasePointerInterface(), tree_manipulation::create_function_decl(), tree_manipulation::create_gimple_call(), tree_manipulation::create_identifier_node(), create_resource(), cxa_demangle(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, ENCODE_FDNAME, InterfaceInfer::interface_info::factor, generic, get_aligned_bitsize(), GET_CONST_NODE, get_decl_name(), GET_INDEX_CONST_NODE, GET_INDEX_NODE, GET_NODE, tree_helper::GetArrayTotalSize(), tree_manipulation::GetBooleanType(), GetCallArgs(), GetCallStmt(), tree_manipulation::GetCustomIntegerType(), tree_helper::GetFunctionName(), tree_helper::GetMangledFunctionName(), GetSortedRoots(), port_o::GetString(), tree_manipulation::GetUnsignedIntegerType(), tree_manipulation::GetVoidType(), INDENT_DBG_MEX, INDENT_OUT_MEX, INFERRED_INTERFACE_GENERATION, tree_helper::IsArrayType(), tree_helper::IsPointerType(), max, InterfaceInfer::interface_info::name, DesignFlowStep::output_level, OUTPUT_LEVEL_MINIMUM, DesignFlowStep::parameters, tree_helper::PrintType(), ResolvePointerAlias(), setReadInterface(), setWriteInterface(), signature_param_typename(), tree_helper::Size(), sl, STR, SUCCESS, THROW_ASSERT, THROW_ERROR, THROW_UNREACHABLE, THROW_WARNING, InterfaceInfer::interface_info::type, UNCHANGED, and InterfaceInfer::interface_info::update().
|
private |
Definition at line 1191 of file InterfaceInfer.cpp.
References FrontendFlowStep::AppM, GET_CONST_NODE, get_decl_name(), tree_helper::GetMangledFunctionName(), InterfaceInfer::interface_info::iface_attrs, InterfaceInfer::interface_info::parm_attrs, and THROW_ASSERT.
Referenced by ChasePointerInterfaceRecurse().
|
overridevirtual |
Check if this step has actually to be executed.
Reimplemented from ApplicationFrontendFlowStep.
Definition at line 358 of file InterfaceInfer.cpp.
References already_executed.
|
private |
create the function_decl
Definition at line 1234 of file InterfaceInfer.cpp.
References CallGraphManager::addCallPointAndExpand(), FrontendFlowStep::AppM, test_panda::args, BUILTIN_SRCP, tree_manager::CGetTreeReindex(), tree_helper::CGetType(), tree_manipulation::create_binary_operation(), tree_manipulation::create_function_decl(), tree_manipulation::create_gimple_modify_stmt(), tree_manipulation::create_ssa_name(), tree_manipulation::create_unary_operation(), tree_manipulation::CreateCallExpr(), tree_manipulation::CreateGimpleAssign(), tree_manipulation::CreateNopExpr(), tree_manager::CreateUniqueIntegerCst(), DesignFlowStep::debug_level, DEBUG_LEVEL_NONE, DEBUG_LEVEL_PEDANTIC, FunctionEdgeInfo::direct_call, ENCODE_FDNAME, GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_NODE, tree_helper::GetBaseVariable(), tree_manipulation::GetBooleanType(), tree_manipulation::GetCustomIntegerType(), tree_helper::GetMangledFunctionName(), tree_manipulation::GetPointerType(), tree_manipulation::GetUnsignedIntegerType(), INDENT_DBG_MEX, index, tree_node::index, tree_helper::IsPointerType(), tree_helper::IsRealType(), tree_helper::IsSameType(), tree_manager::ReplaceTreeNode(), tree_helper::Size(), sl, THROW_ASSERT, and tree_node::ToString().
Referenced by Exec().
|
private |
create the function_decl
Definition at line 1490 of file InterfaceInfer.cpp.
References FrontendFlowStep::AppM, test_panda::args, BUILTIN_SRCP, tree_manager::CGetTreeReindex(), tree_helper::CGetType(), tree_manipulation::create_binary_operation(), tree_manipulation::create_function_decl(), tree_manipulation::create_gimple_call(), tree_manipulation::create_gimple_modify_stmt(), tree_manipulation::create_ssa_name(), tree_manipulation::create_unary_operation(), tree_manipulation::CreateCallExpr(), tree_manipulation::CreateGimpleAssign(), tree_manipulation::CreateNopExpr(), tree_manager::CreateUniqueIntegerCst(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, ENCODE_FDNAME, GET_CONST_NODE, GET_INDEX_CONST_NODE, GET_INDEX_NODE, GET_NODE, tree_helper::GetBaseVariable(), tree_manipulation::GetBooleanType(), tree_manipulation::GetCustomIntegerType(), tree_helper::GetMangledFunctionName(), tree_manipulation::GetPointerType(), tree_manipulation::GetUnsignedIntegerType(), tree_manipulation::GetVoidType(), INDENT_DBG_MEX, index, tree_node::index, tree_helper::IsPointerType(), tree_helper::IsRealType(), tree_helper::IsSameType(), tree_helper::Size(), sl, THROW_ASSERT, and tree_node::ToString().
Referenced by Exec().
|
private |
Definition at line 65 of file InterfaceInfer.hpp.
Referenced by Exec(), and HasToBeExecuted().