Skip to content

Commit 8f7ea6c

Browse files
committed
(flat/fetch-relaxed) add IDC/DIC model options
Adds arguments for easily passing the Arm IDC/DIC field combinations. Can pass one of: -model fetch-relaxed -model fetch-relaxed-only-idc -model fetch-relaxed-only-dic -model fetch-relaxed-both To get the group of model parameters corresponding to IDC, DIC, both, or neither. Only valid for Arm, on flat with ifetch enabled. In future, we should read the Arm CTR_EL0.{IDC,DIC} register fields to get these, rather than pass in as arguments.
1 parent 0bcc595 commit 8f7ea6c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src_top/model_aux.ml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,19 @@ let XX_update params value = {params with t = {params.t with XX = value}}
367367
let XX_value params = params.t.XX
368368
*)
369369

370-
open MachineDefTypes
371370
let fetch_atomics_assoc =
372-
let r =
373-
(* TODO: eventually read these from user or sail registers *)
374-
{ flat_need_ic = true;
375-
flat_need_dc = true;
371+
let r ic dc =
372+
{ flat_need_ic = ic;
373+
flat_need_dc = dc;
376374
flat_icache_type = Icache_Many;
377375
} in
376+
(* TODO: eventually, dic/idc can be read from the user CTR_EL0 register on Arm
377+
* and don't need to be a weird argument to the model *)
378378
[((Fetch_Atomic, Fetch_Sequential, false), "fetch-atomic");
379-
((Fetch_Relaxed r, Fetch_Unrestricted, true), "fetch-relaxed")]
379+
((Fetch_Relaxed (r true true), Fetch_Unrestricted, true), "fetch-relaxed");
380+
((Fetch_Relaxed (r true false), Fetch_Unrestricted, true), "fetch-relaxed-only-idc");
381+
((Fetch_Relaxed (r false true), Fetch_Sequential, true), "fetch-relaxed-only-dic");
382+
((Fetch_Relaxed (r false false), Fetch_Sequential, true), "fetch-relaxed-both");]
380383
let fetch_atomics_update params (mft, tfo, iffss) =
381384
{params with
382385
ss = {params.ss with ss_fetch_type=mft};

0 commit comments

Comments
 (0)