Exemple #1
0
    def __init__(self, sdrphy, dfi, sdram_geom, sdram_timing, pads, sdram_clk):

        self.clk_freq = 80000000
        phy_settings = sdrphy.settings
        rdphase = phy_settings.rdphase
        self.submodules.slave = Minicon(phy_settings, sdram_geom, sdram_timing)

        self.submodules.tap = wishbone.Tap(self.slave.bus)
        self.submodules.dc = dc = wishbone.DownConverter(32, phy_settings.nphases*flen(dfi.phases[rdphase].rddata))
        self.submodules.master = wishbone.Initiator(self.genxfers(), bus=dc.wishbone_i)
        self.submodules.intercon = wishbone.InterconnectPointToPoint(dc.wishbone_o, self.slave.bus)

        self.submodules.sdrphy = self.sdrphy = sdrphy
        self.dfi = dfi
        self.pads = pads

        self.specials += Instance("mt48lc4m16a2",
                                  io_Dq=pads.dq,
                                  i_Addr=pads.a,
                                  i_Ba=pads.ba,
                                  i_Clk=ClockSignal(),
                                  i_Cke=pads.cke,
                                  i_Cs_n=pads.cs_n,
                                  i_Ras_n=pads.ras_n,
                                  i_Cas_n=pads.cas_n,
                                  i_We_n=pads.we_n,
                                  i_Dqm=pads.dm
        )
Exemple #2
0
 def __init__(self):
     self.submodules.master = wishbone.Initiator(self.gen_reads())
     self.pads = Record([("cs_n", 1), ("clk", 1), ("dq", 4)])
     self.submodules.slave = SpiFlash(self.pads)
     self.submodules.tap = wishbone.Tap(self.slave.bus)
     self.submodules.intercon = wishbone.InterconnectPointToPoint(
             self.master.bus, self.slave.bus)
     self.cycle = 0
Exemple #3
0
 def __init__(self):
     self.submodules.ctler = LASMIcon(sdram_phy, sdram_geom, sdram_timing)
     self.submodules.xbar = lasmibus.Crossbar([self.ctler.lasmic],
                                              self.ctler.nrowbits)
     self.submodules.logger = DFILogger(self.ctler.dfi)
     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)
 def __init__(self):
     # The "wishbone.Initiator" library component runs our generator
     # and manipulates the bus signals accordingly.
     self.submodules.master = wishbone.Initiator(my_generator())
     # The "wishbone.Target" library component examines the bus signals
     # and calls into our model object.
     self.submodules.slave = wishbone.Target(MyModelWB())
     # The "wishbone.Tap" library component examines the bus at the slave port
     # and displays the transactions on the console (<TRead...>/<TWrite...>).
     self.submodules.tap = wishbone.Tap(self.slave.bus)
     # Connect the master to the slave.
     self.submodules.intercon = wishbone.InterconnectPointToPoint(
         self.master.bus, self.slave.bus)
Exemple #5
0
def main():
    # The "wishbone.Initiator" library component runs our generator
    # and manipulates the bus signals accordingly.
    master = wishbone.Initiator(my_generator())
    # Our slave.
    slave = MyPeripheral()
    # The "wishbone.Tap" library component examines the bus at the slave port
    # and displays the transactions on the console (<TRead...>/<TWrite...>).
    tap = wishbone.Tap(slave.bus)
    # Connect the master to the slave.
    intercon = wishbone.InterconnectPointToPoint(master.bus, slave.bus)

    # A small extra simulation function to terminate the process when
    # the initiator is done (i.e. our generator is exhausted).
    def end_simulation(s):
        s.interrupt = master.done

    fragment = autofragment.from_local() + Fragment(sim=[end_simulation])
    sim = Simulator(fragment, Runner())
    sim.run()
Exemple #6
0
    def do_finalize(self):
        UnifiedIOObject.do_finalize(self)
        callers = []
        self.busname_to_caller_id = {}
        if self.get_dataflow():
            callers.append(TokenExchanger(self.dispatch_g(0), self))
        for k, v in self.get_buses().items():
            caller_id = len(callers)
            self.busname_to_caller_id[k] = caller_id
            g = self.dispatch_g(caller_id)
            if isinstance(v, wishbone.Interface):
                caller = wishbone.Initiator(g, v)
            elif isinstance(v, Memory):
                caller = memory.Initiator(g, v)
            callers.append(caller)
        self.submodules += callers

        self.dispatch_state = _WAIT_COMPLETE
        self.dispatch_caller = 0
        self.pending_transaction = None
Exemple #7
0
 def __init__(self):
     pads = _TestPads()
     self.submodules.dut = AD9xxx(pads, drive_fud=True)
     self.submodules.initiator = wishbone.Initiator(_test_gen())
     self.submodules.interconnect = wishbone.InterconnectPointToPoint(
         self.initiator.bus, self.dut.bus)