Hi Ales and others who care about gschem internals,

So I've been hacking away and am actually getting to where the pcb major
mode for gschem is close to working the way I want (or at least parts of
it).

As part of this, I've added a couple of scheme functions and I wanted to
run it by you to see if you are ok with the names and also where (if
anywhere besides the .nw files) I should add some documentation about them.

The functions are:

gschem-log msg -- writes the 'msg' to the gschem log
gschem-msg msg -- displays the 'msg' in a dialog box with an OK button
gschem-confirm msg -- displays the 'msg' in a dialog box with an OK and
                      cancel button.  Returns #t on OK and #f on cancel.

Examples are

(gschem-log "launching pcb\n")
(gschem-msg "About pcb-mode for gschem text here\n")
(if (gschem-confirm "Really do <x>?")
    ;; do <x>
)


I have been using "pcb:...." for all variables and functions in pcb.scm.
 I'm thinking that this will help keep the namespace reasonable.  For
example I have things like

(define pcb:pcb-cmd "pcb")
(define (pcb:about)
  ;; code here
)


For those who may not know what I'm working on here, I'm trying to
implement "major modes" for gschem sort of like what emacs has.  I'm
starting with a pcb mode and I'm hoping maybe others will come along
with a spice mode.

The way it works is at the end of your gschemrc, you just load a pcb.scm
file (which is still in progress) and it provides an extra menu in
gschem.  In this menu, there are things like "launch pcb" and "run
gsch2pcb".  When you start PCB via this menu, PCB is opened as part of a
pipe and gschem can send action commands to PCB.  Via the hooks which
are in gschem, I have implemented cross probing from schematic to
layout.  By this I mean, if you select an element in the schematic,
gschem will issue a Select(ElementByName, name) action to PCB and cause
PCB to select the same element.  Currently the only thing I've
implemented here is the selecting an deselecting of elements.

Some of the unresolved issues that I'd like to figure out are:

- how can I let gschem know the name of the gsch2pcb project file?  I
have a PCB->run gsch2pcb menu choice, but right now it just runs
gsch2pcb with no arguments which just gives you help text.  Should this
go into a gafrc file in your project directory maybe?  If so, I should
probably have a way to change that name and have gschem write it back out.

- same comments about letting gschem know about the layout file name.

- how to have gschem detect what gsch2pcb did and issue the appropriate
actions to pcb to load new elements, load the new netlist, update pin
names, etc.

- how to let gschem access the net aliasing and refdes aliasing scheme
commands from gnetlist and the gnetlist backends.  I don't think pcb
currently uses this, but many other backends should.

- how to backannotate things like refdes renumbering from pcb to gschem

- how to backannotate simulation results to the schematic.  Maybe we put
some annotation attributes on components?  For example, put an
annotation attribute on each pin of each element and you could back
annotate the voltage at the pin or the current out of the pin from
spice.  For elements you might have multiple annotation attributes or
maybe just a multi-line annotation attribute so you could annotate back
a bunch of small signal parameters for a transistor (for example).

- more I'm sure


Comments?  Suggestions?

Thanks

-Dan

Reply via email to