Skip to content

Commit

Permalink
coding style: fix style issues from merge of PR #257
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ptomsich committed May 29, 2023
1 parent f2d8e1b commit 38dbfea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
13 changes: 8 additions & 5 deletions model/riscv_step.sail
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down
5 changes: 2 additions & 3 deletions model/riscv_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 38dbfea

Please sign in to comment.