use new lasmibus.Crossbar master API

This commit is contained in:
Sebastien Bourdeauducq 2013-11-23 17:51:41 +01:00
parent 2160636a5e
commit 4c50923cdf
4 changed files with 14 additions and 23 deletions

View File

@ -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):

View File

@ -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

View File

@ -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)

20
top.py
View File

@ -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