From 38dbfeaba731308dfd58f1ff21ba2cc69d949928 Mon Sep 17 00:00:00 2001 From: Philipp Tomsich Date: Mon, 29 May 2023 21:23:26 +0200 Subject: [PATCH] coding style: fix style issues from merge of PR #257 PR #257 was aggressively merged before all coding-style issues had been commented on. This addresses the issues that came up (except the drive-by whitespace cleanup that was contained in PR #257 and would require a force-push) in review. --- model/riscv_step.sail | 13 ++++++++----- model/riscv_sys_regs.sail | 5 ++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/model/riscv_step.sail b/model/riscv_step.sail index a8a3b1e17..d1d0e4761 100644 --- a/model/riscv_step.sail +++ b/model/riscv_step.sail @@ -73,11 +73,14 @@ function step(step_no : int) -> bool = { /* for step extensions */ ext_pre_step_hook(); - // This records whether or not minstret should be incremented when the - // instruction is retired. Since retirement occurs before CSR writes we - // initialise it based on mcountinhibit here, before it is potentially - // changed. This is also set to false if minstret is written. - // See the note near the minstret declaration for more information. + /* + * This records whether or not minstret should be incremented when + * the instruction is retired. Since retirement occurs before CSR + * writes we initialise it based on mcountinhibit here, before it is + * potentially changed. This is also set to false if minstret is + * written. See the note near the minstret declaration for more + * information. + */ minstret_increment = mcountinhibit.IR() == 0b0; let (retired, stepped) : (Retired, bool) = diff --git a/model/riscv_sys_regs.sail b/model/riscv_sys_regs.sail index fe1b5dcf6..129ba9252 100644 --- a/model/riscv_sys_regs.sail +++ b/model/riscv_sys_regs.sail @@ -565,12 +565,11 @@ register mtime : bits(64) */ register minstret : bits(64) -// Should minstret be incremented when the instruction is retired. +/* Should minstret be incremented when the instruction is retired. */ register minstret_increment : bool function retire_instruction() -> unit = { - if minstret_increment - then minstret = minstret + 1; + if minstret_increment then minstret = minstret + 1; } /* informational registers */