84 unsigned int _funId,
const DesignFlowManagerConstRef _design_flow_manager,
118 std::string name =
"controller_" + function_name;
121 HLS->
HLS_D->get_technology_manager());
122 controller->
SetParameter(
"CONTROLLER_LENGTH", std::to_string(num_states));
125 std::list<vertex> working_list;
126 astg->TopologicalSort(working_list);
128 THROW_ASSERT(boost::out_degree(entry, *astg) == 1,
"Non deterministic initial state");
130 boost::tie(oe, oend) = boost::out_edges(entry, *astg);
133 THROW_ASSERT(std::find(working_list.begin(), working_list.end(), first_state) != working_list.end(),
135 working_list.erase(std::find(working_list.begin(), working_list.end(), first_state));
136 working_list.push_front(first_state);
137 std::map<unsigned long long, structural_objectRef> null_values;
138 for(
const auto& v : working_list)
140 const auto& operations = astg->CGetStateInfo(v)->executing_operations;
141 for(
const auto& op : operations)
147 "Time model not available for operation: " +
GET_NAME(data, op));
155 auto* fu_module = GetPointer<module>(
top);
162 auto portObj = GetPointer<commandport_obj>(genObj)->get_controller_obj();
164 if(null_values.find(
GET_TYPE_SIZE(portObj)) == null_values.end())
186 "Created a shift register with " + std::to_string(num_states) +
" bits as pipeline controller");
void add_connection(structural_objectRef src, structural_objectRef dest)
Create a connection between a source structural object and a destination structural object...
Class specification to contain liveness information.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Data structure representing the entire HLS information.
void * top(node_stack *head)
boost::graph_traits< graph >::out_edge_iterator OutEdgeIterator
out_edge_iterator definition.
#define GET_TYPE(data, vertex_index)
Helper macro returning the type associated with a node.
pipeline_controller(const ParameterConstRef Param, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type hls_flow_step_type=HLSFlowStep_Type::PIPELINE_CONTROLLER_CREATOR)
Constructor.
refcount< structural_type_descriptor > structural_type_descriptorRef
RefCount type definition of the structural_type_descriptor class structure.
File containing functions and utilities to support the printing of debug messagges.
#define PRINT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
#define DEBUG_LEVEL_PEDANTIC
very verbose debugging print is performed.
This file contains the structures needed to manage a graph that will represent the state transition g...
Structure representing the most relevant information about the type of a structural object...
Base class for all command ports into datapath.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
std::string get_function_name() const
Return the name of the function.
const structural_objectRef get_circ() const
Get a reference to circ field.
vertex get_entry_state() const
Gets vertex that represents state that contains entry node.
generic_objRef bind_selector_port(direction_type dir, unsigned int mode, const vertex &cond, const OpGraphConstRef data)
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...
DesignFlowStep_Status InternalExec() override
Execute the step.
unsigned int get_assign(const vertex &v) const
Returns the functional unit assigned to the vertex.
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
#define GET_NAME(data, vertex_index)
Helper macro returning the name associated with a node.
const HLS_deviceRef HLS_D
reference to the information representing the target for the synthesis
exceptions managed by PandA
AllocationInformationRef allocation_information
Store the technology information.
virtual structural_objectRef find_member(const std::string &id, so_kind type, const structural_objectRef owner) const =0
Return the object named id of a given type which belongs to or it is associated with the object...
Class specification of the manager of the technology library data structures.
std::map< vertex, unsigned int > cond_ports
This is the same as in_ports except that the first element is of type vertex.
redefinition of map to manage ordered/unordered structures
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define CLOCK_PORT_NAME
standard name for ports
const OpNodeInfoConstRef CGetOpNodeInfo(const vertex node) const
Returns the info associated with a node.
fu_bindingRef Rfu
Store the refcounted functional unit binding of the operations.
#define register_SHIFT
simple shift register with reset
Data structure used to store the register binding of variables.
Base class for multiplexer into datapath.
void set_top_info(const std::string &id, const technology_managerRef &LM, const std::string &Library="")
Data structure used to store the interconnection binding of datapath elements.
Data structure used to store the schedule of the operations.
unsigned int get_number_of_states() const
Class specification of the data structures used to manage technology information. ...
#define TYPE_EXTERNAL
constant identifying the node type of a EXTERNAL operation (a function call)
redefinition of set to manage ordered/unordered structures
~pipeline_controller() override
Destructor.
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
void set_black_box(bool bb)
Set the black box property associated with the structural_object.
Base class for all register into datapath.
This file contains the structures needed to manage a graph that will represent the state transition g...
void SetParameter(const std::string &name, const std::string &value)
Set a parameter value.
const BehavioralHelperConstRef CGetBehavioralHelper() const
Returns the helper associated with the function.
Classes specification of the tree_node data structures.
static std::string NormalizeTypename(const std::string &id)
Return normalized name of types and variables.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
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...
#define DEBUG_LEVEL_NONE
no debugging print is performed.
const StateTransitionGraphConstRef CGetAstg() const
Returns pointer to state transition graph created.
This file collects some utility functions.
structural_objectRef add_constant(std::string id, structural_objectRef owner, structural_type_descriptorRef type, std::string value, unsigned int treenode=0)
Create a new constant;.
structural_objectRef add_module_from_technology_library(const std::string &id, const std::string &fu_name, const std::string &library_name, const structural_objectRef owner, const technology_managerConstRef TM)
Create a new object starting from a library component.
structural_managerRef controller
Store the controller description.
#define GET_TYPE_SIZE(structural_obj)
Macro returning the size of the type of a structural object.
This class describes all classes used to represent a structural object.
const structural_type_descriptorRef & get_typeRef() const
Return the type descriptor of the structural_object.
Class specification of the tree_reindex support class.
Generic class managing controller creation algorithms.
Header class for the creation of a shift register controlling a pipeline.
Data structure used to store the functional-unit binding of the vertexes.
const OpGraphConstRef CGetOpGraph(FunctionBehavior::graph_type gt) const
This method returns the operation graphs.
hlsRef HLS
HLS data structure of the function to be analyzed.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
It collects all the common strings covering PandA copyrights issues.
Class implementation of the structural_manager.
StateTransitionGraphManagerRef STG
Store the refcounted state transition graph.
int debug_level
The debug level.
Base class for all register into datapath.
#define DEBUG_LEVEL_VERBOSE
verbose debugging print is performed.
Data structure definition for high-level synthesis flow.
conn_bindingRef Rconn
Store the refcounted interconnection of datapath elements.
Class specification of the manager of the tree structures extracted from the raw file.
HLS specialization of generic_device.
A brief description of the C++ Header File.
std::map< vertex, unsigned int > mu_ports
This map put into relation fsm states and alldone multi_unbounded ports.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...