Project

General

Profile

« Previous | Next » 

Revision 6d1693b9

Added by LĂ©lio Brun 7 months ago

work on spec generation almost done

View differences:

src/backends/EMF/EMF_backend.ml
165 165
let get_instr_id fmt i =
166 166
  match Corelang.get_instr_desc i with
167 167
  | MLocalAssign(lhs,_) | MStateAssign (lhs, _) -> pp_var_name fmt lhs
168
  | MReset i | MNoReset i -> fprintf fmt "%s" (reset_name i)
168
  | MSetReset i | MNoReset i -> fprintf fmt "%s" (reset_name i)
169
  (* TODO: handle clear_reset *)
170
  | MClearReset -> ()
169 171
  | MBranch _ -> incr branch_cpt; fprintf fmt "branch_%i" !branch_cpt
170 172
  | MStep (outs, id, _) ->
171 173
     print_protect fmt 
......
242 244

  
243 245
     all_def_vars, def_vars, VSet.union read_guard read_vars
244 246
  | MBranch _ -> assert false (* branch instruction should admit at least one case *)
245
  | MReset ni           
246
    | MNoReset ni ->
247
     let write = ISet.singleton (reset_name ni) in
248
     write, write, VSet.empty
247
  | MSetReset ni
248
  | MNoReset ni ->
249
    let write = ISet.singleton (reset_name ni) in
250
    write, write, VSet.empty
251
  (* TODO: handle clear_reset *)
252
  | MClearReset -> ISet.empty, ISet.empty, VSet.empty
249 253
  | MSpec _ | MComment _ -> assert false (* not  available for EMF output *)
250 254
     
251 255
(* A kind of super join_guards: all MBranch are postponed and sorted by
......
298 302
	  (pp_emf_cst_or_var m) expr
299 303
      )
300 304
       
301
    | MReset id           
305
    | MSetReset id
302 306
      -> (
303 307
	fprintf fmt "\"kind\": \"reset\",@ \"lhs\": \"%s\",@ \"rhs\": \"true\""
304 308
	  (reset_name id)
......
308 312
	fprintf fmt "\"kind\": \"reset\",@ \"lhs\": \"%s\",@ \"rhs\": \"false\""
309 313
	  (reset_name id)
310 314
      )
315
  (* TODO: handle clear_reset *)
316
  | MClearReset -> ()
311 317
       
312 318
    | MBranch (g, hl) -> (
313 319
      let all_outputs, outputs, inputs = branch_instr_vars m i in

Also available in: Unified diff