gEDA-dev: Diode symbols in GSchem and PCB
Stuart Brorson
sdb at cloud9.net
Fri Dec 15 08:14:10 EST 2006
>> The problem is that there is no attribute you can use as a pin
>> identifier:
>
> Well, let's make one! How about "pinname" ?
OK, Peter's comment about not using the pin position is well taken.
But I am not sure we need a new pin attribute label. Since pin
number swapping is all we want to do, we only need fool with the
pinnumber. Or am I wrong?
This being the case, another idea then would look like this: Let's
say you want to backanno a pin-swap between two pins, so 5 -> 7 and 7
-> 5. Here's snippets from the .sch and .sym files before:
-------------- <before> --------------
C 70200 44000 1 180 1 op1177-1.sym
{
T 70900 43400 5 10 1 1 180 6 1
refdes=UCurCtrl
T 70200 44000 5 10 0 1 0 0 1
model-name=OP1177
T 70200 44000 5 10 0 0 0 0 1
footprint=SO8
}
P 200 600 0 600 1 0 1
{
T 50 625 5 8 1 1 0 0 1
pinnumber=5
T 50 625 5 8 0 0 0 0 1
pinseq=1
T 200 600 5 10 0 1 0 0 1
pinlabel=IN+
}
P 200 200 0 200 1 0 1
{
T 50 225 5 8 1 1 0 0 1
pinnumber=7
T 50 225 5 8 0 0 0 0 1
pinseq=2
T 200 200 5 10 0 1 0 0 1
pinlabel=IN-
}
---------------- </before> ---------------
--------------- <after> ------------------
C 70200 44000 1 180 1 op1177-1.sym
{
T 70900 43400 5 10 1 1 180 6 1
refdes=UCurCtrl
T 70200 44000 5 10 0 1 0 0 1
model-name=OP1177
T 70200 44000 5 10 0 0 0 0 1
footprint=SO8
P 5
{
pinnumber=7
}
P 7
{
pinnumber=5
}
}
device=OP1177
P 200 600 0 600 1 0 1
{
T 50 625 5 8 1 1 0 0 1
pinnumber=5
T 50 625 5 8 0 0 0 0 1
pinseq=1
T 200 600 5 10 0 1 0 0 1
pinlabel=IN+
}
P 200 200 0 200 1 0 1
{
T 50 225 5 8 1 1 0 0 1
pinnumber=7
T 50 225 5 8 0 0 0 0 1
pinseq=2
T 200 200 5 10 0 1 0 0 1
pinlabel=IN-
}
--------------- </after> ------------------
The only change occurs in the .sym file, where the P line calls out
the old pinnumber in the .sym file, and the following line calls out
the new pin number. Note that I don't specify a position for the
attribute; that should be inherited from the lower level.
A side benefit is that "pinnumber" is already defined in all symbls I
looked at (a small number, admittedly). It is also checked for in
gsymcheck, so its presence is already enforced.
FWIW, I suppose one could use this scheme to attach other pin
attributes at the top level too, as long as the pinnumber exists at
the lower level. There's no reason you can't do this:
P 5
{
pinseq=3
pinbar=baz
T 100 500 5 10 1 1 0 0 1
pinfoo=woof
}
This does three things:
1. Replaces the existing pinseq with a new value 3 located at the
same position as the old one.
2. Replaces teh existing pinbar with a value baz located at the same
position as the old one.
3. Adds a new pin attribute "pinfoo" at the location specifed in the
text line above it.
But do we ever want to modify any other pin
attributes at the top level? That is, are there any other pin
attributes which end up in a netlist which we might want to change
later, and then backanno?
The above scheme is simple, and would work, I think. Or
am I wrong?
Stuart
More information about the geda-dev
mailing list