Repository navigation
Structured SVG export, export decorations, fanout bands, role grouping - #49
Merged
Merged
Conversation
Role grouping: group_by "role" gathers a wide net's sinks by the naja role of the receiving pin (clock, reset, set, enable, scan, address, data), sent as a sparse "role" on term and occurrence entries by both providers (shared cases in tests/data/role_protocol_cases.json). SVG structure: every net, instance box, top-level port flag, fanout summary and module frame is a <g> with data-* attributes (data-net, data-driver, data-path, data-id-path, data-model, ...; JSON paths when a name holds "/" or ":" or is anonymous). The drawing is unchanged: tests/SvgExportTest.cpp compares it to a golden file. Export decorations (view options, export_svg()/export_png() keywords, CLI flags): title and caption bands, a legend of traces and labeled nets, and hide_ui_glyphs (no open-pin stubs or "more pins" dots). The PNG export draws the same page. Fanout layout: a sink grid with several drivers gives each driver a band of rows level with it, all bands starting in the same column, so no net's wires cross another net's sinks. Sinks are in natural name order (lut_111 before lut_1037), which also picks the first max_sinks drawn. The convergence outline is never drawn on a styled box, and the new view option convergence_outline (--no-convergence-outline) turns it off. --help and the README say max_sinks defaults to 32 and 0 disables it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Role grouping —
group_by: "role"gathers a wide net's sinks by the naja role of the receiving pin (clock,reset,set,enable,scan,address, elsedata). Both providers send a sparse"role"on term and occurrence entries (termRoleName()inLocalSNLProvider.cpp,term_role()inprotocol.py); shared cases intests/data/role_protocol_cases.json.Structured SVG — every drawn object is a
<g>with data-* attributes, so scripts can find things without reading geometry:<g class="net">(wires, junction dots, bus marks, label):data-net,data-driver(u1/u2:Q, or a port name),data-driver-id-path,data-label<g class="instance">:data-path,data-id-path,data-model<g class="port">:data-name,data-direction;<g class="summary">:data-group,data-count;<g class="module">data-path-json/data-driver-jsonwhen a name is empty or holds/or:The groups come from
SchematicPainter::BeginGroup()/EndGroup()(no-ops on screen and in PNG). The drawing itself is unchanged:tests/SvgExportTest.cppcompares an undecorated export, group tags stripped, withtests/data/export_golden.svg.Export decorations — view options
title,caption,legend,hide_ui_glyphs, alsoexport_svg()/export_png()/export_svgs()keywords and--title,--caption,--legend,--hide-ui-glyphson every CLI. Exports only, never the canvas; the PNG draws the same page as the SVG.Fanout layout
lut_111beforelut_1037); this also decides whichmax_sinkssinks are drawn.convergence_outline(--no-convergence-outline, View > Outline Trace Convergence) turns it off.--helpand the README saymax_sinksdefaults to 32 when not given, and0disables it.Version —
__version__goes from 0.2.1 to 0.3.0 (najaeda PR keplertech/naja#534 depends on this release).Behavior changes
wide_fanout.vthe six LUTs now come first, so the summary isFDRE ×38instead ofFDRE ×32+LUT1 ×6(test updated). The golden SVG was regenerated for the same reason.Testing
SvgExportTest.cpp(groups, decorations,hide_ui_glyphs, PNG page size, golden);MultiDriverFanouttests inFanoutTest.cpp(no crossings with 3 drivers at 20 and 40 sinks each; bands level with their drivers; natural order; convergence outline). The crossing test fails with the old single-group grid.NAJA_SCHEMATIC_REQUIRE_RENDER=1(najaeda 0.7.35);test_notebook.pynot run. Python tests parse the renderer's SVG with ElementTree and check the groups against the design's ids.reuse lintpasses.NAJA_SCHEMATIC_UPDATE_GOLDEN=1rewrites it).