Commit e3c9456d authored by Stefan Tauner's avatar Stefan Tauner
Browse files

FIJISettingsViewer: name nets that don't match the netlist

Previously, FIJI Setup told the user only that some nets in the settings
file do not match the supplied netlist but did not state their names.
This patch adds this output to the log and GUI dialogs.

Also, fix some indentions.
parent 6542f247
......@@ -134,18 +134,20 @@ sub netlist {
my @n = map { $_->{'path'} . FIJI::Netlist::HIERSEP . $_->{'name'} } @{$nets};
$self->{'nets'} = \@n;
$self->{'netlist'} = $netlist;
$self->{'nets_ok'} = 1;
$self->{'bad_nets'} = "";
$self->update();
if ($self->{'nets_ok'} != 1) {
my $msg = "Some nets defined in the specified netlist do not match the loaded settings.";
if ($self->{'bad_nets'} ne "") {
my $msg = "Some nets defined in the specified settings do not match the loaded netlist:\n$self->{'bad_nets'}";
$logger->error($msg);
my $warning_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-text => $msg . "\n" . "Proceed with new netlist nevertheless?",
-wraplength => 200,
-title => 'Warning',
-buttons => [qw/~Yes ~No/]);
my $warning_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-text => $msg . "\n" . "Proceed with new netlist nevertheless?",
-wraplength => 400,
-title => 'Warning',
-buttons => [qw/~Yes ~No/],
);
my $rv = $warning_dialog->Show();
if (!defined $rv || $rv eq "No") {
......@@ -179,18 +181,20 @@ sub settings {
# tk:trace for canvas update
$self->traceVariable($self->{'settings'}->{'design'}, 'w' => [\&_update_canvas, $self]);
$self->traceVariable($self->{'settings'}->{'fius'}, 'w' => [\&_update_canvas, $self]);
$self->{'nets_ok'} = 1;
$self->{'bad_nets'} = "";
$self->update();
if (defined $self->{'nets'} && $self->{'nets_ok'} != 1) {
my $msg = "Some nets defined in the specified settings do not match the loaded netlist.";
if (defined $self->{'nets'} && $self->{'bad_nets'} ne "") {
my $msg = "Some nets defined in the specified settings do not match the loaded netlist:\n$self->{'bad_nets'}";
$logger->info($msg);
my $warning_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-text => $msg . "\n" . "Proceed with new netlist nevertheless?",
-wraplength => 200,
-title => 'Warning',
-buttons => [qw/~Yes ~No/]);
my $warning_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-text => $msg . "\n" . "Proceed with new netlist nevertheless?",
-wraplength => 400,
-title => 'Warning',
-buttons => [qw/~Yes ~No/],
);
my $rv = $warning_dialog->Show();
if (!defined $rv || $rv eq "No") {
......@@ -265,10 +269,12 @@ sub update {
my $msg = "Could not find FIJI definition for constant named \"$name\"";
$logger->error($msg);
my $error_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-text => 'Something went horribly wrong!',
-wraplength => 200,
-title => 'Warning',);
my $error_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-text => 'Something went horribly wrong!',
-wraplength => 200,
-title => 'Warning',
);
$error_dialog->Show();
return;
......@@ -584,10 +590,12 @@ sub _populate_widget {
if (defined $rv) {
$logger->warn($rv);
$logger->error($rv);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $self->screenwidth,
-text => "$rv",
-title => "Warning",);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $self->screenwidth,
-text => "$rv",
-title => "Warning",
);
$warn_dialog->Show();
} elsif (@{$netname} > 0) {
$self->{'settings'}->{'design'}->{$k} = @{$netname}[0];
......@@ -907,10 +915,12 @@ sub _add_multiple_fius {
my $rv = $self->_select_net_dialog($netnames,"Select Nets to be instrumented",1);
if (defined $rv) {
$logger->warn($rv);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $self->screenwidth,
-text => "$rv",
-title => "Warning",);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $self->screenwidth,
-text => "$rv",
-title => "Warning",
);
$warn_dialog->Show();
} elsif (@{$netnames} > 0) {
for my $netname (@{$netnames}) {
......@@ -939,10 +949,12 @@ sub _add_multiple_fius {
if (defined $rvd || defined $rvn) {
my $msg = ((defined $rvd) ? $rvd : "").((defined $rvn) ? $rvn : "");
$logger->warn($msg);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $self->screenwidth,
-text => "$msg",
-title => "Warning",);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $self->screenwidth,
-text => "$msg",
-title => "Warning",
);
$warn_dialog->Show();
}
}
......@@ -1034,10 +1046,12 @@ sub _add_fiu ($$) {
my $rv = $self->_select_net_dialog($netname,"Select Net for FIU $i");
if (defined $rv) {
$logger->warn($rv);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $fr_fiu->screenwidth,
-text => "$rv",
-title => "Warning",);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $fr_fiu->screenwidth,
-text => "$rv",
-title => "Warning",
);
$warn_dialog->Show();
} elsif (@{$netname} > 0 && @{$netname}[0] ne "") {
@{$self->{'settings'}->{'fius'}}[$i]->{'FIU_NET_NAME'} = @{$netname}[0];
......@@ -1055,10 +1069,12 @@ sub _add_fiu ($$) {
if (defined $rvd || defined $rvn) {
my $msg = ((defined $rvd) ? $rvd : "").((defined $rvn) ? $rvn : "");
$logger->warn($msg);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $fr_fiu->screenwidth,
-text => "$msg",
-title => "Warning",);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $fr_fiu->screenwidth,
-text => "$msg",
-title => "Warning",
);
$warn_dialog->Show();
}
......@@ -1074,10 +1090,12 @@ sub _add_fiu ($$) {
my $rv = $self->_select_driver_dialog($i);
if (defined $rv) {
$logger->warn($rv);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $fr_fiu->screenwidth,
-text => "$rv",
-title => "Warning",);
my $warn_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::alert_image($self->{'mw'}),
-wraplength => $fr_fiu->screenwidth,
-text => "$rv",
-title => "Warning",
);
$warn_dialog->Show();
} else {
$self->_indicate_warning($drv_entry, 0);
......@@ -1276,10 +1294,12 @@ sub _set_fields_by_button {
} elsif (${$button->cget('-variable')} && ${$f->cget('-variable')}) {
${$button->cget('-variable')} = 0;
my $error_dialog = $self->{'mw'}->FIJIModalDialog(-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-wraplength => 200,
-text => "\"" . $f->{'description'} . "\"\nforbids\n\"" . $button->{'description'} . "\".",
-title => "Error",);
my $error_dialog = $self->{'mw'}->FIJIModalDialog(
-image => Tk::FIJIUtils::error_image($self->{'mw'}),
-wraplength => 200,
-text => "\"" . $f->{'description'} . "\"\nforbids\n\"" . $button->{'description'} . "\".",
-title => "Error",
);
$error_dialog->Show();
}
}
......@@ -1441,8 +1461,8 @@ sub _validate_net_entry {
if (defined $self->{'netlist'}) {
$ok = $self->_validate_against_list($widget, $self->{'nets'}, $new);
if (defined $ok && defined $self->{'nets_ok'} && $new ne "") {
$self->{'nets_ok'} &= ($ok);
if (defined $ok && defined($self->{'bad_nets'}) && $new ne "") {
$self->{'bad_nets'} .= "$new\n" if not $ok;
}
if (defined($widget->{'dependents'})) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment