Skip to content

Commit c314a5e

Browse files
committed
try to figure out why the errno=22 when reading vpr constraint file 2
1 parent 26c6712 commit c314a5e

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

vpr/src/base/gen/vpr_constraints_uxsdcxx.h

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,29 +543,39 @@ inline void load_partition(const pugi::xml_node& root, T& out, Context& context,
543543
(void)report_error;
544544
// Update current file offset in case an error is encountered.
545545
*offset_debug = root.offset_debug();
546-
546+
std::printf("load_partition 546 errno: %d\n", errno);
547547
for (pugi::xml_attribute attr = root.first_attribute(); attr; attr = attr.next_attribute()) {
548+
std::printf("load_partition 548 errno: %d\n", errno);
548549
atok_t_partition in = lex_attr_t_partition(attr.name(), report_error);
550+
std::printf("load_partition 550 errno: %d\n", errno);
549551
switch (in) {
550552
case atok_t_partition::NAME:
551553
out.set_partition_name(attr.value(), context);
554+
std::printf("load_partition 554 errno: %d\n", errno);
552555
break;
553556
default:
554557
break; /* Not possible. */
555558
}
556559
}
560+
std::printf("load_partition 560 errno: %d\n", errno);
557561

558562
// Preallocate arrays by counting child nodes (if any)
559563
size_t add_atom_count = 0;
560564
size_t add_region_count = 0;
561565
{
562566
int next, state = 1;
563567
for (pugi::xml_node node = root.first_child(); node; node = node.next_sibling()) {
568+
std::printf("load_partition 568 errno: %d\n", errno);
564569
*offset_debug = node.offset_debug();
570+
std::printf("load_partition 570 errno: %d\n", errno);
565571
gtok_t_partition in = lex_node_t_partition(node.name(), report_error);
572+
std::printf("load_partition 572 errno: %d\n", errno);
566573
next = gstate_t_partition[state][(int)in];
567-
if (next == -1)
574+
std::printf("load_partition 574 errno: %d\n", errno);
575+
if (next == -1) {
568576
dfa_error(gtok_lookup_t_partition[(int)in], gstate_t_partition[state], gtok_lookup_t_partition, 2, report_error);
577+
std::printf("load_partition 577 errno: %d\n", errno);
578+
}
569579
state = next;
570580
switch (in) {
571581
case gtok_t_partition::ADD_ATOM:
@@ -578,43 +588,68 @@ inline void load_partition(const pugi::xml_node& root, T& out, Context& context,
578588
break; /* Not possible. */
579589
}
580590
}
591+
std::printf("load_partition 591 errno: %d\n", errno);
581592

582593
out.preallocate_partition_add_atom(context, add_atom_count);
594+
std::printf("load_partition 594 errno: %d\n", errno);
583595
out.preallocate_partition_add_region(context, add_region_count);
596+
std::printf("load_partition 596 errno: %d\n", errno);
584597
}
585598
int next, state = 1;
586599
for (pugi::xml_node node = root.first_child(); node; node = node.next_sibling()) {
600+
std::printf("load_partition 600 errno: %d\n", errno);
587601
*offset_debug = node.offset_debug();
602+
std::printf("load_partition 602 errno: %d\n", errno);
588603
gtok_t_partition in = lex_node_t_partition(node.name(), report_error);
604+
std::printf("load_partition 604 errno: %d\n", errno);
589605
next = gstate_t_partition[state][(int)in];
590-
if (next == -1)
606+
if (next == -1) {
591607
dfa_error(gtok_lookup_t_partition[(int)in], gstate_t_partition[state], gtok_lookup_t_partition, 2, report_error);
608+
std::printf("load_partition 608 errno: %d\n", errno);
609+
}
592610
state = next;
593611
switch (in) {
594612
case gtok_t_partition::ADD_ATOM: {
613+
std::printf("load_partition 613 errno: %d\n", errno);
595614
auto child_context = out.add_partition_add_atom(context);
615+
std::printf("load_partition 615 errno: %d\n", errno);
596616
load_add_atom(node, out, child_context, report_error, offset_debug);
617+
std::printf("load_partition 617 errno: %d\n", errno);
597618
out.finish_partition_add_atom(child_context);
619+
std::printf("load_partition 619 errno: %d\n", errno);
598620
} break;
599621
case gtok_t_partition::ADD_REGION: {
600622
int add_region_x_high;
623+
std::printf("load_partition 623 errno: %d\n", errno);
601624
memset(&add_region_x_high, 0, sizeof(add_region_x_high));
625+
std::printf("load_partition 625 errno: %d\n", errno);
602626
int add_region_x_low;
603627
memset(&add_region_x_low, 0, sizeof(add_region_x_low));
628+
std::printf("load_partition 628 errno: %d\n", errno);
604629
int add_region_y_high;
605630
memset(&add_region_y_high, 0, sizeof(add_region_y_high));
631+
std::printf("load_partition 631 errno: %d\n", errno);
606632
int add_region_y_low;
607633
memset(&add_region_y_low, 0, sizeof(add_region_y_low));
634+
std::printf("load_partition 634 errno: %d\n", errno);
608635
load_add_region_required_attributes(node, &add_region_x_high, &add_region_x_low, &add_region_y_high, &add_region_y_low, report_error);
636+
std::printf("load_partition 636 errno: %d\n", errno);
609637
auto child_context = out.add_partition_add_region(context, add_region_x_high, add_region_x_low, add_region_y_high, add_region_y_low);
638+
std::printf("load_partition 638 errno: %d\n", errno);
610639
load_add_region(node, out, child_context, report_error, offset_debug);
640+
std::printf("load_partition 640 errno: %d\n", errno);
611641
out.finish_partition_add_region(child_context);
642+
std::printf("load_partition 642 errno: %d\n", errno);
612643
} break;
613644
default:
614645
break; /* Not possible. */
615646
}
616647
}
617-
if (state != 0) dfa_error("end of input", gstate_t_partition[state], gtok_lookup_t_partition, 2, report_error);
648+
std::printf("load_partition 648 errno: %d\n", errno);
649+
if (state != 0) {
650+
dfa_error("end of input", gstate_t_partition[state], gtok_lookup_t_partition, 2, report_error);
651+
std::printf("load_partition 651 errno: %d\n", errno);
652+
}
618653
}
619654

620655
constexpr int NUM_T_PARTITION_LIST_STATES = 2;

0 commit comments

Comments
 (0)