gEDA-dev: Broken slotting

Stuart Brorson sdb at cloud9.net
Tue Sep 11 07:58:47 EDT 2007


Peter --

As the author of the offending code, let me say "thank you" for
cleaning it up.

My memory is faulty, but IIRC, the code was crafted to fix a bug
having to do with spice-sdb's (actually gnetlist's) handling of
slotted parts.  The problem was that gnetlist originally couldn't deal
with generating pinseqs for slotted parts because it only iterated
over the first slot.  Or something like that.  The issue is that
spice-sdb uses the pinseq attribute to know which pin to emit while
generating SPICE netlists.

Therefore, when you're done hacking, please rerun the test suite
located under gnetlist/tests/spice-sdb.  There are some regression
tests specifically in there which verify that spice-sdb emits the
correct pins for a slotted part.

If you want me to do anything more -- like clean up any mess I made --
please let me know!

Thanks again,

Stuart





On Tue, 11 Sep 2007, Peter Clifton wrote:

>
> On Tue, 2007-09-11 at 13:08 +0200, Gabriel Paubert wrote:
>>> ... = g_strdup_printf( "pinseq=%d", numpins*(slot-1)+pin_counter );
>>
>> Looks fine, I did not know about that function, but why the "pinseq="
>> in the format? It was not in the original one.
>
> A couple of lines down, _another_ block of memory was allocated which
> had room enough for the pinseq= and the length of the number which the
> original line would print. They are then stuck together in this string.
>
>>> Not a big problem, I just wanted to confirm other developers thought
>>> this was the right fix (for now at least).
>>
>> Probably, but you know the code much better than me.
>
> When it comes to that attrib handling my knowledge isn't particularly
> good. I know the data-structures and such, but the API is a mess.
>
> 33+ functions, with a good number sharing VERY similar functionality.
> Its on my "TODO" list to re-factor shared functionality, and (if
> absolutely necessary) keep the old APIs as wrappers.
>
> For an example of a section of the API list:
>
> ATTRIB *o_attrib_search(GList *list, OBJECT *item);
> OBJECT *o_attrib_search_string_list(OBJECT *list, char *string);
> OBJECT *o_attrib_search_string_single(OBJECT *object, char *search_for);
> OBJECT *o_attrib_search_attrib_value(GList *list, char *value, char *name, int counter);
> OBJECT *o_attrib_search_pinseq(OBJECT *list, int pin_number);
> char *o_attrib_search_slotdef(OBJECT *object, int slotnumber);
> char *o_attrib_search_string_partial(OBJECT *object, char *search_for, int counter);
> char *o_attrib_search_name(OBJECT *list, char *name, int counter);
> char *o_attrib_search_attrib_name(GList *list, char *name, int counter);
> char *o_attrib_search_toplevel(OBJECT *list, char *name, int counter);
> char *o_attrib_search_name_single(OBJECT *object, char *name, OBJECT **return_found);
> char *o_attrib_search_name_single_count(OBJECT *object, char *name, int counter);
> char *o_attrib_search_slot(OBJECT *object, OBJECT **return_found);
> char *o_attrib_search_numslots(OBJECT *object, OBJECT **return_found);
> char *o_attrib_search_default_slot(OBJECT *object);
> char *o_attrib_search_toplevel_all(GedaPageList *page_list, char *name);
> char *o_attrib_search_component(OBJECT *object, char *name);
> void o_attrib_slot_update(TOPLEVEL *toplevel, OBJECT *object);
> void o_attrib_slot_copy(TOPLEVEL *toplevel, OBJECT *original, OBJECT *target);
>
>
> Regards,
>
> Peter
>
>
>
>
> _______________________________________________
> geda-dev mailing list
> geda-dev at moria.seul.org
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev
>


More information about the geda-dev mailing list