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

spinal.lib.bus.bmb.BmbWriteRetainer.scala Maven / Gradle / Ivy

There is a newer version: 1.10.2a
Show newest version
package spinal.lib.bus.bmb

import spinal.core._
import spinal.lib._


case class BmbWriteRetainer(p: BmbParameter, queueSize : Int) extends Component{
  val io = new Bundle {
    val input = slave(Bmb(p))
    val output = master(Bmb(BmbSourceRemover.getOutputParameter(p)))
  }

  val cmdBuffer = io.input.cmd.queue(queueSize).stage()
  val tocken = CounterUpDown(
    stateCount = queueSize,
    incWhen = io.input.cmd.lastFire,
    decWhen = cmdBuffer.lastFire
  )

  val halt = cmdBuffer.first && tocken === 0
  io.output.cmd << cmdBuffer.haltWhen(halt)

  io.input.rsp << io.output.rsp
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy