From 921bf7dd7bac1f4303936cc41562e4d8a063b530 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Fri, 21 Feb 2020 20:45:22 -0700 Subject: [PATCH] use constant in device annotation --- openfpga/src/annotation/vpr_device_annotation.cpp | 8 ++++---- openfpga/src/annotation/vpr_device_annotation.h | 6 +++--- openfpga/src/utils/physical_pb_utils.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openfpga/src/annotation/vpr_device_annotation.cpp b/openfpga/src/annotation/vpr_device_annotation.cpp index dfbcde112..0787e0225 100644 --- a/openfpga/src/annotation/vpr_device_annotation.cpp +++ b/openfpga/src/annotation/vpr_device_annotation.cpp @@ -206,9 +206,9 @@ int VprDeviceAnnotation::physical_pb_pin_offset(t_port* pb_port) const { } -t_pb_graph_pin* VprDeviceAnnotation::physical_pb_graph_pin(t_pb_graph_pin* pb_graph_pin) const { +t_pb_graph_pin* VprDeviceAnnotation::physical_pb_graph_pin(const 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); + std::map::const_iterator it = physical_pb_graph_pins_.find(pb_graph_pin); if (it == physical_pb_graph_pins_.end()) { return nullptr; } @@ -409,10 +409,10 @@ void VprDeviceAnnotation::add_physical_pb_pin_rotate_offset(t_port* pb_port, con physical_pb_pin_offsets_[pb_port] = 0; } -void VprDeviceAnnotation::add_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, +void VprDeviceAnnotation::add_physical_pb_graph_pin(const 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); + std::map::const_iterator it = physical_pb_graph_pins_.find(operating_pb_graph_pin); if (it != physical_pb_graph_pins_.end()) { VTR_LOG_WARN("Override the annotation between operating pb_graph_pin '%s' and it physical pb_graph_pin '%s'!\n", operating_pb_graph_pin->port->name, physical_pb_graph_pin->port->name); diff --git a/openfpga/src/annotation/vpr_device_annotation.h b/openfpga/src/annotation/vpr_device_annotation.h index 1cfdcd412..00209df5c 100644 --- a/openfpga/src/annotation/vpr_device_annotation.h +++ b/openfpga/src/annotation/vpr_device_annotation.h @@ -70,7 +70,7 @@ class VprDeviceAnnotation { * The accumulated offset will be reset to 0 when it exceeds the msb() of the physical port */ int physical_pb_pin_offset(t_port* pb_port) const; - t_pb_graph_pin* physical_pb_graph_pin(t_pb_graph_pin* pb_graph_pin) const; + t_pb_graph_pin* physical_pb_graph_pin(const t_pb_graph_pin* pb_graph_pin) const; CircuitModelId rr_switch_circuit_model(const RRSwitchId& rr_switch) const; CircuitModelId rr_segment_circuit_model(const RRSegmentId& rr_segment) const; ArchDirectId direct_annotation(const size_t& direct) const; @@ -91,7 +91,7 @@ class VprDeviceAnnotation { void add_physical_pb_type_index_factor(t_pb_type* pb_type, const float& factor); void add_physical_pb_type_index_offset(t_pb_type* pb_type, const int& offset); void add_physical_pb_pin_rotate_offset(t_port* pb_port, const int& offset); - void add_physical_pb_graph_pin(t_pb_graph_pin* operating_pb_graph_pin, t_pb_graph_pin* physical_pb_graph_pin); + void add_physical_pb_graph_pin(const t_pb_graph_pin* operating_pb_graph_pin, t_pb_graph_pin* physical_pb_graph_pin); void add_rr_switch_circuit_model(const RRSwitchId& rr_switch, const CircuitModelId& circuit_model); void add_rr_segment_circuit_model(const RRSegmentId& rr_segment, const CircuitModelId& circuit_model); void add_direct_annotation(const size_t& direct, const ArchDirectId& arch_direct_id); @@ -169,7 +169,7 @@ class VprDeviceAnnotation { std::map physical_pb_graph_nodes_; /* Pair a pb_graph_pin to a physical pb_graph_pin */ - std::map physical_pb_graph_pins_; + std::map physical_pb_graph_pins_; /* Pair a Routing Resource Switch (rr_switch) to a circuit model */ std::map rr_switch_circuit_models_; diff --git a/openfpga/src/utils/physical_pb_utils.cpp b/openfpga/src/utils/physical_pb_utils.cpp index ec668a7d3..777f2ad0c 100644 --- a/openfpga/src/utils/physical_pb_utils.cpp +++ b/openfpga/src/utils/physical_pb_utils.cpp @@ -127,7 +127,7 @@ void update_primitive_physical_pb_pin_atom_net(PhysicalPb& phy_pb, VTR_ASSERT(atom_net); /* Find the physical pb_graph_pin */ - t_pb_graph_pin* physical_pb_graph_pin = device_annotation.physical_pb_graph_pin((t_pb_graph_pin*)pb_graph_pin); + t_pb_graph_pin* physical_pb_graph_pin = device_annotation.physical_pb_graph_pin(pb_graph_pin); VTR_ASSERT(nullptr != physical_pb_graph_pin); /* Check if the pin has been mapped to a net.