亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
成年人国产精品| 五月婷婷综合激情| 亚洲精品一线二线三线无人区| 91蜜桃婷婷狠狠久久综合9色| 国产成人精品亚洲777人妖| 国产一区二区三区高清播放| 老司机午夜精品99久久| 日本网站在线观看一区二区三区 | 久久99久久99小草精品免视看| 午夜精品久久久久久久久久久| 亚洲大片一区二区三区| 天天综合网天天综合色| 偷偷要91色婷婷| 毛片一区二区三区| 韩国毛片一区二区三区| 国产宾馆实践打屁股91| 成人app软件下载大全免费| 成人黄色在线看| 在线视频欧美区| 在线视频欧美区| 欧美日韩国产大片| 久久综合久久鬼色| 中文字幕日韩一区| 天天色 色综合| 国模冰冰炮一区二区| www.成人在线| 欧美人牲a欧美精品| 精品99一区二区| 亚洲欧美一区二区久久| 日韩成人一级片| 国产成人在线视频网址| 欧美性生活影院| 精品av综合导航| 亚洲一区二区三区小说| 美女免费视频一区二区| 播五月开心婷婷综合| 欧美精品123区| 国产精品色在线| 日本欧美肥老太交大片| 成人国产精品视频| 欧美日韩国产另类不卡| 中文字幕国产一区| 奇米精品一区二区三区在线观看一| 国产精品12区| 欧美老年两性高潮| 国产精品家庭影院| 麻豆成人久久精品二区三区红 | 91亚洲精品久久久蜜桃网站| 欧美色中文字幕| 中文字幕在线一区| 久久99国内精品| 欧美精品电影在线播放| 1区2区3区精品视频| 国产美女一区二区三区| 欧美日韩一级大片网址| 亚洲欧美一区二区在线观看| 国产一区二区看久久| 制服丝袜成人动漫| 亚洲男人天堂一区| 国产999精品久久久久久| 日韩欧美一级片| 午夜久久久久久久久久一区二区| gogo大胆日本视频一区| 日韩免费观看2025年上映的电影| 亚洲一区二区3| 91成人国产精品| 国产精品美女久久久久久| 美洲天堂一区二卡三卡四卡视频| 欧美三日本三级三级在线播放| 中文字幕亚洲一区二区av在线| 国产精品一区二区免费不卡 | 精品国产乱码久久久久久1区2区| 亚洲综合成人网| 一本色道久久综合亚洲91| 国产欧美精品在线观看| 狠狠色狠狠色综合日日91app| 在线综合视频播放| 无码av免费一区二区三区试看| 欧美视频一区二区三区在线观看| 一区二区三区不卡视频 | 一区二区三区成人在线视频| 99久久综合色| 一区二区国产盗摄色噜噜| 欧美色涩在线第一页| 午夜亚洲福利老司机| 在线91免费看| 美女网站色91| 国产日产亚洲精品系列| 高清国产午夜精品久久久久久| 国产精品私人自拍| 91热门视频在线观看| 亚洲综合区在线| 欧美一区二区三区爱爱| 久久国产精品99久久人人澡| 26uuu另类欧美亚洲曰本| 国产高清亚洲一区| 中文字幕中文字幕在线一区 | 午夜激情一区二区| 日韩欧美电影一区| 国产麻豆成人精品| 日韩毛片精品高清免费| 91麻豆精品国产综合久久久久久| 精品亚洲成a人| 亚洲欧洲综合另类在线| 欧美精品在线一区二区三区| 麻豆精品视频在线观看免费| 国产精品久久久久影院| 欧美人与z0zoxxxx视频| 国产精品亚洲一区二区三区在线 | 2021中文字幕一区亚洲| 播五月开心婷婷综合| 午夜久久久久久| 久久精品视频一区二区三区| 99久久精品国产毛片| 日本三级韩国三级欧美三级| 中文字幕成人网| 7777精品久久久大香线蕉| 国产激情偷乱视频一区二区三区| 一区二区免费看| 久久伊人蜜桃av一区二区| 欧美午夜一区二区三区| 国产精品亚洲人在线观看| 亚洲高清在线视频| 成人欧美一区二区三区黑人麻豆 | 精品亚洲国内自在自线福利| 亚洲精品国产无天堂网2021| 久久久九九九九| 欧美一区二区三区电影| 在线中文字幕一区二区| 波多野结衣精品在线| 国产精品影视网| 麻豆精品在线观看| 日韩av网站免费在线| 一区二区三区av电影| 国产精品久久久久久久岛一牛影视| 在线播放亚洲一区| 欧美亚洲一区二区在线观看| 成人午夜激情片| 国产精品1024| 日韩1区2区日韩1区2区| 午夜一区二区三区视频| 亚洲免费观看高清完整| 国产日产欧美一区| 久久久久久一级片| 精品国产1区二区| 日韩欧美在线1卡| 欧美片在线播放| 欧美麻豆精品久久久久久| 欧美性猛交xxxx乱大交退制版| 色婷婷亚洲婷婷| 欧美午夜精品久久久久久孕妇| 91蝌蚪国产九色| 欧洲亚洲国产日韩| 在线观看三级视频欧美| 粉嫩绯色av一区二区在线观看 | 亚洲欧洲精品一区二区三区| 欧美一激情一区二区三区| 欧美男同性恋视频网站| 欧美日韩一区二区三区四区| 91激情五月电影| 欧美吞精做爰啪啪高潮| 欧美三级中文字幕在线观看| 欧美性一区二区| 91精品午夜视频| 久久综合色婷婷| 中文字幕不卡在线播放| 一区二区三区免费网站| 性久久久久久久久| 日本aⅴ精品一区二区三区| 久久国产综合精品| 国产激情视频一区二区三区欧美| 成人免费视频一区| 在线视频国内自拍亚洲视频| 欧美色图一区二区三区| 欧美福利视频一区| 久久综合九色综合欧美就去吻| 精品黑人一区二区三区久久 | 欧美区在线观看| 日韩精品一区二区三区swag| 久久一区二区视频| 亚洲美女精品一区| 精品一区二区三区在线观看国产| 成人h动漫精品一区二区| 欧美色精品天天在线观看视频| 欧美一卡二卡三卡| 自拍偷自拍亚洲精品播放| 天天影视网天天综合色在线播放| 狠狠色狠狠色合久久伊人| 一本久道中文字幕精品亚洲嫩| 91超碰这里只有精品国产| 国产精品美女久久久久久久久 | 国产aⅴ综合色| 欧美亚洲国产一区二区三区 | 国产成人免费视频一区| 成人开心网精品视频| 91精品国产综合久久久蜜臀图片| 精品国产伦一区二区三区免费| 亚洲婷婷综合色高清在线| 日韩高清电影一区| 色综合av在线|