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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
28 changes: 14 additions & 14 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- develop
- full_example_dev_again

defaults:
run:
Expand All @@ -24,9 +25,6 @@ jobs:
defaults:
run:
shell: bash
env: # Set environment variables for the whole job
PIP_ONLY_BINARY: gdstk
MPLBACKEND: agg
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
Expand All @@ -45,18 +43,20 @@ jobs:
run: |
uv venv venv
source venv/bin/activate
uv pip install -e .[dev]
pip install coverage

#----------------------------------------------
# add matrix specifics and run test suite
#----------------------------------------------
- name: Run tests
# Step 2: Install Nix
- name: Install and Build Nix with script
run: source scripts/install_piel_nix.sh

- name: Run Coverage Tests
run: |
source venv/bin/activate
python -m coverage run -m pytest -rA tests
python -m coverage report -m
echo "total=$(coverage report --format=total)" >> $GITHUB_ENV
echo '### Total coverage: ${{ env.total }}%'
nix develop . --command bash -c "
source scripts/test_coverage.sh &&
total=\$(coverage report | tail -n1 | awk '{print \$NF}' | tr -d '%') &&
echo \"total=\${total}\" >> \$GITHUB_ENV &&
echo \"### Total coverage: \${total}%\"
"

- name: "Create badge"
# if: ${{ github.ref == 'refs/heads/latest' }}
Expand All @@ -68,7 +68,7 @@ jobs:
filename: piel_coverage.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 40
minColorRange: 60
maxColorRange: 95
valColorRange: ${{ env.total }}
style: "for-the-badge"
2 changes: 1 addition & 1 deletion .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
tag_name: v${{ env.VERSION }} # Use the incremented version as the tag name
release_name: ${{ env.VERSION }} # Customize the release name
body: |
Alpha-Release ${{ env.VERSION }}
:tada: :tada: Piel Release Version: ${{ env.VERSION }}.
draft: false
release: true
16 changes: 2 additions & 14 deletions .github/workflows/nix_environment_testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,8 @@ jobs:
uses: actions/checkout@v3

# Step 2: Install Nix
- name: Install Nix with Extra Options
run: |
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix/pr/1145 | sh -s -- install --no-confirm --extra-conf "
extra-substituters = https://openlane.cachix.org
extra-trusted-public-keys = openlane.cachix.org-1:qqdwh+QMNGmZAuyeQJTH9ErW57OWSvdtuwfBKdS254E=
"
# Step 3: Enable Nix Flakes
- name: Enable Nix Flakes
run: |
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
# Step 5: Build the flake with no options
- name: Build Flake
run: nix build .
- name: Install and Build Nix with script
run: source scripts/install_piel_nix.sh

# Step 6: Run flake checks/tests
- name: Run Flake Checks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ jobs:
- name: Run tests
run: |
source venv/bin/activate
python -m pytest -rA tests
python -m pytest -m "not full_env" -rA tests
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,9 @@ RUN_*

*.sif
.idea/

docs/autoapi/
result
docs/examples/02a_large_scale_digital_layout/sequential/*
docs/examples/02a_large_scale_digital_layout/parallel/*
*/runs/*
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ repos:
rev: ad3ff374e97e29ca87c94b5dc7eccdd29adc6296
hooks:
- id: codespell
args: ["-L TE,TE/TM,te,ba,FPR,fpr_spacing,ro,nd,donot,schem,Synopsys,ket,inout,astroid" ]
args: ["-L TE,TE/TM,te,ba,FPR,fpr_spacing,ro,nd,donot,schem,Synopsys,ket,inout,astroid,FOM,Komma" ]
additional_dependencies:
- tomli
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ Status](https://readthedocs.org/projects/piel/badge/?style=for-the-badge)](https
[![MIT](https://img.shields.io/github/license/gdsfactory/gdsfactory?style=for-the-badge)](https://choosealicense.com/licenses/mit/)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)

**`piel < 0.1` is still in active development. The API is starting to stabilize, but use it currently at your own risk.**

Microservices to codesign photonics, electronics, communications,
quantum, and more.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_static/img/examples/09b_optical_delay/noise_signal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# # Digital Design & Simulation Flow

# <div style="padding: 10px; border-radius: 5px;">
# <strong>⚠️ Warning:</strong> This example requires the <code>piel-nix</code> tools environment.
# <a href="https://piel.readthedocs.io/en/latest/sections/environment/index.html" target="_blank">See environment configuration documentation</a>.
# </div>

# There are many tools to perform a digital design flow. I have summarised some of the most relevant ones in the TODO LINK INTEGRATION PAGE. In `piel`, there are a few digital design flow functionalities integrated. However, because the output or interconnections have a set of accepted common measurement, it is possible to use different design flows to integrate with other tools in the flow.
#
# We will explore two popular ones:
Expand Down Expand Up @@ -349,7 +354,6 @@

# ## Sequential Implementation

# +
try:
from openlane.flows import SequentialFlow
from openlane.steps import Yosys, OpenROAD, Magic, Netgen
Expand Down Expand Up @@ -387,4 +391,3 @@ class MyFlow(SequentialFlow):
print(
f"Make sure you are running this from an environment with Openlane nix installed {e}"
)
# -
20 changes: 10 additions & 10 deletions docs/examples/02_digital_design_simulation/truth_table_module.v
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
/* Generated by Amaranth Yosys 0.40 (PyPI ver 0.40.0.0.post99, git sha1 a1bb0255d) */
/* Generated by Yosys 0.38 (git sha1 543faed9c8c, clang++ 17.0.6 -fPIC -Os) */

(* top = 1 *)
(* generator = "Amaranth" *)
module top(phase_map_out, detector_in);
reg \$auto$verilog_backend.cc:2352:dump_module$1 = 0;
(* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:82" *)
reg \$auto$verilog_backend.cc:2334:dump_module$1 = 0;
(* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:82" *)
input [1:0] detector_in;
wire [1:0] detector_in;
(* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:86" *)
(* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:86" *)
output [1:0] phase_map_out;
reg [1:0] phase_map_out;
always @* begin
if (\$auto$verilog_backend.cc:2352:dump_module$1 ) begin end
if (\$auto$verilog_backend.cc:2334:dump_module$1 ) begin end
(* full_case = 32'd1 *)
(* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:112" *)
(* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:112" *)
casez (detector_in)
/* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:115" */
/* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:115" */
2'h0:
phase_map_out = 2'h0;
/* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:115" */
/* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:115" */
2'h1:
phase_map_out = 2'h2;
/* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:115" */
/* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:115" */
2'h2:
phase_map_out = 2'h3;
/* src = "/home/daquintero/phd/piel/piel/tools/amaranth/construct.py:115" */
/* src = "/nix/store/li0p6589931jpjhq811qb8x0gyrv28pp-python3.11-piel-0.1.0/lib/python3.11/site-packages/piel/tools/amaranth/construct.py:115" */
2'h3:
phase_map_out = 2'h3;
endcase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@
# | 15 | 1111 | 1010 |


# ### Verify Our Environment Configuration

# This should run successfully for the remaining example

layout_truth_table_through_openlane

layout_truth_table_through_openlane(
truth_table=truth_table,
parent_directory="sequential",
target_directory_name="sequential_test",
)


# ### Configure Optimised Runs


def sequential_implementations(amount_of_implementations: int):
implementations = list()

Expand Down Expand Up @@ -120,6 +136,19 @@ def parallel_implementations(amount_of_implementations: int):

# Let's time this:

# +
start_sequential = time.time()
sequential_implementations(amount_of_implementations=4)
end_sequential = time.time()

print("Sequential")
print(end_sequential - start_sequential)
# -
# ```
# Sequential
# 106.13592076301575
# ```

# +
start_parallel = time.time()
parallel_implementations(amount_of_implementations=4)
Expand All @@ -133,16 +162,3 @@ def parallel_implementations(amount_of_implementations: int):
# Parallel
# 42.47045159339905
# ```

# +
start_sequential = time.time()
sequential_implementations(amount_of_implementations=4)
end_sequential = time.time()

print("Sequential")
print(end_sequential - start_sequential)
# -
# ```
# Sequential
# 106.13592076301575
# ```

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading