File Coverage

blib/lib/Perlilog/sysclasses/site_init.pl
Criterion Covered Total %
statement 25 27 92.5
branch 2 4 50.0
condition n/a
subroutine 1 1 100.0
pod n/a
total 28 32 87.5


line stmt bran cond sub pod time code
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             sub init {
29 1     1   1 my $user_init_flag = 0;
30 1         3 my $home = "${Perlilog::home}Perlilog/siteclasses/";
31              
32 1         4 &Perlilog::inherit('template', "${home}template.pl", 'verilog');
33 1         5 &Perlilog::inherit('static', "${home}static.pl", 'verilog');
34 1         2 &Perlilog::inherit('silos', "${home}silos.pl", 'root');
35            
36 1         2 &Perlilog::inherit('wbm', "${home}wbm.pl", 'port');
37 1         2 &Perlilog::inherit('wbs', "${home}wbs.pl", 'port');
38 1         2 &Perlilog::inherit('vars', "${home}vars.pl", 'port');
39            
40 1         2 &Perlilog::inherit('vars2vars', "${home}vars2vars.pl", 'interface');
41 1         2 &Perlilog::interfaceclass('vars2vars');
42 1         2 &Perlilog::inherit('wbsimple', "${home}wbsimple.pl", 'interface');
43 1         1 &Perlilog::interfaceclass('wbsimple');
44 1         2 &Perlilog::inherit('vars2wbm', "${home}vars2wbm.pl", 'interface');
45 1         2 &Perlilog::interfaceclass('vars2wbm');
46 1         2 &Perlilog::inherit('wbsingmaster', "${home}wbsingmaster.pl", 'interface');
47 1         1 &Perlilog::interfaceclass('wbsingmaster');
48              
49 1 50       13 if (-e 'init.pl') { # Per-project init?
50 0         0 &Perlilog::inherit('user_init','init.pl','PL_hardroot');
51 0         0 $user_init_flag = 1;
52             }
53 1         16 $Perlilog::globalobject = global -> new(name => 'globalobject',
54             beginend => 'noreg');
55 1         15 $Perlilog::globalobject->set('filesdir','./PLverilog');
56 1         1 $Perlilog::globalobject->set('MAX_INTERFACE_REC', 5); # Maximal recursion in interface search
57 1         2 my $system = root -> new(name => 'systemobject');
58 1         2 $Perlilog::globalobject -> const('system', $system);
59 1         3 $system -> set('methods', qw(complete sanity generate instantiate headers epilogue files));
60 1         1 $Perlilog::interface_rec = undef; # Just to be on the safe side
61            
62 1 50       4 user_init->init() if $user_init_flag;
63             }