Skip to content

Commit

Permalink
Move yosys_mod to src directory (#2557)
Browse files Browse the repository at this point in the history
This PR cleans repository structure by moving `yosys_mod` to source
directory.
  • Loading branch information
kamilrakoczy authored Sep 13, 2024
2 parents acc32b2 + 44cc18d commit c088288
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/format_sources.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash

find third_party/yosys_mod src/ \
find src/ \
-name "*.h" -o -name "*.cc" \
| xargs clang-format -i
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ src/*.d
src/*.o
src/frontends/systemverilog/*.d
src/frontends/systemverilog/*.o
third_party/yosys_mod/*.d
third_party/yosys_mod/*.o
src/mods/yosys_ast/*.d
src/mods/yosys_ast/*.o
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ set(synlig_SRC
${PROJECT_SOURCE_DIR}/src/frontends/systemverilog/uhdm_surelog_ast_frontend.cc
${PROJECT_SOURCE_DIR}/src/frontends/systemverilog/uhdm_ast.cc
${PROJECT_SOURCE_DIR}/src/frontends/systemverilog/uhdm_common_frontend.cc
${PROJECT_SOURCE_DIR}/third_party/yosys_mod/synlig_const2ast.cc
${PROJECT_SOURCE_DIR}/third_party/yosys_mod/synlig_edif.cc
${PROJECT_SOURCE_DIR}/third_party/yosys_mod/synlig_simplify.cc)
${PROJECT_SOURCE_DIR}/src/mods/yosys_ast/synlig_const2ast.cc
${PROJECT_SOURCE_DIR}/src/mods/yosys_ast/synlig_edif.cc
${PROJECT_SOURCE_DIR}/src/mods/yosys_ast/synlig_simplify.cc)

add_library(synlig SHARED ${synlig_SRC})

Expand Down Expand Up @@ -306,7 +306,7 @@ target_include_directories(
PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/frontends/systemverilog/>
$<INSTALL_INTERFACE:include>)
target_include_directories(
synlig PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/third_party/yosys_mod/>
synlig PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/mods/yosys_ast/>
$<INSTALL_INTERFACE:include>)
target_include_directories(
synlig PUBLIC $<BUILD_INTERFACE:${SURELOG_INCLUDE_DIRS}>
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ THIS_MK_DIR := $(patsubst /%/,/%,$(dir $(THIS_MK_FILE)))

REPO_DIR := $(abspath $(THIS_MK_DIR)/..)
YOSYS_SRC := $(REPO_DIR)/third_party/yosys
YOSYS_MOD_SRC := $(REPO_DIR)/third_party/yosys_mod
YOSYS_MOD_SRC := $(REPO_DIR)/src/mods/yosys_ast
SYNLIG_FRONTENDS_SRC := $(REPO_DIR)/src/frontends
SYNLIG_SRC := $(REPO_DIR)/src
ifeq ($(SYNLIG_BUILD_TYPE),asan)
Expand Down
9 changes: 5 additions & 4 deletions src/frontends/systemverilog/Build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ cxx_is_clang := $(findstring clang,$(notdir ${CXX}))

${ts}.src_dir := $(call ToAbsDirPaths,$(dir ${THIS_BUILD_MK}))
${ts}.out_build_dir := ${out_dir}
${ts}.mod_dir := ${TOP_DIR}src/mods/yosys_ast/

${ts}.sources := \
${${ts}.src_dir}compat_symbols.cc \
${${ts}.src_dir}uhdm_ast.cc \
${${ts}.src_dir}uhdm_ast_frontend.cc \
${${ts}.src_dir}uhdm_common_frontend.cc \
${${ts}.src_dir}uhdm_surelog_ast_frontend.cc \
${$(call GetTargetStructName,yosys).mod_dir}synlig_const2ast.cc \
${$(call GetTargetStructName,yosys).mod_dir}synlig_edif.cc \
${$(call GetTargetStructName,yosys).mod_dir}synlig_simplify.cc
${${ts}.mod_dir}synlig_const2ast.cc \
${${ts}.mod_dir}synlig_edif.cc \
${${ts}.mod_dir}synlig_simplify.cc

define ${ts}.env =
export PKG_CONFIG_PATH=$(call ShQuote,${$(call GetTargetStructName,surelog).output_vars.PKG_CONFIG_PATH}$(if ${PKG_CONFIG_PATH},:${PKG_CONFIG_PATH}))
Expand All @@ -36,7 +37,7 @@ endif

${ts}.cxxflags = \
-I${$(call GetTargetStructName,yosys).src_dir} \
-I${$(call GetTargetStructName,yosys).mod_dir} \
-I${${ts}.mod_dir} \
-D_YOSYS_ \
-DYOSYS_ENABLE_PLUGINS \
$(shell ${${ts}.env}; pkg-config --cflags Surelog) \
Expand Down
4 changes: 4 additions & 0 deletions src/mods/yosys_ast/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

OBJS += $(REPO_DIR)/src/mods/yosys_ast/synlig_const2ast.o
OBJS += $(REPO_DIR)/src/mods/yosys_ast/synlig_edif.o
OBJS += $(REPO_DIR)/src/mods/yosys_ast/synlig_simplify.o
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion third_party/Build.yosys.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ts := $(call GetTargetStructName,${t})
cxx_is_clang := $(findstring clang,$(notdir ${CXX}))

${ts}.src_dir := ${TOP_DIR}third_party/yosys/
${ts}.mod_dir := ${TOP_DIR}third_party/yosys_mod/
${ts}.out_install_dir := $(call ToAbsPaths,${OUT_DIR})

${ts}.output_files := \
Expand Down
4 changes: 0 additions & 4 deletions third_party/yosys_mod/Makefile.inc

This file was deleted.

0 comments on commit c088288

Please sign in to comment.