Skip to content

Commit

Permalink
fix #27 tselect is now always implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Sep 23, 2024
1 parent ffeaa79 commit e2a1b1f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/scala/vexiiriscv/misc/PrivilegedPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,12 @@ class PrivilegedPlugin(val p : PrivilegedParam, val hartIds : Seq[Int]) extends
}
val stoptime = out(RegNext(debugMode && dcsr.stoptime) init(False))

val noTrigger = (p.debugTriggers == 0) generate new Area {
cap.allowCsr(CSR.TSELECT)
}
val trigger = (p.debugTriggers > 0) generate new Area {
val tselect = new Area {
val index = Reg(UInt(log2Up(p.debugTriggers) bits))
val index = Reg(UInt(log2Up(p.debugTriggers) bits)) init(0)
api.readWrite(index, CSR.TSELECT)

val outOfRange = if (isPow2(p.debugTriggers)) False else index < p.debugTriggers
Expand Down

2 comments on commit e2a1b1f

@jerryz123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Dolu1990 does this change actually add the new CSRs? If (debugTriggers == 0), does this add a CSR init'd to 0?

@Dolu1990
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, VexiiRiscv doesn't implement any of the debug spec (and doesn't implement tselect)
To get tselect, there is a few more things to enable (--debug-privileged --debug-jtag-tap), but isn't enabled in the tilelink soc you are using to generate Vexii. i will take a look tomorrow to get things up ^^

Please sign in to comment.