File Coverage

blib/lib/Verilog/Netlist/Defparam.pm
Criterion Covered Total %
statement 19 27 70.3
branch 1 2 50.0
condition 1 2 50.0
subroutine 7 11 63.6
pod 3 7 42.8
total 31 49 63.2


line stmt bran cond sub pod time code
1             # Verilog - Verilog Perl Interface
2             # See copyright, etc in below POD section.
3             ######################################################################
4              
5             package Verilog::Netlist::Defparam;
6              
7 8     8   56 use Verilog::Netlist;
  8         17  
  8         238  
8 8     8   42 use Verilog::Netlist::Subclass;
  8         13  
  8         471  
9 8     8   47 use vars qw($VERSION @ISA);
  8         13  
  8         380  
10 8     8   51 use strict;
  8         17  
  8         2892  
11             @ISA = qw(Verilog::Netlist::Defparam::Struct
12             Verilog::Netlist::Subclass);
13              
14             $VERSION = '3.478';
15              
16             structs('new',
17             'Verilog::Netlist::Defparam::Struct'
18             =>[name => '$', #' # Unique ID
19             keyword => '$', #' # Keyword name
20             filename => '$', #' # Filename this came from
21             lineno => '$', #' # Linenumber this came from
22             userdata => '%', # User information
23             attributes => '%', #' # Misc attributes for systemperl or other processors
24             #
25             lhs => '$', #' # Left hand side of assignment
26             rhs => '$', #' # Right hand side of assignment
27             module => '$', #' # Module reference
28             ]);
29              
30             sub delete {
31 0     0 0 0 my $self = shift;
32 0         0 my $h = $self->module->_statements;
33 0         0 delete $h->{$self->name};
34 0         0 return undef;
35             }
36              
37             ######################################################################
38             #### Methods
39              
40             sub logger {
41 0     0 1 0 my $self = shift;
42 0         0 return $self->netlist->logger;
43             }
44             sub netlist {
45 0     0 1 0 my $self = shift;
46 0         0 return $self->module->netlist;
47             }
48              
49       3 0   sub lint {}
50       0 0   sub link {}
51              
52             sub verilog_text {
53 2     2 0 4 my $self = shift;
54 2         32 my @out = ($self->keyword," ",$self->lhs," = ",$self->rhs,";");
55 2 50       29 return (wantarray ? @out : join('',@out));
56             }
57              
58             sub dump {
59 3     3 1 6 my $self = shift;
60 3   50     21 my $indent = shift||0;
61 3         69 print " "x$indent,"Defparam:",$self->keyword," lhs:",$self->lhs," rhs:",$self->rhs;
62 3         34 print "\n";
63             }
64              
65             ######################################################################
66             #### Package return
67             1;
68             __END__