aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/verilog/Value.v3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/verilog/Value.v b/src/verilog/Value.v
index fe53dbc..241534c 100644
--- a/src/verilog/Value.v
+++ b/src/verilog/Value.v
@@ -78,6 +78,9 @@ Definition uvalueToZ (v : value) : Z :=
Definition intToValue (i : Integers.int) : value :=
ZToValue Int.wordsize (Int.unsigned i).
+Definition valueToInt (i : value) : Integers.int :=
+ Int.repr (valueToZ i).
+
(** Convert a [value] to a [bool], so that choices can be made based on the
result. This is also because comparison operators will give back [value] instead
of [bool], so if they are in a condition, they will have to be converted before