gEDA-dev: get pin attribute by pinseq

Stuart Brorson sdb at cloud9.net
Tue Apr 24 08:44:23 EDT 2007


Hi Ales --

>>> 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.
>>
>
> I'm not so convinced that option #1 is the way to go.  There might be
> places that assume that the pinseq values are constants.  However,
> perhaps this would be okay for slotted parts.  I would look at
> o_attrib_slot_update in libgeda/src/o_attrib.c for where the pinnumbers
> get updated based on the slotdef attribute.

Yes, I've been looking in there for the last day or two.  I think what
I will do is not only update pinnumber= in o_attrib_slot_update, but
also update pinseq=, and allow for higher numbers in this attrib.
I'll make the update do some type of modulo arithmetic when first
looking for the pinseq attrib so that nothing changes for most programs.

> Option #2 is interesting too.  You might want to generalize it a little
> to be: given a set of attributes and a pinseq number, return the
> desired attribute.  Don't know if that would be useful to anybody else.
>
> Option #1 might be the best overall though.  Give it a shot and see
> what happens.

Will do!  Thanks!

Stuart




More information about the geda-dev mailing list