1 |
46 |
simont |
//////////////////////////////////////////////////////////////////////
|
2 |
|
|
//// ////
|
3 |
|
|
//// 8051 cores fpga test bench ////
|
4 |
|
|
//// ////
|
5 |
|
|
//// This file is part of the 8051 cores project ////
|
6 |
|
|
//// http://www.opencores.org/cores/8051/ ////
|
7 |
|
|
//// ////
|
8 |
|
|
//// Description ////
|
9 |
|
|
//// module for testing core with simular interface than ////
|
10 |
|
|
//// sintesyzed in xilinx fpga ////
|
11 |
|
|
//// ////
|
12 |
|
|
//// To Do: ////
|
13 |
|
|
//// Nothing ////
|
14 |
|
|
//// ////
|
15 |
|
|
//// Author(s): ////
|
16 |
|
|
//// - Simon Teran, simont@opencores.org ////
|
17 |
|
|
//// ////
|
18 |
|
|
//////////////////////////////////////////////////////////////////////
|
19 |
|
|
//// ////
|
20 |
|
|
//// Copyright (C) 2000 Authors and OPENCORES.ORG ////
|
21 |
|
|
//// ////
|
22 |
|
|
//// This source file may be used and distributed without ////
|
23 |
|
|
//// restriction provided that this copyright statement is not ////
|
24 |
|
|
//// removed from the file and that any derivative work contains ////
|
25 |
|
|
//// the original copyright notice and the associated disclaimer. ////
|
26 |
|
|
//// ////
|
27 |
|
|
//// This source file is free software; you can redistribute it ////
|
28 |
|
|
//// and/or modify it under the terms of the GNU Lesser General ////
|
29 |
|
|
//// Public License as published by the Free Software Foundation; ////
|
30 |
|
|
//// either version 2.1 of the License, or (at your option) any ////
|
31 |
|
|
//// later version. ////
|
32 |
|
|
//// ////
|
33 |
|
|
//// This source is distributed in the hope that it will be ////
|
34 |
|
|
//// useful, but WITHOUT ANY WARRANTY; without even the implied ////
|
35 |
|
|
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ////
|
36 |
|
|
//// PURPOSE. See the GNU Lesser General Public License for more ////
|
37 |
|
|
//// details. ////
|
38 |
|
|
//// ////
|
39 |
|
|
//// You should have received a copy of the GNU Lesser General ////
|
40 |
|
|
//// Public License along with this source; if not, download it ////
|
41 |
|
|
//// from http://www.opencores.org/lgpl.shtml ////
|
42 |
|
|
//// ////
|
43 |
|
|
//////////////////////////////////////////////////////////////////////
|
44 |
|
|
//
|
45 |
|
|
// CVS Revision History
|
46 |
|
|
//
|
47 |
|
|
// $Log: not supported by cvs2svn $
|
48 |
|
|
//
|
49 |
|
|
|
50 |
|
|
// synopsys translate_off
|
51 |
|
|
`include "oc8051_timescale.v"
|
52 |
|
|
// synopsys translate_on
|
53 |
|
|
|
54 |
|
|
module oc8051_fpga_tb;
|
55 |
|
|
|
56 |
|
|
reg rst, clk, int1, int2, int3;
|
57 |
|
|
|
58 |
|
|
wire sw1, sw2, sw3, sw4, int_act;
|
59 |
|
|
wire [7:0] p0_out, p1_out, p2_out, p3_out, data_out;
|
60 |
|
|
wire [13:0] dispout;
|
61 |
|
|
wire [15:0] ext_addr;
|
62 |
|
|
|
63 |
|
|
oc8051_fpga_top oc8051_fpga_top1(.clk(clk), .rst(rst), .int1(int1), .int2(int2), .int3(int3), .sw1(sw1), .sw2(sw2), .sw3(sw3), .sw4(sw4),
|
64 |
|
|
.int_act(int_act), .dispout(dispout), .p0_out(p0_out), .p1_out(p1_out), .p2_out(p2_out), .p3_out(p3_out), .data_out(data_out),
|
65 |
|
|
.ext_addr(ext_addr));
|
66 |
|
|
|
67 |
|
|
initial begin
|
68 |
|
|
clk= 1'b0;
|
69 |
|
|
rst= 1'b0;
|
70 |
|
|
int1= 1'b1;
|
71 |
|
|
int2= 1'b1;
|
72 |
|
|
int3= 1'b1;
|
73 |
|
|
#22
|
74 |
|
|
rst = 1'b1;
|
75 |
|
|
#1000
|
76 |
|
|
int2= 1'b0;
|
77 |
|
|
#100
|
78 |
|
|
int2= 1'b1;
|
79 |
|
|
|
80 |
|
|
#40000
|
81 |
|
|
int3= 1'b0;
|
82 |
|
|
#100
|
83 |
|
|
int3= 1'b1;
|
84 |
|
|
#40000
|
85 |
|
|
|
86 |
|
|
rst = 1'b0;
|
87 |
|
|
#20
|
88 |
|
|
$finish;
|
89 |
|
|
end
|
90 |
|
|
|
91 |
|
|
always clk = #5 ~clk;
|
92 |
|
|
|
93 |
|
|
initial $dumpvars;
|
94 |
|
|
|
95 |
|
|
//initial $monitor("time ",$time," rst ",rst, " int1 ", int1, " int2 ", int2, " int3 ", int3, " sw1 ", sw1, " sw2 ", sw2, " sw3 ", sw3, " sw4 ", sw4, " int act ", int_act, " p0_out %h", p0_out);
|
96 |
|
|
|
97 |
|
|
initial $monitor("time ",$time," rst ",rst, " int1 ", int1, " int2 ", int2, " int3 ", int3, " int act ", int_act, " p0_out %h", p0_out);
|
98 |
|
|
|
99 |
|
|
endmodule
|