All Downloads are FREE. Search and download functionalities are using the official Maven repository.

spinal.lib.misc.plic.PlicGateway.scala Maven / Gradle / Ivy

There is a newer version: 1.10.2a
Show newest version
package spinal.lib.misc.plic


import spinal.core._
import spinal.lib._
import spinal.lib.bus.misc.BusSlaveFactory


abstract class PlicGateway(val id : Int, priorityWidth : Int) extends Area{
  val ip : Bool
  val priority = UInt(priorityWidth bits)
  def doClaim() : Unit
  def doCompletion() : Unit
  def driveFrom(bus : BusSlaveFactory, offset : Int) : Unit
}

case class PlicGatewayActiveHigh(source : Bool,override val id : Int, priorityWidth : Int) extends PlicGateway(id = id, priorityWidth = priorityWidth){
  val ip = RegInit(False)
  val waitCompletion = RegInit(False)

  when(!waitCompletion){
    ip := source
    waitCompletion := source
  }
  override def doClaim(): Unit = ip := False
  override def doCompletion(): Unit = waitCompletion := False
  override def driveFrom(bus: BusSlaveFactory, offset: Int): Unit = {}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy