From 0853e650426bc3f89e6a8a8fe24bf2fdcd469595 Mon Sep 17 00:00:00 2001 From: shaithan Date: Tue, 7 Dec 2021 23:21:37 +0100 Subject: [PATCH] finished exec & deleted reports in alu --- README.md | 2 ++ alu.vhdl | 10 +++++----- exec.vhdl | 21 ++++++++++++--------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6b30acc..f733a46 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ ARM barrel shifter (pour debug ROR et RRX) : http://www.davespace.co.uk/arm/intr VHDL basics par Intel FPGA : https://www.youtube.com/watch?v=zm-RA6BsYmc&ab_channel=IntelFPGA +Declaration VHDL : https://www.csee.umbc.edu/portal/help/VHDL/declare.html + # notice : Utiliser uniquement ghdl-gcc (llvm et mcode abort lors des overflows dans les tbs) diff --git a/alu.vhdl b/alu.vhdl index 16dc5bc..aecf350 100644 --- a/alu.vhdl +++ b/alu.vhdl @@ -40,24 +40,24 @@ begin begin case cmd is when "00" => - report "ADD"; + -- report "ADD"; res_temp <= add; cout_temp <= add_cout; when "01" => - report "AND"; + -- report "AND"; res_temp <= op1 and op2 ; cout_temp <= '0'; when "10" => - report "OR "; + -- report "OR "; res_temp <= op1 or op2; cout_temp <= '0'; when "11" => - report "XOR"; + -- report "XOR"; res_temp <= op1 xor op2 ; cout_temp <= '0'; when others => - report "ERROR"; + report "[ERROR] SWITCH CASE UNREACHABLE (Alu::cmd not initialised ?)"; end case; end process; diff --git a/exec.vhdl b/exec.vhdl index bcc8549..b41e76e 100644 --- a/exec.vhdl +++ b/exec.vhdl @@ -240,15 +240,18 @@ architecture Behavior OF EXec is -- carry flag exe_c <= alu_value_cout; - -- sortie mutex entre ALU et fifo - + -- sortie du mutiplexeur entre ALU et fifo mem_adr <= (dec_op1) when dec_pre_index='1' else alu_value_out; - -- Sortie restante - -- exe_pop <= dec2exe_empty; - - -- exe_dest <= dec_exe_dest; - -- exe_wb <= dec_exe_wb; - -- exe_flag_wb <= dec_flag_wb; - + -- Synchronisation fifo + exe_pop <= '1' when ( + (not dec2exe_empty='1') and (not exe2mem_full='1') -- verification dec2exe non vide et exe2mem non pleine + and (dec_mem_lb='1' or dec_mem_lw='1' or dec_mem_sb='1' or dec_mem_sw='1') -- si un acces memoire a lieu + ) else '0'; + + + exe_dest <= dec_exe_dest; + exe_wb <= '0' when dec2exe_empty ='1' else dec_exe_wb ; + exe_flag_wb <= '0' when dec2exe_empty ='1' else dec_flag_wb; + end Behavior; \ No newline at end of file