Line 189... |
Line 189... |
signal bit_nr7 : std_logic_vector(6 downto 0);
|
signal bit_nr7 : std_logic_vector(6 downto 0);
|
signal bit_msb : std_logic_vector(5 downto 0);
|
signal bit_msb : std_logic_vector(5 downto 0);
|
signal bs_shift : std_logic_vector(5 downto 0);
|
signal bs_shift : std_logic_vector(5 downto 0);
|
signal bs_shift_mod : std_logic_vector(5 downto 0);
|
signal bs_shift_mod : std_logic_vector(5 downto 0);
|
signal asl_over : std_logic_vector(32 downto 0);
|
signal asl_over : std_logic_vector(32 downto 0);
|
|
signal asl_over_xor : std_logic_vector(32 downto 0);
|
signal asr_sign : std_logic_vector(32 downto 0);
|
signal asr_sign : std_logic_vector(32 downto 0);
|
signal msb : std_logic;
|
signal msb : std_logic;
|
signal ring : std_logic_vector(5 downto 0);
|
signal ring : std_logic_vector(5 downto 0);
|
signal ALU : std_logic_vector(31 downto 0);
|
signal ALU : std_logic_vector(31 downto 0);
|
signal BSout : std_logic_vector(31 downto 0);
|
signal BSout : std_logic_vector(31 downto 0);
|
Line 211... |
Line 212... |
BEGIN
|
BEGIN
|
ALUout <= OP1in;
|
ALUout <= OP1in;
|
ALUout(7) <= OP1in(7) OR exec_tas;
|
ALUout(7) <= OP1in(7) OR exec_tas;
|
IF exec(opcBFwb)='1' THEN
|
IF exec(opcBFwb)='1' THEN
|
ALUout <= result(31 downto 0);
|
ALUout <= result(31 downto 0);
|
-- ALUout <= bf_datareg(31 downto 0);
|
|
IF bf_fffo='1' THEN
|
IF bf_fffo='1' THEN
|
-- ALUout <= (OTHERS =>'0');
|
|
-- ALUout(5 downto 0) <= bf_firstbit + bf_shift;
|
|
-- ALUout(5 downto 0) <= bf_firstbit;
|
|
ALUout <= bf_ffo_offset - bf_firstbit;
|
ALUout <= bf_ffo_offset - bf_firstbit;
|
END IF;
|
END IF;
|
END IF;
|
END IF;
|
|
|
OP1in <= addsub_q;
|
OP1in <= addsub_q;
|
Line 391... |
Line 388... |
ELSE --opcSBCD
|
ELSE --opcSBCD
|
Vflag_a <= bcd_pur(8) AND NOT bcd_a(7);
|
Vflag_a <= bcd_pur(8) AND NOT bcd_a(7);
|
-- bcd_pur <= ('0'&OP1out(7 downto 0)&'0') - ('0'&OP2out(7 downto 0)&Flags(4));
|
-- bcd_pur <= ('0'&OP1out(7 downto 0)&'0') - ('0'&OP2out(7 downto 0)&Flags(4));
|
bcd_a <= bcd_pur(9 downto 1) - bcd_kor;
|
bcd_a <= bcd_pur(9 downto 1) - bcd_kor;
|
END IF;
|
END IF;
|
|
Vflag_a <= '0'; --nur zum testen
|
bcd_a_carry <= bcd_pur(9) OR bcd_a(8);
|
bcd_a_carry <= bcd_pur(9) OR bcd_a(8);
|
END PROCESS;
|
END PROCESS;
|
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Bits
|
-- Bits
|
Line 716... |
Line 714... |
|
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
-- Barrel Shifter
|
-- Barrel Shifter
|
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
process (OP1out, OP2out, opcode, bit_nr, bit_nr7, bit_msb, hot_bit, bs_shift, bs_shift_mod, ring, result_bs, exe_opcode, vector,
|
process (OP1out, OP2out, opcode, bit_nr, bit_nr7, bit_msb, hot_bit, bs_shift, bs_shift_mod, ring, result_bs, exe_opcode, vector,
|
rot_bits, Flags, msb, hot_msb, asl_over, ALU, asr_sign, exec)
|
rot_bits, Flags, msb, hot_msb, asl_over, asl_over_xor, ALU, asr_sign, exec)
|
begin
|
begin
|
ring <= "100000";
|
ring <= "100000";
|
IF rot_bits="10" THEN --ROX L/R
|
IF rot_bits="10" THEN --ROX L/R
|
CASE exe_opcode(7 downto 6) IS
|
CASE exe_opcode(7 downto 6) IS
|
WHEN "00" => --Byte
|
WHEN "00" => --Byte
|
Line 778... |
Line 776... |
|
|
|
|
-- calc V-Flag by ASL
|
-- calc V-Flag by ASL
|
hot_msb <= (OTHERS =>'0');
|
hot_msb <= (OTHERS =>'0');
|
hot_msb(conv_integer(bit_msb)) <= '1';
|
hot_msb(conv_integer(bit_msb)) <= '1';
|
if bs_shift > ring then
|
IF bs_shift > ring THEN
|
bit_msb <= "000000";
|
bit_msb <= "000000";
|
else
|
ELSE
|
bit_msb <= ring-bs_shift;
|
bit_msb <= ring-bs_shift;
|
end if;
|
END IF;
|
asl_over <= ((('0'&vector(30 downto 0)) XOR ('0'&vector(31 downto 1)))&'0') - ('0'&hot_msb(31 downto 0));
|
asl_over_xor <= (('0'&vector(30 downto 0)) XOR ('0'&vector(31 downto 1)))&msb;
|
|
CASE exe_opcode(7 downto 6) IS
|
|
WHEN "00" => --Byte
|
|
asl_over_xor(8) <= '0';
|
|
WHEN "01"|"11" => --Word
|
|
asl_over_xor(16) <= '0';
|
|
WHEN OTHERS => NULL;
|
|
END CASE;
|
|
asl_over <= asl_over_xor - ('0'&hot_msb(31 downto 0));
|
bs_V <= '0';
|
bs_V <= '0';
|
IF rot_bits="00" AND exe_opcode(8)='1' THEN --ASL
|
IF rot_bits="00" AND exe_opcode(8)='1' THEN --ASL
|
bs_V <= not asl_over(32);
|
bs_V <= not asl_over(32);
|
END IF;
|
END IF;
|
|
|
Line 822... |
Line 828... |
WHEN "10" => --Long
|
WHEN "10" => --Long
|
ALU <= result_bs(31 downto 0) OR result_bs(63 downto 32);
|
ALU <= result_bs(31 downto 0) OR result_bs(63 downto 32);
|
bs_C <= ALU(31);
|
bs_C <= ALU(31);
|
WHEN OTHERS => NULL;
|
WHEN OTHERS => NULL;
|
END CASE;
|
END CASE;
|
IF exe_opcode(0)='1' THEN --left shift
|
IF exe_opcode(8)='1' THEN --left shift
|
bs_C <= ALU(0);
|
bs_C <= ALU(0);
|
END IF;
|
END IF;
|
ELSIF rot_bits="10" THEN --ROX L/R
|
ELSIF rot_bits="10" THEN --ROX L/R
|
CASE exe_opcode(7 downto 6) IS
|
CASE exe_opcode(7 downto 6) IS
|
WHEN "00" => --Byte
|
WHEN "00" => --Byte
|
Line 863... |
Line 869... |
|
|
-- calc ASR sign
|
-- calc ASR sign
|
BSout <= ALU;
|
BSout <= ALU;
|
asr_sign <= (OTHERS =>'0');
|
asr_sign <= (OTHERS =>'0');
|
asr_sign(32 downto 1) <= asr_sign(31 downto 0) OR hot_msb(31 downto 0);
|
asr_sign(32 downto 1) <= asr_sign(31 downto 0) OR hot_msb(31 downto 0);
|
-- IF opcode(2 downto 0)="000" AND msb='1' THEN --ASR
|
|
IF rot_bits="00" AND exe_opcode(8)='0' AND msb='1' THEN --ASR
|
IF rot_bits="00" AND exe_opcode(8)='0' AND msb='1' THEN --ASR
|
BSout <= ALU or asr_sign(32 downto 1);
|
BSout <= ALU or asr_sign(32 downto 1);
|
IF bs_shift > ring THEN
|
IF bs_shift > ring THEN
|
bs_C <= '1';
|
bs_C <= '1';
|
bs_X <= '1';
|
bs_X <= '1';
|