中断节点化
This commit is contained in:
@@ -6,6 +6,7 @@ import chisel3.util._
|
|||||||
import org.chipsalliance.cde.config._
|
import org.chipsalliance.cde.config._
|
||||||
import freechips.rocketchip.diplomacy._
|
import freechips.rocketchip.diplomacy._
|
||||||
import freechips.rocketchip.tilelink._
|
import freechips.rocketchip.tilelink._
|
||||||
|
import freechips.rocketchip.interrupts._
|
||||||
|
|
||||||
class Mac(implicit p: Parameters) extends LazyModule with HasMacParameters{
|
class Mac(implicit p: Parameters) extends LazyModule with HasMacParameters{
|
||||||
|
|
||||||
@@ -32,10 +33,17 @@ class Mac(implicit p: Parameters) extends LazyModule with HasMacParameters{
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// DTS
|
||||||
|
val dtsdevice = new SimpleDevice("mac",Seq("mac_0"))
|
||||||
|
|
||||||
|
val int_node = IntSourceNode(IntSourcePortSimple(num = 1, resources = dtsdevice.int))
|
||||||
|
|
||||||
|
|
||||||
lazy val module = new MacImp(this)
|
lazy val module = new MacImp(this)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -58,7 +66,7 @@ class MacIO extends Bundle with MDIO{
|
|||||||
val mcoll_pad_i = Input(Bool())
|
val mcoll_pad_i = Input(Bool())
|
||||||
val mcrs_pad_i = Input(Bool())
|
val mcrs_pad_i = Input(Bool())
|
||||||
|
|
||||||
val int_o = Output(Bool())
|
// val int_o = Output(Bool())
|
||||||
}
|
}
|
||||||
|
|
||||||
class MacImp(outer: Mac)(implicit p: Parameters) extends LazyModuleImp(outer) with HasMacParameters{
|
class MacImp(outer: Mac)(implicit p: Parameters) extends LazyModuleImp(outer) with HasMacParameters{
|
||||||
@@ -68,6 +76,7 @@ class MacImp(outer: Mac)(implicit p: Parameters) extends LazyModuleImp(outer) wi
|
|||||||
val ( slv_bus, slv_edge ) = outer.tlMasterNode.in.head
|
val ( slv_bus, slv_edge ) = outer.tlMasterNode.in.head
|
||||||
val ( mst_bus, mst_edge ) = outer.tlClientNode.out.head
|
val ( mst_bus, mst_edge ) = outer.tlClientNode.out.head
|
||||||
|
|
||||||
|
val (int, _) = outer.int_node.out(0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -377,7 +386,8 @@ r_FIAD := ethReg.io.r_FIAD
|
|||||||
r_CtrlData := ethReg.io.r_CtrlData
|
r_CtrlData := ethReg.io.r_CtrlData
|
||||||
r_MAC := ethReg.io.r_MAC
|
r_MAC := ethReg.io.r_MAC
|
||||||
r_TxBDNum := ethReg.io.r_TxBDNum
|
r_TxBDNum := ethReg.io.r_TxBDNum
|
||||||
io.int_o := ethReg.io.int_o
|
// io.int_o := ethReg.io.int_o
|
||||||
|
int(0) := ethReg.io.int_o
|
||||||
r_TxPauseTV := ethReg.io.r_TxPauseTV
|
r_TxPauseTV := ethReg.io.r_TxPauseTV
|
||||||
r_TxPauseRq := ethReg.io.r_TxPauseRq
|
r_TxPauseRq := ethReg.io.r_TxPauseRq
|
||||||
|
|
||||||
@@ -813,3 +823,8 @@ val rxethmac = Module(new MacRx)
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import chisel3.util._
|
|||||||
import org.chipsalliance.cde.config._
|
import org.chipsalliance.cde.config._
|
||||||
import freechips.rocketchip.diplomacy._
|
import freechips.rocketchip.diplomacy._
|
||||||
import freechips.rocketchip.tilelink._
|
import freechips.rocketchip.tilelink._
|
||||||
|
import freechips.rocketchip.interrupts._
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class MacTest(implicit p: Parameters) extends Mac{
|
||||||
|
|
||||||
class MacTest(implicit p: Parameters) extends LazyModule with HasMacParameters{
|
|
||||||
|
|
||||||
val mac = LazyModule( new Mac )
|
|
||||||
|
|
||||||
|
|
||||||
val tlRAM = TLRAM(
|
val tlRAM = TLRAM(
|
||||||
@@ -25,7 +25,7 @@ class MacTest(implicit p: Parameters) extends LazyModule with HasMacParameters{
|
|||||||
devName = None,
|
devName = None,
|
||||||
)
|
)
|
||||||
|
|
||||||
tlRAM := mac.tlClientNode
|
tlRAM := tlClientNode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -37,15 +37,20 @@ class MacTest(implicit p: Parameters) extends LazyModule with HasMacParameters{
|
|||||||
))
|
))
|
||||||
)))
|
)))
|
||||||
|
|
||||||
mac.tlMasterNode := tlClientIONode
|
tlMasterNode := tlClientIONode
|
||||||
|
|
||||||
|
|
||||||
|
val intSinkNode = IntSinkNode(IntSinkPortSimple())
|
||||||
|
intSinkNode := int_node
|
||||||
|
|
||||||
val tlSlv = InModuleBody {
|
val tlSlv = InModuleBody {
|
||||||
tlClientIONode.makeIOs()
|
tlClientIONode.makeIOs()
|
||||||
}
|
}
|
||||||
|
|
||||||
lazy val module = new LazyModuleImp(this) {
|
val int = InModuleBody {
|
||||||
val io = IO(new MacIO with MDIO)
|
intSinkNode.makeIOs()
|
||||||
|
|
||||||
io <> mac.module.io
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user