Skip to content

Fix vector CSR register sources - #487

Open
flaviens wants to merge 1 commit into
pulp-platform:mainfrom
flaviens:fix/vector-csr-register-source
Open

flaviens wants to merge 1 commit into
pulp-platform:mainfrom
flaviens:fix/vector-csr-register-source

Conversation

@flaviens

Copy link
Copy Markdown

Register CSR forms read instruction bit positions from the rs1 value. Read the value LSBs.

Verification: Verilator elaboration.

@flaviens
flaviens marked this pull request as ready for review August 22, 2026 06:25
Copilot AI lite review requested due to automatic review settings August 22, 2026 06:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@lionelZhaowy

lionelZhaowy commented Oct 29, 2026 •

Copy link
Copy Markdown

Thanks for the fix. I reproduced the register-source failures with Ara's official testbench and tested the same eight field-selection changes.

The baseline is Ara main 34bd3bc152421b4601a7bf3d6e8e91ffb545c99e. I applied the eight assignments from your commit e24f45f2180a252ded110decd63ef32f667a00ac to that baseline. I did not test the complete historical PR head.

Configuration: ara_tb with real CVA6, 2 lanes, VLEN=2048, ELEN=64, WT D-cache, and effective PMP entries=0. Tools: LLVM 20.1.0, VCS W-2024.09-SP1, Bender 0.32.1, and host g++ 13.3.1. The unchanged eight dependencies follow the pinned Bender.lock.

Both RTL versions used the same newly built CSR test ELF:

Test Main Main with the eight field changes
CSR sources: 44 cases, 178 checks 52 errors, tohost=52 0 errors, tohost=0
Subset with zero upper bits: 38 cases 39 field errors 0 field errors
High-bit diagnostic subset: 6 cases 13 field errors 0 field errors

For example, after clearing VCSR, CSRRW writes 2 to VXRM through t0/x5. Main reads VXRM=0 and VCSR=0. The fixed version reads VXRM=2 and VCSR=4. Both return the previous VXRM value of 0.

The 44 cases comprise 17 CSRRW, 14 CSRRWI, and 13 CSRRS operations. Each case compares the returned old value, VCSR, VXRM, and VXSAT. The 178 checks comprise 176 field comparisons and two platform checks: VLENB=256 and e32/m1 VLMAX=64.

The tested GPR operations use t0/x5, including the three zero-source CSRRS cases. The executed instruction trace contains 30 GPR operations with rs1=x5 and rd=x17, plus 14 immediate-form controls. An independent reconstruction of the stored result array matches all 308 recorded fields in each RTL run.

The six nonzero-upper-bit cases only diagnose field selection. They include the CSRRW cases with nonzero previous values. These results do not establish an ISA guarantee for arbitrary reserved-bit writes. The vector specification directs software to write zero to the upper bits of VXRM and VXSAT.

The unchanged vsetvl test and the existing four-case vaadd test also passed with the fixed RTL. All four RTL runs ended normally: one exact baseline failure and three passes. Each run emitted the same time-zero unique-case warning in unchanged axi_inval_filter.sv:85. No subsequent assertion failure appeared in these logs.

A separate Spike run completed 44 cases and 178 checks with zero errors. It used commit 5cf439b24e945db47edf6e259044c923384ccdfd with --isa=rv64gcv --varch=vlen:2048,elen:64 --priv=msu --pmpregions=0. An earlier invocation rejected zvfh during option parsing, before test execution. I preserved that error and reran the same Spike ELF with the supported ISA option.

These new official-testbench results are separate from the earlier downstream SoC validation. That earlier batch contained eight SoC calls: three exact failing or residual-error comparisons and five passes. Its CSR change reduced the original short test from 25 CSR errors to zero, while all 24 averaging-subtract errors remained.

Coverage excludes CSRRC/CSRRCI, CSRRWI returns with nonzero previous values, x0/rd=x0 side effects, and signed VAADD boundaries. No averaging-arithmetic change is part of this comparison.

AI tools assisted with test preparation, source adaptation, result analysis, and drafting this comment. The test uses Ara's existing runtime and header. The source below uses SHL-0.51, as stated in Ara's license.

CSR test source
// SPDX-License-Identifier: SHL-0.51
//
// Adapted from an earlier vector CSR diagnostic.
// AI tools assisted with test preparation and source adaptation.

#include "vector_macros.h"

enum { CSR_CASES = 44, EXPECTED_VLENB = 256, EXPECTED_VLMAX = 64 };
enum { VXRM, VXSAT, VCSR };
enum { REG_WRITE, IMM_WRITE, REG_SET };

/* Columns: CSR class, operation, source, old CSR, VCSR, VXRM, VXSAT. */
volatile uint64_t vcsr_sources_results[CSR_CASES][7];

static unsigned cases_done, checks_done, platform_errors;
static unsigned low_cases, diagnostic_cases, low_errors, diagnostic_errors;
static unsigned operation_counts[3];

static const char *const csr_names[] = {"vxrm", "vxsat", "vcsr"};
static const char *const operation_names[] = {"CSRRW", "CSRRWI", "CSRRS"};

static void read_fixed_csrs(uint64_t *vcsr, uint64_t *rm, uint64_t *sat) {
  asm volatile("csrr %0, vcsr\ncsrr %1, vxrm\ncsrr %2, vxsat\n"
               : "=&r"(*vcsr), "=&r"(*rm), "=&r"(*sat)
               :
               : "memory");
}

/* Use x5 as rs1, including when the source value is zero. */
static uint64_t register_write(unsigned which, uint64_t value) {
  uint64_t old;
  switch (which) {
  case VXRM:
    asm volatile("mv t0, %1\ncsrrw %0, vxrm, t0"
                 : "=&r"(old) : "r"(value) : "t0", "memory");
    break;
  case VXSAT:
    asm volatile("mv t0, %1\ncsrrw %0, vxsat, t0"
                 : "=&r"(old) : "r"(value) : "t0", "memory");
    break;
  default:
    asm volatile("mv t0, %1\ncsrrw %0, vcsr, t0"
                 : "=&r"(old) : "r"(value) : "t0", "memory");
    break;
  }
  return old;
}

static uint64_t register_set(unsigned which, uint64_t value) {
  uint64_t old;
  switch (which) {
  case VXRM:
    asm volatile("mv t0, %1\ncsrrs %0, vxrm, t0"
                 : "=&r"(old) : "r"(value) : "t0", "memory");
    break;
  case VXSAT:
    asm volatile("mv t0, %1\ncsrrs %0, vxsat, t0"
                 : "=&r"(old) : "r"(value) : "t0", "memory");
    break;
  default:
    asm volatile("mv t0, %1\ncsrrs %0, vcsr, t0"
                 : "=&r"(old) : "r"(value) : "t0", "memory");
    break;
  }
  return old;
}

#define IMMEDIATE_WRITE(CSR_NAME, VALUE)                                    \
  asm volatile("csrrwi %0, " #CSR_NAME ", " #VALUE : "=&r"(old) : : "memory")

static uint64_t immediate_write(unsigned which, unsigned value) {
  uint64_t old;
  if (which == VXRM) {
    switch (value) {
    case 0: IMMEDIATE_WRITE(vxrm, 0); break;
    case 1: IMMEDIATE_WRITE(vxrm, 1); break;
    case 2: IMMEDIATE_WRITE(vxrm, 2); break;
    default: IMMEDIATE_WRITE(vxrm, 3); break;
    }
  } else if (which == VXSAT) {
    if (value) {
      IMMEDIATE_WRITE(vxsat, 1);
    } else {
      IMMEDIATE_WRITE(vxsat, 0);
    }
  } else {
    switch (value) {
    case 0: IMMEDIATE_WRITE(vcsr, 0); break;
    case 1: IMMEDIATE_WRITE(vcsr, 1); break;
    case 2: IMMEDIATE_WRITE(vcsr, 2); break;
    case 3: IMMEDIATE_WRITE(vcsr, 3); break;
    case 4: IMMEDIATE_WRITE(vcsr, 4); break;
    case 5: IMMEDIATE_WRITE(vcsr, 5); break;
    case 6: IMMEDIATE_WRITE(vcsr, 6); break;
    default: IMMEDIATE_WRITE(vcsr, 7); break;
    }
  }
  return old;
}

/* rd=x0 discards the old value during seed preparation. */
static void seed_vcsr(unsigned value) {
  switch (value) {
  case 1: asm volatile("csrwi vcsr, 1" : : : "memory"); break;
  case 2: asm volatile("csrwi vcsr, 2" : : : "memory"); break;
  case 3: asm volatile("csrwi vcsr, 3" : : : "memory"); break;
  case 4: asm volatile("csrwi vcsr, 4" : : : "memory"); break;
  case 7: asm volatile("csrwi vcsr, 7" : : : "memory"); break;
  default: asm volatile("csrwi vcsr, 0" : : : "memory"); break;
  }
}

static unsigned compare(uint64_t actual, uint64_t expected) {
  ++checks_done;
  if (actual == expected) {
    return 0;
  }
  ++num_failed;
  return 1;
}

static void run_case(unsigned id, unsigned which, unsigned operation,
                     unsigned seed, uint64_t source, uint64_t expected_vcsr,
                     unsigned diagnostic) {
  uint64_t vcsr, rm, sat, old;
  test_case = id;
  seed_vcsr(seed);
  if (operation == REG_WRITE) {
    old = register_write(which, source);
  } else if (operation == IMM_WRITE) {
    old = immediate_write(which, (unsigned)source);
  } else {
    old = register_set(which, source);
  }
  read_fixed_csrs(&vcsr, &rm, &sat);

  uint64_t expected_old = which == VXRM ? seed >> 1
                        : which == VXSAT ? seed & 1 : seed;
  vcsr_sources_results[id][0] = which;
  vcsr_sources_results[id][1] = operation;
  vcsr_sources_results[id][2] = source;
  vcsr_sources_results[id][3] = old;
  vcsr_sources_results[id][4] = vcsr;
  vcsr_sources_results[id][5] = rm;
  vcsr_sources_results[id][6] = sat;

  unsigned errors = compare(old, expected_old);
  errors += compare(vcsr, expected_vcsr);
  errors += compare(rm, expected_vcsr >> 1);
  errors += compare(sat, expected_vcsr & 1);
  ++cases_done;
  ++operation_counts[operation];
  if (diagnostic) {
    ++diagnostic_cases;
    diagnostic_errors += errors;
  } else {
    ++low_cases;
    low_errors += errors;
  }
  printf("VCSR_SOURCE_CASE id=%u scope=%s csr=%s op=%s seed=0x%x source=0x%lx "
         "old=0x%lx vcsr=0x%lx vxrm=0x%lx vxsat=0x%lx "
         "expected_old=0x%lx expected_vcsr=0x%lx expected_vxrm=0x%lx "
         "expected_vxsat=0x%lx errors=%u\n",
         id, diagnostic ? "diagnostic" : "low", csr_names[which],
         operation_names[operation], seed, (unsigned long)source,
         (unsigned long)old, (unsigned long)vcsr, (unsigned long)rm,
         (unsigned long)sat, (unsigned long)expected_old,
         (unsigned long)expected_vcsr, (unsigned long)(expected_vcsr >> 1),
         (unsigned long)(expected_vcsr & 1), errors);
}

static void test_initial_cases(void) {
  unsigned id = 0;
  for (unsigned which = VXRM; which <= VCSR; ++which) {
    unsigned limit = which == VXRM ? 4 : which == VXSAT ? 2 : 8;
    for (unsigned value = 0; value < limit; ++value) {
      for (unsigned operation = REG_WRITE; operation <= IMM_WRITE; ++operation) {
        uint64_t expected_vcsr = which == VXRM ? value << 1 : value;
        run_case(id++, which, operation, 0, value, expected_vcsr, 0);
      }
    }
  }
}

static void test_additional_cases(void) {
  static const struct {
    unsigned which, operation, seed;
    uint64_t source, expected_vcsr;
    unsigned diagnostic;
  } cases[] = {
      {VXRM, REG_WRITE, 7, UINT64_C(0x18002), 5, 1},
      {VXSAT, REG_WRITE, 7, UINT64_C(0x08000), 6, 1},
      {VCSR, REG_WRITE, 7, UINT64_C(0x38005), 5, 1},
      {VXRM, REG_SET, 7, 0, 7, 0},
      {VXSAT, REG_SET, 7, 0, 7, 0},
      {VCSR, REG_SET, 7, 0, 7, 0},
      {VXRM, REG_SET, 1, 1, 3, 0},
      {VXRM, REG_SET, 1, 2, 5, 0},
      {VXRM, REG_SET, 1, 3, 7, 0},
      {VXSAT, REG_SET, 4, 1, 5, 0},
      {VCSR, REG_SET, 2, 1, 3, 0},
      {VCSR, REG_SET, 1, 2, 3, 0},
      {VCSR, REG_SET, 1, 4, 5, 0},
      {VXRM, REG_SET, 3, UINT64_C(0x18000), 3, 1},
      {VXSAT, REG_SET, 4, UINT64_C(0x08000), 4, 1},
      {VCSR, REG_SET, 2, UINT64_C(0x38000), 2, 1},
  };
  _Static_assert(sizeof(cases) / sizeof(cases[0]) == 16,
                 "expected 16 additional CSR cases");
  for (unsigned i = 0; i < sizeof(cases) / sizeof(cases[0]); ++i) {
    run_case(28 + i, cases[i].which, cases[i].operation, cases[i].seed,
             cases[i].source, cases[i].expected_vcsr, cases[i].diagnostic);
  }
}

int main(void) {
  INIT_CHECK();
  enable_vec();
  cases_done = checks_done = platform_errors = 0;
  low_cases = diagnostic_cases = low_errors = diagnostic_errors = 0;
  for (unsigned i = 0; i < 3; ++i) {
    operation_counts[i] = 0;
  }
  printf("VCSR_SOURCES_SCOPE low=reserved_high_bits_zero "
         "diagnostic=nonzero_reserved_high_bits "
         "diagnostic_results_do_not_define_ISA_requirements\n");
  test_initial_cases();
  test_additional_cases();

  uintptr_t vlenb, vlmax;
  asm volatile("csrr %0, vlenb\nvsetvli %1, zero, e32, m1, tu, mu\n"
               : "=&r"(vlenb), "=&r"(vlmax)
               :
               : "memory");
  platform_errors += compare(vlenb, EXPECTED_VLENB);
  platform_errors += compare(vlmax, EXPECTED_VLMAX);
  printf("VCSR_SOURCES_PLATFORM vlenb=%lu expected_vlenb=%u "
         "vlmax=%lu expected_vlmax=%u errors=%u\n",
         (unsigned long)vlenb, EXPECTED_VLENB, (unsigned long)vlmax,
         EXPECTED_VLMAX, platform_errors);
  printf("VCSR_SOURCES_SUMMARY cases=%u checks=%u vsets=1 "
         "CSRRW=%u CSRRWI=%u CSRRS=%u low_cases=%u diagnostic_cases=%u "
         "low_errors=%u diagnostic_errors=%u platform_errors=%u errors=%d\n",
         cases_done, checks_done, operation_counts[REG_WRITE],
         operation_counts[IMM_WRITE], operation_counts[REG_SET], low_cases,
         diagnostic_cases, low_errors, diagnostic_errors, platform_errors,
         num_failed);
  EXIT_CHECK();
}
Official test registration
diff --git a/apps/riscv-tests/isa/rv64uv/Makefrag b/apps/riscv-tests/isa/rv64uv/Makefrag
index f2c13360..863235d6 100644
--- a/apps/riscv-tests/isa/rv64uv/Makefrag
+++ b/apps/riscv-tests/isa/rv64uv/Makefrag
@@ -5,7 +5,8 @@
 # Author: Matheus Cavalcante <matheusd@iis.ee.ethz.ch>
 #         Basile Bougenot <bbougenot@student.ethz.ch>
 
-rv64uv_sc_tests = vaadd \
+rv64uv_sc_tests = vcsr_sources \
+                  vaadd \
                   vaaddu\
                   vsadd \
                   vsaddu \
Eight field changes from PR #487
diff --git a/hardware/src/ara_dispatcher.sv b/hardware/src/ara_dispatcher.sv
index e5f9e06d..efb3af6b 100644
--- a/hardware/src/ara_dispatcher.sv
+++ b/hardware/src/ara_dispatcher.sv
@@ -3394,16 +3394,16 @@ module ara_dispatcher import ara_pkg::*; import rvv_pkg::*; #(
                       acc_resp_o.result = csr_vstart_q;
                     end
                     riscv::CSR_VXRM: begin
-                      csr_vxrm_d            = vxrm_t'(acc_req_i.rs1[16:15]);
+                      csr_vxrm_d            = vxrm_t'(acc_req_i.rs1[1:0]);
                       acc_resp_o.result = vlen_t'(csr_vxrm_q);
                     end
                     riscv::CSR_VXSAT: begin
-                      csr_vxsat_d           = vxsat_e'(acc_req_i.rs1[15]);
+                      csr_vxsat_d           = vxsat_e'(acc_req_i.rs1[0]);
                       acc_resp_o.result = vlen_t'(csr_vxsat_q);
                     end
                     riscv::CSR_VCSR: begin
-                      csr_vxrm_d            = vxrm_t'(  acc_req_i.rs1[17:16]  );
-                      csr_vxsat_d           = vxsat_e'( acc_req_i.rs1[15]    );
+                      csr_vxrm_d            = vxrm_t'(  acc_req_i.rs1[2:1]  );
+                      csr_vxsat_d           = vxsat_e'( acc_req_i.rs1[0]    );
                       acc_resp_o.result = vlen_t'(  { csr_vxrm_q, csr_vxsat_q } );
                     end
                     default: illegal_insn = 1'b1;
@@ -3432,16 +3432,16 @@ module ara_dispatcher import ara_pkg::*; import rvv_pkg::*; #(
                       else illegal_insn = 1'b1;
                     end
                     riscv::CSR_VXRM: begin
-                      csr_vxrm_d            = csr_vxrm_q | vxrm_t'(acc_req_i.rs1[16:15]);
+                      csr_vxrm_d            = csr_vxrm_q | vxrm_t'(acc_req_i.rs1[1:0]);
                       acc_resp_o.result = vlen_t'(csr_vxrm_q);
                     end
                     riscv::CSR_VXSAT: begin
-                      csr_vxsat_d           = csr_vxsat_q | vxsat_e'(acc_req_i.rs1[15]);
+                      csr_vxsat_d           = csr_vxsat_q | vxsat_e'(acc_req_i.rs1[0]);
                       acc_resp_o.result = vlen_t'(csr_vxsat_q);
                     end
                     riscv::CSR_VCSR: begin
-                      csr_vxrm_d            = csr_vxrm_q  | vxrm_t'(acc_req_i.rs1[17:16]);
-                      csr_vxsat_d           = csr_vxsat_q | vxsat_e'(acc_req_i.rs1[15]);
+                      csr_vxrm_d            = csr_vxrm_q  | vxrm_t'(acc_req_i.rs1[2:1]);
+                      csr_vxsat_d           = csr_vxsat_q | vxsat_e'(acc_req_i.rs1[0]);
                       acc_resp_o.result = vlen_t'(  { csr_vxrm_q, csr_vxsat_q } );
                     end
                     default: illegal_insn = 1'b1;
Pinned inputs and reproduction commands
#!/usr/bin/env bash
# Prerequisites: Git, Bender 0.32.1, VCS W-2024.09-SP1, host g++ 13.3.1,
# LLVM 20.1.0 with its matching RISC-V sysroot, and Spike 5cf439b24e945db47edf6e259044c923384ccdfd.
# Run from the directory containing vcsr_sources.c and the two patches.
# The reported runs reused local Git objects. The clone/checkout commands below
# obtain equivalent public inputs; network acquisition was not repeated.
set -eu
CASE_DIR=$PWD
LLVM_ROOT=/opt/llvm-20.1.0
SPIKE_ROOT=/opt/spike-5cf439b2
ARA_BASE=$CASE_DIR/ara-main
ARA_FIXED=$CASE_DIR/ara-fixed

git clone https://github.com/pulp-platform/ara.git "$ARA_BASE"
git -C "$ARA_BASE" checkout --detach 34bd3bc152421b4601a7bf3d6e8e91ffb545c99e
git clone --no-hardlinks --no-checkout "$ARA_BASE" "$ARA_FIXED"
git -C "$ARA_FIXED" checkout --detach 34bd3bc152421b4601a7bf3d6e8e91ffb545c99e
for ARA_ROOT in "$ARA_BASE" "$ARA_FIXED"; do
  cp "$CASE_DIR/vcsr_sources.c" "$ARA_ROOT/apps/riscv-tests/isa/rv64uv/vcsr_sources.c"
  git -C "$ARA_ROOT" apply "$CASE_DIR/test_registration.patch"
  (cd "$ARA_ROOT" && bender --git-submodules false checkout)
  git -C "$ARA_ROOT/hardware/deps/cva6" submodule update --init core/cache_subsystem/hpdcache
  git -C "$ARA_ROOT/hardware/deps/cva6/core/cache_subsystem/hpdcache" rev-parse HEAD
  # Expected HPDcache: 04de80896981527c34fbbd35d7b1ef787a082d7c.
done
# These field assignments come from flaviens's Ara PR #487, commit e24f45f.
git -C "$ARA_FIXED" apply "$CASE_DIR/csr_fields.patch"

make -C "$ARA_BASE/apps" config=2_lanes LLVM_INSTALL_DIR="$LLVM_ROOT" \
  LLVM_FLAGS="--target=riscv64-unknown-elf --sysroot=$LLVM_ROOT/riscv64-unknown-elf -isystem $LLVM_ROOT/riscv64-unknown-elf/include -march=rv64gcv_zfh_zvfh -mabi=lp64d -mno-relax -fuse-ld=lld --rtlib=compiler-rt -L$LLVM_ROOT/riscv64-unknown-elf/lib" \
  LLVM_V_FLAGS="-fno-vectorize -fno-slp-vectorize -mno-implicit-float" \
  bin/rv64uv-ara-vcsr_sources bin/rv64uv-ara-vsetvl bin/rv64uv-ara-vaadd
ELF_DIR=$ARA_BASE/apps/bin

for ARA_ROOT in "$ARA_BASE" "$ARA_FIXED"; do
  BUILD_DIR=$ARA_ROOT-build
  mkdir "$BUILD_DIR"
  (cd "$ARA_ROOT" && bender --local --git-submodules false script vcs \
    -t rtl -t cv64a6_imafdcv_sv39 \
    -t tech_cells_generic_include_tc_sram -t tech_cells_generic_include_tc_clk \
    -t exclude_first_pass_decoder -t ara_test -t cva6_test \
    -D NR_LANES=2 -D VLEN=2048 -D ARIANE_ACCELERATOR_PORT=1 \
    --vlogan-args="-full64 -assert svaext +v2k -timescale=1ns/1ps" \
    > "$BUILD_DIR/compile.sh")
  (cd "$BUILD_DIR" && bash compile.sh && \
    vcs -full64 -sverilog -timescale=1ns/1ps -assert svaext -top ara_tb \
      "$ARA_ROOT/hardware/tb/dpi/elfloader.cc" \
      -CFLAGS "-I$SPIKE_ROOT/include" -o simv)
done

mkdir "$CASE_DIR/run-csr-main" "$CASE_DIR/run-csr-fixed" \
      "$CASE_DIR/run-vsetvl-fixed" "$CASE_DIR/run-vaadd-fixed"
(cd "$CASE_DIR/run-csr-main" && timeout 600 "$ARA_BASE-build/simv" \
  +PRELOAD="$ELF_DIR/rv64uv-ara-vcsr_sources")
(cd "$CASE_DIR/run-csr-fixed" && timeout 600 "$ARA_FIXED-build/simv" \
  +PRELOAD="$ELF_DIR/rv64uv-ara-vcsr_sources")
(cd "$CASE_DIR/run-vsetvl-fixed" && timeout 600 "$ARA_FIXED-build/simv" \
  +PRELOAD="$ELF_DIR/rv64uv-ara-vsetvl")
(cd "$CASE_DIR/run-vaadd-fixed" && timeout 600 "$ARA_FIXED-build/simv" \
  +PRELOAD="$ELF_DIR/rv64uv-ara-vaadd")
# Check software results and tohost. VCS returns host status 0 for the expected
# main failure too. Expected tohost values: 52, 0, 0, 0, respectively.

make -C "$ARA_BASE/apps/riscv-tests/isa" \
  RISCV_LLVM="$LLVM_ROOT/bin/clang -fuse-ld=lld --target=riscv64-unknown-elf --sysroot=$LLVM_ROOT/riscv64-unknown-elf -isystem $LLVM_ROOT/riscv64-unknown-elf/include" \
  RISCV_CC_OPTS_C="-O2 -mno-relax -nostdlib -nostartfiles -fno-vectorize -fno-slp-vectorize -mno-implicit-float" \
  rv64uv-p-vcsr_sources
"$SPIKE_ROOT/bin/spike" --isa=rv64gcv --varch=vlen:2048,elen:64 \
  --priv=msu --pmpregions=0 \
  "$ARA_BASE/apps/riscv-tests/isa/rv64uv-p-vcsr_sources"
# Expected: 44 cases, 178 checks, zero errors. The separate Spike ELF uses
# the unchanged official riscv-tests runtime. The VCS ELF uses Ara's runtime.
Recorded versions, artifact hashes, per-case values, and results
{
  "official_base": "34bd3bc152421b4601a7bf3d6e8e91ffb545c99e",
  "field_change_source": "https://github.com/pulp-platform/ara/commit/e24f45f2180a252ded110decd63ef32f667a00ac",
  "rtl_scope": "Only the eight field selections, applied to pinned main. The complete historical PR head was not run.",
  "configuration": {
    "testbench": "ara_tb, real CVA6",
    "lanes": 2,
    "VLEN": 2048,
    "ELEN": 64,
    "D_cache": "WT",
    "effective_PMP_entries": 0
  },
  "tools": {
    "LLVM": "20.1.0",
    "VCS": "W-2024.09-SP1",
    "Bender": "0.32.1",
    "host_g++": "13.3.1 20240611 (Red Hat 13.3.1-2)",
    "Spike": "5cf439b24e945db47edf6e259044c923384ccdfd"
  },
  "locked_dependencies": {
    "apb": "77ddf073f194d44b9119949d2421be59789e69ae",
    "axi": "853ede23b2a9837951b74dbdc6d18c3eef5bac7d",
    "common_cells": "c27bce39ebb2e6bae52f60960814a2afca7bd4cb",
    "common_verification": "9c07fa860593b2caabd9b5681740c25fac04b878",
    "cva6": "99eac9a649001bdf5b8f9da52e0ca73d5c48db1c",
    "fpnew": "e5aa6a01b5bbe1675c3aa8872e1203413ded83d1",
    "fpu_div_sqrt_mvp": "86e1f558b3c95e91577c41b2fc452c86b04e85ac",
    "tech_cells_generic": "7968dd6e6180df2c644636bc6d2908a49f2190cf"
  },
  "hpdcache": "04de80896981527c34fbbd35d7b1ef787a082d7c",
  "runs": [
    {
      "name": "spike",
      "host_return": 255,
      "wall_seconds": 0.005974292755126953,
      "ELF_SHA256": "8a6cd2f3510bb0cf8962074cfeb8a5a7eeae68cf3faf93cf817f4df591c34b54",
      "result": "Command-line rejection before test execution",
      "reason": "unsupported extension: zvfh"
    },
    {
      "name": "spike_02",
      "host_return": 0,
      "wall_seconds": 0.012705802917480469,
      "ELF_SHA256": "8a6cd2f3510bb0cf8962074cfeb8a5a7eeae68cf3faf93cf817f4df591c34b54",
      "result": "PASS",
      "cases": 44,
      "checks": 178,
      "errors": 0
    },
    {
      "name": "csr_baseline",
      "host_return": 0,
      "wall_seconds": 56.15040946006775,
      "ELF_SHA256": "b106d830e62a5e0a3d8cfbf7f984c8bb3366394ddbf4998620b75332dc4205a4",
      "target_tohost": 52,
      "normal_finish": true,
      "main_privilege": "U",
      "finish_time_ps": 360414500,
      "time_zero_unique_case_warning": true,
      "unexpected_assertion_failure_in_log": false
    },
    {
      "name": "csr_fixed",
      "host_return": 0,
      "wall_seconds": 55.97764039039612,
      "ELF_SHA256": "b106d830e62a5e0a3d8cfbf7f984c8bb3366394ddbf4998620b75332dc4205a4",
      "target_tohost": 0,
      "normal_finish": true,
      "main_privilege": "U",
      "finish_time_ps": 359789500,
      "time_zero_unique_case_warning": true,
      "unexpected_assertion_failure_in_log": false
    },
    {
      "name": "vsetvl_fixed",
      "host_return": 0,
      "wall_seconds": 7.368134021759033,
      "ELF_SHA256": "4866a10c435cd59a10f5e791b24658d83d5afc476d64276ad7adc63a2756ebac",
      "target_tohost": 0,
      "normal_finish": true,
      "main_privilege": "U",
      "finish_time_ps": 42188500,
      "time_zero_unique_case_warning": true,
      "unexpected_assertion_failure_in_log": false
    },
    {
      "name": "vaadd_fixed",
      "host_return": 0,
      "wall_seconds": 2.4404401779174805,
      "ELF_SHA256": "b9cc696947a05e491606144abc79e12fb17ada7e497e679b247914e390072e6b",
      "target_tohost": 0,
      "normal_finish": true,
      "main_privilege": "U",
      "finish_time_ps": 11826500,
      "time_zero_unique_case_warning": true,
      "unexpected_assertion_failure_in_log": false
    }
  ],
  "case_results": {
    "csr_baseline": [
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        1,
        0,
        0,
        0,
        0
      ],
      [
        0,
        1,
        1,
        0,
        2,
        1,
        0
      ],
      [
        0,
        0,
        2,
        0,
        0,
        0,
        0
      ],
      [
        0,
        1,
        2,
        0,
        4,
        2,
        0
      ],
      [
        0,
        0,
        3,
        0,
        0,
        0,
        0
      ],
      [
        0,
        1,
        3,
        0,
        6,
        3,
        0
      ],
      [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        0,
        1,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        0,
        1,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        0,
        2,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        2,
        0,
        2,
        1,
        0
      ],
      [
        2,
        0,
        3,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        3,
        0,
        3,
        1,
        1
      ],
      [
        2,
        0,
        4,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        4,
        0,
        4,
        2,
        0
      ],
      [
        2,
        0,
        5,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        5,
        0,
        5,
        2,
        1
      ],
      [
        2,
        0,
        6,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        6,
        0,
        6,
        3,
        0
      ],
      [
        2,
        0,
        7,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        7,
        0,
        7,
        3,
        1
      ],
      [
        0,
        0,
        98306,
        3,
        7,
        3,
        1
      ],
      [
        1,
        0,
        32768,
        1,
        7,
        3,
        1
      ],
      [
        2,
        0,
        229381,
        7,
        7,
        3,
        1
      ],
      [
        0,
        2,
        0,
        3,
        7,
        3,
        1
      ],
      [
        1,
        2,
        0,
        1,
        7,
        3,
        1
      ],
      [
        2,
        2,
        0,
        7,
        7,
        3,
        1
      ],
      [
        0,
        2,
        1,
        0,
        1,
        0,
        1
      ],
      [
        0,
        2,
        2,
        0,
        1,
        0,
        1
      ],
      [
        0,
        2,
        3,
        0,
        1,
        0,
        1
      ],
      [
        1,
        2,
        1,
        0,
        4,
        2,
        0
      ],
      [
        2,
        2,
        1,
        2,
        2,
        1,
        0
      ],
      [
        2,
        2,
        2,
        1,
        1,
        0,
        1
      ],
      [
        2,
        2,
        4,
        1,
        1,
        0,
        1
      ],
      [
        0,
        2,
        98304,
        1,
        7,
        3,
        1
      ],
      [
        1,
        2,
        32768,
        0,
        5,
        2,
        1
      ],
      [
        2,
        2,
        229376,
        2,
        7,
        3,
        1
      ]
    ],
    "csr_fixed": [
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        1,
        0,
        2,
        1,
        0
      ],
      [
        0,
        1,
        1,
        0,
        2,
        1,
        0
      ],
      [
        0,
        0,
        2,
        0,
        4,
        2,
        0
      ],
      [
        0,
        1,
        2,
        0,
        4,
        2,
        0
      ],
      [
        0,
        0,
        3,
        0,
        6,
        3,
        0
      ],
      [
        0,
        1,
        3,
        0,
        6,
        3,
        0
      ],
      [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        0,
        1,
        0,
        1,
        0,
        1
      ],
      [
        1,
        1,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        0,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        1,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        0,
        2,
        0,
        2,
        1,
        0
      ],
      [
        2,
        1,
        2,
        0,
        2,
        1,
        0
      ],
      [
        2,
        0,
        3,
        0,
        3,
        1,
        1
      ],
      [
        2,
        1,
        3,
        0,
        3,
        1,
        1
      ],
      [
        2,
        0,
        4,
        0,
        4,
        2,
        0
      ],
      [
        2,
        1,
        4,
        0,
        4,
        2,
        0
      ],
      [
        2,
        0,
        5,
        0,
        5,
        2,
        1
      ],
      [
        2,
        1,
        5,
        0,
        5,
        2,
        1
      ],
      [
        2,
        0,
        6,
        0,
        6,
        3,
        0
      ],
      [
        2,
        1,
        6,
        0,
        6,
        3,
        0
      ],
      [
        2,
        0,
        7,
        0,
        7,
        3,
        1
      ],
      [
        2,
        1,
        7,
        0,
        7,
        3,
        1
      ],
      [
        0,
        0,
        98306,
        3,
        5,
        2,
        1
      ],
      [
        1,
        0,
        32768,
        1,
        6,
        3,
        0
      ],
      [
        2,
        0,
        229381,
        7,
        5,
        2,
        1
      ],
      [
        0,
        2,
        0,
        3,
        7,
        3,
        1
      ],
      [
        1,
        2,
        0,
        1,
        7,
        3,
        1
      ],
      [
        2,
        2,
        0,
        7,
        7,
        3,
        1
      ],
      [
        0,
        2,
        1,
        0,
        3,
        1,
        1
      ],
      [
        0,
        2,
        2,
        0,
        5,
        2,
        1
      ],
      [
        0,
        2,
        3,
        0,
        7,
        3,
        1
      ],
      [
        1,
        2,
        1,
        0,
        5,
        2,
        1
      ],
      [
        2,
        2,
        1,
        2,
        3,
        1,
        1
      ],
      [
        2,
        2,
        2,
        1,
        3,
        1,
        1
      ],
      [
        2,
        2,
        4,
        1,
        5,
        2,
        1
      ],
      [
        0,
        2,
        98304,
        1,
        3,
        1,
        1
      ],
      [
        1,
        2,
        32768,
        0,
        4,
        2,
        0
      ],
      [
        2,
        2,
        229376,
        2,
        2,
        1,
        0
      ]
    ],
    "spike_02": [
      [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        0,
        0,
        1,
        0,
        2,
        1,
        0
      ],
      [
        0,
        1,
        1,
        0,
        2,
        1,
        0
      ],
      [
        0,
        0,
        2,
        0,
        4,
        2,
        0
      ],
      [
        0,
        1,
        2,
        0,
        4,
        2,
        0
      ],
      [
        0,
        0,
        3,
        0,
        6,
        3,
        0
      ],
      [
        0,
        1,
        3,
        0,
        6,
        3,
        0
      ],
      [
        1,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        1,
        0,
        1,
        0,
        1,
        0,
        1
      ],
      [
        1,
        1,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        1,
        0,
        0,
        0,
        0,
        0
      ],
      [
        2,
        0,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        1,
        1,
        0,
        1,
        0,
        1
      ],
      [
        2,
        0,
        2,
        0,
        2,
        1,
        0
      ],
      [
        2,
        1,
        2,
        0,
        2,
        1,
        0
      ],
      [
        2,
        0,
        3,
        0,
        3,
        1,
        1
      ],
      [
        2,
        1,
        3,
        0,
        3,
        1,
        1
      ],
      [
        2,
        0,
        4,
        0,
        4,
        2,
        0
      ],
      [
        2,
        1,
        4,
        0,
        4,
        2,
        0
      ],
      [
        2,
        0,
        5,
        0,
        5,
        2,
        1
      ],
      [
        2,
        1,
        5,
        0,
        5,
        2,
        1
      ],
      [
        2,
        0,
        6,
        0,
        6,
        3,
        0
      ],
      [
        2,
        1,
        6,
        0,
        6,
        3,
        0
      ],
      [
        2,
        0,
        7,
        0,
        7,
        3,
        1
      ],
      [
        2,
        1,
        7,
        0,
        7,
        3,
        1
      ],
      [
        0,
        0,
        98306,
        3,
        5,
        2,
        1
      ],
      [
        1,
        0,
        32768,
        1,
        6,
        3,
        0
      ],
      [
        2,
        0,
        229381,
        7,
        5,
        2,
        1
      ],
      [
        0,
        2,
        0,
        3,
        7,
        3,
        1
      ],
      [
        1,
        2,
        0,
        1,
        7,
        3,
        1
      ],
      [
        2,
        2,
        0,
        7,
        7,
        3,
        1
      ],
      [
        0,
        2,
        1,
        0,
        3,
        1,
        1
      ],
      [
        0,
        2,
        2,
        0,
        5,
        2,
        1
      ],
      [
        0,
        2,
        3,
        0,
        7,
        3,
        1
      ],
      [
        1,
        2,
        1,
        0,
        5,
        2,
        1
      ],
      [
        2,
        2,
        1,
        2,
        3,
        1,
        1
      ],
      [
        2,
        2,
        2,
        1,
        3,
        1,
        1
      ],
      [
        2,
        2,
        4,
        1,
        5,
        2,
        1
      ],
      [
        0,
        2,
        98304,
        1,
        3,
        1,
        1
      ],
      [
        1,
        2,
        32768,
        0,
        4,
        2,
        0
      ],
      [
        2,
        2,
        229376,
        2,
        2,
        1,
        0
      ]
    ]
  },
  "case_columns": [
    "CSR class (0=vxrm,1=vxsat,2=vcsr)",
    "operation (0=CSRRW,1=CSRRWI,2=CSRRS)",
    "source",
    "old CSR",
    "VCSR",
    "VXRM",
    "VXSAT"
  ],
  "csr_summaries": {
    "csr_baseline": {
      "cases": 44,
      "checks": 178,
      "vsets": 1,
      "CSRRW": 17,
      "CSRRWI": 14,
      "CSRRS": 13,
      "low_cases": 38,
      "diagnostic_cases": 6,
      "low_errors": 39,
      "diagnostic_errors": 13,
      "platform_errors": 0,
      "errors": 52
    },
    "csr_fixed": {
      "cases": 44,
      "checks": 178,
      "vsets": 1,
      "CSRRW": 17,
      "CSRRWI": 14,
      "CSRRS": 13,
      "low_cases": 38,
      "diagnostic_cases": 6,
      "low_errors": 0,
      "diagnostic_errors": 0,
      "platform_errors": 0,
      "errors": 0
    },
    "spike_02": {
      "cases": 44,
      "checks": 178,
      "vsets": 1,
      "CSRRW": 17,
      "CSRRWI": 14,
      "CSRRS": 13,
      "low_cases": 38,
      "diagnostic_cases": 6,
      "low_errors": 0,
      "diagnostic_errors": 0,
      "platform_errors": 0,
      "errors": 0
    }
  },
  "artifact_sha256": {
    "baseline/Bender.lock": "3467093a8c4487787081f2d175e21a56bdcc2b3e5e6e905e013b8465897d398d",
    "baseline/apps/riscv-tests/isa/rv64uv/vcsr_sources.c": "f3bfae03be093ee8872a48d38f678d3e9a8a98634f2f5d1ec8bbc08dac8ba82b",
    "baseline/apps/riscv-tests/isa/macros/vector/vector_macros.h": "3688843f50f7299052cebb9071d0e6243087175cb29c84a352950f06f7caa3ae",
    "baseline/apps/riscv-tests/isa/rv64uv/vsetvl.c": "49424026002ecffb3c756d92c394b17d3c50b29d2f0ed0848a50be6698df213f",
    "baseline/apps/riscv-tests/isa/rv64uv/vaadd.c": "67489857af23d7d5a7376148207deb1209a0df966ae264915983e266354604fd",
    "baseline/apps/bin/rv64uv-ara-vcsr_sources": "b106d830e62a5e0a3d8cfbf7f984c8bb3366394ddbf4998620b75332dc4205a4",
    "baseline/apps/bin/rv64uv-ara-vsetvl": "4866a10c435cd59a10f5e791b24658d83d5afc476d64276ad7adc63a2756ebac",
    "baseline/apps/bin/rv64uv-ara-vaadd": "b9cc696947a05e491606144abc79e12fb17ada7e497e679b247914e390072e6b",
    "baseline/apps/riscv-tests/isa/rv64uv-p-vcsr_sources": "8a6cd2f3510bb0cf8962074cfeb8a5a7eeae68cf3faf93cf817f4df591c34b54",
    "build_baseline/simv": "d7daa1b730098f524d22781df3773a114161112e5308e81932319505e861dea5",
    "build_fixed/simv": "5390dc3f98a01dfbf87b122fb50480667efaaa93b847e279aa19b9e7f6988b28",
    "csr_fields.patch": "6782aabc6d05938339a0382bcea60cbcafa49a91473f18a7dd66e0ada49080ee",
    "test_registration.patch": "1c1b02c0ee9e6bd56154422fd1496df596bb26defe1786d919d09e7bc02fe88a"
  },
  "limitations": [
    "Only eight field assignments applied to official main, not the full historical PR checkout.",
    "Six high-bit cases are diagnostic only.",
    "All four RTL logs contain the same time-zero unique-case warning in unchanged axi_inval_filter.sv.",
    "No CSRRC/CSRRCI, CSRRWI nonzero-old-value return, x0/rd=x0 side effects, or signed VAADD boundary validation."
  ]
}

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants