Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
d2f0621
Reworked and parallel simulations initial commit
bwintermann Oct 16, 2025
5774681
Correct simulation function naming
bwintermann Oct 16, 2025
0e10a33
Add new sim bindings
LinusJungemann Oct 16, 2025
86c6421
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Oct 16, 2025
a047534
Initial layer parallel simulation. Clang format, Python executed comp…
bwintermann Oct 17, 2025
c278572
Passing node names to simulation. Improve simulation code
bwintermann Oct 17, 2025
ea1db07
Group bools into struct
bwintermann Oct 20, 2025
e0557ae
Updated simulation structure
bwintermann Oct 20, 2025
9be1099
Bugfixes for IPC
bwintermann Oct 22, 2025
da60b91
Rework simulation framework on the FINN side
bwintermann Oct 22, 2025
4f9c2ca
Bugfixes and code improvements for C++ Simulation
bwintermann Oct 23, 2025
e5f5b1f
Fixed bug in multithreaded simulation running from FINN
bwintermann Oct 23, 2025
68f7e78
Added FIFO functionality to the simulation interfaces
bwintermann Oct 23, 2025
6f8db92
Several fixes, IPC mostly works.
bwintermann Oct 23, 2025
a20e1f9
Very slight optimizations
bwintermann Oct 23, 2025
b6e49e2
Align data in shared memory
LinusJungemann Oct 28, 2025
5fc6c94
Restructure files
bwintermann Oct 28, 2025
94e3724
Added program options and JSON data output
bwintermann Oct 31, 2025
48dce96
Fixed data logging
bwintermann Oct 31, 2025
28fc0e5
Add dummy layer to remove data path
LinusJungemann Nov 6, 2025
b87fa3d
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Nov 6, 2025
0eae0af
Fix small problem
LinusJungemann Nov 6, 2025
5e77755
Add typing
LinusJungemann Nov 6, 2025
136264c
Fix noqa
LinusJungemann Nov 6, 2025
b6e858e
Fix type hinting and other problems
LinusJungemann Nov 6, 2025
0a32004
Fix type hinting and other problems
LinusJungemann Nov 6, 2025
d51e39d
New FIFO implementation & Bug fix
LinusJungemann Nov 10, 2025
a3ff9f8
Added thread communication of simulation with Python. Restructured si…
bwintermann Nov 11, 2025
9fd097d
Merge improved (functional) simulation, work in progress
bwintermann Nov 11, 2025
4a09271
Merge complete
bwintermann Nov 11, 2025
7f77ce4
Fixes, Linting and prep work
LinusJungemann Nov 11, 2025
1873576
New shared memory implementation
LinusJungemann Nov 18, 2025
7dae9d9
Remove unused include
LinusJungemann Nov 18, 2025
a07de48
Updated communicating node by node simulation
bwintermann Nov 19, 2025
8ebdb1d
Merge with updated node by node simulation
bwintermann Nov 19, 2025
5b48ec0
Add tests
LinusJungemann Nov 21, 2025
efc49c9
Fix fifosim
LinusJungemann Dec 1, 2025
ba6ec0f
Implement full minimization
LinusJungemann Dec 19, 2025
01fd709
Clean up a bit
LinusJungemann Jan 5, 2026
e3d0819
Fix bugs, optimize search and swap sim to InterprocessCommunicationCh…
LinusJungemann Jan 8, 2026
4141166
Add FIFO simulation tests to CI
bwintermann Jan 9, 2026
2b201bc
Move FIFOs
LinusJungemann Jan 9, 2026
8ef0d32
FIFO Depth application step added. C++ driver fix
bwintermann Jan 14, 2026
c190059
Removed old unused FIFO simulation files
bwintermann Jan 14, 2026
dc46c9c
Revert previous deleted module
bwintermann Jan 14, 2026
77a7451
Fixed issue with MemStreamSupport.calc_wmem()
bwintermann Jan 15, 2026
e4ce540
Added isolated sim target, fixed std::format version incompatability.
bwintermann Jan 16, 2026
ab2cfc4
Isolated node simulation runs; added simulation_build.py; bugfixes
bwintermann Jan 21, 2026
77ecc6b
Revert to Sim without Look-Ahead
LinusJungemann Jan 22, 2026
776b5ab
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Jan 22, 2026
f928f01
Finish integrating the reverted changes
LinusJungemann Jan 22, 2026
1c11e6f
Working isolated sim, todo: cleanup and remove debug output
bwintermann Jan 23, 2026
7b1df93
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Jan 23, 2026
a9e0471
Add timeout to communication
LinusJungemann Jan 23, 2026
21d4e3f
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Jan 23, 2026
697fbcf
Work on isolated node simulation data
bwintermann Jan 23, 2026
0e064c8
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Jan 23, 2026
4d376bd
Fix import error
bwintermann Jan 23, 2026
66390a8
Revert simulation connection
LinusJungemann Jan 23, 2026
990cb27
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Jan 23, 2026
e422be1
Working isolated simulation, first bounds results
bwintermann Jan 26, 2026
80f2b26
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Jan 26, 2026
18ac0dc
Reimplemented bounds calculation + doctests
bwintermann Jan 27, 2026
72e7c77
Restructured simulation code. Fixed some bugs in isolated sims.
bwintermann Jan 27, 2026
9446fbc
Fixed naming issues
bwintermann Jan 27, 2026
b33d2fd
Fixed socket communication issues in isolated simulations
bwintermann Jan 27, 2026
e252ad6
IsoSim bugfixes and logging
bwintermann Jan 28, 2026
68f871c
Working version
LinusJungemann Feb 2, 2026
d282079
Integrated steps into FINN itself
bwintermann Feb 4, 2026
915a7ce
Simulations utilize the correct binaries
bwintermann Feb 5, 2026
bf7805f
BuildSimulation independent of simtype, smaller fixes and additions
bwintermann Feb 6, 2026
8a725f1
Start adding resnet support
LinusJungemann Feb 9, 2026
3144156
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Feb 9, 2026
a8dbc9f
Fix building sim for residual connections
LinusJungemann Feb 9, 2026
f7806f2
Mostly formatting for easier readable stdout
bwintermann Feb 11, 2026
64ac007
Use ordered_json to keep order in simulations in cases where multiple…
bwintermann Feb 11, 2026
3d9ceba
Get ResNet to work
LinusJungemann Feb 12, 2026
63c6038
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Feb 12, 2026
f5532dc
Added dataframe storage of sim data. Also moved model preparation to …
bwintermann Feb 12, 2026
199fe75
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Feb 12, 2026
085fbb6
Fix Insert FIFOs
LinusJungemann Feb 12, 2026
ebefb1c
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Feb 12, 2026
d68c0cf
Finished adding all FIFO-related simulation data into a unified dataf…
bwintermann Feb 12, 2026
14f4e0d
Add per layer timeout for late first valid
LinusJungemann Feb 18, 2026
5d367bf
Various fixes to isolated simulation
bwintermann Feb 18, 2026
71bb2bd
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Feb 18, 2026
89d8436
Adjust grace cycles to be dynamic
LinusJungemann Feb 20, 2026
236471e
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Feb 20, 2026
ee425d2
Linting
LinusJungemann Feb 24, 2026
c6b9cdb
Added minimization order options
bwintermann Feb 24, 2026
931f796
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Feb 24, 2026
1acbddb
Fix multi connection models
LinusJungemann Feb 26, 2026
c9cf66e
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Feb 26, 2026
3772d9c
Small fixes
LinusJungemann Feb 26, 2026
060c753
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Feb 26, 2026
ead07ce
Small changes
LinusJungemann Mar 2, 2026
4797860
Added test for diamond communication pattern
bwintermann Mar 2, 2026
5d5aa78
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
bwintermann Mar 2, 2026
351554d
Small fixes
bwintermann Mar 2, 2026
1d6d10b
Try fixing the simulation deadlock
LinusJungemann Mar 4, 2026
3249b1e
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Mar 4, 2026
92fc046
Fix wrong key in apply depths
LinusJungemann Mar 5, 2026
5ecbaee
Add offsets
LinusJungemann Mar 5, 2026
20539b9
More small changes to track error
LinusJungemann Mar 6, 2026
cffd9c0
Fix bugs and add debug stuff
LinusJungemann Mar 12, 2026
0a52fb9
Fix FIFO sizing hopefully
LinusJungemann Mar 12, 2026
19bb621
Merge and integrate dev into parallel-sim feature branch
bwintermann Mar 13, 2026
485ac7a
Integrated the distributed simulation partly into the normal FINN flow
bwintermann Mar 13, 2026
32bebff
Fixes
LinusJungemann Mar 14, 2026
d8890fc
Missing import fixed
bwintermann Mar 17, 2026
28ead34
Small changes to bench
bwintermann Mar 19, 2026
94477b7
Fixes
LinusJungemann Mar 21, 2026
c4dba41
Merge branch 'feature/parallel-sim' of github.com:eki-project/finn-pl…
LinusJungemann Mar 21, 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
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ tags
poetry.lock
*.code-workspace
.env
*.vim

# Cmake files
**/CMakeFiles
**/cmake_install.cmake
**/CMakeCache.txt
**/compile_commands.json
**/.cache
**/build
**/_deps
finn_xsi/finn_xsi/unittests/*.cmake
finn_xsi/finn_xsi/unittests/Makefile

settings.yaml
*/.cache/*

Expand Down Expand Up @@ -100,6 +113,9 @@ MANIFEST
/data/
*.csv

# Mock templated simulation config
finn_xsi/finn_xsi/rtlsim_config.hpp

# Google Drive key for dashboard
/gdrive-key/

Expand All @@ -108,7 +124,7 @@ MANIFEST

# downloaded dep repos
/deps/
/finn_deps/
finn_deps/

# local test directories for benchmarking infrastructure
bench_input
Expand Down
25 changes: 25 additions & 0 deletions finn-rtllib/removedatapath/hdl/dummy_template.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module $TOP_MODULE_NAME$(
//- Global Control ------------------
(* X_INTERFACE_PARAMETER = "ASSOCIATED_BUSIF in0_V:out0_V, ASSOCIATED_RESET = ap_rst_n" *)
(* X_INTERFACE_INFO = "xilinx.com:signal:clock:1.0 ap_clk CLK" *)
input ap_clk,
(* X_INTERFACE_PARAMETER = "POLARITY ACTIVE_LOW" *)
input ap_rst_n,

//- AXI Stream - Input --------------
output in0_V_TREADY,
input in0_V_TVALID,
input [$WIDTH$-1:0] in0_V_TDATA,

//- AXI Stream - Output --------------
input out0_V_TREADY,
output out0_V_TVALID,
output [$WIDTH$-1:0] out0_V_TDATA
);

assign in0_V_TREADY = out0_V_TREADY;
assign out0_V_TVALID = in0_V_TVALID;
assign out0_V_TDATA = 0;


endmodule
46 changes: 46 additions & 0 deletions finn_xsi/finn_xsi/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
BasedOnStyle: Chromium
AccessModifierOffset: '1'
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'true'
AllowShortBlocksOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'false'
AlwaysBreakTemplateDeclarations: 'Yes'
BinPackParameters: 'true'
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: '180'
Cpp11BracedListStyle: 'true'
FixNamespaceComments: 'true'
IndentCaseLabels: 'true'
IndentPPDirectives: BeforeHash
IndentWidth: '4'
IndentWrappedFunctionNames: 'true'
IncludeBlocks: Regroup
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '2'
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'true'
SpaceAfterLogicalNot: 'false'
SpaceAfterTemplateKeyword: 'false'
SpaceBeforeCpp11BracedList: 'false'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
TabWidth: '4'
---
Language: Json
BasedOnStyle: llvm
134 changes: 134 additions & 0 deletions finn_xsi/finn_xsi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
cmake_minimum_required(VERSION 3.11)
project(LayerSimulationBackend)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

# Require C++20
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message(STATUS "Using C++ Standard ${CMAKE_CXX_STANDARD}")
SET(CMAKE_COLOR_MAKEFILE ON)

message(STATUS "CMake cwd: ${CMAKE_CURRENT_SOURCE_DIR}")

# Export compile commands for clangd
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# INCLUDES

#Threads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

#OpenMP
find_package(OpenMP REQUIRED)

#Compiler Options
add_library(fifosim_options INTERFACE)
add_library(fifosim::options ALIAS fifosim_options)

OPTION(FIFOSIM_ENABLE_ALLOPT "Enable all optimizations" ON)
if(${FIFOSIM_ENABLE_ALLOPT})
message(STATUS "All optimizations are enabled")
target_compile_options(
fifosim_options
INTERFACE -Ofast -ffast-math -march=native -mtune=native -fstack-protector-strong -fopenmp -ffunction-sections -fdata-sections -pipe -funroll-loops -shared -fPIC -Wno-interference-size
# Additional performance options:
-flto=auto # Link-time optimization (auto-detect thread count)
-fno-plt # Avoid PLT for better performance with shared libs
-fno-semantic-interposition # Allow more aggressive optimization in shared libs
-ftree-vectorize # Enable auto-vectorization (usually on with -O3)
-fvect-cost-model=dynamic # Better vectorization cost model
-fprefetch-loop-arrays # Prefetch arrays in loops
-fno-math-errno # Don't set errno for math functions (covered by -ffast-math mostly)
-fno-trapping-math # Allow optimizations that may trap (part of -ffast-math)
-ffinite-math-only # Assume no NaN/Inf (part of -ffast-math)
-fassociative-math # Allow reassociation (part of -ffast-math)
)
target_link_options(
fifosim_options
INTERFACE
-flto=auto # LTO at link time
-Wl,--gc-sections # Remove unused sections
-Wl,--as-needed # Only link needed libraries
-Wl,-O3 # Linker optimization level
-Wl,--hash-style=gnu # Faster symbol lookup
)
#target_link_options(fifosim_options INTERFACE -fsanitize=undefined,address)
endif()

### Enable compiler warnings
option(FIFOSIM_ENABLE_WARNINGS "Enable warnings" ON)
if (FIFOSIM_ENABLE_WARNINGS)
include(cmake/CompilerWarnings.cmake)
fifosim_set_project_warnings(
fifosim_options
OFF
""
""
""
"")
endif (FIFOSIM_ENABLE_WARNINGS)

# Use ccache if available
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message(STATUS "Using ccache for builds")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()

#
# Create options for including cmake files from the cmake folder with a bit of output.
#
macro(check_include)
if(NOT ${ARGC} EQUAL 3)
message(FATAL_ERROR "Call to 'check_include' with ${ARGC} arguments instead of 3")
endif()
OPTION(${ARGV0} "Enable ${ARGV0}" ON)
if (${ARGV0})
message(STATUS "${ARGV1}: enabled")
include(cmake/${ARGV2})
else()
message(STATUS "${ARGV1}: disabled")
endif()
endmacro()

message(STATUS "Checks:")
list(APPEND CMAKE_MESSAGE_INDENT " ") #indent +1
check_include(FIFOSIM_IPO "InterproceduralOptimization" InterproceduralOptimization.cmake)
list(POP_BACK CMAKE_MESSAGE_INDENT) #indent -1

# Collect source files
file(GLOB_RECURSE CORE_SRC src/*.cpp)

# For JSON writing
include(FetchContent)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz)
FetchContent_MakeAvailable(json)

# Add boost for PO
find_package(Boost COMPONENTS program_options REQUIRED)

# Build the simulation library
add_library(SimulationBackendLib SHARED ${CORE_SRC})
target_include_directories(SimulationBackendLib PUBLIC "${CMAKE_BINARY_DIR}") # Include the rtlsim wrapper directory itself
target_include_directories(SimulationBackendLib PUBLIC "$ENV{XILINX_VIVADO}/data/xsim/include") # Add xsim includes
target_include_directories(SimulationBackendLib PUBLIC "include")
target_link_libraries(SimulationBackendLib PUBLIC fifosim::options nlohmann_json::nlohmann_json Threads::Threads OpenMP::OpenMP_CXX -ldl -lrt)

# Build the executable for connected simulations
add_executable(LayerSimulationBackend LayerSimulationBackend.cpp)
target_include_directories(LayerSimulationBackend SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
target_link_libraries(LayerSimulationBackend SimulationBackendLib Boost::program_options)

# Build the executable for isolated simulations
add_executable(IsolatedSimulationBackend IsolatedSimulationBackend.cpp)
target_include_directories(IsolatedSimulationBackend SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
target_link_libraries(IsolatedSimulationBackend SimulationBackendLib Boost::program_options)

OPTION(ENABLE_UNITTESTS "Enable unittests" OFF)
if(${ENABLE_UNITTESTS})
add_subdirectory(unittests)
endif()
Loading
Loading