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 (* ********************************************************************** *)
23 include "emulator/status/status.ma".
25 (* *********************************** *)
26 (* IMPOSTAZIONI SPECIFICHE DEI MODELLI *)
27 (* *********************************** *)
30 ninductive RS08_model : Type ≝
31 MC9RS08KA1 : RS08_model
32 | MC9RS08KA2 : RS08_model.
34 (* memoria dei RS08 *)
35 ndefinition memory_type_of_FamilyRS08 ≝
36 λm:RS08_model.match m with
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 *) ]
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 *) ]
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.
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〉
73 (* clk: reset *) (None ?)).
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.
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〉
90 (* mem: inv. *) (mem_desc ? t s)
91 (* chk: inv. *) (chk_desc ? t s)
92 (* clk: reset *) (None ?)).