Browse Source

Makefile global + clean CA + clean Proc

Paul Faure 1 month ago
parent
commit
a91b7dc79d
7 changed files with 32 additions and 54 deletions
  1. 3
    0
      .gitignore
  2. 1
    1
      Compilateur
  3. 1
    1
      CrossAssembleur
  4. 22
    7
      Makefile
  5. 1
    1
      Processeur
  6. 0
    44
      max.c
  7. 4
    0
      prog.c

+ 3
- 0
.gitignore View File

@@ -0,0 +1,3 @@
1
+*.bin
2
+*.memasm
3
+*.regasm

+ 1
- 1
Compilateur

@@ -1 +1 @@
1
-Subproject commit c2a70038eaf9e286fe57234a6e01a45fcb962739
1
+Subproject commit afbc1461c4491222906cdb448ee613a6c2587706

+ 1
- 1
CrossAssembleur

@@ -1 +1 @@
1
-Subproject commit 0288b38c67725f98e9f65a195c22c525675b7948
1
+Subproject commit 985bd00388d0d40b521cca640076d6bfc57e3c8a

+ 22
- 7
Makefile View File

@@ -19,20 +19,35 @@ else ifeq ($(QUOI),null)
19 19
 	@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|cross_asm|load|all]\""
20 20
 else
21 21
 ifeq ($(QUOI),compile)
22
+	@echo "Compilation"
22 23
 	cat $(SOURCE).c | Compilateur/rondoudou_gcc
23
-	mv output.txt $(SOURCE).memasm
24
+	@mv output.txt $(SOURCE).memasm
25
+	@echo "Compilation terminée"
24 26
 else ifeq ($(QUOI),cross_asm)
27
+	@echo "CrossAssemblage"
25 28
 	cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur
26
-	mv output.asm $(SOURCE).regasm
27
-	mv output.bin $(SOURCE).bin
29
+	@mv output.asm $(SOURCE).regasm
30
+	@mv output.bin $(SOURCE).bin
31
+	@echo "CrossAssemblage terminé"
28 32
 else ifeq ($(QUOI),load)
29
-	@echo "Non encore supporté"
33
+	@echo "Chargement du binaire"
34
+	@sed -r "s/signal MEMORY : STD_LOGIC_VECTOR \(\(Mem_Size \* Nb_bits\)-1 downto 0\) := \"[01]*\";/signal MEMORY : STD_LOGIC_VECTOR \(\(Mem_Size \* Nb_bits\)-1 downto 0\) := $$(cat $(SOURCE).bin);/g" Processeur/Processeur.srcs/sources_1/new/MemoireInstructions.vhd > $(SOURCE).tmp.vhd
35
+	@mv $(SOURCE).tmp.vhd Processeur/Processeur.srcs/sources_1/new/MemoireInstructions.vhd
36
+	@echo "Chargement du binaire terminé"
30 37
 else ifeq ($(QUOI),all)
38
+	@echo "Compilation"
31 39
 	cat $(SOURCE).c | Compilateur/rondoudou_gcc
32
-	mv output.txt $(SOURCE).memasm
40
+	@mv output.txt $(SOURCE).memasm
41
+	@echo "Compilation terminée"
42
+	@echo "CrossAssemblage"
33 43
 	cat $(SOURCE).memasm | CrossAssembleur/rondoudou_cross_assembleur
34
-	mv output.asm $(SOURCE).regasm
35
-	mv output.bin $(SOURCE).bin
44
+	@mv output.asm $(SOURCE).regasm
45
+	@mv output.bin $(SOURCE).bin
46
+	@echo "CrossAssemblage terminé"
47
+	@echo "Chargement du binaire"
48
+	@sed -r "s/signal MEMORY : STD_LOGIC_VECTOR \(\(Mem_Size \* Nb_bits\)-1 downto 0\) := \"[01]*\";/signal MEMORY : STD_LOGIC_VECTOR \(\(Mem_Size \* Nb_bits\)-1 downto 0\) := $$(cat $(SOURCE).bin);/g" Processeur/Processeur.srcs/sources_1/new/MemoireInstructions.vhd > $(SOURCE).tmp.vhd
49
+	@mv $(SOURCE).tmp.vhd Processeur/Processeur.srcs/sources_1/new/MemoireInstructions.vhd
50
+	@echo "Chargement du binaire terminé"
36 51
 else 
37 52
 	@echo "USAGE : make exec SOURCE=\"file_name\" QUOI=\"[compile|cross_asm|load|all]\""
38 53
 endif

+ 1
- 1
Processeur

@@ -1 +1 @@
1
-Subproject commit df3b1ecdacb03fd539d18d51983aab2d03493e5d
1
+Subproject commit d57f8a5b375cfef0ca77a7bb6f54cdec19c47b83

+ 0
- 44
max.c View File

@@ -1,44 +0,0 @@
1
-int get_value() {
2
-	int i = 0;
3
-	while (i<5) {
4
-		printf(0);
5
-		stop(1);
6
-		printf(255);
7
-		stop(1);
8
-		i = i+1;
9
-	}
10
-	stop(15);
11
-	i = get();
12
-	return i;
13
-}
14
-
15
-int max(int * tab, int size) {
16
-	int i = 0;
17
-	int max = 0;
18
-	while (i<size) {
19
-		if (tab[i] > max) {
20
-			max = tab[i];
21
-		}
22
-		i = i+1;
23
-	}
24
-	return max;
25
-}
26
-
27
-int main() {
28
-	int tab[10];
29
-	int i = 0;
30
-	while (i<10) {
31
-		tab[i] = get_value();
32
-		i = i+1;
33
-	}
34
-	i = 0;
35
-	while (i<5) {
36
-		printf(170);
37
-		stop(1);
38
-		printf(85);
39
-		stop(1);
40
-		i = i+1;
41
-	}
42
-	stop(3);
43
-	printf(max(tab, 10));
44
-}

+ 4
- 0
prog.c View File

@@ -0,0 +1,4 @@
1
+int main() {
2
+	int a = 2;
3
+	printf(a);
4
+}

Loading…
Cancel
Save