Skip to content

Commit

Permalink
Added TIDC registers
Browse files Browse the repository at this point in the history
  • Loading branch information
francislaus committed Apr 19, 2024
1 parent 6e3613a commit 80b3283
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cheri_insts.sail
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,12 @@ function clause execute (CSpecialRW(cd, scr, cs1)) = {
let (specialExists, ro, priv, needASR) : (bool, bool, Privilege, bool) = match unsigned(scr) {
0 => (true, true, User, false),
1 => (true, false, User, false),
3 if haveUsrMode() => (true, true, User, false),
4 if haveNExt() => (true, false, User, true),
5 if haveNExt() => (true, false, User, true),
6 if haveNExt() => (true, false, User, true),
7 if haveNExt() => (true, false, User, true),
11 if haveSupMode() => (true, false, Supervisor, true),
12 if haveSupMode() => (true, false, Supervisor, true),
13 if haveSupMode() => (true, false, Supervisor, true),
14 if haveSupMode() => (true, false, Supervisor, true),
Expand Down Expand Up @@ -395,10 +397,12 @@ function clause execute (CSpecialRW(cd, scr, cs1)) = {
pcc
},
1 => DDC,
3 => STIDC,
4 => UTCC,
5 => UTDC,
6 => UScratchC,
7 => legalize_epcc(UEPCC),
11 => STIDC,
12 => STCC,
13 => STDC,
14 => SScratchC,
Expand All @@ -416,6 +420,7 @@ function clause execute (CSpecialRW(cd, scr, cs1)) = {
5 => UTDC = cs1_val,
6 => UScratchC = cs1_val,
7 => UEPCC = cs1_val,
12 => STIDC = cs1_val,
12 => STCC = legalize_tcc(STCC, cs1_val),
13 => STDC = cs1_val,
14 => SScratchC = cs1_val,
Expand Down
2 changes: 2 additions & 0 deletions src/cheri_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ function ext_init_regs () = {
DDC = default_cap;
nextPCC = default_cap;

UTIDC = null_cap;
UTCC = default_cap;
UTDC = null_cap;
UScratchC = null_cap;
UEPCC = default_cap;

STIDC = null_cap;
STCC = default_cap;
STDC = null_cap;
SScratchC = null_cap;
Expand Down
2 changes: 2 additions & 0 deletions src/cheri_scr_map.sail
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ scattered mapping scr_name_map
mapping clause scr_name_map = 0b00000 <-> "pcc"
mapping clause scr_name_map = 0b00001 <-> "ddc"

mapping clause scr_name_map = 0b00011 <-> "utidc"
mapping clause scr_name_map = 0b00100 <-> "utcc"
mapping clause scr_name_map = 0b00101 <-> "utdc"
mapping clause scr_name_map = 0b00110 <-> "uscratchc"
mapping clause scr_name_map = 0b00111 <-> "uepcc"

mapping clause scr_name_map = 0b01011 <-> "stidc"
mapping clause scr_name_map = 0b10100 <-> "stcc"
mapping clause scr_name_map = 0b10101 <-> "stdc"
mapping clause scr_name_map = 0b10110 <-> "sscratchc"
Expand Down
2 changes: 2 additions & 0 deletions src/cheri_sys_regs.sail
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ register PCC : Capability
register nextPCC : Capability
register DDC : Capability

register UTIDC : Capability
register UTCC : Capability
register UTDC : Capability
register UScratchC : Capability
register UEPCC : Capability
register STIDC : Capability
register STCC : Capability
register STDC : Capability
register SScratchC : Capability
Expand Down

0 comments on commit 80b3283

Please sign in to comment.