From f35dee7cd0c8e1a8a5dc856e502a92cab4640964 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Mon, 28 Dec 2020 21:50:49 +0100 Subject: Removed outdated files. --- testsuite/python/units01/show_units.py | 55 ---------------------------------- 1 file changed, 55 deletions(-) delete mode 100755 testsuite/python/units01/show_units.py (limited to 'testsuite/python/units01/show_units.py') 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() -- cgit v1.2.3