diff --git a/openfpga/src/annotation/annotate_pb_graph.cpp b/openfpga/src/annotation/annotate_pb_graph.cpp index 2043c2098..bf93cf28e 100644 --- a/openfpga/src/annotation/annotate_pb_graph.cpp +++ b/openfpga/src/annotation/annotate_pb_graph.cpp @@ -28,7 +28,7 @@ namespace openfpga { *******************************************************************/ static void rec_build_vpr_pb_graph_interconnect_physical_type_annotation(t_pb_graph_node* pb_graph_node, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Skip the root node because we start from the inputs of child pb_graph node * @@ -45,7 +45,7 @@ void rec_build_vpr_pb_graph_interconnect_physical_type_annotation(t_pb_graph_nod */ if (false == pb_graph_node->is_root()) { /* We only care the physical modes! But we have to find it through the parent node */ - t_mode* child_physical_mode = vpr_pb_type_annotation.physical_mode(pb_graph_node->parent_pb_graph_node->pb_type); + t_mode* child_physical_mode = vpr_device_annotation.physical_mode(pb_graph_node->parent_pb_graph_node->pb_type); VTR_ASSERT(nullptr != child_physical_mode); std::map interc_num_inputs; @@ -83,14 +83,14 @@ void rec_build_vpr_pb_graph_interconnect_physical_type_annotation(t_pb_graph_nod } e_interconnect interc_physical_type = pb_interconnect_physical_type(interc, interc_num_inputs[interc]); - if (interc_physical_type == vpr_pb_type_annotation.interconnect_physical_type(interc)) { + if (interc_physical_type == vpr_device_annotation.interconnect_physical_type(interc)) { /* Skip annotation if we have already done! */ continue; } VTR_LOGV(verbose_output, "Infer physical type '%s' of interconnect '%s' (was '%s')\n", INTERCONNECT_TYPE_STRING[interc_physical_type], interc->name, INTERCONNECT_TYPE_STRING[interc->type]); - vpr_pb_type_annotation.add_interconnect_physical_type(interc, interc_physical_type); + vpr_device_annotation.add_interconnect_physical_type(interc, interc_physical_type); } } @@ -100,13 +100,13 @@ void rec_build_vpr_pb_graph_interconnect_physical_type_annotation(t_pb_graph_nod } /* Recursively visit all the child pb_graph_nodes */ - t_mode* physical_mode = vpr_pb_type_annotation.physical_mode(pb_graph_node->pb_type); + t_mode* physical_mode = vpr_device_annotation.physical_mode(pb_graph_node->pb_type); VTR_ASSERT(nullptr != physical_mode); for (int ipb = 0; ipb < physical_mode->num_pb_type_children; ++ipb) { /* Each child may exist multiple times in the hierarchy*/ for (int jpb = 0; jpb < physical_mode->pb_type_children[ipb].num_pb; ++jpb) { rec_build_vpr_pb_graph_interconnect_physical_type_annotation(&(pb_graph_node->child_pb_graph_nodes[physical_mode->index][ipb][jpb]), - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); } } @@ -122,14 +122,14 @@ void rec_build_vpr_pb_graph_interconnect_physical_type_annotation(t_pb_graph_nod * build_vpr_physical_pb_mode_implicit_annotation() *******************************************************************/ void annotate_pb_graph_interconnect_physical_type(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { /* By pass nullptr for pb_graph head */ if (nullptr == lb_type.pb_graph_head) { continue; } - rec_build_vpr_pb_graph_interconnect_physical_type_annotation(lb_type.pb_graph_head, vpr_pb_type_annotation, verbose_output); + rec_build_vpr_pb_graph_interconnect_physical_type_annotation(lb_type.pb_graph_head, vpr_device_annotation, verbose_output); } } @@ -143,7 +143,7 @@ void annotate_pb_graph_interconnect_physical_type(const DeviceContext& vpr_devic *******************************************************************/ static void rec_build_vpr_primitive_pb_graph_node_unique_index(t_pb_graph_node* pb_graph_node, - VprPbTypeAnnotation& vpr_pb_type_annotation) { + VprDeviceAnnotation& vpr_device_annotation) { /* Go recursive first until we touch the primitive node */ if (false == is_primitive_pb_type(pb_graph_node->pb_type)) { for (int imode = 0; imode < pb_graph_node->pb_type->num_modes; ++imode) { @@ -151,7 +151,7 @@ void rec_build_vpr_primitive_pb_graph_node_unique_index(t_pb_graph_node* pb_grap /* Each child may exist multiple times in the hierarchy*/ for (int jpb = 0; jpb < pb_graph_node->pb_type->modes[imode].pb_type_children[ipb].num_pb; ++jpb) { rec_build_vpr_primitive_pb_graph_node_unique_index(&(pb_graph_node->child_pb_graph_nodes[imode][ipb][jpb]), - vpr_pb_type_annotation); + vpr_device_annotation); } } } @@ -159,7 +159,7 @@ void rec_build_vpr_primitive_pb_graph_node_unique_index(t_pb_graph_node* pb_grap } /* Give a unique index to the pb_graph_node */ - vpr_pb_type_annotation.add_pb_graph_node_unique_index(pb_graph_node); + vpr_device_annotation.add_pb_graph_node_unique_index(pb_graph_node); } /******************************************************************** @@ -178,13 +178,13 @@ void rec_build_vpr_primitive_pb_graph_node_unique_index(t_pb_graph_node* pb_grap *******************************************************************/ static void annotate_primitive_pb_graph_node_unique_index(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation) { + VprDeviceAnnotation& vpr_device_annotation) { for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { /* By pass nullptr for pb_graph head */ if (nullptr == lb_type.pb_graph_head) { continue; } - rec_build_vpr_primitive_pb_graph_node_unique_index(lb_type.pb_graph_head, vpr_pb_type_annotation); + rec_build_vpr_primitive_pb_graph_node_unique_index(lb_type.pb_graph_head, vpr_device_annotation); } } @@ -196,9 +196,9 @@ void annotate_primitive_pb_graph_node_unique_index(const DeviceContext& vpr_devi static bool try_match_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, t_pb_graph_pin* physical_pb_graph_pin, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { + const VprDeviceAnnotation& vpr_device_annotation) { /* If the parent ports of the two pins are not paired, fail */ - if (physical_pb_graph_pin->port != vpr_pb_type_annotation.physical_pb_port(operating_pb_graph_pin->port)) { + if (physical_pb_graph_pin->port != vpr_device_annotation.physical_pb_port(operating_pb_graph_pin->port)) { return false; } /* Check the pin number of physical pb_graph_pin matches the pin number of @@ -217,8 +217,8 @@ bool try_match_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, * by the pin rotate offset value * The accumulated offset will be reset to 0 when it exceeds the msb() of the physical port */ - int acc_offset = vpr_pb_type_annotation.physical_pb_pin_offset(operating_pb_graph_pin->port); - const BasicPort& physical_port_range = vpr_pb_type_annotation.physical_pb_port_range(operating_pb_graph_pin->port); + int acc_offset = vpr_device_annotation.physical_pb_pin_offset(operating_pb_graph_pin->port); + const BasicPort& physical_port_range = vpr_device_annotation.physical_pb_port_range(operating_pb_graph_pin->port); if (physical_pb_graph_pin->pin_number != operating_pb_graph_pin->pin_number + (int)physical_port_range.get_lsb() + acc_offset) { @@ -250,12 +250,12 @@ void print_success_bind_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, /******************************************************************** * Bind a pb_graph_pin from an operating pb_graph_node to * a pb_graph_pin from a physical pb_graph_node - * - the name matching rules are already defined in the vpr_pb_type_annotation + * - the name matching rules are already defined in the vpr_device_annotation *******************************************************************/ static void annotate_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, t_pb_graph_node* physical_pb_graph_node, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Iterate over every port and pin of the operating pb_graph_node * and find the physical pins @@ -264,15 +264,15 @@ void annotate_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, for (int ipin = 0; ipin < physical_pb_graph_node->num_input_pins[iport]; ++ipin) { if (false == try_match_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->input_pins[iport][ipin]), - vpr_pb_type_annotation)) { + vpr_device_annotation)) { continue; } /* Reach here, it means the pins are matched by the annotation requirements * We can pair the pin and return */ - vpr_pb_type_annotation.add_physical_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->input_pins[iport][ipin])); + vpr_device_annotation.add_physical_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->input_pins[iport][ipin])); if (true == verbose_output) { - print_success_bind_pb_graph_pin(operating_pb_graph_pin, vpr_pb_type_annotation.physical_pb_graph_pin(operating_pb_graph_pin)); + print_success_bind_pb_graph_pin(operating_pb_graph_pin, vpr_device_annotation.physical_pb_graph_pin(operating_pb_graph_pin)); } return; } @@ -282,15 +282,15 @@ void annotate_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, for (int ipin = 0; ipin < physical_pb_graph_node->num_output_pins[iport]; ++ipin) { if (false == try_match_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->output_pins[iport][ipin]), - vpr_pb_type_annotation)) { + vpr_device_annotation)) { continue; } /* Reach here, it means the pins are matched by the annotation requirements * We can pair the pin and return */ - vpr_pb_type_annotation.add_physical_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->output_pins[iport][ipin])); + vpr_device_annotation.add_physical_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->output_pins[iport][ipin])); if (true == verbose_output) { - print_success_bind_pb_graph_pin(operating_pb_graph_pin, vpr_pb_type_annotation.physical_pb_graph_pin(operating_pb_graph_pin)); + print_success_bind_pb_graph_pin(operating_pb_graph_pin, vpr_device_annotation.physical_pb_graph_pin(operating_pb_graph_pin)); } return; } @@ -300,15 +300,15 @@ void annotate_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, for (int ipin = 0; ipin < physical_pb_graph_node->num_clock_pins[iport]; ++ipin) { if (false == try_match_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->clock_pins[iport][ipin]), - vpr_pb_type_annotation)) { + vpr_device_annotation)) { continue; } /* Reach here, it means the pins are matched by the annotation requirements * We can pair the pin and return */ - vpr_pb_type_annotation.add_physical_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->clock_pins[iport][ipin])); + vpr_device_annotation.add_physical_pb_graph_pin(operating_pb_graph_pin, &(physical_pb_graph_node->clock_pins[iport][ipin])); if (true == verbose_output) { - print_success_bind_pb_graph_pin(operating_pb_graph_pin, vpr_pb_type_annotation.physical_pb_graph_pin(operating_pb_graph_pin)); + print_success_bind_pb_graph_pin(operating_pb_graph_pin, vpr_device_annotation.physical_pb_graph_pin(operating_pb_graph_pin)); } return; } @@ -323,13 +323,13 @@ void annotate_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, /******************************************************************** * This function will try bind each pin of the operating pb_graph_node * to a pin of the physical pb_graph_node by following the annotation - * available in vpr_pb_type_annotation - * It will add the pin bindings to the vpr_pb_type_annotation + * available in vpr_device_annotation + * It will add the pin bindings to the vpr_device_annotation *******************************************************************/ static void annotate_physical_pb_graph_node_pins(t_pb_graph_node* operating_pb_graph_node, t_pb_graph_node* physical_pb_graph_node, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Iterate over every port and pin of the operating pb_graph_node * and find the physical pins @@ -337,7 +337,7 @@ void annotate_physical_pb_graph_node_pins(t_pb_graph_node* operating_pb_graph_no for (int iport = 0; iport < operating_pb_graph_node->num_input_ports; ++iport) { for (int ipin = 0; ipin < operating_pb_graph_node->num_input_pins[iport]; ++ipin) { annotate_physical_pb_graph_pin(&(operating_pb_graph_node->input_pins[iport][ipin]), - physical_pb_graph_node, vpr_pb_type_annotation, + physical_pb_graph_node, vpr_device_annotation, verbose_output); } } @@ -345,7 +345,7 @@ void annotate_physical_pb_graph_node_pins(t_pb_graph_node* operating_pb_graph_no for (int iport = 0; iport < operating_pb_graph_node->num_output_ports; ++iport) { for (int ipin = 0; ipin < operating_pb_graph_node->num_output_pins[iport]; ++ipin) { annotate_physical_pb_graph_pin(&(operating_pb_graph_node->output_pins[iport][ipin]), - physical_pb_graph_node, vpr_pb_type_annotation, + physical_pb_graph_node, vpr_device_annotation, verbose_output); } } @@ -353,7 +353,7 @@ void annotate_physical_pb_graph_node_pins(t_pb_graph_node* operating_pb_graph_no for (int iport = 0; iport < operating_pb_graph_node->num_clock_ports; ++iport) { for (int ipin = 0; ipin < operating_pb_graph_node->num_clock_pins[iport]; ++ipin) { annotate_physical_pb_graph_pin(&(operating_pb_graph_node->clock_pins[iport][ipin]), - physical_pb_graph_node, vpr_pb_type_annotation, + physical_pb_graph_node, vpr_device_annotation, verbose_output); } } @@ -369,7 +369,7 @@ void annotate_physical_pb_graph_node_pins(t_pb_graph_node* operating_pb_graph_no *******************************************************************/ static void rec_build_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_node, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Go recursive first until we touch the primitive node */ if (false == is_primitive_pb_type(pb_graph_node->pb_type)) { @@ -378,7 +378,7 @@ void rec_build_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n /* Each child may exist multiple times in the hierarchy*/ for (int jpb = 0; jpb < pb_graph_node->pb_type->modes[imode].pb_type_children[ipb].num_pb; ++jpb) { rec_build_vpr_physical_pb_graph_node_annotation(&(pb_graph_node->child_pb_graph_nodes[imode][ipb][jpb]), - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); } } @@ -393,7 +393,7 @@ void rec_build_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n * - Find the physical pb_graph_node with the given index * To bind pins from operating pb_graph_node to their physical pb_graph_node pins */ - t_pb_type* physical_pb_type = vpr_pb_type_annotation.physical_pb_type(pb_graph_node->pb_type); + t_pb_type* physical_pb_type = vpr_device_annotation.physical_pb_type(pb_graph_node->pb_type); VTR_ASSERT(nullptr != physical_pb_type); /* Index inference: @@ -401,13 +401,13 @@ void rec_build_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n * where factor and offset are provided by users */ PbGraphNodeId physical_pb_graph_node_id = PbGraphNodeId( - vpr_pb_type_annotation.physical_pb_type_index_factor(pb_graph_node->pb_type) - * (size_t)vpr_pb_type_annotation.pb_graph_node_unique_index(pb_graph_node) - + vpr_pb_type_annotation.physical_pb_type_index_offset(pb_graph_node->pb_type) + vpr_device_annotation.physical_pb_type_index_factor(pb_graph_node->pb_type) + * (size_t)vpr_device_annotation.pb_graph_node_unique_index(pb_graph_node) + + vpr_device_annotation.physical_pb_type_index_offset(pb_graph_node->pb_type) ); - t_pb_graph_node* physical_pb_graph_node = vpr_pb_type_annotation.pb_graph_node(physical_pb_type, physical_pb_graph_node_id); + t_pb_graph_node* physical_pb_graph_node = vpr_device_annotation.pb_graph_node(physical_pb_type, physical_pb_graph_node_id); VTR_ASSERT(nullptr != physical_pb_graph_node); - vpr_pb_type_annotation.add_physical_pb_graph_node(pb_graph_node, physical_pb_graph_node); + vpr_device_annotation.add_physical_pb_graph_node(pb_graph_node, physical_pb_graph_node); VTR_LOGV(verbose_output, "Bind operating pb_graph_node '%s' to physical pb_graph_node '%s'\n", @@ -415,7 +415,7 @@ void rec_build_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n physical_pb_graph_node->hierarchical_type_name().c_str()); /* Try to bind each pins under this pb_graph_node to physical_pb_graph_node */ - annotate_physical_pb_graph_node_pins(pb_graph_node, physical_pb_graph_node, vpr_pb_type_annotation, verbose_output); + annotate_physical_pb_graph_node_pins(pb_graph_node, physical_pb_graph_node, vpr_device_annotation, verbose_output); } /******************************************************************** @@ -425,14 +425,14 @@ void rec_build_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n *******************************************************************/ static void annotate_physical_pb_graph_node(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { /* By pass nullptr for pb_graph head */ if (nullptr == lb_type.pb_graph_head) { continue; } - rec_build_vpr_physical_pb_graph_node_annotation(lb_type.pb_graph_head, vpr_pb_type_annotation, verbose_output); + rec_build_vpr_physical_pb_graph_node_annotation(lb_type.pb_graph_head, vpr_device_annotation, verbose_output); } } @@ -443,21 +443,21 @@ void annotate_physical_pb_graph_node(const DeviceContext& vpr_device_ctx, * - Bind pins from operating pb_graph_node to their physical pb_graph_node pins *******************************************************************/ void annotate_pb_graph(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { VTR_LOG("Assigning unique indices for primitive pb_graph nodes..."); VTR_LOGV(verbose_output, "\n"); - annotate_primitive_pb_graph_node_unique_index(vpr_device_ctx, vpr_pb_type_annotation); + annotate_primitive_pb_graph_node_unique_index(vpr_device_ctx, vpr_device_annotation); VTR_LOG("Done\n"); VTR_LOG("Binding operating pb_graph nodes/pins to physical pb_graph nodes/pins..."); VTR_LOGV(verbose_output, "\n"); - annotate_physical_pb_graph_node(vpr_device_ctx, vpr_pb_type_annotation, verbose_output); + annotate_physical_pb_graph_node(vpr_device_ctx, vpr_device_annotation, verbose_output); VTR_LOG("Done\n"); /* Check each primitive pb_graph_node and pin has been binded to a physical node and pin */ - check_physical_pb_graph_node_annotation(vpr_device_ctx, const_cast(vpr_pb_type_annotation)); + check_physical_pb_graph_node_annotation(vpr_device_ctx, const_cast(vpr_device_annotation)); } } /* end namespace openfpga */ diff --git a/openfpga/src/annotation/annotate_pb_graph.h b/openfpga/src/annotation/annotate_pb_graph.h index 64eced256..5dd140da8 100644 --- a/openfpga/src/annotation/annotate_pb_graph.h +++ b/openfpga/src/annotation/annotate_pb_graph.h @@ -6,7 +6,7 @@ *******************************************************************/ #include "vpr_context.h" #include "openfpga_context.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" /******************************************************************** * Function declaration @@ -16,11 +16,11 @@ namespace openfpga { void annotate_pb_graph_interconnect_physical_type(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_pb_type_annotation, const bool& verbose_output); void annotate_pb_graph(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_pb_type_annotation, const bool& verbose_output); } /* end namespace openfpga */ diff --git a/openfpga/src/annotation/annotate_pb_types.cpp b/openfpga/src/annotation/annotate_pb_types.cpp index d70ab7427..d8701be78 100644 --- a/openfpga/src/annotation/annotate_pb_types.cpp +++ b/openfpga/src/annotation/annotate_pb_types.cpp @@ -7,7 +7,7 @@ #include "vtr_assert.h" #include "vtr_log.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" #include "pb_type_utils.h" #include "annotate_pb_graph.h" #include "check_pb_type_annotation.h" @@ -24,7 +24,7 @@ namespace openfpga { static void build_vpr_physical_pb_mode_explicit_annotation(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Walk through the pb_type annotation stored in the openfpga arch */ for (const PbTypeAnnotation& pb_type_annotation : openfpga_arch.pb_type_annotations) { @@ -80,7 +80,7 @@ void build_vpr_physical_pb_mode_explicit_annotation(const DeviceContext& vpr_dev /* Found, we update the annotation by assigning the physical mode */ t_mode* physical_mode = find_pb_type_mode(target_pb_type, pb_type_annotation.physical_mode_name().c_str()); - vpr_pb_type_annotation.add_pb_type_physical_mode(target_pb_type, physical_mode); + vpr_device_annotation.add_pb_type_physical_mode(target_pb_type, physical_mode); /* Give a message */ VTR_LOGV(verbose_output, @@ -112,7 +112,7 @@ void build_vpr_physical_pb_mode_explicit_annotation(const DeviceContext& vpr_dev *******************************************************************/ static void rec_infer_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* We do not check any primitive pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { @@ -128,18 +128,18 @@ void rec_infer_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, t_mode* physical_mode = nullptr; if (1 == cur_pb_type->num_modes) { - if (nullptr == vpr_pb_type_annotation.physical_mode(cur_pb_type)) { + if (nullptr == vpr_device_annotation.physical_mode(cur_pb_type)) { /* Not assigned by explicit annotation, we should infer here */ - vpr_pb_type_annotation.add_pb_type_physical_mode(cur_pb_type, &(cur_pb_type->modes[0])); + vpr_device_annotation.add_pb_type_physical_mode(cur_pb_type, &(cur_pb_type->modes[0])); VTR_LOGV(verbose_output, "Implicitly infer physical mode '%s' for pb_type '%s'\n", cur_pb_type->modes[0].name, cur_pb_type->name); } } else { VTR_ASSERT(1 < cur_pb_type->num_modes); - if (nullptr == vpr_pb_type_annotation.physical_mode(cur_pb_type)) { + if (nullptr == vpr_device_annotation.physical_mode(cur_pb_type)) { /* Not assigned by explicit annotation, we should infer here */ - vpr_pb_type_annotation.add_pb_type_physical_mode(cur_pb_type, &(cur_pb_type->modes[0])); + vpr_device_annotation.add_pb_type_physical_mode(cur_pb_type, &(cur_pb_type->modes[0])); VTR_LOG_ERROR("Unable to find a physical mode for a multi-mode pb_type '%s'!\n", cur_pb_type->name); VTR_LOG_ERROR("Please specify in the OpenFPGA architecture\n"); @@ -148,14 +148,14 @@ void rec_infer_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, } /* Get the physical mode from annotation */ - physical_mode = vpr_pb_type_annotation.physical_mode(cur_pb_type); + physical_mode = vpr_device_annotation.physical_mode(cur_pb_type); VTR_ASSERT(nullptr != physical_mode); /* Traverse the pb_type children under the physical mode */ for (int ichild = 0; ichild < physical_mode->num_pb_type_children; ++ichild) { rec_infer_vpr_physical_pb_mode_annotation(&(physical_mode->pb_type_children[ichild]), - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); } } @@ -174,14 +174,14 @@ void rec_infer_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, *******************************************************************/ static void build_vpr_physical_pb_mode_implicit_annotation(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { /* By pass nullptr for pb_type head */ if (nullptr == lb_type.pb_type) { continue; } - rec_infer_vpr_physical_pb_mode_annotation(lb_type.pb_type, vpr_pb_type_annotation, verbose_output); + rec_infer_vpr_physical_pb_mode_annotation(lb_type.pb_type, vpr_device_annotation, verbose_output); } } @@ -196,13 +196,13 @@ void build_vpr_physical_pb_mode_implicit_annotation(const DeviceContext& vpr_dev * we assume their physical ports share the same as the operating ports * We will try to find a port in the physical pb_type and check the port range * If found, we will create a pair - * - All the pairs will be updated in vpr_pb_type_annotation + * - All the pairs will be updated in vpr_device_annotation *******************************************************************/ static bool pair_operating_and_physical_pb_types(t_pb_type* operating_pb_type, t_pb_type* physical_pb_type, const PbTypeAnnotation& pb_type_annotation, - VprPbTypeAnnotation& vpr_pb_type_annotation) { + VprDeviceAnnotation& vpr_device_annotation) { /* Reach here, we should have valid operating and physical pb_types */ VTR_ASSERT((nullptr != operating_pb_type) && (nullptr != physical_pb_type)); @@ -229,24 +229,24 @@ bool pair_operating_and_physical_pb_types(t_pb_type* operating_pb_type, if (false == BasicPort(physical_pb_port->name, physical_pb_port->num_pins).contained(expected_physical_pb_port)) { return false; } - /* Now, port mapping should succeed, we update the vpr_pb_type_annotation + /* Now, port mapping should succeed, we update the vpr_device_annotation * - port binding * - port range * - port pin rotate offset */ - vpr_pb_type_annotation.add_physical_pb_port(operating_pb_port, physical_pb_port); - vpr_pb_type_annotation.add_physical_pb_port_range(operating_pb_port, expected_physical_pb_port); - vpr_pb_type_annotation.add_physical_pb_pin_rotate_offset(operating_pb_port, pb_type_annotation.physical_pin_rotate_offset(std::string(operating_pb_port->name))); + vpr_device_annotation.add_physical_pb_port(operating_pb_port, physical_pb_port); + vpr_device_annotation.add_physical_pb_port_range(operating_pb_port, expected_physical_pb_port); + vpr_device_annotation.add_physical_pb_pin_rotate_offset(operating_pb_port, pb_type_annotation.physical_pin_rotate_offset(std::string(operating_pb_port->name))); } - /* Now, pb_type mapping should succeed, we update the vpr_pb_type_annotation + /* Now, pb_type mapping should succeed, we update the vpr_device_annotation * - pb_type binding * - physical_pb_type_index_factor * - physical_pb_type_index_offset */ - vpr_pb_type_annotation.add_physical_pb_type(operating_pb_type, physical_pb_type); - vpr_pb_type_annotation.add_physical_pb_type_index_factor(operating_pb_type, pb_type_annotation.physical_pb_type_index_factor()); - vpr_pb_type_annotation.add_physical_pb_type_index_offset(operating_pb_type, pb_type_annotation.physical_pb_type_index_offset()); + vpr_device_annotation.add_physical_pb_type(operating_pb_type, physical_pb_type); + vpr_device_annotation.add_physical_pb_type_index_factor(operating_pb_type, pb_type_annotation.physical_pb_type_index_factor()); + vpr_device_annotation.add_physical_pb_type_index_offset(operating_pb_type, pb_type_annotation.physical_pb_type_index_offset()); return true; } @@ -263,7 +263,7 @@ bool pair_operating_and_physical_pb_types(t_pb_type* operating_pb_type, static void build_vpr_physical_pb_type_explicit_annotation(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Walk through the pb_type annotation stored in the openfpga arch */ for (const PbTypeAnnotation& pb_type_annotation : openfpga_arch.pb_type_annotations) { @@ -328,7 +328,7 @@ void build_vpr_physical_pb_type_explicit_annotation(const DeviceContext& vpr_dev * we update the annotation by assigning the physical mode */ if (true == pair_operating_and_physical_pb_types(target_op_pb_type, target_phy_pb_type, - pb_type_annotation, vpr_pb_type_annotation)) { + pb_type_annotation, vpr_device_annotation)) { /* Give a message */ VTR_LOGV(verbose_output, @@ -354,7 +354,7 @@ void build_vpr_physical_pb_type_explicit_annotation(const DeviceContext& vpr_dev *******************************************************************/ static bool self_pair_physical_pb_types(t_pb_type* physical_pb_type, - VprPbTypeAnnotation& vpr_pb_type_annotation) { + VprDeviceAnnotation& vpr_device_annotation) { /* Reach here, we should have valid physical pb_types */ VTR_ASSERT(nullptr != physical_pb_type); @@ -364,12 +364,12 @@ bool self_pair_physical_pb_types(t_pb_type* physical_pb_type, */ for (t_port* physical_pb_port : pb_type_ports(physical_pb_type)) { BasicPort physical_port_range(physical_pb_port->name, physical_pb_port->num_pins); - vpr_pb_type_annotation.add_physical_pb_port(physical_pb_port, physical_pb_port); - vpr_pb_type_annotation.add_physical_pb_port_range(physical_pb_port, physical_port_range); + vpr_device_annotation.add_physical_pb_port(physical_pb_port, physical_pb_port); + vpr_device_annotation.add_physical_pb_port_range(physical_pb_port, physical_port_range); } - /* Now, pb_type mapping should succeed, we update the vpr_pb_type_annotation */ - vpr_pb_type_annotation.add_physical_pb_type(physical_pb_type, physical_pb_type); + /* Now, pb_type mapping should succeed, we update the vpr_device_annotation */ + vpr_device_annotation.add_physical_pb_type(physical_pb_type, physical_pb_type); return true; } @@ -384,16 +384,16 @@ bool self_pair_physical_pb_types(t_pb_type* physical_pb_type, *******************************************************************/ static void rec_infer_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Physical pb_type is mainly for the primitive pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { /* If the physical pb_type has been mapped, we can skip it */ - if (nullptr != vpr_pb_type_annotation.physical_pb_type(cur_pb_type)) { + if (nullptr != vpr_device_annotation.physical_pb_type(cur_pb_type)) { return; } /* Create the pair here */ - if (true == self_pair_physical_pb_types(cur_pb_type, vpr_pb_type_annotation)) { + if (true == self_pair_physical_pb_types(cur_pb_type, vpr_device_annotation)) { /* Give a message */ VTR_LOGV(verbose_output, "Implicitly infer the physical pb_type for pb_type '%s' itself\n", @@ -406,14 +406,14 @@ void rec_infer_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type, } /* Get the physical mode from annotation */ - t_mode* physical_mode = vpr_pb_type_annotation.physical_mode(cur_pb_type); + t_mode* physical_mode = vpr_device_annotation.physical_mode(cur_pb_type); VTR_ASSERT(nullptr != physical_mode); /* Traverse the pb_type children under the physical mode */ for (int ichild = 0; ichild < physical_mode->num_pb_type_children; ++ichild) { rec_infer_vpr_physical_pb_type_annotation(&(physical_mode->pb_type_children[ichild]), - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); } } @@ -429,14 +429,14 @@ void rec_infer_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type, *******************************************************************/ static void build_vpr_physical_pb_type_implicit_annotation(const DeviceContext& vpr_device_ctx, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { /* By pass nullptr for pb_type head */ if (nullptr == lb_type.pb_type) { continue; } - rec_infer_vpr_physical_pb_type_annotation(lb_type.pb_type, vpr_pb_type_annotation, verbose_output); + rec_infer_vpr_physical_pb_type_annotation(lb_type.pb_type, vpr_device_annotation, verbose_output); } } @@ -450,7 +450,7 @@ static bool link_physical_pb_port_to_circuit_port(t_pb_type* physical_pb_type, const CircuitLibrary& circuit_lib, const CircuitModelId& circuit_model, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { bool link_success = true; /* Iterate over the pb_ports @@ -492,8 +492,8 @@ bool link_physical_pb_port_to_circuit_port(t_pb_type* physical_pb_type, continue; } - /* Reach here, it means that mapping should be ok, update the vpr_pb_type_annotation */ - vpr_pb_type_annotation.add_pb_circuit_port(pb_port, circuit_port); + /* Reach here, it means that mapping should be ok, update the vpr_device_annotation */ + vpr_device_annotation.add_pb_circuit_port(pb_port, circuit_port); VTR_LOGV(verbose_output, "Bind pb type '%s' port '%s' to circuit model '%s' port '%s'\n", physical_pb_type->name, @@ -513,13 +513,13 @@ static bool link_physical_pb_type_to_circuit_model(t_pb_type* physical_pb_type, const CircuitLibrary& circuit_lib, const PbTypeAnnotation& pb_type_annotation, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Reach here, we should have valid operating and physical pb_types */ VTR_ASSERT(nullptr != physical_pb_type); /* This must be a physical pb_type according to our annotation! */ - if (false == vpr_pb_type_annotation.is_physical_pb_type(physical_pb_type)) { + if (false == vpr_device_annotation.is_physical_pb_type(physical_pb_type)) { VTR_LOG_ERROR("An operating pb_type '%s' is not allowed to be linked to any circuit model!\n", physical_pb_type->name); return false; @@ -537,12 +537,12 @@ bool link_physical_pb_type_to_circuit_model(t_pb_type* physical_pb_type, /* Ensure that the pb_type ports can be matched in the circuit model ports */ if (false == link_physical_pb_port_to_circuit_port(physical_pb_type, circuit_lib, circuit_model_id, - vpr_pb_type_annotation, verbose_output)) { + vpr_device_annotation, verbose_output)) { return false; } - /* Now the circuit model is valid, update the vpr_pb_type_annotation */ - vpr_pb_type_annotation.add_pb_type_circuit_model(physical_pb_type, circuit_model_id); + /* Now the circuit model is valid, update the vpr_device_annotation */ + vpr_device_annotation.add_pb_type_circuit_model(physical_pb_type, circuit_model_id); return true; } @@ -555,7 +555,7 @@ bool link_physical_pb_interconnect_to_circuit_model(t_pb_type* physical_pb_type, const std::string& interconnect_name, const CircuitLibrary& circuit_lib, const PbTypeAnnotation& pb_type_annotation, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* The physical pb_type should NOT be a primitive, otherwise it should never contain any interconnect */ if (true == is_primitive_pb_type(physical_pb_type)) { @@ -565,7 +565,7 @@ bool link_physical_pb_interconnect_to_circuit_model(t_pb_type* physical_pb_type, } /* Get the physical mode from annotation */ - t_mode* physical_mode = vpr_pb_type_annotation.physical_mode(physical_pb_type); + t_mode* physical_mode = vpr_device_annotation.physical_mode(physical_pb_type); VTR_ASSERT(nullptr != physical_mode); @@ -594,7 +594,7 @@ bool link_physical_pb_interconnect_to_circuit_model(t_pb_type* physical_pb_type, } /* Double check the type of circuit model, it should be the same as required physical type */ - e_circuit_model_type required_circuit_model_type = pb_interconnect_require_circuit_model_type(vpr_pb_type_annotation.interconnect_physical_type(pb_interc)); + e_circuit_model_type required_circuit_model_type = pb_interconnect_require_circuit_model_type(vpr_device_annotation.interconnect_physical_type(pb_interc)); if (circuit_lib.model_type(circuit_model_id) != required_circuit_model_type) { VTR_LOG_ERROR("Circuit model '%s' type '%s' does not match required type '%s' for interconnect '%s' under physical mode '%s' of pb_type '%s'!\n", circuit_lib.model_name(circuit_model_id).c_str(), @@ -606,8 +606,8 @@ bool link_physical_pb_interconnect_to_circuit_model(t_pb_type* physical_pb_type, return false; } - /* Now the circuit model is valid, update the vpr_pb_type_annotation */ - vpr_pb_type_annotation.add_interconnect_circuit_model(pb_interc, circuit_model_id); + /* Now the circuit model is valid, update the vpr_device_annotation */ + vpr_device_annotation.add_interconnect_circuit_model(pb_interc, circuit_model_id); VTR_LOGV(verbose_output, "Bind pb_type '%s' physical mode '%s' interconnect '%s' to circuit model '%s'\n", @@ -631,7 +631,7 @@ bool link_physical_pb_interconnect_to_circuit_model(t_pb_type* physical_pb_type, static void link_vpr_pb_type_to_circuit_model_explicit_annotation(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Walk through the pb_type annotation stored in the openfpga arch */ for (const PbTypeAnnotation& pb_type_annotation : openfpga_arch.pb_type_annotations) { @@ -683,13 +683,13 @@ void link_vpr_pb_type_to_circuit_model_explicit_annotation(const DeviceContext& /* Only try to bind pb_type to circuit model when it is defined by users */ if (true == link_physical_pb_type_to_circuit_model(target_phy_pb_type, openfpga_arch.circuit_lib, - pb_type_annotation, vpr_pb_type_annotation, + pb_type_annotation, vpr_device_annotation, verbose_output)) { /* Give a message */ VTR_LOGV(verbose_output, "Bind physical pb_type '%s' to its circuit model '%s'\n", target_phy_pb_type->name, - openfpga_arch.circuit_lib.model_name(vpr_pb_type_annotation.pb_type_circuit_model(target_phy_pb_type)).c_str()); + openfpga_arch.circuit_lib.model_name(vpr_device_annotation.pb_type_circuit_model(target_phy_pb_type)).c_str()); link_success = true; break; @@ -718,7 +718,7 @@ void link_vpr_pb_type_to_circuit_model_explicit_annotation(const DeviceContext& static void link_vpr_pb_interconnect_to_circuit_model_explicit_annotation(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Walk through the pb_type annotation stored in the openfpga arch */ for (const PbTypeAnnotation& pb_type_annotation : openfpga_arch.pb_type_annotations) { @@ -771,7 +771,7 @@ void link_vpr_pb_interconnect_to_circuit_model_explicit_annotation(const DeviceC /* Only try to bind interconnect to circuit model when it is defined by users */ for (const std::string& interc_name : pb_type_annotation.interconnect_names()) { if (false == link_physical_pb_interconnect_to_circuit_model(target_phy_pb_type, interc_name, openfpga_arch.circuit_lib, - pb_type_annotation, vpr_pb_type_annotation, + pb_type_annotation, vpr_device_annotation, verbose_output)) { VTR_LOG_ERROR("Unable to bind pb_type '%s' interconnect '%s' to circuit model '%s'!\n", target_phy_pb_type_names.back().c_str(), @@ -812,7 +812,7 @@ void link_vpr_pb_interconnect_to_circuit_model_explicit_annotation(const DeviceC static void rec_infer_vpr_pb_interconnect_circuit_model_annotation(t_pb_type* cur_pb_type, const CircuitLibrary& circuit_lib, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* We do not check any primitive pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { @@ -820,18 +820,18 @@ void rec_infer_vpr_pb_interconnect_circuit_model_annotation(t_pb_type* cur_pb_ty } /* Get the physical mode from annotation */ - t_mode* physical_mode = vpr_pb_type_annotation.physical_mode(cur_pb_type); + t_mode* physical_mode = vpr_device_annotation.physical_mode(cur_pb_type); VTR_ASSERT(nullptr != physical_mode); /* Annotate the circuit model for each interconnect under this physical mode */ for (t_interconnect* pb_interc : pb_mode_interconnects(physical_mode)) { /* If the interconnect has been annotated, we skip it */ - if (CircuitModelId::INVALID() != vpr_pb_type_annotation.interconnect_circuit_model(pb_interc)) { + if (CircuitModelId::INVALID() != vpr_device_annotation.interconnect_circuit_model(pb_interc)) { continue; } /* Infer the circuit model type for a given interconnect */ - e_circuit_model_type circuit_model_type = pb_interconnect_require_circuit_model_type(vpr_pb_type_annotation.interconnect_physical_type(pb_interc)); + e_circuit_model_type circuit_model_type = pb_interconnect_require_circuit_model_type(vpr_device_annotation.interconnect_physical_type(pb_interc)); /* Try to find a default circuit model from the circuit library */ CircuitModelId default_circuit_model = circuit_lib.default_model(circuit_model_type); /* Update the annotation if the model id is valid */ @@ -841,7 +841,7 @@ void rec_infer_vpr_pb_interconnect_circuit_model_annotation(t_pb_type* cur_pb_ty physical_mode->name, cur_pb_type->name); } - vpr_pb_type_annotation.add_interconnect_circuit_model(pb_interc, default_circuit_model); + vpr_device_annotation.add_interconnect_circuit_model(pb_interc, default_circuit_model); VTR_LOGV(verbose_output, "Implicitly infer a circuit model '%s' for interconnect '%s' under physical mode '%s' of pb_type '%s'\n", circuit_lib.model_name(default_circuit_model).c_str(), @@ -853,7 +853,7 @@ void rec_infer_vpr_pb_interconnect_circuit_model_annotation(t_pb_type* cur_pb_ty /* Traverse the pb_type children under the physical mode */ for (int ichild = 0; ichild < physical_mode->num_pb_type_children; ++ichild) { rec_infer_vpr_pb_interconnect_circuit_model_annotation(&(physical_mode->pb_type_children[ichild]), - circuit_lib, vpr_pb_type_annotation, + circuit_lib, vpr_device_annotation, verbose_output); } } @@ -871,25 +871,25 @@ void rec_infer_vpr_pb_interconnect_circuit_model_annotation(t_pb_type* cur_pb_ty static void link_vpr_pb_interconnect_to_circuit_model_implicit_annotation(const DeviceContext& vpr_device_ctx, const CircuitLibrary& circuit_lib, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { /* By pass nullptr for pb_type head */ if (nullptr == lb_type.pb_type) { continue; } - rec_infer_vpr_pb_interconnect_circuit_model_annotation(lb_type.pb_type, circuit_lib, vpr_pb_type_annotation, verbose_output); + rec_infer_vpr_pb_interconnect_circuit_model_annotation(lb_type.pb_type, circuit_lib, vpr_device_annotation, verbose_output); } } /******************************************************************** * This function will bind mode selection bits to a primitive pb_type - * in the vpr_pb_type_annotation + * in the vpr_device_annotation *******************************************************************/ static bool link_primitive_pb_type_to_mode_bits(t_pb_type* primitive_pb_type, const PbTypeAnnotation& pb_type_annotation, - VprPbTypeAnnotation& vpr_pb_type_annotation) { + VprDeviceAnnotation& vpr_device_annotation) { /* Error out if this is not a primitive pb_type */ if (false == is_primitive_pb_type(primitive_pb_type)) { VTR_LOG_ERROR("Mode selection is only applicable to primitive pb_type while pb_type '%s' is not primitve !\n", @@ -898,7 +898,7 @@ bool link_primitive_pb_type_to_mode_bits(t_pb_type* primitive_pb_type, } /* Update the annotation */ - vpr_pb_type_annotation.add_pb_type_mode_bits(primitive_pb_type, pb_type_annotation.mode_bits()); + vpr_device_annotation.add_pb_type_mode_bits(primitive_pb_type, pb_type_annotation.mode_bits()); return true; } @@ -916,7 +916,7 @@ bool link_primitive_pb_type_to_mode_bits(t_pb_type* primitive_pb_type, static void link_vpr_pb_type_to_mode_bits_explicit_annotation(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Walk through the pb_type annotation stored in the openfpga arch */ for (const PbTypeAnnotation& pb_type_annotation : openfpga_arch.pb_type_annotations) { @@ -973,7 +973,7 @@ void link_vpr_pb_type_to_mode_bits_explicit_annotation(const DeviceContext& vpr_ /* Only try to bind pb_type to circuit model when it is defined by users */ if (true == link_primitive_pb_type_to_mode_bits(target_pb_type, - pb_type_annotation, vpr_pb_type_annotation)) { + pb_type_annotation, vpr_device_annotation)) { /* Give a message */ VTR_LOGV(verbose_output, "Bind physical pb_type '%s' to mode selection bits '%s'\n", @@ -1002,7 +1002,7 @@ void link_vpr_pb_type_to_mode_bits_explicit_annotation(const DeviceContext& vpr_ *******************************************************************/ void annotate_pb_types(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output) { /* Annotate physical mode to pb_type in the VPR pb_type graph */ @@ -1010,16 +1010,16 @@ void annotate_pb_types(const DeviceContext& vpr_device_ctx, VTR_LOG("Building annotation for physical modes in pb_type..."); VTR_LOGV(verbose_output, "\n"); build_vpr_physical_pb_mode_explicit_annotation(vpr_device_ctx, openfpga_arch, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); build_vpr_physical_pb_mode_implicit_annotation(vpr_device_ctx, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); VTR_LOG("Done\n"); check_vpr_physical_pb_mode_annotation(vpr_device_ctx, - const_cast(vpr_pb_type_annotation)); + const_cast(vpr_device_annotation)); /* Annotate the physical type for each interconnect under physical modes * Must run AFTER physical mode annotation is done and @@ -1029,7 +1029,7 @@ void annotate_pb_types(const DeviceContext& vpr_device_ctx, VTR_LOG("Building annotation about physical types for pb_type interconnection..."); VTR_LOGV(verbose_output, "\n"); annotate_pb_graph_interconnect_physical_type(vpr_device_ctx, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); VTR_LOG("Done\n"); @@ -1043,16 +1043,16 @@ void annotate_pb_types(const DeviceContext& vpr_device_ctx, VTR_LOG("Building annotation between operating and physical pb_types..."); VTR_LOGV(verbose_output, "\n"); build_vpr_physical_pb_type_explicit_annotation(vpr_device_ctx, openfpga_arch, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); build_vpr_physical_pb_type_implicit_annotation(vpr_device_ctx, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); VTR_LOG("Done\n"); check_vpr_physical_pb_type_annotation(vpr_device_ctx, - const_cast(vpr_pb_type_annotation)); + const_cast(vpr_device_annotation)); /* Link * - physical pb_type to circuit model @@ -1062,32 +1062,32 @@ void annotate_pb_types(const DeviceContext& vpr_device_ctx, VTR_LOG("Building annotation between physical pb_types and circuit models..."); VTR_LOGV(verbose_output, "\n"); link_vpr_pb_type_to_circuit_model_explicit_annotation(vpr_device_ctx, openfpga_arch, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); link_vpr_pb_interconnect_to_circuit_model_explicit_annotation(vpr_device_ctx, openfpga_arch, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); link_vpr_pb_interconnect_to_circuit_model_implicit_annotation(vpr_device_ctx, openfpga_arch.circuit_lib, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); VTR_LOG("Done\n"); check_vpr_pb_type_circuit_model_annotation(vpr_device_ctx, openfpga_arch.circuit_lib, - const_cast(vpr_pb_type_annotation)); + const_cast(vpr_device_annotation)); /* Link physical pb_type to mode_bits */ VTR_LOG("\n"); VTR_LOG("Building annotation between physical pb_types and mode selection bits..."); VTR_LOGV(verbose_output, "\n"); link_vpr_pb_type_to_mode_bits_explicit_annotation(vpr_device_ctx, openfpga_arch, - vpr_pb_type_annotation, + vpr_device_annotation, verbose_output); VTR_LOG("Done\n"); check_vpr_pb_type_mode_bits_annotation(vpr_device_ctx, openfpga_arch.circuit_lib, - const_cast(vpr_pb_type_annotation)); + const_cast(vpr_device_annotation)); } diff --git a/openfpga/src/annotation/annotate_pb_types.h b/openfpga/src/annotation/annotate_pb_types.h index 4be50aed6..d2c1b4cf5 100644 --- a/openfpga/src/annotation/annotate_pb_types.h +++ b/openfpga/src/annotation/annotate_pb_types.h @@ -6,7 +6,7 @@ *******************************************************************/ #include "vpr_context.h" #include "openfpga_context.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" /******************************************************************** * Function declaration @@ -17,7 +17,7 @@ namespace openfpga { void annotate_pb_types(const DeviceContext& vpr_device_ctx, const Arch& openfpga_arch, - VprPbTypeAnnotation& vpr_pb_type_annotation, + VprDeviceAnnotation& vpr_device_annotation, const bool& verbose_output); } /* end namespace openfpga */ diff --git a/openfpga/src/annotation/check_pb_graph_annotation.cpp b/openfpga/src/annotation/check_pb_graph_annotation.cpp index 92cabefb4..fdfa1394c 100644 --- a/openfpga/src/annotation/check_pb_graph_annotation.cpp +++ b/openfpga/src/annotation/check_pb_graph_annotation.cpp @@ -19,8 +19,8 @@ namespace openfpga { *******************************************************************/ static bool check_physical_pb_graph_pin(t_pb_graph_pin* pb_graph_pin, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { - if (nullptr == vpr_pb_type_annotation.physical_pb_graph_pin(pb_graph_pin)) { + const VprDeviceAnnotation& vpr_device_annotation) { + if (nullptr == vpr_device_annotation.physical_pb_graph_pin(pb_graph_pin)) { VTR_LOG_ERROR("Found a pb_graph_pin '%s' missing physical pb_graph_pin binding!\n", pb_graph_pin->port->name); return false; @@ -40,7 +40,7 @@ bool check_physical_pb_graph_pin(t_pb_graph_pin* pb_graph_pin, *******************************************************************/ static void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_node, - const VprPbTypeAnnotation& vpr_pb_type_annotation, + const VprDeviceAnnotation& vpr_device_annotation, size_t& num_err) { /* Go recursive first until we touch the primitive node */ if (false == is_primitive_pb_type(pb_graph_node->pb_type)) { @@ -49,7 +49,7 @@ void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n /* Each child may exist multiple times in the hierarchy*/ for (int jpb = 0; jpb < pb_graph_node->pb_type->modes[imode].pb_type_children[ipb].num_pb; ++jpb) { rec_check_vpr_physical_pb_graph_node_annotation(&(pb_graph_node->child_pb_graph_nodes[imode][ipb][jpb]), - vpr_pb_type_annotation, num_err); + vpr_device_annotation, num_err); } } } @@ -57,7 +57,7 @@ void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n } /* Ensure that the pb_graph_node has been mapped to a physical node */ - t_pb_graph_node* physical_pb_graph_node = vpr_pb_type_annotation.physical_pb_graph_node(pb_graph_node); + t_pb_graph_node* physical_pb_graph_node = vpr_device_annotation.physical_pb_graph_node(pb_graph_node); if (nullptr == physical_pb_graph_node) { VTR_LOG_ERROR("Found a pb_graph_node '%s' missing physical pb_graph_node binding!\n", physical_pb_graph_node->pb_type->name); @@ -71,7 +71,7 @@ void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n for (int iport = 0; iport < physical_pb_graph_node->num_input_ports; ++iport) { for (int ipin = 0; ipin < physical_pb_graph_node->num_input_pins[iport]; ++ipin) { if (false == check_physical_pb_graph_pin(&(physical_pb_graph_node->input_pins[iport][ipin]), - vpr_pb_type_annotation)) { + vpr_device_annotation)) { num_err++; } } @@ -80,7 +80,7 @@ void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n for (int iport = 0; iport < physical_pb_graph_node->num_output_ports; ++iport) { for (int ipin = 0; ipin < physical_pb_graph_node->num_output_pins[iport]; ++ipin) { if (false == check_physical_pb_graph_pin(&(physical_pb_graph_node->output_pins[iport][ipin]), - vpr_pb_type_annotation)) { + vpr_device_annotation)) { num_err++; } } @@ -89,7 +89,7 @@ void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n for (int iport = 0; iport < physical_pb_graph_node->num_clock_ports; ++iport) { for (int ipin = 0; ipin < physical_pb_graph_node->num_clock_pins[iport]; ++ipin) { if (false == check_physical_pb_graph_pin(&(physical_pb_graph_node->clock_pins[iport][ipin]), - vpr_pb_type_annotation)) { + vpr_device_annotation)) { num_err++; } } @@ -102,7 +102,7 @@ void rec_check_vpr_physical_pb_graph_node_annotation(t_pb_graph_node* pb_graph_n * - Each pin has been binded to a physical pb_graph_node pin *******************************************************************/ void check_physical_pb_graph_node_annotation(const DeviceContext& vpr_device_ctx, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { + const VprDeviceAnnotation& vpr_device_annotation) { size_t num_err = 0; for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { @@ -110,7 +110,7 @@ void check_physical_pb_graph_node_annotation(const DeviceContext& vpr_device_ctx if (nullptr == lb_type.pb_graph_head) { continue; } - rec_check_vpr_physical_pb_graph_node_annotation(lb_type.pb_graph_head, vpr_pb_type_annotation, num_err); + rec_check_vpr_physical_pb_graph_node_annotation(lb_type.pb_graph_head, vpr_device_annotation, num_err); } if (0 == num_err) { diff --git a/openfpga/src/annotation/check_pb_graph_annotation.h b/openfpga/src/annotation/check_pb_graph_annotation.h index c482943c5..8416800c0 100644 --- a/openfpga/src/annotation/check_pb_graph_annotation.h +++ b/openfpga/src/annotation/check_pb_graph_annotation.h @@ -6,7 +6,7 @@ *******************************************************************/ #include "vpr_context.h" #include "openfpga_context.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" /******************************************************************** * Function declaration @@ -16,7 +16,7 @@ namespace openfpga { void check_physical_pb_graph_node_annotation(const DeviceContext& vpr_device_ctx, - const VprPbTypeAnnotation& vpr_pb_type_annotation); + const VprDeviceAnnotation& vpr_device_annotation); } /* end namespace openfpga */ diff --git a/openfpga/src/annotation/check_pb_type_annotation.cpp b/openfpga/src/annotation/check_pb_type_annotation.cpp index fdebba00c..5159ec064 100644 --- a/openfpga/src/annotation/check_pb_type_annotation.cpp +++ b/openfpga/src/annotation/check_pb_type_annotation.cpp @@ -22,7 +22,7 @@ namespace openfpga { static void rec_check_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, const bool& expect_physical_mode, - const VprPbTypeAnnotation& vpr_pb_type_annotation, + const VprDeviceAnnotation& vpr_device_annotation, size_t& num_err) { /* We do not check any primitive pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { @@ -36,7 +36,7 @@ void rec_check_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, * nothing in the annotation */ if (true == expect_physical_mode) { - if (nullptr == vpr_pb_type_annotation.physical_mode(cur_pb_type)) { + if (nullptr == vpr_device_annotation.physical_mode(cur_pb_type)) { VTR_LOG_ERROR("Unable to find a physical mode for a multi-mode pb_type '%s'!\n", cur_pb_type->name); VTR_LOG_ERROR("Please specify in the OpenFPGA architecture\n"); @@ -45,9 +45,9 @@ void rec_check_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, } } else { VTR_ASSERT_SAFE(false == expect_physical_mode); - if (nullptr != vpr_pb_type_annotation.physical_mode(cur_pb_type)) { + if (nullptr != vpr_device_annotation.physical_mode(cur_pb_type)) { VTR_LOG_ERROR("Find a physical mode '%s' for pb_type '%s' which is not under any physical mode!\n", - vpr_pb_type_annotation.physical_mode(cur_pb_type)->name, + vpr_device_annotation.physical_mode(cur_pb_type)->name, cur_pb_type->name); num_err++; return; @@ -60,12 +60,12 @@ void rec_check_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, */ for (int imode = 0; imode < cur_pb_type->num_modes; ++imode) { bool expect_child_physical_mode = false; - if (&(cur_pb_type->modes[imode]) == vpr_pb_type_annotation.physical_mode(cur_pb_type)) { + if (&(cur_pb_type->modes[imode]) == vpr_device_annotation.physical_mode(cur_pb_type)) { expect_child_physical_mode = true && expect_physical_mode; } for (int ichild = 0; ichild < cur_pb_type->modes[imode].num_pb_type_children; ++ichild) { rec_check_vpr_physical_pb_mode_annotation(&(cur_pb_type->modes[imode].pb_type_children[ichild]), - expect_child_physical_mode, vpr_pb_type_annotation, + expect_child_physical_mode, vpr_device_annotation, num_err); } } @@ -76,7 +76,7 @@ void rec_check_vpr_physical_pb_mode_annotation(t_pb_type* cur_pb_type, * each pb_type in the device *******************************************************************/ void check_vpr_physical_pb_mode_annotation(const DeviceContext& vpr_device_ctx, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { + const VprDeviceAnnotation& vpr_device_annotation) { size_t num_err = 0; for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { @@ -85,7 +85,7 @@ void check_vpr_physical_pb_mode_annotation(const DeviceContext& vpr_device_ctx, continue; } /* Top pb_type should always has a physical mode! */ - rec_check_vpr_physical_pb_mode_annotation(lb_type.pb_type, true, vpr_pb_type_annotation, num_err); + rec_check_vpr_physical_pb_mode_annotation(lb_type.pb_type, true, vpr_device_annotation, num_err); } if (0 == num_err) { VTR_LOG("Check physical mode annotation for pb_types passed.\n"); @@ -102,9 +102,9 @@ void check_vpr_physical_pb_mode_annotation(const DeviceContext& vpr_device_ctx, *******************************************************************/ static void check_vpr_physical_primitive_pb_type_annotation(t_pb_type* cur_pb_type, - const VprPbTypeAnnotation& vpr_pb_type_annotation, + const VprDeviceAnnotation& vpr_device_annotation, size_t& num_err) { - if (nullptr == vpr_pb_type_annotation.physical_pb_type(cur_pb_type)) { + if (nullptr == vpr_device_annotation.physical_pb_type(cur_pb_type)) { VTR_LOG_ERROR("Find a pb_type '%s' which has not been mapped to any physical pb_type!\n", cur_pb_type->name); VTR_LOG_ERROR("Please specify in the OpenFPGA architecture\n"); @@ -114,7 +114,7 @@ void check_vpr_physical_primitive_pb_type_annotation(t_pb_type* cur_pb_type, /* Now we need to check each port of the pb_type */ for (t_port* pb_port : pb_type_ports(cur_pb_type)) { - if (nullptr == vpr_pb_type_annotation.physical_pb_port(pb_port)) { + if (nullptr == vpr_device_annotation.physical_pb_port(pb_port)) { VTR_LOG_ERROR("Find a port '%s' of pb_type '%s' which has not been mapped to any physical port!\n", pb_port->name, cur_pb_type->name); VTR_LOG_ERROR("Please specify in the OpenFPGA architecture\n"); @@ -132,11 +132,11 @@ void check_vpr_physical_primitive_pb_type_annotation(t_pb_type* cur_pb_type, *******************************************************************/ static void rec_check_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type, - const VprPbTypeAnnotation& vpr_pb_type_annotation, + const VprDeviceAnnotation& vpr_device_annotation, size_t& num_err) { /* Primitive pb_type should always been binded to a physical pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { - check_vpr_physical_primitive_pb_type_annotation(cur_pb_type, vpr_pb_type_annotation, num_err); + check_vpr_physical_primitive_pb_type_annotation(cur_pb_type, vpr_device_annotation, num_err); return; } @@ -144,7 +144,7 @@ void rec_check_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type, for (int imode = 0; imode < cur_pb_type->num_modes; ++imode) { for (int ichild = 0; ichild < cur_pb_type->modes[imode].num_pb_type_children; ++ichild) { rec_check_vpr_physical_pb_type_annotation(&(cur_pb_type->modes[imode].pb_type_children[ichild]), - vpr_pb_type_annotation, + vpr_device_annotation, num_err); } } @@ -157,7 +157,7 @@ void rec_check_vpr_physical_pb_type_annotation(t_pb_type* cur_pb_type, * and every port of the pb_type have been linked a port of a physical pb_type *******************************************************************/ void check_vpr_physical_pb_type_annotation(const DeviceContext& vpr_device_ctx, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { + const VprDeviceAnnotation& vpr_device_annotation) { size_t num_err = 0; for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { @@ -166,7 +166,7 @@ void check_vpr_physical_pb_type_annotation(const DeviceContext& vpr_device_ctx, continue; } /* Top pb_type should always has a physical mode! */ - rec_check_vpr_physical_pb_type_annotation(lb_type.pb_type, vpr_pb_type_annotation, num_err); + rec_check_vpr_physical_pb_type_annotation(lb_type.pb_type, vpr_device_annotation, num_err); } if (0 == num_err) { VTR_LOG("Check physical pb_type annotation for pb_types passed.\n"); @@ -187,12 +187,12 @@ void check_vpr_physical_pb_type_annotation(const DeviceContext& vpr_device_ctx, static void rec_check_vpr_pb_type_circuit_model_annotation(t_pb_type* cur_pb_type, const CircuitLibrary& circuit_lib, - const VprPbTypeAnnotation& vpr_pb_type_annotation, + const VprDeviceAnnotation& vpr_device_annotation, size_t& num_err) { /* Primitive pb_type should always been binded to a physical pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { /* Every physical pb_type should be linked to a valid circuit model */ - if (CircuitModelId::INVALID() == vpr_pb_type_annotation.pb_type_circuit_model(cur_pb_type)) { + if (CircuitModelId::INVALID() == vpr_device_annotation.pb_type_circuit_model(cur_pb_type)) { VTR_LOG_ERROR("Found a physical pb_type '%s' missing circuit model binding!\n", cur_pb_type->name); num_err++; @@ -200,7 +200,7 @@ void rec_check_vpr_pb_type_circuit_model_annotation(t_pb_type* cur_pb_type, } /* Every port of the pb_type have been linked to a valid port of a circuit model */ for (t_port* port : pb_type_ports(cur_pb_type)) { - if (CircuitPortId::INVALID() == vpr_pb_type_annotation.pb_circuit_port(port)) { + if (CircuitPortId::INVALID() == vpr_device_annotation.pb_circuit_port(port)) { VTR_LOG_ERROR("Found a port '%s' of physical pb_type '%s' missing circuit port binding!\n", port->name, cur_pb_type->name); num_err++; @@ -210,9 +210,9 @@ void rec_check_vpr_pb_type_circuit_model_annotation(t_pb_type* cur_pb_type, } /* Every interconnect in the physical mode has been linked to a valid circuit model in a correct type */ - t_mode* physical_mode = vpr_pb_type_annotation.physical_mode(cur_pb_type); + t_mode* physical_mode = vpr_device_annotation.physical_mode(cur_pb_type); for (t_interconnect* interc : pb_mode_interconnects(physical_mode)) { - CircuitModelId interc_circuit_model = vpr_pb_type_annotation.interconnect_circuit_model(interc); + CircuitModelId interc_circuit_model = vpr_device_annotation.interconnect_circuit_model(interc); if (CircuitModelId::INVALID() == interc_circuit_model) { VTR_LOG_ERROR("Found an interconnect '%s' under physical mode '%s' of pb_type '%s' missing circuit model binding!\n", interc->name, @@ -221,7 +221,7 @@ void rec_check_vpr_pb_type_circuit_model_annotation(t_pb_type* cur_pb_type, num_err++; continue; } - e_circuit_model_type required_circuit_model_type = pb_interconnect_require_circuit_model_type(vpr_pb_type_annotation.interconnect_physical_type(interc)); + e_circuit_model_type required_circuit_model_type = pb_interconnect_require_circuit_model_type(vpr_device_annotation.interconnect_physical_type(interc)); if (circuit_lib.model_type(interc_circuit_model) != required_circuit_model_type) { VTR_LOG_ERROR("Found an interconnect '%s' under physical mode '%s' of pb_type '%s' linked to a circuit model '%s' with a wrong type!\nExpect: '%s' Linked: '%s'\n", interc->name, @@ -238,7 +238,7 @@ void rec_check_vpr_pb_type_circuit_model_annotation(t_pb_type* cur_pb_type, for (int ichild = 0; ichild < physical_mode->num_pb_type_children; ++ichild) { rec_check_vpr_pb_type_circuit_model_annotation(&(physical_mode->pb_type_children[ichild]), circuit_lib, - vpr_pb_type_annotation, + vpr_device_annotation, num_err); } } @@ -253,7 +253,7 @@ void rec_check_vpr_pb_type_circuit_model_annotation(t_pb_type* cur_pb_type, *******************************************************************/ void check_vpr_pb_type_circuit_model_annotation(const DeviceContext& vpr_device_ctx, const CircuitLibrary& circuit_lib, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { + const VprDeviceAnnotation& vpr_device_annotation) { size_t num_err = 0; for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { @@ -262,7 +262,7 @@ void check_vpr_pb_type_circuit_model_annotation(const DeviceContext& vpr_device_ continue; } /* Top pb_type should always has a physical mode! */ - rec_check_vpr_pb_type_circuit_model_annotation(lb_type.pb_type, circuit_lib, vpr_pb_type_annotation, num_err); + rec_check_vpr_pb_type_circuit_model_annotation(lb_type.pb_type, circuit_lib, vpr_device_annotation, num_err); } if (0 == num_err) { VTR_LOG("Check physical pb_type annotation for circuit model passed.\n"); @@ -282,14 +282,14 @@ void check_vpr_pb_type_circuit_model_annotation(const DeviceContext& vpr_device_ static void rec_check_vpr_pb_type_mode_bits_annotation(t_pb_type* cur_pb_type, const CircuitLibrary& circuit_lib, - const VprPbTypeAnnotation& vpr_pb_type_annotation, + const VprDeviceAnnotation& vpr_device_annotation, size_t& num_err) { /* Primitive pb_type should always been binded to a physical pb_type */ if (true == is_primitive_pb_type(cur_pb_type)) { /* Find the physical pb_type * If the physical pb_type has mode selection bits, this pb_type must have as well! */ - t_pb_type* physical_pb_type = vpr_pb_type_annotation.physical_pb_type(cur_pb_type); + t_pb_type* physical_pb_type = vpr_device_annotation.physical_pb_type(cur_pb_type); if (nullptr == physical_pb_type) { VTR_LOG_ERROR("Find a pb_type '%s' which has not been mapped to any physical pb_type!\n", @@ -299,7 +299,7 @@ void rec_check_vpr_pb_type_mode_bits_annotation(t_pb_type* cur_pb_type, return; } - if (vpr_pb_type_annotation.pb_type_mode_bits(cur_pb_type).size() != vpr_pb_type_annotation.pb_type_mode_bits(physical_pb_type).size()) { + if (vpr_device_annotation.pb_type_mode_bits(cur_pb_type).size() != vpr_device_annotation.pb_type_mode_bits(physical_pb_type).size()) { VTR_LOG_ERROR("Found different sizes of mode_bits for pb_type '%s' and its physical pb_type '%s'\n", cur_pb_type->name, physical_pb_type->name); @@ -308,15 +308,15 @@ void rec_check_vpr_pb_type_mode_bits_annotation(t_pb_type* cur_pb_type, } /* Try to find a mode selection port for the circuit model linked to the circuit model */ - CircuitModelId circuit_model = vpr_pb_type_annotation.pb_type_circuit_model(physical_pb_type); - if (CircuitModelId::INVALID() == vpr_pb_type_annotation.pb_type_circuit_model(physical_pb_type)) { + CircuitModelId circuit_model = vpr_device_annotation.pb_type_circuit_model(physical_pb_type); + if (CircuitModelId::INVALID() == vpr_device_annotation.pb_type_circuit_model(physical_pb_type)) { VTR_LOG_ERROR("Found a physical pb_type '%s' missing circuit model binding!\n", physical_pb_type->name); num_err++; return; /* Invalid id already, further check is not applicable */ } - if (0 == vpr_pb_type_annotation.pb_type_mode_bits(cur_pb_type).size()) { + if (0 == vpr_device_annotation.pb_type_mode_bits(cur_pb_type).size()) { /* No mode bits to be checked! */ return; } @@ -326,7 +326,7 @@ void rec_check_vpr_pb_type_mode_bits_annotation(t_pb_type* cur_pb_type, for (const CircuitPortId& mode_select_port : mode_select_ports) { port_num_mode_bits += circuit_lib.port_size(mode_select_port); } - if (port_num_mode_bits != vpr_pb_type_annotation.pb_type_mode_bits(cur_pb_type).size()) { + if (port_num_mode_bits != vpr_device_annotation.pb_type_mode_bits(cur_pb_type).size()) { VTR_LOG_ERROR("Length of mode bits of pb_type '%s' does not match the size(%ld) of mode selection ports of circuit model '%s'!\n", cur_pb_type->name, port_num_mode_bits, @@ -341,7 +341,7 @@ void rec_check_vpr_pb_type_mode_bits_annotation(t_pb_type* cur_pb_type, for (int imode = 0; imode < cur_pb_type->num_modes; ++imode) { for (int ichild = 0; ichild < cur_pb_type->modes[imode].num_pb_type_children; ++ichild) { rec_check_vpr_pb_type_mode_bits_annotation(&(cur_pb_type->modes[imode].pb_type_children[ichild]), - circuit_lib, vpr_pb_type_annotation, + circuit_lib, vpr_device_annotation, num_err); } } @@ -359,7 +359,7 @@ void rec_check_vpr_pb_type_mode_bits_annotation(t_pb_type* cur_pb_type, *******************************************************************/ void check_vpr_pb_type_mode_bits_annotation(const DeviceContext& vpr_device_ctx, const CircuitLibrary& circuit_lib, - const VprPbTypeAnnotation& vpr_pb_type_annotation) { + const VprDeviceAnnotation& vpr_device_annotation) { size_t num_err = 0; for (const t_logical_block_type& lb_type : vpr_device_ctx.logical_block_types) { @@ -368,7 +368,7 @@ void check_vpr_pb_type_mode_bits_annotation(const DeviceContext& vpr_device_ctx, continue; } /* Top pb_type should always has a physical mode! */ - rec_check_vpr_pb_type_mode_bits_annotation(lb_type.pb_type, circuit_lib, vpr_pb_type_annotation, num_err); + rec_check_vpr_pb_type_mode_bits_annotation(lb_type.pb_type, circuit_lib, vpr_device_annotation, num_err); } if (0 == num_err) { VTR_LOG("Check pb_type annotation for mode selection bits passed.\n"); diff --git a/openfpga/src/annotation/check_pb_type_annotation.h b/openfpga/src/annotation/check_pb_type_annotation.h index d3d2799aa..5183c5e10 100644 --- a/openfpga/src/annotation/check_pb_type_annotation.h +++ b/openfpga/src/annotation/check_pb_type_annotation.h @@ -6,7 +6,7 @@ *******************************************************************/ #include "vpr_context.h" #include "openfpga_context.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" /******************************************************************** * Function declaration @@ -16,18 +16,18 @@ namespace openfpga { void check_vpr_physical_pb_mode_annotation(const DeviceContext& vpr_device_ctx, - const VprPbTypeAnnotation& vpr_pb_type_annotation); + const VprDeviceAnnotation& vpr_device_annotation); void check_vpr_physical_pb_type_annotation(const DeviceContext& vpr_device_ctx, - const VprPbTypeAnnotation& vpr_pb_type_annotation); + const VprDeviceAnnotation& vpr_device_annotation); void check_vpr_pb_type_circuit_model_annotation(const DeviceContext& vpr_device_ctx, const CircuitLibrary& circuit_lib, - const VprPbTypeAnnotation& vpr_pb_type_annotation); + const VprDeviceAnnotation& vpr_device_annotation); void check_vpr_pb_type_mode_bits_annotation(const DeviceContext& vpr_device_ctx, const CircuitLibrary& circuit_lib, - const VprPbTypeAnnotation& vpr_pb_type_annotation); + const VprDeviceAnnotation& vpr_device_annotation); } /* end namespace openfpga */ diff --git a/openfpga/src/annotation/vpr_pb_type_annotation.cpp b/openfpga/src/annotation/vpr_device_annotation.cpp similarity index 87% rename from openfpga/src/annotation/vpr_pb_type_annotation.cpp rename to openfpga/src/annotation/vpr_device_annotation.cpp index f75a91059..8ae8079d5 100644 --- a/openfpga/src/annotation/vpr_pb_type_annotation.cpp +++ b/openfpga/src/annotation/vpr_device_annotation.cpp @@ -1,11 +1,11 @@ /************************************************************************ - * Member functions for class VprPbTypeAnnotation + * Member functions for class VprDeviceAnnotation ***********************************************************************/ #include #include "vtr_log.h" #include "vtr_assert.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" /* namespace openfpga begins */ namespace openfpga { @@ -13,14 +13,14 @@ namespace openfpga { /************************************************************************ * Constructors ***********************************************************************/ -VprPbTypeAnnotation::VprPbTypeAnnotation() { +VprDeviceAnnotation::VprDeviceAnnotation() { return; } /************************************************************************ * Public accessors ***********************************************************************/ -bool VprPbTypeAnnotation::is_physical_pb_type(t_pb_type* pb_type) const { +bool VprDeviceAnnotation::is_physical_pb_type(t_pb_type* pb_type) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_types_.find(pb_type); if (it == physical_pb_types_.end()) { @@ -30,7 +30,7 @@ bool VprPbTypeAnnotation::is_physical_pb_type(t_pb_type* pb_type) const { return pb_type == physical_pb_types_.at(pb_type); } -t_mode* VprPbTypeAnnotation::physical_mode(t_pb_type* pb_type) const { +t_mode* VprDeviceAnnotation::physical_mode(t_pb_type* pb_type) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_modes_.find(pb_type); if (it == physical_pb_modes_.end()) { @@ -39,7 +39,7 @@ t_mode* VprPbTypeAnnotation::physical_mode(t_pb_type* pb_type) const { return physical_pb_modes_.at(pb_type); } -t_pb_type* VprPbTypeAnnotation::physical_pb_type(t_pb_type* pb_type) const { +t_pb_type* VprDeviceAnnotation::physical_pb_type(t_pb_type* pb_type) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_types_.find(pb_type); if (it == physical_pb_types_.end()) { @@ -48,7 +48,7 @@ t_pb_type* VprPbTypeAnnotation::physical_pb_type(t_pb_type* pb_type) const { return physical_pb_types_.at(pb_type); } -t_port* VprPbTypeAnnotation::physical_pb_port(t_port* pb_port) const { +t_port* VprDeviceAnnotation::physical_pb_port(t_port* pb_port) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_ports_.find(pb_port); if (it == physical_pb_ports_.end()) { @@ -57,7 +57,7 @@ t_port* VprPbTypeAnnotation::physical_pb_port(t_port* pb_port) const { return physical_pb_ports_.at(pb_port); } -BasicPort VprPbTypeAnnotation::physical_pb_port_range(t_port* pb_port) const { +BasicPort VprDeviceAnnotation::physical_pb_port_range(t_port* pb_port) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_port_ranges_.find(pb_port); if (it == physical_pb_port_ranges_.end()) { @@ -67,7 +67,7 @@ BasicPort VprPbTypeAnnotation::physical_pb_port_range(t_port* pb_port) const { return physical_pb_port_ranges_.at(pb_port); } -CircuitModelId VprPbTypeAnnotation::pb_type_circuit_model(t_pb_type* physical_pb_type) const { +CircuitModelId VprDeviceAnnotation::pb_type_circuit_model(t_pb_type* physical_pb_type) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = pb_type_circuit_models_.find(physical_pb_type); if (it == pb_type_circuit_models_.end()) { @@ -77,7 +77,7 @@ CircuitModelId VprPbTypeAnnotation::pb_type_circuit_model(t_pb_type* physical_pb return pb_type_circuit_models_.at(physical_pb_type); } -CircuitModelId VprPbTypeAnnotation::interconnect_circuit_model(t_interconnect* pb_interconnect) const { +CircuitModelId VprDeviceAnnotation::interconnect_circuit_model(t_interconnect* pb_interconnect) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = interconnect_circuit_models_.find(pb_interconnect); if (it == interconnect_circuit_models_.end()) { @@ -87,7 +87,7 @@ CircuitModelId VprPbTypeAnnotation::interconnect_circuit_model(t_interconnect* p return interconnect_circuit_models_.at(pb_interconnect); } -e_interconnect VprPbTypeAnnotation::interconnect_physical_type(t_interconnect* pb_interconnect) const { +e_interconnect VprDeviceAnnotation::interconnect_physical_type(t_interconnect* pb_interconnect) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = interconnect_physical_types_.find(pb_interconnect); if (it == interconnect_physical_types_.end()) { @@ -97,7 +97,7 @@ e_interconnect VprPbTypeAnnotation::interconnect_physical_type(t_interconnect* p return interconnect_physical_types_.at(pb_interconnect); } -CircuitPortId VprPbTypeAnnotation::pb_circuit_port(t_port* pb_port) const { +CircuitPortId VprDeviceAnnotation::pb_circuit_port(t_port* pb_port) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = pb_circuit_ports_.find(pb_port); if (it == pb_circuit_ports_.end()) { @@ -107,7 +107,7 @@ CircuitPortId VprPbTypeAnnotation::pb_circuit_port(t_port* pb_port) const { return pb_circuit_ports_.at(pb_port); } -std::vector VprPbTypeAnnotation::pb_type_mode_bits(t_pb_type* pb_type) const { +std::vector VprDeviceAnnotation::pb_type_mode_bits(t_pb_type* pb_type) const { /* Ensure that the pb_type is in the list */ std::map>::const_iterator it = pb_type_mode_bits_.find(pb_type); if (it == pb_type_mode_bits_.end()) { @@ -117,7 +117,7 @@ std::vector VprPbTypeAnnotation::pb_type_mode_bits(t_pb_type* pb_type) c return pb_type_mode_bits_.at(pb_type); } -PbGraphNodeId VprPbTypeAnnotation::pb_graph_node_unique_index(t_pb_graph_node* pb_graph_node) const { +PbGraphNodeId VprDeviceAnnotation::pb_graph_node_unique_index(t_pb_graph_node* pb_graph_node) const { /* Ensure that the pb_type is in the list */ std::map>::const_iterator it = pb_graph_node_unique_index_.find(pb_graph_node->pb_type); if (it == pb_graph_node_unique_index_.end()) { @@ -138,7 +138,7 @@ PbGraphNodeId VprPbTypeAnnotation::pb_graph_node_unique_index(t_pb_graph_node* p return PbGraphNodeId(it_node - pb_graph_node_unique_index_.at(pb_graph_node->pb_type).begin()); } -t_pb_graph_node* VprPbTypeAnnotation::pb_graph_node(t_pb_type* pb_type, const PbGraphNodeId& unique_index) const { +t_pb_graph_node* VprDeviceAnnotation::pb_graph_node(t_pb_type* pb_type, const PbGraphNodeId& unique_index) const { /* Ensure that the pb_type is in the list */ std::map>::const_iterator it = pb_graph_node_unique_index_.find(pb_type); if (it == pb_graph_node_unique_index_.end()) { @@ -156,7 +156,7 @@ t_pb_graph_node* VprPbTypeAnnotation::pb_graph_node(t_pb_type* pb_type, const Pb return pb_graph_node_unique_index_.at(pb_type)[size_t(unique_index)]; } -t_pb_graph_node* VprPbTypeAnnotation::physical_pb_graph_node(t_pb_graph_node* pb_graph_node) const { +t_pb_graph_node* VprDeviceAnnotation::physical_pb_graph_node(t_pb_graph_node* pb_graph_node) const { /* Ensure that the pb_graph_node is in the list */ std::map::const_iterator it = physical_pb_graph_nodes_.find(pb_graph_node); if (it == physical_pb_graph_nodes_.end()) { @@ -165,7 +165,7 @@ t_pb_graph_node* VprPbTypeAnnotation::physical_pb_graph_node(t_pb_graph_node* pb return physical_pb_graph_nodes_.at(pb_graph_node); } -int VprPbTypeAnnotation::physical_pb_type_index_factor(t_pb_type* pb_type) const { +int VprDeviceAnnotation::physical_pb_type_index_factor(t_pb_type* pb_type) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_type_index_factors_.find(pb_type); if (it == physical_pb_type_index_factors_.end()) { @@ -175,7 +175,7 @@ int VprPbTypeAnnotation::physical_pb_type_index_factor(t_pb_type* pb_type) const return physical_pb_type_index_factors_.at(pb_type); } -int VprPbTypeAnnotation::physical_pb_type_index_offset(t_pb_type* pb_type) const { +int VprDeviceAnnotation::physical_pb_type_index_offset(t_pb_type* pb_type) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_type_index_offsets_.find(pb_type); if (it == physical_pb_type_index_offsets_.end()) { @@ -185,7 +185,7 @@ int VprPbTypeAnnotation::physical_pb_type_index_offset(t_pb_type* pb_type) const return physical_pb_type_index_offsets_.at(pb_type); } -int VprPbTypeAnnotation::physical_pb_pin_rotate_offset(t_port* pb_port) const { +int VprDeviceAnnotation::physical_pb_pin_rotate_offset(t_port* pb_port) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_pin_rotate_offsets_.find(pb_port); if (it == physical_pb_pin_rotate_offsets_.end()) { @@ -195,7 +195,7 @@ int VprPbTypeAnnotation::physical_pb_pin_rotate_offset(t_port* pb_port) const { return physical_pb_pin_rotate_offsets_.at(pb_port); } -int VprPbTypeAnnotation::physical_pb_pin_offset(t_port* pb_port) const { +int VprDeviceAnnotation::physical_pb_pin_offset(t_port* pb_port) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_pin_offsets_.find(pb_port); if (it == physical_pb_pin_offsets_.end()) { @@ -206,7 +206,7 @@ int VprPbTypeAnnotation::physical_pb_pin_offset(t_port* pb_port) const { } -t_pb_graph_pin* VprPbTypeAnnotation::physical_pb_graph_pin(t_pb_graph_pin* pb_graph_pin) const { +t_pb_graph_pin* VprDeviceAnnotation::physical_pb_graph_pin(t_pb_graph_pin* pb_graph_pin) const { /* Ensure that the pb_type is in the list */ std::map::const_iterator it = physical_pb_graph_pins_.find(pb_graph_pin); if (it == physical_pb_graph_pins_.end()) { @@ -218,7 +218,7 @@ t_pb_graph_pin* VprPbTypeAnnotation::physical_pb_graph_pin(t_pb_graph_pin* pb_gr /************************************************************************ * Public mutators ***********************************************************************/ -void VprPbTypeAnnotation::add_pb_type_physical_mode(t_pb_type* pb_type, t_mode* physical_mode) { +void VprDeviceAnnotation::add_pb_type_physical_mode(t_pb_type* pb_type, t_mode* physical_mode) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_modes_.find(pb_type); if (it != physical_pb_modes_.end()) { @@ -229,7 +229,7 @@ void VprPbTypeAnnotation::add_pb_type_physical_mode(t_pb_type* pb_type, t_mode* physical_pb_modes_[pb_type] = physical_mode; } -void VprPbTypeAnnotation::add_physical_pb_type(t_pb_type* operating_pb_type, t_pb_type* physical_pb_type) { +void VprDeviceAnnotation::add_physical_pb_type(t_pb_type* operating_pb_type, t_pb_type* physical_pb_type) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_types_.find(operating_pb_type); if (it != physical_pb_types_.end()) { @@ -240,7 +240,7 @@ void VprPbTypeAnnotation::add_physical_pb_type(t_pb_type* operating_pb_type, t_p physical_pb_types_[operating_pb_type] = physical_pb_type; } -void VprPbTypeAnnotation::add_physical_pb_port(t_port* operating_pb_port, t_port* physical_pb_port) { +void VprDeviceAnnotation::add_physical_pb_port(t_port* operating_pb_port, t_port* physical_pb_port) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_ports_.find(operating_pb_port); if (it != physical_pb_ports_.end()) { @@ -251,7 +251,7 @@ void VprPbTypeAnnotation::add_physical_pb_port(t_port* operating_pb_port, t_port physical_pb_ports_[operating_pb_port] = physical_pb_port; } -void VprPbTypeAnnotation::add_physical_pb_port_range(t_port* operating_pb_port, const BasicPort& port_range) { +void VprDeviceAnnotation::add_physical_pb_port_range(t_port* operating_pb_port, const BasicPort& port_range) { /* The port range must satify the port width*/ VTR_ASSERT((size_t)operating_pb_port->num_pins == port_range.get_width()); @@ -265,7 +265,7 @@ void VprPbTypeAnnotation::add_physical_pb_port_range(t_port* operating_pb_port, physical_pb_port_ranges_[operating_pb_port] = port_range; } -void VprPbTypeAnnotation::add_pb_type_circuit_model(t_pb_type* physical_pb_type, const CircuitModelId& circuit_model) { +void VprDeviceAnnotation::add_pb_type_circuit_model(t_pb_type* physical_pb_type, const CircuitModelId& circuit_model) { /* Warn any override attempt */ std::map::const_iterator it = pb_type_circuit_models_.find(physical_pb_type); if (it != pb_type_circuit_models_.end()) { @@ -276,7 +276,7 @@ void VprPbTypeAnnotation::add_pb_type_circuit_model(t_pb_type* physical_pb_type, pb_type_circuit_models_[physical_pb_type] = circuit_model; } -void VprPbTypeAnnotation::add_interconnect_circuit_model(t_interconnect* pb_interconnect, const CircuitModelId& circuit_model) { +void VprDeviceAnnotation::add_interconnect_circuit_model(t_interconnect* pb_interconnect, const CircuitModelId& circuit_model) { /* Warn any override attempt */ std::map::const_iterator it = interconnect_circuit_models_.find(pb_interconnect); if (it != interconnect_circuit_models_.end()) { @@ -287,7 +287,7 @@ void VprPbTypeAnnotation::add_interconnect_circuit_model(t_interconnect* pb_inte interconnect_circuit_models_[pb_interconnect] = circuit_model; } -void VprPbTypeAnnotation::add_interconnect_physical_type(t_interconnect* pb_interconnect, +void VprDeviceAnnotation::add_interconnect_physical_type(t_interconnect* pb_interconnect, const e_interconnect& physical_type) { /* Warn any override attempt */ std::map::const_iterator it = interconnect_physical_types_.find(pb_interconnect); @@ -299,7 +299,7 @@ void VprPbTypeAnnotation::add_interconnect_physical_type(t_interconnect* pb_inte interconnect_physical_types_[pb_interconnect] = physical_type; } -void VprPbTypeAnnotation::add_pb_circuit_port(t_port* pb_port, const CircuitPortId& circuit_port) { +void VprDeviceAnnotation::add_pb_circuit_port(t_port* pb_port, const CircuitPortId& circuit_port) { /* Warn any override attempt */ std::map::const_iterator it = pb_circuit_ports_.find(pb_port); if (it != pb_circuit_ports_.end()) { @@ -310,7 +310,7 @@ void VprPbTypeAnnotation::add_pb_circuit_port(t_port* pb_port, const CircuitPort pb_circuit_ports_[pb_port] = circuit_port; } -void VprPbTypeAnnotation::add_pb_type_mode_bits(t_pb_type* pb_type, const std::vector& mode_bits) { +void VprDeviceAnnotation::add_pb_type_mode_bits(t_pb_type* pb_type, const std::vector& mode_bits) { /* Warn any override attempt */ std::map>::const_iterator it = pb_type_mode_bits_.find(pb_type); if (it != pb_type_mode_bits_.end()) { @@ -321,11 +321,11 @@ void VprPbTypeAnnotation::add_pb_type_mode_bits(t_pb_type* pb_type, const std::v pb_type_mode_bits_[pb_type] = mode_bits; } -void VprPbTypeAnnotation::add_pb_graph_node_unique_index(t_pb_graph_node* pb_graph_node) { +void VprDeviceAnnotation::add_pb_graph_node_unique_index(t_pb_graph_node* pb_graph_node) { pb_graph_node_unique_index_[pb_graph_node->pb_type].push_back(pb_graph_node); } -void VprPbTypeAnnotation::add_physical_pb_graph_node(t_pb_graph_node* operating_pb_graph_node, +void VprDeviceAnnotation::add_physical_pb_graph_node(t_pb_graph_node* operating_pb_graph_node, t_pb_graph_node* physical_pb_graph_node) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_graph_nodes_.find(operating_pb_graph_node); @@ -340,7 +340,7 @@ void VprPbTypeAnnotation::add_physical_pb_graph_node(t_pb_graph_node* operating_ physical_pb_graph_nodes_[operating_pb_graph_node] = physical_pb_graph_node; } -void VprPbTypeAnnotation::add_physical_pb_type_index_factor(t_pb_type* pb_type, const int& factor) { +void VprDeviceAnnotation::add_physical_pb_type_index_factor(t_pb_type* pb_type, const int& factor) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_type_index_factors_.find(pb_type); if (it != physical_pb_type_index_factors_.end()) { @@ -351,7 +351,7 @@ void VprPbTypeAnnotation::add_physical_pb_type_index_factor(t_pb_type* pb_type, physical_pb_type_index_factors_[pb_type] = factor; } -void VprPbTypeAnnotation::add_physical_pb_type_index_offset(t_pb_type* pb_type, const int& offset) { +void VprDeviceAnnotation::add_physical_pb_type_index_offset(t_pb_type* pb_type, const int& offset) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_type_index_offsets_.find(pb_type); if (it != physical_pb_type_index_offsets_.end()) { @@ -362,7 +362,7 @@ void VprPbTypeAnnotation::add_physical_pb_type_index_offset(t_pb_type* pb_type, physical_pb_type_index_offsets_[pb_type] = offset; } -void VprPbTypeAnnotation::add_physical_pb_pin_rotate_offset(t_port* pb_port, const int& offset) { +void VprDeviceAnnotation::add_physical_pb_pin_rotate_offset(t_port* pb_port, const int& offset) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_pin_rotate_offsets_.find(pb_port); if (it != physical_pb_pin_rotate_offsets_.end()) { @@ -375,7 +375,7 @@ void VprPbTypeAnnotation::add_physical_pb_pin_rotate_offset(t_port* pb_port, con physical_pb_pin_offsets_[pb_port] = 0; } -void VprPbTypeAnnotation::add_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, +void VprDeviceAnnotation::add_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, t_pb_graph_pin* physical_pb_graph_pin) { /* Warn any override attempt */ std::map::const_iterator it = physical_pb_graph_pins_.find(operating_pb_graph_pin); diff --git a/openfpga/src/annotation/vpr_pb_type_annotation.h b/openfpga/src/annotation/vpr_device_annotation.h similarity index 98% rename from openfpga/src/annotation/vpr_pb_type_annotation.h rename to openfpga/src/annotation/vpr_device_annotation.h index add45e42d..0cd9ac63f 100644 --- a/openfpga/src/annotation/vpr_pb_type_annotation.h +++ b/openfpga/src/annotation/vpr_device_annotation.h @@ -1,5 +1,5 @@ -#ifndef VPR_PB_TYPE_ANNOTATION_H -#define VPR_PB_TYPE_ANNOTATION_H +#ifndef VPR_DEVICE_ANNOTATION_H +#define VPR_DEVICE_ANNOTATION_H /******************************************************************** * Include header files required by the data structure definition @@ -33,9 +33,9 @@ typedef vtr::StrongId PbGraphNodeId; * 3. what is the physical pb_type for an operating pb_type * 4. what is the mode pointer that represents the physical mode for a pb_type *******************************************************************/ -class VprPbTypeAnnotation { +class VprDeviceAnnotation { public: /* Constructor */ - VprPbTypeAnnotation(); + VprDeviceAnnotation(); public: /* Public accessors */ bool is_physical_pb_type(t_pb_type* pb_type) const; t_mode* physical_mode(t_pb_type* pb_type) const; diff --git a/openfpga/src/base/openfpga_context.h b/openfpga/src/base/openfpga_context.h index 743847114..aed6b8014 100644 --- a/openfpga/src/base/openfpga_context.h +++ b/openfpga/src/base/openfpga_context.h @@ -4,7 +4,7 @@ #include "vpr_context.h" #include "openfpga_arch.h" #include "vpr_netlist_annotation.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" #include "vpr_clustering_annotation.h" #include "vpr_routing_annotation.h" #include "device_rr_gsb.h" @@ -39,14 +39,14 @@ class OpenfpgaContext : public Context { public: /* Public accessors */ const openfpga::Arch& arch() const { return arch_; } - const openfpga::VprPbTypeAnnotation& vpr_pb_type_annotation() const { return vpr_pb_type_annotation_; } + const openfpga::VprDeviceAnnotation& vpr_device_annotation() const { return vpr_device_annotation_; } const openfpga::VprNetlistAnnotation& vpr_netlist_annotation() const { return vpr_netlist_annotation_; } const openfpga::VprClusteringAnnotation& vpr_clustering_annotation() const { return vpr_clustering_annotation_; } const openfpga::VprRoutingAnnotation& vpr_routing_annotation() const { return vpr_routing_annotation_; } const openfpga::DeviceRRGSB& device_rr_gsb() const { return device_rr_gsb_; } public: /* Public mutators */ openfpga::Arch& mutable_arch() { return arch_; } - openfpga::VprPbTypeAnnotation& mutable_vpr_pb_type_annotation() { return vpr_pb_type_annotation_; } + openfpga::VprDeviceAnnotation& mutable_vpr_device_annotation() { return vpr_device_annotation_; } openfpga::VprNetlistAnnotation& mutable_vpr_netlist_annotation() { return vpr_netlist_annotation_; } openfpga::VprClusteringAnnotation& mutable_vpr_clustering_annotation() { return vpr_clustering_annotation_; } openfpga::VprRoutingAnnotation& mutable_vpr_routing_annotation() { return vpr_routing_annotation_; } @@ -56,7 +56,7 @@ class OpenfpgaContext : public Context { openfpga::Arch arch_; /* Annotation to pb_type of VPR */ - openfpga::VprPbTypeAnnotation vpr_pb_type_annotation_; + openfpga::VprDeviceAnnotation vpr_device_annotation_; /* Naming fix to netlist */ openfpga::VprNetlistAnnotation vpr_netlist_annotation_; diff --git a/openfpga/src/base/openfpga_link_arch.cpp b/openfpga/src/base/openfpga_link_arch.cpp index 2519be57a..88f46571a 100644 --- a/openfpga/src/base/openfpga_link_arch.cpp +++ b/openfpga/src/base/openfpga_link_arch.cpp @@ -7,7 +7,7 @@ #include "vtr_assert.h" #include "vtr_log.h" -#include "vpr_pb_type_annotation.h" +#include "vpr_device_annotation.h" #include "pb_type_utils.h" #include "annotate_pb_types.h" #include "annotate_pb_graph.h" @@ -42,7 +42,7 @@ void link_arch(OpenfpgaContext& openfpga_context, * - circuit models for pb_type and pb interconnect */ annotate_pb_types(g_vpr_ctx.device(), openfpga_context.arch(), - openfpga_context.mutable_vpr_pb_type_annotation(), + openfpga_context.mutable_vpr_device_annotation(), cmd_context.option_enable(cmd, opt_verbose)); /* Annotate pb_graph_nodes @@ -51,7 +51,7 @@ void link_arch(OpenfpgaContext& openfpga_context, * - Bind pins from operating pb_graph_node to their physical pb_graph_node pins */ annotate_pb_graph(g_vpr_ctx.device(), - openfpga_context.mutable_vpr_pb_type_annotation(), + openfpga_context.mutable_vpr_device_annotation(), cmd_context.option_enable(cmd, opt_verbose)); /* Annotate net mapping to each rr_node