Skip to content

Commit

Permalink
Regenerate sail_latex_riscv
Browse files Browse the repository at this point in the history
Corresponds to commit 77e647e6319d142e0bf101f908b4ba0b954fada9 in
sail-cheri-riscv.
  • Loading branch information
bsdjhb committed Aug 7, 2023
1 parent 1945614 commit b95fe95
Show file tree
Hide file tree
Showing 196 changed files with 698 additions and 197 deletions.
541 changes: 454 additions & 87 deletions sail_latex_riscv/commands.tex

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
} else if cs2_val.permit_execute then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_PermitExecuteViolation, cs2);
RETIRE_FAIL
} else if #\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzinCapBounds]{inCapBounds}#(cs1_val, newPC, #\hyperref[sailRISCVzminzyinstructionzybytes]{min\_instruction\_bytes}#())) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_LengthViolation, cs1);
RETIRE_FAIL
} else if newPCCBase[0] == bitone | (newPCCBase[1] == bitone & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#())) then {
} else if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() & (newPCCBase[0] == bitone | (newPCCBase[1] == bitone & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#()))) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_UnalignedBase, cs1);
RETIRE_FAIL
} else if newPC[1] == bitone & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#()) then {
#\hyperref[sailRISCVzhandlezymemzyexception]{handle\_mem\_exception}#(newPC, #\hyperref[sailRISCVzEzyFetchzyAddrzyAlign]{E\_Fetch\_Addr\_Align}#());
RETIRE_FAIL
} else if #\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzinCapBounds]{inCapBounds}#(cs1_val, newPC, #\hyperref[sailRISCVzminzyinstructionzybytes]{min\_instruction\_bytes}#())) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_LengthViolation, cs1);
RETIRE_FAIL
} else {
#\hyperref[sailRISCVzC]{C}#(31) = #\hyperref[sailRISCVzunsealCap]{unsealCap}#(cs2_val);
nextPC = newPC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
} else if #\hyperref[sailRISCVznot]{not}#(cs1_val.permit_execute) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_PermitExecuteViolation, cs1);
RETIRE_FAIL
} else if #\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzinCapBounds]{inCapBounds}#(cs1_val, newPC, #\hyperref[sailRISCVzminzyinstructionzybytes]{min\_instruction\_bytes}#())) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_LengthViolation, cs1);
RETIRE_FAIL
} else if newPCCBase[0] == bitone | (newPCCBase[1] == bitone & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#())) then {
} else if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() & (newPCCBase[0] == bitone | (newPCCBase[1] == bitone & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#()))) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_UnalignedBase, cs1);
RETIRE_FAIL
} else if newPC[1] == bitone & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#()) then {
#\hyperref[sailRISCVzhandlezymemzyexception]{handle\_mem\_exception}#(newPC, #\hyperref[sailRISCVzEzyFetchzyAddrzyAlign]{E\_Fetch\_Addr\_Align}#());
RETIRE_FAIL
} else if #\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzinCapBounds]{inCapBounds}#(cs1_val, newPC, #\hyperref[sailRISCVzminzyinstructionzybytes]{min\_instruction\_bytes}#())) then {
#\hyperref[sailRISCVzhandlezycherizyregzyexception]{handle\_cheri\_reg\_exception}#(CapEx_LengthViolation, cs1);
RETIRE_FAIL
} else {
let (success, linkCap) = #\hyperref[sailRISCVzsetCapAddr]{setCapAddr}#(PCC, nextPC); /* Note that nextPC accounts for compressed instructions */
assert(success, "Link cap should always be representable.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
30 => MScratchC = cs1_val,
31 => MEPCC = cs1_val,
_ => assert(false, "unreachable")
}
};
if #\hyperref[sailRISCVzgetzyconfigzyprintzyreg]{get\_config\_print\_reg}#() then
#\hyperref[sailRISCVzprintzyreg]{print\_reg}#(#\hyperref[sailRISCVzscrzynamezymap]{scr\_name\_map}#(scr) ^ " <- " ^ #\hyperref[sailRISCVzRegStr]{RegStr}#(cs1_val));
};
RETIRE_SUCCESS
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezyloadzycapzyviazycap]{handle\_load\_cap\_via\_cap}#(cd, DDC_IDX, ddc_val, vaddr)
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezyloadzydatazyviazycap]{handle\_load\_data\_via\_cap}#(rd, DDC_IDX, ddc_val, vaddr, is_unsigned, width)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if #\hyperref[sailRISCVzhaveAtomics]{haveAtomics}#() then {
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezyloadreszycapzyviazycap]{handle\_loadres\_cap\_via\_cap}#(cd, DDC_IDX, ddc_val, vaddr, false, false)
} else {
#\hyperref[sailRISCVzhandlezyillegal]{handle\_illegal}#();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
if #\hyperref[sailRISCVzhaveAtomics]{haveAtomics}#() then {
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezyloadreszydatazyviazycap]{handle\_loadres\_data\_via\_cap}#(rd, DDC_IDX, ddc_val, vaddr, width)
} else {
#\hyperref[sailRISCVzhandlezyillegal]{handle\_illegal}#();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezystorezycapzyviazycap]{handle\_store\_cap\_via\_cap}#(cs2, DDC_IDX, ddc_val, vaddr)
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#\hyperref[sailRISCVzC]{C}#(cs2) = #\hyperref[sailRISCVzintzytozycap]{int\_to\_cap}#(#\hyperref[sailRISCVzEXTZ]{EXTZ}#(0b1));
RETIRE_SUCCESS
} else if #\hyperref[sailRISCVzhaveAtomics]{haveAtomics}#() then {
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezystorezycondzycapzyviazycap]{handle\_store\_cond\_cap\_via\_cap}#(cs2, cs2, DDC_IDX, ddc_val, vaddr, false, false, true)
} else {
#\hyperref[sailRISCVzhandlezyillegal]{handle\_illegal}#();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
#\hyperref[sailRISCVzX]{X}#(rs2) = #\hyperref[sailRISCVzEXTZ]{EXTZ}#(0b1);
RETIRE_SUCCESS
} else if #\hyperref[sailRISCVzhaveAtomics]{haveAtomics}#() then {
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezystorezycondzydatazyviazycap]{handle\_store\_cond\_data\_via\_cap}#(rs2, DDC_IDX, ddc_val, vaddr, width)
} else {
#\hyperref[sailRISCVzhandlezyillegal]{handle\_illegal}#();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
let ddc_val = DDC;
let vaddr = ddc_val.address + #\hyperref[sailRISCVzX]{X}#(rs1);
let (ddc_val, vaddr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(rs1));
#\hyperref[sailRISCVzhandlezystorezydatazyviazycap]{handle\_store\_data\_via\_cap}#(rs2, DDC_IDX, ddc_val, vaddr, width)
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function #\hyperref[sailRISCVzcapzytozyintegerzypc]{cap\_to\_integer\_pc}# (cap: Capability) -> xlenbits = {
if (#\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#()) then #\hyperref[sailRISCVzgetCapOffsetBits]{getCapOffsetBits}#(cap) else cap.address
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(#\hyperref[sailRISCVzBitStr]{BitStr}#(0b0 @ #\hyperref[sailRISCVzgetCapPerms]{getCapPerms}#(cap)),
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(" type:",
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(#\hyperref[sailRISCVzBitStr]{BitStr}#(otype64),
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(" offset:",
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(#\hyperref[sailRISCVzBitStr]{BitStr}#(#\hyperref[sailRISCVzgetCapOffsetBits]{getCapOffsetBits}#(cap)),
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(" address:",
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(#\hyperref[sailRISCVzBitStr]{BitStr}#(cap.address),
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(" base:",
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(#\hyperref[sailRISCVzBitStr]{BitStr}#(#\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(cap)),
#\hyperref[sailRISCVzconcatzystr]{concat\_str}#(" length:", len_str)))))))))))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
then match #\hyperref[sailRISCVzextzycheckzyphyszymemzywrite]{ext\_check\_phys\_mem\_write}# (wk, paddr, width, data, meta) {
#\hyperref[sailRISCVzExtzyPhysAddrzyOK]{Ext\_PhysAddr\_OK}#() => #\hyperref[sailRISCVzphyszymemzywrite]{phys\_mem\_write}#(wk, paddr, width, data, meta),
#\hyperref[sailRISCVzExtzyPhysAddrzyError]{Ext\_PhysAddr\_Error}#(e) => #\hyperref[sailRISCVzMemException]{MemException}#(e)
}
}
else #\hyperref[sailRISCVzMemException]{MemException}#(#\hyperref[sailRISCVzEzySAMOzyAccesszyFault]{E\_SAMO\_Access\_Fault}#())
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}# (addr) = {
let ddc_val = DDC in
(ddc_val, if (#\hyperref[sailRISCVzhavezyddczyrelocation]{have\_ddc\_relocation}#()) then ddc_val.address + addr else addr)
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
function #\hyperref[sailRISCVzextzycontrolzycheckzyaddr]{ext\_control\_check\_addr}#(pc : xlenbits) -> #\hyperref[sailRISCVzExtzyControlAddrzyCheck]{Ext\_ControlAddr\_Check}#(ext_control_addr_error) = {
let pcc_base = #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC);
/* We are given the addr without any bit[0] clearing, so the addition
* below may include a set addr[0], and so the bounds checks should
* be accurate.
*/
let target : xlenbits = [pcc_base + pc with 0=bitzero];
let pc = if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() then #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC) + pc else pc;
let target : xlenbits = [pc with 0=bitzero];
if #\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzinCapBounds]{inCapBounds}#(PCC, target, #\hyperref[sailRISCVzminzyinstructionzybytes]{min\_instruction\_bytes}# ()))
then #\hyperref[sailRISCVzExtzyControlAddrzyError]{Ext\_ControlAddr\_Error}#(CapEx_LengthViolation, PCC_IDX)
else #\hyperref[sailRISCVzExtzyControlAddrzyOK]{Ext\_ControlAddr\_OK}#(target)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
function #\hyperref[sailRISCVzextzyfailzyxretzypriv]{ext\_fail\_xret\_priv}# () : unit -> unit =
function #\hyperref[sailRISCVzextzyfailzyxretzypriv]{ext\_fail\_xret\_priv}# () : unit -> unit =
#\hyperref[sailRISCVzhandlezycherizypcczyexception]{handle\_cheri\_pcc\_exception}#(CapEx_AccessSystemRegsViolation)
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
function #\hyperref[sailRISCVzextzyfetchzycheckzypc]{ext\_fetch\_check\_pc}#(start_pc, pc) = {
if start_pc == pc
then {
pcc_base = #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC);
let pcc_base = #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC);
/* We need to perform the permission checks only for the first granule. */
if #\hyperref[sailRISCVznot]{not}#(PCC.tag)
then #\hyperref[sailRISCVzExtzyFetchAddrzyError]{Ext\_FetchAddr\_Error}#(CapEx_TagViolation)
else if #\hyperref[sailRISCVzisCapSealed]{isCapSealed}#(PCC)
then #\hyperref[sailRISCVzExtzyFetchAddrzyError]{Ext\_FetchAddr\_Error}#(CapEx_SealViolation)
else if #\hyperref[sailRISCVznot]{not}#(PCC.permit_execute)
then #\hyperref[sailRISCVzExtzyFetchAddrzyError]{Ext\_FetchAddr\_Error}#(CapEx_PermitExecuteViolation)
/* If PCC relocation is enabled, require that PCC.base be as aligned as PC.
This is also enforced when setting PCC in most places. */
else if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() & (pcc_base[0] != bitzero | (pcc_base[1] != bitzero & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#())))
then #\hyperref[sailRISCVzExtzyFetchAddrzyError]{Ext\_FetchAddr\_Error}#(CapEx_UnalignedBase)
else if #\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzinCapBounds]{inCapBounds}#(PCC, pc, 2))
then #\hyperref[sailRISCVzExtzyFetchAddrzyError]{Ext\_FetchAddr\_Error}#(CapEx_LengthViolation)
/* Require that PCC.base be as aligned as PC. This
is also enforced when setting PCC in most places. */
else if pcc_base[0] != bitzero | (pcc_base[1] != bitzero & ~(#\hyperref[sailRISCVzhaveRVC]{haveRVC}#()))
then #\hyperref[sailRISCVzExtzyFetchAddrzyError]{Ext\_FetchAddr\_Error}#(CapEx_UnalignedBase)
else #\hyperref[sailRISCVzExtzyFetchAddrzyOK]{Ext\_FetchAddr\_OK}#(pc)
} else {
/* Perform only the bounds checks on the current granule, i.e. pc. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@
x31 = null_cap;

misa->#\hyperref[sailRISCVzX]{X}#() = 0b1;
mccsr->#\hyperref[sailRISCVzd]{d}#() = 0b1;
mccsr->#\hyperref[sailRISCVze]{e}#() = 0b1;
sccsr->#\hyperref[sailRISCVzd]{d}#() = 0b1;
sccsr->#\hyperref[sailRISCVze]{e}#() = 0b1;
uccsr->#\hyperref[sailRISCVzd]{d}#() = 0b1;
uccsr->#\hyperref[sailRISCVze]{e}#() = 0b1;
mccsr = #\hyperref[sailRISCVzlegalizzezyccsr]{legalize\_ccsr}#(mccsr, #\hyperref[sailRISCVzzzeros]{zeros}#());
sccsr = #\hyperref[sailRISCVzlegalizzezyccsr]{legalize\_ccsr}#(sccsr, #\hyperref[sailRISCVzzzeros]{zeros}#());
uccsr = #\hyperref[sailRISCVzlegalizzezyccsr]{legalize\_ccsr}#(uccsr, #\hyperref[sailRISCVzzzeros]{zeros}#());
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
function #\hyperref[sailRISCVzextzyinit]{ext\_init}# () = {
misa->#\hyperref[sailRISCVzX]{X}#() = 0b1;
mccsr->#\hyperref[sailRISCVzd]{d}#() = 0b1;
mccsr->#\hyperref[sailRISCVze]{e}#() = 0b1;
sccsr->#\hyperref[sailRISCVzd]{d}#() = 0b1;
sccsr->#\hyperref[sailRISCVze]{e}#() = 0b1;
uccsr->#\hyperref[sailRISCVzd]{d}#() = 0b1;
uccsr->#\hyperref[sailRISCVze]{e}#() = 0b1;
mccsr = #\hyperref[sailRISCVzlegalizzezyccsr]{legalize\_ccsr}#(mccsr, #\hyperref[sailRISCVzzzeros]{zeros}#());
sccsr = #\hyperref[sailRISCVzlegalizzezyccsr]{legalize\_ccsr}#(sccsr, #\hyperref[sailRISCVzzzeros]{zeros}#());
uccsr = #\hyperref[sailRISCVzlegalizzezyccsr]{legalize\_ccsr}#(uccsr, #\hyperref[sailRISCVzzzeros]{zeros}#());
}
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
function #\hyperref[sailRISCVzextzyvetozydisablezyC]{ext\_veto\_disable\_C}# () = #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC)[1] == bitone
function #\hyperref[sailRISCVzextzyvetozydisablezyC]{ext\_veto\_disable\_C}# () = {
if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#()
then #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC)[1] == bitone
else false
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
function #\hyperref[sailRISCVzgetzyarchzypc]{get\_arch\_pc}# () =
PC - #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC)
if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() then PC - #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC) else PC
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
let base_cap = #\hyperref[sailRISCVzC]{C}#(base_reg) in
(base_cap, base_cap.address + offset, 0b0 @ base_reg)
else
let ddc = DDC in
(ddc, ddc.address + #\hyperref[sailRISCVzX]{X}#(base_reg) + offset, DDC_IDX);
let (ddc_val, addr) = #\hyperref[sailRISCVzddczyandzyresultingzyaddr]{ddc\_and\_resulting\_addr}#(#\hyperref[sailRISCVzX]{X}#(base_reg) + offset) in
(ddc_val, addr, DDC_IDX);
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
function #\hyperref[sailRISCVzgetzymtvec]{get\_mtvec}#() -> xlenbits =
#\hyperref[sailRISCVzgetCapOffsetBits]{getCapOffsetBits}#(MTCC)
#\hyperref[sailRISCVzcapzytozyintegerzypc]{cap\_to\_integer\_pc}#(MTCC)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
function #\hyperref[sailRISCVzgetzynextzypc]{get\_next\_pc}#() =
nextPC - #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC)
if #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() then nextPC - #\hyperref[sailRISCVzgetCapBaseBits]{getCapBaseBits}#(PCC) else nextPC
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
function #\hyperref[sailRISCVzgetzystvec]{get\_stvec}#() -> xlenbits =
#\hyperref[sailRISCVzgetCapOffsetBits]{getCapOffsetBits}#(STCC)
#\hyperref[sailRISCVzcapzytozyintegerzypc]{cap\_to\_integer\_pc}#(STCC)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
function #\hyperref[sailRISCVzgetzyutvec]{get\_utvec}#() -> xlenbits =
#\hyperref[sailRISCVzgetCapOffsetBits]{getCapOffsetBits}#(UTCC)
#\hyperref[sailRISCVzcapzytozyintegerzypc]{cap\_to\_integer\_pc}#(UTCC)
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
Supervisor => SEPCC,
User => UEPCC
};
#\hyperref[sailRISCVzlegalizzezyxepc]{legalize\_xepc}#(#\hyperref[sailRISCVzgetCapOffsetBits]{getCapOffsetBits}#(cap))
#\hyperref[sailRISCVzlegalizzezyxepc]{legalize\_xepc}#(#\hyperref[sailRISCVzcapzytozyintegerzypc]{cap\_to\_integer\_pc}#(cap))
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function #\hyperref[sailRISCVzhandlezycherizycapzyexception]{handle\_cheri\_cap\_exception}#(capEx, regnum) =
{
#\hyperref[sailRISCVzprint]{print}#("CHERI " ^ #\hyperref[sailRISCVzstringzyofzycapex]{string\_of\_capex}#(capEx) ^ " Reg=" ^ #\hyperref[sailRISCVzBitStr]{BitStr}#(regnum));
if #\hyperref[sailRISCVzgetzyconfigzyprintzyplatform]{get\_config\_print\_platform}#()
then #\hyperref[sailRISCVzprintzyplatform]{print\_platform}#("CHERI " ^ #\hyperref[sailRISCVzstringzyofzycapex]{string\_of\_capex}#(capEx) ^ " Reg=" ^ #\hyperref[sailRISCVzBitStr]{BitStr}#(regnum));
let t : sync_exception = struct {
trap = #\hyperref[sailRISCVzEzyExtension]{E\_Extension}#(EXC_CHERI),
excinfo = #\hyperref[sailRISCVzSome]{Some}#(#\hyperref[sailRISCVzEXTZ]{EXTZ}#(regnum @ #\hyperref[sailRISCVzCapExCode]{CapExCode}#(capEx)) : xlenbits),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function #\hyperref[sailRISCVzhavezycherizyrelocation]{have\_cheri\_relocation}#() = false
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function #\hyperref[sailRISCVzhavezyddczyrelocation]{have\_ddc\_relocation}#() = #\hyperref[sailRISCVzhavezycherizyrelocation]{have\_cheri\_relocation}#()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function #\hyperref[sailRISCVzhavezypcczyrelocation]{have\_pcc\_relocation}#() = #\hyperref[sailRISCVzhavezycherizyrelocation]{have\_cheri\_relocation}#()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function #\hyperref[sailRISCVzhaveZfa]{haveZfa}#() -> bool = true
Original file line number Diff line number Diff line change
@@ -1 +1 @@
function #\hyperref[sailRISCVzhaveZfh]{haveZfh}#() -> bool = true
function #\hyperref[sailRISCVzhaveZfh]{haveZfh}#() -> bool = (misa.#\hyperref[sailRISCVzF]{F}#() == 0b1) & (mstatus.#\hyperref[sailRISCVzFS]{FS}#() != 0b00)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
function #\hyperref[sailRISCVzhaveZicond]{haveZicond}#() -> bool = true
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
mcounteren->#\hyperref[sailRISCVzbits]{bits}#() = #\hyperref[sailRISCVzEXTZ]{EXTZ}#(0b0);

minstret = #\hyperref[sailRISCVzEXTZ]{EXTZ}#(0b0);
minstret_written = false;
minstret_increment = true;

#\hyperref[sailRISCVzinitzypmp]{init\_pmp}#();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
// Technically, WPRI does not need a legalizer, since software is
// assumed to legalize; so we could remove this function.
let v = #\hyperref[sailRISCVzMkzyccsr]{Mk\_ccsr}#(v);
/* For now these bits are not really supported so hardwired to true */
let c = #\hyperref[sailRISCVzupdatezyd]{update\_d}#(c, 0b1);
/* For now the e bit is not really supported so hardwired to true */
let c = #\hyperref[sailRISCVzupdatezye]{update\_e}#(c, 0b1);
/* Read-only feature bits to allow for software to detect CHERI semantics. */
let c = #\hyperref[sailRISCVzupdatezynr]{update\_nr}#(c, #\hyperref[sailRISCVzboolzytozybits]{bool\_to\_bits}#(#\hyperref[sailRISCVznot]{not}#(#\hyperref[sailRISCVzhavezycherizyrelocation]{have\_cheri\_relocation}#())));
let c = #\hyperref[sailRISCVzupdatezytc]{update\_tc}#(c, 0b1);
c
}
Loading

0 comments on commit b95fe95

Please sign in to comment.