Skip to content

Commit 63ccaf7

Browse files
fix bug in parsing pb_type_name.port_name[end_pin_index:start_pin_index]
1 parent f0a0a42 commit 63ccaf7

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

vpr/src/util/vpr_utils.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <regex>
33
#include <algorithm>
44
#include <sstream>
5-
#include <cstring>
65

76
#include "pack_types.h"
87
#include "prepack.h"
@@ -26,10 +25,6 @@
2625
/* This module contains subroutines that are used in several unrelated parts *
2726
* of VPR. They are VPR-specific utility routines. */
2827

29-
/* This defines the maximum string length that could be parsed by functions *
30-
* in vpr_utils. */
31-
static constexpr size_t MAX_STRING_LEN = 512;
32-
3328
/******************** File-scope variables declarations **********************/
3429
//Regular expressions used to determine register and logic primitives
3530
//TODO: Make this set-able from command-line?
@@ -88,8 +83,7 @@ const t_model_ports* find_model_port(const t_model* model, const std::string& na
8883
* print tabs given number of tabs to file
8984
*/
9085
void print_tabs(FILE* fpout, int num_tab) {
91-
int i;
92-
for (i = 0; i < num_tab; i++) {
86+
for (int i = 0; i < num_tab; i++) {
9387
fprintf(fpout, "\t");
9488
}
9589
}
@@ -1638,7 +1632,7 @@ std::tuple<int, int, std::string, std::string> parse_direct_pin_name(std::string
16381632

16391633
// Replace '.' and '[' characters with ' '
16401634
std::replace_if(source_string.begin(), source_string.end(),
1641-
[](char c) { return c == '.' || c == '['; },
1635+
[](char c) { return c == '.' || c == '[' || c == ':' || c == ']'; },
16421636
' ');
16431637

16441638
std::istringstream source_iss(source_string);
@@ -2059,7 +2053,7 @@ std::vector<int> get_cluster_netlist_intra_tile_pins_at_loc(const int layer,
20592053
const auto& cluster_pin_chains = pin_chains_num[cluster_blk_id];
20602054
const auto& cluster_chain_sinks = pin_chains[cluster_blk_id].chain_sink;
20612055
const auto& cluster_pin_chain_idx = pin_chains[cluster_blk_id].pin_chain_idx;
2062-
// remove common elements betweeen cluster_pin_chains.
2056+
// remove common elements between cluster_pin_chains.
20632057
for (auto pin : cluster_internal_pins) {
20642058
auto it = cluster_pin_chains.find(pin);
20652059
if (it == cluster_pin_chains.end()) {

vpr/src/util/vpr_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ std::string rr_node_arch_name(RRNodeId inode, bool is_flat);
135135
* Intra-Logic Block Utility Functions
136136
**************************************************************/
137137

138-
//Class for looking up pb graph pins from block pin indicies
138+
//Class for looking up pb graph pins from block pin indices
139139
class IntraLbPbPinLookup {
140140
public:
141141
IntraLbPbPinLookup(const std::vector<t_logical_block_type>& block_types);

0 commit comments

Comments
 (0)