@@ -530,6 +530,7 @@ class FunctionalIRConstruction {
530
530
memories[mem.cell ] = &mem;
531
531
}
532
532
}
533
+ private:
533
534
Node concatenate_read_results (Mem *mem, vector<Node> results)
534
535
{
535
536
// sanity check: all read ports concatenated should equal to the RD_DATA port
@@ -632,6 +633,17 @@ class FunctionalIRConstruction {
632
633
}
633
634
}
634
635
}
636
+ void undriven (const char *name) {
637
+ log_error (" The design contains an undriven signal %s. This is not supported by the functional backend. "
638
+ " Call setundef with appropriate options to avoid this error.\n " , name);
639
+ }
640
+ // we perform this check separately to give better error messages that include the wire or port name
641
+ void check_undriven (DriveSpec const & spec, std::string const & name) {
642
+ for (auto const &chunk : spec.chunks ())
643
+ if (chunk.is_none ())
644
+ undriven (name.c_str ());
645
+ }
646
+ public:
635
647
void process_queue ()
636
648
{
637
649
for (; !queue.empty (); queue.pop_front ()) {
@@ -660,6 +672,7 @@ class FunctionalIRConstruction {
660
672
factory.update_pending (pending, node);
661
673
} else {
662
674
DriveSpec driver = driver_map (DriveSpec (wire_chunk));
675
+ check_undriven (driver, RTLIL::unescape_id (wire_chunk.wire ->name ));
663
676
Node node = enqueue (driver);
664
677
factory.suggest_name (node, wire_chunk.wire ->name );
665
678
factory.update_pending (pending, node);
@@ -677,6 +690,7 @@ class FunctionalIRConstruction {
677
690
factory.update_pending (pending, node);
678
691
} else {
679
692
DriveSpec driver = driver_map (DriveSpec (port_chunk));
693
+ check_undriven (driver, RTLIL::unescape_id (port_chunk.cell ->name ) + " port " + RTLIL::unescape_id (port_chunk.port ));
680
694
factory.update_pending (pending, enqueue (driver));
681
695
}
682
696
} else {
@@ -692,8 +706,7 @@ class FunctionalIRConstruction {
692
706
log_error (" Signal %s has multiple drivers. This is not supported by the functional backend. "
693
707
" If tristate drivers are used, call tristate -formal to avoid this error.\n " , log_signal (chunk));
694
708
} else if (chunk.is_none ()) {
695
- log_error (" The design contains an undriven signal %s. This is not supported by the functional backend. "
696
- " Call setundef with appropriate options to avoid this error.\n " , log_signal (chunk));
709
+ undriven (log_signal (chunk));
697
710
} else {
698
711
log_error (" unhandled drivespec: %s\n " , log_signal (chunk));
699
712
log_abort ();
0 commit comments