Skip to content

Commit

Permalink
Merge pull request f4pga#1638 from HackerFoo/kokoro_200t
Browse files Browse the repository at this point in the history
Configure Kokoro to build the 200t install package
  • Loading branch information
Dusty DeWeese committed Sep 11, 2020
2 parents 552d428 + 18eeded commit 666a8dc
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 3 deletions.
32 changes: 32 additions & 0 deletions .github/kokoro/continuous-install-200t.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Generated from .github/kokoro/kokoro-cfg.py
# To regenerate run:
# cd .github/kokoro/ && python3 kokoro-cfg.py

build_file: "symbiflow-arch-defs-continuous-install-200t/.github/kokoro/install-200t.sh"

timeout_mins: 4320

action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-install-200t*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-continuous-install-200t/"
}
}

env_vars {
key: "KOKORO_TYPE"
value: "continuous"
}

env_vars {
key: "KOKORO_DIR"
value: "symbiflow-arch-defs-continuous-install-200t"
}

env_vars {
key: "SYMBIFLOW_ARCH"
value: "install-200t"
}
52 changes: 52 additions & 0 deletions .github/kokoro/install-200t.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash

# Copied from install.sh
# Only difference is INSTALL_DEVICE in CMAKE_FLAGS and tarball name

SCRIPT_SRC="$(realpath ${BASH_SOURCE[0]})"
SCRIPT_DIR="$(dirname "${SCRIPT_SRC}")"
INSTALL_DIR="$(pwd)/github/${KOKORO_DIR}/install"

export CMAKE_FLAGS="-GNinja -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} -DINSTALL_DEVICE=xc7a200t"
export BUILD_TOOL=ninja
source ${SCRIPT_DIR}/common.sh

echo
echo "========================================"
echo "Running install tests (make install)"
echo "----------------------------------------"
(
source env/conda/bin/activate symbiflow_arch_def_base
pushd build
export VPR_NUM_WORKERS=${CORES}
ninja -j${MAX_CORES} install
popd
)
echo "----------------------------------------"

echo
echo "========================================"
echo "Compressing and uploading install dir"
echo "----------------------------------------"
(
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
)
echo "----------------------------------------"

echo
echo "========================================"
echo "Running installed toolchain tests"
echo "----------------------------------------"
(
source env/conda/bin/activate symbiflow_arch_def_base
pushd build
export VPR_NUM_WORKERS=${CORES}
export CTEST_OUTPUT_ON_FAILURE=1
ctest -R binary_toolchain_test -j${MAX_CORES}
popd
)
echo "----------------------------------------"
2 changes: 1 addition & 1 deletion .github/kokoro/kokoro-cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"""

for type in ['tests', 'docs', 'ice40', 'testarch', 'xc7', 'xc7-vendor',
'xc7a200t', 'xc7a200t-vendor', 'install']:
'xc7a200t', 'xc7a200t-vendor', 'install', 'install-200t']:
with open("continuous-%s.cfg" % type, "w") as f:
f.write(db_full % {
'arch': type,
Expand Down
32 changes: 32 additions & 0 deletions .github/kokoro/presubmit-install-200t.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Generated from .github/kokoro/kokoro-cfg.py
# To regenerate run:
# cd .github/kokoro/ && python3 kokoro-cfg.py

build_file: "symbiflow-arch-defs-presubmit-install-200t/.github/kokoro/install-200t.sh"

timeout_mins: 4320

action {
define_artifacts {
# File types
regex: "**/symbiflow-arch-defs-install-200t*.tar.xz"
strip_prefix: "github/symbiflow-arch-defs-presubmit-install-200t/"
}
}

env_vars {
key: "KOKORO_TYPE"
value: "presubmit"
}

env_vars {
key: "KOKORO_DIR"
value: "symbiflow-arch-defs-presubmit-install-200t"
}

env_vars {
key: "SYMBIFLOW_ARCH"
value: "install-200t"
}
12 changes: 12 additions & 0 deletions xc/xc7/tests/install_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
set(INSTALLATION_DIR_BIN "${CMAKE_INSTALL_PREFIX}/bin")

if(${INSTALL_DEVICE} STREQUAL "xc7a200t")
add_test(NAME binary_toolchain_test
COMMAND ${CMAKE_COMMAND} -E env
PATH=${INSTALLATION_DIR_BIN}:$ENV{PATH}
${CMAKE_COMMAND} -E env
PYTHONPATH=${PRJXRAY_DIR}:${PRJXRAY_DIR}/third_party/fasm
DATABASE_DIR=${PRJXRAY_DB_DIR}
FRAMES2BIT=$<TARGET_FILE:xc7frames2bit>
make PARTNAME=xc7a200tsbg484-1 DEVICE=xc7a200t_test BOARD=nexys_video
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
else()
add_test(NAME binary_toolchain_test
COMMAND ${CMAKE_COMMAND} -E env
PATH=${INSTALLATION_DIR_BIN}:$ENV{PATH}
Expand All @@ -9,3 +20,4 @@ add_test(NAME binary_toolchain_test
FRAMES2BIT=$<TARGET_FILE:xc7frames2bit>
make
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
endif()
10 changes: 8 additions & 2 deletions xc/xc7/tests/install_test/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(patsubst %/,%,$(dir $(mkfile_path)))
TOP:=top
VERILOG:=${current_dir}/counter_basys3.v
PARTNAME:= xc7a35tcpg236-1
DEVICE := xc7a50t_test
BOARD := basys3
BITSTREAM_DEVICE := artix7
PCF=${current_dir}/basys3.pcf
VERILOG:=${current_dir}/counter_${BOARD}.v
PCF=${current_dir}/${BOARD}.pcf
XDC=${current_dir}/counter_${BOARD}.xdc
BUILDDIR:=build

all: ${BUILDDIR}/${TOP}.bit
Expand All @@ -14,7 +16,11 @@ ${BUILDDIR}:
mkdir ${BUILDDIR}

${BUILDDIR}/${TOP}.eblif: | ${BUILDDIR}
ifeq (,$(wildcard ${XDC}))
cd ${BUILDDIR} && symbiflow_synth -t ${TOP} -v ${VERILOG} -d ${BITSTREAM_DEVICE} -p ${PARTNAME}
else
cd ${BUILDDIR} && symbiflow_synth -t ${TOP} -v ${VERILOG} -x ${XDC} -d ${BITSTREAM_DEVICE} -p ${PARTNAME}
endif

${BUILDDIR}/${TOP}.net: ${BUILDDIR}/${TOP}.eblif
cd ${BUILDDIR} && symbiflow_pack -e ${TOP}.eblif -d ${DEVICE}
Expand Down
28 changes: 28 additions & 0 deletions xc/xc7/tests/install_test/counter_nexys_video.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module top (
input wire clk,

input wire [7:0] sw,
output wire [7:0] led,

input wire rx,
output wire tx
);

localparam BITS = 4;
localparam LOG2DELAY = 22;

wire clk_to_bufg;
IBUF clk_ibuf(.I(clk), .O(clk_to_bufg));

wire bufg;
BUFG bufgctrl(.I(clk_to_bufg), .O(bufg));

reg [BITS+LOG2DELAY-1:0] counter = 0;

always @(posedge bufg) begin
counter <= counter + 1;
end

assign led[6:0] = counter >> LOG2DELAY;
assign led[7] = ^sw;
endmodule
20 changes: 20 additions & 0 deletions xc/xc7/tests/install_test/counter_nexys_video.xdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set_property IOSTANDARD LVCMOS33 [get_ports clk]

set_property IOSTANDARD LVCMOS25 [get_ports {led[0]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[1]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[2]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[3]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[4]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[5]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[6]}]
set_property IOSTANDARD LVCMOS25 [get_ports {led[7]}]

set_property IOSTANDARD LVCMOS12 [get_ports {sw[0]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[1]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[2]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[3]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[4]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[5]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[6]}]
set_property IOSTANDARD LVCMOS12 [get_ports {sw[7]}]

26 changes: 26 additions & 0 deletions xc/xc7/tests/install_test/nexys_video.pcf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# nexys-video 100 MHz CLK
set_io clk R4

# sw[0:7] correspond with SW0-SW7 on the nexys-video
set_io sw[0] E22
set_io sw[1] F21
set_io sw[2] G21
set_io sw[3] G22
set_io sw[4] H17
set_io sw[5] J16
set_io sw[6] K13
set_io sw[7] M17

# led[0:7] correspond with LD0-LD7 on the nexys-video
set_io led[0] T14
set_io led[1] T15
set_io led[2] T16
set_io led[3] U16
set_io led[4] V15
set_io led[5] W16
set_io led[6] W15
set_io led[7] Y13

# UART bridge
set_io tx AA19
set_io rx V18

0 comments on commit 666a8dc

Please sign in to comment.