gEDA-dev: get pin attribute by pinseq

Stuart Brorson sdb at cloud9.net
Sun Apr 22 14:24:31 EDT 2007


Hi Ales --
On Sun, 22 Apr 2007, Ales Hvezda wrote:
[snip]

>> Meanwhile, get_attribute_by_pinseq seems to work for slot 1, which
>> means that pinseq info is somehow associated with the part (presumably
>> as attributes attached to the slot 1's pins).  But why not slot 2, 3,
>> 4....?
>
> How are you calling gnetlist:get-attribute-by-pinseq ?

I am calling it with pinseq numbers higher than the number of slotted
pins, hoping that gnetlist:get-attribute-by-pinseq would do a modulo
operation.  But no joy!

Then I started thinking about how slotted pins might be implemented in
gnetlist anyway.  Then I got confused and ran to geda-dev for help!
:-)

> You can only
> call it on pinseq numbers that are part of the component.  And slotted
> components do not have uniq pinseq numbers for different slots.

Indeed.

> Should libgeda generate a uniq pinseq for all slots of a slotted
> components?

This is the big question.  There are two ways I can get what I want:

1.  Suppose the part has 5 pins in each slot, and has 4 slots.  Then
allow pinseq = {1, 2, 3, 4, 5, 6, 7, 8, 9, .... 20} and have
get_attribute_by_pinseq do a modulo(pinseq, number_of_slotted_pins)
operation to figure out which pin is in question.

2.  Add another arg to get-attribute-by-pinseq calling out the slot.
Make it an optional arg; that is, if the user doesn't specify it, then
it is assumed to be 1.  In this case, pinseq can be {1, 2, 3, 4, 5}. 
Then gnetlist will use the slot and pinseq to figure out the desired pin.

Ummmm, if I were to attempt implementing option 1, where would I go
looking for the place to do it?

Stuart


More information about the geda-dev mailing list