From caac75c7dbcba68d9f4fb948107cb5d6ff60e05f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 16 Jun 2021 18:04:55 +0200 Subject: [PATCH] trenz_max1000: Review/Cleanup. --- litex_boards/platforms/trenz_max1000.py | 62 +++++++++++++++---------- litex_boards/targets/trenz_max1000.py | 6 +-- 2 files changed, 40 insertions(+), 28 deletions(-) mode change 100644 => 100755 litex_boards/targets/trenz_max1000.py diff --git a/litex_boards/platforms/trenz_max1000.py b/litex_boards/platforms/trenz_max1000.py index ba8a9d6..88280ba 100644 --- a/litex_boards/platforms/trenz_max1000.py +++ b/litex_boards/platforms/trenz_max1000.py @@ -1,8 +1,10 @@ -# This file is Copyright (c) 2019 (year 0 AG) Antti Lukats -# This file is Copyright (c) 2014-2019 Florent Kermarrec -# License: BSD - -# info about the board http://trenz.org/max1000-info +# +# This file is part of LiteX-Boards. +# +# Copyright (c) 2019-2021 Antti Lukats +# SPDX-License-Identifier: BSD-2-Clause +# +# http://trenz.org/max1000-info from litex.build.generic_platform import * from litex.build.altera import AlteraPlatform @@ -11,17 +13,30 @@ from litex.build.altera.programmer import USBBlaster # IOs ---------------------------------------------------------------------------------------------- _io = [ - ("clk12", 0, Pins("H6"), IOStandard("3.3-V LVTTL")), # 12MHz clock - ("user_led", 0, Pins("C5"), IOStandard("3.3-V LVTTL")), # CONF Done, inverted polarity + # Clk / Rst + ("clk12", 0, Pins("H6"), IOStandard("3.3-V LVTTL")), - ("sw", 0, Pins("E6"), IOStandard("3.3-V LVTTL")), - ("sw", 1, Pins("E7"), IOStandard("3.3-V LVTTL")), # nConfig + # Leds + ("user_led", 0, Pins("A8"), IOStandard("3.3-V LVTTL")), + ("user_led", 1, Pins("A9"), IOStandard("3.3-V LVTTL")), + ("user_led", 2, Pins("A11"), IOStandard("3.3-V LVTTL")), + ("user_led", 3, Pins("A10"), IOStandard("3.3-V LVTTL")), + ("user_led", 4, Pins("B10"), IOStandard("3.3-V LVTTL")), + ("user_led", 5, Pins("C9"), IOStandard("3.3-V LVTTL")), + ("user_led", 6, Pins("C10"), IOStandard("3.3-V LVTTL")), + ("user_led", 7, Pins("D8"), IOStandard("3.3-V LVTTL")), + # Buttons + ("user_btn", 0, Pins("E6"), IOStandard("3.3-V LVTTL")), + ("user_btn", 1, Pins("E7"), IOStandard("3.3-V LVTTL")), # nConfig. + + # Serial ("serial", 0, Subsignal("tx", Pins("B4"), IOStandard("3.3-V LVTTL")), Subsignal("rx", Pins("A4"), IOStandard("3.3-V LVTTL")) ), + # SPI Flash ("spiflash4x", 0, Subsignal("cs_n", Pins("B3")), Subsignal("clk", Pins("A3")), @@ -38,26 +53,25 @@ _io = [ IOStandard("3.3-V LVTTL"), ), + # SDRAM ("sdram_clock", 0, Pins("M9"), IOStandard("3.3-V LVTTL")), ("sdram", 0, - Subsignal("a", Pins("K6 M5 N5 J8 N10 M11 N9 L10 M13 N8 N4 M10")), #0, 1, ... - Subsignal("ba", Pins("N6 K8")), - Subsignal("cs_n", Pins("M4")), - Subsignal("cke", Pins("M8")), + Subsignal("a", Pins( + "K6 M5 N5 J8 N10 M11 N9 L10", + "M13 N8 N4 M10")), + Subsignal("ba", Pins("N6 K8")), + Subsignal("cs_n", Pins("M4")), + Subsignal("cke", Pins("M8")), Subsignal("ras_n", Pins("M7")), Subsignal("cas_n", Pins("N7")), - Subsignal("we_n", Pins("K7")), - Subsignal("dq", Pins("D11 G10 F10 F9 E10 D9 G9 F8 F13 E12 E13 D12 C12 B12 B13 A12")), + Subsignal("we_n", Pins("K7")), + Subsignal("dq", Pins( + "D11 G10 F10 F9 E10 D9 G9 F8", + "F13 E12 E13 D12 C12 B12 B13 A12")), Subsignal("dm", Pins("E9 F12")), IOStandard("3.3-V LVTTL") ), - - ("gpio_leds", 0, - Pins("A8 A9 A11 A10 B10 C9 C10 D8"), - IOStandard("3.3-V LVTTL") - ), - # all IO not connected to peripherals mapped to MFIO # <- LEDS -> <- PMOD -> <- D0..D14, D11R, D12R -> <- AIN0..AIN7 -> JE [C O I S i1 i2]sw ("bbio", 0, Pins("A8 A9 A11 A10 B10 C9 C10 D8 M3 L3 M2 M1 N3 N2 K2 K1 H8 K10 H5 H4 J1 J2 L12 J12 J13 K11 K12 J10 H10 H13 G12 B11 G13 E1 C2 C1 D1 E3 F1 E4 B1 E5 J6 J7 K5 L5 J5 L4 E6"), @@ -69,11 +83,9 @@ _io = [ # Platform ----------------------------------------------------------------------------------------- class Platform(AlteraPlatform): - default_clk_name = "clk12" - default_clk_period = 83 + default_clk_name = "clk12" + default_clk_period = 1e9/12e6 -# def __init__(self, device): -# AlteraPlatform.__init__(self, device, _io) def __init__(self): AlteraPlatform.__init__(self, "10M08SAU169C8G", _io) self.add_platform_command("set_global_assignment -name FAMILY \"MAX 10\"") diff --git a/litex_boards/targets/trenz_max1000.py b/litex_boards/targets/trenz_max1000.py old mode 100644 new mode 100755 index 082d25a..7ab2545 --- a/litex_boards/targets/trenz_max1000.py +++ b/litex_boards/targets/trenz_max1000.py @@ -3,7 +3,7 @@ # # This file is part of LiteX-Boards. # -# Copyright (c) 2021 Jakub Cabal +# Copyright (c) 2019-2021 Antti Lukats # SPDX-License-Identifier: BSD-2-Clause import os @@ -11,7 +11,7 @@ import argparse from migen import * -from litex_boards.platforms import trenz_max1000 +from litex_boards.platforms import max1000 from litex.soc.cores.clock import CycloneVPLL from litex.soc.integration.soc_core import * @@ -48,7 +48,7 @@ class _CRG(Module): class BaseSoC(SoCCore): def __init__(self, sys_clk_freq=int(50e6), **kwargs): - platform = trenz_max1000.Platform() + platform = max1000.Platform() kwargs["integrated_rom_size"] = 0x6000 kwargs["integrated_sram_size"] = 0x1000