From 825b77fe8b4eb0919564e51cfaae69a6dfae24e3 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 2 Oct 2020 21:54:34 +0200 Subject: so that all architectures compile --- riscV/OpWeights.ml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'riscV/OpWeights.ml') diff --git a/riscV/OpWeights.ml b/riscV/OpWeights.ml index 88ef5216..143435c1 100644 --- a/riscV/OpWeights.ml +++ b/riscV/OpWeights.ml @@ -1,9 +1,9 @@ open Op;; (* Attempt at modeling SweRV EH1 -[| issues ; LSU ; multiplier ; divider |] *) -let resource_bounds = [| 2 ; 1; 1; 2 |];; - +[| issues ; LSU ; multiplier |] *) +let resource_bounds = [| 2 ; 1; 1 |];; +let nr_non_pipelined_units = 1;; (* divider *) let latency_of_op (op : operation) (nargs : int) = match op with @@ -15,18 +15,25 @@ let latency_of_op (op : operation) (nargs : int) = 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 |] + | Omull | Omullhs | Omullhu -> [| 1 ; 0 ; 1 |] + | Odiv | Odivu | Odivl | Odivlu -> [| 0 ; 0; 0 |] | _ -> [| 1; 0; 0; 0 |];; + +let non_pipelined_resources_of_op (op : operation) (nargs : int) = + match op with + | Odiv | Odivu -> [| 29 |] + | Odivfs -> [| 20 |] + | Odivl | Odivlu | Odivf -> [| 50 |] + | _ -> [| -1 |];; -let resources_of_cond (cond : condition) (nargs : int) = [| 1; 0; 0; 0 |];; +let resources_of_cond (cond : condition) (nargs : int) = [| 1; 0; 0 |];; 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; 1; 0; 0 |];; +let resources_of_load trap chunk addressing nargs = [| 1; 1; 0 |];; -let resources_of_store chunk addressing nargs = [| 1; 1; 0; 0 |];; +let resources_of_store chunk addressing nargs = [| 1; 1; 0 |];; let resources_of_call _ _ = resource_bounds;; let resources_of_builtin _ = resource_bounds;; -- cgit