-
Notifications
You must be signed in to change notification settings - Fork 0
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
v0.1.0 #2
Changes from 13 commits
dfb3faf
d13f5f0
6fe6e3b
2482e9a
88eacdf
fbbd6a7
f4b488d
7f44ceb
d2791eb
192b4ab
37c4170
cf48500
df622be
bf2eebf
ed2c2a9
4866b89
d2da965
2ca7b10
9ec46f2
cebd999
d43c5db
426c4df
42fa39b
7b92685
eb8f8f4
31882ff
d57c82e
552692a
1316dcc
6df33a2
b50c762
645e27a
8bc9155
5ced515
a0bd8b4
2ceaaef
24eb314
41378eb
4ae3ef4
6408645
1b65c8f
43a5758
5c7ade2
76ce6d9
7fc2596
76ec681
3c899e9
86a67de
d654dbd
bf3914e
6a73a00
60b25a1
ec34509
2e477b2
f186135
b325a9f
1fda0fc
c3bcfc2
0750fdd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pyinstaller>=4.7 |
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() | ||
|
||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.