Skip to content

Commit

Permalink
Push mosc generator
Browse files Browse the repository at this point in the history
  • Loading branch information
francislaus committed Mar 28, 2024
1 parent 0873b58 commit 9fc7ec5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/QuickCheckVEngine/Templates/GenTransExec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ genBSC_Excps_Torture tmpReg = random $ do
]


genMOSC_Torture :: ArchDesc -> Integer -> Template
genBSC_Excps_Torture arch tmpReg = random $ do

This comment has been minimized.

Copy link
@elliotb-lowrisc

elliotb-lowrisc Apr 11, 2024

Contributor

@francislaus should this name be genMOSC_Torture to match the type signature on the line above?

imm <- bits 12
longImm <- bits 20
src1 <- sbcRegs
src2 <- sbcRegs
src3 <- sbcRegs
srcSCr <- bits 5
dest <- sbcRegs
let rm = 0x7 -- dynamic rounding mode
let fenceOp1 = 17
let fenceOp2 = 18
return $ uniform [ instUniform $ rv64_i_mem src1 src2 dest imm
, instUniform $ rv32_i_mem src1 src2 dest imm fenceOp1 fenceOp2
]


genTSCTorture :: Template
genTSCTorture = random $ do
imm_bits <- bits 10
Expand Down Expand Up @@ -202,6 +219,14 @@ prepareBSCExcpsGen = random $ do
]


prepareMOSCGen :: Template
prepareMOSCGen = random $ do
let reg0 = 10
let reg1 = 11
return $ mconcat [ li64 reg0 0x80002000
, li64 reg1 0x80004000
]

setUpPageTable :: Template
setUpPageTable = random $ do
let a0 = 10
Expand Down

0 comments on commit 9fc7ec5

Please sign in to comment.