From 7aef05960b9d45dcad3e2269a29188c690d83361 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 17 Oct 2021 00:21:32 +0200 Subject: [PATCH 1/4] Added test code for parsed XPR data. --- tests/unit/VivadoProject.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/unit/VivadoProject.py b/tests/unit/VivadoProject.py index 6a2213d7..97508445 100644 --- a/tests/unit/VivadoProject.py +++ b/tests/unit/VivadoProject.py @@ -49,6 +49,24 @@ def test_Parsing(self): xprFile.Parse() project = xprFile.ProjectModel + + self.assertEqual("StopWatch", project.Name) + + designs = [d for d in project.Designs.values()] + self.assertEqual(1, len(designs)) + + design = designs[0] + self.assertEqual("default", design.Name) + self.assertIs(project.DefaultDesign, design) + + expectedFilsesetNames = ( + "default", "src_Encoder", "src_Display", "src_StopWatch", "const_Encoder", "const_Display", "const_StopWatch", + "sim_StopWatch", "utils_1" + ) + filesets = [fs for fs in design.FileSets.keys()] + self.assertEqual(len(expectedFilsesetNames), len(filesets)) + self.assertSequenceEqual(expectedFilsesetNames, filesets) + print(f"Project: {project.Name}") for designName, design in project.Designs.items(): print(f" Design: {designName}") From 4aa904955c87b954bb666a5265ac5e3dadfdebb6 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 17 Oct 2021 04:15:53 +0200 Subject: [PATCH 2/4] Fixed reimport. --- pyEDAA/ProjectModel/Xilinx/Vivado.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyEDAA/ProjectModel/Xilinx/Vivado.py b/pyEDAA/ProjectModel/Xilinx/Vivado.py index e08e2e48..28e69829 100644 --- a/pyEDAA/ProjectModel/Xilinx/Vivado.py +++ b/pyEDAA/ProjectModel/Xilinx/Vivado.py @@ -36,7 +36,7 @@ from pyVHDLModel import VHDLVersion from pydecor import export -from pyEDAA.ProjectModel import ProjectFile, XMLFile, XMLContent, SDCContent, Project, FileSet, File, Attribute +from pyEDAA.ProjectModel import ProjectFile, XMLFile, XMLContent, SDCContent, Project, FileSet, Attribute from pyEDAA.ProjectModel import File as Model_File from pyEDAA.ProjectModel import ConstraintFile as Model_ConstraintFile from pyEDAA.ProjectModel import VerilogSourceFile as Model_VerilogSourceFile From 7d4c6a4912501b716fc99286b087eee5cca53352 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 17 Oct 2021 04:27:30 +0200 Subject: [PATCH 3/4] Bumped version to v0.2.0. --- doc/conf.py | 4 ++-- pyEDAA/ProjectModel/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 3f82ec9d..2179facd 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -36,8 +36,8 @@ def _LatestTagName(): return check_output(["git", "describe", "--abbrev=0", "--tags"], universal_newlines=True).strip() # The full version, including alpha/beta/rc tags -version = "0.1" # The short X.Y version. -release = "0.1.1" # The full version, including alpha/beta/rc tags. +version = "0.2" # The short X.Y version. +release = "0.2.0" # The full version, including alpha/beta/rc tags. try: if _IsUnderGitControl: latestTagName = _LatestTagName()[1:] # remove prefix "v" diff --git a/pyEDAA/ProjectModel/__init__.py b/pyEDAA/ProjectModel/__init__.py index b10550a7..4c36a4a0 100644 --- a/pyEDAA/ProjectModel/__init__.py +++ b/pyEDAA/ProjectModel/__init__.py @@ -39,7 +39,7 @@ from pydecor import export -__version__ = "0.1.1" +__version__ = "0.2.0" @export diff --git a/setup.py b/setup.py index c4e269de..90d6d717 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ gitHubNamespace = "edaa-org" projectName = "ProjectModel" projectNameWithPrefix = "pyEDAA." + projectName -version = "0.1.1" +version = "0.2.0" # Read README for upload to PyPI readmeFile = Path("README.md") From e839cec1c80db39cff41806b4d4f3aee9cbafe77 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sun, 17 Oct 2021 04:32:03 +0200 Subject: [PATCH 4/4] Deactivated prints from unit tests. --- tests/unit/VivadoProject.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/unit/VivadoProject.py b/tests/unit/VivadoProject.py index 97508445..5e69528d 100644 --- a/tests/unit/VivadoProject.py +++ b/tests/unit/VivadoProject.py @@ -43,8 +43,8 @@ class FileSets(TestCase): def test_Parsing(self): xprPath = Path.cwd() / "tests/VivadoProject/StopWatch/project/StopWatch.xpr" - print() - print(f"{xprPath}") + # print() + # print(f"{xprPath}") xprFile = VivadoProjectFile(xprPath) xprFile.Parse() @@ -67,10 +67,10 @@ def test_Parsing(self): self.assertEqual(len(expectedFilsesetNames), len(filesets)) self.assertSequenceEqual(expectedFilsesetNames, filesets) - print(f"Project: {project.Name}") - for designName, design in project.Designs.items(): - print(f" Design: {designName}") - for fileSetName, fileSet in design.FileSets.items(): - print(f" FileSet: {fileSetName}") - for file in fileSet.Files(): - print(f" {file.ResolvedPath}") + # print(f"Project: {project.Name}") + # for designName, design in project.Designs.items(): + # print(f" Design: {designName}") + # for fileSetName, fileSet in design.FileSets.items(): + # print(f" FileSet: {fileSetName}") + # for file in fileSet.Files(): + # print(f" {file.ResolvedPath}")