ato code defines the function of the circuit via the connections between elements. Unlike a software compiler, these components all need to end up placed somewhere and copper traces need routing between the elements for the circuit to function.

This process is typically called “layout.”

atopile uses KiCad, the premier open source electronics design package for layout.

Opening KiCad

When you run ato build, ato generates a KiCad project file for you. If you’re only building a single build-target, ato will open the KiCAD file for you.

KiCad plugin

The ato compiler automatically installs a KiCad plugin to help you with layout. This saves a lot of time.

The plugin installs automatically when you run the ato command-line tool, but in case something went wrong, you can re-trigger the installation by running ato configure.

Start with existing modules

If you import the rp2040 module installed in the previous section, you can reuse its layout.

from "rp2040/RP2040Kit.ato" import RP2040Kit

module App:
    uc = new RP2040Kit
    # Note: I've emptied this module out for brevity.
    # You can decide whether you want to keep the demo voltage divider or not.

To reuse a layout from a module:

  • run an ato build, to make sure the layout syncs with the code
  • hit the “Sync Group” button in the KiCad plugin
  • select the group you want to sync, and hit the “Pull” (Down arrow) button to pull the layout from the module’s KiCad layout file

The ato compiler will map layouts with a class or super-class that has a build.

The RP2040Kit in the example is the class, and the ato.yaml config file in the rp2040 package means that there’s a layout associated with it.

If you want to create a reusable layout for a class of your own, the easiest way is to add a new build config with ato create build, and then point the newly created entry at the module you’ve made.

Layout the rest of your design

Use KiCad to place-and-route the rest of your design, just like if you got it from the schematic editor.

If you can’t find the quality of KiCad docs you need to get started, drop a comment or upvote on this GitHub Issue !882

Auto-layout :rocket:

atopile can do small bits of auto-layout for you, but it’s not fully exposed to ato yet.

If this is a feature that’d super-charge your workflow, please come vote and discuss it in the GitHub Discussion.