Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PYTHON := uv run
TO_IPYNB := tools/to_ipynb.py
PY_FILES := $(wildcard example*.py) introduction-to-hardware.py
IPYNB_FILES := $(addprefix ../ipynb-examples/, $(PY_FILES:.py=.ipynb))
IPYNB_FILES := $(addprefix ../www/, $(PY_FILES:.py=.ipynb))

all: $(IPYNB_FILES)

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ uv run python3 -i $SCRIPT_FILE
## Generating Jupyter Notebooks

Each example script is automatically converted to a Jupyter notebook in the
[`ipynb-examples`](https://github.com/UCSBarchlab/PyRTL/tree/development/ipynb-examples)
[`www`](https://github.com/UCSBarchlab/PyRTL/tree/development/www)
directory.
[`examples/tools/to_ipynb.py`](https://github.com/UCSBarchlab/PyRTL/blob/development/examples/tools/to_ipynb.py)
performs these conversions. Do not manually edit the generated Jupyter
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Changelog = "https://github.com/UCSBarchlab/PyRTL/blob/development/CHANGELOG.md"
source = "vcs"

[tool.ruff]
exclude = ["ipynb-examples", "docs/_build", "www/_build"]
exclude = ["*.ipynb", "docs/_build", "www/_build"]

[tool.ruff.lint]
# See https://docs.astral.sh/ruff/rules/
Expand Down Expand Up @@ -118,7 +118,7 @@ ignore = [
dev = [
"furo>=2025.9.25",
"graphviz>=0.21",
"jupyterlite-pyodide-kernel<0.8",
"jupyterlite-pyodide-kernel>=0.8.6",
"jupyterlite-sphinx>=0.9.3",
"pyparsing>=3.2.5",
"pytest>=8.4.2",
Expand Down
1,541 changes: 853 additions & 688 deletions uv.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions www/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
exclude_patterns = ["*.ipynb", "_build", "Thumbs.db", ".DS_Store"]

# Enable links to Python standard library classes (str, list, dict, etc).
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"pyrtl": ("https://pyrtl.readthedocs.io/en/latest/", None),
}

jupyterlite_contents = "../ipynb-examples"
jupyterlite_contents = "*.ipynb"

# -- Options for HTML output -------------------------------------------------

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions www/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ differences between the approaches.
The code below provides everything needed to instantiate, simulate, and
visualize the resulting design.

.. jupyterlite:: ../ipynb-examples/example-gcd.ipynb
.. jupyterlite:: example-gcd.ipynb
:new_tab: True
:new_tab_button_text: Try this example in your browser

Expand All @@ -134,7 +134,7 @@ differences between the approaches.
an output ``y`` which is the resulting sum of products and is valid every
cycle (since the design is naturally fully pipelined).

.. jupyterlite:: ../ipynb-examples/example-fir.ipynb
.. jupyterlite:: example-fir.ipynb
:new_tab: True
:new_tab_button_text: Try this example in your browser

Expand All @@ -154,7 +154,7 @@ differences between the approaches.
like :func:`~functools.reduce`, which is used to chain together multiple
``max_2`` elements into a bigger ``max_n``.

.. jupyterlite:: ../ipynb-examples/example-maxn.ipynb
.. jupyterlite:: example-maxn.ipynb
:new_tab: True
:new_tab_button_text: Try this example in your browser

Expand All @@ -176,7 +176,7 @@ differences between the approaches.
an 8-bit ROM address and returns the value stored in the ROM at that
address.

.. jupyterlite:: ../ipynb-examples/example-mul.ipynb
.. jupyterlite:: example-mul.ipynb
:new_tab: True
:new_tab_button_text: Try this example in your browser

Expand All @@ -197,7 +197,7 @@ differences between the approaches.
final ``full_sum`` is produced by concatenating the wires in ``sum`` with
:func:`~pyrtl.concat_list`.

.. jupyterlite:: ../ipynb-examples/example-adder.ipynb
.. jupyterlite:: example-adder.ipynb
:new_tab: True
:new_tab_button_text: Try this example in your browser

Expand Down Expand Up @@ -255,7 +255,7 @@ introduction to fixed 4-bit adders
<https://www.youtube.com/watch?v=bL3ihMA8_Gs>`_, let's go ahead and build an
`arbitrary` bitwidth adder.

.. jupyterlite:: ../ipynb-examples/example-ripple-carry.ipynb
.. jupyterlite:: example-ripple-carry.ipynb
:new_tab: True
:new_tab_button_text: Try this example in your browser

Expand Down
Loading