Пример #1
0
    def toolchain_erase(self):
        """ Erases the LUNA board's flash. """

        from apollo import ApolloDebugger
        from apollo.flash import ensure_flash_gateware_loaded

        # Create our connection to the debug module.
        debugger = ApolloDebugger()
        ensure_flash_gateware_loaded(debugger, platform=self.__class__())

        with debugger.flash as flash:
            flash.erase()

        debugger.soft_reset()
Пример #2
0
    def toolchain_flash(self, products, name="top"):
        """ Programs the LUNA board's flash via its sideband connection. """

        from apollo import ApolloDebugger
        from apollo.flash import ensure_flash_gateware_loaded

        # Create our connection to the debug module.
        debugger = ApolloDebugger()
        ensure_flash_gateware_loaded(debugger, platform=self.__class__())

        # Grab our generated bitstream, and upload it to the .
        bitstream =  products.get("{}.bit".format(name))
        with debugger.flash as flash:
            flash.program(bitstream)

        debugger.soft_reset()
Пример #3
0
    def toolchain_program(self, products, name):
        """ Programs the relevant LUNA board via its sideband connection. """

        from apollo import ApolloDebugger
        from apollo.ecp5 import ECP5_JTAGProgrammer

        # Create our connection to the debug module.
        debugger = ApolloDebugger()

        # Grab our generated bitstream, and upload it to the FPGA.
        bitstream =  products.get("{}.bit".format(name))
        with debugger.jtag as jtag:
            programmer = ECP5_JTAGProgrammer(jtag)
            programmer.configure(bitstream)
Пример #4
0
    def toolchain_program(self, products, name):
        """ Programs the relevant Daisho board via its sideband connection. """

        from apollo import ApolloDebugger
        from apollo.intel import IntelJTAGProgrammer

        # If the user has opted to use their own programming cable, use it instead.
        if os.environ.get("PROGRAM_WITH_QUARTUS", False):
            self._toolchain_program_quartus(products, name)
            return

        # Create our connection to the debug module.
        debugger = ApolloDebugger()

        # Grab our generated bitstream, and upload it to the FPGA.
        bitstream =  products.get("{}.rbf".format(name))
        with debugger.jtag as jtag:
            programmer = IntelJTAGProgrammer(jtag)
            programmer.configure(bitstream)
Пример #5
0
        # Create a simple SFR that will trigger an ILA capture when written,
        # and which will display our sample status read.
        spi_registers.add_sfr(REGISTER_ILA,
                              read=self.ila.complete,
                              write_strobe=self.ila.trigger)

        # Attach the LEDs and User I/O to the MSBs of our counter.
        leds = [platform.request("led", i, dir="o") for i in range(0, 6)]
        m.d.comb += Cat(leds).eq(self.counter[-7:-1])

        # Return our elaborated module.
        return m


if __name__ == "__main__":
    example = top_level_cli(ILASharedBusExample)

    # Create a debug and ILA connection.
    debugger = ApolloDebugger()
    ila = ApolloILAFrontend(debugger, ila=example.ila, use_inverted_cs=True)

    # Trigger an ILA capture.
    debugger.spi.register_write(REGISTER_ILA, 0)

    # Wait for the capture to be complete.
    while not debugger.spi.register_read(REGISTER_ILA):
        time.sleep(0.001)

    # Finally, read back the capture and display it on-screen.
    ila.interactive_display()