Fix Trellis build; ULX3S demo boots to BIOS
authorDavid Shah <dave@ds0.me>
Wed, 31 Oct 2018 12:27:05 +0000 (12:27 +0000)
committerDavid Shah <dave@ds0.me>
Wed, 31 Oct 2018 12:27:05 +0000 (12:27 +0000)
Signed-off-by: David Shah <dave@ds0.me>
litex/boards/platforms/ulx3s.py
litex/boards/targets/ulx3s.py
litex/build/lattice/prjtrellis.py

index e1ccaa31ede70ee678ab2ce922bdbea72e43c5b8..319596d2916b6a475f6a75b185f87f8622035e6d 100644 (file)
@@ -36,6 +36,8 @@ _io = [
         Subsignal("dm", Pins("U19 E20")),
         IOStandard("LVCMOS33")
     ),
+
+    ("wifi_gpio0", 0, Pins("L2"), IOStandard("LVCMOS33")),
 ]
 
 
@@ -44,4 +46,4 @@ class Platform(LatticePlatform):
     default_clk_period = 10
 
     def __init__(self, **kwargs):
-        LatticePlatform.__init__(self, "LFE5U-85F-6BG381C", _io, **kwargs)
+        LatticePlatform.__init__(self, "LFE5U-45F-6BG381C", _io, **kwargs)
index 1e1a300634854ca202edb2b96aca9c73ddff3095..6d8a4e077c47c91f7f2e7cfc6cbe0841a81058d5 100755 (executable)
@@ -46,6 +46,10 @@ class _CRG(Module):
             sdram_ps_clk = new_sdram_ps_clk
         self.comb += self.cd_sys_ps.clk.eq(sdram_ps_clk)
 
+        # Stop ESP32 from resetting FPGA
+        wifi_gpio0 = platform.request("wifi_gpio0")
+        self.comb += wifi_gpio0.eq(1)
+
 
 class BaseSoC(SoCSDRAM):
     def __init__(self, **kwargs):
index e27ae1c6a1c3cce4232a05719415ac43e2a50a72..ec983505f6dafac4ccfabe75186531fd9803cd2c 100644 (file)
@@ -98,10 +98,11 @@ class LatticePrjTrellisToolchain:
             fragment = fragment.get_fragment()
         platform.finalize(fragment)
 
-        top_output = platform.get_verilog(fragment)
+        top_output = platform.get_verilog(fragment, name=build_name)
         named_sc, named_pc = platform.resolve_signals(top_output.ns)
         top_file = build_name + ".v"
         top_output.write(top_file)
+        platform.add_source(top_file)
 
         # generate constraints
         tools.write_to_file(build_name + ".lpf", _build_lpf(named_sc, named_pc))