{ "info": { "author": "Ken Kundert", "author_email": "psf_utils@nurdletech.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Topic :: Utilities" ], "description": "PSF Utilities\n=============\n\n:Author: Ken Kundert\n:Version: 0.4.0\n:Released: 2019-09-26\n\n\nWhat?\n-----\n\n*psf_utils* is a library allows you to read data from a Spectre PSF ASCII file.\nSpectre is a commercial circuit simulator produced by Cadence Design Systems.\nPSF files contain signals generated by Spectre. This package also contains two\nprograms that are useful in their own right, but also act as demonstrators as to\nhow to use the library. They are *list-psf* and *plot-psf*. The first lists the\navailable signals in a file, and the other displays them.\n\n\nAccessing the Results\n---------------------\n\nYou can use the PSF class to read ASCII Parameter Storage Format files. When\ninstantiating the class you pass in the path to the file and then the resulting\nPSF object contains a dictionary that containing the signals. For example, the\nfollowing lists is a::\n\n from psf_utils import PSF\n from inform import Error, display\n\n kinds = {\n 'float double': 'real',\n 'float complex': 'complex',\n }\n\n try:\n psf = PSF('adc.raw/tran.tran')\n\n for signal in psf.all_signals():\n kind = signal.type.kind\n kind = kinds.get(kind, kind)\n display(f'{signal.name:<15} {signal.units:<12} {kind}')\n except Error as e:\n e.terminate()\n\nThis example plots the output signal::\n\n from psf_utils import PSF\n from inform import Error, display\n import matplotlib.pyplot as plt\n\n try:\n psf = PSF('adc.raw/tran.tran')\n sweep = psf.get_sweep()\n out = psf.get_signal('out')\n\n figure = plt.figure()\n axes = figure.add_subplot(1,1,1)\n axes.plot(sweep.abscissa, out.ordinate, linewidth=2, label=out.name)\n axes.set_title('ADC Output')\n axes.set_xlabel(f'{sweep.name} ({PSF.units_to_unicode(sweep.units)})')\n axes.set_ylabel(f'{out.name} ({PSF.units_to_unicode(out.units)})')\n plt.show()\n except Error as e:\n e.terminate()\n\n*abscissa* and *ordinate* are NumPy arrays.\n\n\nUtility Programs\n----------------\n\nTwo utility programs are installed along with the *psf_utils* library:\n*list-psf* and *plot-psf*. The first lists the signals available from a PSF\nfile, and the second displays them. They both employ caching to speed up access\nto the data. They also cache the name of the PSF file so that it need not be\ngiven every time. *plot-psf* also caches its arguments, so if you run it again\nwith no arguments it will simply repeat what it did last time. For example, here\nis a typical session::\n\n # display signals in PSF file\n > list-psf -f resistor.raw/pnoise.pnoise\n Using pnoise.raw/pnoise.pnoise.\n R1:flicker R1:total R2:fn out\n R1:thermal R2:rn R2:total\n\n # display them again, this time in long form\n > list-psf -l\n Using pnoise.raw/pnoise.pnoise.\n R1:flicker A\u00b2/Hz real (12042 points)\n R1:thermal A\u00b2/Hz real (12042 points)\n R1:total A\u00b2/Hz real (12042 points)\n R2:fn A\u00b2/Hz real (12042 points)\n R2:rn A\u00b2/Hz real (12042 points)\n R2:total A\u00b2/Hz real (12042 points)\n out A/\u221aHz real (12042 points)\n\n # display only those that match R1:*\n > list-psf -l R1:*\n Using pnoise.raw/pnoise.pnoise.\n R1:flicker A\u00b2/Hz real (12042 points)\n R1:thermal A\u00b2/Hz real (12042 points)\n R1:total A\u00b2/Hz real (12042 points)\n\n # display a graph containing signals that start with R1:\n > plot-psf R1:*\n\n # display the thermal noise of R1, and then the total noise minue the flicker noise\n > plot-psf R1:thermal R1:total-R1:flicker\n\n # display a graph containing only out\n > plot-psf out\n\n > plot-psf # display out again\n\n\nConverting to PSF ASCII\n-----------------------\n\n*psf_utils* only supports PSF ASCII files. As an alternative, `libpsf\n`_ is a Python package that can read both ASCII\nand binary PSF files. Or, you can use the Cadence *psf* program to convert\nvarious types of simulation results files into PSF ASCII format. To use it,\nsimply specify the input and output files::\n\n > psf -i adc.raw/tran.tran -o adc.raw/tran.psfascii\n > list-psf adc.raw/tran.psfascii\n\nIn this example there is nothing special about the 'psfascii' suffix, it is\nsimply mnemonic. Rather, the output is in ASCII format because the ``-b``\n(binary) option is not specified.\n\n\nReleases\n--------\n\n**Latest development release**:\n | Version: 0.4.0\n | Released: 2019-09-26\n\n**0.4 (2019-09-26)**:\n - Allow glob patterns to be passed to both *list-psf* and *plot-psf*.\n\n**0.3 (2019-09-25)**:\n - Fix import errors in *plot-psf* command.\n\n**0.2 (2019-09-25)**:\n - Fix dependencies.\n\n**0.1 (2019-09-25)**:\n - Initial version", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/kenkundert/psf_utils/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://psf_utils.readthedocs.io", "keywords": "cadence,spectre,PSF,simulation", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "psf-utils", "package_url": "https://pypi.org/project/psf-utils/", "platform": "", "project_url": "https://pypi.org/project/psf-utils/", "project_urls": { "Download": "https://github.com/kenkundert/psf_utils/tarball/master", "Homepage": "https://psf_utils.readthedocs.io" }, "release_url": "https://pypi.org/project/psf-utils/0.4.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Cadence PSF file utilities", "version": "0.4.0" }, "last_serial": 5893588, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "4d4fa20051ff2ad3f27117ee0235dcce", "sha256": "adb2a8c5ef7f75c6bc48945573b70d1ee2d6fbb20f3c0926f3e3defb4970b8a1" }, "downloads": -1, "filename": "psf_utils-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4d4fa20051ff2ad3f27117ee0235dcce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10246, "upload_time": "2019-09-26T02:15:25", "url": "https://files.pythonhosted.org/packages/f6/31/e3da87d009256c9dc244422a9d0ef974d9b3c904d329de2c48b805da1ef5/psf_utils-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "2a21db7ec6d3add58df9959f04341e31", "sha256": "14b4369a889d8a44c95b4634e1ab164c21bdec8e476cf50c93eead56011e4291" }, "downloads": -1, "filename": "psf_utils-0.2.0.tar.gz", "has_sig": false, "md5_digest": "2a21db7ec6d3add58df9959f04341e31", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10253, "upload_time": "2019-09-26T04:20:47", "url": "https://files.pythonhosted.org/packages/f9/bb/48b6658c63ad9af23dd709e2fcbab20464ffe0c8e68044e50c7ed8af987e/psf_utils-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "c4c9c58f87ebfc14f66d92b290a5f612", "sha256": "2387dd83db548837227f8735a2463d4ae19b31c519507002fd0654cd5a89707c" }, "downloads": -1, "filename": "psf_utils-0.3.0.tar.gz", "has_sig": false, "md5_digest": "c4c9c58f87ebfc14f66d92b290a5f612", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10252, "upload_time": "2019-09-26T05:11:29", "url": "https://files.pythonhosted.org/packages/6c/45/469899ff552510bf358d80b2d4f2de1a0a8122c93549e21bc54a2b5118e1/psf_utils-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "08ca888d00c245416c2a4227dd2b2e4a", "sha256": "965a81ed7f2c5bb4396b66745141f30af0858e0c4c8b187f8a477342b9c4dee2" }, "downloads": -1, "filename": "psf_utils-0.4.0.tar.gz", "has_sig": false, "md5_digest": "08ca888d00c245416c2a4227dd2b2e4a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11964, "upload_time": "2019-09-27T01:39:14", "url": "https://files.pythonhosted.org/packages/48/db/a862caa75b6ee506b15fafa0c34f34bd63edbdcdbae9bbf1a7d813215303/psf_utils-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "08ca888d00c245416c2a4227dd2b2e4a", "sha256": "965a81ed7f2c5bb4396b66745141f30af0858e0c4c8b187f8a477342b9c4dee2" }, "downloads": -1, "filename": "psf_utils-0.4.0.tar.gz", "has_sig": false, "md5_digest": "08ca888d00c245416c2a4227dd2b2e4a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 11964, "upload_time": "2019-09-27T01:39:14", "url": "https://files.pythonhosted.org/packages/48/db/a862caa75b6ee506b15fafa0c34f34bd63edbdcdbae9bbf1a7d813215303/psf_utils-0.4.0.tar.gz" } ] }