URL
https://opencores.org/ocsvn/zet86/zet86/trunk
Subversion Repositories zet86
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 27 to Rev 28
- ↔ Reverse comparison
Rev 27 → Rev 28
/trunk/rtl-model/alu.v
52,9 → 52,9
.oflags ({af_cnv, of_cnv, cf_cnv}) |
); |
|
bitlog log4 (x[15:0], y[4:0], log, func, cf_log, of_log); |
bitlog log4 (x[15:0], y, log, func, cf_log, of_log); |
shifts shi5 (x[15:0], y[4:0], shi, func[1:0], word_op, cf_shi, of_shi); |
rotate rot6 (x[15:0], y, func[1:0], cfi, word_op, rot, cf_rot, ofi, of_rot); |
rotate rot6 (x[15:0], y[4:0], func[1:0], cfi, word_op, rot, cf_rot, ofi, of_rot); |
othop oth7 (x[15:0], y, seg, off, iflags, func, word_op, oth, othflags); |
|
mux8_16 m0(t, {8'd0, y[7:0]}, add, cnv[15:0], |
/trunk/rtl-model/fetch.v
645,6 → 645,44
src <= 4'b0; |
end |
|
8'b0011_100x: // cmp r->r, r->m |
begin |
seq_addr <= (mod==2'b11) ? (b ? `CMPRRB : `CMPRRW) |
: (b ? `CMPRMB : `CMPRMW); |
need_modrm <= 1'b1; |
need_off <= need_off_mod; |
need_imm <= 1'b0; |
off_size <= off_size_mod; |
imm_size <= 1'b0; |
dst <= { 1'b0, dstm }; |
src <= { 1'b0, srcm }; |
end |
|
8'b0011_101x: // cmp r->r, m->r |
begin |
seq_addr <= (mod==2'b11) ? (b ? `CMPRRB : `CMPRRW) |
: (b ? `CMPMRB : `CMPMRW); |
need_modrm <= 1'b1; |
need_off <= need_off_mod; |
need_imm <= 1'b0; |
off_size <= off_size_mod; |
imm_size <= 1'b0; |
dst <= { 1'b0, dstm }; |
src <= { 1'b0, srcm }; |
end |
|
8'b0011_110x: // cmp i->r |
begin |
seq_addr <= b ? `CMPIRB : `CMPIRW; |
need_modrm <= 1'b0; |
need_off <= 1'b0; |
need_imm <= 1'b1; |
off_size <= 1'b0; |
imm_size <= ~b; |
dst <= 4'b0; |
src <= 4'b0; |
end |
|
8'b0011_1111: // aas |
begin |
seq_addr <= `AAS; |
719,8 → 757,10
|
8'b1000_00xx: // and, or i->r, i->m |
begin |
seq_addr <= regm == 3'b101 ? |
((mod==2'b11) ? (b ? `SUBIRB : `SUBIRW) |
seq_addr <= regm == 3'b111 ? |
((mod==2'b11) ? (b ? `CMPIRB : `CMPIRW) |
: (b ? `CMPIMB : `CMPIMW)) |
: (regm == 3'b101 ? ((mod==2'b11) ? (b ? `SUBIRB : `SUBIRW) |
: (b ? `SUBIMB : `SUBIMW)) |
: (regm == 3'b011 ? ((mod==2'b11) ? (b ? `SBBIRB : `SBBIRW) |
: (b ? `SBBIMB : `SBBIMW)) |
733,7 → 773,7
: (regm == 3'b001 ? ((mod==2'b11) ? (b ? `ORIRB : `ORIRW) |
: (b ? `ORIMB : `ORIMW)) |
: ((mod==2'b11) ? (b ? `XORIRB : `XORIRW) |
: (b ? `XORIMB : `XORIMW))))))); |
: (b ? `XORIMB : `XORIMW)))))))); |
need_modrm <= 1'b1; |
need_off <= need_off_mod; |
need_imm <= 1'b1; |
1440,11 → 1480,14
|
8'b1111_011x: // test i->r, i->m |
begin |
seq_addr <= regm == 3'b000 ? |
seq_addr <= regm == 3'b011 ? |
((mod==2'b11) ? (b ? `NEGRB : `NEGRW) |
: (b ? `NEGMB : `NEGMW)) |
: (regm == 3'b000 ? |
((mod==2'b11) ? (b ? `TSTIRB : `TSTIRW) |
: (b ? `TSTIMB : `TSTIMW)) |
: ((mod==2'b11) ? (b ? `NOTRB : `NOTRW) |
: (b ? `NOTMB : `NOTMW)); |
: (b ? `NOTMB : `NOTMW))); |
need_modrm <= 1'b1; |
need_off <= need_off_mod; |
need_imm <= (regm == 3'b000); // imm on test |
1451,7 → 1494,7
off_size <= off_size_mod; |
imm_size <= ~b; |
dst <= { 1'b0, srcm }; |
src <= 4'b0; |
src <= { 1'b0, modrm[2:0] }; |
end |
|
8'b1111_1000: // clc |
/trunk/tests/i86/16_cmpneg.s
0,0 → 1,126
.code16 |
start: |
|
movw $96, %sp |
|
# cmp word tests |
movw $0x0001, %ax |
movw $0x0002, %bx |
cmpw %bx, %ax |
movw %ax, (0) |
movw %bx, (2) |
pushf |
|
movw $0xffff, %dx |
movw $0xffff, (4) |
cmpw %dx, (4) |
movw %dx, (6) |
pushf |
|
movw $0xffff, %cx |
movw $0x0001, (8) |
cmpw (8), %cx |
movw %cx, (10) |
pushf |
|
movw $0x8000, %ax |
cmpw $0x0001, %ax |
movw %ax, (12) |
pushf |
|
movw $0x8000, %bp |
.byte 0x83,0xfd,0xff |
movw %bp, (14) |
pushf |
|
movw $0x7f81, %si |
cmpw $0x903c, %si |
movw %si, (16) |
pushf |
|
movw $0xefc3, (18) |
cmpw $0xc664, (18) |
pushf |
|
movw $0xe933, (20) |
.word 0x3e83, 0x0014 |
.byte 0x64 |
pushf |
|
# cmp byte tests |
movb $0x01, (22) |
cmpb $0x02, (22) |
pushf |
|
movb $0xff, %dh |
cmpb $0xff, %dh |
movw %dx, (23) |
pushf |
|
movb $0xff, %al |
cmpb $0x01, %al |
movw %ax, (25) |
pushf |
|
movb $0x80, (27) |
movb $0x01, %ch |
cmpb (27), %ch |
movw %cx, (28) |
pushf |
|
movb $0x80, %bl |
movb $0x7f, (30) |
cmpb %bl, (30) |
movw %bx, (31) |
pushf |
|
movb $0xbc, %al |
movb $0x8e, %ah |
cmpb %al, %ah |
movw %ax, (33) |
pushf |
|
# neg word tests |
movw $0x0, %cx |
negw %cx |
movw %cx, (34) |
pushf |
|
movw $0x7fff, (36) |
negw (36) |
pushf |
|
movw $0x8000, %bp |
negw %bp |
movw %bp, (38) |
pushf |
|
movw $0xace9, (40) |
negw (40) |
pushf |
|
# neg byte tests |
movb $0x0, %ah |
negb %ah |
movw %ax, (42) |
pushf |
|
movb $0x7f, (44) |
negb (44) |
pushf |
|
movb $0xc9, %cl |
negb %cl |
movw %cx, (45) |
pushf |
|
movb $0x80, (47) |
negb (47) |
pushf |
hlt |
|
.org 65520 |
jmp start |
.org 65535 |
.byte 0xff |
|
/trunk/tests/i86/15_sub.s
24,7 → 24,7
pushf |
|
movw $0x8000, %ax |
addw $0x0001, %ax |
subw $0x0001, %ax |
movw %ax, (12) |
pushf |
|
/trunk/tests/i86/.bochsrc
1,4 → 1,4
romimage: file=15_sub.out |
romimage: file=16_cmpneg.out |
cpu: count=1, ips=10000000, reset_on_triple_fault=1 |
megs: 2 |
vgaromimage: file=$BXSHARE/VGABIOS-lgpl-latest |
/trunk/sim/modelsim/tb.do
1,7 → 1,7
#vdel -all -lib work |
#vlib work |
#vlog -work work -lint +incdir+../../rtl-model ../../rtl-model/regfile.v ../../rtl-model/alu.v ../../rtl-model/cpu.v ../../rtl-model/exec.v ../../rtl-model/fetch.v ../../rtl-model/jmp_cond.v ../../rtl-model/util/primitives.v ../../rtl-model/rotate.v |
#vlog -work work +incdir+.. ../memory.v ../testbench.v |
vdel -all -lib work |
vlib work |
vlog -work work -lint +incdir+../../rtl-model ../../rtl-model/regfile.v ../../rtl-model/alu.v ../../rtl-model/cpu.v ../../rtl-model/exec.v ../../rtl-model/fetch.v ../../rtl-model/jmp_cond.v ../../rtl-model/util/primitives.v ../../rtl-model/rotate.v |
vlog -work work +incdir+.. ../memory.v ../testbench.v |
vsim -novopt -t ns work.testbench |
add wave -label clk /testbench/clk |
add wave -label rst /testbench/rst |
35,4 → 35,4
add wave -label we /testbench/we |
add wave -label ack_i /testbench/ack_i |
add wave -label fetch_or_exec /testbench/cpu0/fetch_or_exec |
run 50us |
#run 50us |