Skip to content

Commit 2e0c08a

Browse files
2024.2 Release -
- Add US+ GTY IBERT example design and notebook - Enhanced logging to handle additional logging domains - Move example designs and jupyter notebooks out of pypi wheel to reduce file size - Switch device program log to use hw_server service - Add slr_index option to get_plm_log - Add --force-reset option to device program - Fix problems found in device program done and progress callbacks - Add optional delay prior to create_session device scan to help initialization on slower systems - Fix comparison case mismatch when jtag arch_name is missing from jtag node properties - Upgrade required antlr dependency to 4.13.1 from 4.10 - Add missing YK Scan documentation - Miscellaneous FAQ and documentation updates
1 parent 9b0ef5b commit 2e0c08a

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

RELEASE_NOTES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ChipScoPy Release Notes
22

33
## 2024.2 - Release November 22, 2024
4+
- 2024.2.173228394
5+
- Fix chipscopy-examples directory not found with jupyter notebooks
46

57
- 2024.2.1732227392
68
- Add US+ GTY IBERT example design and notebook

chipscopy/__init__.py

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,42 @@
3838

3939

4040
def get_examples_dir_or_die():
41-
# Examples are provided for Jupyter and Commandline flows. This returns the
42-
# examples directory in both flows.
43-
44-
# First priority - locally installed examples with the default directory name
45-
# Case for most users that installed examples.
46-
examples_dir = os.path.join(os.getcwd(), "chipscopy-examples")
47-
if os.path.isdir(examples_dir):
48-
return examples_dir
49-
50-
# If we get here, try to find examples in the site-libraries area or wherever
51-
# we are running chipscopy from. This makes life easier for developers working
52-
# who want to use examples directly from the chipscopy/examples directory.
53-
if os.path.isfile(inspect.getfile(inspect.currentframe())):
54-
# __file__ does not work in jupyter flows
55-
examples_dir = os.path.realpath(
56-
os.path.dirname(inspect.getfile(inspect.currentframe())) + "/examples"
57-
)
41+
# Check if the environment variable is set
42+
env_examples_dir = os.getenv("CHIPSCOPY_EXAMPLES")
43+
if env_examples_dir and os.path.isdir(env_examples_dir):
44+
return env_examples_dir
45+
46+
# Start from the current working directory
47+
current_dir = os.getcwd()
48+
49+
while True:
50+
# Check for 'chipscopy-examples' directory
51+
examples_dir = os.path.join(current_dir, "chipscopy-examples")
52+
if os.path.isdir(examples_dir):
53+
return examples_dir
54+
55+
# Check for 'examples' directory
56+
examples_dir = os.path.join(current_dir, "examples")
5857
if os.path.isdir(examples_dir):
5958
return examples_dir
6059

61-
# Jupyter doesn't work with currentframe above, just try examples as a last resort
62-
examples_dir = os.path.join(os.getcwd(), "examples")
63-
if os.path.isdir(examples_dir):
64-
return examples_dir
60+
# Move up one directory level
61+
parent_dir = os.path.dirname(current_dir)
62+
63+
# If the parent directory is the same as the current directory, we've reached the root
64+
if parent_dir == current_dir:
65+
break
66+
67+
current_dir = parent_dir
6568

66-
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), examples_dir)
69+
# If we reach here, neither directory was found
70+
error_message = (
71+
"Could not find the 'examples' or 'chipscopy-examples' directory.\n"
72+
"Please ensure that one of these directories exists in the current or parent directories.\n"
73+
"Alternatively, you can set the 'CHIPSCOPY_EXAMPLES' environment variable to the path of the examples directory.\n"
74+
"Example: export CHIPSCOPY_EXAMPLES=/path/to/your/examples"
75+
)
76+
raise FileNotFoundError(errno.ENOENT, error_message)
6777

6878

6979
def _get_design_files_in_dir(p: Path) -> namedtuple:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
[tool.poetry]
1717
name = "chipscopy"
18-
version = "2024.2.1732227392"
18+
version = "2024.2.1732283942"
1919
description = "Open-source project from Xilinx® that enables high-level control of Versal debug IP running in hardware"
2020
authors = ["Xilinx ChipScope Team"]
2121
maintainers = ["Xilinx ChipScope Team"]

0 commit comments

Comments
 (0)