OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [boards/] [xilinx/] [atlys/] [bench/] [verilog/] [include/] [ddr2_model_preload.v] - Blame information for rev 631

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 631 stekern
// File intended to be included in the generate statement for each DDR2 part.
2
// The following loads a vmem file, "sram.vmem" by default, into the SDRAM.
3
 
4
// Wait until the DDR memory is initialised, and then magically
5
// load it
6
@(posedge dut.xilinx_ddr2_0.xilinx_ddr2_if0.ddr2_calib_done);
7
//$display("%t: Loading DDR2",$time);
8
 
9
$readmemh("sram.vmem", program_array);
10
/* Now dish it out to the DDR2 model's memory */
11
for(ram_ptr = 0 ; ram_ptr < 4096 ; ram_ptr = ram_ptr + 1)
12
  begin
13
 
14
     // Construct the burst line
15
     program_word_ptr = ram_ptr*4;
16
     tmp_program_word = program_array[program_word_ptr];
17
     ddr2_ram_mem_line[31:0] = tmp_program_word;
18
 
19
     program_word_ptr = program_word_ptr + 1;
20
     tmp_program_word = program_array[program_word_ptr];
21
     ddr2_ram_mem_line[63:32] = tmp_program_word;
22
 
23
 
24
     program_word_ptr = program_word_ptr + 1;
25
     tmp_program_word = program_array[program_word_ptr];
26
     ddr2_ram_mem_line[95:64] = tmp_program_word;
27
 
28
 
29
     program_word_ptr = program_word_ptr + 1;
30
     tmp_program_word = program_array[program_word_ptr];
31
     ddr2_ram_mem_line[127:96] = tmp_program_word;
32
 
33
     // Put this assembled line into the RAM using its memory writing TASK
34
     if (C3_MEM_ADDR_ORDER == "BANK_ROW_COLUMN") begin
35
        u_mem0.memory_write(2'b00,ram_ptr[19:7],
36
                           {ram_ptr[6:0],3'b000},ddr2_ram_mem_line);
37
     end else if (C3_MEM_ADDR_ORDER == "ROW_BANK_COLUMN") begin
38
        u_mem0.memory_write(ram_ptr[8:7],{2'b00,ram_ptr[19:9]},
39
                           {ram_ptr[6:0],3'b000},ddr2_ram_mem_line);
40
 
41
     end
42
     //$display("Writing 0x%h, ramline=%d",ddr2_ram_mem_line, ram_ptr);
43
 
44
  end // for (ram_ptr = 0 ; ram_ptr < ...
45
$display("(%t) * DDR2 RAM preloaded",$time);
46
 

powered by: WebSVN 2.1.0

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