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

蟲蟲首頁| 資源下載| 資源專輯| 精品軟件
登錄| 注冊

您現在的位置是:蟲蟲下載站 > 資源下載 > 技術資料 > FPGA片內FIFO讀寫測試Verilog邏輯源碼Quartus工程文件+文檔說明 使用 FPGA

FPGA片內FIFO讀寫測試Verilog邏輯源碼Quartus工程文件+文檔說明 使用 FPGA

  • 資源大小:7356 K
  • 上傳時間: 2021-12-19
  • 上傳用戶:20125101110
  • 資源積分:2 下載積分
  • 標      簽: fpga fifo verilog quartus

資 源 簡 介

FPGA片內FIFO讀寫測試Verilog邏輯源碼Quartus工程文件+文檔說明,使用 FPGA 內部的 FIFO 以及程序對該 FIFO 的數據讀寫操作。FPGA型號Cyclone4E系列中的EP4CE6F17C8,Quartus版本17.1。

timescale 1ns / 1ps

//////////////////////////////////////////////////////////////////////////////////

module fifo_test(

input clk,           //50MHz時鐘

input rst_n              //復位信號,低電平有效

);


//-----------------------------------------------------------

localparam      W_IDLE      = 1;

localparam      W_FIFO     = 2; 

localparam      R_IDLE      = 1;

localparam      R_FIFO     = 2; 


reg[2:0]  write_state;

reg[2:0]  next_write_state;

reg[2:0]  read_state;

reg[2:0]  next_read_state;


reg[15:0] w_data;    //FIFO寫數據

wire      wr_en;    //FIFO寫使能

wire      rd_en;    //FIFO讀使能

wire[15:0] r_data; //FIFO讀數據

wire       full;  //FIFO滿信號 

wire       empty;  //FIFO空信號 

wire[8:0]  rd_data_count; 

wire[8:0]  wr_data_count; 


///產生FIFO寫入的數據

always@(posedge clk or negedge rst_n)

begin

if(rst_n == 1'b0)

write_state <= W_IDLE;

else

write_state <= next_write_state;

end


always@(*)

begin

case(write_state)

W_IDLE:

if(empty == 1'b1)               //FIFO空, 開始寫FIFO

next_write_state <= W_FIFO;

else

next_write_state <= W_IDLE;

W_FIFO:

if(full == 1'b1)                //FIFO滿

next_write_state <= W_IDLE;

else

next_write_state <= W_FIFO;

default:

next_write_state <= W_IDLE;

endcase

end


assign wr_en = (next_write_state == W_FIFO) ? 1'b1 : 1'b0; 


always@(posedge clk or negedge rst_n)

begin

if(rst_n == 1'b0)

w_data <= 16'd0;

else

   if (wr_en == 1'b1)

    w_data <= w_data + 1'b1;

else

          w_data <= 16'd0;

end




///產生FIFO讀的數據

always@(posedge clk or negedge rst_n)

begin

if(rst_n == 1'b0)

read_state <= R_IDLE;

else

read_state <= next_read_state;

end


always@(*)

begin

case(read_state)

R_IDLE:

if(full == 1'b1)               //FIFO滿, 開始讀FIFO

next_read_state <= R_FIFO;

else

next_read_state <= R_IDLE;

R_FIFO:

if(empty == 1'b1)   

FPGA片內FIFO讀寫測試Verilog邏輯源碼Quartus工程文件+文檔說明 使用 FPGA FPGA片內FIFO讀寫測試Verilog邏輯源碼Quartus工程文件+文檔說明 使用 FPGA


相 關 資 源

您 可 能 感 興 趣 的

主站蜘蛛池模板: 榕江县| 阿拉尔市| 宜章县| 新建县| 尉犁县| 景泰县| 秦皇岛市| 秦安县| 咸阳市| 库车县| 澎湖县| 清流县| 永川市| 玛纳斯县| 涿州市| 延津县| 三亚市| 连平县| 偃师市| 平原县| 威海市| 京山县| 曲周县| 洛川县| 九台市| 寿阳县| 长泰县| 汽车| 武川县| 宣汉县| 当雄县| 饶阳县| 广宁县| 琼海市| 广平县| 石嘴山市| 桃园县| 高台县| 岳西县| 全椒县| 泸西县|