OpenCores
URL https://opencores.org/ocsvn/tg68kc/tg68kc/trunk

Subversion Repositories tg68kc

[/] [tg68kc/] [trunk/] [TG68K_ALU.vhd] - Diff between revs 8 and 10

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 8 Rev 10
Line 235... Line 235...
                                END IF;
                                END IF;
                        END IF;
                        END IF;
                ELSIF exec(opcDIVU)='1' AND DIV_Mode/=3 THEN
                ELSIF exec(opcDIVU)='1' AND DIV_Mode/=3 THEN
                        IF exe_opcode(15)='1' OR DIV_Mode=0 THEN
                        IF exe_opcode(15)='1' OR DIV_Mode=0 THEN
--                      IF exe_opcode(15)='1' THEN
--                      IF exe_opcode(15)='1' THEN
                                OP1in <= result_div(47 downto 32)&result_div(15 downto 0);
                                OP1in <= result_div(47 downto 32)&result_div(15 downto 0);       --word 
                        ELSE            --64bit
                        ELSE            --64bit
                                IF exec(write_reminder)='1' THEN
                                IF exec(write_reminder)='1' THEN
                                        OP1in <= result_div(63 downto 32);
                                        OP1in <= result_div(63 downto 32);
                                ELSE
                                ELSE
                                        OP1in <= result_div(31 downto 0);
                                        OP1in <= result_div(31 downto 0);
Line 384... Line 384...
                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;
 
--              IF cpu(1)='1' THEN
        Vflag_a <= '0'; --TG 01.11.2019 only for cputest -- but other behaiver in real 68000 Hardware ??? I must check this later
        Vflag_a <= '0'; --TG 01.11.2019 only for cputest -- but other behaiver in real 68000 Hardware ??? I must check this later
 
--              END IF;
                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 981... Line 983...
                                        IF (exec(opcADD) OR exec(opcCMP))='1' THEN
                                        IF (exec(opcADD) OR exec(opcCMP))='1' THEN
                                                Flags(3 downto 0) <= set_flags;
                                                Flags(3 downto 0) <= set_flags;
                                        ELSIF exec(opcDIVU)='1' AND DIV_Mode/=3 THEN
                                        ELSIF exec(opcDIVU)='1' AND DIV_Mode/=3 THEN
                                                IF V_Flag='1' THEN
                                                IF V_Flag='1' THEN
                                                        Flags(3 downto 0) <= "1010";
                                                        Flags(3 downto 0) <= "1010";
                                                ELSE
                                                ELSIF exe_opcode(15)='1' OR DIV_Mode=0 THEN
                                                        Flags(3 downto 0) <= OP1IN(15)&flag_z(1)&"00";
                                                        Flags(3 downto 0) <= OP1IN(15)&flag_z(1)&"00";
 
                                                ELSE
 
                                                        Flags(3 downto 0) <= OP1IN(31)&flag_z(2)&"00";
                                                END IF;
                                                END IF;
                                        ELSIF exec(write_reminder)='1' AND MUL_Mode/=3 THEN -- z-flag MULU.l
                                        ELSIF exec(write_reminder)='1' AND MUL_Mode/=3 THEN -- z-flag MULU.l
                                                Flags(3) <= set_flags(3);
                                                Flags(3) <= set_flags(3);
                                                Flags(2) <= set_flags(2) AND Flags(2);
                                                Flags(2) <= set_flags(2) AND Flags(2);
                                                Flags(1) <= '0';
                                                Flags(1) <= '0';
Line 1025... Line 1029...
                                                IF OP1out(15 downto 0)=X"0000" AND (exe_datatype="01" OR OP1out(31 downto 16)=X"0000") THEN
                                                IF OP1out(15 downto 0)=X"0000" AND (exe_datatype="01" OR OP1out(31 downto 16)=X"0000") THEN
                                                        Flags(2) <='1';
                                                        Flags(2) <='1';
                                                ELSE
                                                ELSE
                                                        Flags(2) <='0';
                                                        Flags(2) <='0';
                                                END IF;
                                                END IF;
                                                Flags(1 downto 0) <= "00";
                                                Flags(1) <= '0';
 
                                                Flags(0) <= NOT set_flags(0);
                                        END IF;
                                        END IF;
                                END IF;
                                END IF;
                        END IF;
                        END IF;
                        Flags(7 downto 5) <= "000";
                        Flags(7 downto 5) <= "000";
                END IF;
                END IF;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.