SURF  1.0
AxiStreamDmaV2.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : AxiStreamDmaV2.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2017-02-02
5 -- Last update: 2017-02-02
6 -------------------------------------------------------------------------------
7 -- Description:
8 -- Generic AXI Stream DMA block for frame at a time transfers.
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 -------------------------------------------------------------------------------
18 
19 library ieee;
20 use ieee.std_logic_1164.all;
21 use ieee.std_logic_arith.all;
22 use ieee.std_logic_unsigned.all;
23 
24 use work.StdRtlPkg.all;
25 use work.AxiStreamPkg.all;
26 use work.AxiLitePkg.all;
27 use work.AxiPkg.all;
28 use work.AxiDmaPkg.all;
29 
30 --! @see entity
31  --! @ingroup axi
32 entity AxiStreamDmaV2 is
33  generic (
34  TPD_G : time := 1 ns;
35  DESC_AWIDTH_G : integer range 4 to 12 := 12;
36  AXIL_BASE_ADDR_G : slv(31 downto 0) := x"00000000";
38  AXI_READY_EN_G : boolean := false;
39  AXIS_READY_EN_G : boolean := false;
43  CHAN_COUNT_G : integer range 1 to 16 := 1;
44  BURST_BYTES_G : integer range 1 to 4096 := 4096;
45  RD_PIPE_STAGES_G : natural := 1;
46  RD_PEND_THRESH_G : natural := 0); -- In units of bytes
47  port (
48  -- Clock/Reset
49  axiClk : in sl;
50  axiRst : in sl;
51  -- Register Access & Interrupt
56  interrupt : out sl;
57  online : out slv(CHAN_COUNT_G-1 downto 0);
58  acknowledge : out slv(CHAN_COUNT_G-1 downto 0);
59  -- AXI Stream Interface
65  -- AXI Interfaces, 0 = Desc, 1-CHAN_COUNT_G = DMA
71 end AxiStreamDmaV2;
72 
73 architecture structure of AxiStreamDmaV2 is
74 
78  signal dmaWrDescRetAck : slv(CHAN_COUNT_G-1 downto 0);
79 
81  signal dmaRdDescAck : slv(CHAN_COUNT_G-1 downto 0);
83  signal dmaRdDescRetAck : slv(CHAN_COUNT_G-1 downto 0);
84 
85  signal axiCache : slv(3 downto 0);
86 
87 begin
88 
89  U_DmaDesc: entity work.AxiStreamDmaV2Desc
90  generic map (
91  TPD_G => TPD_G,
98  ACK_WAIT_BVALID_G => true)
99  port map (
100  -- Clock/Reset
101  axiClk => axiClk,
102  axiRst => axiRst,
107  interrupt => interrupt,
108  online => online,
118  axiCache => axiCache,
121  axiWriteCtrl => axiWriteCtrl(0));
122 
123  -- Read channel 0 unused.
125 
126  U_ChanGen: for i in 0 to CHAN_COUNT_G-1 generate
127 
128  U_DmaRead: entity work.AxiStreamDmaV2Read
129  generic map (
130  TPD_G => TPD_G,
137  port map (
138  axiClk => axiClk,
139  axiRst => axiRst,
144  dmaRdIdle => open,
145  axiCache => axiCache,
146  -- Streaming Interface
147  axisMaster => mAxisMaster(i),
148  axisSlave => mAxisSlave(i),
149  axisCtrl => mAxisCtrl(i),
151  axiReadSlave => axiReadSlave(i+1));
152 
153  U_DmaWrite: entity work.AxiStreamDmaV2Write
154  generic map (
155  TPD_G => TPD_G,
160  ACK_WAIT_BVALID_G => true)
161  port map (
162  axiClk => axiClk,
163  axiRst => axiRst,
168  dmaWrIdle => open,
169  axiCache => axiCache,
170  axisMaster => sAxisMaster(i),
171  axisSlave => sAxisSlave(i),
174  axiWriteCtrl => axiWriteCtrl(i+1));
175  end generate;
176 
177 end structure;
178 
in axiWriteCtrlAxiCtrlType := AXI_CTRL_UNUSED_C
out dmaRdDescRetAxiReadDmaDescRetType
out dmaRdDescReqAxiReadDmaDescReqArray( CHAN_COUNT_G- 1 downto 0)
array(natural range <> ) of AxiStreamSlaveType AxiStreamSlaveArray
AxiReadMasterType :=(arvalid => '0',araddr =>( others => '0'),arid =>( others => '0'),arlen =>( others => '0'),arsize =>( others => '0'),arburst =>( others => '0'),arlock =>( others => '0'),arprot =>( others => '0'),arcache =>( others => '0'),arqos =>( others => '0'),arregion =>( others => '0'),rready => '0') AXI_READ_MASTER_INIT_C
Definition: AxiPkg.vhd:49
out dmaRdDescRetAckslv( CHAN_COUNT_G- 1 downto 0)
array(natural range <> ) of AxiReadSlaveType AxiReadSlaveArray
Definition: AxiPkg.vhd:89
AxiReadDmaDescRetArray( CHAN_COUNT_G- 1 downto 0) dmaRdDescRet
AXI_CONFIG_GAxiConfigType := AXI_CONFIG_INIT_C
out dmaWrDescRetAckslv( CHAN_COUNT_G- 1 downto 0)
AXI_READY_EN_Gboolean := false
array(natural range <> ) of AxiWriteDmaDescReqType AxiWriteDmaDescReqArray
Definition: AxiDmaPkg.vhd:168
in axiWriteCtrlAxiCtrlArray( CHAN_COUNT_G downto 0)
array(natural range <> ) of AxiReadDmaDescRetType AxiReadDmaDescRetArray
Definition: AxiDmaPkg.vhd:336
out axiReadMasterAxiReadMasterArray( CHAN_COUNT_G downto 0)
AXI_DESC_CONFIG_GAxiConfigType := AXI_CONFIG_INIT_C
in dmaRdDescReqAxiReadDmaDescReqType
in axisSlaveAxiStreamSlaveType
array(natural range <> ) of AxiReadDmaDescReqType AxiReadDmaDescReqArray
Definition: AxiDmaPkg.vhd:312
AxiLiteWriteMasterType
Definition: AxiLitePkg.vhd:111
std_logic sl
Definition: StdRtlPkg.vhd:28
out axiWriteMasterAxiWriteMasterArray( CHAN_COUNT_G downto 0)
array(natural range <> ) of AxiWriteDmaDescAckType AxiWriteDmaDescAckArray
Definition: AxiDmaPkg.vhd:200
AXIS_READY_EN_Gboolean := false
in axisMasterAxiStreamMasterType
AxiWriteDmaDescReqArray( CHAN_COUNT_G- 1 downto 0) dmaWrDescReq
out onlineslv( CHAN_COUNT_G- 1 downto 0)
in mAxisSlaveAxiStreamSlaveArray( CHAN_COUNT_G- 1 downto 0)
in axilWriteMasterAxiLiteWriteMasterType
out dmaWrDescRetAxiWriteDmaDescRetType
out dmaWrDescAckAxiWriteDmaDescAckArray( CHAN_COUNT_G- 1 downto 0)
RD_PEND_THRESH_Gnatural := 0
in axiWriteSlaveAxiWriteSlaveType
CHAN_COUNT_Ginteger range 1 to 16:= 1
ACK_WAIT_BVALID_Gboolean := true
out acknowledgeslv( CHAN_COUNT_G- 1 downto 0)
in axiWriteSlaveAxiWriteSlaveType
AxiReadDmaDescReqArray( CHAN_COUNT_G- 1 downto 0) dmaRdDescReq
slv( CHAN_COUNT_G- 1 downto 0) dmaWrDescRetAck
BURST_BYTES_Ginteger range 1 to 4096:= 4096
AXI_CONFIG_GAxiConfigType := AXI_CONFIG_INIT_C
in axilReadMasterAxiLiteReadMasterType
BURST_BYTES_Ginteger range 1 to 4096:= 4096
slv( 3 downto 0) axiCache
in dmaWrDescRetAxiWriteDmaDescRetArray( CHAN_COUNT_G- 1 downto 0)
AxiWriteDmaDescRetArray( CHAN_COUNT_G- 1 downto 0) dmaWrDescRet
AXI_CONFIG_GAxiConfigType := AXI_CONFIG_INIT_C
in dmaRdDescRetAxiReadDmaDescRetArray( CHAN_COUNT_G- 1 downto 0)
array(natural range <> ) of AxiWriteDmaDescRetType AxiWriteDmaDescRetArray
Definition: AxiDmaPkg.vhd:236
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
in sAxisMasterAxiStreamMasterArray( CHAN_COUNT_G- 1 downto 0)
in axiWriteSlaveAxiWriteSlaveArray( CHAN_COUNT_G downto 0)
AXI_READY_EN_Gboolean := false
out mAxisMasterAxiStreamMasterArray( CHAN_COUNT_G- 1 downto 0)
out axiWriteMasterAxiWriteMasterType
out dmaWrDescReqAxiWriteDmaDescReqType
AxiLiteReadMasterType
Definition: AxiLitePkg.vhd:59
TPD_Gtime := 1 ns
in axilReadMasterAxiLiteReadMasterType
CHAN_COUNT_Ginteger range 1 to 16:= 1
in dmaWrDescAckAxiWriteDmaDescAckType
slv( CHAN_COUNT_G- 1 downto 0) dmaRdDescRetAck
out axilReadSlaveAxiLiteReadSlaveType
AxiConfigType
Definition: AxiPkg.vhd:213
out axisSlaveAxiStreamSlaveType
array(natural range <> ) of AxiStreamCtrlType AxiStreamCtrlArray
RD_PIPE_STAGES_Gnatural := 1
DESC_AWIDTH_Ginteger range 4 to 12:= 12
out axiReadMasterAxiReadMasterType
in dmaRdDescAckslv( CHAN_COUNT_G- 1 downto 0)
array(natural range <> ) of AxiStreamMasterType AxiStreamMasterArray
in axiCacheslv( 3 downto 0)
in axiCacheslv( 3 downto 0)
out axiCacheslv( 3 downto 0)
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_OK_C
in dmaWrDescReqAxiWriteDmaDescReqArray( CHAN_COUNT_G- 1 downto 0)
out axilWriteSlaveAxiLiteWriteSlaveType
array(natural range <> ) of AxiReadMasterType AxiReadMasterArray
Definition: AxiPkg.vhd:48
AxiStreamConfigType :=(TSTRB_EN_C => false,TDATA_BYTES_C => 16,TDEST_BITS_C => 4,TID_BITS_C => 0,TKEEP_MODE_C => TKEEP_NORMAL_C,TUSER_BITS_C => 4,TUSER_MODE_C => TUSER_NORMAL_C) AXI_STREAM_CONFIG_INIT_C
array(natural range <> ) of AxiWriteMasterType AxiWriteMasterArray
Definition: AxiPkg.vhd:130
AxiLiteReadSlaveType
Definition: AxiLitePkg.vhd:85
in axiWriteCtrlAxiCtrlType := AXI_CTRL_UNUSED_C
AXIL_BASE_ADDR_Gslv( 31 downto 0) := x"00000000"
in mAxisCtrlAxiStreamCtrlArray( CHAN_COUNT_G- 1 downto 0)
AXIS_READY_EN_Gboolean := false
out axilReadSlaveAxiLiteReadSlaveType
in axisCtrlAxiStreamCtrlType
in axiReadSlaveAxiReadSlaveType
out axisMasterAxiStreamMasterType
slv( 1 downto 0) := "00" AXI_RESP_OK_C
Definition: AxiLitePkg.vhd:31
AXI_READY_EN_Gboolean := false
slv( CHAN_COUNT_G- 1 downto 0) dmaRdDescAck
AxiWriteDmaDescAckArray( CHAN_COUNT_G- 1 downto 0) dmaWrDescAck
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
out sAxisSlaveAxiStreamSlaveArray( CHAN_COUNT_G- 1 downto 0)
AXI_ERROR_RESP_Gslv( 1 downto 0) := AXI_RESP_OK_C
array(natural range <> ) of AxiWriteSlaveType AxiWriteSlaveArray
Definition: AxiPkg.vhd:181
AXIL_BASE_ADDR_Gslv( 31 downto 0) := x"00000000"
out acknowledgeslv( CHAN_COUNT_G- 1 downto 0)
AxiConfigType :=axiConfig(ADDR_WIDTH_C => 32,DATA_BYTES_C => 4,ID_BITS_C => 12,LEN_BITS_C => 4) AXI_CONFIG_INIT_C
Definition: AxiPkg.vhd:227
in axilWriteMasterAxiLiteWriteMasterType
ACK_WAIT_BVALID_Gboolean := true
array(natural range <> ) of AxiCtrlType AxiCtrlArray
Definition: AxiPkg.vhd:202
AXIS_CONFIG_GAxiStreamConfigType := AXI_STREAM_CONFIG_INIT_C
DESC_AWIDTH_Ginteger range 4 to 12:= 12
in axiReadSlaveAxiReadSlaveArray( CHAN_COUNT_G downto 0)
out onlineslv( CHAN_COUNT_G- 1 downto 0)
std_logic_vector slv
Definition: StdRtlPkg.vhd:29
BURST_BYTES_Ginteger range 1 to 4096:= 4096
out axilWriteSlaveAxiLiteWriteSlaveType
out axiWriteMasterAxiWriteMasterType
AXI_DMA_CONFIG_GAxiConfigType := AXI_CONFIG_INIT_C