Skip to content

Commit

Permalink
Connect the UART interruption to the CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Jul 31, 2017
1 parent 568c7d1 commit 0c9a39d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/scala/vexriscv/demo/Murax.scala
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ case class Murax(config : MuraxConfig) extends Component{
)

//Checkout plugins used to instanciate the CPU to connect them to the SoC
val timerInterrupt = Bool
val timerInterrupt = False
val externalInterrupt = False
var iBus : IBusSimpleBus = null
var dBus : DBusSimpleBus = null
var debugBus : DebugExtensionBus = null
Expand All @@ -202,7 +203,7 @@ case class Murax(config : MuraxConfig) extends Component{
}
}
case plugin : CsrPlugin => {
plugin.externalInterrupt := False
plugin.externalInterrupt := externalInterrupt
plugin.timerInterrupt := timerInterrupt
}
case plugin : DebugPlugin => plugin.debugClockDomain{
Expand Down Expand Up @@ -315,7 +316,7 @@ case class Murax(config : MuraxConfig) extends Component{
}

val specification = List[(SimpleBus,SizeMapping)](
ram.bus -> (0x00000000l, onChipRamSize kB),
ram.bus -> (0x00000000l, onChipRamSize kB),
apbBridge.simpleBus -> (0xF0000000l, 1 MB)
)

Expand Down Expand Up @@ -365,8 +366,10 @@ case class Murax(config : MuraxConfig) extends Component{
txFifoDepth = 16,
rxFifoDepth = 16
)

val uartCtrl = Apb3UartCtrl(uartCtrlConfig)
uartCtrl.io.uart <> io.uart
externalInterrupt setWhen(uartCtrl.io.interrupt)

val timer = new Area{
val apb = Apb3(
Expand Down Expand Up @@ -394,7 +397,7 @@ case class Murax(config : MuraxConfig) extends Component{
val interruptCtrlBridge = interruptCtrl.driveFrom(busCtrl,0x10)
interruptCtrl.io.inputs(0) := timerA.io.full
interruptCtrl.io.inputs(1) := timerB.io.full
timerInterrupt := interruptCtrl.io.pendings.orR
timerInterrupt setWhen(interruptCtrl.io.pendings.orR)
}


Expand Down

0 comments on commit 0c9a39d

Please sign in to comment.