Files
eb001/src/main/scala/Switch/TxBuff.scala

53 lines
1.0 KiB
Scala
Raw Normal View History

package Switch
2023-10-12 18:37:12 +08:00
import chisel3._
import chisel3.util._
2023-10-19 18:31:26 +08:00
class Transmit_Req_Bundle extends Bundle{
val txLength = UInt(16.W)
val PerPacketCrcEn = Bool()
val PerPacketPad = Bool()
}
2023-10-19 18:31:26 +08:00
class Transmit_Resp_Bundle extends Bundle{
val RetryCntLatched = UInt(4.W)
val RetryLimit = Bool()
val LateCollLatched = Bool()
val DeferLatched = Bool()
val CarrierSenseLost = Bool()
2023-10-12 18:37:12 +08:00
val isClear = Bool()
2023-10-12 18:37:12 +08:00
}
2023-10-19 18:31:26 +08:00
class Transmit_Bundle extends Bundle{
2023-10-12 18:37:12 +08:00
val data = Decoupled(UInt(32.W))
2023-10-19 18:31:26 +08:00
val req = Decoupled(new Transmit_Req_Bundle)
val resp = Flipped(Decoupled(new Transmit_Resp_Bundle))
2023-10-12 18:37:12 +08:00
}
class TxBuffIO extends Bundle{
2023-10-19 18:31:26 +08:00
val enq = Flipped(new Transmit_Bundle)
val deq = new Transmit_Bundle
2023-10-12 18:37:12 +08:00
}
class TxBuff extends Module{
val io: TxBuffIO = IO(new TxBuffIO)
io.enq.data.ready := true.B
io.enq.ctrl.ready := true.B
2023-10-12 18:37:12 +08:00
io.deq.data.valid := false.B
io.deq.data.bits := 0.U
2023-10-12 18:37:12 +08:00
io.deq.req.valid := false.B
io.deq.req.bits := 0.U.asTypeOf(new Transmit_Deq_Req_Bundle)
2023-10-12 18:37:12 +08:00
io.deq.resp.ready := true.B
2023-10-12 18:37:12 +08:00
}