1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| module s65fh_sp528x8x8_test ;
supply0 gnd_1;
supply1 vdd;
wire [7:0] D;
reg [0:9] BA;
reg BFRD, RY_EN, SLOWRD_EN, POR_N, OE, WREN_N;
reg clk;
integer i=0;
reg [0:23] ivector,temp;
reg [0:23] wvector[0:528] ;
reg [0:23] rvector[0:528] ;
s65fh_sp528x8x8 s65fh_sp528x8x8 (.BFRD(BFRD),.WREN_N(WREN_N),.RY_EN(RY_EN),.SLOWRD_EN(SLOWRD_EN),.OE(OE),.POR_N(POR_N),.D(D),.BA(BA),.gnd_1(gnd_1),.vdd(vdd));
initial begin
wvector[0] = {1'b0,1'b0,1'b1,1'b0,1'b0,1'b1,8'b00000000,10'b0000000000};
wvector[1] = {1'b0,1'b0,1'b1,1'b0,1'b0,1'b1,8'b00000001,10'b1000000000};
wvector[2] = {1'b0,1'b0,1'b1,1'b0,1'b0,1'b1,8'b00000010,10'b0100000000};
wvector[3] = {1'b0,1'b0,1'b1,1'b0,1'b0,1'b1,8'b00000011,10'b1100000000};
wvector[4] = {1'b0,1'b0,1'b1,1'b0,1'b0,1'b1,8'b00000100,10'b0010000000};
wvector[5] = {1'b0,1'b0,1'b1,1'b0,1'b0,1'b1,8'b00000101,10'b1010000000};
....
end
always@(posedge clk)
temp=ivector;
//bidirectional data
assign D=(OE == 0 && WREN_N == 0 && BFRD == 0) ? temp[6:13] : 8'bz ;
....
end
endmodule |