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 (* Ultima modifica: 05/08/2009 *)
21 (* ********************************************************************** *)
23 include "freescale_tests/micro_tests_tools.ma".
24 include "freescale/multivm.ma".
25 include "freescale/status_lemmas.ma".
27 (* ****************************************** *)
28 (* MICRO TEST DI CORRETTEZZA DELLE ISTRUZIONI *)
29 (* ****************************************** *)
35 ndefinition mTest_RS08_TNY_source ≝ let m ≝ RS08 in source_to_byte8 m (
36 (* testa la logica RS08 X,D[X] le modalita' TNY *)
37 (* NB: il meccanismo utilizzato e' quello complesso dell'RS08
38 fare riferimento alle spiegazioni in STATUS/LOAD_WRITE *)
40 (* [0x3800] 3clk *) (compile m ? ADD (maTNY xD) I) @ (* ... +[0x000D]=0x0C *)
41 (* [0x3801] 3clk *) (compile m ? ADD (maTNY xE) I) @ (* ... +D[X]=[0x0020]=0x1F *)
42 (* [0x3802] 3clk *) (compile m ? ADD (maTNY xF) I) @ (* ... +X=0x20 *)
43 (* [0x3803] 3clk *) (compile m ? ADD (maDIR1 〈xC,xF〉) I) @ (* ... +X=0x20 *)
44 (* [0x3805] 3clk *) (compile m ? ADD (maDIR1 〈xC,xE〉) I) (* ... +[0x000E]=0x0D *)
45 (* [0x3807] si puo' quindi enunciare che dopo 15 clk
49 (* creazione del processore+caricamento+impostazione registri *)
50 ndefinition mTest_RS08_TNY_status ≝
52 setweak_x_map RS08 t (* X<-0x20 *)
53 (setweak_ps_map RS08 t (* PS<-0x00 *)
54 (set_pc_reg RS08 t (* PC<-mTest_RS08_prog *)
55 (start_of_mcu_version_RS08
57 (load_from_source_at t (* carica mTest_bytes in RAM:mTest_RS08_RAM *)
58 (load_from_source_at t (zero_memory t) (* carica source in ROM:mTest_RS08_prog *)
59 mTest_RS08_TNY_source mTest_RS08_prog)
60 mTest_bytes 〈〈x0,x0〉:〈x0,x1〉〉)
61 (build_memory_type_of_mcu_version (FamilyRS08 MC9RS08KA2) t)
62 (mk_byte8 x0 x0) (mk_byte8 x0 x0) (* non deterministici tutti a 0 *)
63 false false false false false false (* non deterministici tutti a 0 *)
68 (* dimostrazione senza svolgimento degli stati, immediata *)
69 nlemma ok_mTest_RS08_TNY_full :
71 execute RS08 t (TickOK ? (mTest_RS08_TNY_status t)) nat15 =
72 TickOK ? (set_acc_8_low_reg RS08 t (* nuovo A *)
73 (set_pc_reg RS08 t (mTest_RS08_TNY_status t) (* nuovo PC *)
74 (mk_word16 〈x3,x8〉 〈x0,x7〉))