xilinx/kv260: Minor cleanup and add Build/Use instructions (from PR).

This commit is contained in:
Florent Kermarrec 2022-02-07 08:12:43 +01:00
parent 8621700916
commit 18e8bec9d4
2 changed files with 21 additions and 9 deletions

View File

@ -8,17 +8,22 @@ from litex.build.generic_platform import *
from litex.build.xilinx import XilinxPlatform, VivadoProgrammer
# IOs ----------------------------------------------------------------------------------------------
_io = [
# Fan.
("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")),
]
# Platform -----------------------------------------------------------------------------------------
class Platform(XilinxPlatform):
default_clk_name = 'pmod_hda16_cc'
default_clk_period = 10.0
default_clk_name = "pmod_hda16_cc"
default_clk_period = 1e9/100e6
def __init__(self):
XilinxPlatform.__init__(self, "xck26-sfvc784-2lv-c", _io, toolchain="vivado")
@ -31,4 +36,4 @@ class Platform(XilinxPlatform):
def 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)

View File

@ -6,6 +6,16 @@
# Copyright (c) 2022 Ilia Sergachev <ilia@sergachev.ch>
# 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
from migen import *
@ -24,7 +34,6 @@ from litex.soc.integration.builder import *
# CRG ----------------------------------------------------------------------------------------------
class _CRG(Module):
def __init__(self, platform, sys_clk_freq, use_ps7_clk=False):
self.rst = Signal()
@ -45,7 +54,6 @@ class _CRG(Module):
# BaseSoC ------------------------------------------------------------------------------------------
class BaseSoC(SoCCore):
mem_map = {"csr": 0xA000_0000} # default GP0 address on ZynqMP
@ -60,7 +68,7 @@ class BaseSoC(SoCCore):
ident = "LiteX SoC on KV260",
**kwargs)
# ZynqMP Integration ---------------------------------------------------------------------
# ZynqMP Integration -----------------------------------------------------------------------
if kwargs.get("cpu_type", None) == "zynqmp":
self.cpu.config.update({
'PSU_MIO_36_DIRECTION': 'out',
@ -202,7 +210,6 @@ class BaseSoC(SoCCore):
# Build --------------------------------------------------------------------------------------------
def main():
parser = argparse.ArgumentParser(description="LiteX SoC on KV260")
parser.add_argument("--build", action="store_true", help="Build bitstream.")