Skip to content

Adds openroad in image and enables PnR process#87

Merged
syifan merged 22 commits into
syifan:mainfrom
yuqisun:main
Mar 16, 2026
Merged

Adds openroad in image and enables PnR process#87
syifan merged 22 commits into
syifan:mainfrom
yuqisun:main

Conversation

@yuqisun

@yuqisun yuqisun commented Mar 14, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

…egfault

The mlir-neura-opt mapper crashes (exit code 139, SIGSEGV) whenever any
entry appears in tile_overrides, including the 'existence: true' field
that was being emitted for every enabled tile.

Changes:
- converter.js: hardcode tile_overrides to [] and derive tile_defaults
  from the union of all enabled tile operations (superset strategy)
- converter.js: remove 'existence: true' from generateTileOverrides
  (function kept as dead code for future use with disabled tiles)
- converter.js: switch deriveDefaultOperations from most-common to
  union so no per-tile override is needed
- converter.test.js: update tests to assert tile_overrides is empty
  and tile_defaults contains the union of all tile operations
- mappingExecutor.js: pick up VERILOG_DOCKER_TIMEOUT_MS, patchSeededTestFile,
  and minimum 2x2 multi-CGRA grid guard (uncommitted changes)
… Verilator OOM

VectorCGRA's Verilated model compilation (g++ cc1plus) is killed by the Linux
OOM killer when per-CGRA tiles > 2x2. A 4x4 per-CGRA grid produces ~16x more
RTL than the reference 2x2 arch, exceeding g++ compilation memory limits.

Cap perRows/perCols at 2 to match the reference arch.yaml and all passing
VectorCGRA tests. Per-CGRA size > 2x2 silently works in the dataflow mapper
(which has its own arch description) but breaks SVerilog Verilator compilation.
# Conflicts:
#	src/workspace/LayoutTab.jsx
#	src/workspace/VerificationTab.jsx
Copilot AI review requested due to automatic review settings March 14, 2026 15:44
@vercel

vercel Bot commented Mar 14, 2026

Copy link
Copy Markdown

@yuqisun is attempting to deploy a commit to the syifan's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR switches the project to the cgra/cgra-flow:web-ui Docker image and adds a real “layout” (OpenROAD PnR) job end-to-end: frontend submission + realtime progress UI + runner execution + artifact upload.

Changes:

  • Update default Docker image tag from cgra/cgra-flow:uicgra/cgra-flow:web-ui across scripts, runner executors, and docs.
  • Add a new layout job type: submitLayoutJob in the frontend, LayoutTab wiring for progress/results, and runner/layoutExecutor.js to run OpenROAD PnR in Docker and upload layout.png.
  • Add spec/proposal/design documentation under openspec/changes/layout-openroad-pnr/.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
test_verilog_simple.js Updates default DOCKER_IMAGE tag to :web-ui for local test runs.
test_vectorcgra_verilog.js Updates default DOCKER_IMAGE tag to :web-ui.
test_vectorcgra_fixed.js Updates default DOCKER_IMAGE tag to :web-ui.
test_vectorcgra_complete.js Updates default DOCKER_IMAGE tag to :web-ui.
src/workspace/services/verificationService.js Adds submitLayoutJob(...) API for inserting layout jobs.
src/workspace/LayoutTab.jsx Replaces mock layout UI with real job submission + realtime progress + result image rendering.
runner/testExecutor.js Updates docstring + default DOCKER_IMAGE tag to :web-ui.
runner/synthesisExecutor.js Updates docstring + default DOCKER_IMAGE tag to :web-ui.
runner/mappingExecutor.js Updates default DOCKER_IMAGE tag to :web-ui.
runner/layoutExecutor.js New runner executor that runs OpenROAD/ORFS flow in Docker and uploads layout image to Supabase Storage.
runner/jobProcessor.js Registers layout job type dispatch to executeLayoutJob.
runner/collect_benchmark_ops.js Updates default DOCKER_IMAGE tag to :web-ui.
runner/README.md Updates example DOCKER_IMAGE to :web-ui.
runner/.env.example Updates example DOCKER_IMAGE to :web-ui.
public/benchmark_ops_index.json Updates recorded docker image tag to :web-ui.
openspec/changes/layout-openroad-pnr/tasks.md Adds task checklist for the layout/OpenROAD integration.
openspec/changes/layout-openroad-pnr/specs/layout-pnr-panel/spec.md Specifies expected Layout tab behavior (job submit, progress, image, errors).
openspec/changes/layout-openroad-pnr/specs/layout-pnr-job/spec.md Specifies expected runner behavior for layout jobs (sv2v, PnR, progress, upload).
openspec/changes/layout-openroad-pnr/proposal.md Describes why/what/impact of enabling real layout PnR.
openspec/changes/layout-openroad-pnr/design.md Design notes, decisions, risks for layout PnR flow.
openspec/changes/layout-openroad-pnr/.openspec.yaml Adds OpenSpec metadata for the change.
docs/LOCAL_SETUP.md Updates local setup instructions to pull/use :web-ui.
cgra-flow-docker/Dockerfile.openroad Adds Dockerfile layering OpenROAD/ORFS onto cgra/cgra-flow:web-ui.
README.md Updates root README to pull/use :web-ui.
CGRA-Flow-sample/layout/constraint.sdc Updates sample constraint to target CgraTemplateRTL and formatting.
CGRA-Flow-sample/layout/config.mk Updates sample config.mk to ORFS-style config and paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread runner/layoutExecutor.js
Comment on lines +45 to +48
const LAYOUT_DOCKER_TIMEOUT_MS = parseInt(
process.env.LAYOUT_DOCKER_TIMEOUT_MS || '0',
10
); // 0 = no timeout
Comment on lines +65 to +69
try {
const sdcContent = sdcFile ? await sdcFile.text() : null;
const mkContent = mkFile ? await mkFile.text() : null;
const id = await submitLayoutJob(projectId, sdcContent, mkContent);
setJobId(id);
Comment on lines +115 to +131
export async function submitLayoutJob(projectId, sdcContent = null, mkContent = null) {
const {
data: { user }
} = await supabase.auth.getUser();

const { data: newJob, error } = await supabase
.from('jobs')
.insert({
project_id: projectId,
user_id: user?.id,
type: 'layout',
status: 'queued',
info: {
...(sdcContent ? { sdcContent } : {}),
...(mkContent ? { mkContent } : {}),
}
})
Comment on lines +38 to +47
### Requirement: Executor runs OpenROAD place-and-route via mflowgen inside Docker
The executor SHALL write a shell script, mount a temp directory into the Docker container, and run mflowgen with OpenROAD through to the final routing step.

#### Scenario: Docker container is started for PnR
- **WHEN** the layout job begins executing
- **THEN** `docker run --rm -v <tempDir>:/layout <DOCKER_IMAGE> bash /layout/layout.sh` is invoked with the `cgra/cgra-flow:web-ui` image

#### Scenario: mflowgen drives the flow
- **WHEN** the layout shell script runs inside Docker
- **THEN** mflowgen is configured for the `nangate45` process node and `make` is called to run through the final routing step
Comment on lines +77 to +79
### Requirement: Layout job executor has a configurable timeout
The executor SHALL respect a `LAYOUT_DOCKER_TIMEOUT_MS` environment variable (default: 3 600 000 ms = 60 min).

Comment on lines 28 to +35
function LayoutTab({ projectId, sverilogReady }) {
const [sdcPath, setSdcPath] = useState('');
const [mkPath, setMkPath] = useState('');
const [sdcFile, setSdcFile] = useState(null);
const [mkFile, setMkFile] = useState(null);
const [process, setProcess] = useState('asap7');
const [loading, setLoading] = useState(false);
const [showResult, setShowResult] = useState(false);
const [jobId, setJobId] = useState(null);
const [jobStatus, setJobStatus] = useState(null);
Comment on lines +1 to +3
## 1. Runner �?Layout Job Executor

- [x] 1.1 Create `runner/layoutExecutor.js` with the same module structure as `synthesisExecutor.js`: dotenv config, Supabase client init, `DOCKER_IMAGE`, `GRAPH_BUCKET`, `LAYOUT_DOCKER_TIMEOUT_MS` (default 3 600 000 ms) constants, UUID validation pattern, `patchJobInfo`, `updateProgress`, and `runWithProgress` helpers
Comment on lines +13 to +16
**Non-Goals:**
- Supporting custom SDC / config.mk files uploaded by the user (the file-picker fields in LayoutTab remain UI-only for now).
- Supporting process nodes other than `nangate45` in the first iteration (OpenROAD's bundled PDK in orfs).
- Cancelling an in-flight layout job.
Comment on lines +51 to +56
### Requirement: Executor reports intermediate progress to Supabase
The executor SHALL update `job.info` with `{ progress, stage, timeCost }` at key milestones via `PROGRESS:<n>:<label>` markers streamed from the Docker process.

#### Scenario: Progress milestones are emitted
- **WHEN** the Docker process emits `PROGRESS:10:starting`, `PROGRESS:20:sv2v`, `PROGRESS:50:pnr-init`, `PROGRESS:80:routing`, `PROGRESS:95:image-export`
- **THEN** the runner patches `job.info` with the corresponding progress value and stage label
# This avoids rebuilding the entire cgra-flow image from scratch.
#
# orfs base: Ubuntu 22.04 (Jammy)
# cgra-flow:ui base: Ubuntu 24.04 (Noble)
@syifan syifan merged commit c222294 into syifan:main Mar 16, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants