diff --git a/lib/CPUs/JCpu/src/core/alu.vhd b/lib/CPUs/JCpu/src/core/alu.vhd index 19b3478..3f03e85 100644 --- a/lib/CPUs/JCpu/src/core/alu.vhd +++ b/lib/CPUs/JCpu/src/core/alu.vhd @@ -54,14 +54,14 @@ architecture Behavioral of alu is -------------------------------------------------------------------------- function test_zero(arg : unsigned) return STD_LOGIC is - variable result : STD_LOGIC; + variable res : STD_LOGIC; begin - result := '0'; + res := '0'; for i in arg'range loop - result := result or To_X01(arg(i)); + res := res or To_X01(arg(i)); end loop; - return not result; + return not res; end test_zero; -------------------------------------------------------------------------- diff --git a/lib/CPUs/JCpu/src/core/cpu_pkg.vhd b/lib/CPUs/JCpu/src/core/cpu_pkg.vhd index a6cfe0e..ebd060c 100644 --- a/lib/CPUs/JCpu/src/core/cpu_pkg.vhd +++ b/lib/CPUs/JCpu/src/core/cpu_pkg.vhd @@ -217,9 +217,9 @@ package cpu_pkg is function Instr(opcode : opcode_t) return inst_t; function Instr(opcode : opcode_t; data : inst_data_t) return inst_t; function Instr(opcode : opcode_t; data : inst_data_t; reg : integer) return inst_t; - function Instr(opcode : opcode_t; reg_a : integer) return inst_t; - function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t; - function Instr(opcode : opcode_t; reg_a, reg_b, reg_c : integer) return inst_t; + function Instr(opcode : opcode_t; reg_ptr_a : integer) return inst_t; + function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b : integer) return inst_t; + function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b, reg_ptr_c : integer) return inst_t; function ctrl_lines_default return ctrl_lines_t; function idecoder(instr_name : instr_name_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t; function idecoder(opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t; @@ -260,34 +260,34 @@ package body cpu_pkg is end Instr; - function Instr(opcode : opcode_t; reg_a : integer) return inst_t is + function Instr(opcode : opcode_t; reg_ptr_a : integer) return inst_t is variable inst : inst_t := (others => '0'); begin inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode; - inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length)); + inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_ptr_a, reg_ptr_t'length)); return inst; end Instr; - function Instr(opcode : opcode_t; reg_a, reg_b : integer) return inst_t is + function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b : integer) return inst_t is variable inst : inst_t := (others => '0'); begin inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode; - inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_b, reg_ptr_t'length)); - inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length)); + inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_ptr_b, reg_ptr_t'length)); + inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_ptr_a, reg_ptr_t'length)); return inst; end Instr; - function Instr(opcode : opcode_t; reg_a, reg_b, reg_c : integer) return inst_t is + function Instr(opcode : opcode_t; reg_ptr_a, reg_ptr_b, reg_ptr_c : integer) return inst_t is variable inst : inst_t := (others => '0'); begin inst(inst_t'length-1 downto inst_t'length-opcode_t'length) := opcode; - inst(3*(reg_ptr_t'length)-1 downto 2*reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_c, reg_ptr_t'length)); - inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_b, reg_ptr_t'length)); - inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_a, reg_ptr_t'length)); + inst(3*(reg_ptr_t'length)-1 downto 2*reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_ptr_c, reg_ptr_t'length)); + inst(2*(reg_ptr_t'length)-1 downto reg_ptr_t'length) := reg_ptr_t(to_unsigned(reg_ptr_b, reg_ptr_t'length)); + inst(reg_ptr_t'length-1 downto 0) := reg_ptr_t(to_unsigned(reg_ptr_a, reg_ptr_t'length)); return inst;