Skip to content

Commit

Permalink
platforms/crosslink_nx_evn: Fix 5412d0e always disabling uartbone
Browse files Browse the repository at this point in the history
Also fix a warning about register_mem being deprecated, taking
inspiration from platforms/crosslink_nx_vip
  • Loading branch information
josuah committed Aug 9, 2023
1 parent 3903cde commit 3c0b695
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions litex_boards/targets/lattice_crosslink_nx_evn.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from litex.soc.cores.clock import *
from litex.soc.integration.soc_core import *
from litex.soc.integration.soc import SoCRegion
from litex.soc.integration.builder import *
from litex.soc.cores.led import LedChaser

Expand Down Expand Up @@ -68,6 +69,7 @@ class BaseSoC(SoCCore):
}
def __init__(self, sys_clk_freq=75e6, device="LIFCL-40-9BG400C", toolchain="radiant",
with_led_chaser = True,
with_uartbone = False,
**kwargs):
platform = lattice_crosslink_nx_evn.Platform(device=device, toolchain=toolchain)

Expand All @@ -84,7 +86,7 @@ def __init__(self, sys_clk_freq=75e6, device="LIFCL-40-9BG400C", toolchain="radi
# 128KB LRAM (used as SRAM) ---------------------------------------------------------------
size = 128*kB
self.spram = NXLRAM(32, size)
self.register_mem("sram", self.mem_map["sram"], self.spram.bus, size)
self.bus.add_slave("sram", self.spram.bus, SoCRegion(origin=self.mem_map["sram"], size=size))

# Leds -------------------------------------------------------------------------------------
if with_led_chaser:
Expand All @@ -93,8 +95,7 @@ def __init__(self, sys_clk_freq=75e6, device="LIFCL-40-9BG400C", toolchain="radi
sys_clk_freq = sys_clk_freq)

# UARTBone ---------------------------------------------------------------------------------
debug_uart = False
if debug_uart:
if with_uartbone:
self.add_uartbone()


Expand All @@ -109,12 +110,14 @@ def main():
parser.add_target_argument("--programmer", default="radiant", help="Programmer (radiant or ecpprog).")
parser.add_target_argument("--address", default=0x0, help="Flash address to program bitstream at.")
parser.add_target_argument("--prog-target", default="direct", help="Programming Target (direct or flash).")
parser.add_target_argument("--with-uartbone", action="store_true", help="Add UartBone on 1st serial.")
args = parser.parse_args()

soc = BaseSoC(
sys_clk_freq = args.sys_clk_freq,
device = args.device,
toolchain = args.toolchain,
with_uartbone = args.with_uartbone,
**parser.soc_argdict
)
builder = Builder(soc, **parser.builder_argdict)
Expand Down

0 comments on commit 3c0b695

Please sign in to comment.