Skip to content

Commit 1bfe098

Browse files
typos and comments
1 parent 1cb8d5d commit 1bfe098

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

libs/libarchfpga/src/physical_types.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,11 +1380,11 @@ class t_pb_graph_pin {
13801380
float thld = std::numeric_limits<float>::quiet_NaN(); /* For sequential logic elements the hold time */
13811381
float tco_min = std::numeric_limits<float>::quiet_NaN(); /* For sequential logic elements the minimum clock to output time */
13821382
float tco_max = std::numeric_limits<float>::quiet_NaN(); /* For sequential logic elements the maximum clock to output time */
1383-
t_pb_graph_pin* associated_clock_pin = nullptr; /* For sequentail elements, the associated clock */
1383+
t_pb_graph_pin* associated_clock_pin = nullptr; /* For sequential elements, the associated clock */
13841384

13851385
/* This member is used when flat-routing and has_choking_spot are enabled.
13861386
* It is used to identify choke points.
1387-
* This is only valid for IPINs, and it only contain the pins that are reachable to the pin by a forwarding path.
1387+
* This is only valid for IPINs, and it only contains the pins that are reachable to the pin by a forwarding path.
13881388
* It doesn't take into account feed-back connection.
13891389
* */
13901390
std::unordered_set<int> connected_sinks_ptc; /* ptc numbers of sinks which are directly or indirectly connected to this pin */
@@ -1708,7 +1708,7 @@ enum class BufferSize {
17081708
* parallel stream of pass transistors feeding into a buffer, *
17091709
* we would expect an additional "internal capacitance" *
17101710
* to arise when the pass transistor is enabled and the signal *
1711-
* must propogate to the buffer. See diagram of one stream below: *
1711+
* must propagate to the buffer. See diagram of one stream below: *
17121712
* *
17131713
* Pass Transistor *
17141714
* | *
@@ -1823,7 +1823,7 @@ struct t_rr_switch_inf {
18231823
SwitchType type() const;
18241824

18251825
//Returns true if this switch type isolates its input and output into
1826-
//seperate DC-connected subcircuits
1826+
//separate DC-connected subcircuits
18271827
bool buffered() const;
18281828

18291829
//Returns true if this switch type is configurable
@@ -1894,7 +1894,7 @@ struct t_wireconn_inf {
18941894
* elements (if 'from' is larger than 'to'), or in some elements of 'to' having
18951895
* no driving connections (if 'to' is larger than 'from').
18961896
* 'to': The number of generated connections is set equal to the size of the 'to' set.
1897-
* This ensures that each element of the 'to' set has precisely one incomming connection.
1897+
* This ensures that each element of the 'to' set has precisely one incoming connection.
18981898
* Note: this may result in 'from' elements driving multiple 'to' elements (if 'to' is
18991899
* larger than 'from'), or some 'from' elements driving to 'to' elements (if 'from' is
19001900
* larger than 'to')
@@ -1948,7 +1948,7 @@ struct t_switchblock_inf {
19481948
e_directionality directionality; /* the directionality of this switchblock (unidir/bidir) */
19491949

19501950
int x = -1; /* The exact x-axis location that this SB is used, meaningful when type is set to E_XY_specified */
1951-
int y = -1; /* The exact y-axis location that this SB is used, meanignful when type is set to E_XY_specified */
1951+
int y = -1; /* The exact y-axis location that this SB is used, meaningful when type is set to E_XY_specified */
19521952

19531953
/* We can also define a region to apply this SB to all locations falls into this region using regular expression in the architecture file*/
19541954
t_sb_loc_spec reg_x;

libs/libarchfpga/src/read_xml_arch_file.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,14 @@ static bool attribute_to_bool(const pugi::xml_node node,
368368
const pugi::xml_attribute attr,
369369
const pugiutil::loc_data& loc_data);
370370

371-
static int find_switch_by_name(const std::vector<t_arch_switch_inf>& switches, const std::string& switch_name);
371+
/**
372+
* @brief Searches for a switch whose matches with the given name.
373+
* @param switches Contains all the architecture switches.
374+
* @param switch_name The name with which switch names are compared.
375+
* @return A negative integer if no switch was found with the given name; otherwise
376+
* the index of the matching switch is returned.
377+
*/
378+
static int find_switch_by_name(const std::vector<t_arch_switch_inf>& switches, std::string_view switch_name);
372379

373380
static e_side string_to_side(const std::string& side_str);
374381

@@ -4722,10 +4729,9 @@ static void ProcessPower(pugi::xml_node parent,
47224729
}
47234730
}
47244731

4725-
/* Get the clock architcture */
4732+
/* Get the clock architecture */
47264733
static void ProcessClocks(pugi::xml_node Parent, t_clock_arch* clocks, const pugiutil::loc_data& loc_data) {
47274734
pugi::xml_node Node;
4728-
int i;
47294735
const char* tmp;
47304736

47314737
clocks->num_global_clocks = count_children(Parent, "clock", loc_data, ReqOpt::OPTIONAL);
@@ -4740,7 +4746,7 @@ static void ProcessClocks(pugi::xml_node Parent, t_clock_arch* clocks, const pug
47404746

47414747
/* Load the clock info. */
47424748
Node = get_first_child(Parent, "clock", loc_data);
4743-
for (i = 0; i < clocks->num_global_clocks; ++i) {
4749+
for (int i = 0; i < clocks->num_global_clocks; ++i) {
47444750
tmp = get_attribute(Node, "buffer_size", loc_data).value();
47454751
if (strcmp(tmp, "auto") == 0) {
47464752
clocks->clock_inf[i].autosize_buffer = true;
@@ -4778,7 +4784,7 @@ static bool attribute_to_bool(const pugi::xml_node node,
47784784
return false;
47794785
}
47804786

4781-
static int find_switch_by_name(const std::vector<t_arch_switch_inf>& switches, const std::string& switch_name) {
4787+
static int find_switch_by_name(const std::vector<t_arch_switch_inf>& switches, std::string_view switch_name) {
47824788
for (int iswitch = 0; iswitch < (int)switches.size(); ++iswitch) {
47834789
const t_arch_switch_inf& arch_switch = switches[iswitch];
47844790
if (arch_switch.name == switch_name) {

0 commit comments

Comments
 (0)