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

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

?? atacntl.vhd

?? xilinx fpga 下的IDE控制器原代碼,貢獻一起學習
?? VHD
?? 第 1 頁 / 共 3 頁
字號:
  -- compute the next state and outputs 
  -----------------------------------------------------------

  combinatorial : process(state_r, rd, wr, head, cylinder, sector, hDIn, cmd_r, pioDOut,
                          status_r, pioBusy, pioIntrq, wordCnt_r, rtnState_r)
  begin

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

    done       <= NO;
    pioRd      <= NO;
    pioWr      <= NO;
    pioDIn     <= (others => '0');
    pioAddr    <= (others => '0');
    state_x    <= state_r;
    rtnState_x <= rtnState_r;
    cmd_x      <= cmd_r;
    wordCnt_x  <= wordCnt_r;
    status_x   <= status_r;

    if(pioBusy = NO) then

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

      case state_r is

        -----------------------------------------------------------------
        -- set and then clear the reset bit in the disk control register
        -----------------------------------------------------------------                               
        when RESET_DRIVE   =>
          pioWr              <= YES;
          pioAddr            <= CONTROL_REG;
          pioDIn(7 downto 0) <= DRIVE_RESET_CMD;
          state_x            <= RESET_DRIVE_1;
          status_x           <= "0000010";
        when RESET_DRIVE_1 =>
          pioWr              <= YES;
          pioAddr            <= CONTROL_REG;
          pioDIn(7 downto 0) <= DRIVE_RELEASE_CMD;
          state_x            <= WAIT_FOR_NOT_BUSY;  -- wait for the drive to go non-busy after reset
          rtnState_x         <= WAIT_FOR_CMD;
          status_x           <= "0000100";

          -----------------------------------------------------------------
          -- abort the current command by issuing a NOP command
          -----------------------------------------------------------------                             
        when ABORT_1 =>
          pioWr              <= YES;
          pioAddr            <= CMD_REG;
          pioDIn(7 downto 0) <= NOP_CMD;
          state_x            <= WAIT_FOR_NOT_BUSY;
          rtnState_x         <= WAIT_FOR_CMD;
          status_x           <= "0000110";

          -----------------------------------------------------------------
          -- wait for the busy bit in the disk status register to clear
          -----------------------------------------------------------------                             
        when WAIT_FOR_NOT_BUSY   =>
          pioRd     <= YES;
          pioAddr   <= STATUS_REG;
          state_x   <= WAIT_FOR_NOT_BUSY_1;
          status_x  <= "0001000";
        when WAIT_FOR_NOT_BUSY_1 =>
          if(pioDOut(STATUS_REG_BSY) = YES) then
            state_x <= WAIT_FOR_NOT_BUSY;  -- busy bit not clear so check it again
          else
            state_x <= rtnState_r;      -- pop the state registers
          end if;
          status_x  <= "0001010";

          -----------------------------------------------------------------
          -- wait for a read or write sector command
          -----------------------------------------------------------------                             
        when WAIT_FOR_CMD =>
          if(rd = YES) then
                                        -- read a sector of the disk
            wordCnt_x  <= SECTOR_SIZE-1;  -- set number of words to read from sector
            cmd_x      <= READ_SECTOR_CMD;  -- command for rading a sector
            state_x    <= SETUP_DRIVE;  -- setup the disk registers for reading the sector
            rtnState_x <= READ_WORDS;
          elsif(wr = YES) then
                                        -- write a sector of the disk
            wordCnt_x  <= SECTOR_SIZE-1;  -- set number of words to write to sector
            cmd_x      <= WRITE_SECTOR_CMD;  -- command for writing a sector
            state_x    <= SETUP_DRIVE;  -- setup the disk registers for writing the sector
            rtnState_x <= WRITE_WORDS;
          else
                                        -- no operation requested
            state_x    <= WAIT_FOR_CMD;  -- keep waiting for a R/W command
          end if;
          status_x     <= "0001100";

          -----------------------------------------------------------------
          -- setup the disk to read or write a sector
          -----------------------------------------------------------------                             
        when SETUP_DRIVE   =>
          -- load the sector count register with the number of sectors to be read/written
          pioWr               <= YES;
          pioAddr             <= SECTOR_CNT_REG;
          pioDIn              <= CONV_STD_LOGIC_VECTOR(SECTORS_PER_RW, pioDIn'length);
          state_x             <= SETUP_DRIVE_1;
          status_x            <= "0001110";
        when SETUP_DRIVE_1 =>
          -- load the number of the sector that will be read/written
          pioWr               <= YES;
          pioAddr             <= SECTOR_REG;
          pioDIn(7 downto 0)  <= sector;
          state_x             <= SETUP_DRIVE_2;
          status_x            <= "0010000";
        when SETUP_DRIVE_2 =>
          -- load the number of the cylinder that contains the desired sector
          pioWr               <= YES;
          pioAddr             <= CYL_LOW_REG;
          pioDIn(7 downto 0)  <= cylinder(7 downto 0);
          state_x             <= SETUP_DRIVE_3;
          status_x            <= "0010010";
        when SETUP_DRIVE_3 =>
          pioWr               <= YES;
          pioAddr             <= CYL_HIGH_REG;
          pioDIn(7 downto 0)  <= cylinder(15 downto 8);
          state_x             <= SETUP_DRIVE_4;
          status_x            <= "0010100";
        when SETUP_DRIVE_4 =>
          -- load the number of the head that accesses the desired cylinder
          pioWr               <= YES;
          pioAddr             <= DRIVE_HEAD_REG;
          pioDIn(7 downto 0)  <= "1010" & head;
          state_x             <= SETUP_DRIVE_5;
          status_x            <= "0010110";
        when SETUP_DRIVE_5 =>
          -- load the command (read sector or write sector)
          pioWr               <= YES;
          pioAddr             <= CMD_REG;
          pioDIn(cmd_r'range) <= cmd_r;
          state_x             <= rtnState_r;
          status_x            <= "0011000";

          -----------------------------------------------------------------
          -- write data to the disk sector
          -----------------------------------------------------------------                             
        when WRITE_WORDS   =>
          state_x                <= WAIT_FOR_NOT_BUSY;
          rtnState_x             <= WRITE_WORDS_1;
          status_x               <= "0011000";
        when WRITE_WORDS_1 =>
          -- check the data request bit to see if the sector is ready for read/write ops
          if(pioDOut(STATUS_REG_DRQ) = YES) then
            state_x              <= WRITE_WORDS_2;  -- if ready, then write sector state
          elsif(pioDOut(STATUS_REG_ERR) = YES) then
            status_x(ERROR_FLAG) <= YES;  -- tell the host there was an error
            state_x              <= error;
          else
                                        -- data not ready, so read status again
            pioRd                <= YES;
            pioAddr              <= STATUS_REG;
            state_x              <= WRITE_WORDS_1;
          end if;
          status_x               <= "0011010";
        when WRITE_WORDS_2 =>
          -- write another word to the disk each time the write control is high
          if(wr = YES) then
            pioWr                <= YES;
            pioAddr              <= DATA_REG;
            pioDIn               <= hDIn;
            state_x              <= WRITE_WORDS_3;
          else
            state_x              <= WRITE_WORDS_2;  -- halt writes to disk when wr is inactive
          end if;
          status_x               <= "0011100";
        when WRITE_WORDS_3 =>
          done                   <= YES;  -- tell the host this word has been written to disk
          if(wordCnt_r = 0) then
            -- this sector is done, so write the next sector
            state_x              <= WRITE_WORDS_4;
          else
            -- otherwise, write the next word to this sector
            wordCnt_x            <= wordCnt_r - 1;
            state_x              <= WRITE_WORDS_2;
          end if;
          status_x               <= "0011110";
        when WRITE_WORDS_4 =>
          -- wait for the interrupt from the disk that indicates the write of the
          -- current sector is done.
          if(pioIntrq = YES) then
                                        -- the interrupt has arrived, so see if there are more sectors to write
            pioRd                <= YES;
            pioAddr              <= STATUS_REG;
            state_x              <= WRITE_WORDS_5;
          else
                                        -- keep waiting for the interrupt
            state_x              <= WRITE_WORDS_4;
          end if;
          status_x               <= "0100000";
        when WRITE_WORDS_5 =>
          if(pioDOut(STATUS_REG_DRQ) = YES) then
                                        -- if the disk is still busy, then there are more sectors to write
            wordCnt_x            <= SECTOR_SIZE-1;  -- set number of words to write to the next sector
            state_x              <= WRITE_WORDS_2;
          else
                                        -- there are no more sectors to write, so go wait for another command
            state_x              <= WAIT_FOR_CMD;
          end if;
          status_x               <= "0100010";

          -----------------------------------------------------------------
          -- read data from the disk sector
          -----------------------------------------------------------------                             
        when READ_WORDS   =>
          if(pioIntrq = YES) then
            pioRd     <= YES;
            pioAddr   <= STATUS_REG;
            state_x   <= READ_WORDS_1;
          else
            state_x   <= READ_WORDS;
          end if;
          status_x    <= "0100100";
        when READ_WORDS_1 =>
          -- read another word from the disk each time the read control is high
          if(rd = YES) then
            pioRd     <= YES;
            pioAddr   <= DATA_REG;
            state_x   <= READ_WORDS_2;
          else
            state_x   <= READ_WORDS_1;  -- halt reads from disk when rd is inactive
          end if;
          status_x    <= "0100110";
        when READ_WORDS_2 =>
          done        <= YES;           -- tell the host a word has been read and is available
          if(wordCnt_r = 0) then
                                        -- this sector is done, so read the next sector
            pioRd     <= YES;
            pioAddr   <= STATUS_REG;
            state_x   <= READ_WORDS_3;
          else
                                        -- otherwise, read the next word from this sector
            wordCnt_x <= wordCnt_r - 1;
            state_x   <= READ_WORDS_1;
          end if;
          status_x    <= "0101000";
        when READ_WORDS_3 =>
          if(pioDOut(STATUS_REG_BSY) = YES) then
                                        -- there are more sectors still to read
            wordCnt_x <= SECTOR_SIZE-1;  -- set number of words to read from the next sector
            state_x   <= READ_WORDS;
          else
                                        -- there are no more sectors to read, so go wait for another command
            state_x   <= WAIT_FOR_CMD;
          end if;
          status_x    <= "0101010";


          -----------------------------------------------------------------
          -- error state.  Requires a reset to leave this state
          -----------------------------------------------------------------                             
        when error =>
          state_x              <= error;
          status_x(ERROR_FLAG) <= YES;

          -----------------------------------------------------------------
          -- unknown state.  Go to the error state
          -----------------------------------------------------------------                             
        when others =>
          state_x              <= error;
          status_x(ERROR_FLAG) <= YES;

      end case;
    end if;
  end process combinatorial;


  -----------------------------------------------------------
  -- update registers on the appropriate clock edge     
  -----------------------------------------------------------

  update : process(rst, clk)
  begin

    if rst = YES then
      -- asynchronous reset
      state_r    <= RESET_DRIVE;        -- upon reset, reset the drive
      rtnState_r <= WAIT_FOR_CMD;       -- and then wait for read/write commands
      cmd_r      <= (others => '0');
      wordCnt_r  <= 0;
      status_r   <= (others => '0');    -- clear the status register
    elsif rising_edge(clk) then
      if(abort = YES) then
        -- abort a read or write sector command and go back to wait for another command
        state_r  <= ABORT_1;
      else
        state_r  <= state_x;
      end if;
      rtnState_r <= rtnState_x;
      cmd_r      <= cmd_x;
      wordCnt_r  <= wordCnt_x;
      status_r   <= status_x;
    end if;

  end process update;

end arch;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人精品视频一区二区三区| 久久久久久久网| 久久综合色鬼综合色| 国产精品国模大尺度视频| 日韩中文字幕av电影| 不卡的av中国片| 久久久久久免费| 蜜臀av性久久久久蜜臀aⅴ四虎| 99精品视频中文字幕| 亚洲人快播电影网| 国产米奇在线777精品观看| 欧美色图12p| 亚洲精品成人精品456| 成人动漫av在线| 国产欧美精品在线观看| 国产精品一区二区在线播放| 日韩视频免费直播| 水蜜桃久久夜色精品一区的特点| 91免费在线视频观看| 国产精品美日韩| 国产成人精品免费在线| 26uuu精品一区二区| 麻豆91免费观看| 欧美一级生活片| 日韩一区欧美二区| 538prom精品视频线放| 五月婷婷久久丁香| 3d动漫精品啪啪| 日本亚洲电影天堂| 91精品国产色综合久久| 麻豆免费精品视频| 日韩色在线观看| 狠狠久久亚洲欧美| 久久人人爽爽爽人久久久| 国产成人精品网址| 亚洲青青青在线视频| 日本高清视频一区二区| 亚洲一级二级在线| 91精品国产综合久久蜜臀 | 色婷婷av一区二区三区大白胸| 国产精品美女久久久久久久久久久 | 91精品国产91久久久久久最新毛片| 亚洲一二三区不卡| 日韩欧美一区在线| 国内精品久久久久影院薰衣草| 久久久影院官网| 成人午夜激情在线| 一区二区三区蜜桃网| 欧美久久高跟鞋激| 国产一区二区三区av电影| 中文av字幕一区| 欧美在线制服丝袜| 精品影视av免费| 1024成人网| 91精品国产综合久久久久久漫画| 精品一区二区三区在线播放视频| 亚洲精品一区二区精华| 成人一级视频在线观看| 亚洲男同性恋视频| 精品久久久久久久久久久久久久久久久| 国产一区二区三区在线观看免费视频 | 成人av在线观| 亚洲va天堂va国产va久| 久久先锋影音av鲁色资源| 91香蕉视频mp4| 久久国内精品自在自线400部| 国产精品久久久久久久久久久免费看 | 亚洲欧美自拍偷拍色图| 69久久99精品久久久久婷婷 | 欧美国产视频在线| 欧美精品v日韩精品v韩国精品v| 国产乱子伦一区二区三区国色天香| 国产精品成人网| 日韩精品中文字幕在线一区| av在线不卡电影| 蜜桃视频一区二区三区在线观看 | 国产女人18水真多18精品一级做| 国产区在线观看成人精品| 欧美伊人精品成人久久综合97| 激情文学综合丁香| 天堂精品中文字幕在线| 亚洲三级小视频| 久久综合999| 在线综合亚洲欧美在线视频| 波多野结衣一区二区三区| 国内精品在线播放| 亚洲成人免费视| 亚洲精选视频免费看| 中文字幕久久午夜不卡| 精品国产第一区二区三区观看体验 | www.在线成人| 国产一级精品在线| 蜜臀久久99精品久久久久久9| 亚洲宅男天堂在线观看无病毒| 国产视频一区二区三区在线观看| 51精品国自产在线| 欧美日韩一区二区三区高清| 91在线一区二区三区| 国产成人自拍在线| 狠狠狠色丁香婷婷综合激情| 青青草国产精品97视觉盛宴| 亚洲在线视频网站| 一片黄亚洲嫩模| 专区另类欧美日韩| 中文字幕一区二区视频| 国产精品国产精品国产专区不片| 久久日韩精品一区二区五区| 欧美一级搡bbbb搡bbbb| 91精品免费观看| 欧美一区二区三区啪啪| 91精品综合久久久久久| 欧美日韩国产一级片| 91.xcao| 欧美一级一区二区| 精品欧美黑人一区二区三区| 欧美成人一区二区三区片免费| 日韩亚洲电影在线| 精品国产乱码久久| 久久久久久久久久电影| 欧美国产激情一区二区三区蜜月| 国产欧美精品区一区二区三区 | 国产亚洲精品bt天堂精选| 久久久精品tv| 亚洲欧洲精品一区二区三区不卡| 国产精品美女久久久久aⅴ国产馆| 久久综合成人精品亚洲另类欧美 | 亚洲视频一区在线观看| 一区二区三区不卡视频| 亚洲午夜久久久久中文字幕久| 首页国产欧美日韩丝袜| 国产在线视频精品一区| 国产精品99久久不卡二区| 成人av网址在线观看| 色噜噜狠狠色综合中国| 欧美日韩一区二区不卡| 精品奇米国产一区二区三区| 国产精品区一区二区三区| 亚洲妇女屁股眼交7| 美美哒免费高清在线观看视频一区二区 | 国产精品久久久久7777按摩| 亚洲成人午夜电影| 老司机精品视频线观看86| 成人一区二区三区在线观看| 欧美日韩精品一区视频| 久久九九影视网| 一区二区久久久久久| 国内外成人在线视频| 99精品一区二区| 日韩免费高清av| 亚洲人成网站色在线观看| 成人天堂资源www在线| 67194成人在线观看| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲日本韩国一区| 国产一区二区福利视频| 欧美亚洲动漫精品| 日本一区二区三区免费乱视频| 亚洲国产精品精华液网站| 丰满亚洲少妇av| 777欧美精品| 亚洲欧美一区二区三区孕妇| 狠狠久久亚洲欧美| 欧美日韩三级一区| 亚洲欧美怡红院| 国产伦精品一区二区三区免费迷| 欧美群妇大交群的观看方式| 日韩伦理免费电影| 精品无码三级在线观看视频| 欧美日韩一区二区在线观看视频| 国产精品热久久久久夜色精品三区 | 91在线丨porny丨国产| 精品三级av在线| 日本欧美在线看| 欧美日本视频在线| 亚洲麻豆国产自偷在线| 国产成人av影院| 久久久久久免费| 精品一区二区av| 日韩午夜在线影院| 亚洲成人一二三| 国产偷国产偷亚洲高清人白洁| 轻轻草成人在线| 91精品一区二区三区久久久久久 | 精品国产一区二区精华| 日产国产高清一区二区三区| 在线观看三级视频欧美| 1000部国产精品成人观看| 成人h版在线观看| 中文字幕精品—区二区四季| 粉嫩蜜臀av国产精品网站| 亚洲精品一区二区三区在线观看| 亚洲成人资源网| 欧美色精品在线视频| 亚洲福利一二三区| 在线电影国产精品| 日本一不卡视频| 日韩午夜电影av| 美女视频一区二区三区| 日韩欧美亚洲国产精品字幕久久久| 奇米综合一区二区三区精品视频|