Merge pull request #10 from sifive/axi-mmio
authorHenry Cook <henry@sifive.com>
Wed, 3 May 2017 18:46:30 +0000 (11:46 -0700)
committerGitHub <noreply@github.com>
Wed, 3 May 2017 18:46:30 +0000 (11:46 -0700)
axi4: switch to new pipelined converters

src/main/scala/devices/xilinxvc707mig/XilinxVC707MIG.scala
src/main/scala/devices/xilinxvc707pciex1/XilinxVC707PCIeX1.scala
src/main/scala/ip/xilinx/vc707axi_to_pcie_x1/vc707axi_to_pcie_x1.scala

index 0ea057f7c179596b7bee31034b56913a112ba9c9..c248f6c5553b05f317aee6bbd285bc81c7719e9f 100644 (file)
@@ -28,16 +28,21 @@ class XilinxVC707MIG(implicit p: Parameters) extends LazyModule with HasXilinxVC
       regionType    = RegionType.UNCACHED,
       executable    = true,
       supportsWrite = TransferSizes(1, 256*8),
-      supportsRead  = TransferSizes(1, 256*8),
-      interleavedId = Some(0))),
+      supportsRead  = TransferSizes(1, 256*8))),
     beatBytes = 8)))
 
-  val xing = LazyModule(new TLAsyncCrossing)
-  val toaxi4 = LazyModule(new TLToAXI4(idBits = 4))
+  val xing    = LazyModule(new TLAsyncCrossing)
+  val toaxi4  = LazyModule(new TLToAXI4(beatBytes = 8))
+  val indexer = LazyModule(new AXI4IdIndexer(idBits = 4))
+  val deint   = LazyModule(new AXI4Deinterleaver(p(coreplex.CacheBlockBytes)))
+  val yank    = LazyModule(new AXI4UserYanker)
 
   xing.node := node
   val monitor = (toaxi4.node := xing.node)
-  axi4 := toaxi4.node
+  axi4 := yank.node
+  yank.node := deint.node
+  deint.node := indexer.node
+  indexer.node := toaxi4.node
 
   lazy val module = new LazyModuleImp(this) {
     val io = new Bundle {
@@ -80,9 +85,7 @@ class XilinxVC707MIG(implicit p: Parameters) extends LazyModule with HasXilinxVC
     xing.module.io.in_reset := reset
     xing.module.io.out_clock := blackbox.io.ui_clk
     xing.module.io.out_reset := blackbox.io.ui_clk_sync_rst
-    toaxi4.module.clock := blackbox.io.ui_clk
-    toaxi4.module.reset := blackbox.io.ui_clk_sync_rst
-    monitor.foreach { lm =>
+    (Seq(toaxi4, indexer, deint, yank) ++ monitor) foreach { lm =>
       lm.module.clock := blackbox.io.ui_clk
       lm.module.reset := blackbox.io.ui_clk_sync_rst
     }
index f657459637f903ed4c86fb0addafba70b0563815..2e376d0fc9d7a0db3cf499ee1586a253a48dbf8b 100644 (file)
@@ -26,9 +26,31 @@ class XilinxVC707PCIeX1(implicit p: Parameters) extends LazyModule {
   val intnode = IntOutputNode()
 
   val axi_to_pcie_x1 = LazyModule(new VC707AXIToPCIeX1)
-  axi_to_pcie_x1.slave   := AXI4Buffer()(TLToAXI4(idBits=4)(slave))
-  axi_to_pcie_x1.control := AXI4Buffer()(AXI4Fragmenter(lite=true, maxInFlight=4)(TLToAXI4(idBits=0)(control)))
-  master := TLWidthWidget(8)(AXI4ToTL()(AXI4Fragmenter()(axi_to_pcie_x1.master)))
+
+  axi_to_pcie_x1.slave :=
+    AXI4Buffer()(
+    AXI4UserYanker()(
+    AXI4Deinterleaver(p(coreplex.CacheBlockBytes))(
+    AXI4IdIndexer(idBits=4)(
+    TLToAXI4(beatBytes=8)(
+    slave)))))
+
+  axi_to_pcie_x1.control :=
+    AXI4Buffer()(
+    AXI4UserYanker()(
+    AXI4Fragmenter()(
+    AXI4IdIndexer(idBits=0)(
+    TLToAXI4(beatBytes=4)(
+    control)))))
+
+  master :=
+    TLWidthWidget(8)(
+    AXI4ToTL()(
+    AXI4UserYanker(capMaxFlight=Some(8))(
+    AXI4Fragmenter()(
+    AXI4IdIndexer(idBits=0)(
+    axi_to_pcie_x1.master)))))
+
   intnode := axi_to_pcie_x1.intnode
 
   lazy val module = new LazyModuleImp(this) {
index b4fad2127210a05e9cf2a78281ea5e55d2a66582..d9ffe8b9e7cd42f5d159095410ee92fd673b9047 100644 (file)
@@ -197,8 +197,7 @@ class VC707AXIToPCIeX1(implicit p:Parameters) extends LazyModule
       resources     = Seq(Resource(device, "ranges")),
       executable    = true,
       supportsWrite = TransferSizes(1, 256),
-      supportsRead  = TransferSizes(1, 256),
-      interleavedId = Some(0))), // the Xilinx IP is friendly
+      supportsRead  = TransferSizes(1, 256))),
     beatBytes = 8)))
 
   val control = AXI4SlaveNode(Seq(AXI4SlavePortParameters(
@@ -206,8 +205,7 @@ class VC707AXIToPCIeX1(implicit p:Parameters) extends LazyModule
       address       = List(AddressSet(0x50000000L, 0x03ffffffL)),
       resources     = device.reg,
       supportsWrite = TransferSizes(1, 4),
-      supportsRead  = TransferSizes(1, 4),
-      interleavedId = Some(0))), // no read interleaving b/c AXI-lite
+      supportsRead  = TransferSizes(1, 4))),
     beatBytes = 4)))
 
   val master = AXI4MasterNode(Seq(AXI4MasterPortParameters(