PandA-2024.02
|
Generic class managing controller creation algorithms. More...
#include <controller_creator_base_step.hpp>
Public Member Functions | |
ControllerCreatorBaseStep (const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type) | |
Constructor. More... | |
~ControllerCreatorBaseStep () override | |
Destructor. More... | |
Public Member Functions inherited from HLSFunctionStep | |
HLSFunctionStep (const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization=HLSFlowStepSpecializationConstRef()) | |
Constructor. More... | |
~HLSFunctionStep () override | |
Destructor. More... | |
bool | HasToBeExecuted () const override |
Check if this step has actually to be executed. More... | |
void | Initialize () override |
Initialize the step (i.e., like a constructor, but executed just before exec. More... | |
std::string | GetSignature () const final |
Return a unified identifier of this design step. More... | |
std::string | GetName () const final |
Return the name of this design step. More... | |
DesignFlowStep_Status | Exec () final |
Execute the step. More... | |
Public Member Functions inherited from HLS_step | |
HLS_step (const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization=HLSFlowStepSpecializationConstRef()) | |
Constructor. More... | |
~HLS_step () override | |
Destructor. More... | |
std::string | GetSignature () const override |
Return a unified identifier of this design step. More... | |
std::string | GetName () const override |
Return the name of this design step. More... | |
virtual std::string | GetKindText () const |
Return the name of the type of this frontend flow step. More... | |
DesignFlowStepFactoryConstRef | CGetDesignFlowStepFactory () const final |
Return the factory to create this type of steps. More... | |
void | ComputeRelationships (DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override |
Compute the relationships of a step with other steps. More... | |
Public Member Functions inherited from DesignFlowStep | |
DesignFlowStep (const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters) | |
Constructor. More... | |
virtual | ~DesignFlowStep () |
Destructor. 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... | |
virtual void | PrintInitialIR () const |
Dump the initial intermediate representation. More... | |
virtual void | PrintFinalIR () const |
Dump the final intermediate representation. More... | |
Protected Member Functions | |
const CustomUnorderedSet< std::tuple< HLSFlowStep_Type, HLSFlowStepSpecializationConstRef, HLSFlowStep_Relationship > > | ComputeHLSRelationships (const DesignFlowStep::RelationshipType relationship_type) const override |
Return the set of analyses in relationship with this design step. More... | |
void | Initialize () override |
Initialize the step (i.e., like a constructor, but executed just before exec. More... | |
virtual void | add_common_ports (structural_objectRef circuit, structural_managerRef SM) |
This member function adds the standard ports (clock, reset, done and command ones) to a circuit. More... | |
Protected Member Functions inherited from HLSFunctionStep | |
void | ComputeRelationships (DesignFlowStepSet &design_flow_step_set, const DesignFlowStep::RelationshipType relationship_type) override |
Compute the relationships of a step with other steps. More... | |
virtual DesignFlowStep_Status | InternalExec ()=0 |
Execute the step. More... | |
Protected Attributes | |
std::map< generic_objRef, unsigned int > | out_ports |
This contains all the ports that go from the controller to the datapath, used to enable the registers and to control muxes in the datapath. More... | |
std::map< vertex, unsigned int > | cond_ports |
This is the same as in_ports except that the first element is of type vertex. More... | |
std::map< vertex, unsigned int > | mu_ports |
This map put into relation fsm states and alldone multi_unbounded ports. More... | |
unsigned int | out_num |
Initialized after add_common_ports is called. It represents the current number of output ports. More... | |
unsigned int | in_num |
Initialized after add_common_ports is called. It represents the current number of input ports. More... | |
Protected Attributes inherited from HLSFunctionStep | |
std::map< unsigned int, unsigned int > | last_bb_ver |
last bb version of the called functions More... | |
std::map< unsigned int, unsigned int > | last_bitvalue_ver |
The version of bit value IR representation on which this step was applied. More... | |
const unsigned int | funId |
identifier of the function to be processed (0 means that it is a global step) More... | |
hlsRef | HLS |
HLS data structure of the function to be analyzed. More... | |
unsigned int | bb_version |
The version of bb intermediate representation on which this step was applied. More... | |
unsigned int | bitvalue_version |
The version of bitvalue on which this step was applied. More... | |
unsigned int | memory_version |
The version of memory representation on which this step was applied. More... | |
Protected Attributes inherited from HLS_step | |
const HLS_managerRef | HLSMgr |
information about all the HLS synthesis More... | |
const HLSFlowStep_Type | hls_flow_step_type |
The type of this step. More... | |
const HLSFlowStepSpecializationConstRef | hls_flow_step_specialization |
The information about specialization. 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... | |
Private Member Functions | |
void | add_clock_reset (structural_objectRef circuit, structural_managerRef SM) |
Adds the clock and reset ports to a circuit. More... | |
void | add_done_port (structural_objectRef circuit, structural_managerRef SM) |
Adds the done port to a circuit. More... | |
void | add_start_port (structural_objectRef circuit, structural_managerRef SM) |
Adds the start port to a circuit. More... | |
void | add_command_ports (structural_objectRef circuit, structural_managerRef SM) |
Adds the command ports to a circuit. More... | |
Additional Inherited Members | |
Public Types inherited from DesignFlowStep | |
enum | RelationshipType { DEPENDENCE_RELATIONSHIP, INVALIDATION_RELATIONSHIP, PRECEDENCE_RELATIONSHIP } |
The relationship type. More... | |
Static Public Member Functions inherited from HLSFunctionStep | |
static std::string | ComputeSignature (const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization, const unsigned int function_id) |
Compute the signature of a hls flow step. More... | |
Static Public Member Functions inherited from HLS_step | |
static std::string | EnumToName (const HLSFlowStep_Type hls_flow_step_type) |
Given a HLS flow step type, return the name of the type. More... | |
static const std::string | ComputeSignature (const HLSFlowStep_Type hls_flow_step_type, const HLSFlowStepSpecializationConstRef hls_flow_step_specialization) |
Compute the signature of a hls flow step. More... | |
Static Protected Attributes inherited from HLS_step | |
static CustomUnorderedMap< std::string, HLSFlowStep_Type > | command_line_name_to_enum |
Map hls step name to enum. More... | |
Generic class managing controller creation algorithms.
Definition at line 78 of file controller_creator_base_step.hpp.
ControllerCreatorBaseStep::ControllerCreatorBaseStep | ( | const ParameterConstRef | Param, |
const HLS_managerRef | HLSMgr, | ||
unsigned int | funId, | ||
const DesignFlowManagerConstRef | design_flow_manager, | ||
const HLSFlowStep_Type | hls_flow_step_type | ||
) |
Constructor.
Definition at line 57 of file controller_creator_base_step.cpp.
References ~ControllerCreatorBaseStep().
|
overridedefault |
|
private |
Adds the clock and reset ports to a circuit.
Called by add_common_ports
circuit | the circuit where to add the clock and reset ports |
define Boolean type for the clock and reset signals
add clock port
add entry in in_port_map between port id and port index
add reset port
Definition at line 124 of file controller_creator_base_step.cpp.
References structural_manager::add_port(), CLOCK_PORT_NAME, DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, PRINT_DBG_MEX, and RESET_PORT_NAME.
Referenced by add_common_ports().
|
private |
Adds the command ports to a circuit.
Called by add_common_ports Command ports are of three types:
circuit | the circuit where to add the command ports |
define Boolean type for command signals
connections from controller to datapath
operations signals have not to be added at this point
they represent commands to multiplexers or write enables to registers
connections from datapath to controller
operation modifying the control flow (e.g., if, switch, ...)
multi bit selector representing the evaluation of a switch
single bit selector representing the evaluation of a condition
Definition at line 162 of file controller_creator_base_step.cpp.
References structural_manager::add_port(), FunctionBehavior::CGetBehavioralHelper(), cond_ports, DesignFlowStep::debug_level, DEBUG_LEVEL_VERY_PEDANTIC, hls::functionId, HLSFunctionStep::funId, conn_binding::GetSelectors(), HLSFunctionStep::HLS, HLS_step::HLSMgr, in_num, INDENT_DBG_MEX, mu_ports, out_num, out_ports, hls::Rconn, and THROW_ASSERT.
Referenced by add_common_ports().
|
protectedvirtual |
This member function adds the standard ports (clock, reset, done and command ones) to a circuit.
circuit | it is the data-structure of the component where to add these ports |
Reimplemented in controller_cs.
Definition at line 110 of file controller_creator_base_step.cpp.
References add_clock_reset(), add_command_ports(), add_done_port(), add_start_port(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, and PRINT_DBG_MEX.
Referenced by controller_cs::add_common_ports(), pipeline_controller::InternalExec(), and fsm_controller::InternalExec().
|
private |
Adds the done port to a circuit.
Called by add_common_ports The done port appears to go high once all the calculation of a function are completed
circuit | the circuit where to add the done port |
define Boolean type for the done port
add done port
Definition at line 142 of file controller_creator_base_step.cpp.
References structural_manager::add_port(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, DONE_PORT_NAME, and PRINT_DBG_MEX.
Referenced by add_common_ports().
|
private |
Adds the start port to a circuit.
Called by add_common_ports
circuit | the circuit where to add the start port |
define Boolean type for the start port
add the start port
Definition at line 152 of file controller_creator_base_step.cpp.
References structural_manager::add_port(), DesignFlowStep::debug_level, DEBUG_LEVEL_PEDANTIC, DEBUG_LEVEL_VERY_PEDANTIC, PRINT_DBG_MEX, and START_PORT_NAME.
Referenced by add_common_ports().
|
overrideprotectedvirtual |
Return the set of analyses in relationship with this design step.
relationship_type | is the type of relationship to be considered |
Reimplemented from HLS_step.
Definition at line 68 of file controller_creator_base_step.cpp.
References DesignFlowStep::DEPENDENCE_RELATIONSHIP, DesignFlowStep::INVALIDATION_RELATIONSHIP, DesignFlowStep::parameters, DesignFlowStep::PRECEDENCE_RELATIONSHIP, SAME_FUNCTION, and THROW_UNREACHABLE.
|
overrideprotectedvirtual |
Initialize the step (i.e., like a constructor, but executed just before exec.
Test on previous steps. They check if schedule, register and connection binding have been performed. Otherwise, the circuit cannot be created.
Reimplemented from DesignFlowStep.
Definition at line 93 of file controller_creator_base_step.cpp.
References cond_ports, hls::controller, HLSFunctionStep::HLS, in_num, HLSFunctionStep::Initialize(), out_num, out_ports, hls::Param, hls::Rconn, hls::Rreg, hls::Rsch, and THROW_ASSERT.
This is the same as in_ports except that the first element is of type vertex.
Each element is obtained by calling GetPointer<commandport_obj>(j->second)->get_vertex() to the elements into in_ports. The second element is the same number of the generic_objRef into in_ports to which get_vertex() was called Initialized after add_common_ports is called
Definition at line 125 of file controller_creator_base_step.hpp.
Referenced by add_command_ports(), fsm_controller::create_state_machine(), Initialize(), pipeline_controller::InternalExec(), and fsm_controller::InternalExec().
|
protected |
Initialized after add_common_ports is called. It represents the current number of input ports.
Definition at line 133 of file controller_creator_base_step.hpp.
Referenced by add_command_ports(), fsm_controller::create_state_machine(), and Initialize().
This map put into relation fsm states and alldone multi_unbounded ports.
Definition at line 127 of file controller_creator_base_step.hpp.
Referenced by add_command_ports(), fsm_controller::create_state_machine(), pipeline_controller::InternalExec(), and fsm_controller::InternalExec().
|
protected |
Initialized after add_common_ports is called. It represents the current number of output ports.
Definition at line 130 of file controller_creator_base_step.hpp.
Referenced by add_command_ports(), fsm_controller::create_state_machine(), and Initialize().
|
protected |
This contains all the ports that go from the controller to the datapath, used to enable the registers and to control muxes in the datapath.
The first element in the map is the port object. Despite its type is generic_objRef it appears that this map contains only objects of type commandport_obj. This is suggested by the dynamic cast hidden behind a GetPointer call in controller::add_command_ports(). The second element of the map is the integer identifier of the port Initialized only after add_common_ports is called
Definition at line 119 of file controller_creator_base_step.hpp.
Referenced by add_command_ports(), fsm_controller::create_state_machine(), Initialize(), pipeline_controller::InternalExec(), and fsm_controller::InternalExec().