Project

General

Profile

« Previous | Next » 

Revision 2863281f

Added by Pierre-Loïc Garoche almost 7 years ago

Further restructuring:
- arrow.ml* to define basic builder for arrow (node, name, ...)
- machine_code_common similar to corelang but for machine_code (printers, some builders, ...)
- machine_code restricted to the translatation from normalized nodes to machines

View differences:

src/plugins/scopes/scopes.ml
1 1
open Lustre_types 
2 2
open Corelang 
3 3
open Machine_code_types
4
open Machine_code
4
open Machine_code_common
5 5

  
6 6
(* (variable, node name, node instance) *)
7 7
type scope_t = (var_decl * string * string option) list * var_decl
......
107 107
      let instance = 
108 108
	List.find 
109 109
	  (fun i -> match get_instr_desc i with 
110
	  | Machine_code_types.MStep(p, o, _) -> List.exists find_var p 
110
	  | MStep(p, o, _) -> List.exists find_var p 
111 111
	  | _ -> false
112 112
	  ) 
113 113
	  e_machine.mstep.step_instrs 
......
115 115
      try
116 116
	let variable, instance_node, instance_id = 
117 117
	  match get_instr_desc instance with 
118
	  | Machine_code_types.MStep(p, o, _) -> 
118
	  | MStep(p, o, _) -> 
119 119
	    (* Format.eprintf "Looking for machine %s@.@?" o; *)
120 120
	    let o_fun, _ = List.assoc o e_machine.mcalls in
121 121
	    if node_name o_fun = nodename then
......
221 221
let update_machine machine =
222 222
  let stateassign vdecl =
223 223
    mkinstr 
224
    (Machine_code_types.MStateAssign (vdecl, mk_val (Machine_code_types.LocalVar vdecl) vdecl.var_type))
224
    (MStateAssign (vdecl, mk_val (LocalVar vdecl) vdecl.var_type))
225 225
  in
226 226
  let local_decls = machine.mstep.step_inputs
227 227
    (* @ machine.mstep.step_outputs   *)
......
232 232
    mstep = { 
233 233
      machine.mstep with 
234 234
        step_instrs = machine.mstep.step_instrs
235
        @ (mkinstr (Machine_code_types.MComment "Registering all flows"))::(List.map stateassign local_decls)
235
        @ (mkinstr (MComment "Registering all flows"))::(List.map stateassign local_decls)
236 236
          
237 237
    }
238 238
  }

Also available in: Unified diff