Commit a3a91f8e authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

Disable only if the key an entry depends on is found in the reference map.

Addresses Issue #73
parent 7fff3824
......@@ -722,8 +722,19 @@ sub _sanitize_fiu {
sub _disabled_via_dependency {
my ($map_ref, $consts_ref, $k) = @_;
my $dependency = $map_ref->{$k}->{'depends_on'};
return defined($dependency) && $map_ref->{$k}->{'type'} eq 'boolean' && !$consts_ref->{$dependency};
my $depends_on = $map_ref->{$k}->{'depends_on'};
# If we can't find the template for an entry in $map_ref, we assume
# everything's OK.
# Rationale: We would need to pass >1 different maps to cross-check
# entries defined in other maps (e.g., FIU_LFSR_MASK in the FIUMAP depends on LFSR_MASK in the DESIGNMAP)
# For an entry to be disabled by a dependency, ...
return defined($depends_on) && # ... it must depend on something
defined($map_ref->{$depends_on}) && # ... that something must be found in the map
$map_ref->{$depends_on}->{'type'} eq 'boolean' && # ... that something must be of type boolean
!$consts_ref->{$depends_on}; # ... that something must be set to false
sub _validate_hashmap {
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