[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: Schematic Level DRC DIscussion



Peter,

I have been putting one together as I modify g_smob.c, g_rc.c and
g_register.c

It is in an open office format and is very raw but attached is the
current version. Suggestions on what the API should look like are
allways welcome.

For example, your suggestion

"No. Special case-tastic. If anything, we could make an {s|o}_slot.c and
define slotting API there. Slots _use_ attributes, but aren't necessary
in the attribute API its-self."

Lead me to create a slot structure and an api for slots

//-----------------------------------------------------------------------------
/*
 * Peter Clifton suggested the seperation of the slot structure 
 * the attribute structure  
 */

struct st_slot
{
  int    reference_count;

  gchar  *name;

  GList  *entries;  // this is a list of SLOT_ENTRY pointers
                    // SLOT_ENTRY is a private structure of st_slot

  ATTRIB *attrib;   // this is a reference to the associated ATTRIB
};

and slot entries looks like

//----------------------------------------------------------------
// SLOT_ENTRY Prototypes

struct st_slot_entry
{
  int    pin_sequence;       
  gchar *pin_number;
};

SLOT_ENTRY *s_slot_entry_new();

void s_slot_entry_init(SLOT_ENTRY *this_slot_entry, int pin_sequence,
gchar *pin_number);

void s_slot_entry_free(SLOT_ENTRY* this_slot_entry);

SLOT_ENTRY *s_slot_entry_duplicate(SLOT_ENTRY *this_slot_entry);

void s_slot_entry_print(SLOT_ENTRY *this_slot_entry);



Thanks again,

Steve Meier


On Wed, 2007-11-07 at 23:32 +0000, Peter Clifton wrote:
> On Wed, 2007-11-07 at 14:32 -0800, Steve Meier wrote:
> > In the official geda version I don't.
> > 
> > In my stuff. Yep, heavily.
> > 
> > I have scripts for loading existing nets lists into the eda library,
> > other scripts for modifing the net based upon eco reports from pads. 
> > 
> > I am currently working on replacing the reading/writting of schematics
> > and symbols with guile scripts. 
> 
> I saw you mention that before, with some interest.. I'd suggested it to
> Peter Brett over dinner last week, as a possibility to help support
> different evolving file-formats, and for future import / export of non
> "native" format files. I'm glad to see there is actually going to be
> code to to this out there.
> 
> Do you have a guile API documented?
> 
> > >From my perspective this will allow a non-gui application to do every
> > thing from translate files, update files (version changes), implment
> > back anotation, run rule based design checks and generate net lists
> > (flat or hierarchical) vhdl or spice.
> 
> Sounds like a good direction to go in, it matches up with how I wanted
> to do online per "page" / "circuit" / (insert term here) net-listing in
> libgeda, and use gnetlist as just an exporter plugin framework for that.
> (Perhaps letting it take charge of merging a hierarchical design).
> 
> Best wishes,
> 
/* AKEDA - GPL Electronic Design Automation
 * Derivative of gEDA - GPL Electronic Design Automation
 * Copyright (C) 1998-2004 Ales V. Hvezda
 * Copyright (C) 2006,2007 Stephen F. Meier
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

/* s_slot.c */

/*
 * Peter Clifton suggested the seperation of the slot structure 
 * the attribute structure  
 */


#ifndef S_SLOT_H
#define S_SLOT_H

SLOT *s_slot_new( );

//----------------------------------------------------------------
// Use a pointer to the parent attribute s_slot_init will then ask 
// for it's own a reference

void s_slot_init(SLOT *this_slot, ATTRIB *parent_attrib);

void s_slot_free(SLOT* this_slot);

//----------------------------------------------------------------
// duplicate an slot.
// caller is responsible for destroying returnd slot

SLOT *s_slot_duplicate(SLOT *this_slot);

SLOT *s_slot_get_reference(SLOT *this_slot);

//----------------------------------------------------------------
// print a slot report.

void s_slot_print (SLOT *this_slot);

//----------------------------------------------------------------
// compare two slots to see if the have equivellent values

BOOL s_slot_compare(SLOT *first_slot, SLOT *second_slot);

//----------------------------------------------------------------
// for a list of SLOT (slot deffenitions) return a reference to the slot 
// which matches the slot number

SLOT *s_slot_find_slot_in_list(GList *slot_list, gint slot_number);

//----------------------------------------------------------------
// given a SLOT and a pinseq number find the replacement pin number
// caller is responsible for free the returned string

gchar *s_slot_get_pin_number(SLOT *this_slot, gint pinseq);


#endif

Attachment: guile_interface_rev0.01.odt
Description: application/vnd.oasis.opendocument.text


_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user