diff --git a/lib/CPUs/JCpu/src/core/cpu.vhd b/lib/CPUs/JCpu/src/core/cpu.vhd index 38e8686..5fc08c9 100644 --- a/lib/CPUs/JCpu/src/core/cpu.vhd +++ b/lib/CPUs/JCpu/src/core/cpu.vhd @@ -218,7 +218,7 @@ begin xmem_dout <= mem_data; xmem_addr <= mem_addr; cmem_din <= creg_ctrl_out.cmem_high & mem_data; - cmem_addr <= '1' & creg_ctrl_out.bank_sel & mem_addr(MIN(cmem_addr'length-creg_ctrl_out.bank_sel'length-1, mem_addr'length)-1 downto 0); + cmem_addr <= '1' & creg_ctrl_out.bank_sel & mem_addr(JMIN(cmem_addr'length-creg_ctrl_out.bank_sel'length-1, mem_addr'length)-1 downto 0); -------------------------------------------------------------------- mem_ctrl_lines: diff --git a/lib/CPUs/JCpu/src/core/cpu_pkg.vhd b/lib/CPUs/JCpu/src/core/cpu_pkg.vhd index 91bdae2..a6cfe0e 100644 --- a/lib/CPUs/JCpu/src/core/cpu_pkg.vhd +++ b/lib/CPUs/JCpu/src/core/cpu_pkg.vhd @@ -225,8 +225,8 @@ package cpu_pkg is function idecoder(opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return ctrl_lines_t; function gen_murom return murom_t; function get_muromaddr (opcode : opcode_t; iphase : iphase_t; status : cpu_status_t) return unsigned; - function MIN (X, Y: INTEGER) return INTEGER; - function MAX (X, Y: INTEGER) return INTEGER; + function JMIN (X, Y: INTEGER) return INTEGER; + function JMAX (X, Y: INTEGER) return INTEGER; end cpu_pkg; @@ -824,7 +824,7 @@ package body cpu_pkg is end get_muromaddr; ------------------------------------------------------------- - function MIN (X, Y: INTEGER) return INTEGER is + function JMIN (X, Y: INTEGER) return INTEGER is variable res : integer := X; begin if Y < X then @@ -833,10 +833,10 @@ package body cpu_pkg is return res; - end MIN; + end JMIN; ------------------------------------------------------------- - function MAX (X, Y: INTEGER) return INTEGER is + function JMAX (X, Y: INTEGER) return INTEGER is variable res : integer := X; begin if Y > X then @@ -845,7 +845,7 @@ package body cpu_pkg is return res; - end MAX; + end JMAX; end cpu_pkg; diff --git a/lib/CPUs/JCpu/src/tb_cpu_itest.vhd b/lib/CPUs/JCpu/src/tb_cpu_itest.vhd index 243ba8f..6c28c81 100644 --- a/lib/CPUs/JCpu/src/tb_cpu_itest.vhd +++ b/lib/CPUs/JCpu/src/tb_cpu_itest.vhd @@ -135,10 +135,11 @@ CLK_GEN: process end process; STIMULUS: process - file RESULT: text open write_mode is "../tools/opc.list"; + file RESULT: text; variable L: line; begin + file_open(RESULT, "../tools/opc.list", WRITE_MODE); for i in 0 to instr_name_array'length-1 loop fprint(RESULT, L,"%d %s\n", fo(i), instr_name_array(i)); @@ -151,7 +152,9 @@ STIMULUS: process wait until rising_edge(clk); ce <= '1'; - assert false report "Test finished" severity error; + file_close(RESULT); + + assert false report "Test finished" severity failure; wait; end process;