5 Copyright (C) 2012-2014, Molnar Karoly <molnarkaroly@users.sf.net>
7 This file is part of SDCC.
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any damages
11 arising from the use of this software.
13 Permission is granted to anyone to use this software for any purpose,
14 including commercial applications, and to alter it and redistribute it
15 freely, subject to the following restrictions:
17 1. The origin of this software must not be misrepresented; you must not
18 claim that you wrote the original software. If you use this software
19 in a product, an acknowledgment in the product documentation would be
20 appreciated but is not required.
22 2. Altered source versions must be plainly marked as such, and must not be
23 misrepresented as being the original software.
25 3. This notice may not be removed or altered from any source distribution.
27 ================================================================================
29 Proposal for use: ./pic14-header-parser.pl -gp
31 This program creates seven files in the actual directory:
41 In these the MCUs can be seen in groups, according to a periphery.
42 These informations helps to realize the handling of periphery.
43 Of course necessary to study the data sheets as well.
51 no if $] >= 5.018, warnings
=> "experimental::smartmatch"; # perl 5.16
53 use feature
'switch'; # Starting from 5.10.1.
54 use POSIX
'ULONG_MAX';
56 use constant FALSE
=> 0;
57 use constant TRUE
=> 1;
59 use constant P_NO_SHOW_BITS
=> 0;
60 use constant P_NO_SHOW_IF_EMPTY
=> 1;
61 use constant P_ALWAYS_SHOW
=> 2;
62 use constant P_SHOW_ONLY_NAME
=> 3;
66 '/usr/share/sdcc/non-free/include',
67 '/usr/share/sdcc/include',
68 '/usr/local/share/sdcc/non-free/include',
69 '/usr/local/share/sdcc/include'
72 my $default_port = 'pic14';
73 my $header_name_filter = 'pic1[026][a-z]+\d+([a-z]|([a-z]+\d+)?).h';
76 my $out_tail = '.gen';
77 my $peri_group = 'peripheral.groups';
78 my $table_border = (' ' x
19) . '+' . ('---------+' x
8);
80 my %reg_addresses = ();
82 my @some_ADC_registers =
84 'ADCON\d+[HL]?|AD\d*CON\d*',
91 #-----------------------------------------------
94 The structure of one element of the @periphery_table array.
102 PRINT_MODE => P_ALWAYS_SHOW
114 my @periphery_table = ();
116 #-----------------------------------------------
119 The structure of one element of the @io_table_by_mcu hash:
136 my %io_table_by_mcu = ();
138 #-----------------------------------------------
141 The structure of one element of the @io_dir_table_by_mcu hash:
155 my %io_dir_table_by_mcu = ();
157 #-----------------------------------------------
160 The structure of one element of the @mcu_raw array:
163 NAME => '', The name of MCU.
164 ENHANCED => 0, This is enhanced MCU.
165 REG_REFS => { Accelerate searching of the registers.
166 'PIR1' => register_reference, ---+
167 'TRISD' => register_reference, ---|---+
171 REG_ARRAY => [ The array of registers. | .
173 NAME => 'PIR1', The name of register.
174 ADDRESS => 0, The address of register.
175 BITNAMES => [ The bits of register.
176 [], The names of bit.
197 #-----------------------------------------------
200 The structure of one element of the @mcu_filtered and @mcu_groups arrays:
203 NAME => '', The name of MCU.
204 ENHANCED => 0, This is enhanced MCU.
205 IN_GROUP => 0, This member of a MCU group.
206 REG_REFS => { Accelerate searching of the registers.
207 'PIR1' => register_reference, ----------------------+
208 'TRISD' => register_reference, ----------------------|---+
212 REG_GROUPS => [ The group of all necessary register. | .
213 { The first register group. | .
214 VALID_REGS => '', The valid names of registers. |
215 VALID_BITS => '', The valid names of bits. |
216 PRINT_MODE => 0, The mode of print. |
217 REG_ARRAY => [ The array of registers. |
218 { A register. <-----+
219 NAME => 'PIR1', The name of register.
220 ADDRESS => 0, The address of register.
221 GROUP => undef, Back reference of REG_GROUPS.
222 TOUCHED => 0, Touched register during the search.
223 EMPTY => 0, True if the register became empty after the filtering.
224 BITNAMES => [ The bits of register.
225 [], The names of bit.
245 { The last register group.
251 my @mcu_filtered = ();
255 my %definitions = ();
258 #-----------------------------------------------
268 my $peri_groups = '';
270 ################################################################################
271 ################################################################################
272 ################################################################################
273 ################################################################################
277 return ($_[0] =~ /([^\/]+)$/) ?
$1 : '';
280 #-------------------------------------------------------------------------------
284 return if (pop(@_) > $verbose);
285 foreach (@_) { print STDERR
$_; }
289 #-------------------------------------------------------------------------------
293 foreach (@_) { print $out_handler $_; }
296 #-------------------------------------------------------------------------------
301 print $out_handler "\n";
304 #-------------------------------------------------------------------------------
308 printf $out_handler (shift(@_), @_);
311 #-------------------------------------------------------------------------------
316 print $out_handler "\n";
319 #-------------------------------------------------------------------------------
323 my ($Str1, $Str2) = @_;
325 if (${$Str1} =~ /^\d/o && ${$Str2} =~ /^\d/o)
327 # $Str1 number and $Str2 number
328 return (int(${$Str1}) <=> int(${$Str2}));
331 return (${$Str1} cmp ${$Str2});
334 #-------------------------------------------------------------------------------
338 my @a_s = ($_[0] =~ /(\d+|\D+)/go);
339 my @b_s = ($_[1] =~ /(\d+|\D+)/go);
340 my ($i, $k, $end, $ret);
361 for ($i = 0; $i < $end; ++$i)
363 $k = smartCompare
(\
$a_s[$i], \
$b_s[$i]);
365 return $k if ($k != 0);
371 #-------------------------------------------------------------------------------
373 sub exist_in_list
($$)
375 my ($List, $Member) = @_;
379 return TRUE
if ($Member =~ /^$_$/);
385 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
386 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
387 #@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@
388 #@@@@@@@@@@@@@@@@@@@@@ Populates the peripheral table. @@@@@@@@@@@@@@@@@@@@@@@
389 #@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@
390 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
391 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
400 push(@periphery_table, $peri);
401 return $peri->{REGS
};
404 #-------------------------------------------------------------------------------
411 PRINT_MODE
=> P_ALWAYS_SHOW
414 push(@
{$_[0]}, $def);
417 #-------------------------------------------------------------------------------
419 sub resolve_define
($)
422 my $ig = \@
{$io_groups{$Name}};
426 if (defined($ig) && scalar(@
{$ig}) > 0)
430 $r = $definitions{$_};
431 push(@array, ((defined($r)) ?
$r : $_));
436 $r = $definitions{$Name};
437 push(@array, ((defined($r)) ?
$r : $Name));
443 #-------------------------------------------------------------------------------
447 my ($Mcu_group, $Peri, $Pins) = @_;
454 if ($_ !~ /^(\w+):(\S+)$/o)
456 print STDERR
"This piece is wrong: \"$_\" (" . join(',', @
{$Mcu_group}) . ")\n";
463 foreach (split('/', $2))
465 if ($_ =~ /^(\w+)\[(\d+)-(\d+)\]$/o)
467 # This is a section. E.g.: "RI[0-8]"
469 my ($name, $first, $second) = ($1, int($2), int($3));
471 if ($first > $second)
473 print STDERR
"\"$_\" The first number ($first) greather than the second number ($second)!\n";
477 while ($first <= $second)
479 push(@ports, @
{resolve_define
("$name$first")});
485 # This is a name. E.g.: "RD7" or "RO2"
487 push(@ports, @
{resolve_define
($_)});
489 } # foreach (split('/', $2))
491 $pin_groups{$io} = [ sort {$a cmp $b} @ports ];
492 } # foreach (@{$Pins})
494 foreach $mcu (@
{$Mcu_group})
496 foreach $io (keys(%pin_groups))
498 $io_table_by_mcu{$mcu}->{$Peri}{$io} = [ @
{$pin_groups{$io}} ];
503 #-------------------------------------------------------------------------------
507 my ($Mcu_group, $Peri, $Pins) = @_;
509 my ($mcu, $io, $dir);
514 if ($_ !~ /^(\w+):([01])$/o)
516 print STDERR
"This piece is wrong: \"$_\" (" . join(',', @
{$Mcu_group}) . ")\n";
521 @ports = @
{resolve_define
($1)};
525 print STDERR
"Only one I/O line can be specified: \"$_\" (" . join(',', @
{$Mcu_group}) . ")\n";
529 $pin_groups{$ports[0]} = $dir;
530 } # foreach (@{$Pins})
532 foreach $mcu (@
{$Mcu_group})
534 foreach $io (keys(%pin_groups))
536 $io_dir_table_by_mcu{$mcu}->{$Peri}{$io} = $pin_groups{$io};
541 #-------------------------------------------------------------------------------
543 sub load_periphery_data
()
545 my $periphery = undef;
548 my ($line, $block, $key, $val);
550 foreach (grep(! /^\s*$|^\s*#/o, <DATA
>))
553 s/#.*$//o; # Remove ending comment.
554 s/^\s*|\s*$//go; # Remove starting and ending whitespaces.
557 if ($line =~ /^BEGIN=(\S+)$/o)
563 when (['IO_TABLE', 'DEFINE', 'GROUP'])
567 when (/^(PERIPHERY):(\w+)$/o)
570 $periphery = add_periphery
($2);
575 if (! defined($periphery))
577 print STDERR
"There is no periphery to which can be assigned the following register.\n";
581 add_reg_def
($periphery);
584 when (/^(MCU):(\S+)$/o)
587 @mcu_group = split(',', $2);
592 print STDERR
"Unknown block: \"$block\"\n";
597 push(@blocks, $block);
599 } # if ($line =~ /^BEGIN=(\S+)$/o)
600 elsif ($line =~ /^END=(\S+)$/o)
604 if (scalar(@blocks) == 0 || $blocks[$#blocks] ne $block)
606 print STDERR
"The \"$block\" block has no beginning!\n";
612 when ('PERIPHERY') { $periphery = undef; }
613 when ('MCU') { @mcu_group = (); }
616 $block = pop(@blocks);
618 } # elsif ($line =~ /^END=(\w+)$/o)
620 #...................................
622 $block = (scalar(@blocks) > 0) ?
$blocks[$#blocks] : '';
628 if ($line =~ /^([^=]+)=(.*)$/o)
630 # This a key -- value pair.
632 if (scalar(@
{$periphery}) == 0)
634 print STDERR
"No entry of the register table!\n";
638 ($key, $val) = ($1, $2);
639 # Reference of the last member.
640 my $peri_r = \
%{$periphery->[$#{$periphery}]};
642 if ($val =~ /^['"]([^'"]*)['"]$/o)
646 $peri_r->{$key} = $1;
652 $peri_r->{$key} = eval($val);
655 } # when ('REGISTER')
659 if ($line !~ /^([^=]+)=(.*)$/o)
661 print STDERR
"This is not key -- value pair: $line\n";
665 ($key, $val) = ($1, $2);
667 if (defined($val) && $val ne '')
669 $definitions{$key} = $val;
675 delete($definitions{$key});
681 if ($line !~ /^([^=]+)=(.*)$/o)
683 print STDERR
"This is not group -- members definition: $line\n";
687 @
{$io_groups{$1}} = split(',', $2);
692 if ($line =~ /^([^=]+)=(.*)$/o)
694 my ($peri, $val) = (lc($1), $2);
696 if ($val =~ /^([^=]+)=(.*)$/o)
698 # It is possible that this is a property.
707 my @pins = split(',', $val);
709 add_io_dir
(\
@mcu_group, $peri, \
@pins);
714 print STDERR
"This is unknown property definition: $line\n";
721 my @pins = split(',', $val);
723 add_io_pins
(\
@mcu_group, $peri, \
@pins);
725 } # if ($line =~ /^([^=]+)=(.*)$/o)
728 } # foreach (grep(! /^\s*$|^\s*#/o, <DATA>))
730 if (scalar(@blocks) > 0)
732 print STDERR
"The \"$blocks[$#blocks]\" block has no ending!\n";
737 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
738 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
739 #@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@
740 #@@@@@@@@@@@@@ Load all registers, which will find in a header. @@@@@@@@@@@@@@
741 #@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@
742 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
743 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
747 my $Name = uc($_[0]);
749 Log
("add_mcu_raw(): $Name", 9);
758 push(@mcu_raw, $mcu_ref);
762 #-------------------------------------------------------------------------------
764 sub add_register_raw
($$$)
766 my ($Mcu_raw, $Name, $Address) = @_;
768 $Mcu_raw->{ENHANCED
} = TRUE
if ($Name eq 'STATUS_SHAD');
770 Log
(sprintf("add_register_raw(): $Name, 0x%04X", $Address), 9);
778 push(@
{$Mcu_raw->{REG_ARRAY
}}, $reg);
779 $Mcu_raw->{REG_REFS
}->{$Name} = $reg;
782 #-------------------------------------------------------------------------------
784 sub read_regs_from_header
($$)
786 my ($Mcu_ref, $Fname) = @_;
787 my $path = "$include_path/$Fname";
788 my ($fh, $name, $addr, $bit_addr, $bitnames, $width);
790 if (! open($fh, '<', $path))
792 print STDERR
"\a\t$0 : Can not open the $path header file!\n";
796 Log
("read_regs_from_header(): $path", 6);
799 foreach (grep(! /^\s*$/o, <$fh>))
807 Log
(">>>>: $line", 7);
809 if ($line =~ /^#include\s+"(\S+)"$/o)
811 &read_regs_from_header
($Mcu_ref, $1);
813 elsif ($line =~ /^#\s*define\s+(\w+_ADDR)\s+0[xX]([[:xdigit:]]+)$/o)
815 Log
("reg_addresses\{$1\} = hex($2)", 8);
816 $reg_addresses{$1} = hex($2);
818 elsif ($line =~ /^extern\b/o &&
819 $line =~ /\b__sfr\b/o &&
820 (($addr) = ($line =~ /\b__at\s*\(\s*0[xX]([[:xdigit:]]+)\s*\)/o)) &&
821 (($name) = ($line =~ /\b(\w+)\s*;$/o)))
823 # extern __at(0x0000) __sfr INDF;
824 # extern __sfr __at(0x0003) STATUS;
827 add_register_raw
($Mcu_ref, $name, hex($addr));
829 elsif ($line =~ /^extern\s+__sfr\s+__at\s*\((\w+_ADDR)\)\s+(\w+);$/o)
831 # extern __sfr __at (EEDATA_ADDR) EEDATA;
834 if (! defined($reg_addresses{$1}))
836 print STDERR
"This register: $2 not have address!\n";
840 add_register_raw
($Mcu_ref, $2, $reg_addresses{$1});
842 elsif ($line =~ /\bstruct\b/o)
844 Log
("\tbit_addr = 0", 8);
847 elsif ($line =~ /^unsigned(?:\s+char|\s+int)?\s*:\s*(\d+)\s*;$/o)
855 Log
("\tbit_addr += $width ($bit_addr)", 8);
857 elsif ($line =~ /^unsigned(?:\s+char|\s+int)?\s*(\w+)\s*:\s*(\d+)\s*;$/o)
859 # unsigned char PCFG2:1;
860 # unsigned int PSA:1;
864 ($name, $width) = ($1, int($2));
868 Log
("\tpush(bitnames->\[$bit_addr\], $name)", 8);
869 push(@
{$bitnames->[$bit_addr]}, $name);
877 Log
("\tbit_addr += $width ($bit_addr)", 8);
879 elsif ($line =~ /^\}\s*(?:__)?(\w+)bits_t\s*;$/o || $line =~ /^\}\s*(?:__)?(\w+)_t\s*;$/o)
881 my $reg_ref = $Mcu_ref->{REG_REFS
}->{$1};
883 if (! defined($reg_ref))
885 print STDERR
"This register: $1 not have data structure!\n";
889 Log
("\treg_ref : $reg_ref)", 8);
890 $reg_ref->{BITNAMES
} = $bitnames;
893 } # foreach (grep(! /^\s*$/o, <$fh>))
897 if ($Mcu_ref->{ENHANCED
})
899 push(@enhanced, lc($Mcu_ref->{NAME
}));
903 push(@regular, lc($Mcu_ref->{NAME
}));
906 my $array = \@
{$Mcu_ref->{REG_ARRAY
}};
908 return if (scalar(@
{$array}) == 0);
910 # Within the array sorts by name the registers.
912 @
{$array} = sort {smartSort
($a->{NAME
}, $b->{NAME
})} @
{$array};
915 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
916 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
917 #@@@@@@@@@@ @@@@@@@@@@@
918 #@@@@@@@@@ To periphery fitting in a manner, filters the registers. @@@@@@@@@@
919 #@@@@@@@@@@ @@@@@@@@@@@
920 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
921 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
925 my ($Peri_regs, $Mcu_raw) = @_;
928 NAME
=> $Mcu_raw->{NAME
},
929 ENHANCED
=> $Mcu_raw->{ENHANCED
},
935 Log
("add_mcu($mcu->{NAME})", 8);
937 # Copies the master periphery table.
939 foreach (@
{$Peri_regs})
942 VALID_REGS
=> $_->{VALID_REGS
},
943 VALID_BITS
=> $_->{VALID_BITS
},
944 PRINT_MODE
=> $_->{PRINT_MODE
},
948 push(@
{$mcu->{REG_GROUPS
}}, $group);
951 push(@mcu_filtered, $mcu);
955 #-------------------------------------------------------------------------------
959 my ($Mcu, $Reg_raw) = @_;
960 my $name = $Reg_raw->{NAME
};
962 Log
("add_register($Mcu->{NAME}, $name)", 8);
964 foreach (@
{$Mcu->{REG_GROUPS
}})
966 if ($name =~ /^$_->{VALID_REGS}$/)
968 # This register fits into this group.
970 if ($name =~ /^([\D_]+)1$/ && defined($Mcu->{REG_REFS
}->{$1}))
972 # This register already exists. E.g.: RCREG1 --> RCREG
978 ADDRESS
=> $Reg_raw->{ADDRESS
},
985 push(@
{$_->{REG_ARRAY
}}, $reg);
986 $Mcu->{REG_REFS
}->{$name} = $reg;
994 #-------------------------------------------------------------------------------
996 # Cut down frippery from the bit names.
998 sub cut_frippery_from_bitnames
($$)
1000 my ($Regname, $Bits) = @_;
1002 return if (! defined($Bits) || scalar(@
{$Bits}) <= 0);
1009 $changed += ($_ =~ s/^${Regname}_|_${Regname}$//);
1010 $changed += ($_ =~ s/^(\d+)$/bit_$1/o);
1011 push(@
{$new_bits}, $_);
1014 $Bits = $new_bits if ($changed);
1017 #-------------------------------------------------------------------------------
1019 sub tris_ansel_filter
($$)
1021 my ($Peri_pins, $Pin_name) = @_;
1023 return TRUE
if (! defined($Peri_pins) ||
1024 ($Pin_name !~ /^TRIS[A-O]\d+$/io &&
1025 $Pin_name !~ /^ANS[A-O]\d+$/io));
1027 foreach (keys(%{$Peri_pins}))
1029 foreach (@
{$Peri_pins->{$_}})
1031 if ($_ =~ /^R([A-O]\d+)$/io)
1033 # E.g.: "RC7" --> "TRISC7"; "RC7" --> "ANSC7"
1035 my $trisx = "TRIS$tail";
1036 my $ansx = "ANS$tail";
1038 return TRUE
if ($Pin_name eq $trisx || $Pin_name eq $ansx);
1046 #-------------------------------------------------------------------------------
1048 sub filter_regs_from_raw
($)
1050 my $Periphery = $_[0];
1051 my ($peri_name, $peri_regs) = ($Periphery->{NAME
}, $Periphery->{REGS
});
1055 my $mcu = lc($_->{NAME
});
1056 my $io_ref = \
%{$io_table_by_mcu{$mcu}};
1057 my $peri_pins = (defined($io_ref)) ?
$io_ref->{$peri_name} : undef;
1059 # The MCU not have this periphery.
1060 next if (! defined($peri_pins));
1062 my $mcu_ref = add_mcu
($peri_regs, $_);
1064 foreach my $reg_raw (@
{$_->{REG_ARRAY
}})
1066 my $reg_dst = add_register
($mcu_ref, $reg_raw);
1068 next if (! defined($reg_dst));
1070 my $bits_src = $reg_raw->{BITNAMES
};
1071 my $bits_dst = $reg_dst->{BITNAMES
};
1072 my $valid_bits = $reg_dst->{GROUP
}->{VALID_BITS
};
1075 if (defined($valid_bits) && $valid_bits ne '')
1077 # Filtering follows.
1079 for (my $i = 0; $i < 8; ++$i)
1083 cut_frippery_from_bitnames
($reg_dst->{NAME
}, \@
{$bits_src->[$i]});
1084 foreach (@
{$bits_src->[$i]})
1086 # Only those names notes, which passed through the filter.
1088 push(@
{$new_bits}, $_) if (defined($_) && $_ =~ /^$valid_bits$/ &&
1089 tris_ansel_filter
($peri_pins, $_));
1092 if (scalar(@
{$new_bits}) > 0)
1094 $bits_dst->[$i] = $new_bits;
1099 $bits_dst->[$i] = undef;
1107 for (my $i = 0; $i < 8; ++$i)
1109 cut_frippery_from_bitnames
($reg_dst->{NAME
}, \@
{$bits_src->[$i]});
1110 $empty = FALSE
if (defined($bits_src->[$i]));
1112 $bits_dst->[$i] = [ @
{$bits_src->[$i]} ];
1116 $reg_dst->{EMPTY
} = $empty;
1118 } # foreach (@mcu_raw)
1121 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1122 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1124 #@@@@@@@ Collects same group them MCU which, have the same peripheral. @@@@@@@
1126 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1127 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1129 sub load_touched_flags
($$)
1133 foreach (@
{$_[0]->{REG_GROUPS
}})
1135 foreach (@
{$_->{REG_ARRAY
}})
1137 $_->{TOUCHED
} = $Level;
1142 #-------------------------------------------------------------------------------
1144 sub find_not_touched_reg
($)
1146 foreach (@
{$_[0]->{REG_GROUPS
}})
1148 foreach (@
{$_->{REG_ARRAY
}})
1150 next if ($_->{EMPTY
}); # It does not take into account the empty register.
1152 return TRUE
if (! $_->{TOUCHED
}); # This register left out from a previous comparison.
1159 #-------------------------------------------------------------------------------
1161 sub find_register
($$)
1163 my $Prime_reg = $_[1];
1164 my $cand_reg = $_[0]->{REG_REFS
}->{$Prime_reg->{NAME
}};
1166 return $cand_reg if (defined($cand_reg) && $cand_reg->{ADDRESS
} == $Prime_reg->{ADDRESS
});
1171 #-------------------------------------------------------------------------------
1173 sub find_equivalent_bit
($$)
1175 my ($Bits1, $Bits2) = @_;
1176 my $d = (defined($Bits1) && scalar(@
{$Bits1}) > 0) + (defined($Bits2) && scalar(@
{$Bits2}) > 0);
1178 return TRUE
if ($d == 0);
1182 Log
("find_equivalent_bit(): Only one bits defined.", 6);
1188 return TRUE
if (/^$_$/ ~~ @
{$Bits2});
1190 Log
("find_equivalent_bit(): The $_ bit not defined.", 7);
1196 #-------------------------------------------------------------------------------
1198 sub find_equivalent_register
($$$)
1200 my ($Candidate, $Prime_reg, $Print_mode) = @_;
1201 my ($cand_reg, $prime_bits, $cand_bits);
1203 $cand_reg = find_register
($Candidate, $Prime_reg);
1205 if (! defined($cand_reg))
1207 Log
("find_equivalent_register(): Not exists candidate reg: $Prime_reg->{NAME} in $Candidate->{NAME} MCU", 5);
1211 $cand_reg->{TOUCHED
} = TRUE
;
1213 # Not performs comparison, if the bits not must be displayed.
1214 return TRUE
if ($Print_mode == P_SHOW_ONLY_NAME
);
1216 $prime_bits = \@
{$Prime_reg->{BITNAMES
}};
1217 $cand_bits = \@
{$cand_reg->{BITNAMES
}};
1219 for (my $i = 0; $i < 8; ++$i)
1221 if (! find_equivalent_bit
(\@
{$cand_bits->[$i]}, \@
{$prime_bits->[$i]}))
1223 Log
("find_equivalent_register(): Not finds equivalent bit: $cand_reg->{NAME} != $Prime_reg->{NAME}", 5);
1231 #-------------------------------------------------------------------------------
1233 sub find_equivalent_mcu
($$)
1235 my ($Prime, $Candidate) = @_;
1237 return FALSE
if ($Prime->{ENHANCED
} != $Candidate->{ENHANCED
});
1239 load_touched_flags
($Prime, FALSE
);
1240 load_touched_flags
($Candidate, FALSE
);
1242 foreach (@
{$Prime->{REG_GROUPS
}})
1244 my $pmode = $_->{PRINT_MODE
};
1246 foreach (@
{$_->{REG_ARRAY
}})
1248 $_->{TOUCHED
} = TRUE
;
1249 next if ($_->{EMPTY
});
1251 return FALSE
if (! find_equivalent_register
($Candidate, $_, $pmode));
1255 if (find_not_touched_reg
($Prime))
1257 Log
("find_equivalent_mcu(): Finds not touched register: $Prime->{NAME}", 5);
1261 if (find_not_touched_reg
($Candidate))
1263 Log
("find_equivalent_mcu(): Finds not touched register: $Candidate->{NAME}", 5);
1270 #-------------------------------------------------------------------------------
1272 sub cmp_io_dirs
($$$)
1274 my ($Prime, $Candidate, $Periphery) = @_;
1275 my $prime_io = $io_dir_table_by_mcu{lc($Prime->{NAME
})};
1276 my $cand_io = $io_dir_table_by_mcu{lc($Candidate->{NAME
})};
1277 my $d = (defined($prime_io) && scalar(keys %{$prime_io}) > 0) + (defined($cand_io) && scalar(keys %{$cand_io}) > 0);
1279 return TRUE
if ($d == 0);
1280 return FALSE
if ($d != 2);
1282 my ($pr, $ca) = ($prime_io->{$Periphery}, $cand_io->{$Periphery});
1284 $d = (defined($pr) && scalar(keys %{$pr}) > 0) + (defined($ca) && scalar(keys %{$ca}) > 0);
1286 return TRUE
if ($d == 0);
1287 return FALSE
if ($d != 2);
1289 foreach (keys(%{$pr}))
1293 return FALSE
if (! defined($d) || $d != $pr->{$_});
1299 #-------------------------------------------------------------------------------
1301 sub make_mcu_groups
($)
1303 my $Periphery = $_[0];
1306 foreach (@mcu_filtered)
1308 next if ($_->{IN_GROUP
});
1310 my $group = \@
{$mcu_groups[$index]};
1313 # The prime - reference - member of group;
1314 push(@
{$group}, $_);
1315 $_->{IN_GROUP
} = TRUE
;
1317 foreach (@mcu_filtered)
1319 next if ($_->{IN_GROUP
} || $prime == $_);
1321 if (find_equivalent_mcu
($prime, $_) && cmp_io_dirs
($prime, $_, $Periphery))
1323 Log
("make_mcu_groups(): $prime->{NAME} == $_->{NAME}\n", 5);
1324 push(@
{$group}, $_);
1325 $_->{IN_GROUP
} = TRUE
;
1329 @
{$group} = sort {smartSort
($a->{NAME
}, $b->{NAME
})} @
{$group};
1334 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1335 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1336 #@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@
1337 #@@@@@@@@@@@@@@@@@@@@@@@ Prints the register tables. @@@@@@@@@@@@@@@@@@@@@@@@@
1338 #@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@
1339 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1340 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1343 Sometimes a bit has more name. This procedure selects these from among
1347 sub find_shortest_name
($)
1349 my $min = ULONG_MAX
;
1366 #-------------------------------------------------------------------------------
1368 sub print_registers
($$$)
1370 my ($Reg_array, $Print_mode, $No_ADC) = @_;
1372 my $show_closing_border = FALSE
;
1374 foreach (@
{$Reg_array})
1376 next if ($No_ADC && exist_in_list
(\
@some_ADC_registers, $_->{NAME
}));
1378 # Sole bit not have name and the empty register is not must show.
1379 next if ($_->{EMPTY
} && $Print_mode == P_NO_SHOW_IF_EMPTY
);
1381 if ($Print_mode == P_SHOW_ONLY_NAME
)
1383 Outfl
("%-10s (%03Xh)", $_->{NAME
}, $_->{ADDRESS
});
1384 $initial_border = FALSE
;
1388 if (! $initial_border)
1390 Outl
($table_border);
1391 $initial_border = TRUE
;
1394 Outf
("%-10s (%03Xh) |", $_->{NAME
}, $_->{ADDRESS
});
1396 $bits = \@
{$_->{BITNAMES
}};
1397 for ($i = 7; $i >= 0; --$i)
1399 if (defined($bits->[$i]) && $Print_mode != P_NO_SHOW_BITS
)
1401 Outf
("%-9s|", find_shortest_name
(\@
{$bits->[$i]}));
1410 $show_closing_border = TRUE
;
1411 } # foreach (@{$_[0]})
1413 Outl
($table_border) if ($show_closing_border);
1416 #-------------------------------------------------------------------------------
1419 # Collects into a list the inputs of ADC, which are uses another
1423 sub filter_off_adc_inputs
($$)
1425 my ($Peri_pins, $Adc) = @_;
1430 foreach my $adc_pin_name (keys(%{$Adc}))
1432 my $adc_pin_io = $Adc->{$adc_pin_name};
1434 foreach my $peri_pin_name (keys(%{$Peri_pins}))
1436 foreach (@
{$Peri_pins->{$peri_pin_name}})
1438 if (! (/^$adc_pin_name$/ ~~ @adc_pins) && /^$_$/ ~~ @
{$adc_pin_io})
1440 push(@adc_pins, $adc_pin_name)
1450 #-------------------------------------------------------------------------------
1454 my ($Mcu, $Peri_name) = @_;
1455 my $name = lc($Mcu->{NAME
});
1456 my $io_ref = \
%{$io_table_by_mcu{$name}};
1457 my $io_dir_ref = \
%{$io_dir_table_by_mcu{$name}};
1458 my $peri_pins = (defined($io_ref)) ?
$io_ref->{$Peri_name} : undef;
1459 my $peri_dirs = (defined($io_dir_ref)) ?
$io_dir_ref->{$Peri_name} : undef;
1460 my ($adc, $adc_pins, $io, $pin_name, $drop_adc_pins);
1461 my $suppl_info = '';
1463 $drop_adc_pins = FALSE
;
1465 Outl
("This is an enhanced 14 bit MCU.") if ($Mcu->{ENHANCED
});
1467 if (defined($peri_pins))
1469 if ($Peri_name ne 'adc')
1471 $adc = \
%{$io_ref->{'adc'}};
1472 $adc_pins = filter_off_adc_inputs
($peri_pins, $adc);
1474 if (scalar(@
{$adc_pins}) > 0)
1476 # Supplementary information: Displays inputs of the ADC periphery.
1478 $suppl_info .= "\n";
1480 foreach $pin_name (sort {smartSort
($a, $b)} @
{$adc_pins})
1482 $suppl_info .= "\t$pin_name:";
1484 foreach (@
{$adc->{$pin_name}})
1486 $suppl_info .= " $_";
1489 $suppl_info .= "\n";
1494 $drop_adc_pins = TRUE
;
1496 } # if ($Peri_name ne 'adc')
1498 $suppl_info .= "\n";
1500 foreach $pin_name (sort {smartSort
($a, $b)} keys(%{$peri_pins}))
1502 $suppl_info .= "\t$pin_name:";
1504 foreach (@
{$peri_pins->{$pin_name}})
1506 $suppl_info .= " $_";
1509 $suppl_info .= "\n";
1511 } # if (defined($peri_pins))
1514 print STDERR
"print_mcu(): This MCU $name not have $Peri_name pin!\n";
1517 if (defined($peri_dirs))
1519 $suppl_info .= "\n I/O directions after initialization:\n\n";
1521 foreach (sort {smartSort
($a, $b)} keys %{$peri_dirs})
1523 $io = ($peri_dirs->{$_} == 0) ?
'0 (output)' : '1 (input)';
1524 $suppl_info .= "\t$_: $io\n";
1528 $initial_border = FALSE
;
1530 foreach (@
{$Mcu->{REG_GROUPS
}})
1532 next if (scalar(@
{$_->{REG_ARRAY
}}) == 0);
1534 print_registers
(\@
{$_->{REG_ARRAY
}}, $_->{PRINT_MODE
}, $drop_adc_pins);
1540 #-------------------------------------------------------------------------------
1542 sub print_all_data
($$)
1544 my ($Periphery, $Index) = @_;
1545 my $peri_name = $Periphery->{NAME
};
1546 my $lock = '__' . uc($peri_name) . '__H__';
1547 my ($sidx, $group_index, $border);
1548 my ($family, $tech, $group_name, $len);
1550 Outl
("\n#ifndef $lock\n#define $lock\n\n#include \"pic16fam.h\"");
1552 $peri_groups .= "\n SECTION=" . uc($peri_name) . "\n\n";
1559 make_mcu_groups
($peri_name);
1561 foreach (@mcu_groups)
1563 next if (scalar(@
{$_}) == 0);
1565 Outl
("\n//$border ${group_index}th group $border");
1567 ($family, $tech, $group_name) = ($_->[0]->{NAME
} =~ /^(1[026])(c|cr|f|hv|lf)(\w+)$/io);
1569 $group_name =~ s/\D//go;
1570 $len = length($group_name);
1574 $group_name = "00$group_name";
1578 $group_name = "0$group_name";
1584 when (/c|cr/io) { $sidx = '0'; }
1587 default { $sidx = '1'; }
1590 $peri_groups .= "$family$group_name$Index$sidx:" . join(',', map { lc($_->{NAME
}); } @
{$_}) . "\n";
1596 # Prints the name of the group members.
1600 Outl
("PIC$_->{NAME}");
1603 # Only contents of the first it shows, because content of the others same.
1605 print_mcu
($_->[0], $peri_name);
1610 # Displays full contents of each member of the group.
1614 Outl
("\n\n/*\nPIC$_->{NAME}");
1615 print_mcu
($_, $peri_name);
1625 # Displays full contents of each MCU.
1627 foreach (@mcu_filtered)
1629 Outl
("\n\n/*\nPIC$_->{NAME}");
1630 print_mcu
($_, $peri_name);
1635 Outl
("\n#endif // $lock");
1638 #-------------------------------------------------------------------------------
1640 sub print_listing
($$$)
1642 my ($Out, $Device_per_line, $List_ref) = @_;
1645 $len = scalar(@
{$List_ref});
1647 return if ($len <= 0);
1652 print $Out $List_ref->[$i];
1661 print $Out ((($i % $Device_per_line) == 0) ?
"\n" : ',');
1665 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1666 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1667 #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1668 #@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The main program. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1669 #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1670 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1671 # @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1673 load_periphery_data
();
1676 $make_groups = FALSE
;
1677 $only_prime = FALSE
;
1679 for (my $i = 0; $i < @ARGV; )
1681 my $opt = $ARGV[$i++];
1685 when (/^-(I|-include)$/o)
1687 die "This option \"$opt\" requires a parameter." if ($i > $#ARGV);
1689 $include_path = $ARGV[$i++];
1692 when (/^-(g|-make-groups)$/o)
1694 $make_groups = TRUE
;
1697 when (/^-(p|-only-prime)$/o)
1702 when (/^-(gp|pg)$/o)
1704 $make_groups = TRUE
;
1708 when (/^-(v|-verbose)$/o)
1710 die "This option \"$opt\" requires a parameter.\n" if ($i > $#ARGV);
1712 $verbose = int($ARGV[$i++]);
1713 $verbose = 0 if (! defined($verbose) || $verbose < 0);
1714 $verbose = 10 if ($verbose > 10);
1717 when (/^-(h|-help)$/o)
1724 -I <path> or --include <path>
1726 The program on this path looks for the headers.
1727 If this is not specified, then looking for a installed
1728 sdcc copy in the system.
1732 This command creates groups of MCUs.
1736 Prints only the prime member of an MCU group.
1738 -v <level> or --verbose <level>
1740 It provides information on from the own operation.
1741 Possible value of the level between 0 and 10. (default: 0)
1753 if ($include_path eq '')
1755 foreach (@default_paths)
1759 $include_path = "$_/$default_port";
1764 die "Can not find the directory of sdcc headers!" if ($include_path eq '');
1767 opendir(DIR
, $include_path) || die "Can not open. -> \"$include_path\"";
1769 print "Include path: \"$include_path\"\n";
1771 my @filelist = grep(-f
"$include_path/$_" && /^$header_name_filter$/, readdir(DIR
));
1777 foreach (sort {smartSort
($a, $b)} @filelist)
1781 print STDERR
"Reading the registers from the $_ header ...";
1783 $name =~ s/^pic//io;
1784 $name =~ s/\.\S+$//o;
1785 read_regs_from_header
(add_mcu_raw
($name), $_);
1786 print STDERR
" done.\n";
1790 foreach (@periphery_table)
1792 my $out_name = "$_->{NAME}.h$out_tail";
1794 open($out_handler, '>', $out_name) || die "Can not create the $out_name output!";
1796 print STDERR
"Filtering of registers the aspects of $_->{NAME} according to ...";
1799 filter_regs_from_raw
($_);
1800 print STDERR
" done.\n";
1802 print STDERR
"Creating the $out_name ...";
1803 print_all_data
($_, $p_idx);
1804 print STDERR
" done.\n";
1806 close($out_handler);
1810 open(GR
, '>', $peri_group) || die "Can not create the $peri_group output!";
1812 if (scalar(@regular) > 0)
1814 print GR
"\n SECTION=REGULAR\n\n";
1815 print_listing
(*GR
, 10, \
@regular);
1818 if (scalar(@enhanced) > 0)
1820 print GR
"\n SECTION=ENHANCED\n\n";
1821 print_listing
(*GR
, 10, \
@enhanced);
1824 print GR
$peri_groups;
1828 ################################################################################
1830 # The following rules determine to which registers belong to an peripheral.
1831 # The description of a periphery is bounded by the BEGIN=TABLE_XXX flags.
1832 # The description of a register begin after the BEGIN=REGISTER flag.
1834 # BEGIN=PERIPHERY:ADC
1835 # The "ADC" effect of: An file will be created under the name "adc.tables".
1837 # VALID_REGS -- This a regular expression. Specifies which one a register
1838 # applies to this entries.
1840 # VALID_BITS -- This a regular expression. Specifies which bits are interesting,
1841 # are important. If an empty string is in there will be no filtering.
1843 # PRINT_MODE -- This a constant. The following values can be:
1845 # P_NO_SHOW_BITS -- Does not shows the bits.
1847 # P_NO_SHOW_IF_EMPTY -- Not shows the register if it is empty.
1848 # (This it could be because there are no bits
1849 # or because the filter thrown out them.)
1851 # P_ALWAYS_SHOW -- All conditions shows the register.
1853 # P_SHOW_ONLY_NAME -- Only shows the register name and address.
1856 ################################################################################
1858 # The ADC module related registers.
1859 # (There is so, which only indirectly connected to the module.)
1862 BEGIN=PERIPHERY
:ADC
# ADC --> adc.h.gen
1865 VALID_REGS
="AD\d*CON\d*|ADCOMCON"
1867 PRINT_MODE
=P_ALWAYS_SHOW
1871 VALID_REGS
="AD\d*RES\d*[HL]?"
1873 PRINT_MODE
=P_SHOW_ONLY_NAME
1877 VALID_REGS
="ANSEL[A-Z]*"
1879 PRINT_MODE
=P_ALWAYS_SHOW
1883 VALID_REGS
="(FVR|REF)CON"
1885 PRINT_MODE
=P_ALWAYS_SHOW
1891 PRINT_MODE
=P_SHOW_ONLY_NAME
1895 VALID_REGS
="DAC(ON\d*|CON\d+)"
1897 PRINT_MODE
=P_ALWAYS_SHOW
1901 VALID_REGS
="INTCON\d?"
1902 VALID_BITS
="(G|PE|AD)IE"
1903 PRINT_MODE
=P_ALWAYS_SHOW
1909 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
1915 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
1919 VALID_REGS
="ANSEL[A-Z]*"
1921 PRINT_MODE
=P_ALWAYS_SHOW
1925 VALID_REGS
="TRIS([A-Z]|IO)"
1926 VALID_BITS
="TRIS([A-Z]|IO)?\d"
1927 PRINT_MODE
=P_ALWAYS_SHOW
1932 ################################################################################
1934 # The CCP module related registers.
1935 # (There is so, which only indirectly connected to the module.)
1938 BEGIN=PERIPHERY
:CCP
# CCP --> ccp.h.gen
1941 VALID_REGS
="APFCON\d*"
1942 VALID_BITS
="(CCP(SEL\d|\dSEL)|P\d[A-D]SEL)"
1943 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
1947 VALID_REGS
="PPSLOCK"
1949 PRINT_MODE
=P_ALWAYS_SHOW
1953 VALID_REGS
="CCP\d+PPS"
1955 PRINT_MODE
=P_ALWAYS_SHOW
1959 VALID_REGS
="R[A-Z]\dPPS"
1961 PRINT_MODE
=P_ALWAYS_SHOW
1965 VALID_REGS
="CCP(CON\d*|\d+CON)"
1967 PRINT_MODE
=P_ALWAYS_SHOW
1971 VALID_REGS
="CCP(AS\d*|\d+AS)"
1973 PRINT_MODE
=P_ALWAYS_SHOW
1977 VALID_REGS
="CCPR([HL]\d*|\d+[HL])"
1979 PRINT_MODE
=P_SHOW_ONLY_NAME
1983 VALID_REGS
="CCPTMRS\d*"
1985 PRINT_MODE
=P_ALWAYS_SHOW
1989 VALID_REGS
="PSTR(CON\d*|\d+CON)"
1991 PRINT_MODE
=P_ALWAYS_SHOW
1995 VALID_REGS
="PWM(CON\d*|\d+CON)"
1997 PRINT_MODE
=P_ALWAYS_SHOW
2001 VALID_REGS
="(T[2468]CON|T10CON)"
2003 PRINT_MODE
=P_ALWAYS_SHOW
2007 VALID_REGS
="(TMR[2468]|TMR10)"
2009 PRINT_MODE
=P_SHOW_ONLY_NAME
2013 VALID_REGS
="(PR[2468]|PR10)"
2015 PRINT_MODE
=P_SHOW_ONLY_NAME
2019 VALID_REGS
="INTCON\d?"
2020 VALID_BITS
="(G|PE)IE"
2021 PRINT_MODE
=P_ALWAYS_SHOW
2026 VALID_BITS
="CCP\d+IE"
2027 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2032 VALID_BITS
="CCP\d+IF"
2033 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2037 VALID_REGS
="ANSEL[A-Z]*"
2039 PRINT_MODE
=P_ALWAYS_SHOW
2043 VALID_REGS
="ADCON\d+"
2045 PRINT_MODE
=P_ALWAYS_SHOW
2049 VALID_REGS
="TRIS([A-Z]|IO)"
2050 VALID_BITS
="TRIS([A-Z]|IO)\d"
2051 PRINT_MODE
=P_ALWAYS_SHOW
2056 ################################################################################
2058 # The PWM(CCP) module related registers.
2059 # (There is so, which only indirectly connected to the module.)
2062 BEGIN=PERIPHERY
:PWM
# PWM --> pwm.h.gen
2065 VALID_REGS
="APFCON\d*"
2066 VALID_BITS
="(CCP(SEL\d|\dSEL)|P\d[A-D]SEL)"
2067 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2071 VALID_REGS
="PPSLOCK"
2073 PRINT_MODE
=P_ALWAYS_SHOW
2077 VALID_REGS
="CCP\d+PPS"
2079 PRINT_MODE
=P_ALWAYS_SHOW
2083 VALID_REGS
="R[A-Z]\dPPS"
2085 PRINT_MODE
=P_ALWAYS_SHOW
2089 VALID_REGS
="CCP(CON\d*|\d+CON)"
2091 PRINT_MODE
=P_ALWAYS_SHOW
2095 VALID_REGS
="CCP(AS\d*|\d+AS)"
2097 PRINT_MODE
=P_ALWAYS_SHOW
2101 VALID_REGS
="CCPR([HL]\d*|\d+[HL])"
2103 PRINT_MODE
=P_SHOW_ONLY_NAME
2107 VALID_REGS
="CCPTMRS\d*"
2109 PRINT_MODE
=P_ALWAYS_SHOW
2113 VALID_REGS
="PSTR(CON\d*|\d+CON)"
2115 PRINT_MODE
=P_ALWAYS_SHOW
2119 VALID_REGS
="PWM(CON\d*|\d+CON)"
2121 PRINT_MODE
=P_ALWAYS_SHOW
2125 VALID_REGS
="PWM(DC[HL]\d*|\d+DC[HL])"
2127 PRINT_MODE
=P_ALWAYS_SHOW
2131 VALID_REGS
="(T[2468]CON|T10CON)"
2133 PRINT_MODE
=P_ALWAYS_SHOW
2137 VALID_REGS
="(TMR[2468]|TMR10)"
2139 PRINT_MODE
=P_SHOW_ONLY_NAME
2143 VALID_REGS
="(PR[2468]|PR10)"
2145 PRINT_MODE
=P_SHOW_ONLY_NAME
2149 VALID_REGS
="INTCON\d?"
2150 VALID_BITS
="(G|PE)IE"
2151 PRINT_MODE
=P_ALWAYS_SHOW
2156 VALID_BITS
="((CCP\d+|TMR[2468])IE|TMR10IE)"
2157 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2162 VALID_BITS
="((CCP\d+|TMR[2468])IF|TMR10IF)"
2163 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2167 VALID_REGS
="ANSEL[A-Z]*"
2169 PRINT_MODE
=P_ALWAYS_SHOW
2173 VALID_REGS
="ADCON\d+"
2175 PRINT_MODE
=P_ALWAYS_SHOW
2179 VALID_REGS
="TRIS([A-Z]|IO)"
2180 VALID_BITS
="TRIS([A-Z]|IO)\d"
2181 PRINT_MODE
=P_ALWAYS_SHOW
2186 ################################################################################
2188 # The I2C(SSP) module related registers.
2189 # (There is so, which only indirectly connected to the module.)
2192 BEGIN=PERIPHERY
:I2C
# I2C --> i2c.h.gen
2195 VALID_REGS
="APFCON\d*"
2196 VALID_BITS
="S(DI|DO|CK|S)\d*SEL"
2197 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2201 VALID_REGS
="PPSLOCK"
2203 PRINT_MODE
=P_ALWAYS_SHOW
2207 VALID_REGS
="SSP(CLK|DAT)PPS"
2209 PRINT_MODE
=P_ALWAYS_SHOW
2213 VALID_REGS
="R[A-Z]\dPPS"
2215 PRINT_MODE
=P_ALWAYS_SHOW
2219 VALID_REGS
="SSP\d*CON\d*"
2221 PRINT_MODE
=P_ALWAYS_SHOW
2225 VALID_REGS
="SSP\d*ADD\d*"
2227 PRINT_MODE
=P_SHOW_ONLY_NAME
2231 VALID_REGS
="SSP\d*BUF\d*"
2233 PRINT_MODE
=P_SHOW_ONLY_NAME
2237 VALID_REGS
="SSP\d*MSK\d*"
2239 PRINT_MODE
=P_SHOW_ONLY_NAME
2243 VALID_REGS
="SSP\d*STAT\d*"
2245 PRINT_MODE
=P_ALWAYS_SHOW
2249 VALID_REGS
="INTCON\d?"
2250 VALID_BITS
="(G|PE)IE"
2251 PRINT_MODE
=P_ALWAYS_SHOW
2256 VALID_BITS
="(BCL|SSP)\d*IE"
2257 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2262 VALID_BITS
="(BCL|SSP)\d*IF"
2263 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2267 VALID_REGS
="ANSEL[A-Z]*"
2269 PRINT_MODE
=P_ALWAYS_SHOW
2273 VALID_REGS
="ADCON\d+"
2275 PRINT_MODE
=P_ALWAYS_SHOW
2279 VALID_REGS
="TRIS([A-Z]|IO)"
2280 VALID_BITS
="TRIS([A-Z]|IO)\d"
2281 PRINT_MODE
=P_ALWAYS_SHOW
2286 ################################################################################
2288 # The SPI(SSP) module related registers.
2289 # (There is so, which only indirectly connected to the module.)
2292 BEGIN=PERIPHERY
:SPI
# SPI --> spi.h.gen
2295 VALID_REGS
="APFCON\d*"
2296 VALID_BITS
="S(DI|DO|CK|S)\d*SEL"
2297 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2301 VALID_REGS
="PPSLOCK"
2303 PRINT_MODE
=P_ALWAYS_SHOW
2307 VALID_REGS
="SSP\w+PPS"
2309 PRINT_MODE
=P_ALWAYS_SHOW
2313 VALID_REGS
="R[A-Z]\dPPS"
2315 PRINT_MODE
=P_ALWAYS_SHOW
2319 VALID_REGS
="SSP\d*CON\d*"
2321 PRINT_MODE
=P_ALWAYS_SHOW
2325 VALID_REGS
="SSP\d*ADD\d*"
2327 PRINT_MODE
=P_SHOW_ONLY_NAME
2331 VALID_REGS
="SSP\d*BUF\d*"
2333 PRINT_MODE
=P_SHOW_ONLY_NAME
2337 VALID_REGS
="SSP\d*MSK\d*"
2339 PRINT_MODE
=P_SHOW_ONLY_NAME
2343 VALID_REGS
="SSP\d*STAT\d*"
2345 PRINT_MODE
=P_ALWAYS_SHOW
2349 VALID_REGS
="INTCON\d?"
2350 VALID_BITS
="(G|PE)IE"
2351 PRINT_MODE
=P_ALWAYS_SHOW
2356 VALID_BITS
="(BCL|SSP)\d*IE"
2357 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2362 VALID_BITS
="(BCL|SSP)\d*IF"
2363 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2367 VALID_REGS
="ANSEL[A-Z]*"
2369 PRINT_MODE
=P_ALWAYS_SHOW
2373 VALID_REGS
="ADCON\d+"
2375 PRINT_MODE
=P_ALWAYS_SHOW
2379 VALID_REGS
="TRIS([A-Z]|IO)"
2380 VALID_BITS
="TRIS([A-Z]|IO)\d"
2381 PRINT_MODE
=P_ALWAYS_SHOW
2386 ################################################################################
2388 # The USART module related registers.
2389 # (There is so, which only indirectly connected to the module.)
2392 BEGIN=PERIPHERY
:USART
# USART --> usart.h.gen
2395 VALID_REGS
="APFCON\d*"
2396 VALID_BITS
="(RX(DT)?|TX(CK)?)SEL"
2397 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2401 VALID_REGS
="PPSLOCK"
2403 PRINT_MODE
=P_ALWAYS_SHOW
2407 VALID_REGS
="R[A-Z]\dPPS"
2409 PRINT_MODE
=P_ALWAYS_SHOW
2413 VALID_REGS
="RC(STA\d*|\d+STA)"
2415 PRINT_MODE
=P_ALWAYS_SHOW
2419 VALID_REGS
="TX(STA\d*|\d+STA)"
2421 PRINT_MODE
=P_ALWAYS_SHOW
2425 VALID_REGS
="BAUD(C(ON|TL)\d*|\d+C(ON|TL))"
2427 PRINT_MODE
=P_ALWAYS_SHOW
2431 VALID_REGS
="SP(BRG[HL]?\d?|\d+BRG[HL]?)"
2433 PRINT_MODE
=P_SHOW_ONLY_NAME
2437 VALID_REGS
="RC(REG\d*|\d+REG)"
2439 PRINT_MODE
=P_SHOW_ONLY_NAME
2443 VALID_REGS
="TX(REG\d*|\d+REG)"
2445 PRINT_MODE
=P_SHOW_ONLY_NAME
2449 VALID_REGS
="INTCON\d?"
2450 VALID_BITS
="(G|PE)IE"
2451 PRINT_MODE
=P_ALWAYS_SHOW
2456 VALID_BITS
="(RC|TX)\d*IE"
2457 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2462 VALID_BITS
="(RC|TX)\d*IF"
2463 PRINT_MODE
=P_NO_SHOW_IF_EMPTY
2467 VALID_REGS
="ANSEL[A-Z]*"
2469 PRINT_MODE
=P_ALWAYS_SHOW
2473 VALID_REGS
="ADCON\d+"
2475 PRINT_MODE
=P_ALWAYS_SHOW
2479 VALID_REGS
="TRIS([A-Z]|IO)"
2480 VALID_BITS
="TRIS([A-Z]|IO)\d"
2481 PRINT_MODE
=P_ALWAYS_SHOW
2486 ################################################################################
2488 # This table describes that which onto port pins connected a peripheral.
2493 BEGIN=MCU
:10f320
,10f322
2494 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
2495 PWM
=PWM1
:RA0
,PWM2
:RA1
2498 BEGIN=MCU
:12f615
,12f617
,12f683
2499 ADC
=AN0
:GP0
,AN1
:GP1
,AN2
:GP2
,AN3
:GP4
2505 ADC
=AN0
:GP0
,AN1
:GP1
,AN2
:GP2
,AN3
:GP4
2509 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
2515 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
2516 PWM
=PWM1
:RA2
,PWM2
:RA0
,PWM3
:RA4
,PWM4
:RA5
2520 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
2521 PWM
=PWM1
:RA1
/RA5,PWM2:RA0/RA4
,PWM3
:RA2
2525 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
2526 PWM
=PWM1
:RA1
/RA5,PWM2:RA0/RA4
,PWM3
:RA2
2527 USART
=RX
:RA1
/RA5,TX:RA0/RA4
2528 USART
=IO_DIR
=RX
:1,TX
:0
2532 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
2533 CCP
=CCP1
:RA2
/RA5
,CCP2
:RA0
2534 PWM
=PWM1
:RA2
/RA5
,PWM2
:RA0
2538 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
2542 SPI
=SDI
:RA2
,SDO
:RA0
,SCK
:RA1
,SS
:RA0
/RA3
2543 USART
=RX
:RA1
/RA5,TX:RA0/RA4
2544 USART
=IO_DIR
=RX
:1,TX
:0
2548 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
,AN4
:RA5
2549 I2C
=SDA
:RA2
/R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977 I2C
=SDA
:RC1
/RA3
,SCL
:RC0
2978 SPI
=SDI
:RC1
/RA3,SDO:RC2/RA4
,SCK
:RC0
,SS
:RC3
/RA3
2979 USART
=RX
:RC5
/RA4,TX:RC4/RC3
2980 USART
=IO_DIR
=RX
:1,TX
:1
2984 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
,AN4
:RC0
,AN5
:RC1
,AN6
:RC2
,AN7
:RC3
2985 CCP
=CCP1
:RC5
,CCP2
:RA5
/RC3
2986 PWM
=PWM1
:RC5
,PWM2
:RA5
/RC3
2990 # Remappable peripheral pins. (PPS)
2991 # (The definition valid until a newer definition overwrites the members.)
3021 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
,AN4
:RC0
,AN5
:RC1
,AN6
:RC2
,AN7
:RC3
3022 CCP
=CCP1
:RI
[0-11],CCP2
:RI
[0-11]
3023 PWM
=PWM1
:RO
[0-10],PWM2
:RO
[0-10]
3024 I2C
=SDA
:RO
[0-10],SCL
:RO
[0-10]
3025 SPI
=SDI
:RI
[0-11],SDO
:RO
[0-10],SCK
:RO
[0-10],SS
:RI
[0-11]
3028 BEGIN=MCU
:16f1704
,16lf
1704,16f1705
3029 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
,AN4
:RC0
,AN5
:RC1
,AN6
:RC2
,AN7
:RC3
3030 CCP
=CCP1
:RI
[0-11],CCP2
:RI
[0-11]
3031 PWM
=PWM1
:RO
[0-10],PWM2
:RO
[0-10]
3032 I2C
=SDA
:RO
[0-10],SCL
:RO
[0-10]
3033 SPI
=SDI
:RI
[0-11],SDO
:RO
[0-10],SCK
:RO
[0-10],SS
:RI
[0-11]
3034 USART
=RX
:RI
[0-11],TX
:RO
[0-10]
3035 USART
=IO_DIR
=RX
:1,TX
:1
3039 # Remappable peripheral pins. (PPS)
3040 # (The definition valid until a newer definition overwrites the members.)
3064 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
,AN4
:RC0
,AN5
:RC1
,AN6
:RC2
,AN7
:RC3
,AN8
:RC6
,AN9
:RC7
,AN10
:RB4
,AN11
:RB5
3065 CCP
=CCP1
:RI
[0-17],CCP2
:RI
[0-17]
3066 PWM
=PWM1
:RO
[0-10],PWM2
:RO
[0-10]
3067 I2C
=SDA
:RO
[0-10],SCL
:RO
[0-10]
3068 SPI
=SDI
:RI
[0-17],SDO
:RO
[0-10],SCK
:RO
[0-10],SS
:RI
[0-17]
3071 BEGIN=MCU
:16f1708
,16lf
1708,16f1709
3072 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA4
,AN4
:RC0
,AN5
:RC1
,AN6
:RC2
,AN7
:RC3
,AN8
:RC6
,AN9
:RC7
,AN10
:RB4
,AN11
:RB5
3073 CCP
=CCP1
:RI
[0-17],CCP2
:RI
[0-17]
3074 PWM
=PWM1
:RO
[0-10],PWM2
:RO
[0-10]
3075 I2C
=SDA
:RO
[0-10],SCL
:RO
[0-10]
3076 SPI
=SDI
:RI
[0-17],SDO
:RO
[0-10],SCK
:RO
[0-10],SS
:RI
[0-17]
3077 USART
=RX
:RI
[0-17],TX
:RO
[0-10]
3078 USART
=IO_DIR
=RX
:1,TX
:1
3082 # Remappable peripheral pins. (PPS)
3083 # (The definition valid until a newer definition overwrites the members.)
3121 BEGIN=MCU
:16f1713
,16f1716
,16f1718
3122 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA3
,AN4
:RA5
,AN8
:RB2
,AN9
:RB3
,AN10
:RB1
,AN11
:RB4
,AN12
:RB0
,AN13
:RB5
,AN14
:RC2
,AN15
:RC3
,AN16
:RC4
:AN17
:RC5
,AN18
:RC6
,AN19
:RC7
3123 CCP
=CCP1
:RI
[0-15],CCP2
:RI
[0-15]
3124 PWM
=PWM1
:RO
[0-15],PWM2
:RO
[0-15]
3125 I2C
=SDA
:RO
[0-15],SCL
:RO
[0-15]
3126 SPI
=SDI
:RI
[0-15],SDO
:RO
[8-15],SCK
:RO
[0-15],SS
:RI
[8-15]
3127 USART
=RX
:RI
[0-15],TX
:RO
[0-15]
3128 USART
=IO_DIR
=RX
:1,TX
:1
3131 BEGIN=MCU
:16f1717
,16f1719
3132 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA3
,AN4
:RA5
,AN5
:RE0
,AN6
:RE1
,AN7
:RE2
,AN8
:RB2
,AN9
:RB3
,AN10
:RB1
,AN11
:RB4
,AN12
:RB0
,AN13
:RB5
,AN14
:RC2
,AN15
:RC3
,AN16
:RC4
:AN17
:RC5
,AN18
:RC6
,AN19
:RC7
,AN20
:RD0
,AN21
:RD1
,AN22
:RD2
,AN23
:RD3
,AN24
:RD4
,AN25
:RD5
,AN26
:RD6
,AN27
:RD7
3133 CCP
=CCP1
:RI
[0-15],CCP2
:RI
[0-15]
3134 PWM
=PWM1
:RO
[0-15],PWM2
:RO
[0-15]
3135 I2C
=SDA
:RO
[0-15],SCL
:RO
[0-15]
3136 SPI
=SDI
:RI
[0-15],SDO
:RO
[8-15],SCK
:RO
[0-15],SS
:RI
[8-15]
3137 USART
=RX
:RI
[0-15],TX
:RO
[0-15]
3138 USART
=IO_DIR
=RX
:1,TX
:1
3141 BEGIN=MCU
:16f1782
,16f1783
3142 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
,AN3
:RA3
,AN4
:RA5
,AN8
:RB2
,AN9
:RB3
,AN10
:RB1
,AN11
:RB4
,AN12
:RB0
,AN13
:RB5
3143 CCP
=CCP1
:RC2
/RB0,CCP2:RC1/RB3
3144 PWM
=PWM1
:RC2
/RB0,PWM2:RC1/RB3
3145 I2C
=SDA
:RC4
/RB6,SCL:RC3/RB7
3146 SPI
=SDI
:RC4
/RB6,SDO:RC5/RB5
,SCK
:RC3
/RB7
,SS
:RA5
3148 USART
=IO_DIR
=RX
:1,TX
:1
3152 ADC
=AN0
:RA0
,AN1
:RA1
,AN2
:RA2
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