Update TG68K.

This commit is contained in:
sorgelig 2020-05-11 01:57:31 +08:00
parent bc370736d3
commit 1b5314cc30
4 changed files with 3921 additions and 2859 deletions

View File

@ -291,7 +291,7 @@ wire cpu_clkena = cep && (cpuBusControl || (cpu_busstate == 2'b01));
reg [15:0] cpuDataIn;
always @(posedge clk_sys) if(cel && cpuBusControl && ~cpu_busstate[0] && _cpuRW) cpuDataIn <= dataControllerDataOut;
TG68KdotC_Kernel #(0,0,0,0,0,0) m68k
TG68KdotC_Kernel #(0,0,0,0,0,0, 0,1) m68k
(
.clk ( clk_sys ),
.nReset ( _cpuReset ),
@ -302,7 +302,7 @@ TG68KdotC_Kernel #(0,0,0,0,0,0) m68k
.berr ( 1'b0 ),
.clr_berr ( 1'b0 ),
.CPU ( 2'b00 ), // 00=68000
.addr ( {cpuAddrHi, cpuAddr} ),
.addr_out ( {cpuAddrHi, cpuAddr} ),
.data_write ( cpuDataOut ),
.nUDS ( _cpuUDS ),
.nLDS ( _cpuLDS ),

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- --
-- Copyright (c) 2009-2013 Tobias Gubener --
-- Copyright (c) 2009-2020 Tobias Gubener --
-- Patches by MikeJ, Till Harbaum, Rok Krajnk, ... --
-- Subdesign fAMpIGA by TobiFlex --
-- --
-- This source file is free software: you can redistribute it and/or modify --
-- it under the terms of the GNU General Public License as published --
-- it under the terms of the GNU Lesser General Public License as published --
-- by the Free Software Foundation, either version 3 of the License, or --
-- (at your option) any later version. --
-- --
@ -27,9 +28,11 @@ package TG68K_Pack is
type micro_states is (idle, nop, ld_nn, st_nn, ld_dAn1, ld_AnXn1, ld_AnXn2, st_dAn1, ld_AnXnbd1, ld_AnXnbd2, ld_AnXnbd3,
ld_229_1, ld_229_2, ld_229_3, ld_229_4, st_229_1, st_229_2, st_229_3, st_229_4,
st_AnXn1, st_AnXn2, bra1, bsr1, bsr2, nopnop, dbcc1, movem1, movem2, movem3,
andi, op_AxAy, cmpm, link1, link2, unlink1, unlink2, int1, int2, int3, int4, rte1, rte2, rte3, trap0, trap1, trap2, trap3,
andi, pack1, pack2, pack3, op_AxAy, cmpm, link1, link2, unlink1, unlink2, int1, int2, int3, int4, rte1, rte2, rte3,
rte4, rte5, rtd1, rtd2, trap00, trap0, trap1, trap2, trap3, cas1, cas2, cas21, cas22, cas23, cas24,
cas25, cas26, cas27, cas28, chk20, chk21, chk22, chk23, chk24,
trap4, trap5, trap6, movec1, movep1, movep2, movep3, movep4, movep5, rota1, bf1,
mul1, mul2, mul_end1, mul_end2, div1, div2, div3, div4, div_end1, div_end2, pack1, pack2, pack3);
mul1, mul2, mul_end1, mul_end2, div1, div2, div3, div4, div_end1, div_end2);
constant opcMOVE : integer := 0; --
constant opcMOVEQ : integer := 1; --
@ -108,113 +111,39 @@ package TG68K_Pack is
constant opcRESET : integer := 74; --
constant opcBF : integer := 75; --
constant opcBFwb : integer := 76; --
constant s2nd_hbits : integer := 77; --
constant opcPACK : integer := 77; --
-- constant s2nd_hbits : integer := 77; --
constant opcUNPACK : integer := 78; --
constant hold_ea_data : integer := 79; --
constant store_ea_packdata : integer := 80; --
constant exec_BS : integer := 81; --
constant hold_OP2 : integer := 82; --
constant restore_ADDR : integer := 83; --
constant alu_exec : integer := 84; --
constant alu_move : integer := 85; --
constant alu_setFlags : integer := 86; --
constant opcCHK2 : integer := 87; --
constant opcEXTB : integer := 88; --
-- constant : integer := 75; --
-- constant : integer := 76; --
-- constant : integer := 7; --
-- constant : integer := 7; --
-- constant : integer := 7; --
constant lastOpcBit : integer := 77;
type rTG68K_opc is record
opcMOVE : bit;
opcMOVEQ : bit;
opcMOVESR : bit;
opcADD : bit;
opcADDQ : bit;
opcOR : bit;
opcAND : bit;
opcEOR : bit;
opcCMP : bit;
opcROT : bit;
opcCPMAW : bit;
opcEXT : bit;
opcABCD : bit;
opcSBCD : bit;
opcBITS : bit;
opcSWAP : bit;
opcScc : bit;
andiSR : bit;
eoriSR : bit;
oriSR : bit;
opcMULU : bit;
opcDIVU : bit;
dispouter : bit;
rot_nop : bit;
ld_rot_cnt : bit;
writePC_add : bit;
ea_data_OP1 : bit;
ea_data_OP2 : bit;
use_XZFlag : bit;
get_bfoffset : bit;
save_memaddr : bit;
opcCHK : bit;
movec_rd : bit;
movec_wr : bit;
Regwrena : bit;
update_FC : bit;
linksp : bit;
movepl : bit;
update_ld : bit;
OP1addr : bit;
write_reg : bit;
changeMode : bit;
ea_build : bit;
trap_chk : bit;
store_ea_data : bit;
addrlong : bit;
postadd : bit;
presub : bit;
subidx : bit;
no_Flags : bit;
use_SP : bit;
to_CCR : bit;
to_SR : bit;
OP2out_one : bit;
OP1out_zero : bit;
mem_addsub : bit;
addsub : bit;
directPC : bit;
direct_delta : bit;
directSR : bit;
directCCR : bit;
exg : bit;
get_ea_now : bit;
ea_to_pc : bit;
hold_dwr : bit;
to_USP : bit;
from_USP : bit;
write_lowlong : bit;
write_reminder : bit;
movem_action : bit;
briefext : bit;
get_2ndOPC : bit;
mem_byte : bit;
longaktion : bit;
opcRESET : bit;
opcBF : bit;
opcBFwb : bit;
s2nd_hbits : bit;
end record;
constant lastOpcBit : integer := 88;
component TG68K_ALU
generic(
MUL_Mode : integer := 0; --0=>16Bit, 1=>32Bit, 2=>switchable with CPU(1), 3=>no MUL,
DIV_Mode : integer := 0 --0=>16Bit, 1=>32Bit, 2=>switchable with CPU(1), 3=>no DIV,
MUL_Mode :integer; --0=>16Bit, 1=>32Bit, 2=>switchable with CPU(1), 3=>no MUL,
MUL_Hardware :integer; --0=>no, 1=>yes,
DIV_Mode :integer; --0=>16Bit, 1=>32Bit, 2=>switchable with CPU(1), 3=>no DIV,
BarrelShifter :integer --0=>no, 1=>yes, 2=>switchable with CPU(1)
);
port(
clk : in std_logic;
Reset : in std_logic;
CPU : in std_logic_vector(1 downto 0):="00"; -- 00->68000 01->68010 11->68020(only some parts - yet)
clkena_lw : in std_logic:='1';
execOPC : in bit;
decodeOPC : in bit;
exe_condition : in std_logic;
exec_tas : in std_logic;
long_start : in bit;
non_aligned : in std_logic;
movem_presub : in bit;
set_stop : in bit;
Z_error : in bit;
@ -225,7 +154,7 @@ package TG68K_Pack is
reg_QA : in std_logic_vector(31 downto 0);
reg_QB : in std_logic_vector(31 downto 0);
opcode : in std_logic_vector(15 downto 0);
datatype : in std_logic_vector(1 downto 0);
-- datatype : in std_logic_vector(1 downto 0);
exe_opcode : in std_logic_vector(15 downto 0);
exe_datatype : in std_logic_vector(1 downto 0);
sndOPC : in std_logic_vector(15 downto 0);
@ -237,6 +166,7 @@ package TG68K_Pack is
bf_ext_out : out std_logic_vector(7 downto 0);
bf_shift : in std_logic_vector(5 downto 0);
bf_width : in std_logic_vector(5 downto 0);
bf_ffo_offset : in std_logic_vector(31 downto 0);
bf_loffset : in std_logic_vector(4 downto 0);
set_V_Flag : buffer bit;

File diff suppressed because it is too large Load Diff