-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathtestbench.v
More file actions
18 lines (18 loc) · 743 Bytes
/
testbench.v
File metadata and controls
18 lines (18 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module testbench;
reg clk, reset, writeORread;
reg [7:0] inbyte;
reg [31:0] pa;
reg [255:0] dataBlock;
wire [7:0] cacheOutput;
cacheModule uut(clk, reset,pa, writeORread, inbyte, dataBlock, cacheOutput);
always #5 clk=~clk;
initial
begin
clk=0; reset=1;//writeORread=0;inbyte=7'd9;dataBlock=256'h123456;pa=32'h9876ABC0;
#10 reset=0;writeORread=0;inbyte=8'd9;dataBlock=256'h123456;pa=32'h9876ABC0;//read miss
#30 writeORread=0;inbyte=8'h77;dataBlock=256'h123456;pa=32'hABCDABC0; //read miss
#30 writeORread=1;inbyte=8'hAA;pa=32'hABCDABC0; //write hit
#30 writeORread=1;inbyte=8'hBB;dataBlock=256'h666666;pa=32'h12345678; //write miss
#40 $finish;
end
endmodule