From 4c50923cdfe62ab505ab7b6a7fb130c7d6a35828 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 23 Nov 2013 17:51:41 +0100 Subject: [PATCH] use new lasmibus.Crossbar master API --- tb/lasmicon/lasmicon.py | 5 +++-- tb/lasmicon/lasmicon_df.py | 6 +++--- tb/lasmicon/lasmicon_wb.py | 6 +++--- top.py | 20 +++++--------------- 4 files changed, 14 insertions(+), 23 deletions(-) diff --git a/tb/lasmicon/lasmicon.py b/tb/lasmicon/lasmicon.py index 69156938..7ce009a0 100644 --- a/tb/lasmicon/lasmicon.py +++ b/tb/lasmicon/lasmicon.py @@ -27,11 +27,12 @@ def my_generator(n): class TB(Module): def __init__(self): self.submodules.dut = LASMIcon(sdram_phy, sdram_geom, sdram_timing) - self.submodules.xbar = lasmibus.Crossbar([self.dut.lasmic], 6, self.dut.nrowbits) + self.submodules.xbar = lasmibus.Crossbar([self.dut.lasmic], self.dut.nrowbits) self.submodules.logger = DFILogger(self.dut.dfi) + masters = [self.xbar.get_master() for i in range(6)] self.initiators = [Initiator(my_generator(n), master) - for n, master in enumerate(self.xbar.masters)] + for n, master in enumerate(masters)] self.submodules += self.initiators def do_simulation(self, s): diff --git a/tb/lasmicon/lasmicon_df.py b/tb/lasmicon/lasmicon_df.py index c34c8fad..512c9424 100644 --- a/tb/lasmicon/lasmicon_df.py +++ b/tb/lasmicon/lasmicon_df.py @@ -10,10 +10,10 @@ from common import sdram_phy, sdram_geom, sdram_timing, DFILogger class TB(Module): def __init__(self): self.submodules.ctler = LASMIcon(sdram_phy, sdram_geom, sdram_timing) - # FIXME: remove dummy master - self.submodules.xbar = lasmibus.Crossbar([self.ctler.lasmic], 2, self.ctler.nrowbits) + self.submodules.xbar = lasmibus.Crossbar([self.ctler.lasmic], self.ctler.nrowbits) + self.xbar.get_master() # FIXME: remove dummy master self.submodules.logger = DFILogger(self.ctler.dfi) - self.submodules.writer = dma_lasmi.Writer(self.xbar.masters[0]) + self.submodules.writer = dma_lasmi.Writer(self.xbar.get_master()) self.comb += self.writer.address_data.stb.eq(1) pl = self.writer.address_data.payload diff --git a/tb/lasmicon/lasmicon_wb.py b/tb/lasmicon/lasmicon_wb.py index ad2f429b..89b5fa33 100644 --- a/tb/lasmicon/lasmicon_wb.py +++ b/tb/lasmicon/lasmicon_wb.py @@ -26,10 +26,10 @@ def my_generator(): class TB(Module): def __init__(self): self.submodules.ctler = LASMIcon(sdram_phy, sdram_geom, sdram_timing) - # FIXME: remove dummy master - self.submodules.xbar = lasmibus.Crossbar([self.ctler.lasmic], 2, self.ctler.nrowbits) + self.submodules.xbar = lasmibus.Crossbar([self.ctler.lasmic], self.ctler.nrowbits) + self.xbar.get_master() # FIXME: remove dummy master self.submodules.logger = DFILogger(self.ctler.dfi) - self.submodules.bridge = wishbone2lasmi.WB2LASMI(l2_size//4, self.xbar.masters[0]) + self.submodules.bridge = wishbone2lasmi.WB2LASMI(l2_size//4, self.xbar.get_master()) self.submodules.initiator = wishbone.Initiator(my_generator()) self.submodules.conn = wishbone.InterconnectPointToPoint(self.initiator.bus, self.bridge.wishbone) diff --git a/top.py b/top.py index 321b87c8..50a6502b 100644 --- a/top.py +++ b/top.py @@ -105,24 +105,14 @@ class SoC(Module): self.submodules.lasmicon = lasmicon.LASMIcon(self.ddrphy.phy_settings, sdram_geom, sdram_timing) self.submodules.dficon1 = dfi.Interconnect(self.lasmicon.dfi, self.dfii.slave) - n_lasmims = 1 # wishbone bridging + self.submodules.lasmixbar = lasmibus.Crossbar([self.lasmicon.lasmic], self.lasmicon.nrowbits) + lasmim_wb = self.lasmixbar.get_master() if platform_name == "mixxeo": - n_lasmims += 4 # framebuffer (2-channel mixing) + 2 DVI samplers + lasmim_fb0, lasmim_fb1, lasmim_dvi0, lasmim_dvi1 = (self.lasmixbar.get_master() for i in range(4)) if platform_name == "m1": - n_lasmims += 1 # framebuffer (single channel) + lasmim_fb = self.lasmixbar.get_master() if with_memtest: - n_lasmims += 2 # writer + reader - self.submodules.lasmixbar = lasmibus.Crossbar([self.lasmicon.lasmic], n_lasmims, self.lasmicon.nrowbits) - - lasmims = list(self.lasmixbar.masters) - lasmim_wb = lasmims.pop() - if platform_name == "mixxeo": - lasmim_fb0, lasmim_fb1, lasmim_dvi0, lasmim_dvi1 = (lasmims.pop() for i in range(4)) - if platform_name == "m1": - lasmim_fb = lasmims.pop() - if with_memtest: - lasmim_mtw, lasmim_mtr = lasmims.pop(), lasmims.pop() - assert(not lasmims) + lasmim_mtw, lasmim_mtr = self.lasmixbar.get_master(), self.lasmixbar.get_master() # # WISHBONE -- 2.30.2