Commit 03d7eb98 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Warn about a FIU count of 0 at settings load time

Also, do not repeat warnings as errors in GUIs and during instrumentation.
parent 0b1c29e1
......@@ -305,7 +305,7 @@ sub read_settingsfile ($$$) {
if (defined $dup->{$fiu_ref->{'FIU_NET_NAME'}}) {
my $msg = "More than one FIU attached to ".$fiu_ref->{'FIU_NET_NAME'};
$logger->error($msg);
$logger->warn($msg);
$warn .= $msg;
} else {
$dup->{$fiu_ref->{'FIU_NET_NAME'}} = 1;
......@@ -317,7 +317,9 @@ sub read_settingsfile ($$$) {
}
if ($fiu_num == 0) {
$logger->debug("Could not fetch any FIU blocks from config file \"$fiji_ini_file\"");
my $msg = "No FIU blocks in config file \"$fiji_ini_file\". Synthesis would fail.";
$logger->warn($msg);
$warn .= $msg;
}
# FIU_NUM is optional in the Settings file... if it was set check that
......@@ -633,7 +635,6 @@ sub _validate_hashmap {
# The function deals with sanity checks for the values
# themselves. It checks for the following conditions:
#
# - FIU_NUM: > 0
# - FIU_CFG_BITS: > 0
# - TIMER_WIDTH: > 0, <= 16
# - ID: > 0, < 2^15-1
......@@ -667,7 +668,7 @@ sub _sanitize_design {
return sprintf("ID is invalid (0x%04X).", $consts_ref->{ID});
}
if (($consts_ref->{'BAUDRATE'} <= 0)) {
return "BAUDRATE missing is <= 0.";
return "BAUDRATE is <= 0.";
}
return $consts_ref;
......
......@@ -267,9 +267,8 @@ sub main {
my $filename = $settings_filename;
my ($tmp_settings, $warn) = FIJI::Settings->new('download', $filename);
if (defined($warn)) {
my $msg = "Settings file $filename could not be loaded correctly.";
$msg .= "\n$warn" if (defined($warn));
$logger->error($msg);
my $msg = "Settings file $filename could not be loaded correctly.\n$warn";
$logger->error($msg) if !$tmp_settings;
my $d = $self->{'mw'}->FIJIModalDialog(-image => (!defined($tmp_settings) ? Tk::FIJIUtils::error_image($self->{'mw'}) : Tk::FIJIUtils::alert_image($self->{'mw'})),
-wraplength => "200",
-text => $msg,
......
......@@ -115,11 +115,8 @@ sub main {
my ($settings_ref, $msg) = FIJI::Settings->new("setup", $options->{'fiji_settings_file'});
my $netlist_filename = $options->{'netlist_file'};
if (defined $msg) {
$logger->error($msg);
}
if (!ref($settings_ref)) {
$logger->error($msg);
return 1;
}
$self->{'settings'} = $settings_ref;
......
......@@ -135,10 +135,8 @@ sub main {
# Start out with default settings
#
my ($settings_ref, $msg) = FIJI::Settings->new();
if (defined $msg) {
$logger->error($msg);
}
if (!defined($settings_ref)) {
$logger->error($msg);
return 1;
}
$self->{'settings'} = $settings_ref;
......@@ -202,7 +200,7 @@ sub main {
($tmp_settings, $warn) = FIJI::Settings->new('setup', $filename);
if (defined($warn)) {
my $msg = "Settings file $filename could not be loaded correctly: $warn";
$logger->error($msg);
$logger->error($msg) if !$tmp_settings;
my $d = $self->{'mw'}->FIJIModalDialog(-image => (!defined($tmp_settings) ?
Tk::FIJIUtils::error_image($self->{'mw'}) :
Tk::FIJIUtils::alert_image($self->{'mw'})
......
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