Mail Archives: geda-user/2015/07/14/00:26:18
--Apple-Mail=_35011E12-23A7-49D2-983D-1770828155BB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=windows-1252
On Jul 13, 2015, at 9:16 PM, Kai-Martin Knaak <kmk AT familieknaak DOT de> =
wrote:
> It gets painful once you try to build a library that other users can=20=
> just use. Currently, there is place to keep all the necessary=20
> information about a specific component. In particular, the=20
> many-to-many-many relation between symbols, footprints and values must=20=
> be managed in the head of the user.=20
Part of the footprint problem is that the actual footprint name depends =
on a number of aspects of the downstream flow. Fussy design rules use =
different footprints for resistors and capacitors in the same nominal =
package, for example. Different tools use different names.
Here=92s a script that can alias footprints in gnetlist:
--Apple-Mail=_35011E12-23A7-49D2-983D-1770828155BB
Content-Disposition: attachment;
filename=map-footprints.scm
Content-Type: application/octet-stream;
name="map-footprints.scm"
Content-Transfer-Encoding: 7bit
;;; gEDA - GPL Electronic Design Automation
;;; map-footprints.scm - Change footprint names for a particular downstream flow
;;; Copyright (C) John P. Doty
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program 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 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.
;; Load this file into gnetlist using the -m flag
;; Then load the footprint list with -m as well
(use-modules (srfi srfi-1))
;; Constructor for list of footprints
(define footprint-list '())
(define (footprint-name . x)
(set! footprint-list (cons x footprint-list)))
;; Wrap gnetlist:get-package-attribute
(define footprint-map-wrapped-gpa gnetlist:get-package-attribute)
(define (gnetlist:get-package-attribute refdes attribute)
(let ((value (footprint-map-wrapped-gpa refdes attribute)))
(if (equal? attribute "footprint")
(map-footprint
(footprint-map-wrapped-gpa refdes "device")
value)
value)))
;; Find the footprint map entry or #f
(define (find-footprint device footprint)
(find (lambda (x)
(and (equal? device (car x)) (equal? footprint (cadr x))))
footprint-list))
;; Extract the mapped footprint name from the entry or not
(define (map-footprint device footprint)
(let ((f (find-footprint device footprint)))
(if f (caddr f) footprint)))
--Apple-Mail=_35011E12-23A7-49D2-983D-1770828155BB
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
And an example of a list of aliases for a particular flow:
--Apple-Mail=_35011E12-23A7-49D2-983D-1770828155BB
Content-Disposition: attachment;
filename=example-footprints.scm
Content-Type: application/octet-stream;
name="example-footprints.scm"
Content-Transfer-Encoding: 7bit
;;; gEDA - GPL Electronic Design Automation
;;; example-footprints.scm - Footprint names for a particular downstream flow
;;; Copyright (C) John P. Doty
;;;
;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.
;;;
;;; This program 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 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.
;; First load map-footprints.scm into gnetlist using the -m flag
;; Load this file into gnetlist using the -m flag
(footprint-name "RESISTOR" "0603" "RESC1608X55N")
(footprint-name "RESISTOR" "0805" "RESC2012X70N")
(footprint-name "RESISTOR" "1206" "RESC3216X84N")
(footprint-name "RESISTOR" "2010" "RESC5025X70N")
(footprint-name "RESISTOR" "2512" "RESC6332X70N")
(footprint-name "CAPACITOR" "0505" "CAPC1414X145N")
(footprint-name "CAPACITOR" "0603" "CAPC1608X87N")
(footprint-name "CAPACITOR" "0805" "CAPC2012X135N")
(footprint-name "CAPACITOR" "1206" "CAPC3216X190N")
(footprint-name "CAPACITOR" "1812" "CAPC4532X270N")
(footprint-name "CAPACITOR" "2225" "CAPC5664X155N")
(footprint-name "POLARIZED_CAPACITOR" "2711" "CAPPC7234X317N")
(footprint-name "POLARIZED_CAPACITOR" "2915" "CAPMP7238X317N")
(footprint-name "DIODE" "DO213AA" "DIOMELF3517N")
(footprint-name "NPN_TRANSISTOR" "UB" "SOT95P237X122-3N")
(footprint-name "PNP_TRANSISTOR" "UB" "SOT95P237X122-3N")
(footprint-name "PNP_TRANSISTOR" "UB" "SOT95P237X122-3N")
(footprint-name "NMOS_TRANSISTOR" "TO252AA" "TO-252AA_GDS")
(footprint-name "PMOS_TRANSISTOR" "TO252AA" "TO-252AA_GDS")
(footprint-name "MMBFJ309" "SOT23" "SOT95P240X120-3N")
(footprint-name "LM195H" "TO39" "TO254P939H660-3")
(footprint-name "REFERENCE" "SO8" "SOIC127P600X175-8N")
(footprint-name "DUAL_OPAMP" "SO8" "SOIC127P600X175-8N")
(footprint-name "DG403" "SO16" "SOIC127P600X175-16N")
(footprint-name "MAX308CSE+" "SO16" "SOIC127P600X175-16N")
(footprint-name "AD5328" "TSSOP16" "SOP65P640X120-16N")
(footprint-name "MAX4594DCKR" "SC70" "SOT65P210X110-5N")
(footprint-name "MAX9180" "SC70-6" "SOT65P210X110-6N")
(footprint-name "ADA4805-1AKSZ" "SC70-6" "SOT65P210X110-6N")
(footprint-name "AD7984BRMZ" "MSOP10" "MSOP50P490X110-10N")
(footprint-name "DS26LV32A" "CFP16" "SOIC127P600X175-16N")
(footprint-name "Artix" "BGA484" "BGA484C100P22X22_2300X2300X260")
(footprint-name "2104D60M0000YAX" "FP14" "VECTRON_2104")
(footprint-name "LED" "0603" "LEDC1608X20N")
(footprint-name "EXC-3BB102H" "0603" "INDC1608X100N")
(footprint-name "IHLP5050FDER100M01" "IHLP5050" "IND_IHLP5050")
(footprint-name "MIL4922" "MIL4922" "INDM12861X584N")
(footprint-name "StackConn" "RC422-200-201-3900" "AIRBORN_RC422-200")
(footprint-name "HEADER14" "HEADER14SMT2MM" "MOLEX_87832-14")
(footprint-name "Header" "HEADER16" "FCI_95278-XXX-16LF")
(footprint-name "747467-1" "747467-1" "HARTING_DB9_09641227235")
(footprint-name "MDM9S" "MDM9S" "CONN_MDM-9S")
(footprint-name "TempConn" "MDM31P" "CONN_MDM-31P")
(footprint-name "Flexprint" "NK-2M2-051" "AIRBORN_NK-2M2-051")
--Apple-Mail=_35011E12-23A7-49D2-983D-1770828155BB
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
It might be better to have map-footprints read TSV or similar rather =
than defining the aliases with S-expressions.
John Doty Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd AT noqsi DOT com
--Apple-Mail=_35011E12-23A7-49D2-983D-1770828155BB--
- Raw text -