]> matita.cs.unibo.it Git - helm.git/blob - helm/software/matita/contribs/ng_assembly/freescale/table_HC08_tests.ma
freescale porting to ng, work in progress
[helm.git] / helm / software / matita / contribs / ng_assembly / freescale / table_HC08_tests.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* ********************************************************************** *)
16 (*                           Progetto FreeScale                           *)
17 (*                                                                        *)
18 (* Sviluppato da:                                                         *)
19 (*   Cosimo Oliboni, oliboni@cs.unibo.it                                  *)
20 (*                                                                        *)
21 (* Questo materiale fa parte della tesi:                                  *)
22 (*   "Formalizzazione Interattiva dei Microcontroller a 8bit FreeScale"   *)
23 (*                                                                        *)
24 (*                    data ultima modifica 15/11/2007                     *)
25 (* ********************************************************************** *)
26
27 include "freescale/table_HC08.ma".
28
29 (* ***************** *)
30 (* TABELLA DELL'HC08 *)
31 (* ***************** *)
32
33 (* HC08: opcode non implementati come da manuale (byte) *)
34 ndefinition HC08_not_impl_byte ≝
35  [〈x3,x2〉;〈x3,xE〉
36  ;〈x8,x2〉;〈x8,xD〉
37  ;〈x9,x6〉;〈x9,xE〉
38  ;〈xA,xC〉
39  ].
40
41 nlemma ok_byte_table_HC08 : forall_byte8 (λb.
42  (test_not_impl_byte b HC08_not_impl_byte     ⊙ eq_nat (get_byte_count HC08 b 0 opcode_table_HC08) 1) ⊗
43  (⊖ (test_not_impl_byte b HC08_not_impl_byte) ⊙ eq_nat (get_byte_count HC08 b 0 opcode_table_HC08) 0))
44  = true.
45  napply (refl_eq ??).
46 nqed.
47
48 (* HC08: opcode non implementati come da manuale (0x9E+byte) *)
49 ndefinition HC08_not_impl_word ≝
50  [〈x0,x0〉;〈x0,x1〉;〈x0,x2〉;〈x0,x3〉;〈x0,x4〉;〈x0,x5〉;〈x0,x6〉;〈x0,x7〉
51  ;〈x0,x8〉;〈x0,x9〉;〈x0,xA〉;〈x0,xB〉;〈x0,xC〉;〈x0,xD〉;〈x0,xE〉;〈x0,xF〉
52  ;〈x1,x0〉;〈x1,x1〉;〈x1,x2〉;〈x1,x3〉;〈x1,x4〉;〈x1,x5〉;〈x1,x6〉;〈x1,x7〉
53  ;〈x1,x8〉;〈x1,x9〉;〈x1,xA〉;〈x1,xB〉;〈x1,xC〉;〈x1,xD〉;〈x1,xE〉;〈x1,xF〉
54  ;〈x2,x0〉;〈x2,x1〉;〈x2,x2〉;〈x2,x3〉;〈x2,x4〉;〈x2,x5〉;〈x2,x6〉;〈x2,x7〉
55  ;〈x2,x8〉;〈x2,x9〉;〈x2,xA〉;〈x2,xB〉;〈x2,xC〉;〈x2,xD〉;〈x2,xE〉;〈x2,xF〉
56  ;〈x3,x0〉;〈x3,x1〉;〈x3,x2〉;〈x3,x3〉;〈x3,x4〉;〈x3,x5〉;〈x3,x6〉;〈x3,x7〉
57  ;〈x3,x8〉;〈x3,x9〉;〈x3,xA〉;〈x3,xB〉;〈x3,xC〉;〈x3,xD〉;〈x3,xE〉;〈x3,xF〉
58  ;〈x4,x0〉;〈x4,x1〉;〈x4,x2〉;〈x4,x3〉;〈x4,x4〉;〈x4,x5〉;〈x4,x6〉;〈x4,x7〉
59  ;〈x4,x8〉;〈x4,x9〉;〈x4,xA〉;〈x4,xB〉;〈x4,xC〉;〈x4,xD〉;〈x4,xE〉;〈x4,xF〉
60  ;〈x5,x0〉;〈x5,x1〉;〈x5,x2〉;〈x5,x3〉;〈x5,x4〉;〈x5,x5〉;〈x5,x6〉;〈x5,x7〉
61  ;〈x5,x8〉;〈x5,x9〉;〈x5,xA〉;〈x5,xB〉;〈x5,xC〉;〈x5,xD〉;〈x5,xE〉;〈x5,xF〉
62  ;〈x6,x2〉;〈x6,x5〉;〈x6,xE〉
63  ;〈x7,x0〉;〈x7,x1〉;〈x7,x2〉;〈x7,x3〉;〈x7,x4〉;〈x7,x5〉;〈x7,x6〉;〈x7,x7〉
64  ;〈x7,x8〉;〈x7,x9〉;〈x7,xA〉;〈x7,xB〉;〈x7,xC〉;〈x7,xD〉;〈x7,xE〉;〈x7,xF〉
65  ;〈x8,x0〉;〈x8,x1〉;〈x8,x2〉;〈x8,x3〉;〈x8,x4〉;〈x8,x5〉;〈x8,x6〉;〈x8,x7〉
66  ;〈x8,x8〉;〈x8,x9〉;〈x8,xA〉;〈x8,xB〉;〈x8,xC〉;〈x8,xD〉;〈x8,xE〉;〈x8,xF〉
67  ;〈x9,x0〉;〈x9,x1〉;〈x9,x2〉;〈x9,x3〉;〈x9,x4〉;〈x9,x5〉;〈x9,x6〉;〈x9,x7〉
68  ;〈x9,x8〉;〈x9,x9〉;〈x9,xA〉;〈x9,xB〉;〈x9,xC〉;〈x9,xD〉;〈x9,xE〉;〈x9,xF〉
69  ;〈xA,x0〉;〈xA,x1〉;〈xA,x2〉;〈xA,x3〉;〈xA,x4〉;〈xA,x5〉;〈xA,x6〉;〈xA,x7〉
70  ;〈xA,x8〉;〈xA,x9〉;〈xA,xA〉;〈xA,xB〉;〈xA,xC〉;〈xA,xD〉;〈xA,xE〉;〈xA,xF〉
71  ;〈xB,x0〉;〈xB,x1〉;〈xB,x2〉;〈xB,x3〉;〈xB,x4〉;〈xB,x5〉;〈xB,x6〉;〈xB,x7〉
72  ;〈xB,x8〉;〈xB,x9〉;〈xB,xA〉;〈xB,xB〉;〈xB,xC〉;〈xB,xD〉;〈xB,xE〉;〈xB,xF〉
73  ;〈xC,x0〉;〈xC,x1〉;〈xC,x2〉;〈xC,x3〉;〈xC,x4〉;〈xC,x5〉;〈xC,x6〉;〈xC,x7〉
74  ;〈xC,x8〉;〈xC,x9〉;〈xC,xA〉;〈xC,xB〉;〈xC,xC〉;〈xC,xD〉;〈xC,xE〉;〈xC,xF〉
75  ;〈xD,xC〉;〈xD,xD〉
76  ;〈xE,xC〉;〈xE,xD〉
77  ;〈xF,x0〉;〈xF,x1〉;〈xF,x2〉;〈xF,x3〉;〈xF,x4〉;〈xF,x5〉;〈xF,x6〉;〈xF,x7〉
78  ;〈xF,x8〉;〈xF,x9〉;〈xF,xA〉;〈xF,xB〉;〈xF,xC〉;〈xF,xD〉;〈xF,xE〉;〈xF,xF〉
79  ].
80
81 nlemma ok_word_table_HC08 : forall_byte8 (λb.
82  (test_not_impl_byte b HC08_not_impl_word     ⊙ eq_nat (get_word_count HC08 b 0 opcode_table_HC08) 1) ⊗
83  (⊖ (test_not_impl_byte b HC08_not_impl_word) ⊙ eq_nat (get_word_count HC08 b 0 opcode_table_HC08) 0))
84  = true.
85  napply (refl_eq ??).
86 nqed.
87
88 (* HC08: pseudocodici non implementati come da manuale *)
89 ndefinition HC08_not_impl_pseudo ≝
90  [ BGND ; SHA ; SLA ].
91
92 nlemma ok_pseudo_table_HC08 : forall_opcode (λo.
93  (test_not_impl_pseudo o HC08_not_impl_pseudo     ⊙ le_nat 1 (get_pseudo_count HC08 o 0 opcode_table_HC08)) ⊗
94  (⊖ (test_not_impl_pseudo o HC08_not_impl_pseudo) ⊙ eq_nat (get_pseudo_count HC08 o 0 opcode_table_HC08) 0))
95  = true.
96  napply (refl_eq ??).
97 nqed.
98
99 (* HC08: modalita' non implementate come da manuale *)
100 ndefinition HC08_not_impl_mode ≝
101  [ MODE_TNY x0 ; MODE_TNY x1 ; MODE_TNY x2 ; MODE_TNY x3
102  ; MODE_TNY x4 ; MODE_TNY x5 ; MODE_TNY x6 ; MODE_TNY x7
103  ; MODE_TNY x8 ; MODE_TNY x9 ; MODE_TNY xA ; MODE_TNY xB
104  ; MODE_TNY xC ; MODE_TNY xD ; MODE_TNY xE ; MODE_TNY xF
105  ; MODE_SRT t00 ; MODE_SRT t01 ; MODE_SRT t02 ; MODE_SRT t03
106  ; MODE_SRT t04 ; MODE_SRT t05 ; MODE_SRT t06 ; MODE_SRT t07
107  ; MODE_SRT t08 ; MODE_SRT t09 ; MODE_SRT t0A ; MODE_SRT t0B
108  ; MODE_SRT t0C ; MODE_SRT t0D ; MODE_SRT t0E ; MODE_SRT t0F
109  ; MODE_SRT t10 ; MODE_SRT t11 ; MODE_SRT t12 ; MODE_SRT t13
110  ; MODE_SRT t14 ; MODE_SRT t15 ; MODE_SRT t16 ; MODE_SRT t17
111  ; MODE_SRT t18 ; MODE_SRT t19 ; MODE_SRT t1A ; MODE_SRT t1B
112  ; MODE_SRT t1C ; MODE_SRT t1D ; MODE_SRT t1E ; MODE_SRT t1F ].
113
114 nlemma ok_mode_table_HC08 : forall_instr_mode (λi.
115  (test_not_impl_mode i HC08_not_impl_mode     ⊙ le_nat 1 (get_mode_count HC08 i 0 opcode_table_HC08)) ⊗
116  (⊖ (test_not_impl_mode i HC08_not_impl_mode) ⊙ eq_nat (get_mode_count HC08 i 0 opcode_table_HC08) 0))
117  = true.
118  napply (refl_eq ??).
119 nqed.
120
121 nlemma ok_OpIm_table_HC08 :
122  forall_instr_mode (λi:instr_mode.
123  forall_opcode     (λop:opcode.
124   le_nat (get_OpIm_count HC08 (anyOP HC08 op) i 0 opcode_table_HC08) 1)) = true.
125  napply (refl_eq ??).
126 nqed.