1 ------------------------------------------------------------------------------- 2 -- File : AxiWritePathFifo.vhd 3 -- Company : SLAC National Accelerator Laboratory 4 -- Created : 2014-04-25 5 -- Last update: 2014-05-01 6 ------------------------------------------------------------------------------- 8 -- FIFO for AXI write path transactions. 9 ------------------------------------------------------------------------------- 10 -- This file is part of 'SLAC Firmware Standard Library'. 11 -- It is subject to the license terms in the LICENSE.txt file found in the 12 -- top-level directory of this distribution and at: 13 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. 14 -- No part of 'SLAC Firmware Standard Library', including this file, 15 -- may be copied, modified, propagated, or distributed except according to 16 -- the terms contained in the LICENSE.txt file. 17 ------------------------------------------------------------------------------- 20 use ieee.std_logic_1164.
all;
21 use ieee.std_logic_unsigned.
all;
22 use ieee.std_logic_arith.
all;
32 -- General Configurations 35 -- General FIFO configurations 48 LOCK_FIXED_EN_G : := false;
52 -- Address FIFO Config 63 -- Response FIFO Config 99 constant RESP_BITS_C : := 2;
102 BURST_BITS_C + LOCK_BITS_C + PROT_BITS_C + CACHE_BITS_C;
104 constant DATA_FIFO_SIZE_C : := 1 + DATA_BITS_C + STRB_BITS_C + ID_BITS_C;
106 constant RESP_FIFO_SIZE_C : := RESP_BITS_C + ID_BITS_C;
108 -- Convert address record to slv 110 variable retValue : slv(ADDR_FIFO_SIZE_C-1 downto 0);
128 retValue((SIZE_BITS_C+i)-1 downto i) := din.awsize(SIZE_BITS_C-1 downto 0);
129 i := i + SIZE_BITS_C;
133 retValue((BURST_BITS_C+i)-1 downto i) := din.awburst(BURST_BITS_C-1 downto 0);
134 i := i + BURST_BITS_C;
138 retValue((LOCK_BITS_C+i)-1 downto i) := din.awlock(LOCK_BITS_C-1 downto 0);
139 i := i + LOCK_BITS_C;
143 retValue((PROT_BITS_C+i)-1 downto i) := din.awprot(PROT_BITS_C-1 downto 0);
144 i := i + PROT_BITS_C;
148 retValue((CACHE_BITS_C+i)-1 downto i) := din.awcache(CACHE_BITS_C-1 downto 0);
149 i := i + CACHE_BITS_C;
156 -- Convert slv to address record 157 -
procedure slvToAddr (din :
in slv(ADDR_FIFO_SIZE_C1
downto 0);
167 master.awaddr := (others=>'0');
174 master.awid := (others=>'0');
182 master.awlen := (others=>'0');
190 master.awsize := (others=>'0');
191 master.awsize(SIZE_BITS_C-1 downto 0) := din((SIZE_BITS_C+i)-1 downto i);
192 i := i + SIZE_BITS_C;
198 master.awburst := (others=>'0');
199 master.awburst(BURST_BITS_C-1 downto 0) := din((BURST_BITS_C+i)-1 downto i);
200 i := i + BURST_BITS_C;
206 master.awlock := (others=>'0');
207 master.awlock(LOCK_BITS_C-1 downto 0) := din((LOCK_BITS_C+i)-1 downto i);
208 i := i + LOCK_BITS_C;
212 master.awprot := (others=>'0');
215 master.awprot(PROT_BITS_C-1 downto 0) := din((PROT_BITS_C+i)-1 downto i);
216 i := i + PROT_BITS_C;
220 master.awcache := (others=>'0');
223 master.awcache(CACHE_BITS_C-1 downto 0) := din((CACHE_BITS_C+i)-1 downto i);
224 i := i + CACHE_BITS_C;
229 -- Convert data record to slv 231 variable retValue : slv(DATA_FIFO_SIZE_C-1 downto 0);
235 retValue(0) := din.wlast;
238 retValue((DATA_BITS_C+i)-1 downto i) := din.wdata(DATA_BITS_C-1 downto 0);
239 i := i + DATA_BITS_C;
241 retValue((STRB_BITS_C+i)-1 downto i) := din.wstrb(STRB_BITS_C-1 downto 0);
242 i := i + STRB_BITS_C;
253 -- Convert slv to data record 254 -
procedure slvToData (din :
in slv(DATA_FIFO_SIZE_C1
downto 0);
263 master.wlast := din(0);
266 master.wdata := (others=>'0');
267 master.wdata(DATA_BITS_C-1 downto 0) := din((DATA_BITS_C+i)-1 downto i);
268 i := i + DATA_BITS_C;
270 master.wstrb := (others=>'0');
271 master.wstrb(STRB_BITS_C-1 downto 0) := din((STRB_BITS_C+i)-1 downto i);
272 i := i + STRB_BITS_C;
277 master.wid := (others=>'0');
284 -- Convert resp record to slv 286 variable retValue : slv(RESP_FIFO_SIZE_C-1 downto 0);
290 retValue(RESP_BITS_C-1 downto 0) := din.bresp;
302 -- Convert slv to resp record 303 -
procedure slvToResp (din :
in slv(RESP_FIFO_SIZE_C1
downto 0);
313 slave.bresp := din(RESP_BITS_C-1 downto 0);
319 slave.bid := (others=>'0');
326 signal addrFifoWrite : sl;
327 signal addrFifoDin : slv(ADDR_FIFO_SIZE_C-1 downto 0);
328 signal addrFifoDout : slv(ADDR_FIFO_SIZE_C-1 downto 0);
329 signal addrFifoValid : sl;
330 signal addrFifoAFull : sl;
331 signal addrFifoRead : sl;
332 signal dataFifoWrite : sl;
333 signal dataFifoDin : slv(DATA_FIFO_SIZE_C-1 downto 0);
334 signal dataFifoDout : slv(DATA_FIFO_SIZE_C-1 downto 0);
335 signal dataFifoValid : sl;
336 signal dataFifoAFull : sl;
337 signal dataFifoRead : sl;
338 signal respFifoWrite : sl;
339 signal respFifoDin : slv(RESP_FIFO_SIZE_C-1 downto 0);
340 signal respFifoDout : slv(RESP_FIFO_SIZE_C-1 downto 0);
341 signal respFifoValid : sl;
342 signal respFifoAFull : sl;
343 signal respFifoRead : sl;
347 ------------------------- 349 ------------------------- 376 wr_en => addrFifoWrite,
386 rd_en => addrFifoRead,
387 dout => addrFifoDout,
389 valid => addrFifoValid,
421 wr_en => dataFifoWrite,
431 rd_en => dataFifoRead,
432 dout => dataFifoDout,
434 valid => dataFifoValid,
466 wr_en => respFifoWrite,
476 rd_en => respFifoRead,
477 dout => respFifoDout,
479 valid => respFifoValid,
487 ------------------------- 489 ------------------------- 500 ------------------------- 502 ------------------------- 507 ------------------------- 509 ------------------------- 512 addrFifoDout, addrFifoAFull, addrFifoValid,
513 dataFifoDout, dataFifoAFull, dataFifoValid,
514 respFifoDout, respFifoAFull, respFifoValid )
is 524 slvToAddr(addrFifoDout, addrFifoValid, sAxiWriteMaster, imAxiWriteMaster);
525 slvToData(dataFifoDout, dataFifoValid, sAxiWriteMaster, imAxiWriteMaster);
526 slvToResp(respFifoDout, respFifoValid, sAxiWriteMaster, isAxiWriteSlave);
528 isAxiWriteSlave.awready := not addrFifoAFull;
529 isAxiWriteSlave.wready := not dataFifoAFull;
530 imAxiWriteMaster.bready := not respFifoAFull;
AxiWriteSlaveType :=(awready => '0',wready => '0',bresp =>( others => '0'),bvalid => '0',bid =>( others => '0')) AXI_WRITE_SLAVE_INIT_C
ALTERA_RAM_Gstring := "M9K"
out doutslv( DATA_WIDTH_G- 1 downto 0)
RESP_FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
DATA_BRAM_EN_Gboolean := true
XIL_DEVICE_Gstring := "7SERIES"
out sAxiWriteSlaveAxiWriteSlaveType
RESP_CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
ADDR_CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
RST_ASYNC_Gboolean := false
ALTERA_RAM_Gstring := "M9K"
slv( 1023 downto 0) wdata
in dinslv( DATA_WIDTH_G- 1 downto 0)
PROT_FIXED_EN_Gboolean := false
LOCK_FIXED_EN_Gboolean := false
AXI_CONFIG_GAxiConfigType := AXI_CONFIG_INIT_C
ADDR_BRAM_EN_Gboolean := true
EMPTY_THRES_Ginteger range 1 to ( 2** 24):= 1
ALTERA_SYN_Gboolean := false
DATA_CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
positive range 12 to 64 ADDR_WIDTH_C
FULL_THRES_Ginteger range 1 to ( 2** 24):= 1
LEN_FIXED_EN_Gboolean := false
SYNC_STAGES_Ginteger range 3 to ( 2** 24):= 3
ALTERA_SYN_Gboolean := false
in mAxiWriteSlaveAxiWriteSlaveType
GEN_SYNC_FIFO_Gboolean := false
ADDR_FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9
SIZE_FIXED_EN_Gboolean := false
DATA_FIFO_PAUSE_THRESH_Ginteger range 1 to ( 2** 24):= 500
RESP_BRAM_EN_Gboolean := true
ADDR_LSB_Gnatural range 0 to 31:= 0
GEN_SYNC_FIFO_Gboolean := false
USE_BUILT_IN_Gboolean := false
CACHE_FIXED_EN_Gboolean := false
positive range 1 to 128 DATA_BYTES_C
USE_DSP48_Gstring := "no"
LAST_STAGE_ASYNC_Gboolean := true
ADDR_WIDTH_Ginteger range 4 to 48:= 4
XIL_DEVICE_Gstring := "7SERIES"
USE_BUILT_IN_Gboolean := false
FWFT_EN_Gboolean := false
DATA_WIDTH_Ginteger range 1 to ( 2** 24):= 16
CASCADE_SIZE_Ginteger range 1 to ( 2** 24):= 1
BURST_FIXED_EN_Gboolean := false
AxiConfigType :=axiConfig(ADDR_WIDTH_C => 32,DATA_BYTES_C => 4,ID_BITS_C => 12,LEN_BITS_C => 4) AXI_CONFIG_INIT_C
positive range 1 to 32 ID_BITS_C
out wr_data_countslv( ADDR_WIDTH_G- 1 downto 0)
ID_FIXED_EN_Gboolean := false
AxiWriteMasterType :=(awvalid => '0',awaddr =>( others => '0'),awid =>( others => '0'),awlen =>( others => '0'),awsize =>( others => '0'),awburst =>( others => '0'),awlock =>( others => '0'),awprot =>( others => '0'),awcache =>( others => '0'),awqos =>( others => '0'),awregion =>( others => '0'),wdata =>( others => '0'),wlast => '0',wvalid => '0',wid =>( others => '0'),wstrb =>( others => '0'),bready => '0') AXI_WRITE_MASTER_INIT_C
in sAxiWriteMasterAxiWriteMasterType
out mAxiWriteMasterAxiWriteMasterType
natural range 0 to 8 LEN_BITS_C
out rd_data_countslv( ADDR_WIDTH_G- 1 downto 0)
DATA_FIFO_ADDR_WIDTH_Ginteger range 4 to 48:= 9