mirror of
https://github.com/mist-devel/mist-board.git
synced 2026-02-26 00:04:08 +00:00
[TG68K] Some bitfield tests
This commit is contained in:
@@ -4,7 +4,7 @@ M68K_RUN = m68k_run
|
||||
SRCS = TG68K_ALU.vhd TG68K_Pack.vhd TG68KdotC_Kernel.vhd $(TG68K_RUN).vhd mem_if.vhd
|
||||
OBJS = $(SRCS:.vhd=.o) mem_if_c.o mem.o
|
||||
GHW = $(TG68K_RUN).ghw
|
||||
TOOLS=../../tools
|
||||
TOOLS=../../../tools
|
||||
ZIP = tg68k_run.zip
|
||||
PATCH = tg68k.patch
|
||||
M68K_RUN_OBJS = $(M68K_RUN).o mem.o m68kcpu.o m68kops.o m68kopnz.o m68kopac.o m68kopdm.o
|
||||
@@ -33,7 +33,7 @@ Musashi/m68kopnz.c: Musashi/m68kops.h
|
||||
Musashi/m68kopdm.c: Musashi/m68kops.h
|
||||
Musashi/m68kopac.c: Musashi/m68kops.h
|
||||
|
||||
$(CODE).bin: $(CODE).s tests/bcd.s tests/bfxxx.s tests/cmpi_d16_pc.s
|
||||
$(CODE).bin: $(CODE).s tests/bcd.s tests/bfxxx.s tests/cmpi_d16_pc.s tests/pack.s tests/trace.s tests/magic.s
|
||||
|
||||
Musashi/m68kops.h: Musashi/m68kmake Musashi/m68k_in.c
|
||||
cd Musashi; ./m68kmake
|
||||
@@ -44,8 +44,8 @@ $(M68K_RUN): $(M68K_RUN_OBJS)
|
||||
test: $(M68K_RUN) $(CODE).bin
|
||||
./$(M68K_RUN) $(CODE).bin
|
||||
|
||||
vtest: tg68k_run $(CODE).bin
|
||||
ghdl -r tg68k_run --ieee-asserts=disable --stop-time=20000ns --wave=$(GHW)
|
||||
vtest: $(TG68K_RUN) $(CODE).bin
|
||||
ghdl -r $(TG68K_RUN) --ieee-asserts=disable --stop-time=2000000ns --wave=$(GHW)
|
||||
|
||||
clean::
|
||||
rm -f work-obj93.cf *.o Musashi/m68kop* $(CODE).bin *~ *.lst *.ghw $(TG68K_RUN) ghwreplay Musashi/m68kmake $(M68K_RUN)
|
||||
@@ -54,8 +54,8 @@ $(GHW): $(TG68K_RUN) Makefile
|
||||
ghdl -r $< --ieee-asserts=disable --stop-time=20000ns --wave=$@
|
||||
|
||||
disasm: $(CODE).bin
|
||||
# $(TOOLS)/tools/m68kdis/m68kdis -020 $(CODE).bin
|
||||
cat $(CODE).bin.s
|
||||
$(TOOLS)/m68kdis/m68kdis -020 $(CODE).bin
|
||||
cat `basename $(CODE).bin.s`
|
||||
|
||||
view: $(GHW)
|
||||
gtkwave $< $(TG68K_RUN).sav
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,252 +1,243 @@
|
||||
------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------
|
||||
-- --
|
||||
-- Copyright (c) 2009-2013 Tobias Gubener --
|
||||
-- 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 --
|
||||
-- by the Free Software Foundation, either version 3 of the License, or --
|
||||
-- (at your option) any later version. --
|
||||
-- --
|
||||
-- This source file is distributed in the hope that it will be useful, --
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --
|
||||
-- GNU General Public License for more details. --
|
||||
-- --
|
||||
-- You should have received a copy of the GNU General Public License --
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>. --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
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, rte4, rte5, trap00, trap0, trap1, trap2, trap3,
|
||||
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);
|
||||
|
||||
constant opcMOVE : integer := 0; --
|
||||
constant opcMOVEQ : integer := 1; --
|
||||
constant opcMOVESR : integer := 2; --
|
||||
constant opcADD : integer := 3; --
|
||||
constant opcADDQ : integer := 4; --
|
||||
constant opcOR : integer := 5; --
|
||||
constant opcAND : integer := 6; --
|
||||
constant opcEOR : integer := 7; --
|
||||
constant opcCMP : integer := 8; --
|
||||
constant opcROT : integer := 9; --
|
||||
constant opcCPMAW : integer := 10;
|
||||
constant opcEXT : integer := 11; --
|
||||
constant opcABCD : integer := 12; --
|
||||
constant opcSBCD : integer := 13; --
|
||||
constant opcBITS : integer := 14; --
|
||||
constant opcSWAP : integer := 15; --
|
||||
constant opcScc : integer := 16; --
|
||||
constant andiSR : integer := 17; --
|
||||
constant eoriSR : integer := 18; --
|
||||
constant oriSR : integer := 19; --
|
||||
constant opcMULU : integer := 20; --
|
||||
constant opcDIVU : integer := 21; --
|
||||
constant dispouter : integer := 22; --
|
||||
constant rot_nop : integer := 23; --
|
||||
constant ld_rot_cnt : integer := 24; --
|
||||
constant writePC_add : integer := 25; --
|
||||
constant ea_data_OP1 : integer := 26; --
|
||||
constant ea_data_OP2 : integer := 27; --
|
||||
constant use_XZFlag : integer := 28; --
|
||||
constant get_bfoffset : integer := 29; --
|
||||
constant save_memaddr : integer := 30; --
|
||||
constant opcCHK : integer := 31; --
|
||||
constant movec_rd : integer := 32; --
|
||||
constant movec_wr : integer := 33; --
|
||||
constant Regwrena : integer := 34; --
|
||||
constant update_FC : integer := 35; --
|
||||
constant linksp : integer := 36; --
|
||||
constant movepl : integer := 37; --
|
||||
constant update_ld : integer := 38; --
|
||||
constant OP1addr : integer := 39; --
|
||||
constant write_reg : integer := 40; --
|
||||
constant changeMode : integer := 41; --
|
||||
constant ea_build : integer := 42; --
|
||||
constant trap_chk : integer := 43; --
|
||||
constant store_ea_data : integer := 44; --
|
||||
constant addrlong : integer := 45; --
|
||||
constant postadd : integer := 46; --
|
||||
constant presub : integer := 47; --
|
||||
constant subidx : integer := 48; --
|
||||
constant no_Flags : integer := 49; --
|
||||
constant use_SP : integer := 50; --
|
||||
constant to_CCR : integer := 51; --
|
||||
constant to_SR : integer := 52; --
|
||||
constant OP2out_one : integer := 53; --
|
||||
constant OP1out_zero : integer := 54; --
|
||||
constant mem_addsub : integer := 55; --
|
||||
constant addsub : integer := 56; --
|
||||
constant directPC : integer := 57; --
|
||||
constant direct_delta : integer := 58; --
|
||||
constant directSR : integer := 59; --
|
||||
constant directCCR : integer := 60; --
|
||||
constant exg : integer := 61; --
|
||||
constant get_ea_now : integer := 62; --
|
||||
constant ea_to_pc : integer := 63; --
|
||||
constant hold_dwr : integer := 64; --
|
||||
constant to_USP : integer := 65; --
|
||||
constant from_USP : integer := 66; --
|
||||
constant write_lowlong : integer := 67; --
|
||||
constant write_reminder : integer := 68; --
|
||||
constant movem_action : integer := 69; --
|
||||
constant briefext : integer := 70; --
|
||||
constant get_2ndOPC : integer := 71; --
|
||||
constant mem_byte : integer := 72; --
|
||||
constant longaktion : integer := 73; --
|
||||
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 : 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;
|
||||
|
||||
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,
|
||||
);
|
||||
port(
|
||||
clk : in std_logic;
|
||||
Reset : in std_logic;
|
||||
clkena_lw : in std_logic:='1';
|
||||
execOPC : in bit;
|
||||
exe_condition : in std_logic;
|
||||
exec_tas : in std_logic;
|
||||
long_start : in bit;
|
||||
movem_presub : in bit;
|
||||
set_stop : in bit;
|
||||
Z_error : in bit;
|
||||
rot_bits : in std_logic_vector(1 downto 0);
|
||||
exec : in bit_vector(lastOpcBit downto 0);
|
||||
OP1out : in std_logic_vector(31 downto 0);
|
||||
OP2out : in std_logic_vector(31 downto 0);
|
||||
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);
|
||||
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);
|
||||
last_data_read : in std_logic_vector(15 downto 0);
|
||||
data_read : in std_logic_vector(15 downto 0);
|
||||
FlagsSR : in std_logic_vector(7 downto 0);
|
||||
micro_state : in micro_states;
|
||||
bf_ext_in : in std_logic_vector(7 downto 0);
|
||||
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_loffset : in std_logic_vector(4 downto 0);
|
||||
bf_offset : in std_logic_vector(5 downto 0);
|
||||
|
||||
set_V_Flag : buffer bit;
|
||||
Flags : buffer std_logic_vector(7 downto 0);
|
||||
c_out : buffer std_logic_vector(2 downto 0);
|
||||
addsub_q : buffer std_logic_vector(31 downto 0);
|
||||
ALUout : out std_logic_vector(31 downto 0)
|
||||
);
|
||||
end component;
|
||||
|
||||
end;
|
||||
------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------
|
||||
-- --
|
||||
-- Copyright (c) 2009-2013 Tobias Gubener --
|
||||
-- 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 --
|
||||
-- by the Free Software Foundation, either version 3 of the License, or --
|
||||
-- (at your option) any later version. --
|
||||
-- --
|
||||
-- This source file is distributed in the hope that it will be useful, --
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --
|
||||
-- GNU General Public License for more details. --
|
||||
-- --
|
||||
-- You should have received a copy of the GNU General Public License --
|
||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>. --
|
||||
-- --
|
||||
------------------------------------------------------------------------------
|
||||
------------------------------------------------------------------------------
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
|
||||
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, rte4, rte5, trap00, trap0, trap1, trap2, trap3,
|
||||
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);
|
||||
|
||||
constant opcMOVE : integer := 0; --
|
||||
constant opcMOVEQ : integer := 1; --
|
||||
constant opcMOVESR : integer := 2; --
|
||||
constant opcADD : integer := 3; --
|
||||
constant opcADDQ : integer := 4; --
|
||||
constant opcOR : integer := 5; --
|
||||
constant opcAND : integer := 6; --
|
||||
constant opcEOR : integer := 7; --
|
||||
constant opcCMP : integer := 8; --
|
||||
constant opcROT : integer := 9; --
|
||||
constant opcCPMAW : integer := 10;
|
||||
constant opcEXT : integer := 11; --
|
||||
constant opcABCD : integer := 12; --
|
||||
constant opcSBCD : integer := 13; --
|
||||
constant opcBITS : integer := 14; --
|
||||
constant opcSWAP : integer := 15; --
|
||||
constant opcScc : integer := 16; --
|
||||
constant andiSR : integer := 17; --
|
||||
constant eoriSR : integer := 18; --
|
||||
constant oriSR : integer := 19; --
|
||||
constant opcMULU : integer := 20; --
|
||||
constant opcDIVU : integer := 21; --
|
||||
constant dispouter : integer := 22; --
|
||||
constant rot_nop : integer := 23; --
|
||||
constant ld_rot_cnt : integer := 24; --
|
||||
constant writePC_add : integer := 25; --
|
||||
constant ea_data_OP1 : integer := 26; --
|
||||
constant ea_data_OP2 : integer := 27; --
|
||||
constant use_XZFlag : integer := 28; --
|
||||
constant get_bfoffset : integer := 29; --
|
||||
constant save_memaddr : integer := 30; --
|
||||
constant opcCHK : integer := 31; --
|
||||
constant movec_rd : integer := 32; --
|
||||
constant movec_wr : integer := 33; --
|
||||
constant Regwrena : integer := 34; --
|
||||
constant update_FC : integer := 35; --
|
||||
constant linksp : integer := 36; --
|
||||
constant movepl : integer := 37; --
|
||||
constant update_ld : integer := 38; --
|
||||
constant OP1addr : integer := 39; --
|
||||
constant write_reg : integer := 40; --
|
||||
constant changeMode : integer := 41; --
|
||||
constant ea_build : integer := 42; --
|
||||
constant trap_chk : integer := 43; --
|
||||
constant store_ea_data : integer := 44; --
|
||||
constant addrlong : integer := 45; --
|
||||
constant postadd : integer := 46; --
|
||||
constant presub : integer := 47; --
|
||||
constant subidx : integer := 48; --
|
||||
constant no_Flags : integer := 49; --
|
||||
constant use_SP : integer := 50; --
|
||||
constant to_CCR : integer := 51; --
|
||||
constant to_SR : integer := 52; --
|
||||
constant OP2out_one : integer := 53; --
|
||||
constant OP1out_zero : integer := 54; --
|
||||
constant mem_addsub : integer := 55; --
|
||||
constant addsub : integer := 56; --
|
||||
constant directPC : integer := 57; --
|
||||
constant direct_delta : integer := 58; --
|
||||
constant directSR : integer := 59; --
|
||||
constant directCCR : integer := 60; --
|
||||
constant exg : integer := 61; --
|
||||
constant get_ea_now : integer := 62; --
|
||||
constant ea_to_pc : integer := 63; --
|
||||
constant hold_dwr : integer := 64; --
|
||||
constant to_USP : integer := 65; --
|
||||
constant from_USP : integer := 66; --
|
||||
constant write_lowlong : integer := 67; --
|
||||
constant write_reminder : integer := 68; --
|
||||
constant movem_action : integer := 69; --
|
||||
constant briefext : integer := 70; --
|
||||
constant get_2ndOPC : integer := 71; --
|
||||
constant mem_byte : integer := 72; --
|
||||
constant longaktion : integer := 73; --
|
||||
constant opcRESET : integer := 74; --
|
||||
constant opcBF : integer := 75; --
|
||||
constant opcBFwb : integer := 76; --
|
||||
constant opcPACK : integer := 77; --
|
||||
|
||||
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;
|
||||
|
||||
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,
|
||||
);
|
||||
port(
|
||||
clk : in std_logic;
|
||||
Reset : in std_logic;
|
||||
clkena_lw : in std_logic:='1';
|
||||
execOPC : 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;
|
||||
rot_bits : in std_logic_vector(1 downto 0);
|
||||
exec : in bit_vector(lastOpcBit downto 0);
|
||||
OP1out : in std_logic_vector(31 downto 0);
|
||||
OP2out : in std_logic_vector(31 downto 0);
|
||||
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);
|
||||
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);
|
||||
last_data_read : in std_logic_vector(15 downto 0);
|
||||
data_read : in std_logic_vector(15 downto 0);
|
||||
FlagsSR : in std_logic_vector(7 downto 0);
|
||||
micro_state : in micro_states;
|
||||
bf_ext_in : in std_logic_vector(7 downto 0);
|
||||
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_loffset : in std_logic_vector(4 downto 0);
|
||||
bf_offset : in std_logic_vector(5 downto 0);
|
||||
set_V_Flag_out : out bit;
|
||||
Flags_out : out std_logic_vector(7 downto 0);
|
||||
c_out_out : out std_logic_vector(2 downto 0);
|
||||
addsub_q_out : out std_logic_vector(31 downto 0);
|
||||
ALUout : out std_logic_vector(31 downto 0)
|
||||
);
|
||||
end component;
|
||||
|
||||
end;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -80,9 +80,13 @@
|
||||
bne fail
|
||||
|
||||
;; bfins
|
||||
or.w #$13,sr ; set x,v and c flag
|
||||
move.l #$12345678,testword3
|
||||
move #$affe,d4
|
||||
bfins d4,testword3{4:16}
|
||||
bvs fail ; v flag must have been cleared
|
||||
bcs fail ; c flag must have been cleared
|
||||
|
||||
beq fail ; inserted value is not 0
|
||||
cmp.l #$1affe678,testword3
|
||||
bne fail
|
||||
@@ -97,6 +101,23 @@
|
||||
bfffo testword3{20:10},d6
|
||||
cmp #21,d6
|
||||
bne fail
|
||||
|
||||
;; test from MikeJ
|
||||
clr.w testword3
|
||||
bfffo testword3+1{0:8},d2
|
||||
cmp #8,d2
|
||||
bne fail
|
||||
|
||||
move.l #$4e63860e,testword3
|
||||
bfffo testword3{0:15},d3
|
||||
cmp #1,d3
|
||||
bne fail
|
||||
|
||||
;; and another one from MikeJ
|
||||
move.l #$4e63860e,d6
|
||||
bfffo d6{0:15},d3
|
||||
cmp #1,d3
|
||||
bne fail
|
||||
|
||||
;; test some of the 68020 addressing modes
|
||||
move.l #$12345678,testword3
|
||||
|
||||
4
tests/tg68k/tests/magic.s
Normal file
4
tests/tg68k/tests/magic.s
Normal file
@@ -0,0 +1,4 @@
|
||||
;; illegal instruction used in Atari ST magic 6.20
|
||||
;; should trigger illegal instruction trap
|
||||
dc.l $43bf0001
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
dc.l start
|
||||
|
||||
org $24
|
||||
dc.l trace_trap ; disable this if tests/trace is not included
|
||||
; dc.l trace_trap ; disable this if tests/trace is not included
|
||||
|
||||
testword3 equ $10100
|
||||
testword4 equ $10104
|
||||
@@ -11,10 +11,11 @@ testword4 equ $10104
|
||||
org $100
|
||||
start:
|
||||
; include "tests/cmpi_d16_pc.s"
|
||||
; include "tests/bfxxx.s"
|
||||
include "tests/bfxxx.s"
|
||||
; include "tests/bcd.s"
|
||||
; include "tests/pack.s"
|
||||
include "tests/trace.s"
|
||||
; include "tests/trace.s"
|
||||
; include "tests/magic.s"
|
||||
|
||||
;; if all tests pass the code will arrive here
|
||||
move.b #0,$beefed ; exit with result 0
|
||||
|
||||
@@ -32,8 +32,8 @@ generic(
|
||||
IPL_autovector : in std_logic;
|
||||
berr : in std_logic; -- only 68000 sp dummy
|
||||
CPU : in std_logic_vector(1 downto 0);
|
||||
addr : buffer std_logic_vector(31 downto 0);
|
||||
data_write : buffer std_logic_vector(15 downto 0);
|
||||
addr_out : out std_logic_vector(31 downto 0);
|
||||
data_write : out std_logic_vector(15 downto 0);
|
||||
nWr : out std_logic;
|
||||
nUDS, nLDS : out std_logic;
|
||||
busstate : out std_logic_vector(1 downto 0);
|
||||
@@ -42,7 +42,7 @@ generic(
|
||||
clr_berr : out std_logic;
|
||||
-- for debug
|
||||
skipFetch : out std_logic;
|
||||
regin : buffer std_logic_vector(31 downto 0)
|
||||
regin_out : out std_logic_vector(31 downto 0)
|
||||
);
|
||||
end component ;
|
||||
|
||||
@@ -69,7 +69,7 @@ begin
|
||||
IPL_autovector => '0',
|
||||
berr => '0',
|
||||
CPU => "11", -- 00=68000, 11=68020
|
||||
addr => addr,
|
||||
addr_out => addr,
|
||||
nUDS => uds_n,
|
||||
nLDS => lds_n,
|
||||
busstate => busstate
|
||||
|
||||
Reference in New Issue
Block a user