Changeset 2856


Ignore:
Timestamp:
Mar 12, 2013, 7:11:56 PM (4 years ago)
Author:
sacerdot
Message:

Pretty printing of LTL almost finished.

Location:
driver
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • driver/IntelHex.mli

    r2778 r2856  
    11type intel_hex_format
    22
     3val int_of_vect : Extracted.BitVector.bitVector -> int
     4
    35val string_of_intel_hex_format: intel_hex_format -> string
     6
    47val pack_exported_code_memory: int -> int -> Extracted.BitVector.byte Extracted.BitVectorTrie.bitVectorTrie -> intel_hex_format
  • driver/backendPrinter.ml

    r2854 r2856  
    5959 }
    6060
     61let print_byte b = string_of_int (IntelHex.int_of_vect b)
     62
     63let print_argument print_arg =
     64 function
     65    Extracted.Joint.Imm b -> print_byte b
     66  | Extracted.Joint.Reg x -> print_arg x
     67
     68let print_Register =
     69 function
     70  | Extracted.I8051.Register00     -> "Register00"
     71  | Extracted.I8051.Register01     -> "Register01"
     72  | Extracted.I8051.Register02     -> "Register02"
     73  | Extracted.I8051.Register03     -> "Register03"
     74  | Extracted.I8051.Register04     -> "Register04"
     75  | Extracted.I8051.Register05     -> "Register05"
     76  | Extracted.I8051.Register06     -> "Register06"
     77  | Extracted.I8051.Register07     -> "Register07"
     78  | Extracted.I8051.Register10     -> "Register10"
     79  | Extracted.I8051.Register11     -> "Register11"
     80  | Extracted.I8051.Register12     -> "Register12"
     81  | Extracted.I8051.Register13     -> "Register13"
     82  | Extracted.I8051.Register14     -> "Register14"
     83  | Extracted.I8051.Register15     -> "Register15"
     84  | Extracted.I8051.Register16     -> "Register16"
     85  | Extracted.I8051.Register17     -> "Register17"
     86  | Extracted.I8051.Register20     -> "Register20"
     87  | Extracted.I8051.Register21     -> "Register21"
     88  | Extracted.I8051.Register22     -> "Register22"
     89  | Extracted.I8051.Register23     -> "Register23"
     90  | Extracted.I8051.Register24     -> "Register24"
     91  | Extracted.I8051.Register25     -> "Register25"
     92  | Extracted.I8051.Register26     -> "Register26"
     93  | Extracted.I8051.Register27     -> "Register27"
     94  | Extracted.I8051.Register30     -> "Register30"
     95  | Extracted.I8051.Register31     -> "Register31"
     96  | Extracted.I8051.Register32     -> "Register32"
     97  | Extracted.I8051.Register33     -> "Register33"
     98  | Extracted.I8051.Register34     -> "Register34"
     99  | Extracted.I8051.Register35     -> "Register35"
     100  | Extracted.I8051.Register36     -> "Register36"
     101  | Extracted.I8051.Register37     -> "Register37"
     102  | Extracted.I8051.RegisterA      -> "RegisterA"
     103  | Extracted.I8051.RegisterB      -> "RegisterB"
     104  | Extracted.I8051.RegisterDPL    -> "RegisterDPL"
     105  | Extracted.I8051.RegisterDPH    -> "RegisterDPH"
     106  | Extracted.I8051.RegisterCarry  -> "RegisterCarry"
     107
     108let print_registers_move =
     109 function
     110  | Extracted.Joint_LTL_LIN.From_acc (reg,_unit) ->
     111     print_Register reg ^ " " ^ "ACC_A"
     112  | Extracted.Joint_LTL_LIN.To_acc (_unit,reg) ->
     113     "ACC_A " ^ print_Register reg
     114  | Extracted.Joint_LTL_LIN.Int_to_reg (reg,byte) ->
     115     print_Register reg ^ " " ^ print_byte byte
     116  | Extracted.Joint_LTL_LIN.Int_to_acc (_unit,byte) ->
     117     "ACC_A " ^ print_byte byte
     118
    61119let joint_LTL_LIN_printing_params =
    62120 { Extracted.Joint_printer.print_pass_ind = printing_pass_independent_params
     
    69127 ; print_dpl_arg = (fun _ -> "DPL")
    70128 ; print_dph_arg = (fun _ -> "DPH")
    71  ; print_snd_arg = (fun hdw_arg -> "ACC_B")
    72  ; print_pair_move = (fun pair_move -> "ACC_B")
    73  ; print_call_args = (fun n -> "ACC_B")
     129 ; print_snd_arg = (fun hdw_arg -> print_argument print_Register (Obj.magic hdw_arg))
     130 ; print_pair_move = Obj.magic print_registers_move
     131 ; print_call_args =
     132    (fun n ->string_of_int (Extracted.Glue.int_of_matitanat (Obj.magic n)))
    74133 ; print_call_dest = (fun _ -> "")
    75134 ; print_ext_seq = (fun ltl_lin_seq -> assert false )
  • driver/build

    r2854 r2856  
    1212ocamlc -I ../Deliverables/D2.2/8051/lib -c -g error.ml
    1313ocamlc -I ../Deliverables/D2.2/8051/lib -c -g *.ml
    14 ocamlc -custom -g -I ../Deliverables/D2.2/8051/lib extracted.cmo  ../Deliverables/D2.2/8051/lib/libcparser.a ../Deliverables/D2.2/8051/lib/cparser.cma clightFromC.cmo clightParser.cmo clightPrinter.cmo backendPrinter.cmo IntelHex.cmo ASMPrinter.cmo error.cmo cerco.cmo -o cerco
     14ocamlc -custom -g -I ../Deliverables/D2.2/8051/lib extracted.cmo  ../Deliverables/D2.2/8051/lib/libcparser.a ../Deliverables/D2.2/8051/lib/cparser.cma clightFromC.cmo clightParser.cmo IntelHex.cmo clightPrinter.cmo backendPrinter.cmo ASMPrinter.cmo error.cmo cerco.cmo -o cerco
Note: See TracChangeset for help on using the changeset viewer.