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

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

?? sram512kleft16bit50mhzreadreq-sv05.vhd

?? interface on virtex test ram
?? VHD
字號:
-------------------------------------------------------------------------------
-- sram512kleft16bit50mhzreadreq-sv05.vhd
--
-- Author(s):     James Brennan
-- Created:       15 Feb 2001
-- Last Modified: 16 Feb 2001
-- 
-- Entity: sraminterface
--
-- * Provides a simple interface to the SRAM on an XSV Board, v1.0
-- * 512k address space (512 * 1024 addressable locations, meaning
--   that addresses are 19 bits wide).
-- * 16 bit data (each location holds 16 bits). 
-- * Only uses left-bank of SRAM. (Technically you could connect this entity
--   to either bank of SRAM in your top-level file. The data and address
--   lines have simply been named assuming that the entity will be connected
--   to the left bank of SRAM).
--
-- * Writes are performed in 2 clock cycles. Reads are performed in 2 clock
--   cycles.
--
-- * Read data is NOT registered internally. It must be registered externally.
-------------------------------------------------------------------------------

-- ---------------------------------
-- Clock:
-- 50Mhz or slower required.
-- Must have a 50% duty cycle.
-- ---------------------------------

-- The two signals canRead and canWrite are are high when new requests
-- for reads and writes respectively can be made. 

-- Writes and reads can be performed in any order and can be
-- interspersed in any way.

-- To perform a write:
-- *	Place the write address on writeAddr and the write data on 
--		writeData.
-- *	Wait until canWrite is '1'. Then assert doWrite (set to '1').
--		You can assert doWrite on the same clock cycle that canWrite
--		is high. Asserting doWrite is also called making a
--		"write request".
-- *	The sraminterface will see doWrite is '1' on the next rising
--		clock edge and on the same edge will register (i.e. place in
--		registers) writeAddr and writeData. The write will take place
--		in the 2 cycles after this first edge and will be completed at
--		the third rising clock edge after doWrite is asserted.
-- To perform a read:
-- *	Place the read address on readAddr.
-- *	Wait until canRead is '1'. Then assert doRead (set to '1').
--		You can assert doRead on the same clock cycle that canRead
--		is high. Asserting doRead is also called making a
--		"read request".
-- *	The sraminterface will see doRead is '1' on the next rising
--		clock edge and on the same edge will register (i.e. place in
--		registers) the value on readAddr. The read will take place
--		over two clock cycles. In the first cycle, canRead (and
--		canWrite will be low. In the second cycle, canRead (and
--		canWrite) will be high. This indicates both that the
--		readData will be valid at the end of this cycle	and that the
--		sraminterface can at this point handle another read or write
--		request.
-- *	At the end of the clock cycle in which canRead goes high
--		again, the user of the sraminterface must register the value
--		on readData. This value must be registered, as on the next
--		clock cycle it is not guaranteed to be the same and may
--		instead change.

library IEEE;
use IEEE.std_logic_1164.all;

entity sraminterface is
    port (
        CLK: in STD_LOGIC;								-- Clock signal.
        Resetn: in STD_LOGIC;							-- Asynchronous reset
        doRead: in STD_LOGIC;							-- Set this to make a read request.							
        doWrite: in STD_LOGIC;							-- Set this to make a write request.
        readAddr: in STD_LOGIC_VECTOR (18 downto 0);	-- Address to read from (user-side).
        writeAddr: in STD_LOGIC_VECTOR (18 downto 0);	-- Address to write to (user-side).
        readData: out STD_LOGIC_VECTOR (15 downto 0);	-- Data read (user-side).
        writeData: in STD_LOGIC_VECTOR (15 downto 0);	-- Data to write (user-side).
        canRead: out STD_LOGIC;							-- Is '1' when a read request can be handled.							
        canWrite: out STD_LOGIC;						-- Is '1' when a write request can be handled.
        CELeftn: out STD_LOGIC;							-- CEn signal to left SRAM bank.
        OELeftn: out STD_LOGIC;							-- OEn signal to left SRAM bank.
        WELeftn: out STD_LOGIC;							-- WEn signal to left SRAM bank.
        SRAMLeftAddr: out STD_LOGIC_VECTOR (18 downto 0);	-- Address bus to left SRAM bank.
        SRAMLeftData: inout STD_LOGIC_VECTOR (15 downto 0)	-- Data bus to left SRAM bank.
    );
end sraminterface;

architecture sraminterface_arch of sraminterface is

	-- ========================================
	-- Architechture declarations:
	-- ========================================	

	-- Constants:

	-- General enabled/disabled constants:
	constant CONST_ENABLED : STD_LOGIC := '1';
	constant CONST_DISABLED : STD_LOGIC := '0';
	
	-- Signals for registers:
	signal addrReg : STD_LOGIC_VECTOR(18 downto 0);
	signal writeDataReg : STD_LOGIC_VECTOR(15 downto 0);
	
	-- Clock-enable controls for the registers:
	signal regWriteAddr : STD_LOGIC;
	signal regReadAddr : STD_LOGIC;
	signal regWriteData : STD_LOGIC;
	
	-- Internal values of SRAM control signals:
	signal CEn : STD_LOGIC;
	signal OEn : STD_LOGIC;
	signal WEn : STD_LOGIC;

	-- Flip-flop signals for signalling when we are
	-- in the "write" states (these are effectively
	-- duplicating some of the presState signal to
	-- try and improve the timing of the circuit):
	signal doingWrite1 : STD_LOGIC;
	signal doingWrite2 : STD_LOGIC;

	-- Other control signals for the data path:
	signal enableWriteData : STD_LOGIC;

	-- 16-bit data bus:
	-- We are only using the left-hand side SRAM bank.
	signal SRAMData : STD_LOGIC_VECTOR(15 downto 0);
		
	-- Signals for latched-mealy outputs:
	signal nextOEn: STD_LOGIC;
	signal nextWEn: STD_LOGIC;
	signal nextDoingWrite1 : STD_LOGIC;
	signal nextDoingWrite2 : STD_LOGIC;
	
	-- Declarations required for the controller FSM.
	type STATE_TYPE is (stIdle, stWrite1, stWrite2,
			stRead1, stRead2);
	signal presState, nextState: STATE_TYPE;
	
begin
	-- ========================================
	-- Architecture body:
	-- ========================================

	-- ========================================
	-- Combinational signals
	-- ========================================

	-- Control signals:
	CELeftn <= CEn;
	OELeftn <= OEn;
	WELeftn <= WEn;

	-- SRAM address bus:
	SRAMLeftAddr <= addrReg;
	
	-- SRAM data bus:
	SRAMLeftData <= SRAMData;

	readData <= SRAMData;
	
	-- ========================================
	-- Implementation of specific structures	
	-- ========================================
	
	-- 3-state buffer placed after the writeDataReg register
	-- in the data path:
	process(writeDataReg, doingWrite1, doingWrite2, CLK)
	begin
		-- We drive the SRAM data I/O bus with data to be written
		-- ONLY at the following times:
		--		* For the 2nd half of write cycle 1
		--	and * For the entirety of write cycle 2
		--
		-- To do this we rely on the fact that CLK = '1' for the
		-- first half of a clock cycle and CLK = '0' for the
		-- second half of a cycle.
		-- The reason for the dependancy on CLK is as follows:
		-- At the start of the clock cycle in which we are
		-- performing a write, we raise OEn. This is to make the
		-- SRAM stop driving its bidirectional data lines and
		-- instead make its drivers high impedance. We wait half a
		-- clock cycle for the SRAM's data line drivers to go high
		-- impedance, and THEN we ourselves drive the SRAM's
		-- bidirectional data lines with the data that we wish to
		-- be written.
		if	(doingWrite1 = '1' and CLK = '0') or
			(doingWrite2 = '1') then
			SRAMData <= writeDataReg;
		else
			SRAMData <= (others => 'Z');
		end if;
	end process;

	-- Process for WEn signal:
	-- This process has been placed here simply because it is similar
	-- to the 3-state buffer on the write data output above. However
	-- we do NOT use a 3-state buffer for WEn.
	process(doingWrite1, doingWrite2, CLK)
	begin
		if	(doingWrite1 = '1' and CLK = '0') or
			(doingWrite2 = '1' and CLK = '1') then
			WEn <= '0';
		else
			WEn <= '1';
		end if;
	end process;
	

	
	-- ========================================
	-- Process for reset and clock-edge events
	-- ========================================
	process(CLK, Resetn)
	begin
		if Resetn = '0' then
			-- Default values of signals that are NOT
			-- controlled by the FSM controller:
			presState <= stIdle;
	
			CEn <= '1';
			OEn <= '0';

			doingWrite1 <= '0';
			doingWrite2 <= '0';

			addrReg <= (others => '0');
			writeDataReg <= (others => '0');
					
		elsif CLK'EVENT and CLK = '1' then
			CEn <= '0';
			
			-- Handle the clock-enabling of each register:
			if regReadAddr = '1' then
				addrReg <= readAddr;
			elsif regWriteAddr = '1' then
				addrReg <= writeAddr;
			end if;

			if regWriteData = '1' then
				writeDataReg <= writeData;
			end if;

			-- Update latched-mealy outputs:
			OEn <= nextOEn;
			doingWrite1 <= nextDoingWrite1;
			doingWrite2 <= nextDoingWrite2;
					
			-- Update current state for controller FSM:
			presState <= nextState;
		end if;
	end process;

	
	-- ========================================
	-- Process for FSM of controller
	-- ========================================
	process(presState, doRead, doWrite)
	begin
		-- Set the defaults for all the signals this FSM
		-- controls:
		nextOEn <= '0';
		nextDoingWrite1 <= '0';
		nextDoingWrite2 <= '0';

		regWriteAddr <= '0';
		regWriteData <= '0';
		regReadAddr <= '0';
		
		canRead <= '1';
		canWrite <= '1';

		case presState is
			when stIdle =>
				nextState <= stIdle;
				 
				if doWrite = '1' then
					nextState <= stWrite1;
		
					regWriteAddr <= '1';
					regWriteData <= '1';					

					nextOEn <= '1';
					nextDoingWrite1 <= '1';
					nextDoingWrite2 <= '0';
				elsif doRead = '1' then
					nextState <= stRead1;
					
					regReadAddr <= '1';
				end if;

			when stWrite1 =>
				nextState <= stWrite2;
				
				nextOEn <= '1';
				nextDoingWrite1 <= '0';
				nextDoingWrite2 <= '1';
				
				canRead <= '0';
				canWrite <= '0';
			when stWrite2 =>
				nextState <= stIdle;

				nextOEn <= '0';
				nextDoingWrite1 <= '0';
				nextDoingWrite2 <= '0';
				
				canRead <= '1';
				canWrite <= '1';	

				if doWrite = '1' then
					nextState <= stWrite1;
		
					regWriteAddr <= '1';
					regWriteData <= '1';					

					nextOEn <= '1';
					nextDoingWrite1 <= '1';
					nextDoingWrite2 <= '0';
				elsif doRead = '1' then
					nextState <= stRead1;
					
					regReadAddr <= '1';
				end if;

			when stRead1 =>
				nextState <= stRead2;
				
				canWrite <= '0';
				canRead <= '0';

			when stRead2 =>
				nextState <= stIdle;				

				canWrite <= '1';
				canRead <= '1';

				if doWrite = '1' then
					nextState <= stWrite1;
		
					regWriteAddr <= '1';
					regWriteData <= '1';					

					nextOEn <= '1';
					nextDoingWrite1 <= '1';
					nextDoingWrite2 <= '0';
				elsif doRead = '1' then
					nextState <= stRead1;
					
					regReadAddr <= '1';
				end if;
			
				-- readAddrReg already contains the read address and
				-- is the default connection for the SRAM address bus.
				-- Therefore all the user needs to do is register the SRAM
				-- data bus at the end of this clock cycle.
				
		end case;
	end process;

end sraminterface_arch;

-- ---------------------------------
-- Major features/changes:
-- ---------------------------------
-- (15/02/2001) sram512kleft16bit50mhzreadreq-sv05 created
-- from sv04. This version works successfully again.
-- It uses a 2 clock cycle write and a 2 clock cycle read.
-- Note we also have tried to improve the logic that
-- handles generating the value for WEn. We have created
-- two signals (doingWrite1 and doingWrite2) as part of
-- this effort to improve timing. They are basically
-- duplicates of some of the bits of presState. The path
-- from presState to the WEn pad was very long, so this
-- duplication of logic is aimed to shorten that path.
-- The .ucf file we are using is:
-- "Y pport, Y debug, Y timing, Y IOB outputs, N input delay, Y fast slew.ucf"
-- (09/02/2001) sram512kleft16bit50mhzreadreq-sv04 created
-- from sv03. An experimental version with *many* cycles
-- for reads and writes.
-- (06/02/2001) We removed the multiplexor on the readData
-- output port as well.
-- (06/02/1001) Address multiplexer placed before
-- address register, instead of having two address registers
-- and a multiplexor placed between them and the SRAM ports.
-- (05/02/2001) sram512kleft16bit50mhzreadreq-sv02 created
-- from sv02. An experimental version.
-- 3 cycle read introduced. Still using a 2 cycle write.
-- (29/01/2001) sram512kleft16bit50mhzreadreq-sv02 created
-- from sv01b. A read now takes two clock cycles.
-- Also, we have reverted to NOT registering the read data
-- internally. Therefore the read data must be registered
-- externally at the end of the 2nd clock cycle of the read
-- process.
-- (24/01/2001) sram512kleft16bit50mhzreadreq-sv01b created
-- from sram512kleft16bit50mhz-sv01b.
-- To perform a read, a read "request" must now be given using
-- the doRead signal, just as a write request is made using the
-- doWrite signal. In this version of the SRAM interface, the
-- read data is also registered internally. Thus the read data
-- no longer needs to be registered externally.
-- (17/01/2001) File created by copying
-- "sram512kleft16bit50mhz-sv01.vhd" and modifying it.
-- The write process was changed to take 2 clock cycles
-- instead of 1, while the read process still takes
-- only 1 clock cycle.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
顶级嫩模精品视频在线看| 中文字幕日韩精品一区| 天天做天天摸天天爽国产一区| 91久久一区二区| 亚洲国产精品视频| 欧美日韩国产123区| 麻豆精品一区二区综合av| 欧美www视频| 成人一区二区三区| 亚洲综合在线免费观看| 欧美日韩国产小视频| 日韩av中文字幕一区二区| 精品国产乱码久久久久久久 | 欧美人与性动xxxx| 日韩国产一区二| 久久久噜噜噜久久中文字幕色伊伊 | 日韩欧美一卡二卡| 麻豆精品在线看| 国产精品久久久久婷婷| 日本高清视频一区二区| 欧美aaaaa成人免费观看视频| 久久伊人蜜桃av一区二区| 不卡一区中文字幕| 日韩国产精品久久久| 久久精品亚洲麻豆av一区二区 | 欧美亚洲动漫精品| 毛片一区二区三区| 亚洲欧洲成人自拍| 欧美一区二区三区喷汁尤物| 国产69精品一区二区亚洲孕妇 | 欧美日韩一区视频| 国产乱色国产精品免费视频| 亚洲精品第一国产综合野| 欧美一区二区国产| 91香蕉视频黄| 麻豆国产精品一区二区三区| 亚洲色图一区二区| 日韩精品一区二区在线| 91麻豆成人久久精品二区三区| 免费观看在线色综合| 亚洲女女做受ⅹxx高潮| 26uuu国产一区二区三区| 在线中文字幕一区二区| 成人亚洲一区二区一| 毛片av一区二区三区| 最新中文字幕一区二区三区| 日韩欧美亚洲国产另类| 欧美性猛交xxxx黑人交| 成人精品国产福利| 久久不见久久见免费视频7| 亚洲亚洲精品在线观看| 成人欧美一区二区三区| 久久免费看少妇高潮| 在线不卡中文字幕| 色婷婷av一区| 北岛玲一区二区三区四区| 精品午夜久久福利影院| 肉丝袜脚交视频一区二区| 亚洲免费在线观看视频| 国产精品久久久久永久免费观看 | av不卡在线观看| 国产高清亚洲一区| 国产综合色视频| 青青草97国产精品免费观看无弹窗版| 亚洲激情中文1区| 亚洲欧美一区二区三区孕妇| 国产欧美日韩另类视频免费观看| 精品国精品国产| 日韩女优制服丝袜电影| 91精品欧美久久久久久动漫| 欧美日韩一区视频| 欧美优质美女网站| 欧洲一区在线电影| 在线亚洲人成电影网站色www| jizzjizzjizz欧美| 成人av网在线| 91看片淫黄大片一级| 91免费视频网| 在线观看成人小视频| 91高清视频免费看| 日本黄色一区二区| 欧美日韩视频不卡| 日韩限制级电影在线观看| 91精品国产91久久综合桃花 | 99在线视频精品| 99热这里都是精品| 色综合天天性综合| 欧美视频一区二区三区四区| 欧美日韩成人在线| 欧美一区二区三区视频| 日韩精品一区二区三区视频播放| 日韩精品一区二区三区swag| 久久久久久电影| 日韩一区欧美一区| 亚洲永久精品国产| 日韩av不卡在线观看| 精品系列免费在线观看| 不卡一二三区首页| 在线欧美日韩国产| 91精选在线观看| 久久丝袜美腿综合| 综合久久给合久久狠狠狠97色| 亚洲黄色小视频| 奇米色一区二区三区四区| 精久久久久久久久久久| caoporn国产精品| 欧美亚洲国产怡红院影院| 制服丝袜亚洲播放| 久久久电影一区二区三区| 中文字幕一区二区三区不卡在线 | 久久精品欧美一区二区三区麻豆| 中文字幕亚洲在| 天天操天天综合网| 国产成人av一区二区三区在线观看| 99精品黄色片免费大全| 制服丝袜激情欧洲亚洲| 国产精品视频第一区| 午夜视频在线观看一区| 国产成人av电影在线观看| 日本高清无吗v一区| 精品国产伦一区二区三区观看方式| 中文字幕一区二区不卡| 丝袜脚交一区二区| av不卡免费电影| 日韩精品一区二区三区在线| 亚洲欧美日韩一区二区| 久久国产精品区| 欧美自拍丝袜亚洲| 国产色产综合色产在线视频| 亚洲电影你懂得| 成人av电影在线| 精品国产伦一区二区三区免费| 一区二区在线观看不卡| 精品亚洲成a人| 欧美日韩国产一级| 亚洲欧洲制服丝袜| 国产成人免费9x9x人网站视频| 91精品国产综合久久久久久久| 18欧美亚洲精品| 国产aⅴ综合色| 精品国产一区久久| 天使萌一区二区三区免费观看| 懂色av一区二区三区免费观看 | 麻豆成人av在线| 91精品福利在线| 亚洲色欲色欲www| 国产风韵犹存在线视精品| 日韩欧美中文字幕一区| 亚洲综合一区二区| 波多野结衣中文一区| 久久久久88色偷偷免费| 激情国产一区二区| 日韩三级免费观看| 视频一区二区国产| 欧美亚洲综合色| 亚洲一区在线免费观看| 99re热这里只有精品免费视频| 久久久不卡影院| 久久99久久99| 日韩欧美一卡二卡| 美日韩一区二区| 日韩一级片在线播放| 日韩专区中文字幕一区二区| 欧美日韩国产在线观看| 五月婷婷另类国产| 欧美日韩激情一区二区| 亚洲国产视频在线| 欧美亚洲高清一区二区三区不卡| 亚洲精品国产a久久久久久| caoporn国产精品| 亚洲免费观看高清在线观看| 色婷婷久久久亚洲一区二区三区 | 国产午夜三级一区二区三| 精品一区中文字幕| 国产亚洲视频系列| 99热这里都是精品| 亚洲精品免费在线观看| 欧美午夜不卡在线观看免费| 亚洲va韩国va欧美va| 欧美欧美午夜aⅴ在线观看| 日韩电影免费在线看| 欧美一级夜夜爽| 国产精选一区二区三区| 国产精品萝li| 欧美亚洲国产怡红院影院| 日韩国产成人精品| 久久综合99re88久久爱| 不卡av在线网| 亚洲第一搞黄网站| 欧美大片免费久久精品三p| 国产盗摄一区二区三区| 亚洲人亚洲人成电影网站色| 欧美日韩在线不卡| 国产曰批免费观看久久久| 国产精品美女一区二区在线观看| 91在线观看美女| 日本视频一区二区| 日本一区二区成人在线| 日本韩国视频一区二区| 久久99精品视频|