diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2020-12-28 21:50:49 +0100 |
---|---|---|
committer | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2020-12-28 21:50:49 +0100 |
commit | f35dee7cd0c8e1a8a5dc856e502a92cab4640964 (patch) | |
tree | 6a0340a1cd7fc34cf475234a6389d827c000654e /testsuite/python/units01/show_units.py | |
parent | e5db6a80cf34db4b5ec84d8bd159fef837184e78 (diff) | |
download | ghdl-f35dee7cd0c8e1a8a5dc856e502a92cab4640964.tar.gz ghdl-f35dee7cd0c8e1a8a5dc856e502a92cab4640964.tar.bz2 ghdl-f35dee7cd0c8e1a8a5dc856e502a92cab4640964.zip |
Removed outdated files.
Diffstat (limited to 'testsuite/python/units01/show_units.py')
-rwxr-xr-x | testsuite/python/units01/show_units.py | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/testsuite/python/units01/show_units.py b/testsuite/python/units01/show_units.py deleted file mode 100755 index 43baf9aed..000000000 --- a/testsuite/python/units01/show_units.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -import libghdl -from libghdl.thin import name_table -from libghdl.thin import files_map -from libghdl.thin.vhdl import nodes -from libghdl.thin.vhdl import sem_lib -from libghdl.thin import errorout_console - - -def init(): - """Initialization: set options and then load libaries""" - # Print error messages on the console - errorout_console.Install_Handler() - # Set options. This must be done before analyze_init() - libghdl.set_option(b"--std=08") - # Finish initialization. This will load the standard package - if libghdl.analyze_init_status() != 0: - raise Exception("libghdl initialization error") - -def get_identifier_ptr(n): - """Return the python string from node :param n: identifier""" - return name_table.Get_Name_Ptr(nodes.Get_Identifier(n)).decode("utf-8") - - -def list_units(filename): - # Load the file - file_id = name_table.Get_Identifier(filename.encode("utf_8")) - sfe = files_map.Read_Source_File(name_table.Null_Identifier, file_id) - if sfe == files_map.No_Source_File_Entry: - print("cannot open file '%s'" % filename) - return - - # Parse - file = sem_lib.Load_File(sfe) - - # Display all design units - unit = nodes.Get_First_Design_Unit(file) - while unit != nodes.Null_Iir: - lib_unit = nodes.Get_Library_Unit(unit) - if nodes.Get_Kind(lib_unit) == nodes.Iir_Kind.Entity_Declaration: - print("entity %s" % get_identifier_ptr(lib_unit)) - elif nodes.Get_Kind(lib_unit) == nodes.Iir_Kind.Architecture_Body: - print("architecture %s" % get_identifier_ptr(lib_unit)) - else: - print("unknown unit!") - unit = nodes.Get_Chain(unit) - - -def main(): - init() - list_units("demo.vhdl") - - -if __name__ == "__main__": - main() |