[Donate]

library ieee;
use ieee.std_logic_1164.all;
use work.config.all;

-- PREFIX: mde_xxx
package m68kdecode is

-------------------------------------------------------------------------------

type mde_decinsn is (
  insn_abcd,   insn_add,    insn_addx,   insn_addq,   
  insn_and,    insn_or,     insn_eor,    
  insn_sh,     insn_shm,    
  insn_chk,    insn_clr,    insn_neg,    insn_negx,   insn_not,    
  insn_cmp,    insn_cmpa,   insn_cmpm,   
  insn_bitr,   
  insn_mov,    
  insn_im,     
  insn_jmp,    insn_bcc,       
  insn_dbcc,   insn_tas,    insn_tst,    insn_lnk,    
  insn_pea,    insn_lea,    
  insn_ext,    
  insn_exg,    
  insn_nop,    insn_rst,    insn_rte,    insn_rtr,    insn_rts,    insn_stop,   
  insn_trap,   insn_trapv,  
  insn_undef
);

function mde_decode(
  insn : in std_logic_vector(31 downto 0)
) return mde_decinsn;
  
end m68kdecode;

package body m68kdecode is

-- automatically generated by soft/cdef/m68k.el: use fun-call: "(insert (print-decoder-vhd-pre h))"
function mde_decode(
  insn : in std_logic_vector(31 downto 0)
) return mde_decinsn is
begin

case insn(31 downto 31) is  
when "0"=>
 case insn(30 downto 30) is  
 when "1"=>
  case insn(29 downto 28) is  
  when "00"=>
   case insn(24 downto 24) is  
   when "0"=>
    case insn(27 downto 27) is  
    when "1"=>
     case insn(26 downto 25) is  
     when "11"=>
      case insn(23 downto 23) is  
      when "0"=>
       case insn(22 downto 22) is  
       when "1"=>
        case insn(21 downto 20) is  
        when "11"=>
         case insn(19 downto 19) is  
         when "0"=>
          case insn(18 downto 16) is  
          when "110"=>
           return insn_trapv;
          when "010"=>
           return insn_stop;
          when "101"=>
           return insn_rts;
          when "111"=>
           return insn_rtr;
          when "011"=>
           return insn_rte;
          when "000"=>
           return insn_rst;
          when "001"=>
           return insn_nop;
          when others =>
          end case;
         when others =>
         end case;
        when "00"=>
         return insn_trap;
        when "01"=>
         return insn_lnk;
        when others =>
        end case;
       when others =>
       end case;
      when "1"=>
       return insn_jmp;
      when others =>
      end case;
     when "00"=>
      case insn(23 downto 23) is  
      when "1"=>
       case insn(21 downto 20) is  
       when "00"=>
        case insn(19 downto 19) is  
        when "0"=>
         return insn_ext;
        when others =>
        end case;
       when others =>
       end case;
      when "0"=>
       case insn(22 downto 22) is  
       when "1"=>
        case insn(21 downto 20) is  
        when "00"=>
         case insn(19 downto 19) is  
         when "0"=>
          return insn_dbcc;
         when others =>
         end case;
        when others =>
        end case;
        return insn_pea; --default
       when others =>
       end case;
      when others =>
      end case;
     when "01"=>
      case insn(23 downto 23) is  
      when "1"=>
       case insn(22 downto 22) is  
       when "1"=>
        return insn_tas;
       when others =>
       end case;
      when others =>
      end case;
      return insn_tst; --default
     when others =>
     end case;
    when "0"=>
     case insn(26 downto 25) is  
     when "11"=>
      return insn_not;
     when "00"=>
      return insn_negx;
     when "10"=>
      return insn_neg;
     when "01"=>
      return insn_clr;
     when others =>
     end case;
    when others =>
    end case;
   when "1"=>
    case insn(23 downto 23) is  
    when "1"=>
     case insn(22 downto 22) is  
     when "1"=>
      return insn_lea;
     when "0"=>
      return insn_chk;
     when others =>
     end case;
    when others =>
    end case;
   when others =>
   end case;
  when "10"=>
   return insn_bcc;
  when "01"=>
   return insn_addq;
  when others =>
  end case;
 when "0"=>
  case insn(29 downto 28) is  
  when "00"=>
   case insn(24 downto 24) is  
   when "0"=>
    return insn_im;
   when "1"=>
    return insn_bitr;
   when others =>
   end case;
  when others =>
  end case;
  return insn_mov; --default
 when others =>
 end case;
when "1"=>
 case insn(29 downto 28) is  
 when "00"=>
  case insn(30 downto 30) is  
  when "1"=>
   case insn(24 downto 24) is  
   when "1"=>
    return insn_exg;
   when others =>
   end case;
   return insn_and; --default
  when "0"=>
   return insn_or;
  when others =>
  end case;
   -- default:
    case insn(24 downto 24) is  
  when "1"=>
   case insn(23 downto 23) is  
   when "0"=>
    case insn(22 downto 22) is  
    when "0"=>
     case insn(21 downto 20) is  
     when "00"=>
      return insn_abcd;
     when others =>
     end case;
    when others =>
    end case;
   when others =>
   end case;
  when others =>
  end case;
 when "11"=>
  case insn(30 downto 30) is  
  when "0"=>
   case insn(24 downto 24) is  
   when "1"=>
    case insn(21 downto 20) is  
    when "00"=>
     case insn(19 downto 19) is  
     when "1"=>
      return insn_cmpm;
     when others =>
     end case;
    when others =>
    end case;
    return insn_eor; --default
   when "0"=>
    case insn(23 downto 23) is  
    when "1"=>
     case insn(22 downto 22) is  
     when "1"=>
      return insn_cmp;
     when others =>
     end case;
    when others =>
    end case;
   when others =>
   end case;
    -- default:
      case insn(23 downto 23) is  
   when "1"=>
    case insn(22 downto 22) is  
    when "1"=>
     return insn_cmpa;
    when others =>
    end case;
   when others =>
   end case;
  when others =>
  end case;
 when "10"=>
  case insn(30 downto 30) is  
  when "1"=>
   case insn(27 downto 27) is  
   when "0"=>
    case insn(23 downto 23) is  
    when "1"=>
     case insn(22 downto 22) is  
     when "1"=>
      return insn_shm;
     when others =>
     end case;
    when others =>
    end case;
   when others =>
   end case;
   return insn_sh; --default
  when others =>
  end case;
 when "01"=>
  case insn(24 downto 24) is  
  when "1"=>
   case insn(21 downto 20) is  
   when "00"=>
    return insn_addx;
   when others =>
   end case;
   return insn_add; --default
  when others =>
  end case;
 when others =>
 end case;
when others =>
end case;

return insn_undef;
end;

end m68kdecode;


If you have question mail to: Konrad Eisele<eiselekd@web.de>, created: Wed Apr 14 13:07:33 WEDT 2004 ;
This is part of the Core distribution

Valid HTML 4.0!