Skip to content

Commit

Permalink
Additions needed by Xilinx Vivado project files
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Oct 17, 2021
2 parents cd2edd1 + e839cec commit 9e2c78b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 14 deletions.
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pyEDAA/ProjectModel/Xilinx/Vivado.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyEDAA/ProjectModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from pydecor import export


__version__ = "0.1.1"
__version__ = "0.2.0"


@export
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
36 changes: 27 additions & 9 deletions tests/unit/VivadoProject.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,34 @@
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()

project = xprFile.ProjectModel
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}")

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}")
# for fileSetName, fileSet in design.FileSets.items():
# print(f" FileSet: {fileSetName}")
# for file in fileSet.Files():
# print(f" {file.ResolvedPath}")

0 comments on commit 9e2c78b

Please sign in to comment.