Font Size: a A A

Research On Compiled Embedded Python Precompilation Methods And Rule Optimization

Posted on:2024-06-10Degree:MasterType:Thesis
Country:ChinaCandidate:C T LiFull Text:PDF
GTID:2568306941464204Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
In embedded systems,Python,as an interpreted language,often faces problems such as slow execution speed and large storage space.In order to solve these problems,this thesis proposes a compiled embedded Python precompilation method,which converts Python code into C++language and separates the component layer from the application layer,and then reassembles the chip-related header files,Makefile files and The link files,etc.are put together to compile and link,and finally generate the target executable file.The main research content of this thesis is as follows:(1)Based on the abstract syntax tree,the overall design method of the compiled embedded Python compilation environment is proposed.This method proposes "storage classification representation" to realize Python’s dynamic type and data operation under dynamic type.Combining it with the static type description method forms a hybrid type system.Based on the principle of Python grammar,the translation rules of expressions and sentences are designed,which provides theoretical support for the research of translators.(2)Aiming at the problem of insufficient compiling adaptability of the embedded integrated development environment on different microcontrollers in the precompilation stage.With the help of the GCC compiler,the working principle of the Make tool and the characteristics of the Makefile are analyzed in detail.According to the common characteristics of the Makefile,a multi-chip compatible compilation method based on the Makefile is designed.(3)Aiming at the problem of poor translation performance caused by repeated translation of translated files in the pre-compilation stage,an optimization study on the translation architecture was carried out.From the three aspects of dependency path optionization,dependency graph persistence and dependency graph incremental update,a translation acceleration method is given to reduce translation files and use historical translation results.By comparing the compilation time before and after optimization through experiments,the effectiveness of this acceleration method in improving the compilation speed is verified,and the ease of use of CE-Python is improved.Based on the above research,the translator is embedded in the integrated development environment(AHL-GEC-IDE)developed in the laboratory to form the final CE-Python compilation environment.Taking the low-resource embedded license plate recognition system as the application scenario,the application scenario verification is carried out.On this basis,a comparative experiment is made between CE-Python and MicroPython to further verify that the performance of CE-Python is better than that of MicroPython.
Keywords/Search Tags:CE-Python, Type Annotation, Abstract Syntax Tree, Incremental translation, C/C++ Mixed Programming
PDF Full Text Request
Related items