You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to this domain (open hardware and nmigen).
I am trying to do an example blinky in nmigen and try to make it build the bitstream file for FPGA.
Here is my current example code.
import os
import subprocess
from typing import List
from nmigen import Elaboratable, Module, Signal
from nmigen.build import *
from nmigen.build.run import LocalBuildProducts
from nmigen.cli import main_parser, main_runner
from nmigen.vendor.lattice_ecp5 import *
class Blinker(Elaboratable):
def __init__(self):
pass
def elaborate(self, platform: Platform) -> Module:
led = platform.request("led", 0)
timer = Signal(20)
m = Module()
m.d.sync += timer.eq(timer + 1)
m.d.comb += led.o.eq(timer[-1])
return m
def ports(self) -> List[Signal]:
return []
class Board(LatticeECP5Platform):
device = "LFE5U-25F"
package = "BG256"
speed = "6"
default_clk = "clk1"
default_rst = "rst"
resources = [
Resource("clk1", 0, Pins("P6",dir="i"), Clock(25e6),
Attrs(IO_TYPE = "LVCMOS33")),
Resource("rst", 0, Pins("L14",dir="i"),
Attrs(IO_TYPE = "LVCMOS33")),
Resource("led", 0, Pins("B11",dir="o"),
Attrs(IO_TYPE = "LVCMOS33")),
]
connectors = []
def toolchain_program(self, products, name):
iceprog = os.environ.get("ICEPROG", "iceprog")
with products.extract("{}.bin".format(name)) as bitstream_filename:
subprocess.check_call([iceprog, bitstream_filename])
if __name__ == "__main__":
Board().build(Blinker(), do_program= False)
But not sure if it works.. my board is not here yet.
Can you support a board file for nmigen? It would be nice!
Or maybe a blinky example? That would be wonderful!
Thank you
The text was updated successfully, but these errors were encountered:
I am new to this domain (open hardware and nmigen).
I am trying to do an example blinky in nmigen and try to make it build the bitstream file for FPGA.
Here is my current example code.
But not sure if it works.. my board is not here yet.
Can you support a board file for nmigen? It would be nice!
Or maybe a blinky example? That would be wonderful!
Thank you
The text was updated successfully, but these errors were encountered: