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

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

?? atacntl.vhd

?? 這是一個基于FPGA的CF卡讀寫程序
?? VHD
?? 第 1 頁 / 共 3 頁
字號:
library IEEE, UNISIM;
use IEEE.std_logic_1164.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	unsigned(4 downto 0);		-- disk register address from host
		pioDIn:			in	unsigned(15 downto 0);	-- data from host	to disk
		pioDOut:		out	unsigned(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	unsigned(2 downto 0);		-- disk register address
		ddIn:				in	unsigned(15 downto 0);	-- data from disk
		ddOut:			out unsigned(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
	);
	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	unsigned(3 downto 0);		-- disk head for data access
		cylinder:		in	unsigned(15 downto 0);	-- cylinder for data access
		sector:			in	unsigned(7 downto 0);		-- sector for data access
		hDIn:				in	unsigned(15 downto 0);	-- data from host	to disk
		hDOut:			out	unsigned(15 downto 0);	-- data from disk to host
		done:				out	std_logic;							-- read or write operation is done
		status:			out std_logic_vector(3 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	unsigned(2 downto 0);		-- register address
		ddIn:				in	unsigned(15 downto 0);	-- data from disk
		ddOut:			out unsigned(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.numeric_std.all;
--use WORK.common.all;

----------------------------------------------------------------------------------
-- 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.
----------------------------------------------------------------------------------

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	unsigned(4 downto 0);		-- disk register address from host
		pioDIn:			in	unsigned(15 downto 0);	-- data from host	to disk
		pioDOut:		out	unsigned(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	unsigned(2 downto 0);		-- disk register address
		ddIn:				in	unsigned(15 downto 0);	-- data from disk
		ddOut:			out unsigned(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
	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_N:		natural := 1+((Top*FREQ)/NORM);
	constant	SETUP_CYCLES_N:	natural := 1+((Tsetup*FREQ)/NORM);
	constant	PULSE_CYCLES_N:	natural := 1+((Tpulse*FREQ)/NORM);
	constant	HOLD_CYCLES_N:	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:				unsigned(log2(OP_CYCLES_N+1)-1 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:	unsigned(pioAddr'range);				-- disk register address register
	signal		ddOut_r, ddOut_x:	unsigned(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:	unsigned(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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美色偷偷大香| 国产精品久久久久久久久久久免费看 | 精品av久久707| 国产精品久久久久久久久久免费看 | 久久精品夜色噜噜亚洲a∨| 亚洲图片激情小说| 久草精品在线观看| 欧美欧美午夜aⅴ在线观看| 国产精品久久久久久久蜜臀| 秋霞午夜av一区二区三区| 91亚洲男人天堂| 欧美va亚洲va| 日日夜夜一区二区| 一本色道**综合亚洲精品蜜桃冫| 精品日韩av一区二区| 亚洲图片自拍偷拍| 97久久超碰国产精品| 欧美精品一区二区精品网| 婷婷成人激情在线网| 在线免费精品视频| 中文字幕第一区| 懂色av一区二区夜夜嗨| 精品久久久久久久久久久久包黑料 | 成人免费视频视频在线观看免费| 欧美一区二区性放荡片| 亚洲电影一区二区三区| 91丨九色丨黑人外教| 中文字幕第一区二区| 盗摄精品av一区二区三区| 久久综合色鬼综合色| 岛国精品在线观看| 精品99一区二区三区| 久久99精品国产麻豆婷婷洗澡| 欧美日韩国产一区二区三区地区| 亚洲午夜三级在线| 欧美日韩亚洲综合| 天堂影院一区二区| 欧美美女黄视频| 亚洲欧美激情一区二区| 91丝袜高跟美女视频| 亚洲男人天堂av| 欧美日韩中字一区| 日本欧美韩国一区三区| 精品少妇一区二区三区日产乱码| 理论电影国产精品| 久久精品欧美一区二区三区不卡 | 日韩免费观看高清完整版| 蜜桃视频一区二区| 久久综合久久99| 波多野结衣在线一区| 国产精品盗摄一区二区三区| 色综合久久88色综合天天6| 亚洲一区二区视频| 精品日本一线二线三线不卡| 国产精品亚洲成人| 亚洲天堂成人网| 欧美精品自拍偷拍动漫精品| 蜜臀国产一区二区三区在线播放| 国产午夜久久久久| 91视频观看视频| 日韩成人午夜精品| 国产日韩欧美制服另类| 日本精品免费观看高清观看| 午夜精品aaa| 久久亚区不卡日本| 在线观看欧美黄色| 国内外精品视频| 亚洲视频每日更新| 日韩欧美国产电影| av影院午夜一区| 免费成人在线网站| 国产精品天美传媒沈樵| 911精品国产一区二区在线| 国产一区二区免费视频| 亚洲黄网站在线观看| 欧美xxx久久| 在线观看日产精品| 国产福利视频一区二区三区| 午夜久久福利影院| 久久久综合九色合综国产精品| 99久久精品情趣| 成人激情动漫在线观看| 欧美精品色一区二区三区| 国产成人精品三级| 亚洲123区在线观看| 中文字幕欧美日本乱码一线二线| 欧美日韩高清影院| 97se亚洲国产综合自在线不卡| 美女国产一区二区三区| 亚洲福利视频导航| 亚洲三级在线观看| 欧美国产日韩a欧美在线观看 | 国产在线看一区| 亚洲国产精品尤物yw在线观看| 久久精品视频在线免费观看| 久久九九久久九九| 欧美精选在线播放| 色狠狠桃花综合| 成人亚洲一区二区一| 韩国av一区二区| 蜜臀久久久久久久| 日本一道高清亚洲日美韩| 亚洲欧美国产高清| **网站欧美大片在线观看| 国产欧美一区二区三区沐欲| 日韩一区二区三区三四区视频在线观看 | 亚洲国产成人porn| 亚洲精品免费看| 国产精品欧美极品| 中文一区二区在线观看| 久久亚洲免费视频| 欧美videos大乳护士334| 日韩手机在线导航| 欧美成人一区二区| 日韩精品专区在线影院观看| 欧美区一区二区三区| 日本精品一区二区三区四区的功能| 成人sese在线| 9色porny自拍视频一区二区| 国产成人亚洲综合a∨婷婷图片 | 欧美刺激午夜性久久久久久久| 6080亚洲精品一区二区| 欧美精品在线一区二区三区| 91麻豆精品国产综合久久久久久| 欧美精品v国产精品v日韩精品| 欧美二区三区91| 欧美一区二区三区视频免费播放 | av成人老司机| av在线不卡观看免费观看| 99免费精品在线观看| 色94色欧美sute亚洲线路一久| 91福利精品第一导航| 91精品国产色综合久久ai换脸| 日韩午夜三级在线| 久久亚洲春色中文字幕久久久| 国产精品美日韩| 亚洲黄色片在线观看| 日本亚洲一区二区| 国产乱码一区二区三区| 91首页免费视频| 91 com成人网| 亚洲日本一区二区三区| 亚洲欧美日韩一区| 日韩电影在线一区二区| 国产露脸91国语对白| 99久久综合狠狠综合久久| 欧美色视频一区| 欧美精品一区二区三区高清aⅴ| 中文字幕中文在线不卡住| 一区二区三区在线视频免费| 免费不卡在线观看| 成人18视频在线播放| 91.com在线观看| 国产精品你懂的在线欣赏| 亚洲自拍另类综合| 国产精品中文字幕日韩精品 | 日韩精品乱码免费| 丁香五精品蜜臀久久久久99网站| 在线一区二区观看| 欧美v日韩v国产v| 99国产精品久久久久久久久久 | 亚洲福利电影网| 久久亚洲欧美国产精品乐播| 亚洲激情在线激情| 亚洲蜜臀av乱码久久精品| 欧美精品粉嫩高潮一区二区| 国产日韩av一区二区| 亚洲高清一区二区三区| 国产精品一区久久久久| 欧美日韩免费一区二区三区视频 | 精品处破学生在线二十三| 亚洲免费毛片网站| 国产激情偷乱视频一区二区三区| 在线观看日韩毛片| 国产婷婷一区二区| 日本美女一区二区| 91香蕉国产在线观看软件| 精品久久久久久久久久久院品网| 亚洲小少妇裸体bbw| 成人h动漫精品一区二| 精品久久一区二区三区| 亚洲成人自拍偷拍| 91浏览器在线视频| 国产精品麻豆网站| 国产91清纯白嫩初高中在线观看| 日韩视频一区二区| 日韩中文字幕一区二区三区| 欧美性感一类影片在线播放| 中文字幕av免费专区久久| 国产麻豆视频精品| 欧美成人精品二区三区99精品| 亚洲 欧美综合在线网络| 欧美日韩一区二区三区视频 | 婷婷综合在线观看| 在线观看一区二区视频| 亚洲精品成人悠悠色影视| 99精品欧美一区二区蜜桃免费| 国产嫩草影院久久久久| 国产成人自拍网| 中文字幕av一区二区三区高|