gEDA setup and use notes

2019/04/19

I used many schematic capture tools but the one that always stuck with me was Concept from Cadence back in 1999-2006 (aka Allegro HDL Design Entry, example). Many aspects felt natural to me, including screen/page/UI design, keyboard and mouse assignments, command line entry, library management, ascii files and hence scriptable, library management, keyboard and mouse assignments, scriptable, library management, keyboard and mouse… :) For hobby/enthusiast level work, I tried open-source/free tools out there and even paid for commercial tools, but I always missed Concept. This search was over when I found out about gEDA gschem.

I tried gEDA several times in the past and always gave up. One time, I was trying to make a Linux Hardware Design distribution that had gEDA and version control tools + custom scripts that you can put on a server and use this server to manage hardware design as a team. It was going to have GUI/scripts for project and library management, as well as guide engineers thru the design -> release -> validation -> sustaining process. Basically, build an open-source version of Cadence flow :)

For PCB layout, I use PCB from gEDA because it integrates well. What I like about PCB is keyboard/mouse assignments, files being ascii, simple UI.

With RetroShield I forced myself to figure out the issues and make a work-flow for my future hardware projects. My notes below explain what I did and why I did.

gEDA-Project

The main project website:

gEDA Project Website

gEDA setup

http://wiki.geda-project.org/geda:download

I recommend using gEDA on Linux. You will have the latest version and good community support. Experimental files are available for Windows, but frankly do yourself a favor and use Linux.

gEDA resources

Some useful links:

Design Flow

I worked on many commercial products, with volumes ranging from a few tens of units to millions of units. Overall the process is the same; you start with an idea, do some investigation and then build a bunch of hardware/software versions, do a lot of testing, make sure you can replicate the design (i.e.manufacturing), ship the product, and then wait for / monitor customer feedback. After a while, you decide on what to do next, and repeat the process.

Phase Explanation Comments
Idea features, cost, schedule (new experience for people, solve a problem, better quality, lower cost, faster, etc.)
Investigation learn about new or risky stuff you want to use and maybe build small pieces to try, experience, and/or validate
Proto prototype build something close to the final product features or even form to do data-collection + user + system-level testing among team members.
EVT engineering validation build final (or candidate) product form and validate engineering designs (electrical, mechanical, battery, preliminary certification requirements, etc.)
DVT design validation build final product at a slightly higher volume and test at system-level as well as look for corner case (1%) issues (validate fixes from evt, system power consumption, thermals, emissions, certification, hardware/software tuning, app validation, etc.)
PVT production validation can your factory line produce replicas of what you intend to build? with acceptable yields? Also, build a higher volume to look for 0.01% problems.
MP mass production start building and packaging. Replicate and validate more factory lines to meet the volume requirements.
Sustaining after mp, there might be changes to the design because of component changes (second source or end-of-life), more 0.01% problems, vendors going out of business, software updates, new geographic regions (requiring new certification), factory-line quality/yield issues (new manufacturing, etc.)

“app validation” at DVT phase is an interesting task. It’s not about testing software UI, but testing software configures hardware correctly. For example, on your computer, the CPU will change clock frequency frequently :) as system load changes. In addition to the frequency, the power supply output voltage to CPU is also adjusted to save power. These changes need to be done together in a specific order. Assume cpu clock frequency is low and we need to go to a higher clock frequency: we first need to raise the voltage, delay X ms for power output to stabilize, and then change the cpu frequeny to higher setting. If this delay is not done or not long enough, you will encounter random crashes and good luck solving those quickly. So we need to validate software that touches hardware and either verify it is done correctly, or fix hardware.

“App validation” is very critical in RetroShield, since software is what makes hardware tick :)

Project Folder Setup

To support the above flow, I came up with the following folder structure.

bin/                # scripts go in here.
docs/               # various documents saved here.
hardware/           # boards are saved under individual folders.
  - k65c02/
  - k6809e/
  - kz80/
manufacturing/      # once a design is released to fab, it is copied for future reference.
  - Proto
  - EVT
  - EVT2
  - DVT
validation/         # validation results saved under each board rev.
  - Proto
  - EVT
  - DVT
  - DVT2
LICENSE.md
README.md

gEDA Setup

Now we’ll focus on one hardware board. I reordered files to explain better:

k65c02.sch
k65c02.pcb
symbols/
    65c02-1.sym
    megahdr2x18-1.sym
    osha-logo-svg
gafrc
project
makefile

Where to save Symbols

For a long time, I used to have a global symbols directory where I kept my symbols and every project pointed to that location. Recently, I changed my mind about this. I now copy symbols to a sub-folder within the project.

The benefit is I can zip a project folder and I have everything I need to do open it, work on it, and share it. I can even move it to another folder or drive or even computer and it will still work. Some ecad tools have an option to copy symbols into the sch or pcb file or generate an archive file, so in a way I’m doing that manually.

The drawback is the symbol files are replicated. If you modify one, you may need to copy it to other projects (sometimes you don’t want that because the pins move around and this may break older schematics). I don’t like this redundancy, maybe a script that compares the local symbols with a global location and report what’s different could help.

Makefile

I found a similar makefile online and modified to the following:

Let’s go over the makefile line by line:

TARGET = k65c02
PCBAPP = pcb
RENAMEPCB = ../../bin/renamepcb
MYDATE = $(shell date +'%Y_%m%d_%H%M%S')

These are easy to follow.

gerber:
    mkdir -p gerbers
    cp $(TARGET).pcb gerbers/
    cd gerbers/; pcb -x gerber --all-layers $(TARGET).pcb 
    $(RENAMEPCB) gerbers
    rm ./gerbers/$(TARGET).pcb
    zip $(TARGET)_gerbers.zip gerbers/*

Gerbers are created in a local folder (gerbers/) and also zipped in the root folder (xxx_gerbers.zip). You can review individual files w/ gerbv application, and/or send the zip file to the fab house to build your design.

backup:
    mkdir -p ./archive/sch
    mkdir -p ./archive/pcb
    cp $(TARGET).sch ./archive/sch/$(TARGET)_$(MYDATE).sch
    cp $(TARGET).pcb ./archive/pcb/$(TARGET)_$(MYDATE).pcb

It’s good idea to save backups from time to time or before making major changes, so make backup copies current sch and pcb files into archive folder w/ date+time stamps.

That’s about it. My daily use usually involves make backup to backup daily, then make sch, make to generate netlist, and make pcb to edit changes.

Schematics

gschem screenshot

I love using gschem because everything is accessible via 1 or 2 key presses. It reminds me Concept from Cadence. For example, V-E, will zoom fit. V-W will change background to white. I suggest looking thru the gEDA wiki page to learn about shortcuts.

symbol attributes

I use the following attributes as needed (values will be visible in the schematic).

PCB

gschem screenshot

I enjoyed using PCB as well. Similar to gschem, key short-cuts work great and I can pan using right-mouse button. I had several issues along the way and support from mailing list and the designer was very good.

There is a fork of PCB, called pcb-rnd. I plan to give it a try. This app is in constant development and things like UI might change.

Other tools

I really wanted kicad to work for me but I could not get over the library management process around creating new symbols. Otherwise it has great features like being all-in-one solution and 3d capability.