-
Notifications
You must be signed in to change notification settings - Fork 21
144 lines (124 loc) · 3.85 KB
/
test.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
##
# Copyright 2023,2024 Cesar Fuguet
#
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
#
# Licensed under the Solderpad Hardware License v 2.1 (the “License”); you
# may not use this file except in compliance with the License, or, at your
# option, the Apache License version 2.0. You may obtain a copy of the
# License at
#
# https://solderpad.org/licenses/SHL-2.1/
#
# Unless required by applicable law or agreed to in writing, any work
# distributed under the License is distributed on an “AS IS” BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
##
##
# Author : Cesar Fuguet
# Date : October, 2024
# Description: GitHub Action to run tests on pull requests and pushes
##
name: HPDcache Test CI
on:
push:
paths-ignore:
- 'docs'
- '*.md'
- 'CODEOWNERS'
- 'LICENSE'
pull_request:
paths-ignore:
- 'docs'
- '*.md'
- 'CODEOWNERS'
- 'LICENSE'
jobs:
build-and-run:
name: build-and-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
# Install Dependencies
- name: Install Dependencies
shell: bash
run: |
./.github/scripts/install_deps_ubuntu.sh
# Install SystemC
- name: Cache SystemC
id: cache-systemc
uses: actions/cache@v4
with:
path: build/systemc-3.0.1
key: ${{ runner.os }}-build-systemc-${{ hashFiles('.github/scripts/install_systemc.sh') }}
- name: Install SystemC
shell: bash
run: |
. .github/scripts/env.sh
./.github/scripts/install_systemc.sh
# Install Verilator
- name: Cache Verilator
id: cache-verilator
uses: actions/cache@v4
with:
path: build/verilator-v5.028
key: ${{ runner.os }}-build-verilator-${{ hashFiles('.github/scripts/install_verilator.sh') }}
- name: Install Verilator
shell: bash
run: |
. .github/scripts/env.sh
./.github/scripts/install_verilator.sh
# Verilate the HPDcache RTL sources and build the testbench
- name: Verilate the HPDcache RTL
id: verilate
shell: bash
run: |
. .github/scripts/env.sh
cd rtl/tb
make verilate
- name: Archive Verilate log
if: ${{ failure () && steps.verilate.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: verilate-log
path: rtl/tb/build/verilate.log
- name: Build SystemC testbench
id: build-tb
shell: bash
run: |
. .github/scripts/env.sh
cd rtl/tb
make build -j${PARALLEL_JOBS}
- name: Archive SystemC build log
if: ${{ failure () && steps.build-tb.conclusion == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: build-log
path: rtl/tb/build/build.log
# Run the tests
- name: Run the random test sequence (short)
shell: bash
run: |
. .github/scripts/env.sh
cd rtl/tb
make nonregression SEQUENCE=random NTESTS=128 NTRANSACTIONS=5000
- name: Run the random test sequence (long)
shell: bash
run: |
. .github/scripts/env.sh
cd rtl/tb
make nonregression SEQUENCE=random NTESTS=16 NTRANSACTIONS=100000
- name: Run the single addr test sequence
shell: bash
run: |
. .github/scripts/env.sh
cd rtl/tb
make nonregression SEQUENCE=single_addr NTESTS=64 NTRANSACTIONS=5000
- name: Archive nonregression logs
if: ${{ failure () }}
uses: actions/upload-artifact@v4
with:
name: run-log
path: rtl/tb/logs