2020-08-23 09:00:17 -04:00
|
|
|
#
|
|
|
|
# This file is part of LiteX-Boards.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2018-2019 Florent Kermarrec <florent@enjoy-digital.fr>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
2019-06-10 11:09:51 -04:00
|
|
|
|
|
|
|
from litex.build.generic_platform import *
|
|
|
|
from litex.build.microsemi import MicrosemiPlatform
|
|
|
|
|
|
|
|
# IOs ----------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
_io = [
|
2020-11-03 04:48:41 -05:00
|
|
|
# Clk / Rst
|
2019-06-10 11:09:51 -04:00
|
|
|
("clk50", 0, Pins("R1"), IOStandard("LVCMOS25")),
|
|
|
|
("clk50", 1, Pins("J3"), IOStandard("LVCMOS25")),
|
|
|
|
("rst_n", 0, Pins("F5"), IOStandard("LVCMOS33")),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# Leds
|
2019-06-10 11:09:51 -04:00
|
|
|
("user_led", 0, Pins("D6"), IOStandard("LVCMOS33")),
|
|
|
|
("user_led", 1, Pins("D7"), IOStandard("LVCMOS33")),
|
|
|
|
("user_led", 2, Pins("D8"), IOStandard("LVCMOS33")),
|
|
|
|
("user_led", 3, Pins("D9"), IOStandard("LVCMOS33")),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# Buttons
|
2019-06-10 11:09:51 -04:00
|
|
|
("user_btn", 0, Pins("E13"), IOStandard("LVCMOS33")),
|
|
|
|
("user_btn", 1, Pins("E14"), IOStandard("LVCMOS33")),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# Serial
|
2019-06-10 11:09:51 -04:00
|
|
|
("serial", 0,
|
|
|
|
Subsignal("tx", Pins("F17")),
|
|
|
|
Subsignal("rx", Pins("F16")),
|
|
|
|
IOStandard("LVCMOS33")
|
|
|
|
),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# SPIFlash
|
2019-06-10 11:09:51 -04:00
|
|
|
("spiflash", 0,
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("clk", Pins("J1")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("cs_n", Pins("H1")),
|
|
|
|
Subsignal("mosi", Pins("F2")),
|
|
|
|
Subsignal("miso", Pins("F1")),
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("wp", Pins("M7")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("hold", Pins("M8")),
|
|
|
|
IOStandard("LVCMOS25"),
|
|
|
|
),
|
2020-11-03 04:48:41 -05:00
|
|
|
("spiflash4x", 0,
|
|
|
|
Subsignal("clk", Pins("J1")),
|
|
|
|
Subsignal("cs_n", Pins("H1")),
|
|
|
|
Subsignal("dq", Pins("F2 F1 M7 M8")),
|
|
|
|
IOStandard("LVCMOS25")
|
|
|
|
),
|
2019-06-10 11:09:51 -04:00
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# DDR3 SDRAM
|
2019-06-10 11:09:51 -04:00
|
|
|
("ddram", 0,
|
|
|
|
Subsignal("a", Pins(
|
2020-04-09 14:02:02 -04:00
|
|
|
"U5 U4 V4 W3 V5 W4 Y3 AA3",
|
2019-06-10 11:09:51 -04:00
|
|
|
"Y4 Y5 AA2 AB2 V6 W6 AB3"),
|
|
|
|
IOStandard("SSTL15II")),
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("ba", Pins("V7 Y6 U7"), IOStandard("SSTL15II")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("ras_n", Pins("AA6"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("cas_n", Pins("AA5"), IOStandard("SSTL15II")),
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("we_n", Pins("AB5"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("cs_n", Pins("W7"), IOStandard("SSTL15II")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("dm", Pins("Y9 R15"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("dq", Pins(
|
2020-04-09 14:02:02 -04:00
|
|
|
"T7 T8 U8 U9 R10 V9 V10 W9",
|
2019-06-10 11:09:51 -04:00
|
|
|
"V14 U14 R12 T11 U15 T13 U13 T15"),
|
|
|
|
IOStandard("SSTL15II")),
|
|
|
|
Subsignal("dqs_p", Pins("T10 R13"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("dqs_n", Pins("U10 T12"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("clk_p", Pins("V2"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("clk_n", Pins("W2"), IOStandard("SSTL15II")),
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("cke", Pins("W8"), IOStandard("SSTL15II")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("odt", Pins("AA7"), IOStandard("SSTL15II")),
|
|
|
|
Subsignal("reset_n", Pins("AB7"), IOStandard("SSTL15II")),
|
|
|
|
),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# Ethernet
|
2019-06-10 11:09:51 -04:00
|
|
|
("eth_clocks", 0,
|
|
|
|
Subsignal("tx", Pins("J8")),
|
|
|
|
Subsignal("rx", Pins("K3")),
|
|
|
|
IOStandard("LVCMOS25")
|
|
|
|
),
|
|
|
|
("eth", 0,
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("rst_n", Pins("L8"), IOStandard("LVCMOS33")),
|
|
|
|
Subsignal("int_n", Pins("J4")),
|
|
|
|
Subsignal("mdio", Pins("H2")),
|
|
|
|
Subsignal("mdc", Pins("J2")),
|
|
|
|
Subsignal("rx_ctl", Pins("K5")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("rx_data", Pins("J9 K1 K6 K4")),
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("tx_ctl", Pins("L5")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("tx_data", Pins("K8 L1 L2 L3")),
|
|
|
|
IOStandard("LVCMOS25")
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
|
|
|
# Platform -----------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Platform(MicrosemiPlatform):
|
2020-04-09 14:02:02 -04:00
|
|
|
default_clk_name = "clk50"
|
2019-08-07 02:47:08 -04:00
|
|
|
default_clk_period = 1e9/50e6
|
2019-06-10 11:09:51 -04:00
|
|
|
|
2022-02-14 05:35:08 -05:00
|
|
|
def __init__(self, toolchain="libero_soc_polarfire"):
|
|
|
|
MicrosemiPlatform.__init__(self, "MPF300TS_ES-FCG484-1", _io, toolchain=toolchain)
|
2020-05-05 05:45:41 -04:00
|
|
|
|
|
|
|
def do_finalize(self, fragment):
|
|
|
|
MicrosemiPlatform.do_finalize(self, fragment)
|
|
|
|
self.add_period_constraint(self.lookup_request("clk50", 0, loose=True), 1e9/50e6)
|
|
|
|
self.add_period_constraint(self.lookup_request("clk50", 1, loose=True), 1e9/50e6)
|