
Adventures in Autorouting (2017) - luu
https://wp.josh.com/2017/10/23/adventures-in-autorouting/
======
sytelus
These are the type of articles that makes HN worth looking in to every once in
while :). The circuit routing is indeed worth $100M problem. And it's going to
remain unsolved in classical sense because its NP-Hard.

The reason this is very interesting problem is that basic version of the
problem is fairly easy to specify: You are given bunch of polygons, each with
few fixed points on it. You are also given series of sets, each containing
list of points that must be connected together. Can you come up with
connections that has minimum crossing with each other (see Wikipedia [1] for
more formal statement of routing problem).

The more practical version of the problem will include more constraints to
make sure the design meets timing, has no crosstalk problems, meets any metal
density requirements, does not suffer from antenna effects, and so on.

Recently Travelling Salesman Problem was attacked using reinforcement
learning[2] and that could be a good start to attack routing problem. I'll be
definitely looking in to this!

[1]
[https://en.wikipedia.org/wiki/Routing_(electronic_design_aut...](https://en.wikipedia.org/wiki/Routing_\(electronic_design_automation\))

[2] [https://arxiv.org/abs/1611.09940](https://arxiv.org/abs/1611.09940)

------
Hasz
Honestly, for small boards, autorouting just isn't worth the time. Once you do
a few layouts, it's very easy to see how everything can fit together.

Also, for some sensitive designs (boost, buck, high speed clock, memory
interface etc) you definitely don't want and autorouter doing it, at least the
ones that are available to hobbyists.

Would it be a time saver, sure. But for a board like that, we're talking ~15
minutes of saved time. There are much better optimizations to be made
(standardized parts libraries) that would save way more time.

~~~
CamperBob2
Nobody cares about autorouting trivial boards, but there are serious economic
incentives to turn 8+ layer boards into 6+ layer boards.

The author makes a strong point in comparing the autorouting problem to the
milestone achieved by Alpha Go in defeating some of the strongest human
players. These problems are similar enough that the same insights are likely
applicable to both.

The first time I ever heard the phrase "Monte Carlo tree search," it took me
about five seconds for me to start wondering if it might be applicable to PCB
routing.

~~~
aj7
No, comparison to Alpha Go was utterly naive. Where do you get the training
set? From thousands of proprietary boards you have full documentation of? The
physics rules for the aforementioned difficult tasks, EMI, stripline, race,
not to mention all the thermal and mechanical constraints for analog boards is
a PhD thesis or four to get the AI auto router to “play itself.”

~~~
davrosthedalek
Wouldn't it be enough to come up with a scoring function for the final routing
solution? E.g. number of violations in DRC/ERC + total number of vias +
absolute trace length.

------
dima586
Autorouting will not work for most things due to the requirement to meet EMC
standards. That board you created will not have any chance to pass EMC (at
least if it were an automotive product - I guess CE would fly).

------
hansc
For these simple designs (and more complicated ones), my experience shows me
that the problem has been solved with Eagle and a decent design rule file. I
have autorouted tens of 2-layer designs with between 5 and 200 components with
Eagle's autorouter and the seeedstudio .drc file as constraints. It's good and
quick, give it a try (would take a few sec <50 parts, couple of minutes >
100parts)!

BTW nobody professional uses curved traces (except very rare cases), have a
look at any electronics PCB

~~~
avianlyric
Is there a good reason that people don’t use curved traces anymore, except
that it easier for CAD software?

When traces where done by hand, they used to be curved and flowing, and
frequently looked very elegant. And occasionally you see a super high speed
design that’s a bit curvy today.

~~~
Gibbon1
I think the answer is the discontinuity you get from a sharp bend is smaller
than the highest frequency/wavelength in the signal. So you don't get any
reflections off it. The way I think is the length of the wave front heading
down the trace is much longer than the size of the bend. I think very high
speed stuff can start having trouble with via's.

I think curved traces were used make layout easier when running tape. Bending
the tape is easier than doing a cut to shift the trace over.

And safer, a problem with old tape layouts is it's easy enough to knock off a
small section of tape. Old draftsman I worked with would check the layout
against a blue print on a light table to make sure nothing was amiss before
making mods. He also got really antsy if anyone was rummaging around in the
drawers holding PCB layouts.

~~~
davrosthedalek
High speed designs definitely do not like corners, especially fast serial
interconnects are often problematic (they tend to have really high clocks),
think PCIe, USB3,...

------
apcragg
If it was going to take them 10 hours to manually route that small board, I
think the real problem is just that they are really bad at pcb design.

------
jhallenworld
Autorouting has been getting a bad rap because the autorouter in Altium is
total crap. It creates design rule errors while failing to route the board.

But there are good autorouters. Back in the 90s I had a license to PADS, so I
had access to Specctra and then Blaze. I still use the version of Blaze I
bought then (originally for Windows-98) today. It used for my relay computer:

[http://relaysbc.sourceforge.net/](http://relaysbc.sourceforge.net/)

It routes the entire board in about two minutes.

Unfortunately these tools are now very expensive ($6000).

------
omgtehlion
Topor is my go-to tool for small boards. I just start with manually tracing
power nets, the rest is autorouted.

Comparing to other routers, Topor gives results almost instantaneously. This
is really useful when placing parts: you try something, autoroute (no more
than tens of seconds), see result, tweak here and there then repeat.

idk about seriously big boards, but they have examples with mammoth BGA on
their site, so at least it is capable of routing those boards.

~~~
omgtehlion
P.S.: near the end of article author lists what autorouter should do and what
info (and freedom) we should give to the tool.

I think, the first show-stopper for 100% autorouted designs are power nets (of
course, not only power, there are a lot of other corner cases, like thermals,
but power is what you encounter right out of the door).

Router should know which nets handle (somewhat)high currents. And which
direction the current flows. You do not want your power amp supply rail routed
sequentially. And on the other side, not all power nets should be routed as
stars (sometimes there is only small power draw, and sometimes it is only
voltage sensing).

------
StavrosK
I understand the frustration, but I can't relate. For me, routing the board is
the most fun part. It's like a large puzzle that you have to solve, the result
of which is useful to boot!

I keep wanting to design PCBs pretty much just so I can do the routing! That's
for small, two-layer PCBs, though. If you had to do eight layers on a huge
PCB, I can see how you wouldn't want to be bothered.

------
buserror
I used to use freerouting a lot -- it's 'semi automatic' to be fair, you can
hint at stuff, and you need to configure it pretty carefully for it to do a
good job...

I used it as a 'first pass' routing, imported the result, deleted anything I
didn't like and manually did the rest. Still saves a bundle of time!

------
toomanybeersies
I've never worked with a board with curvy traces like that before, but I don't
think I'd like them. They look a lot harder to debug than straight traces with
90 and 45 degree angles.

~~~
sleavey
Some autorouters have options to only use 45 or 90 degree traces where
possible (in fact some of the examples in the link show this behaviour). In a
similar vein, I'd like to see an autorouter that also cares about ground plane
impedance and continuity: attempting to avoid ground plane islands or regions
where clearances prevent ground planes from separating tracks, and even trying
to keep ground planes associated with tracks in certain classes (e.g. high
speed vs power lines) separated, joining only at the external power supply
jack.

But, given the autorouting problem's NP hardness, especially when there are
extra constraints like above, I expect that manual routing for anything beyond
trivial layouts will continue to be the norm.

~~~
frahs
Can humans magically solve NP hard problems that computers can't? I don't
think so...

~~~
xorcist
Humans make use of the fact that the optimal solution is not necessary (or
probably even desirable, given the multitude of parameters to optimize for).
By heuristics we can find a good solution that is also understandable to
others.

~~~
setra
A computer can understand that an optimal solution is not always needed. There
is nothing about the problem being NP complete that means the computer HAS to
find the optimal solution.

------
cyounkins
If anyone is interested in working on a fan-out autorouter (and has been
before they saw this article), please shoot me an email! <username>@gmail.com

