2021-01-04 08:35:45 -05:00
|
|
|
#
|
|
|
|
# This file is part of LiteX-Boards.
|
|
|
|
#
|
|
|
|
# This file is Copyright (c) 2017-2020 Florent Kermarrec <florent@enjoy-digital.fr>
|
2019-06-24 06:38:58 -04:00
|
|
|
# This file is Copyright (c) 2019 Tim 'mithro' Ansell <me@mith.ro>
|
2020-08-23 09:00:17 -04:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
import subprocess
|
|
|
|
import unittest
|
|
|
|
import os
|
|
|
|
|
|
|
|
from migen import *
|
|
|
|
|
|
|
|
from litex.soc.integration.builder import *
|
|
|
|
|
|
|
|
def build_test(socs):
|
|
|
|
errors = 0
|
|
|
|
for soc in socs:
|
|
|
|
os.system("rm -rf build")
|
|
|
|
builder = Builder(soc, output_dir="./build", compile_software=False, compile_gateware=False)
|
|
|
|
builder.build()
|
|
|
|
errors += not os.path.isfile("./build/gateware/top.v")
|
|
|
|
os.system("rm -rf build")
|
|
|
|
return errors
|
|
|
|
|
|
|
|
|
|
|
|
class TestTargets(unittest.TestCase):
|
|
|
|
# Build simple design for all platforms
|
|
|
|
def test_simple(self):
|
|
|
|
platforms = []
|
|
|
|
|
|
|
|
# Xilinx Spartan6
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("linsn_rv901t")
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("minispartan6")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("pipistrello")
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("sp605")
|
2020-11-12 08:26:47 -05:00
|
|
|
platforms.append("pano_logic_g2")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
2020-04-13 09:20:36 -04:00
|
|
|
# Xilinx Spartan7
|
|
|
|
platforms.append("arty_s7")
|
|
|
|
|
2019-06-24 06:38:58 -04:00
|
|
|
# Xilinx Artix7
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("ac701")
|
|
|
|
platforms.append("aller")
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("arty")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("mimas_a7")
|
|
|
|
platforms.append("netv2")
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("nexys4ddr")
|
|
|
|
platforms.append("nexys_video")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("tagus")
|
2021-03-27 04:11:12 -04:00
|
|
|
platforms.append("acorn")
|
2020-05-09 04:17:13 -04:00
|
|
|
platforms.append("marblemini")
|
2020-12-29 07:19:38 -05:00
|
|
|
platforms.append("qmtech_wukong")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
# Xilinx Kintex7
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("genesys2")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("kc705")
|
2021-03-25 09:21:13 -04:00
|
|
|
platforms.append("mercury_kx2")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("nereid")
|
2019-08-26 03:19:32 -04:00
|
|
|
|
2020-02-27 05:17:28 -05:00
|
|
|
# Xilinx Virtex7
|
|
|
|
platforms.append("vc707")
|
|
|
|
|
2019-08-26 03:19:32 -04:00
|
|
|
# Xilinx Kintex Ultrascale
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("kcu105")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
2020-10-06 14:35:03 -04:00
|
|
|
# Xilinx Zynq-7000
|
|
|
|
platforms.append("zedboard")
|
2020-11-12 08:26:47 -05:00
|
|
|
platforms.append("zybo_z7")
|
2020-10-06 14:35:03 -04:00
|
|
|
|
2020-02-27 05:17:28 -05:00
|
|
|
# Xilinx Zynq Ultrascale+
|
|
|
|
platforms.append("zcu104")
|
2020-11-12 08:26:47 -05:00
|
|
|
platforms.append("mercury_xu5")
|
2020-02-27 05:17:28 -05:00
|
|
|
|
|
|
|
# Xilinx Virtex Ultrascale+
|
|
|
|
platforms.append("vcu118")
|
|
|
|
|
2020-10-17 06:28:22 -04:00
|
|
|
# Intel Cyclone3
|
|
|
|
platforms.append("mist")
|
|
|
|
|
2019-06-24 06:38:58 -04:00
|
|
|
# Intel Cyclone4
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("de0nano")
|
|
|
|
platforms.append("de2_115")
|
2020-11-12 08:33:45 -05:00
|
|
|
platforms.append("qmtech_ep4ce15")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
# Intel Cyclone5
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("de1soc")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("de10nano")
|
2021-03-25 09:21:13 -04:00
|
|
|
platforms.append("sockit")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
2020-04-08 02:35:33 -04:00
|
|
|
# Intel Cyclone10
|
2020-04-08 03:59:58 -04:00
|
|
|
platforms.append("c10lprefkit")
|
2020-04-08 02:35:33 -04:00
|
|
|
|
2019-06-24 06:38:58 -04:00
|
|
|
# Intel Max10
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("de10lite")
|
2021-02-25 00:22:56 -05:00
|
|
|
platforms.append("deca")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
# Lattice iCE40
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("fomu_evt")
|
|
|
|
platforms.append("fomu_hacker")
|
|
|
|
platforms.append("fomu_pvt")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("tinyfpga_bx")
|
2020-11-12 08:26:47 -05:00
|
|
|
platforms.append("icebreaker")
|
2021-05-06 23:47:17 -04:00
|
|
|
platforms.append("icesugar")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
# Lattice MachXO2
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("machxo3")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
# Lattice ECP5
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("ecp5_evn")
|
2020-02-03 04:04:02 -05:00
|
|
|
platforms.append("hadbadge")
|
|
|
|
platforms.append("orangecrab")
|
|
|
|
platforms.append("trellisboard")
|
|
|
|
platforms.append("ulx3s")
|
|
|
|
platforms.append("versa_ecp5")
|
2020-02-27 05:17:28 -05:00
|
|
|
platforms.append("colorlight_5a_75b")
|
2020-11-12 08:26:47 -05:00
|
|
|
platforms.append("colorlight_5a_75e")
|
|
|
|
platforms.append("camlink_4k")
|
|
|
|
|
|
|
|
# Lattice Crosslink NX
|
|
|
|
platforms.append("crosslink_nx_evn")
|
|
|
|
platforms.append("crosslink_nx_vip")
|
|
|
|
|
|
|
|
# Gowin
|
|
|
|
platforms.append("tec0117")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
|
|
|
# Microsemi PolarFire
|
2020-02-03 03:44:22 -05:00
|
|
|
platforms.append("avalanche")
|
2019-06-24 06:38:58 -04:00
|
|
|
|
2021-03-30 08:44:15 -04:00
|
|
|
# LPDDR4 Test Board
|
|
|
|
platforms.append("lpddr4_test_board")
|
|
|
|
|
2020-02-03 03:44:22 -05:00
|
|
|
for name in platforms:
|
|
|
|
with self.subTest(platform=name):
|
2019-06-24 06:38:58 -04:00
|
|
|
cmd = """\
|
2020-02-03 03:44:22 -05:00
|
|
|
litex_boards/targets/simple.py litex_boards.platforms.{} \
|
2019-06-24 06:38:58 -04:00
|
|
|
--no-compile-software \
|
|
|
|
--no-compile-gateware \
|
2020-01-13 11:00:01 -05:00
|
|
|
--uart-name="stub" \
|
2020-02-03 03:44:22 -05:00
|
|
|
""".format(name)
|
2019-06-24 06:38:58 -04:00
|
|
|
subprocess.check_call(cmd, shell=True)
|