blib/lib/Perlilog/sysclasses/site_init.pl

filter: Statementstmt 92.5% 25 / 27 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 87.5% 28 / 32 CC 3 SCAR 11.1
CC
3
Cov
87%
init
3.0
CRAP 3.0
« blib/lib/Perlilog/siteclasses/vars2vars.pl ↑ Summary blib/lib/Perlilog/PLerror.pm »
1 #
2 # This file is part of the Perlilog project.
3 #
4 # Copyright (C) 2003, Eli Billauer
5 #
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #
20 # A copy of the license can be found in a file named "licence.txt", at the
21 # root directory of this project.
22 #
23  
24 # This class contains only one method -- init.
25 # It includes the initialization associated with this current
26 # site (application and user independent).
27  
28 1 ▶sub init {
Subroutine init: called CC=3 SCAR=11.1
29 1 my $user_init_flag = 0;
30 1 my $home = "${Perlilog::home}Perlilog/siteclasses/";
31  
32 1 &Perlilog::inherit('template', "${home}template.pl", 'verilog');
33 1 &Perlilog::inherit('static', "${home}static.pl", 'verilog');
34 1 &Perlilog::inherit('silos', "${home}silos.pl", 'root');
35
36 1 &Perlilog::inherit('wbm', "${home}wbm.pl", 'port');
37 1 &Perlilog::inherit('wbs', "${home}wbs.pl", 'port');
38 1 &Perlilog::inherit('vars', "${home}vars.pl", 'port');
39
40 1 &Perlilog::inherit('vars2vars', "${home}vars2vars.pl", 'interface');
41 1 &Perlilog::interfaceclass('vars2vars');
42 1 &Perlilog::inherit('wbsimple', "${home}wbsimple.pl", 'interface');
43 1 &Perlilog::interfaceclass('wbsimple');
44 1 &Perlilog::inherit('vars2wbm', "${home}vars2wbm.pl", 'interface');
45 1 &Perlilog::interfaceclass('vars2wbm');
46 1 &Perlilog::inherit('wbsingmaster', "${home}wbsingmaster.pl", 'interface');
47 1 &Perlilog::interfaceclass('wbsingmaster');
48  
49 1 ▶ if (-e 'init.pl') { # Per-project init?
Branch: 1 branch
BranchTrueFalseTotal
if (-e "init.pl") 0 1 1
50 0 &Perlilog::inherit('user_init','init.pl','PL_hardroot');
51 0 $user_init_flag = 1;
52 }
53 1 $Perlilog::globalobject = global -> new(name => 'globalobject',
54 beginend => 'noreg');
55 1 $Perlilog::globalobject->set('filesdir','./PLverilog');
56 1 $Perlilog::globalobject->set('MAX_INTERFACE_REC', 5); # Maximal recursion in interface search
57 1 my $system = root -> new(name => 'systemobject');
58 1 $Perlilog::globalobject -> const('system', $system);
59 1 $system -> set('methods', qw(complete sanity generate instantiate headers epilogue files));
60 1 $Perlilog::interface_rec = undef; # Just to be on the safe side
61
62 1 ▶ user_init->init() if $user_init_flag;
Branch: 1 branch
BranchTrueFalseTotal
if $user_init_flag 0 1 1
63 }
« blib/lib/Perlilog/siteclasses/vars2vars.pl ↑ Summary blib/lib/Perlilog/PLerror.pm »