47 #include "config_HAVE_FLOPOCO.hpp" 80 #define PORT_VECTOR_N_PORTS 2 83 const DesignFlowManagerConstRef _design_flow_manager,
87 component(ComputeComponent(_cells)),
88 cells(ComputeCells(_cells))
91 dummy_synthesis(_parameters->IsParameter(
"dummy_synthesis") and
92 _parameters->GetParameter<
std::string>(
"dummy_synthesis") ==
"yes")
122 auto* fu_br = GetPointer<functional_unit>(f_unit_br);
124 auto* op_ASSIGN = GetPointer<operation>(op_br_node);
125 double ASSIGN_exec_time = op_ASSIGN->time_m->get_execution_time();
126 std::vector<unsigned int> bitsizes;
127 bitsizes.push_back(8);
128 bitsizes.push_back(16);
129 bitsizes.push_back(32);
130 bitsizes.push_back(64);
131 const auto b_it_end = bitsizes.end();
132 for(
auto b_it = bitsizes.begin(); b_it != b_it_end; ++b_it)
134 std::string test_mul_mux_name = std::string(
TEST_MUL_MUX_8) +
"_" +
STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
135 STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
136 STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
STR(*b_it) +
"_" +
143 auto* fu_test = GetPointer<functional_unit>(f_unit_test);
145 auto* op_test = GetPointer<operation>(op_test_node);
146 double test_exec_time = op_test->time_m->get_execution_time();
150 auto* fu_mult = GetPointer<functional_unit>(f_unit_mult);
152 auto* op_mult = GetPointer<operation>(op_mult_node);
153 double mult_exec_time = op_mult->time_m->get_execution_time();
157 auto* fu_mux = GetPointer<functional_unit>(f_unit_mux);
159 for(
const auto& op : ops)
161 auto* current_op = GetPointer<operation>(op);
162 if(!current_op->time_m)
166 unsigned int curr_cycles = current_op->time_m->get_cycles();
167 double curr_exec = current_op->time_m->get_execution_time();
168 double new_exec_time = (test_exec_time - mult_exec_time) / 3 + ASSIGN_exec_time;
169 if(new_exec_time > curr_exec)
171 current_op->time_m->set_execution_time(new_exec_time, curr_cycles);
180 auto* fu_br = GetPointer<functional_unit>(f_unit_br);
182 auto* op_br_LOAD = GetPointer<operation>(op_br_node);
183 double ASSIGN_exec_time = op_br_LOAD->time_m->get_execution_time();
190 auto* current_fu = GetPointer<functional_unit>(tn);
193 if((!
parameters->isOption(OPT_component_name) || current_fu->get_operations_num() == 0) &&
199 for(
const auto& op : ops)
201 auto* current_op = GetPointer<operation>(op);
202 if(!current_op->time_m)
206 double curr_exec = current_op->time_m->get_execution_time();
207 unsigned int curr_cycles = current_op->time_m->get_cycles();
208 if(curr_exec - ASSIGN_exec_time < 0)
210 current_op->time_m->set_execution_time(0, curr_cycles);
214 current_op->time_m->set_execution_time(curr_exec - ASSIGN_exec_time, curr_cycles);
222 std::vector<std::string> high_latency_postfix_list;
223 high_latency_postfix_list.push_back(std::string(
"_3"));
224 high_latency_postfix_list.push_back(std::string(
"_4"));
225 for(
const auto& high_latency_postfix : high_latency_postfix_list)
228 auto* fu_br = GetPointer<functional_unit>(f_unit_br);
230 auto* op_br_STORE = GetPointer<operation>(op_br_node);
231 double STORE_exec_time = op_br_STORE->time_m->get_execution_time();
233 auto* fu_br_nn = GetPointer<functional_unit>(f_unit_br_nn);
235 auto* op_br_nn_STORE = GetPointer<operation>(op_br_nn_node);
236 double nn_STORE_exec_time = op_br_nn_STORE->time_m->get_execution_time();
239 auto* fu_br_hl = GetPointer<functional_unit>(f_unit_br_hl);
241 auto* op_br_STORE_hl = GetPointer<operation>(op_br_node_hl);
242 double STORE_exec_time_hl = op_br_STORE_hl->time_m->get_execution_time();
244 auto* fu_br_nn_hl = GetPointer<functional_unit>(f_unit_br_nn_hl);
246 auto* op_br_nn_STORE_hl = GetPointer<operation>(op_br_nn_node_hl);
247 double nn_STORE_exec_time_hl = op_br_nn_STORE_hl->time_m->get_execution_time();
255 auto* current_fu = GetPointer<functional_unit>(tn);
260 std::string fu_name = current_fu->functional_unit_name;
261 std::string memory_ctrl_type = current_fu->memory_ctrl_type;
262 std::string bram_load_latency = current_fu->bram_load_latency;
265 fu_name ==
BMEMORY_STD + (bram_load_latency !=
"2" ? high_latency_postfix :
""))
267 if((!
parameters->isOption(OPT_component_name) || current_fu->get_operations_num() == 0) &&
273 for(
const auto& op : ops)
275 auto* current_op = GetPointer<operation>(op);
276 if(!current_op->time_m)
280 unsigned int curr_cycles = current_op->time_m->get_cycles();
281 if(bram_load_latency ==
"2")
285 current_op->time_m->set_stage_period(STORE_exec_time);
289 current_op->time_m->set_execution_time(STORE_exec_time, curr_cycles);
296 current_op->time_m->set_stage_period(STORE_exec_time_hl);
300 current_op->time_m->set_execution_time(STORE_exec_time_hl, curr_cycles);
307 fu_name ==
BMEMORY_STDN + (bram_load_latency !=
"2" ? high_latency_postfix :
""))
309 if((!
parameters->isOption(OPT_component_name) || current_fu->get_operations_num() == 0) &&
315 for(
const auto& op : ops)
317 auto* current_op = GetPointer<operation>(op);
318 if(!current_op->time_m)
322 unsigned int curr_cycles = current_op->time_m->get_cycles();
323 if(bram_load_latency ==
"2")
327 current_op->time_m->set_stage_period(nn_STORE_exec_time);
331 current_op->time_m->set_execution_time(nn_STORE_exec_time, curr_cycles);
338 current_op->time_m->set_stage_period(nn_STORE_exec_time_hl);
342 current_op->time_m->set_execution_time(nn_STORE_exec_time_hl, curr_cycles);
352 const auto file_name =
GetPath(
"characterization.xml");
364 catch(
const char* msg)
368 catch(
const std::string& msg)
372 catch(
const std::exception& ex)
374 THROW_ERROR(
"Exception caught: " + std::string(ex.what()));
391 for(
const auto& cell :
cells)
393 if(fus.find(cell) == fus.end())
395 THROW_ERROR(cell +
" is not in any technology library");
398 auto* current_fu = GetPointer<functional_unit>(tn);
401 auto* current_fu_temp = GetPointer<functional_unit_template>(tn);
402 if(current_fu_temp->specialized !=
"")
405 current_fu_temp->xwrite(template_el, tn,
parameters);
410 if((!
parameters->isOption(OPT_component_name) || current_fu->get_operations_num() == 0) &&
416 if(!current_fu->area_m)
428 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
430 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::REGISTERS) != 0)
434 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
435 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::REGISTERS)));
437 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::SLICE_LUTS) != 0)
441 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
442 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::SLICE_LUTS)));
444 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::SLICE) != 0)
448 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
449 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::SLICE)));
451 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::LUT_FF_PAIRS) != 0)
455 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
456 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::LUT_FF_PAIRS)));
458 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::DSP) != 0)
462 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
463 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::DSP)));
465 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::BRAM) != 0)
469 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
470 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::BRAM)));
472 if(current_fu->area_m && current_fu->area_m->get_resource_value(area_info::DRAM) != 0)
476 WRITE_XNVM2(
"value_type",
"float64", attribute_el);
477 attribute_el->
add_child_text(
STR(current_fu->area_m->get_resource_value(area_info::DRAM)));
480 if(current_fu->fu_template_name !=
"" && current_fu->fu_template_parameters !=
"")
483 WRITE_XNVM2(
"name", current_fu->fu_template_name, template_el);
484 WRITE_XNVM2(
"parameter", current_fu->fu_template_parameters, template_el);
486 if(current_fu->characterizing_constant_value !=
"")
492 auto characterization_timestamp_el = cell_el->
add_child_element(
"characterization_timestamp");
495 for(
const auto& op : ops)
497 auto* current_op = GetPointer<operation>(op);
500 if(current_fu->CM && current_fu->CM->get_circ() && GetPointer<module>(current_fu->CM->get_circ()) &&
501 GetPointer<module>(current_fu->CM->get_circ())->get_specialized() !=
"")
503 if(current_fu->memory_type !=
"")
508 if(current_fu->channels_type !=
"")
513 if(current_fu->memory_ctrl_type !=
"")
518 if(current_fu->bram_load_latency !=
"")
523 current_fu->CM->xwrite(cell_el);
535 if(GetPointer<port_o>(port)->get_is_doubled())
548 else if(GetPointer<port_o>(port)->get_is_halved())
574 unsigned int bus_addr_bitsize,
unsigned int bus_size_bitsize,
575 unsigned int bus_tag_bitsize,
size_t portsize_value)
582 if(GetPointer<port_o>(port)->get_ports_size() == 0)
584 GetPointer<port_o>(port)->add_n_ports(static_cast<unsigned int>(portsize_value), port);
588 for(
unsigned int p = 0; p < GetPointer<port_o>(port)->get_ports_size(); ++p)
590 resize_port(GetPointer<port_o>(port)->get_port(p), prec);
607 if(GetPointer<port_o>(port)->get_ports_size() == 0)
609 GetPointer<port_o>(port)->add_n_ports(static_cast<unsigned int>(portsize_value), port);
613 for(
unsigned int p = 0; p < GetPointer<port_o>(port)->get_ports_size(); ++p)
615 resize_port(GetPointer<port_o>(port)->get_port(p), prec);
644 register_library, circuit,
TM);
649 register_library, circuit,
TM);
657 GetPointer<module>(reg_mod)->get_out_port(0)->type_resize(
GET_TYPE_SIZE(port_in));
670 SM->
add_connection(GetPointer<module>(reg_mod)->get_in_port(2), r_signal);
673 SM->
add_connection(GetPointer<module>(reg_mod)->get_out_port(0), r_signal);
692 register_library, circuit,
TM);
697 register_library, circuit,
TM);
705 GetPointer<module>(reg_mod)->get_out_port(0)->type_resize(
GET_TYPE_SIZE(port_out));
718 SM->
add_connection(GetPointer<module>(reg_mod)->get_in_port(2), r_signal);
720 SM->
add_connection(GetPointer<module>(reg_mod)->get_out_port(0), r_signal);
731 return "RTLCharacterization";
736 return "RTLCharacterization";
742 switch(relationship_type)
747 const auto* technology_flow_step_factory = GetPointer<const TechnologyFlowStepFactory>(
749 const std::string technology_flow_signature =
753 technology_flow_step ?
754 design_flow_graph->CGetDesignFlowStepInfo(technology_flow_step)->design_flow_step :
756 relationship.insert(technology_design_flow_step);
774 return DesignFlowStepFactoryConstRef();
778 const std::vector<std::string>& portsize_parameters,
const size_t portsize_index,
779 const std::vector<std::string>& pipe_parameters,
const size_t stage_index,
780 const unsigned int constPort,
const bool is_commutative,
size_t max_lut_size)
782 const auto fu_name = fu->
get_name();
786 size_t n_portsize_parameters = portsize_parameters.size();
787 size_t n_pipe_parameters = pipe_parameters.size();
790 unsigned int n_ports = GetPointer<module>(obj)->get_in_port_size();
793 if(constPort < n_ports)
813 "Verilog, VHDL, SystemVerilog or Flopoco description not provided for functional unit " + fu_name);
817 auto top_wrapper_name =
"top" + fu_name +
"_wrapper";
818 boost::replace_all(top_wrapper_name,
"__",
"");
829 auto* spec_module = GetPointer<module>(template_circuit);
833 unsigned int BRAM_BITSIZE = 16;
834 if(BRAM_BITSIZE >
device->get_parameter<
unsigned int>(
"BRAM_bitsize_max"))
836 BRAM_BITSIZE =
device->get_parameter<
unsigned int>(
"BRAM_bitsize_max");
838 unsigned int ALIGNED_BITSIZE = 2 * BRAM_BITSIZE;
839 unsigned int BUS_DATA_BITSIZE = 2 * BRAM_BITSIZE;
840 unsigned int BUS_ADDR_BITSIZE = 15;
841 unsigned int BUS_SIZE_BITSIZE = 7;
842 unsigned int BUS_TAG_BITSIZE = 8;
843 unsigned int NUMBER_OF_BYTES_ALLOCATED = 1024;
846 NUMBER_OF_BYTES_ALLOCATED = NUMBER_OF_BYTES_ALLOCATED / 16;
848 specialize_fu(spec_module, prec, BUS_DATA_BITSIZE, BUS_ADDR_BITSIZE, BUS_SIZE_BITSIZE, BUS_TAG_BITSIZE,
849 n_portsize_parameters > 0 ? static_cast<unsigned>(std::stoul(portsize_parameters[portsize_index])) :
852 if(fu_base_name ==
"MC_FU")
854 spec_module->SetParameter(
"EXECUTION_TIME",
STR(2));
855 spec_module->SetParameter(
"BITSIZE",
STR(8));
856 spec_module->SetParameter(
"INITIATION_TIME",
STR(1));
858 else if(memory_type !=
"")
860 unsigned int base_address = 0;
861 std::string init_filename =
"array_ref_" +
STR(base_address) +
".mem";
863 unsigned int nbyte_on_memory = BRAM_BITSIZE / 8;
864 unsigned int elts_size = BUS_DATA_BITSIZE;
865 unsigned int vec_size = NUMBER_OF_BYTES_ALLOCATED / (elts_size / 8);
868 BRAM_BITSIZE = elts_size;
869 nbyte_on_memory = elts_size / 8;
874 BRAM_BITSIZE = elts_size;
875 nbyte_on_memory = elts_size / 8;
882 std::ofstream init_file_a(
GetPath(
"a_" + init_filename));
883 std::ofstream init_file_b(
GetPath(
"b_" + init_filename));
885 for(
unsigned int i = 0; i < vec_size; ++i)
887 for(
unsigned int j = 0; j < BRAM_BITSIZE; ++j)
889 long int random_value = random();
890 std::string bit_val = (random_value & 1) == 0 ?
"0" :
"1";
893 init_file_a << bit_val;
897 init_file_b << bit_val;
900 if(counter % (nbyte_on_memory * 8) == 0)
904 init_file_a << std::endl;
908 init_file_b << std::endl;
919 std::ofstream init_file(
GetPath(init_filename));
920 for(
unsigned int i = 0; i < vec_size; ++i)
922 for(
unsigned int j = 0; j < elts_size; ++j)
924 long int random_value = random();
925 std::string bit_val = (random_value & 1) == 0 ?
"0" :
"1";
926 init_file << bit_val;
928 if(counter % (nbyte_on_memory * 8) == 0)
930 init_file << std::endl;
936 spec_module->SetParameter(
"address_space_begin",
STR(base_address));
937 spec_module->SetParameter(
"address_space_rangesize",
STR((elts_size / 8) * vec_size));
938 spec_module->SetParameter(
"USE_SPARSE_MEMORY",
"1");
944 spec_module->SetParameter(
"MEMORY_INIT_file_a",
"\"\"" +
GetPath(
"a_" + init_filename) +
"\"\"");
945 spec_module->SetParameter(
"MEMORY_INIT_file_b",
"\"\"" +
GetPath(
"b_" + init_filename) +
"\"\"");
949 spec_module->SetParameter(
"MEMORY_INIT_file",
"\"\"" +
GetPath(init_filename) +
"\"\"");
951 spec_module->SetParameter(
"n_elements",
STR(vec_size));
952 spec_module->SetParameter(
"data_size",
STR(elts_size));
956 spec_module->SetParameter(
"BRAM_BITSIZE",
STR(BRAM_BITSIZE));
958 spec_module->SetParameter(
"BUS_PIPELINED",
"1");
959 spec_module->SetParameter(
"PRIVATE_MEMORY",
"0");
963 spec_module->SetParameter(
"base_address",
"8");
967 spec_module->SetParameter(
"base_address",
"8");
971 if(n_pipe_parameters > 0)
978 std::vector<std::string>
params;
980 for(
const auto&
param : params)
982 if(
param ==
"PRECISION")
984 unsigned int precision_bitsize = prec;
985 precision_bitsize =
std::max(8u, precision_bitsize);
986 spec_module->SetParameter(
"PRECISION",
STR(precision_bitsize));
988 else if(
param ==
"ALIGNED_BITSIZE")
990 spec_module->SetParameter(
"ALIGNED_BITSIZE",
STR(ALIGNED_BITSIZE));
992 else if(
param ==
"LSB_PARAMETER")
994 spec_module->SetParameter(
"LSB_PARAMETER",
STR(0));
998 spec_module->ExistsParameter(
param),
999 "parameter not yet specialized: " +
param +
" for module " +
1000 spec_module->get_typeRef()->get_name());
1006 one_port = SM->
add_constant(fu_name +
"_constant_" +
STR(1), circuit, bool_type,
STR(1));
1011 for(
unsigned int i = 0; i < spec_module->get_in_port_size(); i++)
1017 SM->
add_port(GetPointer<port_o>(port_in)->get_id(), port_o::IN, circuit, port_in->
get_typeRef());
1023 SM->
add_port(GetPointer<port_o>(port_in)->get_id(), port_o::IN, circuit, port_in->
get_typeRef());
1028 e_port = SM->
add_port(GetPointer<port_o>(port_in)->get_id(), port_o::IN, circuit, port_in->
get_typeRef());
1041 for(
unsigned int i = 0; i < spec_module->get_in_port_size(); i++)
1055 else if(fu_base_name ==
LUT_EXPR_STD && i > max_lut_size)
1060 else if(isTemplate && i == constPort)
1071 for(
unsigned int p = 0; p < GetPointer<port_o>(port_in)->get_ports_size(); ++p)
1074 STR(BUS_DATA_BITSIZE));
1075 SM->
add_connection(GetPointer<port_o>(port_in)->get_port(p), e_port);
1088 e_port = SM->
add_port_vector(GetPointer<port_o>(port_in)->get_id(), port_o::IN,
1089 GetPointer<port_o>(port_in)->get_ports_size(), circuit,
1090 GetPointer<port_o>(port_in)->get_port(0)->get_typeRef());
1095 SM->
add_port(GetPointer<port_o>(port_in)->get_id(), port_o::IN, circuit, port_in->
get_typeRef());
1097 std::string port_prefix = GetPointer<port_o>(port_in)->get_id();
1102 for(
unsigned int p = 0; p < GetPointer<port_o>(port_in)->get_ports_size(); ++p)
1105 port_prefix + GetPointer<port_o>(port_in)->get_port(p)->get_id(), reset_port,
1106 circuit, clock_port, GetPointer<port_o>(e_port)->get_port(p), SM);
1111 add_input_register(port_in, register_library, port_prefix, reset_port, circuit, clock_port, e_port, SM);
1117 bool is_doubled_out =
false;
1118 bool is_halved_out =
false;
1120 for(
unsigned int i = 0; i < spec_module->get_out_port_size(); i++)
1124 if(GetPointer<port_o>(port_out)->get_is_doubled())
1126 is_doubled_out =
true;
1128 else if(GetPointer<port_o>(port_out)->get_is_halved())
1130 is_halved_out =
true;
1135 e_port = SM->
add_port_vector(GetPointer<port_o>(port_out)->get_id(), port_o::OUT,
1136 GetPointer<port_o>(port_out)->get_ports_size(), circuit,
1137 GetPointer<port_o>(port_out)->get_port(0)->get_typeRef());
1142 SM->
add_port(GetPointer<port_o>(port_out)->get_id(), port_o::OUT, circuit, port_out->
get_typeRef());
1144 std::string port_prefix = GetPointer<port_o>(port_out)->get_id();
1149 for(
unsigned int p = 0; p < GetPointer<port_o>(port_out)->get_ports_size(); ++p)
1152 GetPointer<port_o>(port_out)->get_port(p),
1153 port_prefix + GetPointer<port_o>(port_out)->get_port(p)->get_id(), clock_port,
1159 add_output_register(SM, e_port, circuit, reset_port, port_out, port_prefix, clock_port, register_library);
1165 std::list<std::string> hdl_files, aux_files;
1166 std::list<structural_objectRef> circuits;
1167 circuits.push_back(circuit);
1168 HDL->hdl_gen(fu_name, circuits, hdl_files, aux_files,
false);
1169 int PipelineDepth = -1;
1172 HDL->get_flopocowrapper())
1176 PipelineDepth =
static_cast<int>(HDL->get_flopocowrapper()->get_FUPipelineDepth(
1177 fu_base_name, prec, 2 * prec, pipe_parameters[stage_index]));
1179 else if(is_halved_out)
1181 PipelineDepth =
static_cast<int>(HDL->get_flopocowrapper()->get_FUPipelineDepth(
1182 fu_base_name, prec, prec / 2, pipe_parameters[stage_index]));
1186 PipelineDepth =
static_cast<int>(
1187 HDL->get_flopocowrapper()->get_FUPipelineDepth(fu_base_name, prec, prec, pipe_parameters[stage_index]));
1221 for(
const auto& op : ops)
1223 auto* new_op = GetPointer<operation>(op);
1226 if(not dummy_synthesis)
1243 synthesis_results->set_execution_time(7.75);
1246 double exec_time = 0.0;
1247 if(synthesis_results)
1249 exec_time = synthesis_results->get_execution_time();
1257 if(n_pipe_parameters > 0)
1262 new_op->time_m->set_initiation_time(ii_default);
1264 unsigned int n_cycles;
1265 n_cycles =
static_cast<unsigned>(std::stoul(pipe_parameters[stage_index]));
1266 new_op->pipe_parameters = pipe_parameters[stage_index];
1268 if(n_cycles > 0 && PipelineDepth != 0)
1270 new_op->time_m->set_stage_period(exec_time);
1271 const ControlStep ii(1u);
1272 new_op->time_m->set_initiation_time(ii);
1273 if(PipelineDepth == -1)
1275 new_op->time_m->set_execution_time(exec_time, n_cycles + 1);
1279 new_op->time_m->set_execution_time(exec_time, static_cast<unsigned int>(PipelineDepth) + 1);
1282 else if(PipelineDepth == 0)
1284 new_op->time_m->set_execution_time(exec_time);
1288 new_op->time_m->set_execution_time(exec_time, n_cycles);
1291 else if(new_op->time_m->get_cycles() == 0)
1297 new_op->time_m->set_stage_period(exec_time);
1302 if(not dummy_synthesis)
1325 std::vector<std::string> component_cell =
SplitString(input,
",");
1327 std::vector<std::string> component_or_cell =
SplitString(component_cell[0],
"-");
1328 THROW_ASSERT(component_or_cell.size() == 2, component_or_cell[0]);
1329 return component_or_cell[0];
1335 std::vector<std::string> component_cells =
SplitString(input,
",");
1336 for(
const auto& component_cell : component_cells)
1338 std::vector<std::string> component_or_cell =
SplitString(component_cell,
"-");
1340 THROW_ASSERT(component_or_cell.size() == 2, component_cell);
1342 ret.insert(component_or_cell[1]);
Input function used to read the technology data structures.
void add_connection(structural_objectRef src, structural_objectRef dest)
Create a connection between a source structural object and a destination structural object...
#define MEMORY_CTRL_TYPE_DPROXY
#define CHANNELS_TYPE_MEM_ACC_N1
#define register_AR_NORETIME_INT
void ComputeRelationships(DesignFlowStepSet &relationship, const DesignFlowStep::RelationshipType relationship_type) override
Compute the relationships of a step with other steps.
Collect information about resource area.
const fu_map_type & get_library_fu() const
Return the list of the resources contained into the given library.
refcount< structural_type_descriptor > structural_type_descriptorRef
RefCount type definition of the structural_type_descriptor class structure.
#define register_AR_NORETIME_UINT
#define CHANNELS_TYPE_MEM_ACC_NN
technology_nodeRef get_fu(const std::string &fu_name, const std::string &Library) const
Return the reference to a component given its name.
void resize_port(const structural_objectRef &port, unsigned int prec)
resize the port w.r.t a given precision
Structure representing the most relevant information about the type of a structural object...
const std::string & get_id() const
Return the identifier associated with the structural_object.
void xwrite_characterization(xml_element *nodeRoot)
Add the characterization to the output file.
#define GET_CLASS(obj)
Macro returning the actual type of an object.
std::string fu_template_parameters
Template parameters.
void add_output_register(structural_managerRef SM, structural_objectRef e_port, structural_objectRef circuit, structural_objectRef reset_port, structural_objectRef port_out, const std::string &port_prefix, structural_objectRef clock_port, const std::string ®ister_library)
const structural_objectRef get_circ() const
Get a reference to circ field.
const int output_level
The output level.
const std::vector< std::string > SplitString(const std::string &input, const std::string &separators)
Function which splits a string into tokens.
std::string fu_template_name
Name of the template.
technology_nodeRef get_fu(const std::string &name) const
DesignFlowStep_Status Exec() override
Perform RTL characterization of the modules with respect to the target device.
unsigned int get_out_port_size() const
Return the number of output ports.
RelationshipType
The relationship type.
DesignFlowStepFactoryConstRef CGetDesignFlowStepFactory() const override
Return the factory to create this type of steps.
Source must be executed to satisfy target.
area_infoRef prev_area_characterization
The area model of the last characterization.
The base class for design step.
std::string functional_unit_name
name of the functional unit.
void add_input_register(structural_objectRef port_in, const std::string ®ister_library, const std::string &port_prefix, structural_objectRef reset_port, structural_objectRef circuit, structural_objectRef clock_port, structural_objectRef e_port, structural_managerRef SM)
This class manages the circuit structures.
refcount< area_info > area_infoRef
refcount definition of the class
Collect information about resource performance.
const structural_objectRef get_in_port(unsigned int n) const
Return the ith input port.
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...
Definition of hash function for EdgeDescriptor.
const std::string & get_name() const override
Return the name of the operation.
#define MEMORY_TYPE_SYNCHRONOUS_SDS_BUS
#define LIBRARY_STD_FU
standard library where all standard HLS resources are defined
xml_text_node * add_child_text(const std::string &content)
Append a new text node.
Class specification of the manager of the technology library data structures.
std::string characterizing_constant_value
Value used during the characterization of this instance.
This class specifies the characteristic of a particular functional unit.
const CustomSet< std::string > cells
The cells to be characterized.
#define MEMORY_TYPE_ASYNCHRONOUS
#define MEMORY_CTRL_TYPE_PROXY
std::string channels_type
Specify the type of the channel the functional unit is compliant with.
#define STR(s)
Macro which performs a lexical_cast to a string.
Auxiliary methods for manipulating string.
#define MEMORY_CTRL_TYPE_SPROXY
s_type type
The type of the port or the signal.
#define CLOCK_PORT_NAME
standard name for ports
static std::string GetCurrentTimeStamp()
Return a timestamp of the current time.
#define MEMORY_TYPE_SYNCHRONOUS_UNALIGNED
time_infoRef prev_timing_characterization
The time model of the last characterization.
const CustomSet< std::string > ComputeCells(const std::string &input) const
Extract the cell lists.
#define THROW_UNREACHABLE(str_expr)
helper function used to specify that some points should never be reached
virtual std::string GenerateSynthesisScripts(const std::string &fu_name, const structural_managerRef SM, const std::list< std::string > &hdl_files, const std::list< std::string > &aux_files)
Generates the synthesis scripts for the specified design.
unsigned int has_first_synthesis_id
The id of the first analyzed cell of a sequence of cells which differ for the position of the constan...
area_infoRef area_m
This variable stores the resource information of the component.
void fix_proxies_execution_time_std()
Fix execution/stage period value for proxies and bounded memory controllers.
void set_top_info(const std::string &id, const technology_managerRef &LM, const std::string &Library="")
CustomOrderedSet< std::string > completed
set of units completed with success
static const double stage_period_DEFAULT
zero means that the operation last in ceil(execution_time/clock_period)
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
Class specification of the data structures used to manage technology information. ...
RTLCharacterization(const generic_deviceRef _device, const std::string &_cells, const DesignFlowManagerConstRef design_flow_manager, const ParameterConstRef parameters)
Constructor.
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.
static bool resize_if_busport(unsigned long long bus_size_bitsize, unsigned long long bus_addr_bitsize, unsigned long long bus_data_bitsize, unsigned long long bus_tag_bitsize, structural_objectRef port)
auxiliary function used to resize the bus ports with respect to their associated bus size ...
const structural_objectRef get_out_port(unsigned int n) const
Return the ith output port.
Classes to describe design flow graph.
#define PORT_VECTOR_N_PORTS
Autoheader includes.
Target must be reexecuted.
void write_to_file_formatted(const std::filesystem::path &filename)
Write the document to a file.
static const std::string ComputeSignature(const TechnologyFlowStep_Type technology_flow_step_type)
Compute the signature of a technology flow step.
static const unsigned int cycles_time_DEFAULT
zero means that the operation is not pipelined
#define ARRAY_1D_STD_BRAM_NN
#define LIBRARY_STD
standard library where all built-in ports are defined.
xml_element * create_root_node(const std::string &_name)
Creates the root node.
#define ARRAY_1D_STD_BRAM
refcount< HDL_manager > HDL_managerRef
refcount definition of the class
Factory for technology flow step.
const operation_vec & get_operations() const
Return the operations that the functional unit can handle.
#define MEMORY_TYPE_SYNCHRONOUS_SDS
boost::graph_traits< graph >::vertex_descriptor vertex
vertex definition.
utility function used to read files.
const std::string component
The component to be characterized.
const Wrefcount< const DesignFlowManager > design_flow_manager
The design flow manager.
refcount< HLS_manager > HLS_managerRef
refcount definition of the class
static BackendFlowRef CreateFlow(const ParameterConstRef Param, const std::string &flow_name, const generic_deviceRef _device)
Creates the flow specification based on the given parameters.
virtual void ExecuteSynthesis()
Executes the synthesis with the implemented flow.
void SetParameter(const std::string &name, const std::string &value)
Set a parameter value.
#define LIBRARY_PC
standard library for parallel controller
#define register_AR_NORETIME
register with asynchronous reset no retime
virtual enum so_kind get_kind() const =0
Virtual function used to find the real type of a structural_object instance.
Class for performing RTL characterization.
const ParameterConstRef parameters
Set of input parameters.
DesignFlowStep_Status
The status of a step.
#define GET_CLASS_NAME(meth)
Macro returning the name of a class.
#define THROW_ERROR(str_expr)
helper function used to throw an error in a standard way
refcount< structural_manager > structural_managerRef
RefCount type definition of the structural_manager class structure.
void type_resize(unsigned long long new_bit_size)
Just resize the size of the bits of the object.
static const double execution_time_DEFAULT
bool HasToBeExecuted() const override
Check if this step has actually to be executed.
void fix_execution_time_std()
Fix the execution time by removing set/hold/pad timings.
#define MEMORY_CTRL_TYPE_PROXYN
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.
static const ControlStep initiation_time_DEFAULT
std::map< std::string, technology_nodeRef > fu_map_type
typedef for the identification of the functional units contained into the library ...
#define WRITE_XNVM2(name, value, node)
WRITE XML Name Value Macro second version. Insert a value in an XML tree given the name of the attrib...
unsigned int get_in_port_size() const
Return the number of input ports.
This file contains the definition of the configurable flow for generating and executing synthesis scr...
void fix_muxes()
fix the estimation of mux timing
const technology_managerRef TM
Technology manager.
#define GET_TYPE_SIZE(structural_obj)
Macro returning the size of the type of a structural object.
refcount< T > lock() const
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 area_infoRef factory(const ParameterConstRef &Param)
Factory method.
library_managerRef LM
Library manager.
std::string GetPath(std::filesystem::path path)
#define register_AR_NORETIME_REAL
#define ASSIGN
constant string identifying the operation performed by an assignment.
~RTLCharacterization() override
Destructor.
static structural_objectRef add_sign(std::string id, structural_objectRef owner, structural_type_descriptorRef sign_type, unsigned int treenode=0)
Create a new signal.
#define MEMORY_CTRL_TYPE_DPROXYN
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
std::string GetName() const override
Return the name of this design step.
Data structures used in operations graph.
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
const bool dummy_synthesis
True if we are performing dummy synthesis.
std::string memory_type
Specify the type of memory the functional unit is compliant with.
const generic_deviceRef device
device information
std::string GetSignature() const override
Return a unified identifier of this design step.
#define MEMORY_CTRL_TYPE_SPROXYN
this class is used to manage the command-line or XML options.
Wrapper to FloPoCo for VHDL code generation.
#define ASSIGN_VECTOR_BOOL_STD
Some macro used to interface with the XML library.
Not parsed functionality manager.
virtual void AnalyzeFu(const technology_nodeRef f_unit)
Analyze all the cells built starting from a template.
void specialize_fu(const module *mod, unsigned int prec, unsigned int bus_data_bitsize, unsigned int bus_addr_bitsize, unsigned int bus_size_bitsize, unsigned int bus_tag_bitsize, size_t portsize_value)
Performing the specialization of the given object.
refcount< time_info > time_infoRef
refcount definition of the class
Class implementation of the structural_manager.
time_infoRef get_timing_results() const
Returns the timing information.
unsigned counter[N_THREADS]
Generic device description.
std::string get_library_name() const
void AnalyzeCell(functional_unit *fu, const unsigned int prec, const std::vector< std::string > &portsize_parameters, const size_t portsize_index, const std::vector< std::string > &pipe_parameters, const size_t stage_index, const unsigned int constPort, const bool is_commutative, size_t max_lut_size) override
Analyze the single cell.
Class specification of the manager for each library.
static void resize_std_port(unsigned long long bitsize_variable, unsigned long long n_elements, int debug_level, structural_objectRef port)
auxiliary function used to resize the standard ports
void xwrite_device_file()
Generate the output file.
int debug_level
The debug level.
#define CHANNELS_TYPE_MEM_ACC_11
This class writes different HDL based descriptions (VHDL, Verilog, SystemC) starting from a structura...
#define PRINT_OUT_MEX(profLevel, curprofLevel, mex)
#define OUTPUT_LEVEL_VERBOSE
verbose debugging print is performed.
std::vector< technology_nodeRef > operation_vec
Type definition of a vector of functional_unit.
bool exist_NP_functionality(NP_functionaly_type type) const
Return true in case there exist a functionaly of the given type.
void Initialize() override
Initialize the step (i.e., like a constructor, but executed just before exec.
area_infoRef get_used_resources() const
Returns the list of used resources.
This class describes a generic module.
static structural_objectRef add_port_vector(std::string id, port_o::port_direction pdir, unsigned int n_ports, structural_objectRef owner, structural_type_descriptorRef type_descr, unsigned int treenode=0)
Create a new port_vector.
static time_infoRef factory(const ParameterConstRef Param)
xml_element * add_child_element(const std::string &name)
Add a child element to this node.
const std::string ComputeComponent(const std::string &input) const
Extract the component name from list of cells.
library_managerRef get_library_manager(const std::string &Name) const
Return the library data structure corresponding to the given library id.
Base class for technology flow steps.
std::string get_library(const std::string &Name) const
Return the higher priority library where the given component is stored.
void get_library_parameters(std::vector< std::string > ¶meters) const
fill a vector with the library parameters in case it there exists a LIBRARY based description...
Step which loads device dependent technology information.
#define THROW_ASSERT(cond, str_expr)
helper function used to check an assert and if needed to throw an error in a standard way ...