aboutsummaryrefslogtreecommitdiffstats
path: root/src/hls/RTLBlockgen.v
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2022-04-18 21:48:38 +0100
committerYann Herklotz <git@yannherklotz.com>2022-04-18 21:48:38 +0100
commit33289fbde8979fe8b766c397429603e5bb10e7e7 (patch)
treed663279d9b02986d58a1249565bd3f79b727f9be /src/hls/RTLBlockgen.v
parentd92a54d13dd6dd184fef7e71207ec1d611ad13f2 (diff)
downloadvericert-33289fbde8979fe8b766c397429603e5bb10e7e7.tar.gz
vericert-33289fbde8979fe8b766c397429603e5bb10e7e7.zip
Extract some lemmas from the main proof
Diffstat (limited to 'src/hls/RTLBlockgen.v')
-rw-r--r--src/hls/RTLBlockgen.v12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/hls/RTLBlockgen.v b/src/hls/RTLBlockgen.v
index 2c40291..8b0ea65 100644
--- a/src/hls/RTLBlockgen.v
+++ b/src/hls/RTLBlockgen.v
@@ -39,12 +39,20 @@ Require Import vericert.hls.RTLBlock.
(*|
``find_block max nodes index``: Does not need to be sorted, because we use
filter and the max fold function to find the desired element.
+
+ Compute find_block 100 (2::94::48::39::19::nil) 40
+ = 48
+ : positive
+
+It wants to find the nearest block that is greater than or equal to the current
+block.
|*)
-Definition find_block (max: positive) (nodes: list positive) (index: positive) : positive :=
+Definition find_block (max: positive) (nodes: list positive) (index: positive)
+ : positive :=
List.fold_right Pos.min max (List.filter (fun x => (index <=? x)) nodes).
-(*Compute find_block 100 (2::94::48::39::19::nil) 40.*)
+(*Compute (find_block 100 (2::94::48::39::19::nil) 40 =? 48).*)
(*|
.. index::