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'

Memory_ROM = SchLib(tool=SKIDL).add_parts(*[
        Part(**{ 'name':'XC18V01SO20', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'XC18V01SO20'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'', 'description':'', 'datasheet':'xilinx/xc18v00proms.pdf', 'search_text':'/usr/share/kicad/symbols/Memory_ROM.kicad_sym\nXC18V01SO20\n\n', 'pins':[
            Pin(num='1',name='D0',func=pin_types.OUTPUT,unit=1),
            Pin(num='10',name='CE',func=pin_types.INPUT,unit=1),
            Pin(num='11',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='12',name='D7',func=pin_types.OUTPUT,unit=1),
            Pin(num='13',name='CEO',func=pin_types.OUTPUT,unit=1),
            Pin(num='14',name='D5',func=pin_types.OUTPUT,unit=1),
            Pin(num='15',name='D3',func=pin_types.OUTPUT,unit=1),
            Pin(num='16',name='D1',func=pin_types.OUTPUT,unit=1),
            Pin(num='17',name='TDO',func=pin_types.OPENCOLL,unit=1),
            Pin(num='18',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='19',name='VCCO',func=pin_types.PWRIN,unit=1),
            Pin(num='2',name='D2',func=pin_types.OUTPUT,unit=1),
            Pin(num='20',name='VCC',func=pin_types.PWRIN,unit=1),
            Pin(num='3',name='CLK',func=pin_types.INPUT,unit=1),
            Pin(num='4',name='TDI',func=pin_types.INPUT,unit=1),
            Pin(num='5',name='TMS',func=pin_types.INPUT,unit=1),
            Pin(num='6',name='TCK',func=pin_types.INPUT,unit=1),
            Pin(num='7',name='D4/CF',func=pin_types.OPENCOLL,unit=1),
            Pin(num='8',name='OE/RESET',func=pin_types.INPUT,unit=1),
            Pin(num='9',name='D6',func=pin_types.OUTPUT,unit=1)], 'unit_defs':[] }),
        Part(**{ 'name':'XCF08P', 'dest':TEMPLATE, 'tool':SKIDL, 'aliases':Alias({'XCF08P'}), 'ref_prefix':'U', 'fplist':[''], 'footprint':'', 'keywords':'PROM FLASH', 'description':'', 'datasheet':'https://www.xilinx.com/support/documentation/data_sheets/ds123.pdf', 'search_text':'/usr/share/kicad/symbols/Memory_ROM.kicad_sym\nXCF08P\n\nPROM FLASH', 'pins':[
            Pin(num='A1',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='A2',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='A3',name='OE/RST',func=pin_types.INPUT,unit=1),
            Pin(num='A5',name='D6',func=pin_types.TRISTATE,unit=1),
            Pin(num='A6',name='D7',func=pin_types.TRISTATE,unit=1),
            Pin(num='B1',name='VCCINT',func=pin_types.PWRIN,unit=1),
            Pin(num='B2',name='VCCO',func=pin_types.PWRIN,unit=1),
            Pin(num='B3',name='CLK',func=pin_types.INPUT,unit=1),
            Pin(num='B4',name='CE',func=pin_types.INPUT,unit=1),
            Pin(num='B5',name='D5',func=pin_types.TRISTATE,unit=1),
            Pin(num='B6',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='C1',name='BUSY',func=pin_types.INPUT,unit=1),
            Pin(num='C2',name='CLKOUT',func=pin_types.OUTPUT,unit=1),
            Pin(num='C5',name='D4',func=pin_types.TRISTATE,unit=1),
            Pin(num='C6',name='VCCO',func=pin_types.PWRIN,unit=1),
            Pin(num='D1',name='CF',func=pin_types.BIDIR,unit=1),
            Pin(num='D2',name='CEO',func=pin_types.OUTPUT,unit=1),
            Pin(num='D5',name='D3',func=pin_types.TRISTATE,unit=1),
            Pin(num='D6',name='VCCO',func=pin_types.PWRIN,unit=1),
            Pin(num='E1',name='VCCINT',func=pin_types.PWRIN,unit=1),
            Pin(num='E2',name='TMS',func=pin_types.INPUT,unit=1),
            Pin(num='E5',name='D2',func=pin_types.TRISTATE,unit=1),
            Pin(num='E6',name='TDO',func=pin_types.OUTPUT,unit=1),
            Pin(num='F1',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='F5',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='F6',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='G1',name='TDI',func=pin_types.INPUT,unit=1),
            Pin(num='G3',name='REV-SEL0',func=pin_types.INPUT,unit=1),
            Pin(num='G4',name='REV-SEL1',func=pin_types.INPUT,unit=1),
            Pin(num='G5',name='VCCO',func=pin_types.PWRIN,unit=1),
            Pin(num='G6',name='VCCINT',func=pin_types.PWRIN,unit=1),
            Pin(num='H1',name='GND',func=pin_types.PWRIN,unit=1),
            Pin(num='H2',name='VCCJ',func=pin_types.PWRIN,unit=1),
            Pin(num='H3',name='TCK',func=pin_types.INPUT,unit=1),
            Pin(num='H4',name='/EN-EXT-SEL',func=pin_types.INPUT,unit=1),
            Pin(num='H5',name='D1',func=pin_types.TRISTATE,unit=1),
            Pin(num='H6',name='D0',func=pin_types.TRISTATE,unit=1)], 'unit_defs':[] })])