| 1 | package VIC::PIC::Functions::Chip; | ||||||||||||||||||||||||||||
| 2 | 31 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 31 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 31 | our $VERSION = '0.29'; | |||||||||||||||||||||||||||
| 5 | 31 | $VERSION = eval $VERSION; | |||||||||||||||||||||||||||
| 6 | 31 | ▶ | use Moo::Role; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | ##allow adjusting of this based on user input. for now fixed to this | ||||||||||||||||||||||||||||
| 9 | #string | ||||||||||||||||||||||||||||
| 10 | sub get_chip_config { | ||||||||||||||||||||||||||||
| 11 | 84 | ▶ | my $self = shift; | ||||||||||||||||||||||||||
|
Subroutine
get_chip_config: called CC=12 SCAR=28.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 12 | 84 | my $conf = $self->chip_config; | |||||||||||||||||||||||||||
| 13 | 84 | ▶ | return "\n" unless (defined $conf and ref $conf eq 'HASH'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $conf and ref $conf eq "HASH"
MC/DC0%0/2
defined $conf and ref $conf eq "HASH"
defined $conf
ref $conf eq "HASH"
Truth table33%1/3
A and B
A= defined $confB= ref $conf eq "HASH"
| |||||||||||||||||||||||||||||
| 14 | 84 | ▶ | my $onoff = $conf->{on_off} || {}; | ||||||||||||||||||||||||||
|
Condition50%1/2
$conf->{'on_off'} || {}
MC/DC0%0/1
$conf->{'on_off'} || {}
$conf->{'on_off'}
Truth table50%1/2
A
A= $conf->{'on_off'}
| |||||||||||||||||||||||||||||
| 15 | 84 | ▶ | my $clkout = $conf->{f_osc} || {}; | ||||||||||||||||||||||||||
|
Condition50%1/2
$conf->{'f_osc'} || {}
MC/DC0%0/1
$conf->{'f_osc'} || {}
$conf->{'f_osc'}
Truth table50%1/2
A
A= $conf->{'f_osc'}
| |||||||||||||||||||||||||||||
| 16 | 84 | ▶ | if ($self->pcl_size == 13) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 17 | 84 | my @flags = (); | |||||||||||||||||||||||||||
| 18 | 84 | foreach (keys %$onoff) { | |||||||||||||||||||||||||||
| 19 | 588 | ▶ | push @flags, "_$_" . ($onoff->{$_} ? '_ON' : '_OFF'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | 84 | foreach (keys %$clkout) { | |||||||||||||||||||||||||||
| 22 | 84 | ▶ | push @flags, "_$_" . ($clkout->{$_} ? '_NOCLKOUT' : '_CLKOUT'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | 84 | ▶ | return "\t__config (" . join(' & ', sort @flags) . ")\n" if @flags; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 25 | } elsif ($self->pcl_size == 21) { | ||||||||||||||||||||||||||||
| 26 | } else { | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | 0 | return "\n"; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 31 | 1; | |||||||||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||||||||||