Skip to content

Commit

Permalink
Add method to get all registered SCRs from ScrFile
Browse files Browse the repository at this point in the history
  • Loading branch information
Job Noorman committed Aug 11, 2021
1 parent 9f78215 commit c39f129
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/riscv/plugins/cheri/ScrFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ class ScrFile(scrStage: Stage)(implicit context: Context) extends Plugin[Pipelin
}
}

override def getRegisteredScrs: Seq[Int] = scrs.keys.toSeq

override def getIo(stage: Stage): ScrIo = {
scrStageIos.getOrElseUpdate(stage, {
val area = stage plug new Area {
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/riscv/plugins/cheri/Services.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ trait ScrService {
*/
def registerScr[T <: Scr](id: Int, offsetCsr: Int, scr: => T): T
def getScr(stage: Stage, id: Int): Scr
def getRegisteredScrs: Seq[Int]
}

trait ExceptionService {
Expand Down

0 comments on commit c39f129

Please sign in to comment.