FPGA開発日記

カテゴリ別記事インデックス https://msyksphinz.github.io/github_pages , English Version https://fpgadevdiary.hatenadiary.com/

Diplomacyを使ってOCPバスを作成する(13. Xbarの作成を行う2)

Diplomacyを使ったOCPプロトコルの作成、Xbarをもう少し拡張させてみよう。複数のマスターに対して1つのスレーブを接続する。

val pusher1 = LazyModule(new OCPPatternPusher("pat1", Seq(
  new WriteReqPattern   (0, 0x100, 0x2),
  new WriteDataPattern  (0, 0x012345678L),
...
  new ReadExpectPattern (7, 0x10c, 0x2, 0x087654321L)
)))
val pusher2 = LazyModule(new OCPPatternPusher("pat1", Seq(
  new WriteReqPattern   (0, 0x200, 0x2),
  new WriteDataPattern  (0, 0x012345678L),
...
  new ReadExpectPattern (7, 0x20c, 0x2, 0x087654321L)
)))
val ram = LazyModule(new OCPRAM(AddressSet(0x000, 0x3ff)))
val xbar = LazyModule(new OCPXbar())

xbar.node := pusher1.node
xbar.node := pusher2.node
ram.node := xbar.node
f:id:msyksphinz:20200303001647p:plain

つぎに、複数のマスターに対して複数のスレーブを接続するとどうなるか。

  val pusher1 = LazyModule(new OCPPatternPusher("pat1", Seq(
    new WriteReqPattern   (0, 0x100, 0x2),
    new WriteDataPattern  (0, 0x012345678L),
...
    new ReadExpectPattern (7, 0x10c, 0x2, 0x087654321L)
  )))
  val pusher2 = LazyModule(new OCPPatternPusher("pat1", Seq(
    new WriteReqPattern   (0, 0x400, 0x2),
    new WriteDataPattern  (0, 0x012345678L),
...
    new ReadExpectPattern (7, 0x40c, 0x2, 0x087654321L)
  )))
  val ram0 = LazyModule(new OCPRAM(AddressSet(0x000, 0x3ff)))
  val ram1 = LazyModule(new OCPRAM(AddressSet(0x400, 0x3ff)))
  val ram2 = LazyModule(new OCPRAM(AddressSet(0x800, 0x3ff)))
  val xbar = LazyModule(new OCPXbar())

  xbar.node := pusher1.node
  xbar.node := pusher2.node
  ram0.node := xbar.node
  ram1.node := xbar.node
  ram2.node := xbar.node
f:id:msyksphinz:20200303001811p:plain