def METHOD_NAME(params):
    pinstr = ''
    for tile, (site, val, pad_site_name, pin) in sorted(params.items()):
        pinstr += '%s,%s,%s,%s,%s\n' % (tile, val, site, pad_site_name, pin)
    open('params.csv', 'w').write(pinstr)