Skip to content
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

[WIP] Data driven toolchain wrappers #2225

Closed
wants to merge 53 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
fff3a03
Initial attempts at better toolchain flow wrappers written in python
kboronski Jul 5, 2021
e1ded78
WIP data-driven flow setup
kboronski Jul 6, 2021
937f1ae
symbiflow.py supports synthesis stage
kboronski Jul 7, 2021
fcaf2a1
WIP data-driver packaging stage support
kboronski Jul 7, 2021
c56a49e
Fixed top.net generation
kboronski Jul 8, 2021
755863d
Changed vpr_options to a dictionary and added the ability to overload…
kboronski Jul 8, 2021
bce5e55
A fundamentally different apporoach (WIP)
kboronski Jul 12, 2021
4b13f8e
Removed a line of questionable code
kboronski Jul 13, 2021
36a4321
Synth stage is now functional within the new module-based approach
kboronski Jul 13, 2021
f3775b8
code cleanup
kboronski Jul 14, 2021
231c325
Added WIP pack module
kboronski Jul 14, 2021
c48c6f9
Packing module is now functional
kboronski Jul 14, 2021
bb9e5f8
WIP dependency deduction
kboronski Jul 15, 2021
1a5dfce
Massive changes, flow deduction seems to be working now
kboronski Jul 19, 2021
a8f31ff
WIP change racking
kboronski Jul 19, 2021
3b52053
Updated arty_100 flow definition
kboronski Jul 21, 2021
fd7eff4
Added constraint stage modules
kboronski Jul 21, 2021
7036141
synth and pack refactoring
kboronski Jul 21, 2021
59ce0f6
Modification tracking and pretend mode
kboronski Jul 21, 2021
a6c6e5c
WIP place stage wrapper
kboronski Jul 21, 2021
4eab5dc
place stage is working now
kboronski Jul 22, 2021
010543f
minor fix to pack module ouput move routine
kboronski Jul 22, 2021
daef9a1
route module
kboronski Jul 22, 2021
f099151
WIP FASM module
kboronski Jul 22, 2021
c1736f1
FASM module
kboronski Jul 22, 2021
3760754
Redesigned flow definition system to not included redundant info and …
kboronski Jul 23, 2021
1d32582
xc7 fasm2bitsream module
kboronski Jul 23, 2021
e9271f5
Pack stage fix
kboronski Jul 26, 2021
481aa5c
module context class for providing a useful API for modules
kboronski Jul 26, 2021
b2ab951
Attribute-based dependencies in modules
kboronski Jul 27, 2021
7fa4095
Some comments explaining stuff
kboronski Jul 27, 2021
49732c7
More comments
kboronski Jul 28, 2021
15caf4b
Cleanup and comments
kboronski Jul 28, 2021
d41ed11
dirty install
kboronski Jul 28, 2021
75d0cb8
moved setup_stage_arg_parser to symbiflow_module.py
kboronski Jul 28, 2021
0183bea
minor cosmetic changes
kboronski Jul 28, 2021
ee8efa6
Module i/o parametrization and mkdirs module
kboronski Jul 29, 2021
1c49a4a
An attampt on installation script and project organization
kboronski Aug 2, 2021
26431fe
Structural fixes
kboronski Aug 2, 2021
ab47c0b
Changed module declarations
kboronski Aug 2, 2021
ea08a54
Restructured sfbuild python pacjkage
kboronski Aug 3, 2021
8fe243f
modstr parsing
kboronski Aug 3, 2021
72f50eb
sfbuild installation and xc7a50t platform support
kboronski Aug 3, 2021
36337f9
Added a workaround fo missing sfbuild package
kboronski Aug 4, 2021
7b9df43
Removed a leftover file
kboronski Aug 4, 2021
2643e09
Added a Getting Started document
kboronski Aug 4, 2021
df290e3
Some changes and fixes to the doc
kboronski Aug 4, 2021
3e80370
Updated the docs
kboronski Aug 5, 2021
16ebcdb
Added an example for info mode to the GettingStarted doc
kboronski Aug 5, 2021
ced023f
Added qutes to a section in the document
kboronski Aug 5, 2021
7c7bb11
Changed the getting started section a little
kboronski Aug 5, 2021
56caa79
Removed a garbage python script
kboronski Aug 5, 2021
d9a9185
Flow deduction reworked, new caching system (WIP)
kboronski Aug 5, 2021
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ add_subdirectory(ice40)
add_subdirectory(quicklogic)
add_subdirectory(testarch)
add_subdirectory(tests)
add_subdirectory(sfbuild)

get_target_property_required(YAPF env YAPF)
add_custom_target(
Expand Down
155 changes: 155 additions & 0 deletions sfbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
# Installs sfbuild - experimental Symbiflow Build System

function(INSTALL_DIR)
# Create directory during installation phase
set(options)
set(one_value_args INSTALL_DIRECTORY)
set(multi_value_args)
cmake_parse_arguments(
INSTALL_DIR
"${options}"
"${one_value_args}"
"${multi_value_args}"
${ARGN}
)

set(make_dir_code "file(MAKE_DIRECTORY ${INSTALL_DIR_INSTALL_DIRECTORY})")
install(CODE ${make_dir_code})

endfunction()

function(INSTALL_DIR_CONTENT)
# Install files from ROOT_DIRECTORY/FILES_DIRECTORY directory into a FILES_DIRECTORY subdirectory of INSTALL_DIRECTORY
set(options)
set(one_value_args
ROOT_DIRECTORY
FILES_DIRECTORY
DESTINATION)
set(multi_value_args
FILES
INSTALL_OPTS)
cmake_parse_arguments(
INSTALL_DIR_CONTENT
"${options}"
"${one_value_args}"
"${multi_value_args}"
${ARGN}
)

if(NOT DEFINED INSTALL_DIR_CONTENT_ROOT_DIRECTORY)
set(INSTALL_DIR_CONTENT_ROOT_DIRECTORY .)
endif()
if(NOT DEFINED INSTALL_DIR_CONTENT_FILES_DIRECTORY)
set(INSTALL_DIR_CONTENT_FILES_DIRECTORY .)
endif()

set(file_paths)
foreach(file ${INSTALL_DIR_CONTENT_FILES})
list(APPEND file_paths ${INSTALL_DIR_CONTENT_ROOT_DIRECTORY}/${INSTALL_DIR_CONTENT_FILES_DIRECTORY}/${file})
endforeach()

install(FILES ${file_paths}
DESTINATION ${INSTALL_DIR_CONTENT_DESTINATION}/${INSTALL_DIR_CONTENT_FILES_DIRECTORY}
${INSTALL_DIR_CONTENT_INSTALL_OPTS})

endfunction()


find_package(Python3 COMPONENTS Interpreter REQUIRED)

get_target_property_required(VPR env VPR)
get_target_property_required(GENFASM env GENFASM)

set(SFBUILD_SUPPORTED_PLATFORMS
xc7a50t
xc7a100t)

# Create required directories
foreach(DIR_PATH ${SFBUILD_DIRECTORIES})
install_dir(INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin/${DIR_PATH})
endforeach()

# Install sfbuild
install_dir_content(
FILES
__init__.py
setup.py
sfbuild.py
sf_cache.py
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
install_dir_content(
FILES __init__.py
FILES_DIRECTORY sf_common
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
install_dir_content(
FILES __init__.py
FILES_DIRECTORY sf_module
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
# Install common modules
install_dir_content(
FILES
fasm.py
ioplace.py
mkdirs.py
pack.py
place_constraints.py
place.py
route.py
synth.py
FILES_DIRECTORY sf_common_modules
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
# Install XC7 modules
install_dir_content(
FILES bitstream.py
FILES_DIRECTORY sf_xc7_modules
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
# Install QuickLogic modules
install_dir_content(
FILES bitstream.py
FILES_DIRECTORY sf_quicklogic_modules
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
# Install platform flow definitions
set(sfbuild_supported_platform_defs)
foreach(SFBUILD_PLATFORM ${SFBUILD_SUPPORTED_PLATFORMS})
set(sfbuild_platform_def "${SFBUILD_PLATFORM}.json")
list(APPEND sfbuild_supported_platform_defs ${sfbuild_platform_def})
endforeach()
install_dir_content(
FILES ${sfbuild_supported_platform_defs}
FILES_DIRECTORY platforms
DESTINATION bin/sfbuild
INSTALL_OPTS
PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ GROUP_READ)

# Detect virtualenv and set pip args accordingly
if(DEFINED ENV{VIRTUAL_ENV} OR DEFINED ENV{CONDA_PREFIX})
set(_PIP_ARGS)
else()
set(_PIP_ARGS "--user")
endif()

# Install sfbuild python package *this will allow users to access python modules required to write their Symbiflow Modules.

# ! THIS IS NOT WORKING.
# For some reason running ${Python3_EXECUTABLE} -m pip install -e ${CMAKE_INSTALL_PREFIX}/bin/sfbuild ${_PIP_ARGS}
# does not install the package correctly. Most likely the pip module is not he one provided by conda, but idk.
# Calling which pip3 in CMake with conda's virtualenv also seems to fail.
# Currently the sfbuild python module needs to be installed manually if you want to be able to access it anywhere.

# set(PIP3)
# execute_process(COMMAND "which pip3"
# OUTPUT_VARIABLE PIP3)
# set(PYTHON_PKG_INSTALL_CODE "execute_process(COMMAND ${PIP3} install -e ${CMAKE_INSTALL_PREFIX}/bin/sfbuild ${_PIP_ARGS})")
# install(CODE ${PYTHON_PKG_INSTALL_CODE})
1 change: 1 addition & 0 deletions sfbuild/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import sfbuild
Loading