aboutsummaryrefslogtreecommitdiffstats
path: root/riscV/OpWeights.ml
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-09-18 18:38:26 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-09-18 18:38:26 +0200
commitd87dc1bde1d962fd1192f9176396c4bc7d151041 (patch)
tree32128b3850c8c672f6dc57525982e341ca739be9 /riscV/OpWeights.ml
parent62063b60892dea2e52b32c426bdd481816f24b7f (diff)
downloadcompcert-kvx-d87dc1bde1d962fd1192f9176396c4bc7d151041.tar.gz
compcert-kvx-d87dc1bde1d962fd1192f9176396c4bc7d151041.zip
EH1 scheduling
Diffstat (limited to 'riscV/OpWeights.ml')
-rw-r--r--riscV/OpWeights.ml23
1 files changed, 18 insertions, 5 deletions
diff --git a/riscV/OpWeights.ml b/riscV/OpWeights.ml
index 3662ef1c..02187067 100644
--- a/riscV/OpWeights.ml
+++ b/riscV/OpWeights.ml
@@ -1,19 +1,32 @@
open Op;;
-let resource_bounds = [| 1 |];;
+(* Attempt at modeling SweRV EH1
+[| issues ; LSU ; multiplier ; divider |] *)
+let resource_bounds = [| 2 ; 1; 1; 2 |];;
-let latency_of_op (op : operation) (nargs : int) = 1;;
-let resources_of_op (op : operation) (nargs : int) = [| 1 |];;
+let latency_of_op (op : operation) (nargs : int) =
+ match op with
+ | Omul | Omulhs | Omulhu
+ | Omull | Omullhs | Omullhu -> 3
+ | Odiv | Odivu | Odivl | Odivlu -> 16
+ | _ -> 1;;
+
+let resources_of_op (op : operation) (nargs : int) =
+ match op with
+ | Omul | Omulhs | Omulhu
+ | Omull | Omullhs | Omullhu -> [| 1 ; 0 ; 1; 0 |]
+ | Odiv | Odivu | Odivl | Odivlu -> [| 0 ; 0; 0; 1 |]
+ | _ -> [| 1; 0; 0; 0 |];;
let resources_of_cond (cond : condition) (nargs : int) = [| 1 |];;
let latency_of_load trap chunk (addr : addressing) (nargs : int) = 3;;
let latency_of_call _ _ = 6;;
-let resources_of_load trap chunk addressing nargs = [| 1 |];;
+let resources_of_load trap chunk addressing nargs = [| 1; 1; 0; 0 |];;
-let resources_of_store chunk addressing nargs = [| 1 |];;
+let resources_of_store chunk addressing nargs = [| 1; 1; 0; 0 |];;
let resources_of_call _ _ = resource_bounds;;
let resources_of_builtin _ = resource_bounds;;