From d87dc1bde1d962fd1192f9176396c4bc7d151041 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Fri, 18 Sep 2020 18:38:26 +0200 Subject: EH1 scheduling --- riscV/OpWeights.ml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'riscV/OpWeights.ml') 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;; -- cgit