Line 1... |
Line 1... |
/*******************************************************************************************/
|
/*******************************************************************************************/
|
/** **/
|
/** **/
|
/** ORIGINAL COPYRIGHT (C) 2011, SYSTEMYDE INTERNATIONAL CORPORATION, ALL RIGHTS RESERVED **/
|
/** ORIGINAL COPYRIGHT (C) 2011, SYSTEMYDE INTERNATIONAL CORPORATION, ALL RIGHTS RESERVED **/
|
/** COPYRIGHT (C) 2012, SERGEY BELYASHOV **/
|
/** COPYRIGHT (C) 2012, SERGEY BELYASHOV **/
|
/** **/
|
/** **/
|
/** Y80 processor test bench Rev 0.0 06/13/2012 **/
|
/** Y80e processor test bench Rev 0.0 06/18/2012 **/
|
/** **/
|
/** **/
|
/*******************************************************************************************/
|
/*******************************************************************************************/
|
`timescale 1ns / 10ps /* set time scale */
|
`timescale 1ns / 10ps /* set time scale */
|
`include "version.v" /* select version */
|
`include "version.v" /* select version */
|
`include "hierarchy.v" /* include sources */
|
`include "hierarchy.v" /* include sources */
|
Line 52... |
Line 52... |
reg DISABLE_WAIT; /* wait generator control */
|
reg DISABLE_WAIT; /* wait generator control */
|
reg INT_TYPE; /* int type during bus req */
|
reg INT_TYPE; /* int type during bus req */
|
reg PAT_DONE; /* pattern done flag */
|
reg PAT_DONE; /* pattern done flag */
|
reg TRIG_INT; /* assert interrupt */
|
reg TRIG_INT; /* assert interrupt */
|
reg TRIG_NMI; /* assert nmi */
|
reg TRIG_NMI; /* assert nmi */
|
reg [2:0] PAT_CNT; /* counter to track patterns */
|
reg [3:0] PAT_CNT; /* counter to track patterns */
|
reg [15:0] CMP_ERR_L; /* error counter */
|
reg [15:0] CMP_ERR_L; /* error counter */
|
|
|
reg wait_dly; /* wait request state machine */
|
reg wait_dly; /* wait request state machine */
|
reg [5:0] breq_mach; /* bus request state machine */
|
reg [5:0] breq_mach; /* bus request state machine */
|
|
|
Line 338... |
Line 338... |
|
|
DISABLE_INT = 0; /* interrupt generator on */
|
DISABLE_INT = 0; /* interrupt generator on */
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h1;
|
PAT_CNT = 5'h1;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("int_ops.vm", rdmem);
|
$readmemh("int_ops.vm", rdmem);
|
$readmemh("int_opsd.vm", wrmem);
|
$readmemh("int_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
DISABLE_INT = 1; /* interrupt generator off */
|
DISABLE_INT = 1; /* interrupt generator off */
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h2;
|
PAT_CNT = 5'h2;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("alu_ops.vm", rdmem);
|
$readmemh("alu_ops.vm", rdmem);
|
$readmemh("alu_opsd.vm", wrmem);
|
$readmemh("alu_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h3;
|
PAT_CNT = 5'h3;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("dat_mov.vm", rdmem);
|
$readmemh("dat_mov.vm", rdmem);
|
$readmemh("dat_movd.vm", wrmem);
|
$readmemh("dat_movd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h4;
|
PAT_CNT = 5'h4;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("bit_ops.vm", rdmem);
|
$readmemh("bit_ops.vm", rdmem);
|
$readmemh("bit_opsd.vm", wrmem);
|
$readmemh("bit_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h5;
|
PAT_CNT = 5'h5;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("jmp_ops.vm", rdmem);
|
$readmemh("jmp_ops.vm", rdmem);
|
$readmemh("jmp_opsd.vm", wrmem);
|
$readmemh("jmp_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h6;
|
PAT_CNT = 5'h6;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("io_ops.vm", rdmem);
|
$readmemh("io_ops.vm", rdmem);
|
$readmemh("io_opsd.vm", wrmem);
|
$readmemh("io_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h7;
|
PAT_CNT = 5'h7;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("180_ops.vm", rdmem);
|
$readmemh("180_ops.vm", rdmem);
|
$readmemh("180_opsd.vm", wrmem);
|
$readmemh("180_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
|
resettask;
|
|
CMP_ERR_L = 16'h0000;
|
|
PAT_CNT = 5'h8;
|
|
$readmemh("blank_xx.vm", rdmem);
|
|
$readmemh("blank_xx.vm", wrmem);
|
|
$readmemh("ez8_ops.vm", rdmem);
|
|
$readmemh("ez8_opsd.vm", wrmem);
|
|
wait (PAT_DONE);
|
|
|
DISABLE_INT = 0; /* interrupt generator on */
|
DISABLE_INT = 0; /* interrupt generator on */
|
DISABLE_WAIT = 0; /* wait generator on */
|
DISABLE_WAIT = 0; /* wait generator on */
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h1;
|
PAT_CNT = 5'h1;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("int_ops.vm", rdmem);
|
$readmemh("int_ops.vm", rdmem);
|
$readmemh("int_opsd.vm", wrmem);
|
$readmemh("int_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
DISABLE_INT = 1; /* interrupt generator off */
|
DISABLE_INT = 1; /* interrupt generator off */
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h2;
|
PAT_CNT = 5'h2;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("alu_ops.vm", rdmem);
|
$readmemh("alu_ops.vm", rdmem);
|
$readmemh("alu_opsd.vm", wrmem);
|
$readmemh("alu_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h3;
|
PAT_CNT = 5'h3;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("dat_mov.vm", rdmem);
|
$readmemh("dat_mov.vm", rdmem);
|
$readmemh("dat_movd.vm", wrmem);
|
$readmemh("dat_movd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h4;
|
PAT_CNT = 5'h4;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("bit_ops.vm", rdmem);
|
$readmemh("bit_ops.vm", rdmem);
|
$readmemh("bit_opsd.vm", wrmem);
|
$readmemh("bit_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h5;
|
PAT_CNT = 5'h5;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("jmp_ops.vm", rdmem);
|
$readmemh("jmp_ops.vm", rdmem);
|
$readmemh("jmp_opsd.vm", wrmem);
|
$readmemh("jmp_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h6;
|
PAT_CNT = 5'h6;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("io_ops.vm", rdmem);
|
$readmemh("io_ops.vm", rdmem);
|
$readmemh("io_opsd.vm", wrmem);
|
$readmemh("io_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h7;
|
PAT_CNT = 5'h7;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("180_ops.vm", rdmem);
|
$readmemh("180_ops.vm", rdmem);
|
$readmemh("180_opsd.vm", wrmem);
|
$readmemh("180_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
|
resettask;
|
|
CMP_ERR_L = 16'h0000;
|
|
PAT_CNT = 5'h8;
|
|
$readmemh("blank_xx.vm", rdmem);
|
|
$readmemh("blank_xx.vm", wrmem);
|
|
$readmemh("ez8_ops.vm", rdmem);
|
|
$readmemh("ez8_opsd.vm", wrmem);
|
|
wait (PAT_DONE);
|
|
|
DISABLE_INT = 0; /* interrupt generator on */
|
DISABLE_INT = 0; /* interrupt generator on */
|
DISABLE_BREQ = 0; /* bus req generator on */
|
DISABLE_BREQ = 0; /* bus req generator on */
|
DISABLE_WAIT = 1; /* wait generator off */
|
DISABLE_WAIT = 1; /* wait generator off */
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h1;
|
PAT_CNT = 5'h1;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("int_ops.vm", rdmem);
|
$readmemh("int_ops.vm", rdmem);
|
$readmemh("int_opss.vm", wrmem);
|
$readmemh("int_opss.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
DISABLE_INT = 1; /* interrupt generator off */
|
DISABLE_INT = 1; /* interrupt generator off */
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h2;
|
PAT_CNT = 5'h2;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("alu_ops.vm", rdmem);
|
$readmemh("alu_ops.vm", rdmem);
|
$readmemh("alu_opsd.vm", wrmem);
|
$readmemh("alu_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h3;
|
PAT_CNT = 5'h3;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("dat_mov.vm", rdmem);
|
$readmemh("dat_mov.vm", rdmem);
|
$readmemh("dat_movd.vm", wrmem);
|
$readmemh("dat_movd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h4;
|
PAT_CNT = 5'h4;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("bit_ops.vm", rdmem);
|
$readmemh("bit_ops.vm", rdmem);
|
$readmemh("bit_opsd.vm", wrmem);
|
$readmemh("bit_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h5;
|
PAT_CNT = 5'h5;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("jmp_ops.vm", rdmem);
|
$readmemh("jmp_ops.vm", rdmem);
|
$readmemh("jmp_opsd.vm", wrmem);
|
$readmemh("jmp_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h6;
|
PAT_CNT = 5'h6;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("io_ops.vm", rdmem);
|
$readmemh("io_ops.vm", rdmem);
|
$readmemh("io_opsd.vm", wrmem);
|
$readmemh("io_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
resettask;
|
resettask;
|
CMP_ERR_L = 16'h0000;
|
CMP_ERR_L = 16'h0000;
|
PAT_CNT = 4'h7;
|
PAT_CNT = 5'h7;
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", rdmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("blank_xx.vm", wrmem);
|
$readmemh("180_ops.vm", rdmem);
|
$readmemh("180_ops.vm", rdmem);
|
$readmemh("180_opsd.vm", wrmem);
|
$readmemh("180_opsd.vm", wrmem);
|
wait (PAT_DONE);
|
wait (PAT_DONE);
|
|
|
|
resettask;
|
|
CMP_ERR_L = 16'h0000;
|
|
PAT_CNT = 5'h8;
|
|
$readmemh("blank_xx.vm", rdmem);
|
|
$readmemh("blank_xx.vm", wrmem);
|
|
$readmemh("ez8_ops.vm", rdmem);
|
|
$readmemh("ez8_opsd.vm", wrmem);
|
|
wait (PAT_DONE);
|
|
|
$stop;
|
$stop;
|
end
|
end
|
|
|
endmodule
|
endmodule
|
|
|