line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VIC::PIC::P18F252; |
2
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
47
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.32'; |
5
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
6
|
1
|
|
|
1
|
|
6
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
extends 'VIC::PIC::P18F242'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# role CodeGen |
10
|
|
|
|
|
|
|
has type => (is => 'ro', default => 'p18f252'); |
11
|
|
|
|
|
|
|
has include => (is => 'ro', default => 'p18f252.inc'); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# all memory is in bytes |
14
|
|
|
|
|
|
|
has memory => (is => 'ro', default => sub { |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
flash => 16384, # words |
17
|
|
|
|
|
|
|
SRAM => 1536, |
18
|
|
|
|
|
|
|
EEPROM => 256, |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
}); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has address => (is => 'ro', default => sub { |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
# high # low |
25
|
|
|
|
|
|
|
isr => [ 0x0008, 0x0018 ], |
26
|
|
|
|
|
|
|
reset => [ 0x0000 ], |
27
|
|
|
|
|
|
|
range => [ 0x0000, 0x7FFF ], |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
}); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
has banks => (is => 'ro', default => sub { |
32
|
|
|
|
|
|
|
{ |
33
|
|
|
|
|
|
|
count => 16, |
34
|
|
|
|
|
|
|
size => 0x100, |
35
|
|
|
|
|
|
|
gpr => { |
36
|
|
|
|
|
|
|
0 => [ 0x000, 0x0FF], |
37
|
|
|
|
|
|
|
1 => [ 0x100, 0x1FF], |
38
|
|
|
|
|
|
|
2 => [ 0x200, 0x2FF], |
39
|
|
|
|
|
|
|
3 => [ 0x300, 0x3FF], |
40
|
|
|
|
|
|
|
4 => [ 0x400, 0x4FF], |
41
|
|
|
|
|
|
|
5 => [ 0x500, 0x5FF], |
42
|
|
|
|
|
|
|
}, |
43
|
|
|
|
|
|
|
# remapping of these addresses automatically done by chip |
44
|
|
|
|
|
|
|
common => [ [0x000, 0x07F], [0xF80, 0xFFF] ], |
45
|
|
|
|
|
|
|
remap => [], |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
}); |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=encoding utf8 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
VIC::PIC::P18F252 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 SYNOPSIS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
A class that describes the code to be generated for each specific |
60
|
|
|
|
|
|
|
microcontroller that maps the VIC syntax back into assembly. This is the |
61
|
|
|
|
|
|
|
back-end to VIC's front-end. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 DESCRIPTION |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
INTERNAL CLASS. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Vikas N Kumar |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Copyright (c) 2014. Vikas N Kumar |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
76
|
|
|
|
|
|
|
under the same terms as Perl itself. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
See http://www.perl.com/perl/misc/Artistic.html |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |