.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/basic/built_in_libraries.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_basic_built_in_libraries.py: ===================================== Using Built-In Primitive Libraries ===================================== A simple example to demonstrate using SpyDrNet's built in primitive libraries. The b13 example netlist is targeted towards the Xilinx 7 Series family. However, because the primitives are defined in the netlist, we must first compose it out to a new netlist that does not define the primitives. netlist_1 is parsed in without using the built in primitive library. The output shows that the port directions are undefined. netlist_2 is parsed in using the XILINX_7SERIES primitive library. The output shows that the port directions are defined. .. GENERATED FROM PYTHON SOURCE LINES 14-36 .. code-block:: default import spydrnet as sdn from spydrnet.util.netlist_type import VERILOG from spydrnet.util.architecture import XILINX_7SERIES netlist = sdn.load_example_netlist_by_name("b13", VERILOG) netlist.compose("b13.v", write_blackbox = False) print("Without using the primitive library:") netlist_1 = sdn.parse("b13.v") for definition in netlist_1.get_definitions(): if definition is not netlist_1.top_instance.reference: for port in definition.get_ports(): print(port.name + " " + str(port.direction)) print("\nUsing the primitive library:") netlist_2 = sdn.parse("b13.v", architecture=XILINX_7SERIES) for definition in netlist_2.get_definitions(): if definition is not netlist_2.top_instance.reference: for port in definition.get_ports(): print(port.name + " " + str(port.direction)) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_basic_built_in_libraries.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: built_in_libraries.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: built_in_libraries.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_