nMigen platform support


Hey All,

Just this morning Whitequark merged my update in to nmigen. There is now a platform systems that just dropped.

You will need a very recent version of yosys and next-pnr to run it.

The following code , builds, place and routes and uploads a blinky thing to your tinybx

from nmigen import *
from nmigen.vendor.tinyfpga_bx import *

class Blinky(Elaboratable):
    def elaborate(self, platform):
        clk16   = platform.request("clk16", 0)
        user_led = platform.request("user_led", 0)
        counter  = Signal(20)

        m = Module()
        m.domains.sync = ClockDomain()
        m.d.comb += ClockSignal().eq(clk16.i)
        m.d.sync += counter.eq(counter + 1)
        m.d.comb += user_led.o.eq(counter[-1])
        return m

if __name__ == "__main__":
    platform = TinyFPGABXPlatform()
    platform.build(Blinky(), do_program=True)

nmigen is in development at the moment. So more users and feedback will only make it better…


Managed to get a boneless core running on my tiny bx using the new nmigen-boards code

you will need nmigen , nmigen-boards and my Boneless branch.

The source code.

It auto attaches modules into the boneless memory map, and there is not a single line of verilog in sight.

plat.py defines my extended platform and adds 4 blinky and a ftdi I have on pins 19 and 20.