Commit 6f491239 authored by Stefan Tauner's avatar Stefan Tauner
Browse files

Settings: preserve trailing space when saving/loading escaped identifieres

Config::Simple intentionally removes trailing spaces m(
Solution: add quotes if need be... appatently they get removed automatically as well!
parent d42e3436
......@@ -687,7 +687,7 @@ use constant DISPLAYGROUPS => \%displaygroups;
# - natural: values must be oct, hex, binary strings looking like a real number.
# - hexadecimal: values must be hexadecimal numbers.
# - boolean: will be convert to a truth value by Perl semantics
# - net: name of a net from the input netlist
# - net: hierarchical path of a net from the input netlist
# - values (optional) used to restrict valid values. Can be...
# - an array reference listing all valid values (emulates an enum)
# - a code reference to a function that gets the new and old values and
......@@ -703,6 +703,7 @@ BEGIN {
FIU_NET_NAME => {
ini_name => "NET_NAME",
default => "",
type => 'net',
phases_opt => [qw(setup)],
},
FIU_DRIVER_TYPE => {
......@@ -713,8 +714,9 @@ BEGIN {
},
FIU_DRIVER_PATH => {
ini_name => "DRIVER_PATH",
phases_opt => [qw(setup)],
default => "",
type => 'net',
phases_opt => [qw(setup)],
},
FIU_MODEL => {
ini_name => "FAULT_MODEL",
......
......@@ -108,9 +108,13 @@ sub _export_value {
# } elsif ($map_ref->{$k}->{'type'} eq 'natural') {
# } elsif ($map_ref->{$k}->{'type'} eq 'boolean') {
$logger->trace("Converted value of $k (\"$orig\") to \"${$v_ref}\".") if ($orig ne ${$v_ref});
} elsif ($map_ref->{$k}->{'type'} eq 'net') {
# Due to an annoying behavior of Config::Simple we have to enclose
# escaped identifiers with quotes. These are necessary to preserve spaces.
if (substr($orig, -1) eq ' ') {
${$v_ref} = "\"$orig\"";
}
}
# } elsif (defined($map_ref->{$k}->{'values'})) {
}
}
......@@ -485,10 +489,10 @@ sub validate_value {
# @function _rename_import (%$map_ref, %$consts_ref)
# Rename and convert entries in consts_ref according to map_ref.
#
# This function takes a hash of FIJI Settings and converts its contents
# to the respective internal representation. This allows to use different
# names and value representations in the external file than within the
# implementation.
# This function takes a hash of FIJI Settings and converts its keys
# to the respective internal representation. This allows us to use different
# name representations in the external file than within the implementation.
#
#
# \returns $consts_ref, or undef on errors
sub _rename_import {
......
; FIJI::ConfigSorted 0.1
; Tue Mar 15 17:44:08 2016
; Fri Mar 18 18:18:09 2016
[CONSTS]
BAUDRATE=115200
CFGS_PER_MSG=2
CLOCK_NET=top|clk
CLOCK_NET="top|\\clk*oida\\na "
FAULT_DETECT_1_EN=0
FAULT_DETECT_1_INVERT=0
FAULT_DETECT_1_NAME=
......@@ -42,10 +42,10 @@ TRIGGER_EXT_IN_NAME=s_fiji_trigger_ext_i
TX_OUT_NAME=s_fiji_tx_o
[FIU0]
DRIVER_PATH=top|~\\****w****
DRIVER_PATH="top|~\\****w**** "
DRIVER_TYPE=ASSIGN
FAULT_MODEL=RUNTIME
LFSR_MASK=0x7
NET_NAME=top|\\++++n++++
NET_NAME="top|\\++++n++++ "
......@@ -4,9 +4,9 @@
// DRIVEN: ASSIGN, single-bit net
module top (
i, o, clk
i, o, \clk*oida\na
);
input clk;
input \clk*oida\na ;
input i;
output o;
wire \****w**** ;
......@@ -17,4 +17,4 @@ assign o = \++++n++++ ;
cascade cell1 (.in(i), .out(\****w**** ));
endmodule
\ No newline at end of file
endmodule
Markdown is supported
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