亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? sdr_sdram_tb.v

?? sdram的控制器 verilog源碼
?? V
?? 第 1 頁 / 共 2 頁
字號:
                for(i = 1; i <= length-2; i = i + 1)
                begin
                #1000;
                        datain <= start_value + i;
                        
                        @(posedge clk);
                        
                end
                #1000;
                datain <= start_value + i;               // keep incrementing the data value
                #1000;    
                cmd <= 3'b100;                           // issue a precharge/terminate command to terminate the page burst                         
                @(posedge clk);
                #1000;

                datain <= start_value + i + 1;           // increment the data one more
                   
                @(cmdack == 1)                           // Wait for the controller to ack the command   
                #2000;
                cmd <= 3'b000;                           // Clear the command by issuing a NOP
                
                dm <= 0;
                #1000000;
                cmd <= 3'b100;                           // issue a precharge command to close the page                          
                @(posedge clk);
                @(cmdack==1);
                @(posedge clk);
                #1000;    
                cmd  <= 3'b000;


        end
endtask



//      page_read_burst(address, start_value, CL, RCD, length)
//
//      This task performs a page read access of size length 
//      at SDRAM address to the SDRAM controller
//
//      address         :       Address in SDRAM to start the burst access
//      start_value     :       Starting value for the burst read sequence.  The read burst task
//                                simply increments and compares the data values from the start_value.
//      CL              :       CAS latency the sdram devices have been configured for.
//      RCD             :       RCD value the controller has been configured for.
//      length          :       burst length of the access


task    page_read_burst;

        input   [`ASIZE-1 : 0]         address;
        input   [`DSIZE-1 : 0]         start_value;
        input   [1 : 0]                CL;
        input   [1 : 0]                RCD;
        input   [15 : 0]               length;
        integer                        i;
        reg     [`DSIZE-1 : 0]         read_data;
        
        begin
                addr  <= address;
                cmd   <= 3'b001;                                 // issue a read command to the controller
                @(cmdack == 1);                                  // wait for the controller to ack
                @(posedge clk);
                #1000;
                cmd <= 3'b000;
                                                   // NOP on the command input
                for (i=1 ; i<=(CL+RCD+1); i=i+1)                 // Wait for activate and cas latency delays
                @(posedge clk);
                for(i = 1; i <= length; i = i + 1)               // loop and collect the data
                begin
                        @(posedge clk);
                        read_data <= dataout;
                        #2000;
                        if (i == (length-8)) cmd <= 3'b100;      // Terminate the page burst 
                        if (cmdack == 1) cmd<=3'b000;            // end the precharge command once the controller has ack'd
                        if (read_data !== start_value + i - 1)
                        begin
                                $display("Read error at %h read %h expected %h", (addr+i-1), read_data, (start_value + i -1));
                                $stop;
                        end
                end
        end
endtask






//      config(bl, cl, rc, pm, ref)
//
//      This task cofigures the SDRAM devices and the controller 
//
//      bl         :       Burst length 1,2,4, or 8
//      cl         :       Cas latency, 2 or 3
//      rc         :       Ras to Cas delay.
//      pm         :       page mode setting
//      ref        :       refresh period setting


task    config;

        input   [3 : 0]           bl;
        input   [1 : 0]           cl;
        input   [1 : 0]           rc;
        input                     pm;
        input   [15: 0]           ref;
        
        reg     [`ASIZE-1 : 0]    config_data;
        
        begin
                config_data <= 0;
                @(posedge clk);
                @(posedge clk);
                                                        
                @(posedge clk);
                if (bl == 1)
                        config_data[2:0] <= 3'b000;     // Set the Burst length portion of the mode data
                else if (bl == 2)
                        config_data[2:0] <= 3'b001;
                else if (bl == 4)
                        config_data[2:0] <= 3'b010;
                else if (bl == 8)
                        config_data[2:0] <= 3'b011;
                else if (bl == 0)
                        config_data[2:0] <= 3'b111;    // full page burst configuration value for bl
                        
                config_data[6:4] <= cl;
        
                                                         // issue precharge before issuing load_mode
                @(posedge clk);
                cmd <= 3'b100;                         
                @(cmdack == 1)                           // Wait for the controller to ack the command   
                #2000;
                cmd <= 3'b000;                           // Clear the command by issuing a NOP

                @(posedge clk);
                #2000;
        
                                                        // load mode register
                cmd <= 3'b101;
                addr[15:0] <= config_data;
                @(cmdack == 1)                          // Wait for the controller to ack the command
                cmd <= 3'b000;                          // Clear the command by issuing a NOP
        
        
                config_data <= 0;
                config_data[15:0] <= ref;
                @(posedge clk);
                                                         // load refresh counter
                @(posedge clk);
                addr[15:0] <= config_data;
                cmd  <= 3'b111;
                @(cmdack == 1 );                         // Wait for the controller to ack the command
                #2000;                          
                cmd  <= 3'b000;                          // Clear the command by issuing a NOP
                addr <= 0;
                config_data <= 0;               
                
                config_data[1:0] <= cl;                  // load contorller reg1
                config_data[3:2] <= rc;
                config_data[8] <= pm;
                config_data[12:9] <= bl;
                @(posedge clk);
                #2000;
                addr[15:0] <= config_data;
                cmd  <= 3'b110;
                @(cmdack == 1)                           // Wait for the controller to ack the command
                #2000;
                cmd  <= 3'b000;                          // Clear the command by issuing a NOP
                addr <= 0;
                config_data <= 0;
        
               
                
        end
endtask

initial begin
        cmd = 0;
        addr = 0;
        ref_ack = 0;
        dm <= 0;

        #3000000; 


  $display("Testing page burst accesses");
  config(0,3,3,1,1526);
  #1000000;

  $display("Writing a ramp value from 0-29 out to sdram at address 0x0");
  page_write_burst(0, 0, 4'h0, 3, 30);
  #1000000;

 $display("Reading the ramp value from sdram at address 0x0");
  page_read_burst(0,0,3,3,30);
 #1000000;


  $display("Testing data mask inputs");
  config(8,3,3,0,1526);
  #1000000;
  
  $display("writing pattern 0,1,2,3,4,5,6,7 to sdram at address 0x0");
  burst_write(0, 0, 4'b0, 3, 8);
  
  $display("Reading and verifing the pattern 0,1,2,3,4,5,6,7 at sdram address 0x0");
  burst_read(0, 0, 3, 3, 8);
  
  $display("Writing pattern 0xfffffff0, 0xfffffff1, 0xfffffff2, 0xfffffff3, 0xfffffff4, 0xfffffff5, 0xfffffff6, 0xfffffff7");
  $display("with DM set to 0xf");
  burst_write(0, 32'hfffffff0, 4'b1111, 3, 8);
  
  $display("Reading and verifing that the pattern at sdram address 0x0 is");
  $display("still 0,1,2,3,4,5,6,7");
  burst_read(0, 0, 3, 3, 8);
  
  $display("End of data mask test");
  
  
  
  bl = 1;
  for (x = 1; x <=4; x = x + 1)
  begin
    for (y = 3; y <= 3; y = y + 1)              // at 133mhz cl must be 3,  if 100mhz cl can be 2
    begin 
      for (z = 3; z <=3; z = z + 1)             //at 133mhz rc must be 3, if 100mhz rc can be 2
      begin
         $display("configuring for bl = %d   cl = %d   rc = %d",bl,y,z);
         config(bl, y, z, 0, 1526);
                

// perform 1024 burst writes to the first chip select, writing a ramp pattern
        $display("Peforming burst write to first sdram bank");
        test_data <= 0;
        test_addr <= 0;
        @(posedge clk);
        @(posedge clk);
        for (j = 0; j < `LOOP_LENGTH; j = j + 1)
        begin
                burst_write(test_addr, test_data, 4'h0, z, bl);
                test_data <= test_data + bl;
                test_addr <= test_addr + bl;
                #50000;
        end
        

// perform 1024 burst reads to the first chip select, verifing the ramp pattern
        $display("Performing burst read, verify ramp values in first sdram bank");
        test_data <= 0;
        test_addr <= 0;
        @(posedge clk);
        @(posedge clk);
        for (j = 0; j < `LOOP_LENGTH; j = j + 1)
        begin
                burst_read(test_addr, test_data, y, z, bl);
                test_data <= test_data + bl;
                test_addr <= test_addr + bl;
        end
        
        #500000;

// perform 1024 burst writes to the second chip select, writing a ramp pattern
        $display("Peforming burst write to second sdram bank");
        test_data <= 24'h400000;
        test_addr <= 24'h400000;
        @(posedge clk);
        @(posedge clk);
        for (j = 0; j < `LOOP_LENGTH; j = j + 1)
        begin
                burst_write(test_addr, test_data, 4'h0, z, bl);
                test_data <= test_data + bl;
                test_addr <= test_addr + bl;
                @(posedge clk);
        end
        
// perform 1024 burst reads to the second chip select, verifing the ramp pattern
        $display("Performing burst read, verify ramp values in second sdram bank");
        test_data <= 24'h400000;
        test_addr <= 24'h400000;
        @(posedge clk);
        @(posedge clk);
        for (j = 0; j < `LOOP_LENGTH; j = j + 1)
        begin
                burst_read(test_addr, test_data, y, z, bl);
                test_data <= test_data + bl;
                test_addr <= test_addr + bl;
        end
        
        #500000;

        $display("Test complete");
      end
    end
    bl = bl * 2;

  end
$stop;
end

endmodule

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
奇米888四色在线精品| 国产盗摄视频一区二区三区| 日韩激情在线观看| 成人av午夜影院| 日韩欧美一级二级三级久久久| 中文字幕在线一区免费| 久久99九九99精品| 欧美唯美清纯偷拍| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲成av人在线观看| 国产精品性做久久久久久| 欧美色老头old∨ideo| 国产精品每日更新| 国产一区二区在线影院| 欧美高清一级片在线| 亚洲天堂成人在线观看| 国产成人午夜电影网| 欧美精品视频www在线观看| 亚洲激情五月婷婷| 成人国产亚洲欧美成人综合网| 欧美v日韩v国产v| 午夜不卡av在线| 欧美中文字幕不卡| 亚洲情趣在线观看| 97超碰欧美中文字幕| 久久久久久夜精品精品免费| 美女被吸乳得到大胸91| 欧美一区二区三区免费观看视频| 一区二区成人在线| 日本高清不卡视频| 亚洲黄色av一区| 色偷偷一区二区三区| 亚洲人一二三区| 日本韩国欧美国产| 亚洲亚洲精品在线观看| 91福利在线观看| 亚洲与欧洲av电影| 欧美在线免费播放| 一区二区三区成人在线视频| 色综合久久久久久久| 一区二区三区在线免费| 91福利在线看| 日韩av一区二区三区| 宅男在线国产精品| 激情文学综合网| 久久婷婷一区二区三区| 国产成人精品网址| 亚洲欧美中日韩| 91精品办公室少妇高潮对白| 亚洲国产精品久久一线不卡| 欧美色大人视频| 美女在线观看视频一区二区| 久久综合一区二区| 成人精品高清在线| 亚洲午夜免费福利视频| 欧美日韩国产精选| 久久国产精品72免费观看| 久久精品欧美一区二区三区麻豆| 国产成人免费在线观看不卡| 中文字幕一区二区三区精华液| 色综合欧美在线| 日本在线播放一区二区三区| 亚洲精品一区二区三区香蕉| 成人av片在线观看| 亚洲成a人v欧美综合天堂| 日韩女优毛片在线| zzijzzij亚洲日本少妇熟睡| 亚洲图片有声小说| www久久精品| 日本高清免费不卡视频| 蜜臀久久久久久久| 一区二区在线看| 欧美日韩国产高清一区| 国产一区二区精品久久99| 亚洲卡通动漫在线| 精品国产a毛片| 欧亚一区二区三区| 国产精品亚洲视频| 午夜久久久影院| 国产精品系列在线| 欧美一级日韩不卡播放免费| 成人福利视频在线| 久久99蜜桃精品| 亚洲综合成人网| 国产午夜亚洲精品羞羞网站| 欧美亚洲一区三区| 成人91在线观看| 日本中文在线一区| 亚洲影视资源网| 国产精品人妖ts系列视频| 欧美日韩不卡视频| aaa国产一区| 国产精品亚洲а∨天堂免在线| 天堂午夜影视日韩欧美一区二区| 国产免费成人在线视频| 日韩精品一区二区三区四区| 在线亚洲精品福利网址导航| 国产成人综合在线播放| 美国av一区二区| 亚洲成a人v欧美综合天堂下载| **网站欧美大片在线观看| 久久久久久久久99精品| 91精品国产福利| 欧美区视频在线观看| 色拍拍在线精品视频8848| 成人av影院在线| 成人黄色电影在线| 国产成人免费在线观看| 国产精品一区一区| 国内不卡的二区三区中文字幕| 免费在线一区观看| 日韩黄色在线观看| 午夜精品久久久久久久久| 一区二区三区不卡视频| 亚洲欧洲日韩在线| 日韩美女久久久| 亚洲少妇30p| 亚洲精品综合在线| 亚洲综合偷拍欧美一区色| 亚洲人成在线观看一区二区| 中文字幕中文字幕在线一区 | 奇米影视一区二区三区| 亚洲乱码中文字幕综合| 亚洲裸体xxx| 亚洲精品ww久久久久久p站| 中文字幕综合网| 亚洲美女视频在线| 亚洲国产人成综合网站| 婷婷综合另类小说色区| 舔着乳尖日韩一区| 精品一区二区久久久| 国产麻豆欧美日韩一区| 成人黄色777网| 91国产视频在线观看| 精品视频在线免费看| 91精品欧美福利在线观看| 日韩精品一区二区三区四区视频| 久久综合久久鬼色| 一区二区中文视频| 亚洲成人激情综合网| 美女精品一区二区| 国产乱子轮精品视频| 成人av在线观| 欧美日韩精品专区| 日韩美女天天操| 中文字幕免费在线观看视频一区| 亚洲成人综合视频| 精品一区二区在线观看| 成人午夜在线播放| 欧美三级电影在线观看| 精品国产凹凸成av人导航| 国产精品女人毛片| 日韩电影在线免费看| 国产成人精品免费看| 欧美在线观看一二区| 精品久久国产老人久久综合| 亚洲欧洲一区二区三区| 日本不卡一二三| 99视频一区二区| 欧美一级理论片| 国产精品国产三级国产普通话蜜臀| 亚洲乱码日产精品bd| 激情另类小说区图片区视频区| 91在线无精精品入口| 欧美一级艳片视频免费观看| 中文字幕视频一区| 精品在线播放午夜| 欧美三级一区二区| 欧美国产精品一区| 麻豆精品蜜桃视频网站| 色综合久久综合网| 国产欧美视频一区二区| 午夜精品一区二区三区免费视频| 高清不卡在线观看| 日韩三级视频中文字幕| 一区二区三区在线视频免费 | 国内精品伊人久久久久av一坑| 色综合一个色综合| 久久精品亚洲精品国产欧美kt∨| 亚洲成人综合视频| 色综合天天做天天爱| 久久久久久久久久久久久久久99| 视频一区二区中文字幕| 色综合色综合色综合色综合色综合| 久久久不卡网国产精品二区| 偷拍亚洲欧洲综合| 在线观看日韩av先锋影音电影院| 国产精品人成在线观看免费| 久久99精品国产麻豆婷婷 | 亚洲一区视频在线| 成人avav影音| 国产精品天美传媒| 国产一区二区电影| 精品久久久久久久久久久久久久久久久| 亚洲成av人片在线| 欧美日韩在线直播| 亚洲午夜电影网| 在线观看亚洲a| 一区二区三区蜜桃| 在线视频综合导航|