55 const DesignFlowManagerConstRef _design_flow_manager,
57 :
top_entity(_parameters, _HLSMgr, _funId, _design_flow_manager, _hls_flow_step_type)
66 auto omp_functions = GetPointer<OmpFunctions>(
HLSMgr->Rfuns);
68 if(omp_functions->kernel_functions.find(
funId) != omp_functions->kernel_functions.end())
74 if(omp_functions->kernel_functions.find(
funId) != omp_functions->kernel_functions.end())
81 if(omp_functions->parallelized_functions.find(
funId) != omp_functions->parallelized_functions.end())
85 if(omp_functions->atomic_functions.find(
funId) != omp_functions->atomic_functions.end())
111 auto num_slots =
ceil_log2(
parameters->getOption<
unsigned long long int>(OPT_context_switch));
126 if(selector_regFile_sign)
142 auto num_slots =
ceil_log2(
parameters->getOption<
unsigned long long int>(OPT_context_switch));
154 if(not selector_regFile_sign)
188 GetPointer<module>(datapath_circuit)->SetParameter(
"KERN_NUM",
"KERN_NUM");
190 GetPointer<module>(circuit)->AddParameter(
"KERN_NUM",
"0");
199 auto TM =
HLS->
HLS_D->get_technology_manager();
200 auto register_library = TM->get_library(
"register_file");
201 auto register_file_module =
203 auto cs_number =
HLS->
Param->getOption<
unsigned int>(OPT_context_switch);
204 GetPointer<module>(register_file_module)->SetParameter(
"n_elements",
STR(cs_number));
206 GetPointer<module>(register_file_module)->get_in_port(1)->type_resize(
GET_TYPE_SIZE(port_in));
209 GetPointer<module>(register_file_module)->get_out_port(0)->type_resize(
GET_TYPE_SIZE(port_in));
217 auto rf_we_port = GetPointer<module>(register_file_module)->get_in_port(2);
222 auto register_file_selector_port =
224 auto rf_register_file_selector_port = GetPointer<module>(register_file_module)->get_in_port(3);
225 const auto sel_bits =
ceil_log2(cs_number);
226 rf_register_file_selector_port->type_resize(sel_bits);
229 if(not register_file_selector_signal)
231 register_file_selector_signal =
234 SM->
add_connection(register_file_selector_signal, rf_register_file_selector_port);
237 auto external_port_to_register =
SM->
add_sign(port_prefix +
"_to_reg", circuit, port_in->
get_typeRef());
239 SM->
add_connection(GetPointer<module>(register_file_module)->get_in_port(1), external_port_to_register);
242 auto register_to_internal_port =
SM->
add_sign(
243 port_prefix +
"_from_reg", circuit, GetPointer<module>(register_file_module)->get_out_port(0)->get_typeRef());
244 SM->
add_connection(GetPointer<module>(register_file_module)->get_out_port(0), register_to_internal_port);
void add_connection(structural_objectRef src, structural_objectRef dest)
Create a connection between a source structural object and a destination structural object...
structural_managerRef SM
reference to the resulting circuit
#define DEBUG_LEVEL_VERY_PEDANTIC
extremely verbose debugging print is performed.
const HLS_managerRef HLSMgr
information about all the HLS synthesis
Data structure representing the entire HLS information.
#define INDENT_DBG_MEX(dbgLevel, curDbgLevel, mex)
We are producing a debug version of the program, so the message is printed;.
DesignFlowStep_Status InternalExec() override
Execute the step.
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.
structural_managerRef datapath
Store the datapath description.
Structure representing the most relevant information about the type of a structural object...
const ParameterConstRef Param
class containing all the parameters
#define GET_CLASS(obj)
Macro returning the actual type of an object.
const structural_objectRef get_circ() const
Get a reference to circ field.
mathematical utility function not provided by standard libraries
const unsigned int funId
identifier of the function to be processed (0 means that it is a global step)
const HLS_deviceRef HLS_D
reference to the information representing the target for the synthesis
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.
#define STR(s)
Macro which performs a lexical_cast to a string.
virtual void AddParameter(const std::string &name, const std::string &default_value)
Add a parameter.
#define CLOCK_PORT_NAME
standard name for ports
bool registered_inputs
true when the module has registered inputs
T ceil_log2(T x)
Return the smallest n such that 2**n >= X.
static void add_NP_functionality(structural_objectRef cir, NP_functionality::NP_functionaly_type dt, std::string functionality_description)
Add a not-parsed functionality.
static structural_objectRef add_port(const std::string &id, port_o::port_direction pdir, structural_objectRef owner, structural_type_descriptorRef type_descr, unsigned int treenode=0)
Create a new port.
void add_context_switch_port_kernel()
void add_context_switch_port()
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
DesignFlowStep_Status InternalExec() override
Add selector and suspension.
This file collects some utility functions and macros.
void add_input_register(structural_objectRef port_in, const std::string &port_prefix, structural_objectRef circuit, structural_objectRef clock_port, structural_objectRef reset_port, structural_objectRef e_port) override
Add the register file to store input parameters.
top_entity_cs(const ParameterConstRef _parameters, const HLS_managerRef HLSMgr, unsigned int funId, const DesignFlowManagerConstRef design_flow_manager, const HLSFlowStep_Type _hls_flow_step_type=HLSFlowStep_Type::TOP_ENTITY_CS_CREATION)
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.
static structural_objectRef add_sign(std::string id, structural_objectRef owner, structural_type_descriptorRef sign_type, unsigned int treenode=0)
Create a new signal.
hlsRef HLS
HLS data structure of the function to be analyzed.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
~top_entity_cs() override
Destructor.
#define SELECTOR_REGISTER_FILE
Class implementation of the structural_manager.
int debug_level
The debug level.
Datastructure to describe functions allocation in high-level synthesis.
Data structure definition for high-level synthesis flow.
HLS specialization of generic_device.