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

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

?? state_machine.v

?? 基于FPGA的PCI接口源代碼及Testbenc
?? V
?? 第 1 頁 / 共 2 頁
字號:
// --------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------
// Copyright (c) 2001 by Lattice Semiconductor Corporation
// --------------------------------------------------------------------
//
// Permission:
//
//   Lattice Semiconductor grants permission to use this code for use
//   in synthesis for any Lattice programmable logic product.  Other
//   use of this code, including the selling or duplication of any
//   portion is strictly prohibited.
//
// Disclaimer:
//
//   This VHDL or Verilog source code is intended as a design reference
//   which illustrates how these types of functions can be implemented.
//   It is the user's responsibility to verify their design for
//   consistency and functionality through the use of formal
//   verification methods.  Lattice Semiconductor provides no warranty
//   regarding the use or functionality of this code.
//
// --------------------------------------------------------------------
//           
//                     Lattice Semiconductor Corporation
//                     5555 NE Moore Court
//                     Hillsboro, OR 97214
//                     U.S.A
//
//                     TEL: 1-800-Lattice (USA and Canada)
//                          408-826-6000 (other locations)
//
//                     web: http://www.latticesemi.com/
//                     email: techsupport@latticesemi.com
//
// --------------------------------------------------------------------
// Revision History :
// --------------------------------------------------------------------
//   Ver  :| Author            :| Mod. Date :| Changes Made:
//   v1.0 :| D.S.              :| 12/16/98  :| Initial Creation
//   v1.1 :| D.S.              :| 10/05/99  :| added be_oe     
// --------------------------------------------------------------------
//
//	Module  state_machine
//
/*   This module is called state_machine.  It's purpose is to control
  the bus cycle timng of the PCI and bkend Interface signals. 
  The outputs of this block also control output enables for 
  3 state buffers in the design.
 
  The PCI Target State Machine is at the heart of this Reference Design. 
  The State Machine goes from the idle state to one of three possible 
  paths during any given PCI operation.  While in the PCI address phase 
  of a transaction the values on  pci_cbe_l and pci_idsel determine 
  if the transaction is a: Configuration Read or Write, 
  Memory-I/O Read, or a Memory-I/O Write. 

  The designer can modify the state machine HDL code if the 
  functionality of the Back End Device has special system requirements. 
  It may be necessary to implement wait states, or new enable signals 
  for particular applications.  These would require modifications to 
  the HDL code, but embedded HDL comments will guide the designer 
  through the state machine implementation and signal descriptions.

*/

module state_machine (devsel_l, trdy_l, stop_l, pci_ad_oe, 
    dts_oe, par_oe, bk_oe, pci_ad_en, hit_ba0_l, hit_ba1_l, 
    pci_frame_l, pci_idsel, pci_irdy_l, pci_ad, pci_cbe_l, 
    pci_clk, pci_rst_l, abort_sig, data_stop_l, com, 
    data_write_l, ready_l, bkend_abort_l, count_rst_l, count_en_l, 
    retry_l, base_region0_l, base_region1_l, r_w_l, data_read_l,
    be_oe);
 
  output devsel_l; // input to 3 state
  output trdy_l; // input to 3 state
  output stop_l; // input to 3 state
  output pci_ad_oe; // OE for PCI address bus
  output dts_oe; // OE control for the devsel, trdy_l, stop_l (dts)
  output par_oe; // OE control for pci_par
  output bk_oe; // OE control for bkend_dat bus
  output pci_ad_en; // clock enable for the PCI address latch register
  output abort_sig; // sets the status register bit for abort
  output data_write_l; // used as a clock enable for the pci_clk
                       // to the bkend device
  output count_rst_l; // async reset to the retry counter
  output count_en_l; // the clock enable for the retry counter
  output base_region0_l; // chip selects to the backend 
  output base_region1_l; // chip selects to the backend
  output r_w_l; // read == 1 & write == 0
  output data_read_l; // the read strobe for the backend device
  output be_oe; // enables the byte enables for the backend
  input hit_ba0_l; // The pci address is in base address 0
  input hit_ba1_l; // The pci address is in base address 1
  input pci_frame_l; // The pci_frame_l signal
  input pci_idsel; // The pci idsel signal
  input pci_irdy_l; // The pci irdy signal
  input [31:0] pci_ad; // raw pci address data bus
  input [3:0] pci_cbe_l; // The command or byte enables 
  input pci_clk;
  input pci_rst_l;
  input bkend_abort_l; // bkend has had a fatal error
  input data_stop_l; // bkend requesting transaction to stop
  input [1:0] com;
  input ready_l; // bkend is ready to start a transaction cycle
  input retry_l; // when active retry counter has timed out 

  /*********************************************/ 
  /* Some outputs of this block are registered. */
  /* The reg declarations are listed here      */
  /*********************************************/
  
  reg devsel_l; 
  reg trdy_l, stop_l, pci_ad_oe; 
  reg dts_oe, par_oe, bk_oe; 
  reg pci_ad_en;
  reg be_oe;
  reg abort_sig;
  reg count_rst_l, count_en_l;
  reg base_region0_l, base_region1_l;
  reg r_w_l;
  reg read_flag, single_read_flag;
 
  /*********************************************/
  /* begin statemachine declarations           */
  /* Note: synthesis attributes are synthesis  */
  /*       tool specific.                      */
  /*********************************************/
  
  reg [11:0] /* exemplar enum state_type */ cstate;
 
 
  parameter [11:0] /* exemplar enum state_type */

     idle =         12'b0000_0000_0001,
     con_wait =     12'b0000_0000_0010,
     con_wait2 =    12'b0000_0000_0100,
     con =          12'b0000_0000_1000,
     read_wait =    12'b0000_0001_0000,
     rw =           12'b0000_0010_0000,
     rw_wait =      12'b0000_0100_0000,
     rw_wait2 =     12'b0000_1000_0000,
     last_rw =      12'b0001_0000_0000,
     backoff =      12'b0010_0000_0000,
     retry =        12'b0100_0000_0000,
     abort =        12'b1000_0000_0000;

 /***********************************************/
 /* The following `defines are defined here to  */
 /* keep the state machine clean.               */
 /***********************************************/
 
 `define config_read (pci_cbe_l == 4'b1010)
 `define config_write (pci_cbe_l == 4'b1011)
 `define func_zero_type_zero (pci_ad[10:8] == 3'b000) && (pci_ad[1:0] == 2'b00)

 `define write_ba0 pci_addr[7:2] == 6'h10
 `define write_ba1 pci_addr[7:2] == 6'h14
 
 `define no_config (!pci_idsel && !pci_frame_l)
 `define io_read ((pci_cbe_l == 4'b0010)  && com[0]) 
 `define io_write ((pci_cbe_l == 4'b0011) && com[0])
 `define mem_read ((pci_cbe_l == 4'b0110) && com[1])
 `define mem_write ((pci_cbe_l == 4'b0111) && com[1])

 // Notice:  All outputs that go off the chip are registered,
 // except for data_write_l and data_read_l.
 // If an output is active low it ends with _l else it's
 // active high.
 
 // mealy state machine with synchronous outputs
 always @ (posedge pci_clk or negedge pci_rst_l)
   begin 
     if (!pci_rst_l) begin 
	 cstate <= #1 idle;
	 devsel_l <= #1 1; 
         trdy_l <= #1 1; 
	 stop_l <= #1 1;
	 pci_ad_oe <= #13 0; 
         dts_oe <= #13 0; 
	 par_oe <= #13 0; 
	 bk_oe <= #13 0; 
         abort_sig <= #1 0;
	 count_rst_l <= #1 1;
	 count_en_l <= #1 1;
	 base_region0_l <= #1 1;
	 base_region1_l <= #1 1;
	 r_w_l <= #1 1; // default to read
	 read_flag <= #1 0;
	 single_read_flag <= #1 0;
        end 
        else begin 
	 case (cstate) // parallel_case full_case
	   idle:
 	      begin 
	      	if ((`config_read || `config_write) && `func_zero_type_zero
		&& !pci_frame_l && pci_idsel) begin 
	      	  cstate <= #1 con_wait;
		  dts_oe <= #13 1; // takes 1 tic
	          if (`config_read) begin 
		    pci_ad_oe <= #13 1; // takes 1 tic
		  end
		  else begin // config write
		    pci_ad_oe <= #13 0; // takes 1 tic
		  end
		  par_oe <= #13 0;
		  devsel_l <= #1 1; // disabled at first
		  trdy_l <= #1 1; // disabled at first
		  stop_l <= #1 1; // disabled at first
		  count_rst_l <= #1 1;
	          count_en_l <= #1 1;
		  abort_sig <= #1 0; // disable
		  base_region0_l <= #1 1;
	          base_region1_l <= #1 1;
	          r_w_l <= #1 1;
		end

		else if ((`io_read || `mem_read) && `no_config ) begin 
		  cstate <= #1 rw_wait;
		  read_flag <= #1 1; // set because it's a read
		  dts_oe <= #13 1; // takes 1 tic get ready to drive
		  devsel_l <= #1 1; // disabled at first
		  trdy_l <= #1 1; // disabled at first
		  stop_l <= #1 1; // disabled at first
		  count_rst_l <= #1 0; // reset the counter
	          count_en_l <= #1 1;
		  abort_sig <= #1 0; // disable
		  base_region0_l <= #1 1;
	          base_region1_l <= #1 1;
	          r_w_l <= #1 1; // default to read
		end
		else if ((`io_write || `mem_write) && `no_config )begin 
		  cstate <= #1 rw_wait;
		  read_flag <= #1 0; // clear because it's a write
		  dts_oe <= #13 1; // takes 1 tic get ready to drive
		  devsel_l <= #1 1; // disabled at first
		  trdy_l <= #1 1; // disabled at first
		  stop_l <= #1 1; // disabled at first
		  count_rst_l <= #1 0; // reset the counter
	          count_en_l <= #1 1;
		  abort_sig <= #1 0; // disable
		  base_region0_l <= #1 1;
	          base_region1_l <= #1 1;
	          r_w_l <= #1 1; // default to a read at first
		end
		else begin 
		  cstate <= #1 idle;
	          devsel_l <= #1 1; 
                  trdy_l <= #1 1; 
	          stop_l <= #1 1;
	          pci_ad_oe <= #13 0; 
                  dts_oe <= #13 0; 
	          par_oe <= #13 0; 
	          bk_oe <= #13 0; 
                  abort_sig <= #1 0;
	          count_rst_l <= #1 1;
	          count_en_l <= #1 1;
		  abort_sig <= #1 0; // disable
		  base_region0_l <= #1 1;
	          base_region1_l <= #1 1;
	          r_w_l <= #1 1;
		end	      
	      end
	      
        con_wait: 
	      begin 
	         // always go to con_wait2
		 cstate <= con_wait2;
                 devsel_l <= #1 0;
	      end

	 con_wait2: 
	      begin 
		cstate <= con;
		par_oe <= #13 1; // takes one tic
 		trdy_l <= #1 0; // ready to transfer next tic
                if (!pci_frame_l)  
		  stop_l <= #1 0; // burst config not supported
		                  // disconnect A or B
		else
		  stop_l <= #1 1; // single Config is OK
	      end

	 con:
	      begin 
		if (!pci_irdy_l) begin 
		  // transfer data
		  cstate <= backoff;
		  devsel_l <= #1 1;
		  trdy_l <= #1 1;
		  stop_l <= #1 1;
		  pci_ad_oe <= #13 0; // disable
		end
		else begin 
		  // wait for pci_irdy_l == 0
		  cstate <= con;
		  devsel_l <= #1 0;
		  trdy_l <= #1 0;
		  if (!pci_frame_l)  
		    stop_l <= #1 0; // burst config not supported
		                    // disconnect A or B
		  else
 		    stop_l <= #1 1; // single Config is OK
		end
	      end

          /* if we have a hit rw_wait turns on dts_oe.
	     and asserts the base address region signal.
	     we need to wait till rw_wait2 to change
	     any dts signal.
	     d=devsel_l t=trdy_l s=stop_l
	  */   

   	  rw_wait:
    	     begin 
	
	       if (pci_frame_l && read_flag) begin 
		     single_read_flag <= #1 1; // single cycle read
	           end
	           else begin 
		     single_read_flag <= #1 0; // i.e. burst read
	           end
	       // Irdy_l can not be late, the initiator must be ready
	       // here. The target relies on it.
	       if (!hit_ba0_l) begin 
	           cstate <= #1 rw_wait2;
	           count_rst_l <= #1 1; // disable
		   count_en_l <= #1 0; // enable
		   base_region0_l <= #1 0; // enable
		   base_region1_l <= #1 1; // disable
		   dts_oe <= #13 1; // takes 1 tic get ready to drive
		   devsel_l <= #1 1; // disabled at first
		   trdy_l <= #1 1; // disabled at first
		   stop_l <= #1 1; // disabled at first
		   if (read_flag) begin 
		     bk_oe <= #13 0; // disable OE
		     r_w_l <= #1 1;
		     end
		   else begin 
		     bk_oe <= #13 1; // enable OE
		     r_w_l <= #1 0;
		   end 
		end
		else if (!hit_ba1_l) begin 
		   cstate <= #1 rw_wait2;
	           count_rst_l <= #1 1; // disable
		   count_en_l <= #1 0; // enable

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日本一区二区三区| 亚洲六月丁香色婷婷综合久久| 久久美女艺术照精彩视频福利播放| 日本一区二区免费在线观看视频| 亚洲精品日韩专区silk | 欧美伊人久久大香线蕉综合69| 欧美一区二区三区影视| 69堂精品视频| 亚洲国产高清在线| 国产一区二区久久| 日韩一区二区免费视频| 1区2区3区精品视频| 美女视频一区二区| 精品视频一区 二区 三区| 久久精品一区二区三区不卡| 亚洲一二三区不卡| 成人精品一区二区三区中文字幕| 91精品国产色综合久久不卡电影 | 99精品视频在线免费观看| 日韩一区二区影院| 亚洲一区在线免费观看| 秋霞av亚洲一区二区三| 色综合激情五月| 26uuu亚洲综合色| 日本强好片久久久久久aaa| 91免费小视频| 中文字幕不卡在线观看| 经典三级在线一区| eeuss国产一区二区三区| 亚洲国产精品传媒在线观看| 久久66热re国产| 欧美一区二区三级| 亚瑟在线精品视频| 在线观看免费一区| 有坂深雪av一区二区精品| www.性欧美| 亚洲国产成人私人影院tom| 国产在线一区二区| 欧美大黄免费观看| 热久久久久久久| 日韩一级完整毛片| 久久精品久久99精品久久| 欧美日韩精品免费观看视频 | 一区二区欧美精品| 91传媒视频在线播放| 依依成人综合视频| 在线精品国精品国产尤物884a| 18欧美乱大交hd1984| 成人精品电影在线观看| 中文字幕乱码久久午夜不卡 | 麻豆视频一区二区| 欧美一区二视频| 韩国中文字幕2020精品| 精品国产人成亚洲区| 裸体歌舞表演一区二区| 久久尤物电影视频在线观看| 国产一区二区女| 国产精品私房写真福利视频| 韩国一区二区三区| 久久久不卡影院| 北条麻妃国产九九精品视频| 综合色中文字幕| 一本大道久久a久久精二百| 亚洲欧美日韩国产综合| 欧美日韩高清一区二区| 国产sm精品调教视频网站| 一区二区免费视频| 久久精品人人做| 欧美亚洲动漫另类| 国产乱码字幕精品高清av | 精品一区二区三区欧美| 中文字幕一区二区三区乱码在线| 精品视频在线免费看| 国产精品综合网| 天堂成人免费av电影一区| 日本一区二区三区在线不卡| 欧美日本一区二区在线观看| 国产精品 欧美精品| 日本女人一区二区三区| 亚洲精品网站在线观看| 久久精品人人做人人综合| 精品视频在线免费观看| a4yy欧美一区二区三区| 久久99精品一区二区三区| 亚洲国产日韩a在线播放| 国产精品久久一级| ww亚洲ww在线观看国产| 欧美色男人天堂| 色婷婷综合久久久中文字幕| 国产乱人伦偷精品视频不卡| 日本伊人精品一区二区三区观看方式| 国产精品久久久久影院亚瑟| 精品久久久久久无| 91精品蜜臀在线一区尤物| 色女孩综合影院| 不卡的av网站| heyzo一本久久综合| 国产乱码字幕精品高清av| 日韩国产高清影视| 亚洲国产精品久久久久秋霞影院 | 激情图片小说一区| 蜜桃av一区二区在线观看| 石原莉奈一区二区三区在线观看| 亚洲自拍偷拍麻豆| 亚洲自拍另类综合| 亚洲妇熟xx妇色黄| 亚洲国产精品久久久久秋霞影院| 亚洲色图欧洲色图| 亚洲人成网站在线| 亚洲色图20p| 亚洲免费毛片网站| 夜夜揉揉日日人人青青一国产精品 | 亚洲欧洲www| 国产精品免费aⅴ片在线观看| 国产午夜精品久久| 国产精品网站在线| 亚洲色图色小说| 一区二区三区免费网站| 亚洲一卡二卡三卡四卡| 视频一区国产视频| 奇米综合一区二区三区精品视频| 免费观看在线综合| 国产麻豆成人传媒免费观看| 国产不卡高清在线观看视频| 成人激情动漫在线观看| 日韩高清一区在线| 经典三级在线一区| 成年人网站91| 欧美日韩和欧美的一区二区| 日韩美一区二区三区| 国产午夜精品久久久久久久 | 国产日韩v精品一区二区| 中文字幕不卡在线| 亚洲在线观看免费| 精品一区二区av| caoporm超碰国产精品| 欧美日韩中文字幕精品| 精品国内片67194| 自拍偷拍国产精品| 视频精品一区二区| 成人午夜视频福利| 欧美军同video69gay| 26uuu欧美日本| 伊人开心综合网| 蜜臀av性久久久久蜜臀aⅴ四虎| 国产综合久久久久久久久久久久| 99这里只有久久精品视频| 在线日韩一区二区| 精品av综合导航| 最新国产精品久久精品| 日本系列欧美系列| 99在线视频精品| 欧美精选一区二区| 中文字幕第一区综合| 日韩激情一区二区| 波多野结衣欧美| 精品日韩一区二区| 亚洲影院在线观看| 成人不卡免费av| 欧美大片免费久久精品三p| 亚洲欧美日韩国产中文在线| 精品亚洲porn| 欧美精品第1页| 中文字幕中文乱码欧美一区二区 | 日韩在线卡一卡二| www.性欧美| 久久免费看少妇高潮| 日本欧美肥老太交大片| 91久久精品国产91性色tv| 国产日韩精品一区| 久久99久久久久久久久久久| 欧美日韩一二三| 亚洲精品午夜久久久| 成人美女在线视频| 久久精品亚洲国产奇米99| 日韩国产精品久久久久久亚洲| 91亚洲国产成人精品一区二区三| 欧美v国产在线一区二区三区| 亚洲不卡一区二区三区| 色一情一乱一乱一91av| 欧美国产视频在线| 国产在线精品不卡| 欧美一区二区精美| 丝袜美腿亚洲综合| 欧美日韩一区二区三区不卡| 亚洲精品久久久久久国产精华液| av亚洲精华国产精华精华| 国产偷国产偷精品高清尤物| 激情文学综合网| www国产亚洲精品久久麻豆| 蜜臀av一区二区| 欧美videossexotv100| 男女男精品视频网| 欧美一二三四在线| 日本中文字幕一区二区有限公司| 666欧美在线视频| 美女任你摸久久| 精品国产精品网麻豆系列| 国内精品国产成人国产三级粉色 | 色综合久久88色综合天天6 |