-
Notifications
You must be signed in to change notification settings - Fork 1k
78 lines (67 loc) · 2.69 KB
/
monthly.yml
File metadata and controls
78 lines (67 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright lowRISC contributors (OpenTitan project).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: Monthly
on:
schedule:
- cron: "00 00 01 * *"
timezone: "Europe/London"
workflow_dispatch:
inputs:
branch:
description: "Branch to run the monthly on"
required: true
type: string
permissions:
id-token: write
contents: read
env:
VIVADO_VERSION: "2021.1"
jobs:
chip_englishbreakfast_cw305:
name: Build English Breakfast Bitstream for CW305
runs-on: ubuntu-22.04-vivado
steps:
- uses: actions/checkout@v6
- name: Prepare environment
uses: ./.github/actions/prepare-env
with:
service_account_json: '${{ secrets.BAZEL_CACHE_CREDS }}'
- name: Build bitstream
run: |
. util/build_consts.sh
bitstream_target=//hw/top_englishbreakfast/bitstream:fpga_cw305
archive_target=//hw/top_englishbreakfast/bitstream:englishbreakfast_cw305_archive
bitstream_archive=$(./bazelisk.sh outquery ${archive_target})
trap 'get_logs' EXIT
get_logs() {
design_name=chip_englishbreakfast_cw305
SUB_PATH="hw/top_englishbreakfast/${design_name}"
mkdir -p "$OBJ_DIR/$SUB_PATH" "$BIN_DIR/$SUB_PATH"
# This can fail if the build result is from Bazel cache
cp -rLvt "$OBJ_DIR/$SUB_PATH/" \
$(./bazelisk.sh outquery-all ${bitstream_target}) || true
# TODO: Splice ROM into the bitstream?
cp -Lv ${bitstream_archive} build-bin.tar
}
# Build the bitstream first. It has an empty ROM (all zeroes).
module load "xilinx/vivado/${VIVADO_VERSION}"
./bazelisk.sh build //hw/top_englishbreakfast/bitstream:englishbreakfast_cw305_archive
tar xvf ${bitstream_archive}
# Build CW305 test rom required by `build-bitstream-vivado.sh`
rom_path="sw/device/lib/testing/test_rom"
./bazelisk.sh build "//${rom_path}:test_rom_fpga_cw305" \
--features=-rv32_bitmanip \
--copt=-DOT_IS_ENGLISH_BREAKFAST_REDUCED_SUPPORT_FOR_INTERNAL_USE_ONLY_
vmem="$(./bazelisk.sh cquery --output=files "//${rom_path}:test_rom_fpga_cw305" \
--features=-rv32_bitmanip \
--copt=-DOT_IS_ENGLISH_BREAKFAST_REDUCED_SUPPORT_FOR_INTERNAL_USE_ONLY_
)"
mkdir -p "build-bin/${rom_path}"
cp "$vmem" "build-bin/${rom_path}"
- name: Upload bitstream
uses: actions/upload-artifact@v7
with:
name: chip_englishbreakfast_cw305
path: build-bin.tar
overwrite: true