Skip to content

web: add Implant/Other layer categories and per-layer fill patterns#10795

Open
jorge-ferreira-pii wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:feature-WebGUI-display-controls-layers
Open

web: add Implant/Other layer categories and per-layer fill patterns#10795
jorge-ferreira-pii wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:feature-WebGUI-display-controls-layers

Conversation

@jorge-ferreira-pii

@jorge-ferreira-pii jorge-ferreira-pii commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Addresses a portion of #10619

@jorge-ferreira-pii jorge-ferreira-pii self-assigned this Jul 1, 2026
@github-actions github-actions Bot added the size/M label Jul 1, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces support for per-layer fill patterns (such as diagonal, cross, and dots) in the web frontend, mirroring the Qt GUI's rendering behavior. It updates both the JavaScript frontend to manage and persist these pattern choices via cookies and the C++ tile generator backend to parse and apply the patterns when rendering polygons and rectangles. The review feedback focuses on performance and code quality improvements, specifically suggesting to refactor a local lambda into a free function, optimize a modulo operation, and add early returns in the rendering functions when the fill pattern is set to none.

Comment thread src/web/src/tile_generator.cpp Outdated
Comment on lines +780 to +782
auto wrap = [](const int v, const int period) {
return ((v % period) + period) % period;
};

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.

medium

Helper logic should be defined as a free function in a namespace rather than as a local lambda within a function. Additionally, since period is always positive, we can optimize the modulo operation to avoid a second modulo by using a simple conditional check.

References
  1. Helper logic should be defined as a free function in a namespace rather than as a local lambda within a function.

Comment on lines 808 to +809
{
// Tile origin in absolute pixel space, anchoring non-solid patterns.

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.

medium

If the fill pattern is set to FillPattern::kNone, we can return early immediately. This avoids performing any polygon scanline setup, edge intersections, sorting, or pixel loops entirely, which is a significant performance win.

Suggested change
{
// Tile origin in absolute pixel space, anchoring non-solid patterns.
{
if (pattern == FillPattern::kNone) {
return;
}
// Tile origin in absolute pixel space, anchoring non-solid patterns.

Comment on lines 3651 to 3652
{
for (int iy = rect.yMin(); iy < rect.yMax(); ++iy) {

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.

medium

Similarly, if the fill pattern is set to FillPattern::kNone, we can return early from drawFilledRect immediately to avoid any loop overhead.

{
  if (pattern == FillPattern::kNone) {
    return;
  }
  for (int iy = rect.yMin(); iy < rect.yMax(); ++iy) {

@openroad-ci openroad-ci force-pushed the feature-WebGUI-display-controls-layers branch from 6f827e1 to f6b066f Compare July 1, 2026 18:34
@jorge-ferreira-pii

Copy link
Copy Markdown
Contributor Author

2.2 Display controls — layers ✅

Feature GUI Web Status
Per-layer visibility (tree) displayControls display-controls.js
Per-layer color color picker color.h
Selectability column yes yes
Per-layer fill pattern (solid/hatch/crosshatch) yes FillPattern + patternCovers ❌ → ✅
Implant / Other layer categories yes classifyLayer() grouping 🟡 → ✅

The whole 2.2 — Display controls — layers area is now ✅.

@jorge-ferreira-pii

Copy link
Copy Markdown
Contributor Author

What was implemented and tested

  • Per-layer fill pattern (❌ → ✅) — solid/diagonal/cross/dots/none per layer, chosen from the layer-tree right-click menu and persisted in the or_layer_patterns cookie.

  • Implant / Other layer categories (🟡 → ✅) :

asap7/gcd — exercises the Implant category: RVTN/RVTP render real geometry.
sky130hd/gcd — exercises the Other category: nwell/pwell render real geometry.

@jorge-ferreira-pii jorge-ferreira-pii marked this pull request as ready for review July 1, 2026 19:00
@jorge-ferreira-pii jorge-ferreira-pii requested a review from a team as a code owner July 1, 2026 19:00

@gadfort gadfort 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.

I would suggest leaving the Implant and Other categories collapsed when opening.
Also I found it strange that the layer selection was saved between sessions (so when I opened a new design in a new session the fact that only one metal was visible was a little jarring (this behavior differs from the QtGUI where the layer options are not saved between sessions).

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
…Project#10795)

- collapse the Implant and Other layer categories by default
- store per-layer visibility/selectability in sessionStorage instead of
  cookies, so layer options survive the reload that opening a database
  triggers but reset in a new session (matching the Qt GUI, which does
  not persist layer options between sessions)
- update the GetLayers test golden: getLayers() now returns every tech
  layer type (22 for Nangate45: +poly/active/OVERLAP) to back the
  Implant/Other categories and the saveReport prerender

Signed-off-by: Jorge Ferreira <jorge.ferreira@precisioninno.com>
@openroad-ci openroad-ci force-pushed the feature-WebGUI-display-controls-layers branch from f6b066f to 4e74cdb Compare July 4, 2026 21:29
@jorge-ferreira-pii

Copy link
Copy Markdown
Contributor Author

I would suggest leaving the Implant and Other categories collapsed when opening. Also I found it strange that the layer selection was saved between sessions (so when I opened a new design in a new session the fact that only one metal was visible was a little jarring (this behavior differs from the QtGUI where the layer options are not saved between sessions).

Thanks, Peter! Good catch, those details totally flew under my radar. I've just pushed the fixes for the category collapsing and the session saving, and I also fixed the merge conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants