xilinx/kv260: Minor cleanup and add Build/Use instructions (from PR).
This commit is contained in:
parent
8621700916
commit
18e8bec9d4
|
@ -8,17 +8,22 @@ from litex.build.generic_platform import *
|
||||||
from litex.build.xilinx import XilinxPlatform, VivadoProgrammer
|
from litex.build.xilinx import XilinxPlatform, VivadoProgrammer
|
||||||
|
|
||||||
|
|
||||||
|
# IOs ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
_io = [
|
_io = [
|
||||||
|
# Fan.
|
||||||
("fan", 0, Pins("A12"), IOStandard("LVCMOS33")),
|
("fan", 0, Pins("A12"), IOStandard("LVCMOS33")),
|
||||||
# seems like there are no on-board clock sources for PL when PS is not used
|
|
||||||
# so here a clock-capable PMOD connector pin is added as a possible clock input (not tested)
|
# Seems like there are no on-board clock sources for PL when PS is not used so here a
|
||||||
|
# clock-capable PMOD connector pin is added as a possible clock input (not tested).
|
||||||
("pmod_hda16_cc", 0, Pins("B21"), IOStandard("LVCMOS33")),
|
("pmod_hda16_cc", 0, Pins("B21"), IOStandard("LVCMOS33")),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Platform -----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
class Platform(XilinxPlatform):
|
class Platform(XilinxPlatform):
|
||||||
default_clk_name = 'pmod_hda16_cc'
|
default_clk_name = "pmod_hda16_cc"
|
||||||
default_clk_period = 10.0
|
default_clk_period = 1e9/100e6
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
XilinxPlatform.__init__(self, "xck26-sfvc784-2lv-c", _io, toolchain="vivado")
|
XilinxPlatform.__init__(self, "xck26-sfvc784-2lv-c", _io, toolchain="vivado")
|
||||||
|
@ -31,4 +36,4 @@ class Platform(XilinxPlatform):
|
||||||
|
|
||||||
def do_finalize(self, fragment, *args, **kwargs):
|
def do_finalize(self, fragment, *args, **kwargs):
|
||||||
XilinxPlatform.do_finalize(self, fragment, *args, **kwargs)
|
XilinxPlatform.do_finalize(self, fragment, *args, **kwargs)
|
||||||
self.add_period_constraint(self.lookup_request("pmod_hda16_cc", loose=True), self.default_clk_period)
|
self.add_period_constraint(self.lookup_request("pmod_hda16_cc", loose=True), 1e9/100e6)
|
||||||
|
|
|
@ -6,6 +6,16 @@
|
||||||
# Copyright (c) 2022 Ilia Sergachev <ilia@sergachev.ch>
|
# Copyright (c) 2022 Ilia Sergachev <ilia@sergachev.ch>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
|
||||||
|
# Build/Use:
|
||||||
|
# The current support is sufficient to run LiteX BIOS on Cortex-A53 core #0:
|
||||||
|
# ./xilinx_kv260.py --build --load
|
||||||
|
# LiteX BIOS can then be executed on hardware using JTAG with the following xsct script from:
|
||||||
|
# https://github.com/sergachev/litex-template/tree/kv260
|
||||||
|
# make -f Makefile.kv260 load will build everything and run xsct in the end.
|
||||||
|
#
|
||||||
|
# Relies on https://github.com/lucaceresoli/zynqmp-pmufw-builder to create a generic PMU firmware;
|
||||||
|
# first build will take a while because it includes a cross-toolchain.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from migen import *
|
from migen import *
|
||||||
|
@ -24,7 +34,6 @@ from litex.soc.integration.builder import *
|
||||||
|
|
||||||
# CRG ----------------------------------------------------------------------------------------------
|
# CRG ----------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class _CRG(Module):
|
class _CRG(Module):
|
||||||
def __init__(self, platform, sys_clk_freq, use_ps7_clk=False):
|
def __init__(self, platform, sys_clk_freq, use_ps7_clk=False):
|
||||||
self.rst = Signal()
|
self.rst = Signal()
|
||||||
|
@ -45,7 +54,6 @@ class _CRG(Module):
|
||||||
|
|
||||||
# BaseSoC ------------------------------------------------------------------------------------------
|
# BaseSoC ------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class BaseSoC(SoCCore):
|
class BaseSoC(SoCCore):
|
||||||
mem_map = {"csr": 0xA000_0000} # default GP0 address on ZynqMP
|
mem_map = {"csr": 0xA000_0000} # default GP0 address on ZynqMP
|
||||||
|
|
||||||
|
@ -60,7 +68,7 @@ class BaseSoC(SoCCore):
|
||||||
ident = "LiteX SoC on KV260",
|
ident = "LiteX SoC on KV260",
|
||||||
**kwargs)
|
**kwargs)
|
||||||
|
|
||||||
# ZynqMP Integration ---------------------------------------------------------------------
|
# ZynqMP Integration -----------------------------------------------------------------------
|
||||||
if kwargs.get("cpu_type", None) == "zynqmp":
|
if kwargs.get("cpu_type", None) == "zynqmp":
|
||||||
self.cpu.config.update({
|
self.cpu.config.update({
|
||||||
'PSU_MIO_36_DIRECTION': 'out',
|
'PSU_MIO_36_DIRECTION': 'out',
|
||||||
|
@ -202,7 +210,6 @@ class BaseSoC(SoCCore):
|
||||||
|
|
||||||
# Build --------------------------------------------------------------------------------------------
|
# Build --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="LiteX SoC on KV260")
|
parser = argparse.ArgumentParser(description="LiteX SoC on KV260")
|
||||||
parser.add_argument("--build", action="store_true", help="Build bitstream.")
|
parser.add_argument("--build", action="store_true", help="Build bitstream.")
|
||||||
|
|
Loading…
Reference in New Issue