Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
355 commits
Select commit Hold shift + click to select a range
5850e63
add forgotten file
Jun 23, 2025
1cc3feb
Merge pull request #1367 from jsmonson/feature/loop_op
auphelia Jun 24, 2025
9da9b56
[FINNLoop] Update ipi stitching script and fix fetch weights clk assi…
auphelia Jun 24, 2025
6272ea4
[FINNLoop] Saving bd design before validation to allow for investigat…
auphelia Jun 24, 2025
51ef902
Merge branch 'feature/finnxsi_integration' into feature/loop_op
auphelia Jun 24, 2025
b022ca5
[FINNLoop] Adding exp cycles function from @jsmonson
auphelia Jun 25, 2025
7653487
move template replacement into mlo_max_iter if-statement
Jun 24, 2025
ad8e6ce
added the ability to create an adjacency_list of the original model b…
STFleming Jun 25, 2025
6abc5b4
[FINNLoop] Exposing clk and rst signals
auphelia Jun 25, 2025
761adfa
Merge pull request #1376 from Xilinx/feature/adj_list_lambda
auphelia Jun 25, 2025
ea1b238
Fix continuous combinatorial assignments.
preusser Jun 25, 2025
80ee883
Fixes in serving of memory image.
preusser Jun 25, 2025
cdc6022
Merge remote-tracking branch 'origin/feature/loop_op' into feature/lo…
preusser Jun 25, 2025
24c8413
[FINNLoop] Linting
auphelia Jun 25, 2025
52cb964
[FINNLoop] Update stitching script to connect components
auphelia Jun 25, 2025
b3329fc
[FINNLoop] Update stitching to expose interfaces
auphelia Jun 25, 2025
f063a8a
[FINNLoop] Add verilog and system verilog files from rtllib
auphelia Jun 25, 2025
212d30a
relocated and reorganize files, fix typo, add missing sources
Jun 25, 2025
cb05624
add a branching node and a dyn_matmul to testbench
Jun 25, 2025
708b49b
relocated and reorganize files, fix typo, add missing sources
Jun 25, 2025
a6763fb
Merge pull request #1378 from jsmonson/feature/updated_loop_tb
auphelia Jun 26, 2025
1bade7d
[Tests] Add duplicate streams to new loop test
auphelia Jun 26, 2025
305bc62
[Tests] Add name for dup strms layer and run cppsim steps
auphelia Jun 26, 2025
ff64113
[Tests] Add fifo node attribute
auphelia Jun 26, 2025
26646ca
Adding a test that makes a stitchedIP of the loop body
STFleming Jun 26, 2025
3b6c258
Added an extra make_model function to create a simpler MLO model with…
STFleming Jun 26, 2025
36222bf
Including .svh files for mlo sim object compliation
STFleming Jun 26, 2025
4e6f0ba
Including the .svh file the proper way
STFleming Jun 26, 2025
3d84223
[FINNLoop] Generate stream tap graph for branching structures
auphelia Jun 26, 2025
28133df
Sketching out model for AXIMM-backed loopback storage.
preusser Jun 27, 2025
65cc7c9
[FINNLoop] Switch out AND gate ip and deal with multiple paths to out…
auphelia Jun 27, 2025
b1d9629
[FINNLoop] Tie n_layers to mlo max iter
auphelia Jun 27, 2025
f0704dc
simulation object compiling
STFleming Jun 27, 2025
17d65e3
Trying to add a prehook function to initialise the aximm_ro_images
STFleming Jun 27, 2025
b63e1b1
[Tests/finnrtllib] Add synthesis to ip stitching and define aximm int…
auphelia Jun 27, 2025
da95916
Merge branch 'feature/loop_op' into feature/loop_op_xsi
STFleming Jun 30, 2025
e6855e2
[FINNLoop] Remove double edges from stream tap graph generation
auphelia Jun 30, 2025
67f2b23
[finn-rtllib] Associate interfaces with clk and rst in wrapper
auphelia Jun 30, 2025
96f3b4f
Attempting to fix thresholding dat file issue, and failing
STFleming Jun 30, 2025
983db27
Added a custom step to assign unique names
STFleming Jun 30, 2025
bf15120
Merge branch 'feature/loop_op_xsi' of github.com:Xilinx/finn into fea…
Jun 30, 2025
afc830b
Merge branch 'feature/loop_op_xsi' into feature/loop_op
auphelia Jul 1, 2025
3732028
Close to getting simulation started, current issue is incorrect dat f…
STFleming Jul 1, 2025
73e767c
Cleanup pdb"
STFleming Jul 1, 2025
adf6be0
minor fix
STFleming Jul 1, 2025
f0e8e5e
Passing SETS through correctly, well spotted @auphelia
STFleming Jul 1, 2025
c387247
Merge branch 'feature/loop_op_xsi' into feature/loop_op
auphelia Jul 1, 2025
6865a3b
Silly typo on the interface, watchdog now times out
STFleming Jul 1, 2025
0ada1d5
Starting to get the first MLO waveforms coming out
STFleming Jul 1, 2025
fb36967
Starting to automate the ro_image population from weight params
STFleming Jul 1, 2025
13e813b
Fixed issue with multidim numpy array being used for aximm ro_image
STFleming Jul 1, 2025
1e96f08
initial removal of idx_fs and idx_fe interfaces
Jul 1, 2025
174f73d
fully remove fetch start input interface
Jul 1, 2025
30b72e5
remove m_idx_out
Jul 1, 2025
bb901d4
fully remove m_idx_out
Jul 1, 2025
b840ab7
add input from stream tap
Jul 1, 2025
ab4aa52
modified code to trigger from start on FS
Jul 1, 2025
da2dcd7
RTL/IPI Fixes
Jul 1, 2025
75e2386
Merge branch 'feature/loop_op' into feature/loop_op_xsi
auphelia Jul 2, 2025
1e2bed0
Merge pull request #1383 from Xilinx/feature/loop_op_xsi
auphelia Jul 2, 2025
9f0417a
[MLOSim] Moved some of the MLO simulation utils into a separate module
STFleming Jul 2, 2025
9fd6aff
Merge remote-tracking branch 'origin/feature/loop_op_back' into featu…
STFleming Jul 2, 2025
67057a8
[MLOSim] Hooking in the aximm_queue for the m_axi_hbm interface for t…
STFleming Jul 2, 2025
e19b797
[Builder] Bring back copying of stitched ip folder to output dir
auphelia Jul 2, 2025
ddf4d54
updated RTL if buffering.
Jul 2, 2025
e2f249e
[FINNLoop] Add changes from transformer_loop
auphelia Jul 4, 2025
74b8f80
[FINNLoop] Linting and cleanup
auphelia Jul 4, 2025
3ce32d7
Merge pull request #1385 from Xilinx/update/loop_op
auphelia Jul 4, 2025
7c460af
[FINNLoop] Fix typo in tcl command
auphelia Jul 4, 2025
f5ec2bb
Infrastructure fix
Jul 5, 2025
2cdeac6
[FINNLoop Sim] Making progress on the intermediate frames write back,…
STFleming Jul 7, 2025
b365218
[FINNLoop Sim] removing pdb trace
STFleming Jul 7, 2025
09ad5cc
[FINNLoop Sim] forgot the read for the m_axi_hmb bready, bvalids are …
STFleming Jul 7, 2025
1f6e25d
[FINNLoop Sim] Restoring original lengths, appears like the last fram…
STFleming Jul 7, 2025
b8fa264
[FINNLoop Sim] Cleaning up debug log messaging
STFleming Jul 7, 2025
95941ed
prior code was dropping first piece of data.
Jul 6, 2025
fbbcdd3
fix bytes alignment formula
Jul 6, 2025
202250d
reps should be the total number of vectors?
Jul 6, 2025
564a4f1
fix off-by-one errors
Jul 6, 2025
9f482fe
Merge pull request #1387 from jsmonson/feature/loop_op
STFleming Jul 7, 2025
829ad5f
add missing signal connections
Jul 7, 2025
762149b
Running simulation
Jul 7, 2025
de5e8ce
Merge branch 'feature/loop_op' of https://github.com/Xilinx/finn into…
Jul 7, 2025
073b851
merge fixes.
Jul 7, 2025
4607090
pre-commit run.
Jul 7, 2025
46923f6
Merge branch 'feature/loop_op' of https://github.com/Xilinx/finn into…
Jul 7, 2025
002f0be
correct output context copying for RTL sim.
Jul 7, 2025
009dc17
[FINNLoop Sim] Verify output now collected correctly.
STFleming Jul 7, 2025
e795274
[FINNLoop Sim] Better association between the MVAUs external interfac…
STFleming Jul 7, 2025
3ac6fcf
Merge branch 'feature/loop_op' of https://github.com/Xilinx/finn into…
Jul 7, 2025
d46c3a4
Merge branch 'feature/loop_op' of https://github.com/Xilinx/finn into…
Jul 7, 2025
4fb2d78
HACK to Account for minimum DMA burst size
Jul 7, 2025
5a52aaa
Merge branch 'feature/loop_op' of github.com:jsmonson/finn into featu…
Jul 7, 2025
083486a
remove old signals
Jul 8, 2025
c35a8a9
Merge pull request #1388 from jsmonson/feature/loop_op
STFleming Jul 8, 2025
d5620b3
[FINNLoop Sim] Changed to try to get the weights from the dat file in…
STFleming Jul 8, 2025
51b2d81
[FINNLoop Sim] m_axi weight ports are now associated via MVAU name ra…
STFleming Jul 9, 2025
356e38b
[FINNLoop Sim] Added the ability to change the number of iterations f…
STFleming Jul 9, 2025
6f3ecda
[RTLMVAU] Create second input npy for rtlsim also for mlo case
auphelia Jul 9, 2025
8faf5dc
[Tests] Change branching loop model example
auphelia Jul 9, 2025
049899b
[FINNLoop] Temporarily save full exec ctx for loop body
auphelia Jul 10, 2025
a0d1f80
[Tests] Change dynamic MatMul to addstreams in loop test
auphelia Jul 10, 2025
fb37b0f
[FINNLoop Sim] Updating the reading of the DAT file to account for mu…
STFleming Jul 10, 2025
2176bff
Merge branch 'feature/loop_op' of github.com:Xilinx/finn into feature…
STFleming Jul 10, 2025
17ec4d0
Merge branch 'dev' into feature/loop_op
auphelia Jul 11, 2025
8788575
[FINNLoop Sim] Changed how we are interpreting the DAT file to little…
STFleming Jul 11, 2025
eadd74b
[FINNLoop] Change parameter file names to contain input if
auphelia Jul 11, 2025
3bd78d6
[MLO] Rename axi mm interfaces based on input idx
auphelia Jul 11, 2025
381e23c
[FINNLoop Sim] handling when we have a nibble leftover in the DAT fil…
STFleming Jul 11, 2025
1cf8f02
fix typo
Jul 14, 2025
5d3c7b8
changed fetch weights input ordering.
Jul 15, 2025
19ab2f6
Merge pull request #1392 from jsmonson/feature/loop_op
auphelia Jul 15, 2025
bb4f26b
[FINNLoop] Adding PE_BITS for local weight buffer
STFleming Jul 15, 2025
4ec5bf3
[FIFOsizing] Alternative way of resetting Threshold layers after mlo …
auphelia Jul 15, 2025
dabf90b
[FINN Loop] Fixed width on fetch weights components when SIMD > 1
STFleming Jul 15, 2025
cc10de2
Merge branch 'dev' into feature/loop_op
auphelia Jul 31, 2025
60905fb
Adding skid buffer design.
preusser Aug 7, 2025
3b4974c
Use credit-based input control to avoid backpressure inflation.
preusser Aug 25, 2025
d6803ca
Use behavioral bypass in simulation for faster execution.
preusser Aug 25, 2025
0ee536e
Motivate path with SRL primitive instantiation.
preusser Aug 25, 2025
5cebd06
[InsertFIFO] Ignore mlo parameter inputs when inserting FIFOs
auphelia Aug 27, 2025
99994be
Merge branch 'dev' into feature/loop_op
auphelia Aug 27, 2025
87a8839
[Tests] Extend loop op test case to also have elementwise Mul
auphelia Aug 28, 2025
fd8d208
Merge branch 'preusser.skid' into feature/stream_tap_fifo
preusser Aug 28, 2025
66a5964
[FINNLoop] Parameter dat file generation for elementwise ops in loop op
auphelia Aug 28, 2025
0e44ac7
stream_tap with small skid buffer to decouple tap output.
preusser Aug 28, 2025
fb324be
[FINNLoop] Add skid verilog files to stitching code
auphelia Aug 31, 2025
962ce6d
Merge pull request #1415 from Xilinx/feature/stream_tap_fifo
auphelia Sep 10, 2025
cada770
initial pull over to feature/loop_op
Sep 10, 2025
6cbebf8
fix layers assertion
Sep 10, 2025
d385acb
update loop_rolling transform to latest version
Sep 10, 2025
1fd27da
update test to use quantized model
Sep 10, 2025
63b6308
update brevitas commit
Sep 10, 2025
7f8a6ea
exporting simple test
Sep 10, 2025
3395587
remove i/o check
Sep 11, 2025
03c9e8e
re-add multiply
Sep 11, 2025
e4b7e99
add onnxscript helpers
Sep 11, 2025
19167e7
switch to non-custom onnxscript
Sep 11, 2025
f0489b6
switch to non-custom onnxscript
Sep 11, 2025
80b335a
disconnect graph from value
Sep 11, 2025
304734f
comment line that causes test to fail and leave reason
Sep 11, 2025
724c45c
remove debugging save points.
Sep 11, 2025
e728653
run pre-commit
Sep 11, 2025
34ea230
add loop rolling as step in finn
Sep 12, 2025
1801f1b
update onnxscript to 0.5.0
Sep 15, 2025
b5ef94e
remove simple unused helper functions
Sep 19, 2025
3e1e088
fix import organization
Sep 19, 2025
fed0e4a
remove commented print statements
Sep 19, 2025
3c63bf6
move remaining imports to top of file.
Sep 19, 2025
2f8a93f
move loop related functions into loop_transform python file.
Sep 19, 2025
3e7dc49
change bGraphView to build_graph_view
Sep 22, 2025
2bffab0
replace build graph view with subgraph view
Sep 22, 2025
0112379
[Transforms] Add node meta data preservation and execution in loop ro…
auphelia Sep 24, 2025
09b2dd7
add include initializers arg to SubGraphView
Sep 24, 2025
79b922b
add graph sort to loop rolling
Sep 24, 2025
134344f
fix missing metadata bug
Sep 24, 2025
122a387
readd missing assertions
Sep 24, 2025
7146973
[Tests] Add streamlining to loop rolling test
auphelia Sep 25, 2025
fe833b5
[Tests] Add manual streamlining to be able to convert to hw in loop r…
auphelia Sep 26, 2025
34c94a0
found that results are consistly good within 10^-4
Sep 26, 2025
3052b34
re-add output shape check
Sep 26, 2025
2bdb1a1
added failing test for initializer shape check
Sep 26, 2025
74fbe5d
added check and raise to pass inconsistency test
Sep 26, 2025
4b3987c
cleaned up and add warning about streamlining
Sep 26, 2025
c50a5ed
add raise_scaler_to_rank1.py and update test
Sep 26, 2025
55067a3
add documentation to onnxscript helpers.
Sep 26, 2025
9109ef7
pre-commit edits
Sep 26, 2025
9e217e5
pre-commit changes on loop_rolling.py
Sep 26, 2025
f0471a0
more pre-commit
Sep 26, 2025
979a40e
[Tests + Docs] Remove obsolete code in loop rolling test and add new …
auphelia Sep 29, 2025
0ba0296
add loop body hierarchy to config file
Sep 29, 2025
29bb65f
only add mlo_max_iter to fpgadataflow nodes
Sep 29, 2025
6056dff
protect standard onnx nodes from mlo_max_iter
Sep 29, 2025
5273b8f
add I/O type checkes to loop rolling
Sep 29, 2025
ffa34ed
remove print statements
Sep 29, 2025
f3a6a5f
[Tests] Adjusting PyTorch code to be more flexible with shapes (kudos…
auphelia Sep 30, 2025
81ef1dd
[Test] Set mul_val lower to allow for higher num_layers param and rem…
auphelia Sep 30, 2025
7dcc31c
[Tests] Change op_types for mlo test
auphelia Sep 30, 2025
7bd523b
Merge pull request #1421 from jsmonson/feature/loop_op_roll_to_finn_loop
auphelia Sep 30, 2025
85800a2
Merge branch 'dev' into feature/loop_op
auphelia Sep 30, 2025
556024b
[QONNXConversion] Move scalar out_bias into MultiThreshold
auphelia Sep 30, 2025
6824e48
[QONNXconversion] Only set out_bias as argument if integer value
auphelia Sep 30, 2025
dad1b19
[Tests] Revert qonnx conversion changes and use streamlining transfor…
auphelia Sep 30, 2025
6d0fe4b
Merge branch 'dev' into feature/loop_op
auphelia Sep 30, 2025
f741e26
fix misspelling
Sep 30, 2025
e719344
[HWCustomOp] Use mlo_max_iter to set SETS in memstream component
auphelia Sep 30, 2025
e0b2f8a
Merge branch 'feature/loop_op' of https://github.com/Xilinx/finn into…
Sep 30, 2025
42a8784
remove bias quantization
Sep 30, 2025
ee86e1e
remove hard-coded model version
Sep 30, 2025
4af2876
fix other hardcoded model proto ir versions
Sep 30, 2025
22128d1
Merge pull request #1442 from jsmonson/feature/loop_op_fix_int8_annot…
auphelia Oct 1, 2025
f6a7b26
Merge branch 'dev' into feature/loop_op
auphelia Oct 1, 2025
7f80c97
[FINNLoop] Connect memstream tap input to stream tap graph
auphelia Oct 1, 2025
01d4ec1
[FINNLoop] Add onnx graph and npy file generation to loop test and ad…
auphelia Oct 1, 2025
7dbf571
[finn-rtllib] Propagate SETS through memstream components
auphelia Oct 2, 2025
d2835d5
[Streamtap] Set tap_rep for elementwise op to 1
auphelia Oct 2, 2025
47dfa1e
[Tests] Add finn loop test with arbitrary number of loops
auphelia Oct 3, 2025
c519966
[Builder] If model is mlo, skip the rtlsim performance for now
auphelia Oct 3, 2025
0ec3bcc
ensure activation replacements are to the first node.
Oct 3, 2025
3f79627
handle activation identification if only 1 loopbody exists.
Oct 3, 2025
cd000d1
handle 1 length loop body
Oct 3, 2025
d64bda9
remove commented code
Oct 4, 2025
46bbac6
fix initializer rounding error.
Oct 7, 2025
0f7d626
all fpgadataflow_finnloop tests are working now
Oct 7, 2025
3b6d6ee
Merge pull request #1446 from jsmonson/feature/loop_op_rolling_fixes
auphelia Oct 8, 2025
28ebd23
[Tests] Add ip-stitching to loop test
auphelia Oct 8, 2025
b0ea5f2
correctly calculate input and output bitwidth
Oct 8, 2025
7624ba0
refactor loop validation and add checks between i/o on the node and l…
Oct 8, 2025
90a4c6a
ensure metadata is copied into the replacement graph.
Oct 8, 2025
e9727ee
Merge pull request #1448 from jsmonson/feature/loop_op_rtlsim_fixes
auphelia Oct 9, 2025
f5bc387
[Tests] Apply FIFO sizing also to subgraph
auphelia Oct 9, 2025
be5f1fc
fix loop santization and validation
Oct 10, 2025
5a674b1
wait until write completes before queuing the write completion
Oct 11, 2025
7b20c14
Merge pull request #1451 from jsmonson/feature/loop_op_sim_engine
auphelia Oct 13, 2025
faf3f20
[Tests] Change finnloop test case to only run with 4-bit
auphelia Oct 13, 2025
f022f39
[Test] Revert test to int8 and generate dcp instead of simulation
auphelia Oct 22, 2025
94596d7
[FINNLoop] First draft of generating standalone ip for LoopOp during …
auphelia Oct 23, 2025
ee4dee5
[FINNLoop] Remove reset after running the prehook simulation
auphelia Oct 23, 2025
cbd6de2
[FINNLoop] Add fifo sizing to upper level and update ip stitching
auphelia Oct 23, 2025
5c7961c
[FINNLoop] Move tcl cmds into template
auphelia Oct 24, 2025
e7d2b5a
[BuildSteps] Update build flow with refactored loop op integration
auphelia Oct 24, 2025
0417723
[Tests] Add end2end builder test for mlo
auphelia Oct 24, 2025
67f90d1
Merge branch 'feature/loop_op' into feature/refactor_loop_ipgen
auphelia Oct 24, 2025
b3bb82e
[LoopRolling] Use hierarchy_list as a list of lists
auphelia Oct 14, 2025
469310f
update loop_hierarhcy in builder and checking in LoopExtraction
Oct 21, 2025
9ad2da6
[MLO INT4] Disable narrow weights when MLO is being used (fix for INT…
STFleming Oct 23, 2025
29f477b
add fix for rhs_style
Oct 23, 2025
1c3a0ff
[MLO] Clean-up files after cherry-picking commits
auphelia Oct 24, 2025
589fb30
[MLOSim VerifyStep] Fixing issue when user request a full context and…
STFleming Oct 23, 2025
7a546cc
[Builder] Remove f in print statement
auphelia Oct 24, 2025
be2310c
[MLO] Insert GiveUniqueNodeNames
auphelia Oct 24, 2025
7cc5ee2
Merge pull request #1466 from Xilinx/feature/refactor_loop_ipgen
auphelia Oct 24, 2025
0b82ff3
[MLO] Make sure that body is saved after changes
auphelia Oct 24, 2025
4944870
[MLO] Refactor node naming for loop node
auphelia Oct 28, 2025
583d40c
Merge branch 'dev' into feature/loop_op
auphelia Oct 28, 2025
462fddd
[Tests] Thresholding: move sim reset into prehook fct
auphelia Oct 28, 2025
18423d1
[FINNLoop] Update exp cycles estimate
auphelia Oct 28, 2025
bb4ae3d
[MLO] Make sure subgraph nodes are named differently from upper level…
auphelia Nov 4, 2025
39e3eff
Merge branch 'dev' into feature/loop_op
auphelia Nov 25, 2025
520ea98
[FINNLoop] Propagate rtlsim trace node attribute to execute node
auphelia Nov 17, 2025
769d6af
[MLO] Cleanup and align with recent changes
auphelia Nov 25, 2025
fbc2afe
[Deps] Make import of finn xsi optional in case Vivado installation i…
auphelia Nov 12, 2025
5da9d6b
[Tests] Add markers to finnloop test
auphelia Nov 25, 2025
a2f6327
Merge branch 'dev' into feature/loop_op
auphelia Dec 10, 2025
5cc6d48
Merge branch 'dev' into feature/loop_op
auphelia Dec 10, 2025
577b1b9
PR review fixes
d-kor Jan 8, 2026
2a2e50c
Merge branch 'dev' into feature/loop_op
auphelia Jan 8, 2026
080c164
[MLO] Instead of node metadata propagation, implement manual setting …
auphelia Jan 12, 2026
a7218dd
Merge branch 'dev' into feature/loop_op
auphelia Jan 12, 2026
e35e28a
[MLO] Add auto gen doc and allow for analysis passes in builder steps…
auphelia Jan 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/finn/source_code/finn.transformation.fpgadataflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ finn.transformation.fpgadataflow.insert\_tlastmarker
:undoc-members:
:show-inheritance:

finn.transformation.fpgadataflow.loop\_rolling
-------------------------------------------------

.. automodule:: finn.transformation.fpgadataflow.loop_rolling
:members:
:undoc-members:
:show-inheritance:


finn.transformation.fpgadataflow.make\_pynq\_driver
----------------------------------------------------------

Expand Down Expand Up @@ -205,6 +214,14 @@ finn.transformation.fpgadataflow.prepare\_rtlsim
:undoc-members:
:show-inheritance:

finn.transformation.fpgadataflow.raise\_scalar\_to\_rank1
-------------------------------------------------------------

.. automodule:: finn.transformation.fpgadataflow.raise_scalar_to_rank1
:members:
:undoc-members:
:show-inheritance:

finn.transformation.fpgadataflow.replace\_verilog\_relpaths
------------------------------------------------------------------

Expand Down Expand Up @@ -237,6 +254,14 @@ finn.transformation.fpgadataflow.set\_folding
:undoc-members:
:show-inheritance:

finn.transformation.fpgadataflow.set\_loop\_boundary
-------------------------------------------------------

.. automodule:: finn.transformation.fpgadataflow.set_loop_boundary
:members:
:undoc-members:
:show-inheritance:

finn.transformation.fpgadataflow.specialize\_layers
-------------------------------------------------------

Expand Down
17 changes: 17 additions & 0 deletions docs/finn/source_code/finn.util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ qonnx.util.inference\_cost
:undoc-members:
:show-inheritance:

qonnx.util.mlo\_sim
--------------------------

.. automodule:: qonnx.util.mlo_sim
:members:
:undoc-members:
:show-inheritance:


qonnx.util.onnx
-------------------

Expand All @@ -63,6 +72,14 @@ qonnx.util.onnx
:undoc-members:
:show-inheritance:

qonnx.util.onnxscript\_helpers
--------------------------------

.. automodule:: qonnx.util.onnxscript_helpers
:members:
:undoc-members:
:show-inheritance:

qonnx.util.prune\_channels
---------------------------

Expand Down
249 changes: 249 additions & 0 deletions finn-rtllib/cdma/cdma_a/axi_dma_rd_a.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,249 @@
/******************************************************************************
* Copyright (C) 2024, Advanced Micro Devices, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION). HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/

module axi_dma_rd_a #(
parameter integer BURST_LEN = 16,
parameter integer DATA_BITS = 256,
parameter integer ADDR_BITS = 64,
parameter integer ID_BITS = 2,
parameter integer MAX_OUTSTANDING = 8,
parameter integer LEN_BITS = 32
) (
// Clock and reset
input wire aclk,
input wire aresetn,

// Control and status
input wire ctrl_valid,
output wire stat_ready,
input wire [ADDR_BITS-1:0] ctrl_addr,
input wire [LEN_BITS-1:0] ctrl_len,
input wire ctrl_ctl,
output wire stat_done,

// AXI4 master interface
output wire arvalid,
input wire arready,
output wire [ADDR_BITS-1:0] araddr,
output wire [ID_BITS-1:0] arid,
output wire [7:0] arlen,
output wire [2:0] arsize,
output wire [1:0] arburst,
output wire [0:0] arlock,
output wire [3:0] arcache,
output wire [2:0] arprot,
input wire rvalid,
output wire rready,
input wire [DATA_BITS-1:0] rdata,
input wire rlast,
input wire [ID_BITS-1:0] rid,
input wire [1:0] rresp,

// AXI4-Stream master interface
output wire axis_out_tvalid,
input wire axis_out_tready,
output wire [DATA_BITS-1:0] axis_out_tdata,
output wire [DATA_BITS/8-1:0] axis_out_tkeep,
output wire axis_out_tlast
);

///////////////////////////////////////////////////////////////////////////////
// Local Parameters
///////////////////////////////////////////////////////////////////////////////
localparam integer AXI_MAX_BURST_LEN = BURST_LEN;
localparam integer AXI_DATA_BYTES = DATA_BITS / 8;
localparam integer LOG_DATA_LEN = $clog2(AXI_DATA_BYTES);
localparam integer LOG_BURST_LEN = $clog2(AXI_MAX_BURST_LEN);
localparam integer LP_MAX_OUTSTANDING_CNTR_WIDTH = $clog2(MAX_OUTSTANDING+1);
localparam integer LP_TRANSACTION_CNTR_WIDTH = LEN_BITS-LOG_BURST_LEN-LOG_DATA_LEN;

logic [LP_TRANSACTION_CNTR_WIDTH-1:0] num_full_bursts;
logic num_partial_bursts;

logic start;
logic [LP_TRANSACTION_CNTR_WIDTH-1:0] num_transactions;
logic has_partial_burst;
logic [LOG_BURST_LEN-1:0] final_burst_len;
logic single_transaction;

// AR
logic arvalid_r;
logic [ADDR_BITS-1:0] addr_r;
logic ctl_r;
logic ar_done;
logic ar_idle;

logic arxfer;
logic ar_final_transaction;
logic [LP_TRANSACTION_CNTR_WIDTH-1:0] ar_transactions_to_go;

// R
logic rxfer;
logic r_final_transaction;

logic burst_ready_snk;

///////////////////////////////////////////////////////////////////////////////
// Ctrl
///////////////////////////////////////////////////////////////////////////////
assign stat_done = rxfer & rlast & r_final_transaction;
assign stat_ready = ar_idle;

// Determine how many full burst to issue and if there are any partial bursts.
assign num_full_bursts = ctrl_len[LOG_DATA_LEN+LOG_BURST_LEN+:LEN_BITS-LOG_DATA_LEN-LOG_BURST_LEN];
assign num_partial_bursts = ctrl_len[LOG_DATA_LEN+:LOG_BURST_LEN] ? 1'b1 : 1'b0;

always_ff @(posedge aclk) begin
if(~aresetn) begin
start <= 0;
num_transactions <= 'X;
has_partial_burst <= 'X;
final_burst_len <= 'X;
end
else begin
start <= ctrl_valid & stat_ready;
if(ctrl_valid & stat_ready) begin
num_transactions <= (num_partial_bursts == 1'b0) ? num_full_bursts - 1'b1 : num_full_bursts;
has_partial_burst <= num_partial_bursts;
final_burst_len <= ctrl_len[LOG_DATA_LEN+:LOG_BURST_LEN] - 1'b1;
end
end
end

// Special case if there is only 1 AXI transaction.
assign single_transaction = (num_transactions == {LP_TRANSACTION_CNTR_WIDTH{1'b0}}) ? 1'b1 : 1'b0;

///////////////////////////////////////////////////////////////////////////////
// AXI Read Address Channel
///////////////////////////////////////////////////////////////////////////////
assign arvalid = arvalid_r;
assign araddr = addr_r;
assign arlen = ar_final_transaction ? final_burst_len : AXI_MAX_BURST_LEN - 1;
assign arsize = LOG_DATA_LEN;
assign arid = 0;

assign arburst = 2'b01;
assign arlock = 1'b0;
assign arcache = 4'b0011;
assign arprot = 3'b010;

assign arxfer = arvalid & arready;

// Send ar_valid
always_ff @(posedge aclk) begin
if (~aresetn) begin
arvalid_r <= 1'b0;
end
else begin
arvalid_r <= ~ar_idle & ~arvalid_r & burst_ready_snk ? 1'b1 :
arready ? 1'b0 : arvalid_r;
end
end

// When ar_idle, there are no transactions to issue.
always_ff @(posedge aclk) begin
if (~aresetn) begin
ar_idle <= 1'b1;
end
else begin
ar_idle <= (ctrl_valid & stat_ready) ? 1'b0 :
ar_done ? 1'b1 : ar_idle;
end
end

// Increment to next address after each transaction is issued. Ctl latching.
always_ff @(posedge aclk) begin
if (~aresetn) begin
ctl_r <= 1'b0;
addr_r <= 'X;
end
else begin
addr_r <= (ctrl_valid & stat_ready) ? ctrl_addr :
arxfer ? addr_r + AXI_MAX_BURST_LEN*AXI_DATA_BYTES : addr_r;
ctl_r <= (ctrl_valid & stat_ready) ? ctrl_ctl : ctl_r;
end
end

// Counts down the number of transactions to send.
krnl_counter #(
.C_WIDTH ( LP_TRANSACTION_CNTR_WIDTH ) ,
.C_INIT ( {LP_TRANSACTION_CNTR_WIDTH{1'b0}} )
)
inst_ar_transaction_cntr (
.aclk ( aclk ) ,
.clken ( 1'b1 ) ,
.aresetn ( aresetn ) ,
.load ( start ) ,
.incr ( 1'b0 ) ,
.decr ( arxfer ) ,
.load_value ( num_transactions ) ,
.count ( ar_transactions_to_go ) ,
.is_zero ( ar_final_transaction )
);

assign ar_done = ar_final_transaction && arxfer;

///////////////////////////////////////////////////////////////////////////////
// AXI Read Channel
///////////////////////////////////////////////////////////////////////////////
assign axis_out_tvalid = rvalid;
assign axis_out_tdata = rdata;
assign axis_out_tkeep = ~0;
assign axis_out_tlast = rlast & r_final_transaction;
assign rready = axis_out_tready;

assign rxfer = rready & rvalid;

Q_srl #(
.depth(MAX_OUTSTANDING),
.width(1)
) inst_q_rd (
.clock(aclk),
.reset(!aresetn),
.count(),
.maxcount(),
.i_d(ctl_r & ar_final_transaction),
.i_v(arxfer),
.i_r(burst_ready_snk),
.o_d(r_final_transaction),
.o_v(),
.o_r(rlast & rxfer)
);

/////////////////////////////////////////////////////////////////////////////
// DEBUG
/////////////////////////////////////////////////////////////////////////////
`ifdef DBG_CDMA_RD_A

`endif

endmodule
Loading