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

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

?? sdramcntl.vhd

?? xst3_video.ZIP是基于XILINX的XST3開發板的視頻采集源碼
?? VHD
?? 第 1 頁 / 共 4 頁
字號:
  constant WRITE_CMD  : sdramCmd := "010000";
  constant PCHG_CMD   : sdramCmd := "001011";
  constant MODE_CMD   : sdramCmd := "000011";
  constant RFSH_CMD   : sdramCmd := "000111";

  -- SDRAM mode register
  -- the SDRAM is placed in a non-burst mode (burst length = 1) with a 3-cycle CAS
  subtype sdramMode is std_logic_vector(11 downto 0);
  constant MODE : sdramMode := "00" & "0" & "00" & "011" & "0" & "000";

  -- the host address is decomposed into these sets of SDRAM address components
  constant ROW_LEN : natural := log2(NROWS);  -- number of row address bits
  constant COL_LEN : natural := log2(NCOLS);  -- number of column address bits
  signal   bank    : std_logic_vector(ba'range);  -- bank address bits
  signal   row     : std_logic_vector(ROW_LEN - 1 downto 0);  -- row address within bank
  signal   col     : std_logic_vector(sAddr'range);  -- column address within row

  -- registers that store the currently active row in each bank of the SDRAM
  constant NUM_ACTIVE_ROWS            : integer := int_select(MULTIPLE_ACTIVE_ROWS = false, 1, 2**ba'length);
  type activeRowType is array(0 to NUM_ACTIVE_ROWS-1) of std_logic_vector(row'range);
  signal   activeRow_r, activeRow_x   : activeRowType;
  signal   activeFlag_r, activeFlag_x : std_logic_vector(0 to NUM_ACTIVE_ROWS-1);  -- indicates that some row in a bank is active
  signal   bankIndex                  : natural range 0 to NUM_ACTIVE_ROWS-1;  -- bank address bits
  signal   activeBank_r, activeBank_x : std_logic_vector(ba'range);  -- indicates the bank with the active row
  signal   doActivate                 : std_logic;  -- indicates when a new row in a bank needs to be activated

  -- there is a command bit embedded within the SDRAM column address
  constant CMDBIT_POS    : natural   := 10;  -- position of command bit
  constant AUTO_PCHG_ON  : std_logic := '1';  -- CMDBIT value to auto-precharge the bank
  constant AUTO_PCHG_OFF : std_logic := '0';  -- CMDBIT value to disable auto-precharge
  constant ONE_BANK      : std_logic := '0';  -- CMDBIT value to select one bank
  constant ALL_BANKS     : std_logic := '1';  -- CMDBIT value to select all banks

  -- status signals that indicate when certain operations are in progress
  signal wrInProgress       : std_logic;  -- write operation in progress
  signal rdInProgress       : std_logic;  -- read operation in progress
  signal activateInProgress : std_logic;  -- row activation is in progress

  -- these registers track the progress of read and write operations
  signal rdPipeline_r, rdPipeline_x : std_logic_vector(CAS_CYCLES+1 downto 0);  -- pipeline of read ops in progress
  signal wrPipeline_r, wrPipeline_x : std_logic_vector(0 downto 0);  -- pipeline of write ops (only need 1 cycle)

  -- registered outputs to host
  signal opBegun_r, opBegun_x             : std_logic;  -- true when SDRAM read or write operation is started
  signal hDOut_r, hDOut_x                 : std_logic_vector(hDOut'range);  -- holds data read from SDRAM and sent to the host
  signal hDOutOppPhase_r, hDOutOppPhase_x : std_logic_vector(hDOut'range);  -- holds data read from SDRAM   on opposite clock edge

  -- registered outputs to SDRAM
  signal cke_r, cke_x           : std_logic;  -- clock enable 
  signal cmd_r, cmd_x           : sdramCmd;  -- SDRAM command bits
  signal ba_r, ba_x             : std_logic_vector(ba'range);  -- SDRAM bank address bits
  signal sAddr_r, sAddr_x       : std_logic_vector(sAddr'range);  -- SDRAM row/column address
  signal sData_r, sData_x       : std_logic_vector(sDOut'range);  -- SDRAM out databus
  signal sDataDir_r, sDataDir_x : std_logic;  -- SDRAM databus direction control bit

begin

  -----------------------------------------------------------
  -- attach some internal signals to the I/O ports 
  -----------------------------------------------------------

  -- attach registered SDRAM control signals to SDRAM input pins
  (ce_n, ras_n, cas_n, we_n, dqmh, dqml) <= cmd_r;  -- SDRAM operation control bits
  cke                                    <= cke_r;  -- SDRAM clock enable
  ba                                     <= ba_r;  -- SDRAM bank address
  sAddr                                  <= sAddr_r;  -- SDRAM address
  sDOut                                  <= sData_r;  -- SDRAM output data bus
  sDOutEn                                <= YES when sDataDir_r = OUTPUT else NO;  -- output databus enable

  -- attach some port signals
  hDOut   <= hDOut_r;                   -- data back to host
  opBegun <= opBegun_r;                 -- true if requested operation has begun


  -----------------------------------------------------------
  -- compute the next state and outputs 
  -----------------------------------------------------------

  combinatorial : process(rd, wr, hAddr, hDIn, hDOut_r, sDIn, state_r, opBegun_x,
                          activeFlag_r, activeRow_r, activeBank_r, rdPipeline_r, wrPipeline_r,                          hDOutOppPhase_r, nopCntr_r, lock, rfshCntr_r, timer_r, rasTimer_r,
                          wrTimer_r, refTimer_r, cmd_r, cke_r, col, ba_r)  begin

    -----------------------------------------------------------
    -- setup default values for signals 
    -----------------------------------------------------------

    opBegun_x    <= NO;                 -- no operations have begun
    earlyOpBegun <= opBegun_x;
    cke_x        <= YES;                -- enable SDRAM clock
    cmd_x        <= NOP_CMD;            -- set SDRAM command to no-operation
    sDataDir_x   <= INPUT;              -- accept data from the SDRAM
    sData_x      <= hDIn(sData_x'range);  -- output data from host to SDRAM
    state_x      <= state_r;            -- reload these registers and flags
    activeFlag_x <= activeFlag_r;       --              with their existing values
    activeRow_x  <= activeRow_r;
    activeBank_x <= activeBank_r;
    rfshCntr_x   <= rfshCntr_r;

    -----------------------------------------------------------
    -- setup default value for the SDRAM address 
    -----------------------------------------------------------

    -- extract bank field from host address
    ba_x                    <= hAddr(ba'length + ROW_LEN + COL_LEN - 1 downto ROW_LEN + COL_LEN);
    if MULTIPLE_ACTIVE_ROWS = true then
      bank                  <= (others => '0');
      bankIndex             <= CONV_INTEGER(ba_x);
    else
      bank                  <= ba_x;
      bankIndex             <= 0;
    end if;
    -- extract row, column fields from host address
    row                     <= hAddr(ROW_LEN + COL_LEN - 1 downto COL_LEN);
    -- extend column (if needed) until it is as large as the (SDRAM address bus - 1)
    col                     <= (others => '0');  -- set it to all zeroes
    col(COL_LEN-1 downto 0) <= hAddr(COL_LEN-1 downto 0);
    -- by default, set SDRAM address to the column address with interspersed
    -- command bit set to disable auto-precharge
    sAddr_x                 <= col(col'high-1 downto CMDBIT_POS) & AUTO_PCHG_OFF
                               & col(CMDBIT_POS-1 downto 0);

    -----------------------------------------------------------
    -- manage the read and write operation pipelines
    -----------------------------------------------------------

    -- determine if read operations are in progress by the presence of
    -- READ flags in the read pipeline 
    if rdPipeline_r(rdPipeline_r'high downto 1) /= 0 then
      rdInProgress <= YES;
    else
      rdInProgress <= NO;
    end if;
    rdPending      <= rdInProgress;     -- tell the host if read operations are in progress

    -- enter NOPs into the read and write pipeline shift registers by default
    rdPipeline_x    <= NOP & rdPipeline_r(rdPipeline_r'high downto 1);
    wrPipeline_x(0) <= NOP;

    -- transfer data from SDRAM to the host data register if a read flag has exited the pipeline
    -- (the transfer occurs 1 cycle before we tell the host the read operation is done)
    if rdPipeline_r(1) = READ then
      hDOutOppPhase_x <= sDIn(hDOut'range);  -- gets value on the SDRAM databus on the opposite phase
      if IN_PHASE then
        -- get the SDRAM data for the host directly from the SDRAM if the controller and SDRAM are in-phase
        hDOut_x       <= sDIn(hDOut'range);
      else
        -- otherwise get the SDRAM data that was gathered on the previous opposite clock edge
        hDOut_x       <= hDOutOppPhase_r(hDOut'range);
      end if;
    else
      -- retain contents of host data registers if no data from the SDRAM has arrived yet
      hDOutOppPhase_x <= hDOutOppPhase_r;
      hDOut_x         <= hDOut_r;
    end if;

    done   <= rdPipeline_r(0) or wrPipeline_r(0);  -- a read or write operation is done
    rdDone <= rdPipeline_r(0);          -- SDRAM data available when a READ flag exits the pipeline 

    -----------------------------------------------------------
    -- manage row activation
    -----------------------------------------------------------

    -- request a row activation operation if the row of the current address
    -- does not match the currently active row in the bank, or if no row
    -- in the bank is currently active
    if (bank /= activeBank_r) or (row /= activeRow_r(bankIndex)) or (activeFlag_r(bankIndex) = NO) then
      doActivate <= YES;
    else
      doActivate <= NO;
    end if;

    -----------------------------------------------------------
    -- manage self-refresh
    -----------------------------------------------------------

    -- enter self-refresh if neither a read or write is requested for MAX_NOP consecutive cycles.
    if (rd = YES) or (wr = YES) then
      -- any read or write resets NOP counter and exits self-refresh state
      nopCntr_x  <= 0;
      doSelfRfsh <= NO;
    elsif nopCntr_r /= MAX_NOP then
      -- increment NOP counter whenever there is no read or write operation 
      nopCntr_x  <= nopCntr_r + 1;
      doSelfRfsh <= NO;
    else
      -- start self-refresh when counter hits maximum NOP count and leave counter unchanged
      nopCntr_x  <= nopCntr_r;
      doSelfRfsh <= YES;
    end if;

    -----------------------------------------------------------
    -- update the timers 
    -----------------------------------------------------------

    -- row activation timer
    if rasTimer_r /= 0 then
      -- decrement a non-zero timer and set the flag
      -- to indicate the row activation is still inprogress
      rasTimer_x         <= rasTimer_r - 1;
      activateInProgress <= YES;
    else
      -- on timeout, keep the timer at zero     and reset the flag
      -- to indicate the row activation operation is done
      rasTimer_x         <= rasTimer_r;
      activateInProgress <= NO;
    end if;

    -- write operation timer            
    if wrTimer_r /= 0 then
      -- decrement a non-zero timer and set the flag
      -- to indicate the write operation is still inprogress
      wrTimer_x    <= wrTimer_r - 1;
      wrInPRogress <= YES;
    else
      -- on timeout, keep the timer at zero and reset the flag that
      -- indicates a write operation is in progress
      wrTimer_x    <= wrTimer_r;
      wrInPRogress <= NO;
    end if;

    -- refresh timer            
    if refTimer_r /= 0 then
      refTimer_x <= refTimer_r - 1;
    else
      -- on timeout, reload the timer with the interval between row refreshes
      -- and increment the counter for the number of row refreshes that are needed
      refTimer_x <= REF_CYCLES;
      if ENABLE_REFRESH then
        rfshCntr_x <= rfshCntr_r + 1;
      else
        rfshCntr_x <= 0; -- refresh never occurs if this counter never gets above zero
      end if;
    end if;

    -- main timer for sequencing SDRAM operations               
    if timer_r /= 0 then
      -- decrement the timer and do nothing else since the previous operation has not completed yet.
      timer_x <= timer_r - 1;
      status  <= "0000";
    else
      -- the previous operation has completed once the timer hits zero
      timer_x <= timer_r;               -- by default, leave the timer at zero

      -----------------------------------------------------------
      -- compute the next state and outputs 
      -----------------------------------------------------------
      case state_r is

        -----------------------------------------------------------
        -- let clock stabilize and then wait for the SDRAM to initialize 
        -----------------------------------------------------------
        when INITWAIT =>
          if lock = YES then
                                        -- wait for SDRAM power-on initialization once the clock is stable
            timer_x <= INIT_CYCLES;     -- set timer for initialization duration
            state_x <= INITPCHG;
          else
                                        -- disable SDRAM clock and return to this state if the clock is not stable

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产毛片精品视频| 亚洲自拍偷拍综合| 最好看的中文字幕久久| 日韩极品在线观看| voyeur盗摄精品| 日韩精品影音先锋| 亚洲精品免费在线观看| 国产精品996| 日韩精品中文字幕在线不卡尤物| 中文字幕一区二区三区精华液| 亚洲1区2区3区视频| 99热精品国产| 国产三级一区二区| 久久激情五月激情| 欧美日本国产视频| 综合久久久久久久| fc2成人免费人成在线观看播放 | 欧美区视频在线观看| 国产蜜臀97一区二区三区| 久久aⅴ国产欧美74aaa| 欧美日韩1234| 亚洲大片一区二区三区| 色综合久久久久综合| 国产精品视频观看| 国产福利一区在线观看| xvideos.蜜桃一区二区| 奇米四色…亚洲| 91 com成人网| 日本不卡视频在线观看| 在线电影院国产精品| 亚洲va国产va欧美va观看| 91激情五月电影| 亚洲国产欧美另类丝袜| 欧美色倩网站大全免费| 亚洲国产精品久久一线不卡| 在线免费观看日韩欧美| 亚洲午夜久久久久久久久久久| 在线精品国精品国产尤物884a| 一区二区久久久| 欧美日韩日日摸| 亚洲国产精品久久久久婷婷884| 在线观看亚洲一区| 午夜激情久久久| 日韩一区二区免费视频| 久88久久88久久久| 久久久亚洲国产美女国产盗摄| 高清av一区二区| 国产精品电影院| 精品视频1区2区| 日本aⅴ精品一区二区三区| 欧美精品一区二区三区蜜臀| 国产风韵犹存在线视精品| 国产精品色眯眯| 色综合欧美在线| 偷拍一区二区三区| 精品国产一二三| 不卡的av网站| 午夜国产精品一区| 2欧美一区二区三区在线观看视频| 国产激情一区二区三区桃花岛亚洲| 国产精品国产三级国产有无不卡 | 国产一区二区不卡老阿姨| 国产天堂亚洲国产碰碰| 色综合一个色综合亚洲| 午夜精品久久久久| 国产欧美综合在线| 欧美亚一区二区| 精一区二区三区| 亚洲女与黑人做爰| 欧美变态tickling挠脚心| 波多野结衣中文一区| 亚洲一区视频在线| 久久亚洲一区二区三区明星换脸| 日本韩国一区二区三区视频| 日韩av中文字幕一区二区| 日本一二三不卡| 欧美高清激情brazzers| 懂色中文一区二区在线播放| 亚洲大型综合色站| 国产精品午夜久久| 7777精品伊人久久久大香线蕉完整版 | 欧美一区二区三区免费观看视频| 国产v日产∨综合v精品视频| 伊人夜夜躁av伊人久久| 精品毛片乱码1区2区3区| 91在线视频播放地址| 久久国产精品99久久久久久老狼| 亚洲欧美日韩小说| 欧美韩国日本不卡| 欧美本精品男人aⅴ天堂| 色婷婷国产精品| 成人三级在线视频| 久久99精品久久久久婷婷| 亚洲欧美经典视频| 国产亚洲一区二区在线观看| 欧美一区二区三区视频在线观看| 色综合视频一区二区三区高清| 国产一区福利在线| 麻豆精品久久久| 天天做天天摸天天爽国产一区| 综合久久一区二区三区| 国产婷婷一区二区| 26uuu成人网一区二区三区| 欧美一区二区精品久久911| 欧美天堂亚洲电影院在线播放| 成人一区在线看| 国产成人av自拍| 国产精品中文字幕一区二区三区| 日本成人在线网站| 同产精品九九九| 亚洲国产毛片aaaaa无费看| 亚洲免费视频中文字幕| 国产精品人妖ts系列视频| 精品国产乱码久久久久久免费 | 色欧美88888久久久久久影院| 粉嫩aⅴ一区二区三区四区| 国产河南妇女毛片精品久久久| 精品一区二区三区免费| 九色综合狠狠综合久久| 久草在线在线精品观看| 精品一区二区三区免费| 黄页视频在线91| 国产一区二区在线看| 国产精品538一区二区在线| 国产91精品久久久久久久网曝门| 国产精品综合视频| 北条麻妃一区二区三区| 色综合天天综合网国产成人综合天| 成人一区二区三区视频 | 国产不卡视频在线观看| 成人性生交大片免费看中文| 成人精品免费看| www.日韩av| 欧美色爱综合网| 日韩欧美一二区| 国产丝袜欧美中文另类| 一区二区中文视频| 一区二区三区在线观看国产| 五月婷婷综合在线| 国产一区二区三区黄视频| www.日韩在线| 欧美一区二区视频在线观看2020| 日韩三级av在线播放| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美日韩激情在线| 26uuu色噜噜精品一区二区| 国产三级三级三级精品8ⅰ区| 亚洲免费在线视频| 日本va欧美va瓶| 成人免费看黄yyy456| 在线亚洲+欧美+日本专区| 日韩一区二区三区四区 | 奇米影视7777精品一区二区| 国产一区二区三区香蕉| 91网站在线观看视频| 91精品国产高清一区二区三区 | 2022国产精品视频| 中文字幕日韩一区| 免费日本视频一区| 99视频精品全部免费在线| 69p69国产精品| 1000精品久久久久久久久| 日本欧美一区二区在线观看| 成人综合激情网| 91精品国产综合久久久蜜臀图片| 国产精品久久久久久久久免费丝袜| 日韩精品91亚洲二区在线观看| 国v精品久久久网| 欧美一区二区三区免费在线看| 国产精品传媒视频| 国产在线播精品第三| 欧美日韩一区二区在线视频| 国产视频一区不卡| 日本不卡一区二区三区高清视频| a级高清视频欧美日韩| 久久免费看少妇高潮| 日韩二区在线观看| 91久久国产最好的精华液| 欧美国产一区在线| 精品一区精品二区高清| 欧美日韩久久一区| 国产精品毛片高清在线完整版| 老司机精品视频一区二区三区| 91成人在线免费观看| 中文字幕中文字幕在线一区 | 欧美国产日韩亚洲一区| 日韩经典中文字幕一区| 欧美性受xxxx黑人xyx性爽| 国产精品美女一区二区| 国产精品996| 久久久久久久久久久久久女国产乱 | 91麻豆视频网站| **欧美大码日韩| 豆国产96在线|亚洲| 久久精品视频网| 国产成人av一区二区三区在线观看| 欧美白人最猛性xxxxx69交| 日韩av高清在线观看| 欧美日韩国产一二三| 爽好久久久欧美精品|