from collections import defaultdict
from skidl import Pin, Part, Alias, SchLib, SKIDL, TEMPLATE

from skidl.pin import pin_types

SKIDL_lib_version = '0.0.1'

Logic_Programmable = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'GAL16V8', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'GAL16V8'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'GAL PLD 16V8', 'description':'', 'datasheet':'', 'search_text':'/usr/share/kicad/symbols/Logic_Programmable.kicad_sym\nGAL16V8\n\nGAL PLD 16V8', 'pins':[
            Pin(num='10',name='GND',func=pin_types.PWRIN),
            Pin(num='20',name='VCC',func=pin_types.PWRIN),
            Pin(num='1',name='I1/CLK',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='I10/~{OE}',func=pin_types.INPUT,unit=1),
            Pin(num='12',name='IO8',func=pin_types.TRISTATE,unit=1),
            Pin(num='13',name='IO7',func=pin_types.TRISTATE,unit=1),
            Pin(num='14',name='IO6',func=pin_types.TRISTATE,unit=1),
            Pin(num='15',name='IO5',func=pin_types.TRISTATE,unit=1),
            Pin(num='16',name='IO4',func=pin_types.TRISTATE,unit=1),
            Pin(num='17',name='I03',func=pin_types.TRISTATE,unit=1),
            Pin(num='18',name='IO2',func=pin_types.TRISTATE,unit=1),
            Pin(num='19',name='IO1',func=pin_types.TRISTATE,unit=1),
            Pin(num='2',name='I2',func=pin_types.INPUT,unit=1),
            Pin(num='3',name='I3',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='I4',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='I5',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='I6',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='I7',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='I8',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='I9',func=pin_types.INPUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'PAL16L8', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PAL16L8'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'PAL PLD 16L8', 'description':'', 'datasheet':'', 'search_text':'/usr/share/kicad/symbols/Logic_Programmable.kicad_sym\nPAL16L8\n\nPAL PLD 16L8', 'pins':[
            Pin(num='10',name='GND',func=pin_types.PWRIN),
            Pin(num='20',name='VCC',func=pin_types.PWRIN),
            Pin(num='1',name='I1',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='I10',func=pin_types.INPUT,unit=1),
            Pin(num='12',name='IO8',func=pin_types.TRISTATE,unit=1),
            Pin(num='13',name='IO7',func=pin_types.TRISTATE,unit=1),
            Pin(num='14',name='IO6',func=pin_types.TRISTATE,unit=1),
            Pin(num='15',name='IO5',func=pin_types.TRISTATE,unit=1),
            Pin(num='16',name='IO4',func=pin_types.TRISTATE,unit=1),
            Pin(num='17',name='I03',func=pin_types.TRISTATE,unit=1),
            Pin(num='18',name='IO2',func=pin_types.TRISTATE,unit=1),
            Pin(num='19',name='IO1',func=pin_types.TRISTATE,unit=1),
            Pin(num='2',name='I2',func=pin_types.INPUT,unit=1),
            Pin(num='3',name='I3',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='I4',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='I5',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='I6',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='I7',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='I8',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='I9',func=pin_types.INPUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'PAL20', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PAL20'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'logic programmable PAL', 'description':'', 'datasheet':'~', 'search_text':'/usr/share/kicad/symbols/Logic_Programmable.kicad_sym\nPAL20\n\nlogic programmable PAL', 'pins':[
            Pin(num='1',name='OD/CLK',func=pin_types.PASSIVE,unit=1),
            Pin(num='10',name='GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='11',name='CLK/OD',func=pin_types.PASSIVE,unit=1),
            Pin(num='12',name='LR/O3',func=pin_types.PASSIVE,unit=1),
            Pin(num='13',name='A2/O2',func=pin_types.PASSIVE,unit=1),
            Pin(num='14',name='A1/O1',func=pin_types.PASSIVE,unit=1),
            Pin(num='15',name='A0/O0',func=pin_types.PASSIVE,unit=1),
            Pin(num='16',name='O3/A2',func=pin_types.PASSIVE,unit=1),
            Pin(num='17',name='O2/A1',func=pin_types.PASSIVE,unit=1),
            Pin(num='18',name='O1/A0',func=pin_types.PASSIVE,unit=1),
            Pin(num='19',name='O0/LR',func=pin_types.PASSIVE,unit=1),
            Pin(num='2',name='I0',func=pin_types.PASSIVE,unit=1),
            Pin(num='20',name='VCC',func=pin_types.PASSIVE,unit=1),
            Pin(num='3',name='I1',func=pin_types.PASSIVE,unit=1),
            Pin(num='4',name='I2',func=pin_types.PASSIVE,unit=1),
            Pin(num='5',name='I3',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='I4',func=pin_types.PASSIVE,unit=1),
            Pin(num='7',name='I5',func=pin_types.PASSIVE,unit=1),
            Pin(num='8',name='I6',func=pin_types.PASSIVE,unit=1),
            Pin(num='9',name='I7',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'PAL20L8', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PAL20L8'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'PAL PLD 20L8', 'description':'', 'datasheet':'', 'search_text':'/usr/share/kicad/symbols/Logic_Programmable.kicad_sym\nPAL20L8\n\nPAL PLD 20L8', 'pins':[
            Pin(num='12',name='GND',func=pin_types.PWRIN),
            Pin(num='24',name='VCC',func=pin_types.PWRIN),
            Pin(num='1',name='I1',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='I10',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='I11',func=pin_types.INPUT,unit=1),
            Pin(num='13',name='I13',func=pin_types.INPUT,unit=1),
            Pin(num='14',name='I14',func=pin_types.INPUT,unit=1),
            Pin(num='15',name='IO15',func=pin_types.TRISTATE,unit=1),
            Pin(num='16',name='IO16',func=pin_types.TRISTATE,unit=1),
            Pin(num='17',name='IO17',func=pin_types.TRISTATE,unit=1),
            Pin(num='18',name='IO18',func=pin_types.TRISTATE,unit=1),
            Pin(num='19',name='IO19',func=pin_types.TRISTATE,unit=1),
            Pin(num='2',name='I2',func=pin_types.INPUT,unit=1),
            Pin(num='20',name='I020',func=pin_types.TRISTATE,unit=1),
            Pin(num='21',name='IO21',func=pin_types.TRISTATE,unit=1),
            Pin(num='22',name='IO22',func=pin_types.TRISTATE,unit=1),
            Pin(num='23',name='I23',func=pin_types.INPUT,unit=1),
            Pin(num='3',name='I3',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='I4',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='I5',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='I6',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='I7',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='I8',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='I9',func=pin_types.INPUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'PAL20RS10', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PAL20RS10'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'PAL PLD 20RS10', 'description':'', 'datasheet':'', 'search_text':'/usr/share/kicad/symbols/Logic_Programmable.kicad_sym\nPAL20RS10\n\nPAL PLD 20RS10', 'pins':[
            Pin(num='1',name='CLK',func=pin_types.INPUT,unit=1),
            Pin(num='10',name='I8',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='I9',func=pin_types.INPUT,unit=1),
            Pin(num='12',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='13',name='~{OE}',func=pin_types.INPUT,unit=1),
            Pin(num='14',name='O9',func=pin_types.OUTPUT,unit=1),
            Pin(num='15',name='O8',func=pin_types.OUTPUT,unit=1),
            Pin(num='16',name='O7',func=pin_types.OUTPUT,unit=1),
            Pin(num='17',name='O6',func=pin_types.OUTPUT,unit=1),
            Pin(num='18',name='O5',func=pin_types.OUTPUT,unit=1),
            Pin(num='19',name='O4',func=pin_types.OUTPUT,unit=1),
            Pin(num='2',name='I0',func=pin_types.INPUT,unit=1),
            Pin(num='20',name='O3',func=pin_types.OUTPUT,unit=1),
            Pin(num='21',name='O2',func=pin_types.OUTPUT,unit=1),
            Pin(num='22',name='O1',func=pin_types.OUTPUT,unit=1),
            Pin(num='23',name='O0',func=pin_types.OUTPUT,unit=1),
            Pin(num='24',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='3',name='I1',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='I2',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='I3',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='I4',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='I5',func=pin_types.INPUT,unit=1),
            Pin(num='8',name='I6',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='I7',func=pin_types.INPUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'PAL24', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'PAL24'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'logic programmable PAL', 'description':'', 'datasheet':'~', 'search_text':'/usr/share/kicad/symbols/Logic_Programmable.kicad_sym\nPAL24\n\nlogic programmable PAL', 'pins':[
            Pin(num='1',name='OD/CLK',func=pin_types.PASSIVE,unit=1),
            Pin(num='10',name='I8',func=pin_types.PASSIVE,unit=1),
            Pin(num='11',name='I9',func=pin_types.PASSIVE,unit=1),
            Pin(num='12',name='GND',func=pin_types.PASSIVE,unit=1),
            Pin(num='13',name='CLK/OD',func=pin_types.PASSIVE,unit=1),
            Pin(num='14',name='LR/O4',func=pin_types.PASSIVE,unit=1),
            Pin(num='15',name='A0/O3',func=pin_types.PASSIVE,unit=1),
            Pin(num='16',name='A1/O2',func=pin_types.PASSIVE,unit=1),
            Pin(num='17',name='A2/O1',func=pin_types.PASSIVE,unit=1),
            Pin(num='18',name='NC/O0',func=pin_types.PASSIVE,unit=1),
            Pin(num='19',name='O4/NC',func=pin_types.PASSIVE,unit=1),
            Pin(num='2',name='I0',func=pin_types.PASSIVE,unit=1),
            Pin(num='20',name='O3/A2',func=pin_types.PASSIVE,unit=1),
            Pin(num='21',name='O2/A1',func=pin_types.PASSIVE,unit=1),
            Pin(num='22',name='O1/A0',func=pin_types.PASSIVE,unit=1),
            Pin(num='23',name='O0/LR',func=pin_types.PASSIVE,unit=1),
            Pin(num='24',name='VCC',func=pin_types.PASSIVE,unit=1),
            Pin(num='3',name='I1',func=pin_types.PASSIVE,unit=1),
            Pin(num='4',name='I2',func=pin_types.PASSIVE,unit=1),
            Pin(num='5',name='I3',func=pin_types.PASSIVE,unit=1),
            Pin(num='6',name='I4',func=pin_types.PASSIVE,unit=1),
            Pin(num='7',name='I5',func=pin_types.PASSIVE,unit=1),
            Pin(num='8',name='I6',func=pin_types.PASSIVE,unit=1),
            Pin(num='9',name='I7',func=pin_types.PASSIVE,unit=1)], 'unit_defs':[] })])