Skip to content

Commit 678dc94

Browse files
authored
Document Copilot build setup (incl. PyCDE/ESI) and align integration image defaults (#9314)
Implements Teach copilot how to compile CIRCT #9313
1 parent 4d30bad commit 678dc94

File tree

3 files changed

+49
-1
lines changed

3 files changed

+49
-1
lines changed

.github/copilot-instructions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copilot build & test guidance
2+
3+
- Default to the integration docker image in `CIRCT_INTEGRATION_IMAGE` (set by the Copilot setup workflow and the `utils/run-docker.sh` default; currently `ghcr.io/circt/images/circt-integration-test:v19.2`) when compiling or testing.
4+
- Run inside that image via `./utils/run-docker.sh ./utils/run-tests-docker.sh "$CIRCT_INTEGRATION_IMAGE"` or `docker run` with the repo root bind-mounted.
5+
- When cloning or checking out, ensure submodules are present (`git submodule update --init --recursive` if needed).
6+
- Configure builds from the repo root with Ninja, matching the README:
7+
```
8+
cmake -G Ninja llvm/llvm -B build \
9+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
10+
-DLLVM_ENABLE_ASSERTIONS=ON \
11+
-DLLVM_TARGETS_TO_BUILD=host \
12+
-DLLVM_ENABLE_PROJECTS=mlir \
13+
-DLLVM_EXTERNAL_PROJECTS=circt \
14+
-DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=$PWD \
15+
-DLLVM_ENABLE_LLD=ON
16+
```
17+
- Build everything with `ninja -C build check-circt`; use `ninja -C build bin/circt-opt` or `ninja -C build bin/firtool` for tool-only builds.
18+
- Keep Python bindings enabled when needed via `-DMLIR_ENABLE_BINDINGS_PYTHON=ON -DCIRCT_BINDINGS_PYTHON_ENABLED=ON`.
19+
- For PyCDE and the ESI runtime, add `-DCIRCT_ENABLE_FRONTENDS=PyCDE -DESI_RUNTIME=ON` (keep Python bindings on). Test with `ninja -C build check-pycde` and `ninja -C build check-pycde-integration` (the integration tests exercise both PyCDE and the ESI runtime and are the only ESIRuntime tests).
20+
- Prefer the integration image and the setup steps workflow for reliable dependencies; only fall back to host builds when explicitly requested.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Copilot setup steps
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Pre-pull integration docker image
17+
env:
18+
CIRCT_INTEGRATION_IMAGE: ghcr.io/circt/images/circt-integration-test:v19.2
19+
run: |
20+
echo "CIRCT_INTEGRATION_IMAGE=$CIRCT_INTEGRATION_IMAGE" >> $GITHUB_ENV
21+
docker pull "$CIRCT_INTEGRATION_IMAGE"
22+
- name: Summarize defaults
23+
run: |
24+
{
25+
echo "### CIRCT Copilot setup"
26+
echo "- Integration image: $CIRCT_INTEGRATION_IMAGE"
27+
echo "- Default build directory: build"
28+
} >> "$GITHUB_STEP_SUMMARY"

utils/run-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
##===----------------------------------------------------------------------===##
2121

2222
CMD=${1:-"./utils/run-tests-docker.sh"}
23-
VER=${2:-"v5"}
23+
VER=${2:-"v19.2"}
2424
REPO_ROOT=$(cd "$(dirname "$BASH_SOURCE[0]")/.." && pwd)
2525

2626
cd $REPO_ROOT

0 commit comments

Comments
 (0)