1 # gaf.netlist - gEDA Netlist Extraction and Generation
2 # Copyright (C) 1998-2010 Ales Hvezda
3 # Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details)
4 # Copyright (C) 2013-2020 Roland Lutz
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software Foundation,
18 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 # Netlister for GOSSIP system simulation system
21 # For more info see http://gossip.sourceforge.net
24 f
.write(';; Gossip Netlist Created by gNetlist\n')
26 f
.write(';; Created By Matt Ettus <matt@ettus.com>\n')
27 f
.write(';; Libraries:\n')
31 for package
in reversed(netlist
.packages
):
32 lib
= package
.get_attribute('library', 'unknown')
34 package
.warn("does not have a library attribute")
38 f
.write('(use-library %s *)\n' % lib
)
41 blockname
= netlist
.get_toplevel_attribute('blockname', 'not found')
42 f
.write('(define-block (%s (\n' % blockname
)
43 f
.write('(signals (%s))\n' % ' '.join(
44 net
.name
for net
in reversed(netlist
.nets
)))
46 for package
in reversed(netlist
.packages
):
48 f
.write(package
.refdes
)
52 if str(i
) not in package
.pins_by_number
:
54 pin
= package
.pins_by_number
[str(i
)]
55 pinname
= pin
.get_attribute('label', None)
59 f
.write(' :%s ' % pinname
)
61 if not pin
.net
.is_unconnected_pin
:
64 f
.write('Not Connected')