test: add test_examples

This commit is contained in:
Florent Kermarrec 2018-10-01 11:29:08 +02:00
parent f7f8169883
commit 1bc016cf6c
2 changed files with 22 additions and 1 deletions

View File

@ -50,7 +50,7 @@ class LiteDRAMCrossbar(Module):
data_width=self.controller.data_width,
clock_domain="sys",
id=len(self.masters),
with_bank=self.controller.settigns.with_reordering)
with_bank=self.controller.settings.with_reordering)
self.masters.append(port)
# clock domain crossing

21
test/test_examples.py Normal file
View File

@ -0,0 +1,21 @@
import unittest
import os
def build_config(name):
errors = 0
os.system("rm -rf examples/build")
os.system("cd examples && python3 litedram_gen.py {}_config.py".format(name))
errors += not os.path.isfile("examples/build/gateware/litedram_core.v")
os.system("rm -rf examples/build")
return errors
class TestExamples(unittest.TestCase):
def test_arty(self):
errors = build_config("arty")
self.assertEqual(errors, 0)
def test_genesys2(self):
errors = build_config("genesys2")
self.assertEqual(errors, 0)