2020-08-23 09:00:17 -04:00
|
|
|
#
|
|
|
|
# This file is part of LiteX-Boards.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2019 Antony Pavlov <antonynpavlov@gmail.com>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
2019-06-10 11:09:51 -04:00
|
|
|
|
|
|
|
from litex.build.generic_platform import *
|
|
|
|
from litex.build.altera import AlteraPlatform
|
2020-05-05 03:42:34 -04:00
|
|
|
from litex.build.altera.programmer import USBBlaster
|
2019-06-10 11:09:51 -04:00
|
|
|
|
2020-05-05 03:47:55 -04:00
|
|
|
# IOs ----------------------------------------------------------------------------------------------
|
2019-06-10 11:09:51 -04:00
|
|
|
|
|
|
|
_io = [
|
2020-11-03 04:48:41 -05:00
|
|
|
# Clk
|
2019-06-10 11:09:51 -04:00
|
|
|
("clk50", 0, Pins("Y2"), IOStandard("3.3-V LVTTL")),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# Serial
|
2019-06-10 11:09:51 -04:00
|
|
|
("serial", 0,
|
2021-11-03 11:50:40 -04:00
|
|
|
Subsignal("tx", Pins("G9"), IOStandard("3.3-V LVTTL")), # Use built-in Tx RS32 port
|
|
|
|
Subsignal("rx", Pins("G12"), IOStandard("3.3-V LVTTL")) # Use built-in Rx RS32 port
|
2019-06-10 11:09:51 -04:00
|
|
|
),
|
|
|
|
|
2020-11-03 04:48:41 -05:00
|
|
|
# SDR SDRAM
|
2019-06-10 11:09:51 -04:00
|
|
|
("sdram_clock", 0, Pins("AE5"), IOStandard("3.3-V LVTTL")),
|
|
|
|
("sdram", 0,
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("a", Pins(
|
|
|
|
"R6 V8 U8 P1 V5 W8 W7 AA7",
|
|
|
|
"Y5 Y6 R5 AA5 Y7")),
|
|
|
|
Subsignal("ba", Pins("U7 R4")),
|
|
|
|
Subsignal("cs_n", Pins("T4")),
|
|
|
|
Subsignal("cke", Pins("AA6")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("ras_n", Pins("U6")),
|
|
|
|
Subsignal("cas_n", Pins("V7")),
|
2020-04-09 14:02:02 -04:00
|
|
|
Subsignal("we_n", Pins("V6")),
|
|
|
|
Subsignal("dq", Pins(
|
|
|
|
"W3 W2 V4 W1 V3 V2 V1 U3",
|
|
|
|
"Y3 Y4 AB1 AA3 AB2 AC1 AB3 AC2")),
|
2019-06-10 11:09:51 -04:00
|
|
|
Subsignal("dm", Pins("U2 W4")),
|
|
|
|
IOStandard("3.3-V LVTTL")
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
2020-05-05 03:47:55 -04:00
|
|
|
# Platform -----------------------------------------------------------------------------------------
|
2019-06-10 11:09:51 -04:00
|
|
|
|
|
|
|
class Platform(AlteraPlatform):
|
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
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
AlteraPlatform.__init__(self, "EP4CE115F29C7", _io)
|
2020-05-05 03:42:34 -04:00
|
|
|
|
|
|
|
def create_programmer(self):
|
|
|
|
return USBBlaster()
|
2020-05-05 05:45:41 -04:00
|
|
|
|
|
|
|
def do_finalize(self, fragment):
|
|
|
|
AlteraPlatform.do_finalize(self, fragment)
|
|
|
|
self.add_period_constraint(self.lookup_request("clk50", loose=True), 1e9/50e6)
|