Laporkan Masalah

Pengembangan Compiler Bagian Lexer dan Parser untuk Instruction-set Prosesor GAMA32 Menggunakan Python

Willy Jordan, Agus Bejo, S.T., M.Eng., D.Eng.;Anugerah Galang Persada, S.T., M.Eng.

2019 | Skripsi | S1 TEKNIK ELEKTRO

Saat ini Laboratorium Sistem Digital Departemen Teknik Elektro dan Teknologi Informasi Fakultas Teknik Universitas Gadjah Mada (DTETI FT UGM) tengah mengembangkan sebuah embedded processor 32-bit yang didesain dengan menggunakan SystemC Model dengan arsitektur prosesornya adalah General Purpose Processor (GPP) yang diberi nama GAMA32. GPP adalah arsitektur prosesor yang mampu menjalankan instruction-set standar. Akan tetapi tahap pengembangan GAMA32 ini sampai pada masalah belum adanya compiler yang mampu mengubah bahasa level tinggi menjadi bahasa assembly yang kemudian akan diubah menjadi bahasa mesin oleh assembler GAMA32. Untuk menyelesaikan permasalahan di atas maka dilakukan pengembangan compiler yang dalam penelitian tugas akhir ini dikembangkan compiler khususnya bagian lexer dan parsernya terlebih dahulu dengan menggunakan library RPLY Python yang mampu mengakomodasi fungsi-fungsi untuk membuat lexer dan parser (Abstract Syntax Tree (AST) generator) untuk kebutuhan penelitian ini. Pengujian yang dilakukan untuk memastikan kerja AST generator menggunakan beberapa pola sintaksis dalam bahasa pemrograman C seperti if, if else, while, do while, for, dan deklarasi variabel. Hasil pengujian ini menunjukkan rancangan lexer dan parser yang dikembangkan mampu menghasilkan AST dengan format JSON dengan benar sesuai yang diharapkan.

Currently the Digital System Laboratory of the Department of Electrical and Information Engineering, Faculty of Engineering Universitas Gadjah Mada (DEIE FE UGM) is developing a 32-bit embedded processor designed by using System C Model with its processor architecture is General Purpose Processor (GPP), named GAMA32. GPP is a processor architecture that capable of running standard instruction-set such as other embedded processor. However, the development phase of GAMA32 arrived at the problem that there was no compiler capable of converting high-level language into assembly language which would be converted into machine language by GAMA32 single quote s assembler. To solve the above problems, compiler development is carried out in which the compiler research is developed specifically in the lexer and parser sections by using the Python RPLY library which is able to accommodate functions for creating lexers and parsers (Abstract Syntax Tree (AST) generators) for the need of this research. The tests are conducted to ensure the work of the AST generator by using several syntactic patterns in C programming languages such as if, if else, while, do while, for, and variable declarations. The results of this test show that the lexer and parser designs developed were able to produce the AST with JSON format correctly as expected.

Kata Kunci : embedded processor, GAMA32, lexer, parser, Python

  1. S1-2019-381187-abstract.pdf  
  2. S1-2019-381187-bibliography.pdf  
  3. S1-2019-381187-tableofcontent.pdf  
  4. S1-2019-381187-title.pdf