Improve template path handling. Add synthesis tests
This commit is contained in:
36
test/lib/synth_testcase.py
Normal file
36
test/lib/synth_testcase.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from typing import List
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
from .base_testcase import BaseTestCase
|
||||
|
||||
@pytest.mark.skipif(os.environ.get("SKIP_SYNTH_TESTS", False), reason="user skipped")
|
||||
class SynthTestCase(BaseTestCase):
|
||||
|
||||
def _get_synth_files(self) -> List[str]:
|
||||
files = []
|
||||
files.extend(self.cpuif.get_synth_files())
|
||||
files.append("regblock_pkg.sv")
|
||||
files.append("regblock.sv")
|
||||
|
||||
return files
|
||||
|
||||
|
||||
def run_synth(self) -> None:
|
||||
script = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"synthesis/vivado/run.tcl"
|
||||
)
|
||||
|
||||
cmd = [
|
||||
"vivado", "-nojournal", "-notrace",
|
||||
"-mode", "batch",
|
||||
"-log", "out.log",
|
||||
"-source", script,
|
||||
"-tclargs"
|
||||
]
|
||||
cmd.extend(self._get_synth_files())
|
||||
|
||||
subprocess.run(cmd, check=True)
|
||||
Reference in New Issue
Block a user