35use ieee.std_logic_1164.
all;
36use ieee.numeric_std.
all;
113 if rising_edge(CLK) then
125 end process proc_regs;
137 if unsigned(DDST) = 0 then
140 if DDST = "1000000000000000" then
143 if unsigned(DSRC) = 0 then
146 if signed(DSRC) = -1 then
149 if unsigned(DTMP) = 0 then
152 if signed(DTMP) > 0 then
156 end process proc_comm;
175 if R_SHC(5) = '0' then
184 if unsigned(R_SHC) = 0 then
188 end process proc_shc;
195 variable div_zero : slbit := '0';
196 variable div_ovfl : slbit := '0';
197 variable shftdd : slbit := '0';
198 variable subadd : slbit := '0';
200 variable dd_le : slbit := '0';
201 variable dd_ge : slbit := '0';
202 variable dd_gt : slbit := '0';
204 variable qbit : slbit := '0';
205 variable qbit_1 : slbit := '0';
206 variable qbit_n : slbit := '0';
208 variable dd_h_old : slv16 := (others=>'0');
209 variable dd_h_new : slv16 := (others=>'0');
222 qbit_1 := not (DR(15) xor DD_H(15));
228 dd_h_old := DD_H(15 downto 0);
238 dd_h_new := slv(signed(dd_h_old) + signed(DR));
240 dd_h_new := slv(signed(dd_h_old) - signed(DR));
244 if signed(dd_h_new) <= 0 then
249 if signed(dd_h_new) >= -1 then
254 if dd_h_new(15) = '0' and
255 (unsigned(dd_h_new(14 downto 0))/=0 or
256 unsigned(R_DD_L(14 downto 0))/=0)
262 qbit_n := DR(15) xor not dd_h_new(15);
265 qbit_n := DR(15) xor dd_gt;
267 qbit_n := dd_h_new(15);
291 if dd_h_new(15) = '0' then
339 end process proc_div;
356 if R_SHC(5) = '0' then
362 if FUNC = c_munit_func_ash then
370 end process proc_ash;
377 variable prod : slv32 := (others=>'0');
378 variable omux_sel : slv2 := "00";
379 variable ash_dout0 : slbit := '0';
381 variable mul_c : slbit := '0';
388 when c_munit_func_mul =>
390 when c_munit_func_div =>
392 when c_munit_func_ash |c_munit_func_ashc =>
393 if R_SHC(5) = '0' then
401 if FUNC = c_munit_func_ash then
404 ash_dout0 := DTMP(15);
409 DOUT <= prod(31 downto 16);
410 DOUTE <= prod(15 downto 0);
415 DOUT <= DSRC(14 downto 0) & ash_dout0;
424 if DSRC(15) = '0' then
435 when c_munit_func_mul =>
438 CCOUT(c_cc_f_v) <= '0';
439 CCOUT(c_cc_f_c) <= mul_c;
441 when c_munit_func_div =>
443 CCOUT(c_cc_f_n) <= '0';
444 CCOUT(c_cc_f_z) <= '1';
447 CCOUT(c_cc_f_z) <= '0';
455 when c_munit_func_ash =>
461 when c_munit_func_ashc =>
470 end process proc_omux;
slv16 :=( others => '0') R_DD_L
slv6 :=( others => '0') R_SHC
slv16 :=( others => '0') N_DD_L
slv6 :=( others => '0') N_SHC
slv16 :=( others => '0') DOUT_DIV
slv16 :=( others => '0') DOUTE_DIV
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 31 downto 0) slv32
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 5 downto 0) slv6
std_logic_vector( 1 downto 0) slv2