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
つぎに、複数のマスターに対して複数のスレーブを接続するとどうなるか。
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