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

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

?? atacntl.vhd

?? xilinx fpga 下的IDE控制器原代碼,貢獻一起學習
?? VHD
?? 第 1 頁 / 共 3 頁
字號:
library IEEE, UNISIM;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.numeric_std.all;
use WORK.common.all;


package ata is

  component pioIntfc
    generic(
      FREQ     :     natural := 50_000  -- operating frequency in KHz
      );
    port(
      -- host side
      clk      : in  std_logic;         -- master clock
      pioRst   : in  std_logic;         -- async. reset
      pioRd    : in  std_logic;         -- initiate read operation
      pioWr    : in  std_logic;         -- initiate write operation
      pioAddr  : in  std_logic_vector(4 downto 0);  -- disk register address from host
      pioDIn   : in  std_logic_vector(15 downto 0);  -- data from host to disk
      pioDOut  : out std_logic_vector(15 downto 0);  -- data from disk to host
      pioBusy  : out std_logic;         -- read or write operation is in progress
      pioIntrq : out std_logic;         -- debounced interrupt from disk
      status   : out std_logic_vector(3 downto 0);  -- diagnostic status for the R/W

      -- disk side
      dior_n    : out std_logic;        -- disk register read-enable
      diow_n    : out std_logic;        -- disk register write-enable
      cs0_n     : out std_logic;        -- disk command block register select
      cs1_n     : out std_logic;        -- disk control block register select
      da        : out std_logic_vector(2 downto 0);  -- disk register address
      ddIn      : in  std_logic_vector(15 downto 0);  -- data from disk
      ddOut     : out std_logic_vector(15 downto 0);  -- data to disk
      ddOutEnbl : out std_logic;        -- enable data outputs to disk
      intrq     : in  std_logic;        -- interrupt from disk
      dmack_n   : out std_logic         -- DMA acknowledge
      );
  end component;

  component ataCntl
    generic(
      FREQ           :     natural := 50_000;  -- operating frequency in KHz
      SECTORS_PER_RW :     natural := 1  -- number of sectors to read/write
      );
    port(
      -- host side
      clk            : in  std_logic;   -- master clock
      rst            : in  std_logic;   -- reset
      rd             : in  std_logic;   -- initiate read operation
      wr             : in  std_logic;   -- initiate write operation
      abort          : in  std_logic;   -- aborts read/write sector operation
      head           : in  std_logic_vector(3 downto 0);  -- disk head for data access
      cylinder       : in  std_logic_vector(15 downto 0);  -- cylinder for data access
      sector         : in  std_logic_vector(7 downto 0);  -- sector for data access
      hDIn           : in  std_logic_vector(15 downto 0);  -- data from host       to disk
      hDOut          : out std_logic_vector(15 downto 0);  -- data from disk to host
      done           : out std_logic;   -- read or write operation is done
      status         : out std_logic_vector(6 downto 0);  -- diagnostic status            

      -- disk side
      dior_n    : out std_logic;        -- disk register read-enable
      diow_n    : out std_logic;        -- disk register write-enable
      cs0_n     : out std_logic;        -- disk command block register select
      cs1_n     : out std_logic;        -- disk control block register select
      da        : out std_logic_vector(2 downto 0);  -- register address
      ddIn      : in  std_logic_vector(15 downto 0);  -- data from disk
      ddOut     : out std_logic_vector(15 downto 0);  -- data to disk
      ddOutEnbl : out std_logic;        -- enable data outputs to disk
      intrq     : in  std_logic;        -- interrupt from disk
      dmack_n   : out std_logic         -- DMA acknowledge
      );
  end component;

end package ata;




library IEEE, UNISIM;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.numeric_std.all;
use WORK.common.all;

--------------------------------------------------------------------
-- Company : XESS Corp.
-- Engineer : Dave Vanden Bout
-- Creation Date : 04/14/2004
-- Copyright : 2004-2006, XESS Corp
-- Tool Versions : WebPACK 6.3.03i
--
-- Description:
-- This module executes a timed read/write operation to one of the disk registers.
--
-- For a read operation, the host supplies a register address and pulls the read
-- control line high. The read operation begins on the next rising clock edge
-- and the busy signal goes high. The host gets the data from the disk register
-- once the busy signal goes low again.
--
-- For a write operation, the host supplies a register address and the data to
-- be stored there and pulls the write control line high. The write operation
-- begins on the nxt rising clock edge an the busy signal goes high. The register
-- contains the new data once the busy signal goes low again.
--
-- The 5-bit register address from the host contains the 3-bit disk register address
-- along with the control and command block register select bits in the most
-- significant bit positions.
--
-- Revision:
-- 1.0.1
--
-- Additional Comments:
-- 1.0.1:
-- Added PIO Mode 2 timing parameters.
-- 1.0.0:
-- Initial release.
--
-- License:
-- This code can be freely distributed and modified as long as
-- this header is not removed.
--------------------------------------------------------------------

entity pioIntfc is
  generic(
    FREQ     :     natural := 50_000    -- operating frequency in KHz
    );
  port(
    -- host side
    clk      : in  std_logic;           -- master clock
    pioRst   : in  std_logic;           -- async. reset
    pioRd    : in  std_logic;           -- initiate read operation
    pioWr    : in  std_logic;           -- initiate write operation
    pioAddr  : in  std_logic_vector(4 downto 0);  -- disk register address from host
    pioDIn   : in  std_logic_vector(15 downto 0);  -- data from host       to disk
    pioDOut  : out std_logic_vector(15 downto 0);  -- data from disk to host
    pioBusy  : out std_logic;           -- read or write operation is in progress
    pioIntrq : out std_logic;           -- debounced interrupt from disk
    status   : out std_logic_vector(3 downto 0);  -- diagnostic status for the R/W

    -- disk side
    dior_n    : out std_logic;          -- disk register read-enable
    diow_n    : out std_logic;          -- disk register write-enable
    cs0_n     : out std_logic;          -- disk command block register select
    cs1_n     : out std_logic;          -- disk control block register select
    da        : out std_logic_vector(2 downto 0);  -- disk register address
    ddIn      : in  std_logic_vector(15 downto 0);  -- data from disk
    ddOut     : out std_logic_vector(15 downto 0);  -- data to disk
    ddOutEnbl : out std_logic;          -- enable data outputs to disk
    intrq     : in  std_logic;          -- interrupt from disk
    dmack_n   : out std_logic           -- DMA acknowledge
    );
end pioIntfc;


architecture arch of pioIntfc is
  -- PIO mode 0 timing parameters in ns
  constant Top    : natural := 600;     -- minimum cycle time between R/W operations
  constant Tsetup : natural := 70;      -- address/data setup before R/W pulse
  constant Tpulse : natural := 290;     -- R/W pulse width
  -- PIO mode 2 timing parameters in ns
--  constant Top    : natural := 240;   -- minimum cycle time between R/W operations
--  constant Tsetup : natural := 30;    -- address/data setup before R/W pulse
--  constant Tpulse : natural := 100;   -- R/W pulse width

  constant Thold : natural := Top-Tsetup-Tpulse;  -- address/data hold after R/W pulse

  -- PIO mode timing parameters converted into clock cycles (based on FREQ)
  constant NORM         : natural := 1_000_000;  -- normalize ns * KHz
  constant OP_CYCLES    : natural := 1+((Top*FREQ)/NORM);
  constant SETUP_CYCLES : natural := 1+((Tsetup*FREQ)/NORM);
  constant PULSE_CYCLES : natural := 1+((Tpulse*FREQ)/NORM);
  constant HOLD_CYCLES  : natural := 1+((Thold*FREQ)/NORM);

  -- timer register that counts down times for the phases of the disk R/W operation
  signal timer_r, timer_x : natural range OP_CYCLES downto 0;

  -- PIO mode timing parameters converted into unsigned clock cycles for clarity
--  constant OP_CYCLES    : unsigned := TO_UNSIGNED(OP_CYCLES_N, timer_r'length);
--  constant SETUP_CYCLES : unsigned := TO_UNSIGNED(SETUP_CYCLES_N, timer_r'length);
--  constant PULSE_CYCLES : unsigned := TO_UNSIGNED(PULSE_CYCLES_N, timer_r'length);
--  constant HOLD_CYCLES  : unsigned := TO_UNSIGNED(HOLD_CYCLES_N, timer_r'length);

  -- states of the PIO interface state machine
  type cntlState is (
    RW_SETUP,                           -- setup address/data before read pulse
    RD_PULSE,                           -- read pulse active
    RD_HOLD,                            -- hold address/data after read pulse
    WR_PULSE,                           -- write pulse active
    WR_HOLD                             -- hold address/data after write pulse
    );
  signal state_r, state_x : cntlState;  -- state register and next state

  -- PIO interface registers
  signal pioBusy_r, pioBusy_x     : std_logic;  -- R/W in-progress register
  signal dior_r, dior_x           : std_logic;  -- disk read signal register
  signal diow_r, diow_x           : std_logic;  -- disk write signal register
  signal da_r, da_x               : std_logic_vector(pioAddr'range);  -- disk register address register
  signal ddOut_r, ddOut_x         : std_logic_vector(ddOut'range);  -- data output to disk register
  signal ddOutEnbl_r, ddOutEnbl_x : std_logic;  -- enable data output to disk register
  signal ddIn_r, ddIn_x           : std_logic_vector(ddIn'range);  -- data input from disk register

  -- reports the status of the PIO interface
  signal status_r, status_x : std_logic_vector(3 downto 0);

  -- debounce counter for the interrupt request input
  signal   intrqCnt_r, intrqCnt_x : unsigned(3 downto 0);
  constant DEBOUNCE_CNT           : natural := 10;
  signal   pioIntrq_r, pioIntrq_x : std_logic;
  signal   intrq_r, intrq_x       : std_logic;

begin

  -----------------------------------------------------------
  -- attach some internal signals to the host and disk ports 
  -----------------------------------------------------------

  dior_n    <= dior_r;
  diow_n    <= diow_r;
  da        <= da_r(da'range);
  cs0_n     <= da_r(3);
  cs1_n     <= da_r(4);
  ddOut     <= ddOut_r;
  ddOutEnbl <= ddOutEnbl_r;
  pioDOut   <= ddIn_r;                  -- output data to host is the input data from the disk
  pioBusy   <= pioBusy_r;
  pioIntrq  <= pioIntrq_r;
  status    <= status_r;
  dmack_n   <= HI;                      -- never acknowledge DMA requests from disk

  -----------------------------------------------------------
  -- debounce the interrupt signal from the disk 
  -----------------------------------------------------------
  debounce : process(intrq, intrqCnt_r, intrq_r, pioIntrq_r)
  begin

    intrq_x    <= intrq;
    pioIntrq_x <= pioIntrq_r;

    if(intrq = intrq_r) then
      if(intrqCnt_r = DEBOUNCE_CNT) then
        intrqCnt_x <= (others => '0');
        pioIntrq_x <= intrq_r;
      else
        intrqCnt_x <= intrqCnt_r + 1;
      end if;
    else
      intrqCnt_x   <= (others => '0');
    end if;

  end process debounce;

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

  combinatorial : process(pioRd, pioWr, pioAddr, pioDIn, state_r, timer_r, dior_r, pioBusy_r,
                          diow_r, da_r, ddOut_r, ddOutEnbl_r, ddIn_r, ddIn, status_r)
  begin

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

    state_x     <= state_r;
    dior_x      <= dior_r;
    diow_x      <= diow_r;
    da_x        <= da_r;
    ddOut_x     <= ddOut_r;
    ddOutEnbl_x <= ddOutEnbl_r;
    ddIn_x      <= ddIn_r;
    pioBusy_x   <= pioBusy_r;
    status_x    <= status_r;

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

    -- main timer for sequencing the phases of the R/W waveforms                
    if timer_r /= 0 then
      -- decrement the timer and do nothing else since the previous 
      -- phase has not completed yet.
      timer_x <= timer_r - 1;
    else
      -- the previous phase has completed once the timer hits zero.
      -- By default, leave the timer at zero.  A R/W op will set it
      -- to non-zero below.
      timer_x <= timer_r;

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

        -----------------------------------------------------------
        -- wait for a disk read or write operation 
        -----------------------------------------------------------
        when RW_SETUP =>
          dior_x        <= HI;          -- don't read or write the disk until requested
          diow_x        <= HI;
          ddOutEnbl_x   <= NO;          -- don't drive disk data bus until requested
          if(pioRd = YES) then
                                        -- a read operation is requested
            pioBusy_x   <= YES;         -- set busy bit
            da_x        <= pioAddr;     -- output disk register address
            timer_x     <= SETUP_CYCLES;  -- set timer for address setup
            state_x     <= RD_PULSE;    -- next state after address setup completes

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品沙发午睡系列990531| 欧美一二三区在线观看| 国产精品888| 精品影院一区二区久久久| 蜜臀av一区二区在线观看| 午夜不卡在线视频| 蜜臀av性久久久久蜜臀aⅴ| 麻豆免费精品视频| 国产美女在线精品| av电影天堂一区二区在线观看| 成人av在线观| 欧美图片一区二区三区| 欧美一区二区高清| 国产日韩欧美一区二区三区综合| 中文字幕乱码日本亚洲一区二区| 国产精品福利一区| 亚洲国产精品麻豆| 国产中文字幕精品| 成人av网在线| 欧美日韩成人综合天天影院| 欧美mv和日韩mv国产网站| 国产日韩欧美一区二区三区乱码 | 欧美乱妇一区二区三区不卡视频| 日韩欧美久久久| 日本一二三不卡| 天堂在线亚洲视频| 风间由美一区二区av101| 欧美色图第一页| 国产视频一区在线观看| 亚洲一区中文在线| 国产高清精品久久久久| 欧美在线|欧美| 国产日韩欧美a| 丝袜亚洲精品中文字幕一区| 国产成人av一区二区三区在线 | 国产日韩在线不卡| 亚洲成人tv网| 成人不卡免费av| 日韩欧美精品在线| 亚洲国产美女搞黄色| 国产在线播放一区三区四| 欧洲亚洲国产日韩| 国产精品视频九色porn| 美女一区二区三区在线观看| 91久久线看在观草草青青| 欧美精品一区二区久久久| 亚洲国产精品久久人人爱| 成人三级在线视频| 精品1区2区在线观看| 亚洲超碰97人人做人人爱| 91网上在线视频| 国产视频一区在线播放| 精品一区二区三区在线观看国产| 在线观看av不卡| 中文字幕在线观看不卡视频| 国产乱人伦偷精品视频免下载| 欧美丰满高潮xxxx喷水动漫| 亚洲一区免费观看| 91麻豆自制传媒国产之光| 日本一区二区三区国色天香| 看国产成人h片视频| 91精品国产乱| 日本女优在线视频一区二区| 欧洲另类一二三四区| 亚洲少妇30p| av在线不卡免费看| 亚洲欧洲一区二区三区| 成人av电影在线| 中文字幕在线不卡| 99国产麻豆精品| 国产精品高清亚洲| 91蜜桃在线免费视频| 国产精品国产精品国产专区不蜜| 国产成人在线视频网址| 国产亚洲一区二区在线观看| 国产原创一区二区三区| 久久免费精品国产久精品久久久久| 日本sm残虐另类| 日韩欧美区一区二| 国产酒店精品激情| 中文字幕不卡一区| 色综合久久综合网| 亚洲成年人影院| 欧美一区二区三区影视| 久久99精品久久久久久| 国产三级精品视频| 91视频一区二区| 香蕉久久夜色精品国产使用方法 | 自拍偷拍欧美精品| 色欧美片视频在线观看| 亚洲一二三级电影| 日韩视频一区二区在线观看| 国产乱子轮精品视频| 国产精品久久综合| 欧美日韩国产一二三| 久久国产欧美日韩精品| 亚洲国产精品二十页| 91福利国产精品| 看电影不卡的网站| 亚洲视频一二三| 91精品国产品国语在线不卡| 国产盗摄精品一区二区三区在线| 日韩理论片中文av| 欧美一区二区成人6969| 处破女av一区二区| 天堂蜜桃91精品| 中文字幕中文字幕一区二区| 制服丝袜在线91| 99精品在线免费| 久久av中文字幕片| 亚洲精品五月天| 久久久无码精品亚洲日韩按摩| 91麻豆文化传媒在线观看| 男女激情视频一区| 一区二区三区在线观看视频| 精品久久人人做人人爽| 色猫猫国产区一区二在线视频| 美女高潮久久久| 一区二区三区不卡在线观看| 久久这里只有精品6| 欧美乱熟臀69xxxxxx| 成人黄色软件下载| 精品一区二区三区不卡| 午夜视频在线观看一区二区三区 | 91免费视频网址| 国产毛片精品一区| 五月婷婷综合在线| 亚洲人精品一区| 国产精品丝袜久久久久久app| 日韩视频一区二区| 欧美人动与zoxxxx乱| 91麻豆国产福利在线观看| 国产一区二区伦理片| 久久成人免费日本黄色| 香蕉久久夜色精品国产使用方法 | 日韩视频一区二区三区 | 蜜桃视频免费观看一区| 亚洲一区二区三区视频在线播放| 欧美国产综合一区二区| 国产日韩成人精品| 久久亚洲一区二区三区四区| 日韩精品一区国产麻豆| 欧美一级二级三级蜜桃| 欧美一级专区免费大片| 在线播放视频一区| 9191久久久久久久久久久| 欧美伊人久久久久久久久影院| 99久久伊人精品| av在线播放不卡| 91小视频在线免费看| 97久久超碰国产精品电影| 99久久精品国产网站| 97久久久精品综合88久久| 色综合婷婷久久| caoporen国产精品视频| 91在线精品秘密一区二区| jlzzjlzz亚洲女人18| 99精品久久只有精品| 91久久精品一区二区| 欧美久久久影院| 日韩三级中文字幕| 久久综合九色综合97婷婷女人| 久久久久国产精品人| 中文字幕一区在线观看视频| 亚洲男人天堂av| 日韩激情一二三区| 国精品**一区二区三区在线蜜桃| 国产成人av在线影院| 91香蕉视频污| 欧美一三区三区四区免费在线看| 欧美电影免费观看高清完整版在 | 亚洲欧美日韩在线播放| 亚洲午夜精品在线| 免费成人性网站| 成人开心网精品视频| 在线免费观看视频一区| 日韩午夜电影在线观看| 中文字幕精品在线不卡| 亚洲午夜日本在线观看| 精品一区二区成人精品| 97久久精品人人做人人爽50路| 欧美揉bbbbb揉bbbbb| 国产亚洲一区二区三区在线观看| 亚洲同性gay激情无套| 蜜桃视频在线观看一区二区| 国产99久久久国产精品| 欧美偷拍一区二区| 久久精品一区二区三区不卡牛牛| 亚洲美女屁股眼交3| 蜜桃av一区二区在线观看| 97久久精品人人做人人爽50路 | av电影在线观看一区| 欧美一区二区三区性视频| 国产精品美女久久久久久久| 日韩高清中文字幕一区| 成人高清视频在线观看| 91精品国产黑色紧身裤美女| 亚洲三级在线看| 国产精品一区一区| 欧美一级二级在线观看|