tc58256ft.v
1.28 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// wrapper to map to bb sim;
// cloned tc58256ft.v and TC58512FT.v to emulate smaller device;
module tc58256ft (
io, cle, ale, ceb, reb, web, rbb, wpb, seb
);
inout [7:0] io;
input cle;
input ale;
input ceb;
input reb;
input web;
inout rbb;
input wpb;
input seb;
TC58256FT t ( io, ceb, web, reb, cle, ale, wpb, rbb );
// shuttfle toshiba init file;
integer addr;
integer fl_addr;
integer i;
parameter FLASH_PAGES = 64*1024;
initial
begin
$readmemh("External_File.txt", t.MEM);
addr = (FLASH_PAGES-1)*1024;
for(fl_addr = (FLASH_PAGES-1)*528; fl_addr >= 0; fl_addr = fl_addr - 528) begin
for (i=1023; i>=0; i=i-1)
t.MEM[addr + i] = (i >= 528)? 8'bx : t.MEM[fl_addr + i];
addr = addr - 1024;
end
repeat(20) @(posedge vsim.sysclk);
$display("%t DUMP 8 pages here ", $time);
for (i=0; i<8; i=i+1) begin
$display("PAGE: %d", i);
for (addr=0; addr<1024; addr=addr+1) begin
$write("%2h ", t.MEM[i*1024 + addr]);
if ((addr & 8'h0f) == 8'h0f)
$write("\n");
end
end
end
endmodule