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

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

?? atacntl.vhd

?? Access IDE harddisk by Xilinx FPGA Support PIO2
?? 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一区二区三区免费野_久草精品视频
日本一区二区三区久久久久久久久不 | 久久成人久久鬼色| 色噜噜久久综合| 亚洲美女精品一区| 91久久精品国产91性色tv | 久久久久久久av麻豆果冻| 青青草成人在线观看| 精品国精品自拍自在线| 久久99国内精品| 久久久久国色av免费看影院| 天天综合网 天天综合色| 久久成人精品无人区| 日韩一卡二卡三卡| 午夜精品福利一区二区蜜股av| 色一情一乱一乱一91av| 亚洲欧美综合另类在线卡通| 成人aa视频在线观看| 国产精品成人在线观看| 成人做爰69片免费看网站| 国产精品欧美一级免费| 99久久久国产精品| 亚洲一区二区在线播放相泽| 91黄色激情网站| 洋洋成人永久网站入口| 欧美疯狂做受xxxx富婆| 国产一区二区三区香蕉| 日本一区二区三区免费乱视频| av电影一区二区| 午夜精品成人在线视频| 日韩欧美国产1| 成人免费观看视频| 亚洲图片有声小说| 欧美一区2区视频在线观看| 国产精品一区免费视频| 亚洲精品中文在线观看| 精品播放一区二区| 色94色欧美sute亚洲线路一ni| 日本亚洲天堂网| 国产精品黄色在线观看| 在线电影国产精品| 成人黄色一级视频| 亚洲成人免费在线观看| 久久久久久久一区| 欧美肥妇bbw| 国产一区视频在线看| 亚洲最新在线观看| 亚洲精品伦理在线| 国产精品短视频| 欧美日韩色一区| 97se狠狠狠综合亚洲狠狠| 国产精品 日产精品 欧美精品| 亚洲欧美一区二区三区孕妇| 久久影院视频免费| ww久久中文字幕| 欧美变态tickle挠乳网站| 欧美探花视频资源| 日本福利一区二区| 欧洲av在线精品| 色综合天天综合狠狠| 99精品偷自拍| av午夜一区麻豆| 成人av电影在线| 99re热这里只有精品视频| 精品午夜久久福利影院| 天堂蜜桃一区二区三区| 亚洲国产毛片aaaaa无费看 | 精品日韩欧美一区二区| 欧美大片拔萝卜| 久久久99精品久久| 欧美国产日韩精品免费观看| 亚洲国产精品黑人久久久| 久久av老司机精品网站导航| 麻豆成人av在线| 丁香桃色午夜亚洲一区二区三区| 波多野结衣精品在线| 欧美日韩国产一二三| 精品国产乱码久久久久久闺蜜| 欧美亚洲国产一卡| 欧美精品亚洲一区二区在线播放| 一本大道久久精品懂色aⅴ| 欧美精三区欧美精三区| 中文字幕av一区二区三区免费看 | 欧美日韩日本视频| 欧美电影精品一区二区| 亚洲乱码国产乱码精品精可以看| 天堂va蜜桃一区二区三区漫画版| 麻豆精品在线视频| 麻豆高清免费国产一区| 精品一区二区成人精品| 欧美三级资源在线| 国产网红主播福利一区二区| 亚洲成人7777| 91麻豆.com| 精品捆绑美女sm三区| 一级女性全黄久久生活片免费| 精品无人区卡一卡二卡三乱码免费卡 | 色美美综合视频| 久久亚区不卡日本| 免费成人在线播放| av在线播放成人| 国产精品情趣视频| 国产成人av影院| 国产女人18水真多18精品一级做| 老司机午夜精品99久久| 欧美哺乳videos| 国产一区在线精品| 国产精品视频线看| 成人三级在线视频| 国产精品美女久久久久久久久| 国产在线观看免费一区| 欧美精品一二三区| 青草av.久久免费一区| 日韩午夜中文字幕| 久久精品免费看| 中文子幕无线码一区tr| 成人免费看片app下载| 亚洲青青青在线视频| 国内精品视频666| 亚洲欧美电影一区二区| 欧美日韩免费在线视频| 日韩av网站在线观看| 国产婷婷色一区二区三区| 波多野结衣欧美| 香蕉av福利精品导航| 欧美在线不卡一区| 亚洲成av人片在线观看| 精品成a人在线观看| 成人丝袜18视频在线观看| 亚洲在线中文字幕| 久久久久久久久伊人| 丰满放荡岳乱妇91ww| 日韩美女视频一区二区| 日韩欧美一级二级三级久久久| 黑人精品欧美一区二区蜜桃 | 久久99久久99小草精品免视看| 久久久精品综合| 26uuu精品一区二区| 91精品国产综合久久久久| 日本韩国精品在线| 国产mv日韩mv欧美| 粉嫩嫩av羞羞动漫久久久| 看电视剧不卡顿的网站| 天天做天天摸天天爽国产一区| 亚洲综合在线视频| 一区二区在线观看免费视频播放| 中文av字幕一区| 国产日产欧美一区二区三区| 欧美一级一级性生活免费录像| 成人av免费在线观看| 95精品视频在线| 欧美色综合影院| 这里只有精品电影| 久久你懂得1024| 中文字幕一区二区三区在线观看| 最近日韩中文字幕| 亚洲成人av电影在线| 蜜臀99久久精品久久久久久软件| 日本亚洲最大的色成网站www| 蜜臀久久久久久久| 五月天中文字幕一区二区| 另类小说欧美激情| 91丝袜美女网| 7777精品伊人久久久大香线蕉的| 欧美日韩综合在线免费观看| 欧美精品自拍偷拍动漫精品| 精品久久久久久最新网址| 国产精品久久久久久久久搜平片| 亚洲国产成人一区二区三区| 亚洲精品一二三| 久久国内精品视频| 一本久久综合亚洲鲁鲁五月天| 欧美电影免费观看完整版| 国产精品三级av在线播放| 性感美女极品91精品| 国产99精品在线观看| 日韩丝袜情趣美女图片| 亚洲精品中文在线| 99国产精品久| 久久欧美一区二区| 美女国产一区二区三区| 欧美午夜精品久久久久久孕妇 | 日韩欧美国产三级| 亚洲一区二区在线播放相泽| 国产成人精品免费在线| 亚洲精品一区二区在线观看| 亚洲欧美欧美一区二区三区| 狠狠色丁香九九婷婷综合五月| 欧美在线不卡一区| 亚洲精品五月天| 波多野结衣中文字幕一区 | 欧美精品久久一区| 最新成人av在线| 国产成人99久久亚洲综合精品| 日韩一区二区免费视频| 亚洲成人福利片| 欧美疯狂性受xxxxx喷水图片| 丝袜诱惑制服诱惑色一区在线观看| 色婷婷激情一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 91网站在线播放|