OpenCores
URL https://opencores.org/ocsvn/a-z80/a-z80/trunk

Subversion Repositories a-z80

[/] [a-z80/] [trunk/] [cpu/] [toplevel/] [test_fuse.sv] - Blame information for rev 20

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 gdevic
//--------------------------------------------------------------
2
// Testbench using Fuse Z80 emulator test vectors
3
//--------------------------------------------------------------
4
`include "z80.svh"
5
 
6
module test_bench_fuse(z80_if.tb z);
7
 
8
assign clk = z.CLK;
9
 
10
integer f;
11
// Instead of the PC register, we read the address of the next instruction
12
logic [15:0] pc;
13
 
14
initial begin : init
15
    z.nWAIT <= `CLR;
16
    z.nINT <= `CLR;
17
    z.nNMI <= `CLR;
18
    z.nBUSRQ <= `CLR;
19
    z.nRESET <= `CLR;
20
 
21
    // Run all the tests and write the result to a file
22
    f = $fopen("fuse.result.txt");
23 6 gdevic
    `include "test_fuse.vh"
24 3 gdevic
    $fclose(f);
25
 
26
end : init
27
 
28
endmodule
29
 
30
module test_fuse();
31
 
32
bit clk = 1;
33
initial repeat (`TOTAL_CLKS) #1 clk = ~clk;
34
 
35
z80_if z80(clk);            // Instantiate the Z80 bus interface
36
z80_top_ifc_n dut(z80);     // Create an instance of our Z80 design
37
test_bench_fuse tb(z80);    // Create an instance of the test bench
38
 
39
ram ram( .Address(z80.A), .Data(z80.D), .CS(z80.nMREQ), .WE(z80.nWR), .OE(z80.nRD) );
40
io  io( .Address(z80.A), .Data(z80.D), .CS(z80.nIORQ), .WE(z80.nWR), .OE(z80.nRD) );
41
 
42
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.