2020-08-23 09:52:08 -04:00
|
|
|
#
|
|
|
|
# This file is part of LiteDRAM.
|
|
|
|
#
|
|
|
|
# Copyright (c) 2018-2019 Florent Kermarrec <florent@enjoy-digital.fr>
|
|
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
2019-06-23 17:56:50 -04:00
|
|
|
|
2018-10-01 05:29:08 -04:00
|
|
|
import unittest
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
|
|
def build_config(name):
|
|
|
|
errors = 0
|
2022-08-18 04:42:25 -04:00
|
|
|
os.system(f"rm -rf examples/{name}")
|
|
|
|
os.system(f"mkdir -p examples/{name} && cd examples/{name} && python3 ../../litedram/gen.py ../{name}.yml")
|
|
|
|
errors += not os.path.isfile(f"examples/{name}/build/gateware/litedram_core.v")
|
|
|
|
os.system(f"rm -rf examples/{name}")
|
2018-10-01 05:29:08 -04:00
|
|
|
return errors
|
|
|
|
|
|
|
|
|
|
|
|
class TestExamples(unittest.TestCase):
|
2021-07-02 03:01:31 -04:00
|
|
|
def test_ulx3s(self):
|
|
|
|
errors = build_config("ulx3s")
|
|
|
|
self.assertEqual(errors, 0)
|
|
|
|
|
2018-10-01 05:29:08 -04:00
|
|
|
def test_arty(self):
|
|
|
|
errors = build_config("arty")
|
|
|
|
self.assertEqual(errors, 0)
|
|
|
|
|
2019-03-15 15:10:50 -04:00
|
|
|
def test_nexys4ddr(self):
|
|
|
|
errors = build_config("nexys4ddr")
|
|
|
|
self.assertEqual(errors, 0)
|
|
|
|
|
2018-10-01 05:29:08 -04:00
|
|
|
def test_genesys2(self):
|
|
|
|
errors = build_config("genesys2")
|
|
|
|
self.assertEqual(errors, 0)
|