PandA-2024.02
Data Structures | Public Types | Public Member Functions | Private Member Functions | Private Attributes
InterfaceInfer Class Reference

#include <InterfaceInfer.hpp>

Inheritance diagram for InterfaceInfer:
Inheritance graph
[legend]
Collaboration diagram for InterfaceInfer:
Collaboration graph
[legend]

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 DesignFlowManagerdesign_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...
 

Detailed Description

Definition at line 60 of file InterfaceInfer.hpp.

Member Enumeration Documentation

◆ datatype

Enumerator
generic 
ac_type 

Definition at line 94 of file InterfaceInfer.cpp.

◆ m_axi_type

Enumerator
none 
direct 
axi_slave 

Definition at line 87 of file InterfaceInfer.cpp.

Constructor & Destructor Documentation

◆ InterfaceInfer()

InterfaceInfer::InterfaceInfer ( const application_managerRef  AppM,
const DesignFlowManagerConstRef  design_flow_manager,
const ParameterConstRef  parameters 
)

Constructor.

Parameters
AppMis the application manager
design_flow_manageris the design flow manager
_Paramis the set of the parameters

Definition at line 284 of file InterfaceInfer.cpp.

References DesignFlowStep::debug_level, GET_CLASS, DesignFlowStep::parameters, and ~InterfaceInfer().

Here is the call graph for this function:

◆ ~InterfaceInfer()

InterfaceInfer::~InterfaceInfer ( )
overridedefault

Destructor.

Referenced by InterfaceInfer().

Here is the caller graph for this function:

Member Function Documentation

◆ ChasePointerInterface()

void InterfaceInfer::ChasePointerInterface ( tree_nodeRef  ptr_var,
std::list< tree_nodeRef > &  writeStmt,
std::list< tree_nodeRef > &  readStmt,
interface_info info 
)
private

Definition at line 1182 of file InterfaceInfer.cpp.

References ChasePointerInterfaceRecurse(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, and INDENT_DBG_MEX.

Referenced by Exec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ChasePointerInterfaceRecurse()

void InterfaceInfer::ChasePointerInterfaceRecurse ( CustomOrderedSet< unsigned > &  Visited,
tree_nodeRef  ptr_var,
std::list< tree_nodeRef > &  writeStmt,
std::list< tree_nodeRef > &  readStmt,
interface_info info 
)
private

◆ ComputeFrontendRelationships()

const CustomUnorderedSet< std::pair< FrontendFlowStepType, FrontendFlowStep::FunctionRelationship > > InterfaceInfer::ComputeFrontendRelationships ( const DesignFlowStep::RelationshipType  relationship_type) const
overrideprivatevirtual

Return the set of analyses in relationship with this design step.

Parameters
relationship_typeis 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.

◆ ComputeRelationships()

void InterfaceInfer::ComputeRelationships ( DesignFlowStepSet relationship,
const DesignFlowStep::RelationshipType  relationship_type 
)
overrideprivatevirtual

Compute the relationships of a step with other steps.

Parameters
dependenciesis where relationships will be stored
relationship_typeis 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.

Here is the call graph for this function:

◆ create_resource()

void InterfaceInfer::create_resource ( const std::set< std::string > &  operationsR,
const std::set< std::string > &  operationsW,
const interface_info info,
FunctionArchitectureRef  func_arch 
) const
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_resource_array()

void InterfaceInfer::create_resource_array ( const std::set< std::string > &  operationsR,
const std::set< std::string > &  operationsW,
const interface_info info,
FunctionArchitectureRef  func_arch 
) const
private

◆ create_resource_m_axi()

void InterfaceInfer::create_resource_m_axi ( const std::set< std::string > &  operationsR,
const std::set< std::string > &  operationsW,
const interface_info info,
FunctionArchitectureRef  func_arch 
) const
private

◆ create_resource_Read_simple()

void InterfaceInfer::create_resource_Read_simple ( const std::set< std::string > &  operations,
const interface_info info,
FunctionArchitectureRef  func_arch,
bool  IO_port 
) const
private

◆ create_resource_Write_simple()

void InterfaceInfer::create_resource_Write_simple ( const std::set< std::string > &  operations,
const interface_info info,
FunctionArchitectureRef  func_arch,
bool  IO_port 
) const
private

◆ Exec()

DesignFlowStep_Status InterfaceInfer::Exec ( )
overridevirtual

Execute this step.

Returns
the exit status of 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().

Here is the call graph for this function:

◆ forwardInterface()

void InterfaceInfer::forwardInterface ( const tree_nodeRef fnode,
const tree_nodeRef parm_node,
const interface_info info 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HasToBeExecuted()

bool InterfaceInfer::HasToBeExecuted ( ) const
overridevirtual

Check if this step has actually to be executed.

Returns
true if the step has to be executed

Reimplemented from ApplicationFrontendFlowStep.

Definition at line 358 of file InterfaceInfer.cpp.

References already_executed.

◆ setReadInterface()

void InterfaceInfer::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 
)
private

◆ setWriteInterface()

void InterfaceInfer::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 
)
private

Field Documentation

◆ already_executed

bool InterfaceInfer::already_executed
private

Definition at line 65 of file InterfaceInfer.hpp.

Referenced by Exec(), and HasToBeExecuted().


The documentation for this class was generated from the following files:

Generated on Mon Feb 12 2024 13:03:56 for PandA-2024.02 by doxygen 1.8.13