last commit
This commit is contained in:
parent
6085f51211
commit
315602a36f
7 changed files with 31 additions and 6 deletions
BIN
Projet_Système_Aurélia_LEJEUNE_Raphaël_LACROIX_.pdf
Normal file
BIN
Projet_Système_Aurélia_LEJEUNE_Raphaël_LACROIX_.pdf
Normal file
Binary file not shown.
16
README.md
16
README.md
|
@ -1,2 +1,18 @@
|
|||
# Projet-Systemes-Informatiques
|
||||
**LEJEUNE AURÉLIA - LACROIX RAPHAËL**
|
||||
|
||||
*This project was carried out as part of our computer engineering training.
|
||||
The aim of this project is to design a C compiler and a microprocessor, the former being thought with the latter in mind.*
|
||||
|
||||
The compiler is based on a simplified version of the C language. It supports basic arithmetic operations (addition, subtraction, integer division, multiplication), Boolean operations, while loops and complex conditions. It has been coded using Lex, Yacc and C. The resulting assembly code and object code can be produced using the cross-assembler (itself coded in Python).
|
||||
An interpreter is available in a GUI version to follow assembly code execution step by step in memory.
|
||||
|
||||
## Compilation
|
||||
|
||||
- `$ make vhdl` : compiles and run the compiler then convert its binary into VHDL format
|
||||
- `$ make cli-inter` : compiles and run the compiler then interprets its binary (GUI)
|
||||
- `$ make gui-inter` :compiles and run the compiler then interprets its binary
|
||||
|
||||
## Microprocessor
|
||||
|
||||
The VHDL folder contains all the files needed to build our microprocessor. It also contains two test files, `test_alu` and `test_cpu`, for testing all ALU operations and simulating program execution, respectively.
|
||||
|
|
|
@ -31,6 +31,9 @@ clean:
|
|||
vhdl: clean asm
|
||||
python3 ../cross-Compiler/cross-compiler.py
|
||||
|
||||
inter: clean asm
|
||||
cli-inter: clean asm
|
||||
python3 ../interpreter/interpreter.py
|
||||
|
||||
gui-inter: clean asm
|
||||
python3 ../interpreter/graph_interpreter.py
|
||||
|
||||
|
||||
|
|
BIN
compilateur/out
BIN
compilateur/out
Binary file not shown.
|
@ -194,7 +194,7 @@ void checkArraySanity(){
|
|||
if (currentIndex == maxIndex){
|
||||
reallocateArray(maxIndex * 2);
|
||||
} else {
|
||||
if (currentIndex < maxIndex / 2 && maxIndex / 2 > START_TABLE_SIZE){
|
||||
if (currentIndex < maxIndex / 4 && maxIndex / 4 > START_TABLE_SIZE){
|
||||
reallocateArray(maxIndex / 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ try:
|
|||
from textual.containers import Container, VerticalScroll
|
||||
from textual.widgets import Footer, Header, Static
|
||||
except:
|
||||
print("please install textual and rich !")
|
||||
print("\n\n=====================\n\nplease install textual and rich !\n\n=====================\n\n")
|
||||
|
||||
|
||||
def getLinesToShow(ip, lines):
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
from rich.console import Console
|
||||
from rich.table import Table
|
||||
|
||||
try:
|
||||
from rich.console import Console
|
||||
from rich.table import Tablessdf
|
||||
except:
|
||||
print("\n\n=====================\n\nplease install rich !\n You can also run \"python3 interpreter/interpreter.old.py\" if you want something that does not use any non-core package\n\n=====================\n\n")
|
||||
|
||||
|
||||
table = Table()
|
||||
|
||||
table.add_column("Operation", justify="left", style="red", no_wrap=True)
|
||||
|
|
Loading…
Reference in a new issue