-
Notifications
You must be signed in to change notification settings - Fork 98
Implement AxiStreamFrameBuffer #1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
burbschat
wants to merge
24
commits into
slaclab:pre-release
Choose a base branch
from
burbschat:axiStreamFrameBuffer
base: pre-release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
bee9b16
First draft of axi-stream frame buffer
burbschat f930d77
Add basic testbed for axiStreamFrameBuffer
burbschat 7e95622
Simulate (with tb) and fix axiStreamFrameBuffer
burbschat 03be05f
Simulate axiStreamFrameBuffer with async clocks
burbschat a3b3362
Allow disabling of safe buffering (less resources)
burbschat 05904a7
Resolve some TODOs and add further notes
burbschat c31eece
Cleanup some comments and formatting
burbschat 1096609
Fix missing dataFrameRxDone strobe reset
burbschat 32f7d00
Fix not supported generate else syntax
burbschat 3cb150e
Add rogue device class for axiStreamFrameBuffer
burbschat 9e838c7
Switch to oneshot synchronizer for trigger
burbschat 4c0f5a0
Use surf, not work library for synchronizers
burbschat 6efb041
Properly resolve synchronizer issues
burbschat fc59cf9
Fix wrong clock options for AxiStreamFrameBufferTb
burbschat 6f30086
Add cocotb test for AxiStreamFrameBuffer
burbschat 59f5424
Remove todo comment
burbschat 9b0abef
Add some more notes describing functionality
burbschat 689a091
Use shiftwidth 4 -> 3 for AxiStreamFrameBufferTb
burbschat 68d889d
Add comment on empty buffer edge case
burbschat 4fa18d6
Remove remaining TODO comments
burbschat 7aeec8b
Fix wrong clock for axil->data synchronizer
burbschat 4a721b7
Fix data process returning to idle too early
burbschat c6ccde7
Fix wrong reset signal in IP integrator wrapper
burbschat eff7018
Modify tests to cover async/sync safe/unsafe buffs
burbschat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
189 changes: 189 additions & 0 deletions
189
axi/axi-stream/ip_integrator/AxiStreamFrameBufferIpIntegrator.vhd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| ------------------------------------------------------------------------------- | ||
| -- Company : SLAC National Accelerator Laboratory | ||
| ------------------------------------------------------------------------------- | ||
| -- Description: IP Integrator Wrapper for surf.AxiStreamFrameBuffer | ||
| ------------------------------------------------------------------------------- | ||
| -- This file is part of 'SLAC Firmware Standard Library'. | ||
| -- It is subject to the license terms in the LICENSE.txt file found in the | ||
| -- top-level directory of this distribution and at: | ||
| -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. | ||
| -- No part of 'SLAC Firmware Standard Library', including this file, | ||
| -- may be copied, modified, propagated, or distributed except according to | ||
| -- the terms contained in the LICENSE.txt file. | ||
| ------------------------------------------------------------------------------- | ||
|
|
||
| library ieee; | ||
| use ieee.std_logic_1164.all; | ||
|
|
||
| library surf; | ||
| use surf.StdRtlPkg.all; | ||
| use surf.AxiLitePkg.all; | ||
| use surf.AxiStreamPkg.all; | ||
| use surf.SsiPkg.all; | ||
|
|
||
| entity AxiStreamFrameBufferIpIntegrator is | ||
| generic ( | ||
| TPD_G : time := 1 ns); | ||
| port ( | ||
| dataClk : in sl; | ||
| dataRst : in sl := '0'; | ||
| dataValid : in sl := '1'; | ||
| dataValue : in slv(15 downto 0); | ||
| dataFrameTxLast : in sl := '0'; | ||
| dataFrameRxDone : out sl := '0'; | ||
| dataRdTrig : in sl; | ||
| axilClk : in sl; | ||
| axilRst : in sl; | ||
| axilRdTrig : in sl; | ||
| axisClk : in sl; | ||
| axisRst : in sl; | ||
| S_AXI_AWADDR : in slv(7 downto 0); | ||
| S_AXI_AWPROT : in slv(2 downto 0); | ||
| S_AXI_AWVALID : in sl; | ||
| S_AXI_AWREADY : out sl; | ||
| S_AXI_WDATA : in slv(31 downto 0); | ||
| S_AXI_WSTRB : in slv(3 downto 0); | ||
| S_AXI_WVALID : in sl; | ||
| S_AXI_WREADY : out sl; | ||
| S_AXI_BRESP : out slv(1 downto 0); | ||
| S_AXI_BVALID : out sl; | ||
| S_AXI_BREADY : in sl; | ||
| S_AXI_ARADDR : in slv(7 downto 0); | ||
| S_AXI_ARPROT : in slv(2 downto 0); | ||
| S_AXI_ARVALID : in sl; | ||
| S_AXI_ARREADY : out sl; | ||
| S_AXI_RDATA : out slv(31 downto 0); | ||
| S_AXI_RRESP : out slv(1 downto 0); | ||
| S_AXI_RVALID : out sl; | ||
| S_AXI_RREADY : in sl; | ||
| M_AXIS_TVALID : out sl; | ||
| M_AXIS_TDATA : out slv(15 downto 0); | ||
| M_AXIS_TKEEP : out slv(1 downto 0); | ||
| M_AXIS_TLAST : out sl; | ||
| M_AXIS_TDEST : out slv(0 downto 0); | ||
| M_AXIS_TID : out slv(0 downto 0); | ||
| M_AXIS_TUSER : out slv(1 downto 0); | ||
| M_AXIS_TREADY : in sl); | ||
| end entity AxiStreamFrameBufferIpIntegrator; | ||
|
|
||
| architecture rtl of AxiStreamFrameBufferIpIntegrator is | ||
|
|
||
| constant AXIS_CONFIG_C : AxiStreamConfigType := ssiAxiStreamConfig( | ||
| dataBytes => 2, | ||
| tDestBits => 1, | ||
| tUserBits => 2, | ||
| tIdBits => 1); | ||
|
|
||
| signal axilResetN : sl := '1'; | ||
| signal axisResetN : sl := '1'; | ||
| signal axilReadMaster : AxiLiteReadMasterType := AXI_LITE_READ_MASTER_INIT_C; | ||
| signal axilReadSlave : AxiLiteReadSlaveType := AXI_LITE_READ_SLAVE_INIT_C; | ||
| signal axilWriteMaster : AxiLiteWriteMasterType := AXI_LITE_WRITE_MASTER_INIT_C; | ||
| signal axilWriteSlave : AxiLiteWriteSlaveType := AXI_LITE_WRITE_SLAVE_INIT_C; | ||
| signal axisMaster : AxiStreamMasterType := AXI_STREAM_MASTER_INIT_C; | ||
| signal axisSlave : AxiStreamSlaveType := AXI_STREAM_SLAVE_INIT_C; | ||
|
|
||
| begin | ||
|
|
||
| --------------------------------------------------------------------------- | ||
| -- AXI-Lite and AXI-Stream shims | ||
| --------------------------------------------------------------------------- | ||
| axilResetN <= not axilRst; | ||
| axisResetN <= not axisRst; | ||
|
|
||
| U_AXIL : entity surf.SlaveAxiLiteIpIntegrator | ||
| generic map ( | ||
| EN_ERROR_RESP => true, | ||
| HAS_PROT => 1, | ||
| HAS_WSTRB => 1, | ||
| ADDR_WIDTH => 8) | ||
| port map ( | ||
| S_AXI_ACLK => axilClk, | ||
| S_AXI_ARESETN => axilResetN, | ||
| S_AXI_AWADDR => S_AXI_AWADDR, | ||
| S_AXI_AWPROT => S_AXI_AWPROT, | ||
| S_AXI_AWVALID => S_AXI_AWVALID, | ||
| S_AXI_AWREADY => S_AXI_AWREADY, | ||
| S_AXI_WDATA => S_AXI_WDATA, | ||
| S_AXI_WSTRB => S_AXI_WSTRB, | ||
| S_AXI_WVALID => S_AXI_WVALID, | ||
| S_AXI_WREADY => S_AXI_WREADY, | ||
| S_AXI_BRESP => S_AXI_BRESP, | ||
| S_AXI_BVALID => S_AXI_BVALID, | ||
| S_AXI_BREADY => S_AXI_BREADY, | ||
| S_AXI_ARADDR => S_AXI_ARADDR, | ||
| S_AXI_ARPROT => S_AXI_ARPROT, | ||
| S_AXI_ARVALID => S_AXI_ARVALID, | ||
| S_AXI_ARREADY => S_AXI_ARREADY, | ||
| S_AXI_RDATA => S_AXI_RDATA, | ||
| S_AXI_RRESP => S_AXI_RRESP, | ||
| S_AXI_RVALID => S_AXI_RVALID, | ||
| S_AXI_RREADY => S_AXI_RREADY, | ||
| axilClk => open, | ||
| axilRst => open, | ||
| axilReadMaster => axilReadMaster, | ||
| axilReadSlave => axilReadSlave, | ||
| axilWriteMaster => axilWriteMaster, | ||
| axilWriteSlave => axilWriteSlave); | ||
|
|
||
| U_M_AXIS : entity surf.MasterAxiStreamIpIntegrator | ||
| generic map ( | ||
| INTERFACENAME => "M_AXIS", | ||
| HAS_TLAST => 1, | ||
| HAS_TKEEP => 1, | ||
| HAS_TSTRB => 0, | ||
| HAS_TREADY => 1, | ||
| TUSER_WIDTH => 2, | ||
| TID_WIDTH => 1, | ||
| TDEST_WIDTH => 1, | ||
| TDATA_NUM_BYTES => 2) | ||
| port map ( | ||
| M_AXIS_ACLK => axisClk, | ||
| M_AXIS_ARESETN => axisResetN, | ||
| M_AXIS_TVALID => M_AXIS_TVALID, | ||
| M_AXIS_TDATA => M_AXIS_TDATA, | ||
| M_AXIS_TSTRB => open, | ||
| M_AXIS_TKEEP => M_AXIS_TKEEP, | ||
| M_AXIS_TLAST => M_AXIS_TLAST, | ||
| M_AXIS_TDEST => M_AXIS_TDEST, | ||
| M_AXIS_TID => M_AXIS_TID, | ||
| M_AXIS_TUSER => M_AXIS_TUSER, | ||
| M_AXIS_TREADY => M_AXIS_TREADY, | ||
| axisClk => open, | ||
| axisRst => open, | ||
| axisMaster => axisMaster, | ||
| axisSlave => axisSlave); | ||
|
|
||
| --------------------------------------------------------------------------- | ||
| -- DUT | ||
| --------------------------------------------------------------------------- | ||
| U_DUT : entity surf.AxiStreamFrameBuffer | ||
| generic map ( | ||
| TPD_G => TPD_G, | ||
| COMMON_CLK_G => true, | ||
| DATA_BYTES_G => 2, | ||
| RAM_ADDR_WIDTH_G => 4, | ||
| SAFE_BUFFS_G => true, | ||
| GEN_SYNC_FIFO_G => true, | ||
| AXI_STREAM_CONFIG_G => AXIS_CONFIG_C) | ||
| port map ( | ||
| dataClk => dataClk, | ||
| dataRst => dataRst, | ||
| dataValid => dataValid, | ||
| dataValue => dataValue, | ||
| dataFrameTxLast => dataFrameTxLast, | ||
| dataFrameRxDone => dataFrameRxDone, | ||
| dataRdTrig => dataRdTrig, | ||
| axilClk => axilClk, | ||
| axilRst => dataRst, | ||
| axilReadMaster => axilReadMaster, | ||
| axilReadSlave => axilReadSlave, | ||
| axilWriteMaster => axilWriteMaster, | ||
| axilWriteSlave => axilWriteSlave, | ||
| axilRdTrig => axilRdTrig, | ||
| axisClk => axisClk, | ||
| axisRst => axisRst, | ||
| axisMaster => axisMaster, | ||
| axisSlave => axisSlave); | ||
|
|
||
| end architecture rtl; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.