Implementing cfg for risc
This commit is contained in:
10
bin/main.ml
10
bin/main.ml
@ -1,5 +1,4 @@
|
||||
open MiniImp
|
||||
open MiniImp.CfgImp
|
||||
|
||||
let () =
|
||||
let program = "def main with input x output y as
|
||||
@ -10,11 +9,14 @@ let () =
|
||||
) else
|
||||
x := 1 - y;" in
|
||||
|
||||
|
||||
let get_result x = Lexing.from_string x |> Parser.prg Lexer.lex in
|
||||
|
||||
let p = get_result program in
|
||||
|
||||
let converted = convert p in
|
||||
let convertedcfg = CfgImp.convert_io p 3 in
|
||||
|
||||
Printf.printf "%a" SSCfg.pp converted
|
||||
Printf.printf "%a" CfgImp.SSCfg.pp convertedcfg;
|
||||
|
||||
let convertedrisccfg = CfgRISC.convert convertedcfg in
|
||||
|
||||
Printf.printf "%a" CfgRISC.RISCCfg.pp convertedrisccfg
|
||||
|
||||
Reference in New Issue
Block a user