Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.1.0 #2

Merged
merged 59 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
dfb3faf
add first version of VivadoManager
Dec 17, 2021
d13f5f0
add vivado logo
Dec 17, 2021
6fe6e3b
add script file to generate exe
Dec 29, 2021
2482e9a
clean up file structure
Dec 29, 2021
88eacdf
move py script to correct folder and use path.pwd instead of sys.arg[0]
Dec 29, 2021
fbbd6a7
delete duplicate files
Dec 29, 2021
f4b488d
add requirements.txt for pyinstaller building
Dec 29, 2021
7f44ceb
pin version to 4.7
Dec 29, 2021
d2791eb
fix git ignore for building
Dec 29, 2021
192b4ab
better string
Dec 29, 2021
37c4170
update py charm settings
Dec 29, 2021
cf48500
add header to file
Dec 29, 2021
df622be
update readme with contributors and licence
Dec 29, 2021
bf2eebf
Added more standard repository files.
Paebbels Dec 30, 2021
ed2c2a9
Added code license.
Paebbels Dec 30, 2021
4866b89
Added setup.py for packaging.
Paebbels Dec 30, 2021
d2da965
Fixed path to IML file.
Paebbels Dec 30, 2021
2ca7b10
Added more GitHub related files.
Paebbels Dec 30, 2021
9ec46f2
Modified file header and description text.
Paebbels Dec 30, 2021
cebd999
doc: update codacy shields
umarcor Jan 16, 2022
d43c5db
ci/Params: override python_version_list, since 3.6 was deprecated in …
umarcor Jan 16, 2022
426c4df
Cleanup
Paebbels Jan 17, 2022
42fa39b
Added placeholders for coverage and static type checking.
Paebbels Jan 17, 2022
7b92685
add README
Jan 17, 2022
eb8f8f4
Merge remote-tracking branch 'github/dev' into dev
Jan 17, 2022
31882ff
Added modified Jinja template for autoapi.
Paebbels Feb 28, 2022
d57c82e
Added more documentation pages.
Paebbels Feb 28, 2022
552692a
Added installation instructions, dependencies and glossary.
Paebbels Feb 28, 2022
1316dcc
Updated conf.py for Sphinx.
Paebbels Feb 28, 2022
6df33a2
Updated GHA workflow.
Paebbels Feb 28, 2022
b50c762
Added dependencies and bumped Sphinx to 4.4.0.
Paebbels Feb 28, 2022
645e27a
Changed indentation to one tab per level.
Paebbels Feb 28, 2022
8bc9155
First set of improvements.
Paebbels Feb 28, 2022
5ced515
Added more documentation pages and updated landing page (incl. ToC). …
Paebbels Feb 28, 2022
a0bd8b4
Added example XPR file for unit testing.
Paebbels Feb 28, 2022
2ceaaef
Added minimalistic unit test.
Paebbels Feb 28, 2022
24eb314
Updated README and documentation landing page.
Paebbels Feb 28, 2022
41378eb
Run with new workflow templates.
Paebbels Feb 28, 2022
4ae3ef4
Create report one level up.
Paebbels Feb 28, 2022
6408645
Bumped dependencies.
Paebbels Feb 28, 2022
1b65c8f
Some restructuring.
Paebbels Feb 28, 2022
43a5758
Added headline for Python class reference.
Paebbels Mar 1, 2022
5c7ade2
Added comment to autoapi template.
Paebbels Mar 1, 2022
76ce6d9
Fixed banner file name.
Paebbels Mar 1, 2022
7fc2596
Added dependabot rule for GH actions. Updated dependency table.
Paebbels Mar 3, 2022
76ec681
Bumped dependencies.
Paebbels May 22, 2022
3c899e9
Fixed Python module index.
Paebbels May 22, 2022
86a67de
Bumped dependencies.
Paebbels Nov 6, 2022
d654dbd
Updated pipeline.
Paebbels Nov 6, 2022
bf3914e
Code cleanup.
Paebbels Dec 18, 2022
6a73a00
Bumped dependencies.
Paebbels Dec 18, 2022
60b25a1
Enabled Windows + Python 3.11 again.
Paebbels Dec 18, 2022
ec34509
Bumped dependencies.
Paebbels Jul 5, 2023
2e477b2
Bumped dependencies.
Paebbels Jul 15, 2023
f186135
Updated pyproject file.
Paebbels Jul 29, 2023
b325a9f
Bumped dependencies.
Paebbels Aug 13, 2023
1fda0fc
Improvements
Paebbels Aug 14, 2023
c3bcfc2
General Updates.
Paebbels Nov 11, 2024
0750fdd
General Updates - part 2.
Paebbels Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ coverage.xml
# setuptools
/build/**/*.*
/dist/**/*.*
!/dist/*.cmd
!/dist/*.ico
/*.egg-info

# Dependencies
Expand Down
1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/pyEDAA.Launcher.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
[![Libraries.io SourceRank](https://img.shields.io/librariesio/sourcerank/pypi/pyEDAA.Launcher?longCache=true&style=flat-square)](https://libraries.io/github/edaa-org/pyEDAA.Launcher/sourcerank)
-->

<p align="center">
<a title="edaa-org.github.io/pyEDAA.Launcher" href="https://edaa-org.github.io/pyEDAA.Launcher"><img height="275px" src="doc/_static/work-in-progress.png"/></a>
</p>

# Main Goals
TBD

# Instalation
TBD

# Contributors

* [Stefan Unrein](https://GitHub.com/stefanunrein) (Maintainer)
* [Patrick Lehmann](https://GitHub.com/Paebbels) (Maintainer)
* [Unai Martinez-Corral](https://GitHub.com/umarcor) (Maintainer)
* [and more...](https://GitHub.com/edaa-org/pyEDAA.Launcher/graphs/contributors)

# License

This Python package (source code) licensed under [Apache License 2.0](LICENSE.md).
The accompanying documentation is licensed under [Creative Commons - Attribution 4.0 (CC-BY 4.0)](doc/Doc-License.rst).

-------------------------
SPDX-License-Identifier: Apache-2.0
1 change: 1 addition & 0 deletions dist/build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyinstaller -F -n VivadoLauncher.exe --icon=vivado_logo.ico --clean --distpath=. --workpath=./temp ../pyEDAA/Launcher/__init__.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, generating an executable with the Python entrypoint is out of the scope.
I would prefer if the README and/or the docs were updated first, in order to explain what is the expected purpose and scope of this repository.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we/ Should we upload a local build executable until the pipe is working for automatic builds?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lately we did updates to the pipeline, so it can run also on macOS, Windows and MinGW64. So we can now start to write the job for it.

1 change: 1 addition & 0 deletions dist/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyinstaller>=4.7
Binary file added dist/vivado_logo.ico
Binary file not shown.
130 changes: 130 additions & 0 deletions pyEDAA/Launcher/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# ==================================================================================================================== #
# _____ ____ _ _ ____ _ _ __ __ _ _ #
# _ __ _ _| ____| _ \ / \ / \ | _ \ _ __ ___ (_) ___ ___| |_| \/ | ___ __| | ___| | #
# | '_ \| | | | _| | | | |/ _ \ / _ \ | |_) | '__/ _ \| |/ _ \/ __| __| |\/| |/ _ \ / _` |/ _ \ | #
# | |_) | |_| | |___| |_| / ___ \ / ___ \ _| __/| | | (_) | | __/ (__| |_| | | | (_) | (_| | __/ | #
# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)_| |_| \___// |\___|\___|\__|_| |_|\___/ \__,_|\___|_| #
# |_| |___/ |__/ #
# ==================================================================================================================== #
# Authors: #
# Stefan Unrein #
# #
# License: #
# ==================================================================================================================== #
# Copyright 2021-2022 Stefan Unrein - Endingen, Germany #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may not use this file except in compliance with the License. #
# You may obtain a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# #
# SPDX-License-Identifier: Apache-2.0 #
# ==================================================================================================================== #
#
"""Start the correct Vivado Version based on xpr Version."""
__author__ = "Stefan Unrein"
__email__ = "[email protected]"
__copyright__ = "2021-2022, Stefan Unrein"
__license__ = "Apache License, Version 2.0"
__version__ = "0.1.0"
__keywords__ = ["launcher", "version selector", "xilinx", "vivado"]

import sys
import subprocess
from pathlib import Path
from textwrap import dedent
import time

sub_path_bat = Path("bin/vivado.bat")
sub_path_vvgl = Path("bin/unwrapped/win64.o/vvgl.exe")
match_line = "<!-- Product Version: Vivado v"


def get_version(file_path):
if not file_path.exists():
raise Exception(f"Vivado project file '{file_path!s}' not found.") from FileNotFoundError(f"File '{file_path!s}' not found.")

project_file = file_path.open()

while True:
line = project_file.readline()
if match_line in line:
break

version = line.split(match_line)[1]
version = version.split(" ")[0]
version = version.split(".")
version_major = version[0]
version_minor = version[1]
project_file.close()
return str(version_major + "." + version_minor)


def get_vivado_versions(install_path):
return [directory.name for directory in install_path.iterdir()]


def help():
script_path = Path(sys.argv[0])
print(f"Run-Path '{script_path}'")
print()
print(dedent("""\
For using this VivadoManager please bind xpr extension to this executable with:
* Put this executable into the Vivado installation folder. E.g: c:\\Xilinx\\Vivado\\
* Change *.xpr association: right-click-> open-width-> VivadoManager.exe
"""))

def main():
install_path = Path.cwd()
if len(sys.argv) > 1:
inputArg1 = sys.argv[1]
file_path = Path(inputArg1)

file_version = get_version(file_path)
vivado_versions = get_vivado_versions(install_path)

for version in vivado_versions:
if file_version == str(version):
exec_path1 = install_path / file_version / sub_path_vvgl
exec_path2 = install_path / file_version / sub_path_bat
a = str(file_path)
cmd = [str(exec_path1), str(exec_path2), a]
subprocess.Popen(cmd, cwd=file_path.parent)#, creationflags=subprocess.DETACHED_PROCESS)
print("")
print(f"Open Project with Vivado Version {file_version}.")
time.sleep(2)
sys.exit(0)
else:
vivadoPath = install_path / file_version
print(f"ERROR: Vivado version {file_version} not available at path '{vivadoPath}'. Please start manually!")
print("")
print("Press any key to exit.")
input()
sys.exit(-1)

else:
help()

vivado_versions = get_vivado_versions(install_path)
print(f"Current path '{install_path}' has following Files/Folders in it:")
for version in vivado_versions:
print(version)

print("")
print("Press any key to exit.")
input()
sys.exit(0)


# entry point
if __name__ == "__main__":
main()