Skip to content

Commit

Permalink
test: Fix and add IP testbenches missing from CI (#95)
Browse files Browse the repository at this point in the history
* hw: Fix syntax in IP testbench compile scripts

* hw: Canonicalize SSR verification, add to CI

* hw: Fix `reqrsp_to_axi_tb` and underlying issue in `reqrsp_test`

* gitlab-ci: Preliminarily add `reqrsp_interface` CI

* hw: Also fix and enable `tb_axi_to_reqrsp`
  • Loading branch information
paulsc96 authored Jun 19, 2024
1 parent dc4a6a6 commit 44ca8c4
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 40 deletions.
5 changes: 2 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ snitch-cluster-sw-banshee:
# - snitch_ipu
# - snitch_dma
# - snitch
# Currently failing IP tests/scripts:
# - reqrsp_interface
# - snitch_ssr
snitch-ip-tests:
needs: []
parallel:
Expand All @@ -69,6 +66,8 @@ snitch-ip-tests:
- mem_interface
- snitch_cluster
- tcdm_interface
- snitch_ssr
- reqrsp_interface
script:
- cd hw/$IP
- ./util/compile.sh
Expand Down
4 changes: 2 additions & 2 deletions hw/reqrsp_interface/src/reqrsp_test.sv
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package reqrsp_test;
amo inside {
AMOSwap, AMOAdd, AMOAnd,
AMOOr, AMOXor, AMOMax,
AMOMaxu, AMOMin, AMOMinu, AMOSC} -> write == 1;
AMOMaxu, AMOMin, AMOMinu, AMOLR, AMOSC} -> write == 0;
}

// Reduce the amount of atomics.
Expand All @@ -36,7 +36,7 @@ package reqrsp_test;
is_amo -> amo inside {
AMOSwap, AMOAdd, AMOAnd,
AMOOr, AMOXor, AMOMax,
AMOMaxu, AMOMin, AMOMinu
AMOMaxu, AMOMin, AMOMinu, AMOLR, AMOSC
};
}

Expand Down
4 changes: 2 additions & 2 deletions hw/reqrsp_interface/test/axi_to_reqrsp_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module axi_to_reqrsp_tb import reqrsp_pkg::*; #(
reqrsp_monitor.rsp_mbx.get(rsp);

// Check that we have seen the appropriate transactions on the inputs.
if (req.write) begin
if (req.write | is_amo(req.amo) | (req.amo == AMOSC)) begin
axi_monitor.aw_mbx.peek(ax);
axi_monitor.w_mbx.get(w);
// Invert bits as this is signalled as a clear condition on AXI.
Expand All @@ -149,7 +149,7 @@ module axi_to_reqrsp_tb import reqrsp_pkg::*; #(
else $error("[Write Strb] Expected `%h` got `%h`", w.w_strb, req.strb);
assert(req.data == w.w_data)
else $error("[Write Data] Expected `%h` got `%h`", w.w_data, req.data);
assert(req.write == 1);
assert(req.write == (req.amo == AMONone));
assert (
req.addr ==
axi_pkg::beat_addr(ax.ax_addr, ax.ax_size, ax.ax_len, ax.ax_burst, id_cnt_write)
Expand Down
4 changes: 2 additions & 2 deletions hw/reqrsp_interface/test/reqrsp_to_axi_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ module reqrsp_to_axi_tb import reqrsp_pkg::*; #(
reqrsp_monitor.req_mbx.get(req);
// check fields match
// Writes and atomics.
// For each write the reqrsp bus we want to see a `aw` beat.
if (req.write) begin
// For each "AXI" write (i.e. incl. ATOPs) on the reqrsp bus we want to see a `aw` beat.
if (req.write | is_amo(req.amo) | (req.amo == AMOSC)) begin
axi_monitor.aw_mbx.get(ax);
axi_monitor.w_mbx.get(w);

Expand Down
2 changes: 1 addition & 1 deletion hw/reqrsp_interface/util/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e

[ ! -z "$VSIM" ] || VSIM=vsim

$(BENDER) script vsim -t test \
$BENDER script vsim -t test \
--vlog-arg="-svinputport=compat" \
--vlog-arg="-override_timescale 1ns/1ps" \
--vlog-arg="-suppress 2583" \
Expand Down
2 changes: 1 addition & 1 deletion hw/snitch_ssr/test/tb_simple_ssr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module tb_simple_ssr;
localparam int unsigned NumLoops = 4;

// Test data parameters
localparam string DataFile = "../test/tb_simple_ssr.hex";
localparam string DataFile = "./test/tb_simple_ssr.hex";
localparam int unsigned ValBase = 'h0;
localparam int unsigned IdxBase = 'h2000;
localparam int unsigned IdxStride = 'h800; // Stride of index arrays of different sizes
Expand Down
2 changes: 1 addition & 1 deletion hw/snitch_ssr/test/tb_simple_ssr_streamer.sv
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module tb_simple_ssr_streamer;
localparam int unsigned WPorts = 1;

// Test data parameters
localparam string DataFile = "../test/tb_simple_ssr_streamer.hex";
localparam string DataFile = "./test/tb_simple_ssr_streamer.hex";
localparam int unsigned ValBase = 'h0;
localparam int unsigned IdxBase = 'h2000;
localparam int unsigned IdxStride = 'h800; // Stride of index arrays of different sizes
Expand Down
2 changes: 1 addition & 1 deletion hw/snitch_ssr/util/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set -e

[ ! -z "$VSIM" ] || VSIM=vsim

$(BENDER) script vsim -t test \
$BENDER script vsim -t test \
--vlog-arg="-svinputport=compat" \
--vlog-arg="-override_timescale 1ns/1ps" \
--vlog-arg="-suppress 2583" \
Expand Down
24 changes: 24 additions & 0 deletions hw/snitch_ssr/util/run_vsim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# Copyright 2024 ETH Zurich and University of Bologna.
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51
#
# Fabian Schuiki <[email protected]>
# Andreas Kurth <[email protected]>
# Paul Scheffler <[email protected]>

set -e
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)

[ ! -z "$VSIM" ] || VSIM=vsim

call_vsim() {
# We treat accessing unwritten associative array (memory) locations as fatal
echo "log -r /*; run -all" | $QUESTA_SEPP $VSIM -c -coverage -voptargs='+acc +cover=sbecft' "$@" -fatal vsim-3829 | tee vsim.log 2>&1
(grep "SUCCESS" transcript)
(! grep -n "Fatal:" transcript)
(! grep -n "Error:" transcript)
}

call_vsim tb_simple_ssr
call_vsim tb_simple_ssr_streamer
13 changes: 0 additions & 13 deletions hw/snitch_ssr/util/start_simple_ssr.tcl

This file was deleted.

14 changes: 0 additions & 14 deletions hw/snitch_ssr/util/start_simple_ssr_streamer.tcl

This file was deleted.

0 comments on commit 44ca8c4

Please sign in to comment.