1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* ********************************************************************** *)
16 (* Progetto FreeScale *)
18 (* Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it *)
19 (* Sviluppo: 2008-2010 *)
21 (* ********************************************************************** *)
24 include "num/bitrigesim.ma".
26 (* ********************************************** *)
27 (* MATTONI BASE PER DEFINIRE LE TABELLE DELLE MCU *)
28 (* ********************************************** *)
30 (* enumerazione delle modalita' di indirizzamento = caricamento degli operandi *)
31 ninductive IP2022_instr_mode: Type ≝
32 (* nessun operando : formato xxxxxxxx xxxxxxxx *)
33 MODE_INH : IP2022_instr_mode
34 (* operando implicito [ADDR] : formato xxxxxxxx xxxxxxxx *)
35 | MODE_INHADDR : IP2022_instr_mode
36 (* operando implicito [ADDR]/ADDR+=2 : formato xxxxxxxx xxxxxxxx *)
37 | MODE_INHADDRpp : IP2022_instr_mode
39 (* #lit3 → / : formato xxxxxxxx xxxxxkkk *)
40 | MODE_IMM3 : oct → IP2022_instr_mode
41 (* W, #lit8 → W : formato xxxxxxxx kkkkkkkk [load 1 byte arg] *)
42 | MODE_IMM8 : IP2022_instr_mode
43 (* #lit13 → / : formato xxxkkkkk kkkkkkkk [load 1 byte arg] *)
44 | MODE_IMM13 : bitrigesim → IP2022_instr_mode
46 (* FR, W → FR : formato xxxxxxx0 ffffffff [load 1 byte arg] *)
47 | MODE_FR0_and_W : IP2022_instr_mode
48 (* FR, W → FR : formato xxxxxxx1 ffffffff [load 1 byte arg] *)
49 | MODE_FR1_and_W : IP2022_instr_mode
50 (* W, FR → W : formato xxxxxxx0 ffffffff [load 1 byte arg] *)
51 | MODE_W_and_FR0 : IP2022_instr_mode
52 (* W, FR → W : formato xxxxxxx1 ffffffff [load 1 byte arg] *)
53 | MODE_W_and_FR1 : IP2022_instr_mode
55 (* FR(bitN) → FR(bitN) : formato xxxxbbb0 ffffffff [load 1 byte arg] *)
56 | MODE_FR0n : oct → IP2022_instr_mode
57 (* FR(bitN) → FR(bitN) : formato xxxxbbb1 ffffffff [load 1 byte arg] *)
58 | MODE_FR1n : oct → IP2022_instr_mode
61 ndefinition eq_IP2022_im ≝
62 λi1,i2:IP2022_instr_mode.
64 [ MODE_INH ⇒ match i2 with [ MODE_INH ⇒ true | _ ⇒ false ]
65 | MODE_INHADDR ⇒ match i2 with [ MODE_INHADDR ⇒ true | _ ⇒ false ]
66 | MODE_INHADDRpp ⇒ match i2 with [ MODE_INHADDRpp ⇒ true | _ ⇒ false ]
67 | MODE_IMM3 o1 ⇒ match i2 with [ MODE_IMM3 o2 ⇒ eqc ? o1 o2 | _ ⇒ false ]
68 | MODE_IMM8 ⇒ match i2 with [ MODE_IMM8 ⇒ true | _ ⇒ false ]
69 | MODE_IMM13 t1 ⇒ match i2 with [ MODE_IMM13 t2 ⇒ eqc ? t1 t2 | _ ⇒ false ]
70 | MODE_FR0_and_W ⇒ match i2 with [ MODE_FR0_and_W ⇒ true | _ ⇒ false ]
71 | MODE_FR1_and_W ⇒ match i2 with [ MODE_FR1_and_W ⇒ true | _ ⇒ false ]
72 | MODE_W_and_FR0 ⇒ match i2 with [ MODE_W_and_FR0 ⇒ true | _ ⇒ false ]
73 | MODE_W_and_FR1 ⇒ match i2 with [ MODE_W_and_FR1 ⇒ true | _ ⇒ false ]
74 | MODE_FR0n o1 ⇒ match i2 with [ MODE_FR0n o2 ⇒ eqc ? o1 o2 | _ ⇒ false ]
75 | MODE_FR1n o1 ⇒ match i2 with [ MODE_FR1n o2 ⇒ eqc ? o1 o2 | _ ⇒ false ]
78 ndefinition forall_IP2022_im ≝ λP:IP2022_instr_mode → bool.
82 ⊗ forallc ? (λo.P (MODE_IMM3 o))
84 ⊗ forallc ? (λt.P (MODE_IMM13 t))
89 ⊗ forallc ? (λo.P (MODE_FR0n o))
90 ⊗ forallc ? (λo.P (MODE_FR1n o)).