diff --git a/.gitmodules b/.gitmodules index 9f18be11e..8970d5e46 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,3 +5,6 @@ [submodule "cxxopts"] path = libs/cxxopts url = https://github.com/jarro2783/cxxopts +[submodule "libs/yosys-slang"] + path = libs/yosys-slang + url = https://github.com/mmicko/yosys-slang diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index ae13387c0..da8c4b66f 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -7,3 +7,19 @@ add_subdirectory(json11) add_subdirectory(minisat) add_subdirectory(sha1) add_subdirectory(subcircuit) + +# Link yosys slang +set(_old_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}") +set(BUILD_SHARED_LIBS OFF) +set(BUILD_AS_PLUGIN OFF) +set(YOSYS_SLANG_OBJECT_LIBRARY ON) +add_subdirectory(yosys-slang) +set(BUILD_SHARED_LIBS "${_old_BUILD_SHARED_LIBS}") +set_target_properties(yosys-slang PROPERTIES + YOSYS_IS_ABC ON # Do not error on warning + YOSYS_COMPONENT YES + YOSYS_REQUIRES "" + YOSYS_ENABLE_IF TRUE +) +add_library(yosys_read_slang ALIAS yosys-slang) +set_property(TARGET yosys_everything APPEND PROPERTY YOSYS_REQUIRES read_slang) diff --git a/libs/yosys-slang b/libs/yosys-slang new file mode 160000 index 000000000..0b5c0b333 --- /dev/null +++ b/libs/yosys-slang @@ -0,0 +1 @@ +Subproject commit 0b5c0b333887678a41825f99093a8b0af32d80d2