Skip to content

Commit

Permalink
Merge pull request #1796 from antmicro/package-also-circuits
Browse files Browse the repository at this point in the history
Package also circuits
  • Loading branch information
litghost committed Dec 1, 2020
2 parents ff71ca7 + 4f157a5 commit a6eb1c1
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/kokoro/continuous-install-200t.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-install-200t*.tar.xz"
regex: "**/symbiflow-arch-defs-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-continuous-install-200t/"
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/continuous-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-install*.tar.xz"
regex: "**/symbiflow-arch-defs-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-continuous-install/"
}
}
Expand Down
5 changes: 2 additions & 3 deletions .github/kokoro/install-200t.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ echo "----------------------------------------"
(
rm -rf build
du -ah install
pushd install
export GIT_HASH=$(git rev-parse --short HEAD)
tar vcf - * | xz -9 -T${MAX_CORES} - > ../symbiflow-arch-defs-install-200t-${GIT_HASH}.tar.xz
popd
tar cfJv symbiflow-arch-defs-install-200t-${GIT_HASH}.tar.xz -C install bin share environment.yml
tar cfJv symbiflow-arch-defs-benchmarks-200t-${GIT_HASH}.tar.xz -C install benchmarks
)
echo "----------------------------------------"
5 changes: 2 additions & 3 deletions .github/kokoro/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ echo "----------------------------------------"
(
rm -rf build
du -ah install
pushd install
export GIT_HASH=$(git rev-parse --short HEAD)
tar vcf - * | xz -9 -T${MAX_CORES} - > ../symbiflow-arch-defs-install-${GIT_HASH}.tar.xz
popd
tar cfJv symbiflow-arch-defs-install-${GIT_HASH}.tar.xz -C install bin share environment.yml
tar cfJv symbiflow-arch-defs-benchmarks-${GIT_HASH}.tar.xz -C install benchmarks
)
echo "----------------------------------------"

Expand Down
10 changes: 2 additions & 8 deletions .github/kokoro/kokoro-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
"""

INSTALL = """\
regex: "**/symbiflow-arch-defs-install*.tar.xz"\
"""

INSTALL_200T = """\
regex: "**/symbiflow-arch-defs-install-200t*.tar.xz"\
regex: "**/symbiflow-arch-defs-*.tar.xz"\
"""

DB_FULL = """\
Expand Down Expand Up @@ -61,10 +57,8 @@

for type in ['tests', 'docs', 'ice40', 'testarch', 'xc7', 'xc7-vendor',
'xc7a200t', 'xc7a200t-vendor', 'ql', 'install', 'install-200t']:
if type == 'install':
if 'install' in type:
artifacts = INSTALL
elif type == 'install-200t':
artifacts = INSTALL_200T
else:
artifacts = DEFAULT_ARTIFACTS

Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/presubmit-install-200t.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-install-200t*.tar.xz"
regex: "**/symbiflow-arch-defs-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-presubmit-install-200t/"
}
}
Expand Down
2 changes: 1 addition & 1 deletion .github/kokoro/presubmit-install.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-install*.tar.xz"
regex: "**/symbiflow-arch-defs-*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-presubmit-install/"
}
}
Expand Down
43 changes: 42 additions & 1 deletion common/cmake/devices.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,7 @@ function(ADD_FPGA_TARGET)
# [ASSERT_USAGE <usage_spec>]
# [DEFINES <definitions>]
# [BIT_TO_V_EXTRA_ARGS]
# [INSTALL_CIRCUIT]
# )
# ~~~
#
Expand All @@ -1179,6 +1180,14 @@ function(ADD_FPGA_TARGET)
# DEFINES is a list of environment variables to be defined during Yosys
# invocation.
#
# INSTALL_CIRCUIT is an option that enables installing the generated eblif circuit
# file in the install destination directory. Also the generates/user-provided SDC
# (if present), gets installed as well.
# - eblif destination: <install_directory>/benchmarks/circuits
# - sdc destination: <install_directory>/benchmarks/sdc
# To avoid name conflicts, the eblif file name, as well as the SDC name, are replaced
# with the NAME of the FPGA test target
#
# Targets generated:
#
# * <name>_eblif - Generated eblif file.
Expand All @@ -1197,7 +1206,7 @@ function(ADD_FPGA_TARGET)
# * ${TOP}.route - Place and routed design (http://docs.verilogtorouting.org/en/latest/vpr/file_formats/#routing-file-format-route)
# * ${TOP}.${BITSTREAM_EXTENSION} - Bitstream for target.
#
set(options EXPLICIT_ADD_FILE_TARGET EMIT_CHECK_TESTS NO_SYNTHESIS ROUTE_ONLY)
set(options EXPLICIT_ADD_FILE_TARGET EMIT_CHECK_TESTS NO_SYNTHESIS ROUTE_ONLY INSTALL_CIRCUIT)
set(oneValueArgs NAME TOP BOARD INPUT_IO_FILE EQUIV_CHECK_SCRIPT AUTOSIM_CYCLES ASSERT_USAGE INPUT_XDC_FILE INPUT_SDC_FILE)
set(multiValueArgs SOURCES TESTBENCH_SOURCES DEFINES BIT_TO_V_EXTRA_ARGS)
cmake_parse_arguments(
Expand Down Expand Up @@ -1447,16 +1456,48 @@ function(ADD_FPGA_TARGET)
message(FATAL_ERROR "SDC and XDC constraint files cannot be provided simultaneously!")
endif()

set(SDC_FILE "")
set(SDC_DEPS "")
if(NOT "${ADD_FPGA_TARGET_INPUT_XDC_FILE}" STREQUAL "")
append_file_dependency(VPR_DEPS ${OUT_SDC_REL})
get_file_location(SDC_LOCATION ${OUT_SDC_REL})
set(SDC_ARG --sdc_file ${SDC_LOCATION})
set(SDC_FILE ${SDC_LOCATION})
set(SDC_DEPS ${OUT_SDC_REL})
endif()

if(NOT "${ADD_FPGA_TARGET_INPUT_SDC_FILE}" STREQUAL "")
append_file_dependency(VPR_DEPS ${ADD_FPGA_TARGET_INPUT_SDC_FILE})
get_file_location(SDC_LOCATION ${ADD_FPGA_TARGET_INPUT_SDC_FILE})
set(SDC_ARG --sdc_file ${SDC_LOCATION})
set(SDC_FILE ${SDC_LOCATION})
set(SDC_DEPS ${ADD_FPGA_TARGET_INPUT_SDC_FILE})
endif()

if (${ADD_FPGA_TARGET_INSTALL_CIRCUIT})
set(INSTALL_DEPS "")
append_file_dependency(INSTALL_DEPS ${OUT_EBLIF_REL})

install(
FILES ${OUT_EBLIF}
RENAME ${NAME}.eblif
DESTINATION "benchmarks/circuits"
)

if (NOT SDC_FILE STREQUAL "")
install(
FILES ${SDC_FILE}
RENAME ${NAME}.sdc
DESTINATION "benchmarks/sdc"
)
append_file_dependency(INSTALL_DEPS ${SDC_DEPS})
endif()

add_custom_target(
"INSTALL_${NAME}_CIRCUIT"
ALL
DEPENDS ${INSTALL_DEPS}
)
endif()

# Generate routing and generate HLC.
Expand Down
2 changes: 2 additions & 0 deletions common/cmake/litex.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function(ADD_LITEX_TEST)
${EXTERNAL_SOURCES}
INPUT_XDC_FILE ${LITEX_GATEWARE}/top.xdc
EXPLICIT_ADD_FILE_TARGET
INSTALL_CIRCUIT
)
else()
add_fpga_target(
Expand All @@ -103,6 +104,7 @@ function(ADD_LITEX_TEST)
INPUT_IO_FILE ${LITEX_GATEWARE}/top.pcf
INPUT_SDC_FILE ${LITEX_GATEWARE}/top.sdc
EXPLICIT_ADD_FILE_TARGET
INSTALL_CIRCUIT
)
endif()

Expand Down
1 change: 1 addition & 0 deletions tests/9-soc/murax/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ foreach(FREQ ${BASYS_FREQS})
Murax.v
INPUT_IO_FILE basys3-full.pcf
EXPLICIT_ADD_FILE_TARGET
INSTALL_CIRCUIT
)

math(EXPR PERIOD "1000 / ${FREQ}" OUTPUT_FORMAT DECIMAL)
Expand Down
1 change: 1 addition & 0 deletions tests/9-soc/picosoc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ foreach(FREQ ${BASYS3_FREQS})
INPUT_XDC_FILE basys3.xdc
INPUT_IO_FILE ${BASYS3_PCF}
EXPLICIT_ADD_FILE_TARGET
INSTALL_CIRCUIT
)

math(EXPR PERIOD "1000 / ${FREQ}" OUTPUT_FORMAT DECIMAL)
Expand Down
1 change: 1 addition & 0 deletions xc/xc7/tests/counter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ add_fpga_target(
SOURCES counter_basys3.v
INPUT_IO_FILE ${COMMON}/basys3.pcf
EXPLICIT_ADD_FILE_TARGET
INSTALL_CIRCUIT
)

add_vivado_target(
Expand Down
1 change: 1 addition & 0 deletions xc/xc7/tests/soc/ibex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ add_fpga_target(
INPUT_IO_FILE pins_artya7.pcf
INPUT_SDC_FILE pins_artya7.sdc
EXPLICIT_ADD_FILE_TARGET
INSTALL_CIRCUIT
)

add_vivado_target(
Expand Down

0 comments on commit a6eb1c1

Please sign in to comment.