]> matita.cs.unibo.it Git - helm.git/blob - matitaB/matita/contribs/ng_assembly2/emulator/model/RS08_model.ma
696b968e15eee19b13d7b328669fb9756d29b697
[helm.git] / matitaB / matita / contribs / ng_assembly2 / emulator / model / RS08_model.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: Ing. Cosimo Oliboni, oliboni@cs.unibo.it              *)
19 (*   Sviluppo: 2008-2010                                                  *)
20 (*                                                                        *)
21 (* ********************************************************************** *)
22
23 include "emulator/status/status.ma".
24
25 (* *********************************** *)
26 (* IMPOSTAZIONI SPECIFICHE DEI MODELLI *)
27 (* *********************************** *)
28
29 (* modelli di RS08 *)
30 ninductive RS08_model : Type ≝
31   MC9RS08KA1 : RS08_model
32 | MC9RS08KA2 : RS08_model.
33
34 (* memoria dei RS08 *)
35 ndefinition memory_type_of_FamilyRS08 ≝
36 λm:RS08_model.match m with
37  [ MC9RS08KA1 ⇒
38   [
39 (* tutto mappato nel segmento 0 *)
40 (* 0x0020-0x004F *)   quadruple … o0 〈〈x0,x0〉:〈x2,x0〉〉 〈〈x0,x0〉:〈x3,x0〉〉 MEM_READ_WRITE (* 48B RAM *)
41 (* 0x00C0-0x00FF *) ; quadruple … o0 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,x0〉:〈x4,x0〉〉 MEM_READ_WRITE (* 64B RAM PAGING *)
42 (* 0x0200-0x023F *) ; quadruple … o0 〈〈x0,x2〉:〈x0,x0〉〉 〈〈x0,x0〉:〈x4,x0〉〉 MEM_READ_WRITE (* 64B MEMORY MAPPED IO *)
43 (* 0x3C00-0x3FFF *) ; quadruple … o0 〈〈x3,xC〉:〈x0,x0〉〉 〈〈x0,x4〉:〈x0,x0〉〉 MEM_READ_ONLY  (* 1024B FLASH *) ]
44   | MC9RS08KA2 ⇒
45    [ 
46 (* tutto mappato nel segmento 0 *)
47 (* 0x0020-0x004F *)   quadruple … o0 〈〈x0,x0〉:〈x2,x0〉〉 〈〈x0,x0〉:〈x3,x0〉〉 MEM_READ_WRITE (* 48B RAM *)
48 (* 0x00C0-0x00FF *) ; quadruple … o0 〈〈x0,x0〉:〈xC,x0〉〉 〈〈x0,x0〉:〈x4,x0〉〉 MEM_READ_WRITE (* 64B RAM PAGING *)
49 (* 0x0200-0x023F *) ; quadruple … o0 〈〈x0,x2〉:〈x0,x0〉〉 〈〈x0,x0〉:〈x4,x0〉〉 MEM_READ_WRITE (* 64B MEMORY MAPPED IO *)
50 (* 0x3800-0x3FFF *) ; quadruple … o0 〈〈x3,x8〉:〈x0,x0〉〉 〈〈x0,x8〉:〈x0,x0〉〉 MEM_READ_ONLY  (* 2048B FLASH *) ]
51   ].
52
53 (* parametrizzati i non deterministici rispetto a tutti i valori casuali
54    che verranno dati dall'esterno di tipo byte8 (ndby1-2) e bool (ndbo1-5).
55    l'ACCENSIONE e' totalmente equivalente ad un reset causato da calo di tensione
56    (reset V-low), la memoria ed il check possono essere passati *)
57 ndefinition start_of_model_RS08 ≝
58 λmcu:RS08_model.λt:memory_impl.
59 λmem:aux_mem_type t.λchk:aux_chk_type t.
60 λndby1,ndby2:byte8.λirqfl,ndbo1,ndbo2,ndbo3,ndbo4,ndbo5:bool.
61  (mk_any_status RS08 t
62   (mk_alu_RS08
63    (* acc_low: reset *)  〈x0,x0〉
64    (* pc: reset *) 〈〈x3,xF〉:〈xF,xD〉〉
65    (* pcm *) 〈〈x3,xF〉:〈xF,xF〉〉
66    (* spc: reset *) 〈〈x3,xF〉:〈xF,xD〉〉
67    (* xm: reset *) 〈x0,x0〉
68    (* psm: *) 〈x8,x0〉
69    (* Z: reset *) false
70    (* C: reset *) false)
71    (* mem *) mem
72    (* chk *) chk
73    (* clk: reset *) (None ?)).
74
75 (* cio' che non viene resettato mantiene il valore precedente: nella documentazione
76    viene riportato come "unaffected"/"indeterminate"/"unpredictable"
77    il soft RESET e' diverso da un calo di tensione e la ram non variera' *)
78 ndefinition reset_of_model_RS08 ≝
79 λt:memory_impl.λs:any_status RS08 t.
80  (mk_any_status RS08 t
81   (mk_alu_RS08
82    (* acc_low: reset *) 〈x0,x0〉
83    (* pc: reset *) 〈〈x3,xF〉:〈xF,xD〉〉
84    (* pcm *) (pc_mask_RS08 (alu ? t s))
85    (* spc: reset *) 〈〈x3,xF〉:〈xF,xD〉〉
86    (* xm: reset *) 〈x0,x0〉
87    (* psm: reset *) 〈x8,x0〉
88    (* Z: reset *) false
89    (* C: reset *) false)
90    (* mem: inv. *) (mem_desc ? t s)
91    (* chk: inv. *) (chk_desc ? t s)
92    (* clk: reset *) (None ?)).