def run(f, netlist): net_aliases = util_alias.build_net_aliases( lambda net: net.name.replace('_', '-'), netlist.nets) for net in reversed(netlist.nets): f.write('/') f.write(net_aliases[net]) f.write('\t') f.write(wrap(''.join(' %s(%s)' % (pin.package.refdes, pin.number) for pin in reversed(net.connections)) + ';', 76, ',', ' '))
def run(f, netlist): net_aliases = util_alias.build_net_aliases( lambda net: net.name.replace('_', '-'), netlist.nets) for net in reversed(netlist.nets): f.write('/') f.write(net_aliases[net]) f.write('\t') f.write( wrap( ''.join(' %s(%s)' % (pin.package.refdes, pin.number) for pin in reversed(net.connections)) + ';', 76, ',', ' '))
def run(f, netlist): f = NewlineReplacer(f) # initialize the net-name aliasing # Convert to all upper case because Pads seems to do that # internally anyway and we'd rather do it here to catch shorts # created by not preserving case. Plus we can eliminate lots of # ECO changes that will show up during backannotation. net_aliases = util_alias.build_net_aliases( lambda net: net.name.upper(), netlist.nets) # initialize the refdes aliasing # Convert to all upper case because Pads seems to do that # internally anyway and we'd rather do it here to catch name # clashes created by not preserving case. refdes_aliases = util_alias.build_refdes_aliases( lambda package: package.refdes.upper(), netlist.packages) # print out the header f.write('!PADS-POWERPCB-V3.0-MILS!\n') f.write('\n') f.write('*PART*\n') # print out the parts for package in reversed(netlist.packages): pattern = package.get_attribute('pattern', None) # The above pattern should stay as 'pattern' and not 'footprint' if pattern is not None: f.write(pattern) # print out the refdes with aliasing f.write('%s\t%s\n' % (refdes_aliases[package], package.get_attribute('footprint', 'unknown'))) # print out the net information f.write('\n') f.write('*NET*\n') for net in reversed(netlist.nets): f.write('*SIGNAL* %s\n' % net_aliases[net]) f.write(wrap( ' ' + ' '.join( '%s.%s' % (refdes_aliases[pin.package], pin.number) for pin in reversed(net.connections)), 78, '', ' ')) # print out the footer f.write('\n') f.write('*END*\n')
def run(f, netlist): f = NewlineReplacer(f) # initialize the net-name aliasing # Convert to all upper case because Pads seems to do that # internally anyway and we'd rather do it here to catch shorts # created by not preserving case. Plus we can eliminate lots of # ECO changes that will show up during backannotation. net_aliases = util_alias.build_net_aliases(lambda net: net.name.upper(), netlist.nets) # initialize the refdes aliasing # Convert to all upper case because Pads seems to do that # internally anyway and we'd rather do it here to catch name # clashes created by not preserving case. refdes_aliases = util_alias.build_refdes_aliases( lambda package: package.refdes.upper(), netlist.packages) # print out the header f.write('!PADS-POWERPCB-V3.0-MILS!\n') f.write('\n') f.write('*PART*\n') # print out the parts for package in reversed(netlist.packages): pattern = package.get_attribute('pattern', None) # The above pattern should stay as 'pattern' and not 'footprint' if pattern is not None: f.write(pattern) # print out the refdes with aliasing f.write('%s\t%s\n' % (refdes_aliases[package], package.get_attribute('footprint', 'unknown'))) # print out the net information f.write('\n') f.write('*NET*\n') for net in reversed(netlist.nets): f.write('*SIGNAL* %s\n' % net_aliases[net]) f.write( wrap( ' ' + ' '.join('%s.%s' % (refdes_aliases[pin.package], pin.number) for pin in reversed(net.connections)), 78, '', ' ')) # print out the footer f.write('\n') f.write('*END*\n')
def run(f, netlist): f.write('*OrCAD\n') f.write('*START\n') for package in reversed(netlist.packages): f.write('*COMP %s\t"%s"\n' % ( package.refdes, package.get_attribute('footprint', 'unknown'))) for net in reversed(netlist.nets): f.write('*NET "%s"\n' % net.name) f.write('*NET "%s"' % net.name) f.write(wrap(''.join(' %s."%s"' % (pin.package.refdes, pin.number) for pin in reversed(net.connections)), 500, ' ', '*NET "%s" ' % net.name)) f.write('\n') f.write('*END\n')
def run(f, netlist): for net in reversed(netlist.nets): f.write(net.name + '\t' + wrap( ' '.join('%s-%s' % (pin.package.refdes, pin.number) for pin in reversed(net.connections)) + ' ', 202, ' \\', ' '))