Re: gEDA-user: New autorouter high effort mode

2010-12-01 Thread Peter TB Brett
On Wednesday 01 December 2010 12:51:41 Kovacs Levente wrote:
> On Sat, 27 Nov 2010 08:53:38 +1100
> Stephen Ecob
> 
>  wrote:
> > For my HE autorouter hack I have in mind to fork() off extra processes
> > so that all of my CPU cores can run separate autorouter instances.  As
> > HE has an unbounded run time I'm thinking that the main PCB process
> > should simply hang on to the UI to serve occasional display update
> > requests from the other processes, and to kill off the auto routing
> > processes on user command.
> 
> I think it is enough to make multiple threads. They can run on different
> CPU cores. But I'm not usre.

On Linux and most BSDs, fork() with shared memory is actually cheaper than 
threading, and much much easier to implement.  Unfortunately, that is not true 
on Windows, where fork() is *very* expensive.  So most people use threads. :-/

   Peter

-- 
Peter Brett 
Remote Sensing Research Group
Surrey Space Centre


signature.asc
Description: This is a digitally signed message part.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-12-01 Thread Kovacs Levente
On Sat, 27 Nov 2010 08:53:38 +1100
Stephen Ecob
 wrote:

> For my HE autorouter hack I have in mind to fork() off extra processes
> so that all of my CPU cores can run separate autorouter instances.  As
> HE has an unbounded run time I'm thinking that the main PCB process
> should simply hang on to the UI to serve occasional display update
> requests from the other processes, and to kill off the auto routing
> processes on user command.

I think it is enough to make multiple threads. They can run on different CPU
cores. But I'm not usre.

Levente

-- 
Kovacs Levente 
Voice: +36705071002




___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-26 Thread Stephen Ecob
Oh, BTW, what are your thoughts for processes & threads with PCB+GL ?

For my HE autorouter hack I have in mind to fork() off extra processes
so that all of my CPU cores can run separate autorouter instances.  As
HE has an unbounded run time I'm thinking that the main PCB process
should simply hang on to the UI to serve occasional display update
requests from the other processes, and to kill off the auto routing
processes on user command.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-26 Thread Stephen Ecob
On Fri, Nov 26, 2010 at 11:30 PM, Peter Clifton  wrote:

> How to you get it to draw updates as the auto-router progresses?

Actually, I disable draw updates during each individual run of the
autorouter using the usual LIVEROUTEFLAG + HID_LIVE_DRAWING mechanism.
I only update the display when a superior routing result arrives - so
display updates are often minutes apart.  I update the display from my
high effort code in action.c by calling:

  DeleteRats (false /*all rats */ );
  AddAllRats (false /*all rats */ , NULL);
  ClearAndRedrawOutput ();  

I also added an extra parameter to the autorouters to conditonally
avoid refreshing the rats at the conclusion of each pass, as this
results in a display update.

> PCB's current auto-router does really evil things when you ask it to do
> that (drawing without the GUI necessarily being in an appropriate
> state).

Yes, but at least the autorouter provides an option to disable live
updates.  The trace optimiser and "rip up all autorouted racks" have
no option like this, and they run orders of magnitude slower because
of their live display updates.  I find myself constantly hiding my
copper and via layers - which allows them to run at full speed.

> This is something I'll really need to fix before pushing the PCB+GL
> code, as we hit _all sorts_ of nasty errors / crashes in various GL
> libraries if we try drawing whilst the GL context isn't set up.

It would be great to have a uniform mechanism for handling display
update disabling/enabling for all parts of the code that make lots of
fast changes to the layout (the autorouters, trace optimiser, rip up
all tracks, ...)

> What I'm saying - is that I'll probably end up breaking whatever method
> you use, but if we can cooperate, I'll try and do it in a way which
> isn't so hard to fix ;)

Great! I'm looking forward to using PCB+GL - particularly transparency :)


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-26 Thread Peter Clifton
On Fri, 2010-11-26 at 15:07 +1100, Stephen Ecob wrote:
> On Fri, Nov 26, 2010 at 1:50 AM, Hannu Vuolasaho  wrote:
> >   I'm waiting to see some screencasts (resistor pr0n again) how this is
> >   working but I was wondering is it possible to run HE autorouter to
> >   optimize vias?
> 
> Since you ask!
> 
> http://commons.wikimedia.org/wiki/File:HighEffortDemo1.ogv
> 
> http://commons.wikimedia.org/wiki/File:HighEffortDemo2.ogv

How to you get it to draw updates as the auto-router progresses?
PCB's current auto-router does really evil things when you ask it to do
that (drawing without the GUI necessarily being in an appropriate
state).

This is something I'll really need to fix before pushing the PCB+GL
code, as we hit _all sorts_ of nasty errors / crashes in various GL
libraries if we try drawing whilst the GL context isn't set up.

What I'm saying - is that I'll probably end up breaking whatever method
you use, but if we can cooperate, I'll try and do it in a way which
isn't so hard to fix ;)

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)



___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-26 Thread Stephen Ecob
On Fri, Nov 26, 2010 at 6:10 PM, Hannu Vuolasaho  wrote:
>   > And yes, I'll make a change before my next commit so that
>   optimisation
>   > for minimum vias is also possible.
>   Beatiful. I so see how one takes all the PCB files, exports jpg and
>   makes them video. Very hot stuff in product presentations for
>   management what has been done before the prototype is given to hand.
>   BTW Did autorouter its job finally and got all nets traced?

Yes :)

http://commons.wikimedia.org/wiki/File:HighEffortDemo3.ogv

I've also pushed a new commit to git that adds the option to optimise
for fewest vias instead of shortest tracks.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-25 Thread Hannu Vuolasaho
   > Date: Fri, 26 Nov 2010 15:07:59 +1100
   > From: silicon.on.inspirat...@gmail.com
   > To: geda-user@moria.seul.org
   > Subject: Re: gEDA-user: New autorouter high effort mode
   > Since you ask!
   >
   > http://commons.wikimedia.org/wiki/File:HighEffortDemo1.ogv
   >
   > http://commons.wikimedia.org/wiki/File:HighEffortDemo2.ogv
   >
   > And yes, I'll make a change before my next commit so that
   optimisation
   > for minimum vias is also possible.
   Beatiful. I so see how one takes all the PCB files, exports jpg and
   makes them video. Very hot stuff in product presentations for
   management what has been done before the prototype is given to hand.
   BTW Did autorouter its job finally and got all nets traced?
   Hannu Vuolasaho


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-25 Thread Stephen Ecob
On Fri, Nov 26, 2010 at 1:50 AM, Hannu Vuolasaho  wrote:
>   I'm waiting to see some screencasts (resistor pr0n again) how this is
>   working but I was wondering is it possible to run HE autorouter to
>   optimize vias?

Since you ask!

http://commons.wikimedia.org/wiki/File:HighEffortDemo1.ogv

http://commons.wikimedia.org/wiki/File:HighEffortDemo2.ogv

And yes, I'll make a change before my next commit so that optimisation
for minimum vias is also possible.

>   This might be good solution for getting smaller PCBs. Usually I make my
>   first prototype with huge board and a lot of testpoints after verifying
>   it I start to make smaller.
>   I'm still running stable version since I fear to break my design
>   process with devel versions so I'm just curious.

That's wise :)

Stephen


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-25 Thread Hannu Vuolasaho
   > Date: Thu, 25 Nov 2010 21:39:28 +1100
   > From: silicon.on.inspirat...@gmail.com
   > To: geda-user@moria.seul.org
   > Subject: Re: gEDA-user: New autorouter high effort mode
   >
   > >
   > > Yes, I'm working on a fix for these problems.
   >
   > These problems are now solved with my most recent git push.
   > It also now updates the display every time a better result is found,
   > so you can see what's going on more clearly.
   I'm waiting to see some screencasts (resistor pr0n again) how this is
   working but I was wondering is it possible to run HE autorouter to
   optimize vias?
   This might be good solution for getting smaller PCBs. Usually I make my
   first prototype with huge board and a lot of testpoints after verifying
   it I start to make smaller.
   I'm still running stable version since I fear to break my design
   process with devel versions so I'm just curious.
   Hannu Vuolasaho


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-25 Thread Stephen Ecob
>> Moreover, it uses layers which are disabled.
>> And one thing - even if I select thicker traces (for example Power), it
>> still uses default thickness (Signal).
>
> Yes, I'm working on a fix for these problems.

These problems are now solved with my most recent git push.
It also now updates the display every time a better result is found,
so you can see what's going on more clearly.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-24 Thread Stephen Ecob
On Thu, Nov 25, 2010 at 9:38 AM, Jan Martinek  wrote:

> Yes, now it works :-) I tried to run the autorouter, but it ate all my
> memory after several minutes.

Yes, for the PCB I'm currently working on I lose around 1MB per run of
the autorouter.
I set up the dmalloc library to investigate, but unfortunately just
starting PCB + loading a pcb + loading another pcb + quitting yields
memory leaks from the following sources:

hid/common/actions.c:269'
hid/common/actions.c:46'
hid/common/flags.c:41'
hid/common/flags.c:71'
hid/common/hidinit.c:171'
hid/common/hidinit.c:250'
hid/common/hidinit.c:659'
hid/common/hidinit.c:688'
hid/gtk/gtkhid-gdk.c:352'
hid/gtk/gui-log-window.c:150'
hid/gtk/gui-top-window.c:266'
hid/gtk/gui-top-window.c:2997'
hid/gtk/gui-top-window.c:3005'
hid/gtk/gui-top-window.c:3034'
hid/gtk/gui-top-window.c:3042'
hid/gtk/gui-top-window.c:3306'
hid/gtk/gui-top-window.c:3695'
main.c:780'
main.c:790'
main.c:800'
main.c:810'
main.c:820'
misc.c:1704'
mymem.c:663'
mymem.c:707'
parse_l.c:2232'
res_lex.c:1857'
rtree.c:453'
rtree.c:455'
rtree.c:762'
rtree.c:835'
rtree.c:992'
strflags.c:169'
strflags.c:169'
strflags.c:171'

Unfortunately there are far too many leaks in PCB for any quick solution :(

> Moreover, it uses layers which are disabled.
> And one thing - even if I select thicker traces (for example Power), it
> still uses default thickness (Signal).

Yes, I'm working on a fix for these problems.

> But it looks very promising, though. For my circuit it found solutions I
> have never seen before.

Great!


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-24 Thread Jan Martinek

On 11/24/2010 09:29 PM, Stephen Ecob wrote:

On Thu, Nov 25, 2010 at 2:59 AM, DJ Delorie  wrote:


The menus are defined by a resource file, you might have one in ~/.pcb
that overrides the freshly-installed version.


Oh, my mistake: I forgot to commit my changes to the resource file
src/gpcb-menu.res
I've now done a git push that adds this file. Jan - if you do a git
pull you'll get this file.  A recompile shouldn't be necessary, but as
DJ said do watch out if you have multiple copies of gpcb-menu.res on
your computer - PCB may end up looking at the wrong one.

Stephen



Yes, now it works :-) I tried to run the autorouter, but it ate all my 
memory after several minutes. Moreover, it uses layers which are 
disabled. And one thing - even if I select thicker traces (for example 
Power), it still uses default thickness (Signal).
But it looks very promising, though. For my circuit it found solutions I 
have never seen before.


Jan


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-24 Thread Stephen Ecob
You can tell which resource file PCB is using for its menus by opening
the "Window -> Message Log" window after start up.  You'll see
something like this:

Loading menus from /usr/local/share/pcb/gpcb-menu.res

or

Using default menus   (if it can't find a menu resource file)

My updated gpcb-menu.res has a few extra lines that add three new
entries to the Settings menu for the new autorouter features..
One option is to copy my modified gpcb-menu.res over your existing
one.  This will let pcb-see work.  Main-line versions of PCB that use
the modified gpcb-menu.res will display the new menu entries, but they
will not do anything.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-24 Thread Stephen Ecob
On Thu, Nov 25, 2010 at 2:59 AM, DJ Delorie  wrote:
>
> The menus are defined by a resource file, you might have one in ~/.pcb
> that overrides the freshly-installed version.

Oh, my mistake: I forgot to commit my changes to the resource file
src/gpcb-menu.res
I've now done a git push that adds this file. Jan - if you do a git
pull you'll get this file.  A recompile shouldn't be necessary, but as
DJ said do watch out if you have multiple copies of gpcb-menu.res on
your computer - PCB may end up looking at the wrong one.

Stephen


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-24 Thread DJ Delorie

The menus are defined by a resource file, you might have one in ~/.pcb
that overrides the freshly-installed version.


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


Re: gEDA-user: New autorouter high effort mode

2010-11-24 Thread Jan Martinek



On 11/24/2010 12:11 AM, Stephen Ecob wrote:

Hi all,

I've just pushed an update to my branch of PCB which provides a new
autorouter high effort mode.

What does it achieve?
It wrings a few extra drops of goodness out of the autorouters.
Typically it will route a few extra tracks.  Useful if the autorouter
is almost doing the job, but leaving a handful of tracks unrouted.
Very useful if you're finishing work for the day and your computer has
nothing better to do all night.



Hi,

I am really happy to hear about it, thank you! I successfuly compiled 
your branch:


$ ./pcb --version
PCB version 1.99see

but the Settings menu is still the same as in the official version.



What's the work flow ?
0. Back up your PCB.  WARNING: At the end of this work flow you will
manually kill PCB (ctrl-C) without an opportunity to save.
1. Start PCB from a command shell, you'll need it to read status information
2. Set "Settings ->  Autorouter high effort"
3. Select at least one autorouter with "Settings ->  Disable 2008
autorouter" and "Settings ->  Disable default autorouter"


I cannot find these settings. Did I miss some compile-time options?

regards,
Jan Martinek


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user


gEDA-user: New autorouter high effort mode

2010-11-23 Thread Stephen Ecob
Hi all,

I've just pushed an update to my branch of PCB which provides a new
autorouter high effort mode.

What does it achieve?
It wrings a few extra drops of goodness out of the autorouters.
Typically it will route a few extra tracks.  Useful if the autorouter
is almost doing the job, but leaving a handful of tracks unrouted.
Very useful if you're finishing work for the day and your computer has
nothing better to do all night.

How does it work?
It's a brute force hack.  It sits in an infinite loop repeatedly
running the autorouters, but each run it slightly tweaks the cost
function so that the routing ends up different.  You can use it to
burn CPU cycles to get slightly better autorouting.

Quality ?
No.
It's a brute force hack.  Make copies of your board before using the
hack.  If the hack produces useful results it's safe to take them back
to a stable version of PCB.

What's the work flow ?
0. Back up your PCB.  WARNING: At the end of this work flow you will
manually kill PCB (ctrl-C) without an opportunity to save.
1. Start PCB from a command shell, you'll need it to read status information
2. Set "Settings -> Autorouter high effort"
3. Select at least one autorouter with "Settings -> Disable 2008
autorouter" and "Settings -> Disable default autorouter"
4. Start autorouting (from the "Connects" menu)
5. Wait for status messages in the shell.  They look something like this:

2008FFF routed 208 nets and 332.681560".
2008AFF best yet with 208 nets and 329.589900".
2008BFF best yet with 208 nets and 328.583180".
2008CFF best yet with 208 nets and 328.471335".
2008DFF 208 nets and 328.515675".
2008EFF best yet with 208 nets and 328.347530".
2008GFF 207 nets and 330.267000".
2008HFF 207 nets and 337.805590".
2008IFF 206 nets and 327.564940".
2008JFF 206 nets and 328.720400".
2008KFF 207 nets and 328.265705".
2008EAF 207 nets and 325.139955".
2008EBF best yet with 209 nets and 326.294555".
2008ECF 208 nets and 329.716525".
2008EDF 207 nets and 327.660495".
[...]
2008EBHGHFF 209 nets and 335.422395".
2008EBHGIFF 208 nets and 328.476840".
2008EBHGJFF best yet with 210 nets and 331.878480".

6. Each time is says "best yet ..." a routed copy of your PCB will be
saved with a matching file name, eg myboard-2008EBHGJCF.pcb
7. Ctrl-C in the shell to kill PCB when you're happy with the results
or have run out of patience.

What is this "2008 autorouter" ?
PCB's autorouter underwent a major rewrite in 2009.  This made it work
better in many cases, but in some cases the older version works
better.  My branch of PCB includes both versions.  I often try both
autorouters and keep the best results.

How to get it?
git clone git://repo.or.cz/geda-pcb/see.git
cd see
./autogen.sh
./configure
make
src/pcb

Enjoy!

Stephen Ecob


___
geda-user mailing list
geda-user@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user