aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2021-04-01 01:40:07 +0100
committerYann Herklotz <git@yannherklotz.com>2021-04-01 01:40:07 +0100
commit9fc641a7b2e629021e0840fe272a5b51c41435b6 (patch)
treec19cd478b818cbd8cf0814fe34a04ba4966102c7
parent5ff4baa248397b89b5b66838cd57419191537d3f (diff)
downloadvericert-9fc641a7b2e629021e0840fe272a5b51c41435b6.tar.gz
vericert-9fc641a7b2e629021e0840fe272a5b51c41435b6.zip
Fix initialisation more
-rw-r--r--src/hls/PrintVerilog.ml14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/hls/PrintVerilog.ml b/src/hls/PrintVerilog.ml
index a55193d..a2700a1 100644
--- a/src/hls/PrintVerilog.ml
+++ b/src/hls/PrintVerilog.ml
@@ -139,22 +139,22 @@ let pprint_edge_top i = function
| Valledge -> "@*"
| Voredge (e1, e2) -> concat ["@("; pprint_edge e1; " or "; pprint_edge e2; ")"]
-let declare t =
+let declare (t, i) =
function (r, sz) ->
concat [ t; " ["; sprintf "%d" (Nat.to_int sz - 1); ":0] ";
- register r; " = 0;\n" ]
+ register r; if i then " = 0;\n" else ";\n" ]
-let declarearr t =
+let declarearr (t, _) =
function (r, sz, ln) ->
concat [ t; " ["; sprintf "%d" (Nat.to_int sz - 1); ":0] ";
register r;
" ["; sprintf "%d" (Nat.to_int ln - 1); ":0];\n" ]
let print_io = function
- | Some Vinput -> "input"
- | Some Voutput -> "output reg"
- | Some Vinout -> "inout"
- | None -> "reg"
+ | Some Vinput -> "input", false
+ | Some Voutput -> "output reg", true
+ | Some Vinout -> "inout", false
+ | None -> "reg", true
let decl i = function
| Vdecl (io, r, sz) -> concat [indent i; declare (print_io io) (r, sz)]