Skip to content

Commit 03daf02

Browse files
authored
Merge pull request #7 from thomasnormal/fix-pages-deploy
Fix broken Pages deploy: self-host Surfer artifact, refresh MOX wasm
2 parents 943855c + 6d074c7 commit 03daf02

83 files changed

Lines changed: 1192 additions & 947 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# Optional CIRCT runtime overrides.
1+
# Optional MOX runtime overrides.
22
# Tool artifacts:
3-
VITE_CIRCT_VERILOG_JS_URL=/circt/circt-verilog.js
4-
VITE_CIRCT_VERILOG_WASM_URL=/circt/circt-verilog.wasm
5-
VITE_CIRCT_SIM_JS_URL=/circt/circt-sim.js
6-
VITE_CIRCT_SIM_WASM_URL=/circt/circt-sim.wasm
7-
VITE_CIRCT_BMC_JS_URL=/circt/circt-bmc.js
8-
VITE_CIRCT_BMC_WASM_URL=/circt/circt-bmc.wasm
9-
# VPI-capable circt-sim (for cocotb lessons — built with Asyncify + VPI exports):
10-
VITE_CIRCT_SIM_VPI_JS_URL=/circt/circt-sim-vpi.js
11-
VITE_CIRCT_SIM_VPI_WASM_URL=/circt/circt-sim-vpi.wasm
3+
VITE_MOX_VERILOG_JS_URL=/mox/mox-verilog.js
4+
VITE_MOX_VERILOG_WASM_URL=/mox/mox-verilog.wasm
5+
VITE_MOX_SIM_JS_URL=/mox/mox-sim.js
6+
VITE_MOX_SIM_WASM_URL=/mox/mox-sim.wasm
7+
VITE_MOX_BMC_JS_URL=/mox/mox-bmc.js
8+
VITE_MOX_BMC_WASM_URL=/mox/mox-bmc.wasm
9+
# VPI-capable mox-sim (for cocotb lessons — built with Asyncify + VPI exports):
10+
VITE_MOX_SIM_VPI_JS_URL=/mox/mox-sim-vpi.js
11+
VITE_MOX_SIM_VPI_WASM_URL=/mox/mox-sim-vpi.wasm
1212
# Pyodide URL (used by cocotb runner). Default is local: /pyodide/pyodide.js
1313
# Optional CDN override:
1414
# VITE_PYODIDE_URL=https://cdn.jsdelivr.net/pyodide/v0.27.0/full/pyodide.js
1515
#
1616
# Optional args for each stage (JSON array preferred):
17-
# VITE_CIRCT_VERILOG_ARGS=[\"--ir-llhd\",\"--timescale\",\"1ns/1ns\",\"--single-unit\"]
18-
# VITE_CIRCT_SIM_ARGS=[\"--resource-guard=false\"]
19-
# VITE_CIRCT_BMC_ARGS=[\"--resource-guard=false\",\"-b\",\"3\",\"--module\",\"{top}\",\"--emit-smtlib\",\"-o\",\"-\",\"{input}\"]
17+
# VITE_MOX_VERILOG_ARGS=[\"--ir-llhd\",\"--timescale\",\"1ns/1ns\",\"--single-unit\"]
18+
# VITE_MOX_SIM_ARGS=[\"--resource-guard=false\"]
19+
# VITE_MOX_BMC_ARGS=[\"--resource-guard=false\",\"-b\",\"3\",\"--module\",\"{top}\",\"--emit-smtlib\",\"-o\",\"-\",\"{input}\"]

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,24 @@ jobs:
3636
- name: Setup Pyodide assets
3737
run: scripts/setup-pyodide.sh
3838

39-
- name: Download CIRCT wasm artifacts
40-
# WASM artifacts are built locally and published to the circt-wasm release
41-
# via: npm run build:circt && npm run publish:circt
39+
- name: Download MOX wasm artifacts
40+
# WASM artifacts are built locally and published to the mox-wasm release
41+
# via: npm run build:mox && npm run publish:mox
4242
# CI just downloads the pre-built artifacts — no Emscripten build here.
4343
run: |
44-
mkdir -p static/circt
45-
if gh release download circt-wasm \
44+
mkdir -p static/mox
45+
if gh release download mox-wasm \
4646
--repo "$GITHUB_REPOSITORY" \
47-
-D static/circt \
47+
-D static/mox \
4848
--clobber 2>/dev/null; then
49-
if [ -f static/circt/uvm-core.tar.gz ]; then
50-
rm -rf static/circt/uvm-core
51-
tar -xzf static/circt/uvm-core.tar.gz -C static/circt
49+
if [ -f static/mox/uvm-core.tar.gz ]; then
50+
rm -rf static/mox/uvm-core
51+
tar -xzf static/mox/uvm-core.tar.gz -C static/mox
5252
fi
53-
echo "CIRCT artifacts downloaded"
54-
ls -lh static/circt/*.js
53+
echo "MOX artifacts downloaded"
54+
ls -lh static/mox/*.js
5555
else
56-
echo "::warning::No circt-wasm release found — WASM smoke tests will be skipped"
56+
echo "::warning::No mox-wasm release found — WASM smoke tests will be skipped"
5757
fi
5858
env:
5959
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,48 @@ jobs:
3939
- name: Download Pyodide assets
4040
run: scripts/setup-pyodide.sh
4141

42-
- name: Download CIRCT wasm artifacts
43-
# Artifacts are stored in a GitHub Release named 'circt-wasm'.
42+
- name: Download MOX wasm artifacts
43+
# Artifacts are stored in a GitHub Release named 'mox-wasm'.
4444
# To publish them locally, run:
45-
# gh release create circt-wasm --title "CIRCT WASM artifacts" \
46-
# static/circt/circt-{bmc,sim,sim-vpi,verilog,lec}.{js,wasm} \
45+
# gh release create mox-wasm --title "MOX WASM artifacts" \
46+
# static/mox/mox-{bmc,sim,sim-vpi,verilog,lec}.{js,wasm} \
4747
# /tmp/uvm-core.tar.gz
4848
# where /tmp/uvm-core.tar.gz is created by:
49-
# tar -czf /tmp/uvm-core.tar.gz -C static/circt uvm-core
49+
# tar -czf /tmp/uvm-core.tar.gz -C static/mox uvm-core
5050
# The build proceeds without them; simulation features will be
5151
# unavailable but the rest of the tutorial still works.
5252
run: |
53-
mkdir -p static/circt
53+
mkdir -p static/mox
5454
5555
unpack_uvm_bundle_if_present() {
56-
if [ -f static/circt/uvm-core.tar.gz ]; then
57-
rm -rf static/circt/uvm-core
58-
tar -xzf static/circt/uvm-core.tar.gz -C static/circt
56+
# Match uvm-core.tar.gz as well as older mis-named bundles such as
57+
# uvm-core.XXXXXX.tar.gz (a past mktemp-template bug), newest first.
58+
local bundle
59+
bundle="$(ls -t static/mox/uvm-core*.tar.gz 2>/dev/null | head -1)"
60+
if [ -n "$bundle" ]; then
61+
rm -rf static/mox/uvm-core
62+
tar -xzf "$bundle" -C static/mox
5963
fi
6064
}
6165
6266
have_uvm_bundle() {
63-
[ -f static/circt/uvm-core/uvm-manifest.json ]
67+
[ -f static/mox/uvm-core/uvm-manifest.json ]
6468
}
6569
66-
if gh release download circt-wasm \
70+
if gh release download mox-wasm \
6771
--repo "$GITHUB_REPOSITORY" \
68-
-D static/circt \
72+
-D static/mox \
6973
--clobber 2>/dev/null; then
7074
unpack_uvm_bundle_if_present
71-
echo "CIRCT artifacts downloaded from release 'circt-wasm'"
72-
ls -lh static/circt/
75+
echo "MOX artifacts downloaded from release 'mox-wasm'"
76+
ls -lh static/mox/
7377
if have_uvm_bundle; then
7478
echo "UVM runtime bundle found"
7579
else
7680
echo "::notice::UVM runtime bundle missing (uvm-manifest.json not found); UVM lessons may fail."
7781
fi
7882
else
79-
echo "::notice::No 'circt-wasm' release found; simulation features will be unavailable."
83+
echo "::notice::No 'mox-wasm' release found; simulation features will be unavailable."
8084
fi
8185
env:
8286
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/e2e-waveform.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ jobs:
3434
- name: Prepare Surfer assets
3535
run: scripts/setup-surfer.sh
3636

37-
- name: Ensure CIRCT wasm artifacts
38-
id: circt_artifacts
37+
- name: Ensure MOX wasm artifacts
38+
id: mox_artifacts
3939
run: |
40-
mkdir -p static/circt
40+
mkdir -p static/mox
4141
4242
have_all_artifacts() {
43-
[ -f static/circt/circt-verilog.js ] && \
44-
[ -f static/circt/circt-verilog.wasm ] && \
45-
[ -f static/circt/circt-sim.js ] && \
46-
[ -f static/circt/circt-sim.wasm ]
43+
[ -f static/mox/mox-verilog.js ] && \
44+
[ -f static/mox/mox-verilog.wasm ] && \
45+
[ -f static/mox/mox-sim.js ] && \
46+
[ -f static/mox/mox-sim.wasm ]
4747
}
4848
4949
if have_all_artifacts; then
5050
echo "ready=true" >> "$GITHUB_OUTPUT"
5151
exit 0
5252
fi
5353
54-
echo "Local CIRCT wasm artifacts missing; trying release 'circt-wasm'..."
55-
if gh release download circt-wasm \
54+
echo "Local MOX wasm artifacts missing; trying release 'mox-wasm'..."
55+
if gh release download mox-wasm \
5656
--repo "$GITHUB_REPOSITORY" \
57-
-D static/circt \
57+
-D static/mox \
5858
--clobber 2>/dev/null; then
5959
if have_all_artifacts; then
6060
echo "ready=true" >> "$GITHUB_OUTPUT"
@@ -63,28 +63,28 @@ jobs:
6363
fi
6464
6565
echo "ready=false" >> "$GITHUB_OUTPUT"
66-
echo "::notice::Skipping waveform E2E: CIRCT wasm artifacts are missing (expected under static/circt or release circt-wasm)."
66+
echo "::notice::Skipping waveform E2E: MOX wasm artifacts are missing (expected under static/mox or release mox-wasm)."
6767
env:
6868
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6969

7070
- name: Build app
71-
if: steps.circt_artifacts.outputs.ready == 'true'
71+
if: steps.mox_artifacts.outputs.ready == 'true'
7272
run: npm run build
7373

7474
- name: Run unit tests
75-
if: steps.circt_artifacts.outputs.ready == 'true'
75+
if: steps.mox_artifacts.outputs.ready == 'true'
7676
run: npm test
7777

7878
- name: Install Playwright browser
79-
if: steps.circt_artifacts.outputs.ready == 'true'
79+
if: steps.mox_artifacts.outputs.ready == 'true'
8080
run: npx playwright install --with-deps chromium
8181

8282
- name: Run waveform E2E
83-
if: steps.circt_artifacts.outputs.ready == 'true'
83+
if: steps.mox_artifacts.outputs.ready == 'true'
8484
run: npm run test:e2e -- e2e/waveform.spec.js
8585

8686
- name: Upload Playwright artifacts
87-
if: always() && steps.circt_artifacts.outputs.ready == 'true'
87+
if: always() && steps.mox_artifacts.outputs.ready == 'true'
8888
uses: actions/upload-artifact@v4
8989
with:
9090
name: playwright-waveform-${{ github.run_id }}

.github/workflows/uvm-nightly.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,37 @@ jobs:
3636
- name: Prepare Pyodide assets
3737
run: scripts/setup-pyodide.sh
3838

39-
- name: Download CIRCT wasm artifacts
39+
- name: Download MOX wasm artifacts
4040
env:
4141
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4242
run: |
43-
mkdir -p static/circt
43+
mkdir -p static/mox
4444
4545
unpack_uvm_bundle_if_present() {
46-
if [ -f static/circt/uvm-core.tar.gz ]; then
47-
rm -rf static/circt/uvm-core
48-
tar -xzf static/circt/uvm-core.tar.gz -C static/circt
46+
if [ -f static/mox/uvm-core.tar.gz ]; then
47+
rm -rf static/mox/uvm-core
48+
tar -xzf static/mox/uvm-core.tar.gz -C static/mox
4949
fi
5050
}
5151
5252
have_all_artifacts() {
53-
[ -f static/circt/circt-verilog.js ] && \
54-
[ -f static/circt/circt-verilog.wasm ] && \
55-
[ -f static/circt/circt-sim.js ] && \
56-
[ -f static/circt/circt-sim.wasm ] && \
57-
[ -f static/circt/uvm-core/uvm-manifest.json ]
53+
[ -f static/mox/mox-verilog.js ] && \
54+
[ -f static/mox/mox-verilog.wasm ] && \
55+
[ -f static/mox/mox-sim.js ] && \
56+
[ -f static/mox/mox-sim.wasm ] && \
57+
[ -f static/mox/uvm-core/uvm-manifest.json ]
5858
}
5959
6060
if ! have_all_artifacts; then
61-
gh release download circt-wasm \
61+
gh release download mox-wasm \
6262
--repo "$GITHUB_REPOSITORY" \
63-
-D static/circt \
63+
-D static/mox \
6464
--clobber
6565
unpack_uvm_bundle_if_present
6666
fi
6767
6868
if ! have_all_artifacts; then
69-
echo "::error::CIRCT wasm artifacts are missing after release download."
69+
echo "::error::MOX wasm artifacts are missing after release download."
7070
exit 1
7171
fi
7272

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build.bak.*
1111
*.swp
1212

1313
# Downloaded/built artifacts (run scripts/setup-*.sh to populate)
14-
static/circt/
14+
static/mox/
1515
static/surfer/
1616
static/pyodide/
1717

AGENT.md

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

99
## Resource Safety
1010

11-
- Treat `ninja`, `circt-sim`, large link steps, and similarly heavy tools as high-risk for local system stability.
11+
- Treat `ninja`, `mox-sim`, large link steps, and similarly heavy tools as high-risk for local system stability.
1212
- Always run heavy commands with explicit resource limits (for example: CPU parallelism limits, memory caps, and wall-clock timeouts).
1313
- Prefer incremental/targeted builds over whole-tree builds when possible.
1414
- Avoid running multiple heavy builds concurrently.

CLAUDE.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ npm run dev # Start dev server (Vite)
1010
npm run build # Production build
1111
npm run preview # Preview production build
1212

13-
scripts/setup-circt.sh # Clone/update the CIRCT fork into vendor/circt
14-
scripts/setup-circt.sh <dir> # Clone into a custom directory
13+
scripts/setup-mox.sh # Clone/update the MOX fork into vendor/mox
14+
scripts/setup-mox.sh <dir> # Clone into a custom directory
1515

1616
scripts/setup-surfer.sh # Download Surfer waveform viewer web build into public/surfer
1717
scripts/setup-surfer.sh <dir> # Download into a custom directory
@@ -38,41 +38,41 @@ All state lives in the single root component. Key derived values:
3838
- `completed = filesEqual(workspace, solutionFiles)` — drives the "solve"/"reset" toggle
3939
- Lesson navigation mutates `lessonIndex`; reactive blocks reset `workspace`, `logs`, and `lastWaveform` on lesson change
4040

41-
### CIRCT WASM Runtime (`src/runtime/`)
41+
### MOX WASM Runtime (`src/runtime/`)
4242

4343
Two files handle the runtime bridge:
4444

45-
**`circt-config.js`** — reads Vite env vars and resolves runtime configuration:
46-
- `VITE_CIRCT_WASM_JS_URL` / `VITE_CIRCT_WASM_JS_URLS` — JS artifact URL(s) (comma-separated for fallback)
47-
- `VITE_CIRCT_WASM_URL` / `VITE_CIRCT_WASM_URLS` — WASM artifact URL(s)
48-
- `VITE_CIRCT_FACTORY_NAME` — optional Emscripten factory function name
49-
- `VITE_CIRCT_TOOL_ARGS` — args for `run` (JSON array preferred, space-split fallback)
50-
- `VITE_CIRCT_SELF_CHECK_ARGS` — args for the self-check smoke test
51-
- Default JS candidates: `/circt/circt.js`, `/circt/circt-bmc.js`
52-
- Default WASM candidates: `/circt/circt.wasm`, `/circt/circt-bmc.wasm`
45+
**`mox-config.js`** — reads Vite env vars and resolves runtime configuration:
46+
- `VITE_MOX_WASM_JS_URL` / `VITE_MOX_WASM_JS_URLS` — JS artifact URL(s) (comma-separated for fallback)
47+
- `VITE_MOX_WASM_URL` / `VITE_MOX_WASM_URLS` — WASM artifact URL(s)
48+
- `VITE_MOX_FACTORY_NAME` — optional Emscripten factory function name
49+
- `VITE_MOX_TOOL_ARGS` — args for `run` (JSON array preferred, space-split fallback)
50+
- `VITE_MOX_SELF_CHECK_ARGS` — args for the self-check smoke test
51+
- Default JS candidates: `/mox/mox.js`, `/mox/mox-bmc.js`
52+
- Default WASM candidates: `/mox/mox.wasm`, `/mox/mox-bmc.wasm`
5353

54-
**`circt-adapter.js`**`CirctWasmAdapter` class, lazy-initialized on first `run()` or `selfCheck()`:
54+
**`mox-adapter.js`**`MoxWasmAdapter` class, lazy-initialized on first `run()` or `selfCheck()`:
5555
- Tries each JS candidate URL in order until one loads successfully
5656
- Detects runtime mode automatically:
57-
- **`custom-runtime`**: `window.CIRCT_WASM_RUNTIME` global exposes `{ init, run, selfCheck? }`
58-
- **`emscripten-module`**: raw Emscripten output; looks for factory functions (`createCirctBmcModule`, `createModule`, `Module`) then falls back to `window.Module`
57+
- **`custom-runtime`**: `window.MOX_WASM_RUNTIME` global exposes `{ init, run, selfCheck? }`
58+
- **`emscripten-module`**: raw Emscripten output; looks for factory functions (`createMoxBmcModule`, `createModule`, `Module`) then falls back to `window.Module`
5959
- In Emscripten mode, files are written into the module's virtual FS under `/workspace/`, and output waveform is read back from `/workspace/out/waves.vcd`
6060
- Arg templates support `{top}`, `{input}`, `{waveform}` placeholders
6161

62-
### CIRCT WASM Artifacts
62+
### MOX WASM Artifacts
6363

64-
Place built artifacts from the CIRCT fork (`git@github.com:thomasnormal/circt.git`) at:
65-
- `public/circt/circt-bmc.js` + `public/circt/circt-bmc.wasm`
66-
- or custom shim: `public/circt/circt.js` + `public/circt/circt.wasm`
64+
Place built artifacts from the MOX fork (`git@github.com:normal-computing/mox.git`) at:
65+
- `public/mox/mox-bmc.js` + `public/mox/mox-bmc.wasm`
66+
- or custom shim: `public/mox/mox.js` + `public/mox/mox.wasm`
6767

68-
Without these files, the runtime will fail gracefully with a log message directing you to run `scripts/setup-circt.sh`.
68+
Without these files, the runtime will fail gracefully with a log message directing you to run `scripts/setup-mox.sh`.
6969

7070
### Surfer Waveform Viewer (`src/lib/components/WaveformViewer.svelte`)
7171

7272
The waveform pane embeds [Surfer](https://surfer-project.org/) via an `<iframe src="/surfer/">`.
7373

7474
- Surfer must be self-hosted (same origin) so that blob URLs created from in-memory VCD data are fetchable by the iframe.
75-
- When CIRCT produces a VCD string (`lastWaveform.text`), the component creates a `Blob``URL.createObjectURL` and sends `{ command: 'LoadUrl', url }` via `postMessage` with progressive retries (0 / 800 / 2200 / 4500 ms) to absorb Surfer's WASM initialization time.
75+
- When MOX produces a VCD string (`lastWaveform.text`), the component creates a `Blob``URL.createObjectURL` and sends `{ command: 'LoadUrl', url }` via `postMessage` with progressive retries (0 / 800 / 2200 / 4500 ms) to absorb Surfer's WASM initialization time.
7676
- If `/surfer/index.html` is not found (HEAD 404), the component shows a prompt to run `scripts/setup-surfer.sh`.
7777

7878
Install artifacts:

CURRICULUM.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Flag numbers identify the weak dimension(s): 1=Concept Focus, 2=Starter Calibrat
122122
| Slug | Title | Status | Score | Prereqs | Teaches |
123123
|---|---|---|---|---|---|
124124
| `sva/implication` | Implication: \|->, \|=> || 23/27 ⚠️5,8,9 | `sva/sequence-basics` | `\|->` (overlapping), `\|=>` (non-overlapping), antecedent/consequent |
125-
| `sva/formal-intro` | Bounded Model Checking || 22/27 ⚠️2,4,5,9 | `sva/implication` | BMC, `circt-bmc`, exhaustive proof vs simulation, bounded depth |
125+
| `sva/formal-intro` | Bounded Model Checking || 22/27 ⚠️2,4,5,9 | `sva/implication` | BMC, `mox-bmc`, exhaustive proof vs simulation, bounded depth |
126126

127127
### Chapter: Core Sequences
128128
| Slug | Title | Status | Score | Prereqs | Teaches |
@@ -193,7 +193,7 @@ Flag numbers identify the weak dimension(s): 1=Concept Focus, 2=Starter Calibrat
193193
> match — unlike `|->` / `|=>` which pass vacuously.
194194
> Exercise: compare the two forms on a burst read; observe the `#=#`
195195
> failure when the burst never occurs vs the `|=>` silent pass.
196-
> *Requires circt-bmc for the formal comparison half.*
196+
> *Requires mox-bmc for the formal comparison half.*
197197
198198
---
199199

0 commit comments

Comments
 (0)