2pyrtl logo2pyrtl

The schematic

The schematic viewer

The viewer draws the design your last run produced - the real one, built from the modules and wires 2pyrtl elaborated, not a picture anybody drew. You can move what is in it, and what you move is remembered.

Reading the drawing

Each module is a box with its ports on its edges and its name at the top right. Inside are the primitives your logic became - adders, comparators, multiplexers, gates, flops - each labelled with the expression it computes, so you can follow a value across the page and read what happens to it.

  • ·
    Wires are drawn in level, upright and 45-degree pieces, one colour per wire.
  • ·
    Clocks and resets are there but can be hidden - Settings has the switch - because they reach everything and would otherwise cross everything.
  • ·
    A child module is a box within the box, with its own ports and contents.

Moving about

To do thisDo that
PanDrag the background. On a phone, one finger.
ZoomThe mouse wheel, about the middle of what you can see. On a phone, pinch.
Move a componentDrag it.
Resize a moduleDrag a corner.
Move a portDrag it along its edge.
Bend a wireDrag the middle of a piece; the wire keeps its 45-degree shape.
Remove a bendRight-click the corner you placed.
A menu on a component or labelRight-click it. On a phone, press and hold.
Undo, redoCtrl+Z, Ctrl+Shift+Z - every move is undoable.

The bar

File opens a design or loads and saves a layout; Edit is undo and redo; Settings holds the theme, whether clocks and resets are drawn, and whether a saved layout loads by itself. On the right of the bar are the buttons:

  • ·
    Documentation - this book, in a new tab.
  • ·
    Follow runs (the chain link) - whether a finished run re-opens the schematic it drew. Off, the viewer stays exactly where you left it while you re-run.
  • ·
    Lock editing (the padlock) - green means the drawing can be rearranged, red means it cannot. Panning, zooming and snapshots carry on either way.
  • ·
    Snapshot (the camera) - the drawing as a PNG at print resolution: A4 or Letter, portrait or landscape, or four times what you can see. The grid can be left out, and the background made transparent.
  • ·
    Focus - the schematic alone on the page.

What is remembered

Arranging a schematic is work, so it is kept. Save a layout from the File menu and it is written into stf_files/ in your workspace, keyed to the module's type - which means the same module gets the same arrangement wherever it appears, and a module built with different parameters keeps its own.

Library components arrive with a layout already drawn, by hand, so a FIFO or an arbiter reads as the algorithm rather than as a heap of gates - the component library.

A run rewrites the design, not your layout

The design comes from 2pyrtl_output/rtl_arch/ and is rewritten by every run. Your arrangement is a separate file and survives; it is matched back on by name, so renaming a wire or a module loses that part of it.

Away from the workspace

The viewer is one program: the same thing runs inside the workspace, on the front page as the live demo, and on the desktop. In the workspace it reads and writes your files; on the front page it carries a design of its own and saves nothing.