1 |
14 |
robfinch |
module Raptor64sc_tb();
|
2 |
|
|
parameter IDLE = 8'd1;
|
3 |
|
|
parameter DOCMD = 8'd2;
|
4 |
|
|
|
5 |
|
|
reg clk;
|
6 |
|
|
reg rst;
|
7 |
|
|
reg nmi;
|
8 |
|
|
wire sys_cyc;
|
9 |
|
|
wire sys_stb;
|
10 |
|
|
wire sys_we;
|
11 |
|
|
wire [7:0] sys_sel;
|
12 |
|
|
wire [63:0] sys_adr;
|
13 |
|
|
wire [63:0] sys_dbo;
|
14 |
|
|
wire [63:0] sys_dbi;
|
15 |
|
|
wire sys_ack;
|
16 |
|
|
reg [7:0] cnt;
|
17 |
|
|
wire wr_empty = 1'b1;
|
18 |
|
|
wire wr_full;
|
19 |
|
|
reg [63:0] iromout;
|
20 |
|
|
|
21 |
|
|
assign sys_ack = sys_stb;
|
22 |
|
|
|
23 |
|
|
initial begin
|
24 |
|
|
clk = 1;
|
25 |
|
|
rst = 0;
|
26 |
|
|
nmi = 0;
|
27 |
|
|
#100 rst = 1;
|
28 |
|
|
#100 rst = 0;
|
29 |
|
|
#1300 nmi = 1;
|
30 |
|
|
#100 nmi = 0;
|
31 |
|
|
end
|
32 |
|
|
|
33 |
|
|
always #10 clk = ~clk; // 50 MHz
|
34 |
|
|
|
35 |
|
|
always @(sys_adr)
|
36 |
|
|
case(sys_adr)// | 64'hFFFF_FFFF_FFFF_0000)
|
37 |
|
|
64'h70: iromout <= 64'h0000000000000020;
|
38 |
|
|
64'h78: iromout <= 64'h37800000000DE000;
|
39 |
|
|
64'h80: iromout <= 64'h0000037800000000;
|
40 |
|
|
64'h88: iromout <= 64'h37800000000DE000;
|
41 |
|
|
64'hFFFFFFFFFFFFF000: iromout <= 64'h0010AC50020013FD;
|
42 |
|
|
64'hFFFFFFFFFFFFF008: iromout <= 64'h0104450001814010;
|
43 |
|
|
64'hFFFFFFFFFFFFF010: iromout <= 64'h400003FFFFFFFFFF;
|
44 |
|
|
64'hFFFFFFFFFFFFF018: iromout <= 64'h050040000321400F;
|
45 |
|
|
64'hFFFFFFFFFFFFF020: iromout <= 64'h0000005006000014;
|
46 |
|
|
64'hFFFFFFFFFFFFF028: iromout <= 64'h0284200000262110;
|
47 |
|
|
64'hFFFFFFFFFFFFF030: iromout <= 64'hFFFEA430C6000001;
|
48 |
|
|
64'hFFFFFFFFFFFFF038: iromout <= 64'h0C7FFFFFC18BE307;
|
49 |
|
|
64'hFFFFFFFFFFFFF040: iromout <= 64'h0000037800000000;
|
50 |
|
|
64'hFFFFFFFFFFFFF048: iromout <= 64'h37800000000DE000;
|
51 |
|
|
64'hFFFFFFFFFFFFF060: iromout <= 64'h700003FFFFFFFFFF;
|
52 |
|
|
64'hFFFFFFFFFFFFF068: iromout <= 64'h100440000001400F;
|
53 |
|
|
64'hFFFFFFFFFFFFF070: iromout <= 64'h000006F881FFFFC1;
|
54 |
|
|
64'hFFFFFFFFFFFFF078: iromout <= 64'h0D83E00000040100;
|
55 |
|
|
64'hFFFFFFFFFFFFF080: iromout <= 64'hAAAB541000800009;
|
56 |
|
|
64'hFFFFFFFFFFFFF088: iromout <= 64'h05002AA5555F5554;
|
57 |
|
|
64'hFFFFFFFFFFFFF090: iromout <= 64'h0000019A02000000;
|
58 |
|
|
64'hFFFFFFFFFFFFF098: iromout <= 64'h0104430000646810;
|
59 |
|
|
64'hFFFFFFFFFFFFF0A0: iromout <= 64'h000022F8C00000A9;
|
60 |
|
|
64'hFFFFFFFFFFFFF0A8: iromout <= 64'h03A060000000A840;
|
61 |
|
|
64'hFFFFFFFFFFFFF0B0: iromout <= 64'h800026F8C1FFFF00;
|
62 |
|
|
64'hFFFFFFFFFFFFF0B8: iromout <= 64'h0100080000904802;
|
63 |
|
|
64'hFFFFFFFFFFFFF0C0: iromout <= 64'hA955551A04000000;
|
64 |
|
|
64'hFFFFFFFFFFFFF0C8: iromout <= 64'h2F8C00001090E21A;
|
65 |
|
|
64'hFFFFFFFFFFFFF0D0: iromout <= 64'h0000002210000008;
|
66 |
|
|
64'hFFFFFFFFFFFFF0D8: iromout <= 64'h2F8C1FFFF800E81C;
|
67 |
|
|
64'hFFFFFFFFFFFFF0E0: iromout <= 64'h000026FA14000329;
|
68 |
|
|
64'hFFFFFFFFFFFFF0E8: iromout <= 64'h3AAAAD5552A04002;
|
69 |
|
|
64'hFFFFFFFFFFFFF0F0: iromout <= 64'h000000500355AAAA;
|
70 |
|
|
64'hFFFFFFFFFFFFF0F8: iromout <= 64'h11A0400000066808;
|
71 |
|
|
64'hFFFFFFFFFFFFF100: iromout <= 64'h0003241044300006;
|
72 |
|
|
64'hFFFFFFFFFFFFF108: iromout <= 64'h02210000008BE300;
|
73 |
|
|
64'hFFFFFFFFFFFFF110: iromout <= 64'hFFFC803A07000000;
|
74 |
|
|
64'hFFFFFFFFFFFFF118: iromout <= 64'h01200B00009BE307;
|
75 |
|
|
64'hFFFFFFFFFFFFF120: iromout <= 64'h0000001000800009;
|
76 |
|
|
64'hFFFFFFFFFFFFF128: iromout <= 64'h0388755AAAA46810;
|
77 |
|
|
64'hFFFFFFFFFFFFF130: iromout <= 64'h000022F8C00000A9;
|
78 |
|
|
64'hFFFFFFFFFFFFF138: iromout <= 64'h03A0700000008840;
|
79 |
|
|
64'hFFFFFFFFFFFFF140: iromout <= 64'h000222F8C1FFFF20;
|
80 |
|
|
64'hFFFFFFFFFFFFF148: iromout <= 64'h01216800014BE858;
|
81 |
|
|
64'hFFFFFFFFFFFFF150: iromout <= 64'h000052FA14000048;
|
82 |
|
|
64'hFFFFFFFFFFFFF158: iromout <= 64'h1981000040004852;
|
83 |
|
|
64'hFFFFFFFFFFFFF160: iromout <= 64'h000080D83E000000;
|
84 |
|
|
64'hFFFFFFFFFFFFF168: iromout <= 64'h0080200003400000;
|
85 |
|
|
64'hFFFFFFFFFFFFF170: iromout <= 64'hFC0002F841FFFFC9;
|
86 |
|
|
64'hFFFFFFFFFFFFF178: iromout <= 64'h19805FF00086600F;
|
87 |
|
|
64'hFFFFFFFFFFFFF180: iromout <= 64'h0010A00802000228;
|
88 |
|
|
64'hFFFFFFFFFFFFF188: iromout <= 64'h008800005A902010;
|
89 |
|
|
64'hFFFFFFFFFFFFF190: iromout <= 64'h40000C1884680001;
|
90 |
|
|
64'hFFFFFFFFFFFFF198: iromout <= 64'h1184400000004110;
|
91 |
|
|
64'hFFFFFFFFFFFFF1A0: iromout <= 64'h0000D00880000529;
|
92 |
|
|
64'hFFFFFFFFFFFFF1A8: iromout <= 64'h0080000003502000;
|
93 |
|
|
64'hFFFFFFFFFFFFF1B0: iromout <= 64'hFC00211803FF0000;
|
94 |
|
|
64'hFFFFFFFFFFFFF1B8: iromout <= 64'h0000000002046017;
|
95 |
|
|
64'hFFFFFFFFFFFFFFB0: iromout <= 64'h000000CFFFFFFC5A;
|
96 |
|
|
64'hFFFFFFFFFFFFFFB8: iromout <= 64'h37800000000DE000;
|
97 |
|
|
64'hFFFFFFFFFFFFFFC0: iromout <= 64'h000000CFFFFFFC5A;
|
98 |
|
|
64'hFFFFFFFFFFFFFFC8: iromout <= 64'h37800000000DE000;
|
99 |
|
|
64'hFFFFFFFFFFFFFFD0: iromout <= 64'h0000037800000000;
|
100 |
|
|
64'hFFFFFFFFFFFFFFD8: iromout <= 64'h37800000000DE000;
|
101 |
|
|
64'hFFFFFFFFFFFFFFE0: iromout <= 64'h000000CFFFFFFC59;
|
102 |
|
|
64'hFFFFFFFFFFFFFFE8: iromout <= 64'h37800000000DE000;
|
103 |
|
|
64'hFFFFFFFFFFFFFFF0: iromout <= 64'h000000CFFFFFFC00;
|
104 |
|
|
64'hFFFFFFFFFFFFFFF8: iromout <= 64'h0000000000000000;
|
105 |
|
|
|
106 |
|
|
endcase
|
107 |
|
|
assign sys_dbi = iromout;
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
Raptor64sc u1
|
111 |
|
|
(
|
112 |
|
|
.rst_i(rst),
|
113 |
|
|
.clk_i(clk),
|
114 |
|
|
.nmi_i(nmi),
|
115 |
|
|
.irq_i(1'b0),
|
116 |
|
|
.bte_o(),
|
117 |
|
|
.cti_o(),
|
118 |
|
|
.cyc_o(sys_cyc),
|
119 |
|
|
.stb_o(sys_stb),
|
120 |
|
|
.ack_i(sys_ack),
|
121 |
|
|
.we_o(sys_we),
|
122 |
|
|
.sel_o(sys_sel),
|
123 |
|
|
.adr_o(sys_adr),
|
124 |
|
|
.dat_i(sys_dbi),
|
125 |
|
|
.dat_o(sys_dbo),
|
126 |
|
|
|
127 |
|
|
.sys_adv(1'b0),
|
128 |
|
|
.sys_adr(59'd0)
|
129 |
|
|
);
|
130 |
|
|
endmodule
|