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

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

?? sdr_sdram_tb.v

?? SDRAM的vegilog代碼
?? 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一区二区三区免费野_久草精品视频
日韩欧美中文字幕精品| 一区二区三区成人| 国产一区二区免费在线| 日韩欧美亚洲另类制服综合在线| 亚洲国产视频网站| 91麻豆精品国产自产在线观看一区| 亚洲成人免费视频| 91精品国产综合久久福利| 久久精品av麻豆的观看方式| 2017欧美狠狠色| 99精品视频在线播放观看| 亚洲综合免费观看高清完整版在线| 欧美日韩国产电影| 国内精品在线播放| 国产精品乱码一区二区三区软件 | 中文字幕在线视频一区| 9l国产精品久久久久麻豆| 一区二区三区免费网站| 欧美一区二区美女| 欧美精品1区2区3区| 蜜桃传媒麻豆第一区在线观看| 久久久久久夜精品精品免费| 91浏览器在线视频| 日韩国产高清在线| 中文字幕巨乱亚洲| 欧美日韩一二区| 成人性生交大片| 日韩激情视频网站| 久久久777精品电影网影网 | 久久久欧美精品sm网站| 91网页版在线| 久久精品国产精品亚洲精品| 中文字幕人成不卡一区| 欧美一区二区精品在线| av在线不卡观看免费观看| 成人av资源网站| 亚洲人亚洲人成电影网站色| 91麻豆自制传媒国产之光| 亚洲二区在线观看| 精品日产卡一卡二卡麻豆| 91麻豆文化传媒在线观看| 久久精品国产成人一区二区三区| 一区二区三区中文免费| 欧美videos大乳护士334| 91蝌蚪porny成人天涯| 激情六月婷婷综合| 亚洲超碰97人人做人人爱| 国产精品久久久久久久浪潮网站| 欧美麻豆精品久久久久久| 成人动漫一区二区在线| 久久99深爱久久99精品| 午夜视频在线观看一区二区三区| 国产精品九色蝌蚪自拍| 久久久久久久久久久99999| 91精品国产一区二区三区香蕉| 色偷偷久久人人79超碰人人澡| 激情综合网av| 日韩国产欧美三级| 美女视频黄久久| 成人免费在线观看入口| 久久午夜老司机| 日韩三区在线观看| 色狠狠综合天天综合综合| 成人自拍视频在线| 国内国产精品久久| 久久av老司机精品网站导航| 日韩电影一区二区三区| 亚洲第一福利一区| 亚洲国产欧美日韩另类综合| 亚洲三级电影网站| 亚洲四区在线观看| 国产精品国产三级国产aⅴ入口 | 三级欧美在线一区| 亚洲国产aⅴ成人精品无吗| 亚洲欧美国产毛片在线| 1区2区3区精品视频| 国产精品卡一卡二| 国产精品午夜电影| 中文字幕制服丝袜成人av| 国产精品国产三级国产aⅴ中文| 中文av一区二区| 成人免费在线观看入口| 精品国产一区二区三区久久影院| 日韩三区在线观看| 日韩欧美久久久| 91精品国产色综合久久| 日韩一卡二卡三卡四卡| 精品成人在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 国产欧美一区二区三区网站| 国产精品美日韩| 一卡二卡欧美日韩| 日韩精品欧美精品| 精品一区二区三区在线播放视频| 激情av综合网| 成人动漫精品一区二区| 一本色道亚洲精品aⅴ| 欧美日韩国产三级| 欧美成人精品1314www| 国产三级欧美三级日产三级99| 欧美激情资源网| 亚洲国产视频直播| 国产精品自拍毛片| 成人免费高清在线| 精品视频色一区| 欧美成人vr18sexvr| 亚洲欧洲av在线| 五月婷婷综合激情| 国产精品自在在线| 欧美午夜精品理论片a级按摩| 欧美丰满少妇xxxxx高潮对白 | 成人免费高清视频在线观看| 91在线国产福利| 日韩午夜av一区| 国产精品第五页| 日韩精品午夜视频| 成人一级片网址| 在线播放欧美女士性生活| 久久在线观看免费| 夜夜操天天操亚洲| 国产美女视频一区| 欧美日韩在线三区| 日本一区二区三区免费乱视频| 亚洲成人先锋电影| caoporen国产精品视频| 91精品一区二区三区久久久久久| 中文字幕+乱码+中文字幕一区| 天堂av在线一区| 成人激情校园春色| 精品久久久久一区| 亚洲国产成人tv| 99综合电影在线视频| 日韩欧美www| 亚洲自拍与偷拍| 成人国产精品免费观看视频| 日韩欧美色综合| 亚洲国产精品精华液网站| jiyouzz国产精品久久| 91精品国产乱码| 亚洲一区二区三区小说| 99久久久精品| 国产欧美精品一区二区三区四区 | 精品久久久三级丝袜| 亚洲1区2区3区4区| 日本道精品一区二区三区| 欧美国产日韩精品免费观看| 老色鬼精品视频在线观看播放| 欧美日韩一级片在线观看| 亚洲老司机在线| 99综合影院在线| 国产精品福利一区| 国产一区日韩二区欧美三区| 日韩一区国产二区欧美三区| 一区二区在线观看免费视频播放| 国产超碰在线一区| 久久先锋影音av| 国产一区二区久久| 久久嫩草精品久久久久| 久久激五月天综合精品| 欧美一级免费观看| 蜜桃精品在线观看| 日韩午夜电影av| 久久99热国产| 亚洲精品在线观看网站| 久久精品72免费观看| 精品国产sm最大网站免费看| 久久99精品国产| 精品日产卡一卡二卡麻豆| 国产做a爰片久久毛片| 欧美r级电影在线观看| 久久99久久精品| 久久久久久久久久久久久久久99 | 欧美在线|欧美| 一区二区不卡在线播放| 欧美色精品在线视频| 亚洲1区2区3区4区| 日韩免费电影网站| 国产乱码一区二区三区| 欧美激情一区二区三区不卡| 成人一区二区三区中文字幕| 专区另类欧美日韩| 欧美怡红院视频| 日本成人在线网站| 久久欧美一区二区| 成人激情综合网站| 亚洲国产欧美在线人成| 日韩一区二区在线观看视频| 国产一区美女在线| 自拍偷拍亚洲激情| 欧美色视频在线| 国产在线国偷精品免费看| 国产精品福利av| 91高清在线观看| 久久黄色级2电影| 中文字幕中文字幕在线一区| 色综合久久88色综合天天 | 精品va天堂亚洲国产| 成人久久久精品乱码一区二区三区| 亚洲精品一卡二卡| 欧美一级夜夜爽|