Skip to content

Commit

Permalink
fix: add when condition in assume
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyic00 committed Apr 8, 2024
1 parent 02b21f2 commit 0e180bf
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/scala/nutcore/frontend/Frontend.scala
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ class Frontend_inorder(implicit val p: NutCoreConfig) extends NutCoreModule with
// before this, the inst may not been assemble/splite to 32bit
val tmpInst = ibf.io.out.bits.instr(31, 0)
implicit val checker_xlen = 64


val tmpAssume = !ibf.io.out.valid || (
(hasCSR(tmpInst(31,20)) && (RVZicsr.reg(tmpInst) || RVZicsr.imm(tmpInst)))
||
(RVI.regImm(tmpInst) || RVI.loadStore(tmpInst) || RVI.other(tmpInst))
||
(RVPrivileged.trap_return(tmpInst)),
)
BoringUtils.addSource(tmpAssume, "someassumeid")

when (ibf.io.out.valid){
// Some assume example
// assume(RVI.regImm(tmpInst) || RVI.loadStore(tmpInst))
Expand All @@ -140,15 +149,6 @@ class Frontend_inorder(implicit val p: NutCoreConfig) extends NutCoreModule with
// (RVPriviledged.trap_return(tmpInst))
// // (RVPriviledged.trap_return(tmpInst))
// )

BoringUtils.addSource(
(hasCSR(tmpInst(31,20)) && (RVZicsr.reg(tmpInst) || RVZicsr.imm(tmpInst)))
||
( RVI.regImm(tmpInst) || RVI.loadStore(tmpInst) || RVI.other(tmpInst))
||
(RVPrivileged.trap_return(tmpInst)),
"someassumeid"
)
// assume(
// (hasCSR(tmpInst(31,20)) && (RVZicsr.reg(tmpInst) || RVZicsr.imm(tmpInst)))
// ||
Expand Down

0 comments on commit 0e180bf

Please sign in to comment.