@@ -5421,11 +5421,13 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5421
5421
struct CoordParams {
5422
5422
std::string x_start, x_end, y_start, y_end;
5423
5423
std::string x_repeat = " " , x_incr = " " , y_repeat = " " , y_incr = " " ;
5424
-
5425
- CoordParams (const std::string& xs, const std::string& xe,
5426
- const std::string& ys, const std::string& ye)
5427
- : x_start(xs), x_end(xe), y_start(ys), y_end(ye) {}
5428
-
5424
+
5425
+ CoordParams (const std::string& xs, const std::string& xe, const std::string& ys, const std::string& ye)
5426
+ : x_start(xs)
5427
+ , x_end(xe)
5428
+ , y_start(ys)
5429
+ , y_end(ye) {}
5430
+
5429
5431
CoordParams () = default ;
5430
5432
};
5431
5433
@@ -5442,12 +5444,12 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5442
5444
expect_only_attributes (loc_spec_tag, {" type" , " priority" }, loc_data);
5443
5445
5444
5446
const std::vector<CoordParams> perimeter_edges = {
5445
- {" 0" , " 0" , " 0" , " H - 1" }, // left (including corners)
5446
- {" W - 1" , " W - 1" , " 0" , " H - 1" }, // right (including corners)
5447
- {" 1" , " W - 2" , " 0" , " 0" }, // bottom (excluding corners)
5448
- {" 1" , " W - 2" , " H - 1" , " H - 1" } // top (excluding corners)
5447
+ {" 0" , " 0" , " 0" , " H - 1" }, // left (including corners)
5448
+ {" W - 1" , " W - 1" , " 0" , " H - 1" }, // right (including corners)
5449
+ {" 1" , " W - 2" , " 0" , " 0" }, // bottom (excluding corners)
5450
+ {" 1" , " W - 2" , " H - 1" , " H - 1" } // top (excluding corners)
5449
5451
};
5450
-
5452
+
5451
5453
for (const auto & edge : perimeter_edges) {
5452
5454
t_vib_grid_loc_def edge_def (type_name, priority);
5453
5455
edge_def.x .start_expr = edge.x_start ;
@@ -5460,12 +5462,12 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5460
5462
expect_only_attributes (loc_spec_tag, {" type" , " priority" }, loc_data);
5461
5463
5462
5464
const std::vector<CoordParams> corner_positions = {
5463
- {" 0" , " 0" , " 0" , " 0" }, // bottom_left
5464
- {" 0" , " 0" , " H-1" , " H-1" }, // top_left
5465
- {" W-1" , " W-1" , " 0" , " 0" }, // bottom_right
5466
- {" W-1" , " W-1" , " H-1" , " H-1" } // top_right
5465
+ {" 0" , " 0" , " 0" , " 0" }, // bottom_left
5466
+ {" 0" , " 0" , " H-1" , " H-1" }, // top_left
5467
+ {" W-1" , " W-1" , " 0" , " 0" }, // bottom_right
5468
+ {" W-1" , " W-1" , " H-1" , " H-1" } // top_right
5467
5469
};
5468
-
5470
+
5469
5471
for (const auto & corner : corner_positions) {
5470
5472
t_vib_grid_loc_def corner_def (type_name, priority);
5471
5473
corner_def.x .start_expr = corner.x_start ;
@@ -5488,7 +5490,7 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5488
5490
5489
5491
const std::string x_pos = get_attribute (loc_spec_tag, " x" , loc_data).value ();
5490
5492
const std::string y_pos = get_attribute (loc_spec_tag, " y" , loc_data).value ();
5491
-
5493
+
5492
5494
t_vib_grid_loc_def single_def (type_name, priority);
5493
5495
single_def.x .start_expr = x_pos;
5494
5496
single_def.x .end_expr = x_pos + " + w - 1" ;
@@ -5499,54 +5501,54 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5499
5501
expect_only_attributes (loc_spec_tag, {" type" , " priority" , " startx" , " repeatx" , " starty" , " incry" }, loc_data);
5500
5502
5501
5503
const std::string start_x = get_attribute (loc_spec_tag, " startx" , loc_data).value ();
5502
-
5504
+
5503
5505
t_vib_grid_loc_def col_def (type_name, priority);
5504
5506
col_def.x .start_expr = start_x;
5505
5507
col_def.x .end_expr = start_x + " + w - 1" ;
5506
-
5508
+
5507
5509
// Handle optional attributes
5508
5510
auto repeat_attr = get_attribute (loc_spec_tag, " repeatx" , loc_data, ReqOpt::OPTIONAL);
5509
5511
if (repeat_attr) {
5510
5512
col_def.x .repeat_expr = repeat_attr.value ();
5511
5513
}
5512
-
5514
+
5513
5515
auto start_y_attr = get_attribute (loc_spec_tag, " starty" , loc_data, ReqOpt::OPTIONAL);
5514
5516
if (start_y_attr) {
5515
5517
col_def.y .start_expr = start_y_attr.value ();
5516
5518
}
5517
-
5519
+
5518
5520
auto incr_y_attr = get_attribute (loc_spec_tag, " incry" , loc_data, ReqOpt::OPTIONAL);
5519
5521
if (incr_y_attr) {
5520
5522
col_def.y .incr_expr = incr_y_attr.value ();
5521
5523
}
5522
-
5524
+
5523
5525
loc_defs.push_back (std::move (col_def));
5524
5526
5525
5527
} else if (loc_type == std::string (" row" )) {
5526
5528
expect_only_attributes (loc_spec_tag, {" type" , " priority" , " starty" , " repeaty" , " startx" , " incrx" }, loc_data);
5527
5529
5528
5530
const std::string start_y = get_attribute (loc_spec_tag, " starty" , loc_data).value ();
5529
-
5531
+
5530
5532
t_vib_grid_loc_def row_def (type_name, priority);
5531
5533
row_def.y .start_expr = start_y;
5532
5534
row_def.y .end_expr = start_y + " + h - 1" ;
5533
-
5535
+
5534
5536
// Handle optional attributes
5535
5537
auto repeat_attr = get_attribute (loc_spec_tag, " repeaty" , loc_data, ReqOpt::OPTIONAL);
5536
5538
if (repeat_attr) {
5537
5539
row_def.y .repeat_expr = repeat_attr.value ();
5538
5540
}
5539
-
5541
+
5540
5542
auto start_x_attr = get_attribute (loc_spec_tag, " startx" , loc_data, ReqOpt::OPTIONAL);
5541
5543
if (start_x_attr) {
5542
5544
row_def.x .start_expr = start_x_attr.value ();
5543
5545
}
5544
-
5546
+
5545
5547
auto incr_x_attr = get_attribute (loc_spec_tag, " incrx" , loc_data, ReqOpt::OPTIONAL);
5546
5548
if (incr_x_attr) {
5547
5549
row_def.x .incr_expr = incr_x_attr.value ();
5548
5550
}
5549
-
5551
+
5550
5552
loc_defs.push_back (std::move (row_def));
5551
5553
} else if (loc_type == std::string (" region" )) {
5552
5554
expect_only_attributes (loc_spec_tag,
@@ -5555,15 +5557,15 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5555
5557
" starty" , " endy" , " repeaty" , " incry" },
5556
5558
loc_data);
5557
5559
t_vib_grid_loc_def region_def (type_name, priority);
5558
-
5560
+
5559
5561
// Helper lambda to set optional attribute
5560
5562
auto set_optional_attr = [&](const char * attr_name, std::string& target) {
5561
5563
auto attr = get_attribute (loc_spec_tag, attr_name, loc_data, ReqOpt::OPTIONAL);
5562
5564
if (attr) {
5563
5565
target = attr.value ();
5564
5566
}
5565
5567
};
5566
-
5568
+
5567
5569
// Set all optional region attributes
5568
5570
set_optional_attr (" startx" , region_def.x .start_expr );
5569
5571
set_optional_attr (" endx" , region_def.x .end_expr );
@@ -5573,7 +5575,7 @@ static void process_vib_block_type_locs(t_vib_grid_def& grid_def,
5573
5575
set_optional_attr (" endy" , region_def.y .end_expr );
5574
5576
set_optional_attr (" repeaty" , region_def.y .repeat_expr );
5575
5577
set_optional_attr (" incry" , region_def.y .incr_expr );
5576
-
5578
+
5577
5579
loc_defs.push_back (std::move (region_def));
5578
5580
} else {
5579
5581
archfpga_throw (loc_data.filename_c_str (), loc_data.line (loc_spec_tag),
0 commit comments