Skip to content

Commit 66c60f1

Browse files
authored
Merge pull request #3208 from verilog-to-routing/openfpga_fix
OpenFPGA Patch
2 parents 4003770 + 42257bf commit 66c60f1

File tree

6 files changed

+25
-5
lines changed

6 files changed

+25
-5
lines changed

libs/libarchfpga/src/physical_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ enum e_pin_type {
171171
enum e_interconnect {
172172
COMPLETE_INTERC = 1,
173173
DIRECT_INTERC = 2,
174-
MUX_INTERC = 3
174+
MUX_INTERC = 3,
175+
NUM_INTERC_TYPES = 4
175176
};
176177

177178
/* pin location distributions */

libs/librrgraph/src/base/rr_graph_builder.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ void RRGraphBuilder::create_edge_in_cache(RRNodeId src, RRNodeId dest, RRSwitchI
188188
is_incoming_edge_dirty_ = true;
189189
}
190190

191+
void RRGraphBuilder::create_edge(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped) {
192+
edges_to_build_.emplace_back(src, dest, size_t(edge_switch), remapped);
193+
is_edge_dirty_ = true; /* Adding a new edge revokes the flag */
194+
is_incoming_edge_dirty_ = true;
195+
}
196+
191197
void RRGraphBuilder::build_edges(const bool& uniquify) {
192198
if (uniquify) {
193199
std::sort(edges_to_build_.begin(), edges_to_build_.end());

libs/librrgraph/src/base/rr_graph_builder.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ class RRGraphBuilder {
298298
* @note This will not add an edge to storage. You need to call build_edges() after all the edges are cached. */
299299
void create_edge_in_cache(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped);
300300

301+
/** @brief Add a new edge to the cache of edges to be built
302+
* @note This will not add an edge to storage! You need to call build_edges() after all the edges are cached! */
303+
void create_edge(RRNodeId src, RRNodeId dest, RRSwitchId edge_switch, bool remapped);
304+
301305
/** @brief Allocate and build actual edges in storage.
302306
* Once called, the cached edges will be uniquified and added to routing resource nodes,
303307
* while the cache will be empty once build-up is accomplished
@@ -392,6 +396,13 @@ class RRGraphBuilder {
392396
return node_storage_.count_rr_switches(arch_switch_inf, arch_switch_fanins);
393397
}
394398

399+
/** @brief Unlock storage; required to modify an routing resource graph after edge is read */
400+
inline void unlock_storage() {
401+
node_storage_.edges_read_ = false;
402+
node_storage_.partitioned_ = false;
403+
node_storage_.clear_node_first_edge();
404+
}
405+
395406
/** @brief Reserve the lists of nodes, edges, switches etc. to be memory efficient.
396407
* This function is mainly used to reserve memory space inside RRGraph,
397408
* when adding a large number of nodes/edge/switches/segments,

libs/libvtrutil/src/vtr_geometry.tpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <limits>
2+
13
#include "vtr_assert.h"
24

35
namespace vtr {

vpr/src/util/vpr_utils.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ static AtomPinId find_atom_pin_for_pb_route_id(ClusterBlockId clb, int pb_route_
4040

4141
static bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::regex& blif_model_regex);
4242
static bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::regex& blif_model_regex);
43-
static t_pb_graph_pin** alloc_and_load_pb_graph_pin_lookup_from_index(t_logical_block_type_ptr type);
44-
static void free_pb_graph_pin_lookup_from_index(t_pb_graph_pin** pb_graph_pin_lookup_from_type);
4543

4644
/******************** Subroutine definitions *********************************/
4745

@@ -1020,7 +1018,7 @@ static void load_pb_graph_pin_lookup_from_index_rec(t_pb_graph_pin** pb_graph_pi
10201018
}
10211019

10221020
/* Create a lookup that returns a pb_graph_pin pointer given the pb_graph_pin index */
1023-
static t_pb_graph_pin** alloc_and_load_pb_graph_pin_lookup_from_index(t_logical_block_type_ptr type) {
1021+
t_pb_graph_pin** alloc_and_load_pb_graph_pin_lookup_from_index(t_logical_block_type_ptr type) {
10241022
t_pb_graph_pin** pb_graph_pin_lookup_from_type = nullptr;
10251023

10261024
t_pb_graph_node* pb_graph_head = type->pb_graph_head;
@@ -1048,7 +1046,7 @@ static t_pb_graph_pin** alloc_and_load_pb_graph_pin_lookup_from_index(t_logical_
10481046
}
10491047

10501048
/* Free pb_graph_pin lookup array */
1051-
static void free_pb_graph_pin_lookup_from_index(t_pb_graph_pin** pb_graph_pin_lookup_from_type) {
1049+
void free_pb_graph_pin_lookup_from_index(t_pb_graph_pin** pb_graph_pin_lookup_from_type) {
10521050
if (pb_graph_pin_lookup_from_type == nullptr) {
10531051
return;
10541052
}

vpr/src/util/vpr_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ t_pb_graph_pin* get_pb_graph_node_pin_from_model_port_pin(const t_model_ports* m
190190
/// pb_graph_node.
191191
t_pb_graph_pin* get_pb_graph_node_pin_from_pb_graph_node(t_pb_graph_node* pb_graph_node, int ipin);
192192
t_pb_graph_pin* get_pb_graph_node_pin_from_block_pin(ClusterBlockId iblock, int ipin);
193+
t_pb_graph_pin** alloc_and_load_pb_graph_pin_lookup_from_index(t_logical_block_type_ptr type);
193194
vtr::vector<ClusterBlockId, t_pb**> alloc_and_load_pin_id_to_pb_mapping();
195+
void free_pb_graph_pin_lookup_from_index(t_pb_graph_pin** pb_graph_pin_lookup_from_type);
194196
void free_pin_id_to_pb_mapping(vtr::vector<ClusterBlockId, t_pb**>& pin_id_to_pb_mapping);
195197

196198
std::tuple<t_physical_tile_type_ptr, const t_sub_tile*, int, t_logical_block_type_ptr> get_cluster_blk_physical_spec(ClusterBlockId cluster_blk_id);

0 commit comments

Comments
 (0)