aboutsummaryrefslogtreecommitdiffstats
path: root/src/hls/RTLBlock.v
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2020-08-30 16:06:25 +0100
committerYann Herklotz <git@yannherklotz.com>2020-08-30 16:06:25 +0100
commit6cb38f39f5609651691419c6a299b09695a4623c (patch)
tree66222854728d3609ef5977f4d1c34ad96245822a /src/hls/RTLBlock.v
parentec319c9ec0acc975fcdfbfa2e378b82c9be9ab0a (diff)
downloadvericert-6cb38f39f5609651691419c6a299b09695a4623c.tar.gz
vericert-6cb38f39f5609651691419c6a299b09695a4623c.zip
Continue on Partitioning algorithm
Diffstat (limited to 'src/hls/RTLBlock.v')
-rw-r--r--src/hls/RTLBlock.v16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/hls/RTLBlock.v b/src/hls/RTLBlock.v
index 7169d4a..2aaa010 100644
--- a/src/hls/RTLBlock.v
+++ b/src/hls/RTLBlock.v
@@ -35,13 +35,13 @@ Inductive instruction : Type :=
Definition bblock_body : Type := list instruction.
Inductive control_flow_inst : Type :=
-| RBcall : signature -> ident -> list reg -> reg -> node -> control_flow_inst
-| RBtailcall : signature -> ident -> list reg -> control_flow_inst
+| RBcall : signature -> reg + ident -> list reg -> reg -> node -> control_flow_inst
+| RBtailcall : signature -> reg + ident -> list reg -> control_flow_inst
| RBbuiltin : external_function -> list (builtin_arg reg) ->
builtin_res reg -> node -> control_flow_inst
| RBcond : condition -> list reg -> node -> node -> control_flow_inst
| RBjumptable : reg -> list node -> control_flow_inst
-| RBredurn : option reg -> control_flow_inst.
+| RBreturn : option reg -> control_flow_inst.
Record bblock : Type := mk_bblock {
bb_body: bblock_body;
@@ -67,3 +67,13 @@ Definition funsig (fd: fundef) :=
| Internal f => fn_sig f
| External ef => ef_sig ef
end.
+
+Definition successors_instr (i : control_flow_inst) : list node :=
+ match i with
+ | RBcall sig ros args res s => s :: nil
+ | RBtailcall sig ros args => nil
+ | RBbuiltin ef args res s => s :: nil
+ | RBcond cond args ifso ifnot => ifso :: ifnot :: nil
+ | RBjumptable arg tbl => tbl
+ | RBreturn optarg => nil
+ end.