|
发表于 2012-10-18 16:34:26
|
显示全部楼层
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
emif_dsp_fpga emif_dsp_fpga
(
.clk (clk),
.rst_n (rst_n),
// emif_dsp_fpga
.addr (addr),
.emif_aoe_n (emif_aoe_n),
.emif_ardy (emif_ardy),
.emif_are_n (emif_are_n),
.emif_awe_n (emif_awe_n),
.emif_be_n (emif_be_n),
.emif_ce2_n (emif_ce2_n),
.emif_ce3_n (emif_ce3_n),
.emif_ea (emif_ea),
.emif_ed (emif_ed),
.hwa_ce (ce),
.hwa_rdata (rdata),
.rx_dat (rx_dat),
.rx_dav (rx_dav),
.rx_dma_evrq (rx_dma_evrq),
.rx_ena (rx_ena),
.rx_eop (rx_eop),
.rx_err (rx_err),
.rx_full (rx_full),
.rx_sop (rx_sop),
.rx_val (rx_val),
.soft_reset (soft_reset),
.tx_adr (tx_adr),
.tx_dat (tx_dat),
.tx_dav (tx_dav),
.tx_dma_evrq (tx_dma_evrq),
.tx_ena (tx_ena),
.tx_eop (tx_eop),
.tx_full (tx_full),
.tx_sop (tx_sop),
.wdata (wdata),
.write (write),
);
//------------------------------------------------------------
// Instantiate Transmit FIFO
//-------------------------------------------------------------
wire [31:0] master_sink_dat;
wire master_sink_ena;
wire master_sink_dav;
wire master_sink_sop;
atlantic_fifo #(DEVICE, 32, 32, 32, 2, 4, 2048, 11, 16, 1024)
tx_fifo (
.rst_n (rst_n & ~soft_reset),
// Write port
.clk_wr (clk),
.wr_ena (tx_ena),
.wr_sop (tx_sop),
.wr_eop (tx_eop),
.wr_err (1'b0),
.wr_dat (tx_dat),
.wr_adr (tx_adr),
.wr_mty (2'b0),
.wr_dav (tx_dav),
.wr_full (tx_full),
// Read port
.clk_rd (clk),
.rd_ena (master_sink_ena),
.rd_dav (master_sink_dav),
.rd_val (),
.rd_sop (master_sink_sop),
.rd_eop (),
.rd_err (),
.rd_dat (master_sink_dat),
.rd_adr (),
.rd_mty ()
);
//---------------------------------------------------------------------------
XXXXXXXX 添加FPGA 自己的程序
//---------------------------------------------------------------------------
// Instantiate Receive FIFO
//---------------------------------------------------------------------------
atlantic_fifo #(DEVICE, 32, 32, 32, 2, 4, 2048, 11, 1024, 16)
rx_fifo (
.rst_n (rst_n & ~soft_reset),
// Write port
.clk_wr (clk),
.wr_ena (master_source_ena),
.wr_sop (master_source_sop),
.wr_eop (master_source_eop),
.wr_err (1'b0),
.wr_dat (xxxx1, xxxx2),
.wr_adr (0),
.wr_mty (0),
.wr_dav (master_source_dav),
.wr_full (rx_full),
// Read port
.clk_rd (clk),
.rd_ena (rx_ena),
.rd_dav (rx_dav),
.rd_val (rx_val),
.rd_sop (rx_sop),
.rd_eop (rx_eop),
.rd_err (rx_err),
.rd_dat (rx_dat),
.rd_adr (),
.rd_mty ()
);
endmodule // emif_dsp_fpga
input clk;
input rst_n;
output soft_reset;
// Asynch EMIF
input [21:2] emif_ea; // address
input emif_ce3_n; // chip enable 3 (co-processor/atlantic)
input emif_ce2_n; // chip enable 2 (avalon peripheral)
input [3:0] emif_be_n; // byte enable
input emif_aoe_n; // async output enable
input emif_are_n; // async read enable
input emif_awe_n; // async write enable
output emif_ardy; // Data ready
inout [31:0] emif_ed; // data
// DMA event requests
output tx_dma_evrq; // transmit
output rx_dma_evrq; // receive
// Accelerator control path
output [21:2] addr; // address
output [31:0] wdata; // write data
output hwa_ce; // chip enable
output write; // write strobe
input [31:0] hwa_rdata; // read data
// Atlantic transmit (master source)
input tx_dav; // data available
output tx_ena; // enable
output [31:0] tx_dat; // data
output [3:0] tx_adr; // address
output tx_eop; // end of packet
output tx_sop; // start of packet
// Atlantic Master Sink
output rx_ena; // enable
input [31:0] rx_dat; // data
input rx_eop; // end of packet
input rx_sop; // start of packet
input rx_err; // error
input rx_dav; // data available
input rx_val;
// status
input tx_full;
input rx_full;
// Avalon master port
output [21:0] av_address;
input [31:0] av_data_in;
output [31:0] av_data_out;
output av_read_n;
output av_write_n;
input av_wait; |
|