Skip to content

Zcmp cosim mismatches in llvm-snippy generated tests #2445

@AnastasiyaChernikova

Description

@AnastasiyaChernikova

Observed Behavior

When running Snippy-generated Zcmp tests with cosimulation enabled, some tests fail with cosim mismatches.

The issue was found while experimenting with the llvm-snippy integration from this PR

Spike is used as the cosimulation reference model, built from the ibex_cosim branch as described in the Ibex documentation.

Two different types of cosim mismatches were observed.
One failure mode is a register write index mismatch:

Cosim mismatch Register write index mismatch, DUT: x21 expected: x9

Another failure mode is a missing expected store access:

Cosim mismatch A store at address 800a6e50 was expected but there are no pending accesses

At the moment it is not clear whether this points to an issue in the Ibex implementation of the Zcmp extension, in the Spike model used for cosimulation, or in the interaction between the two.

Expected Behavior

Snippy-generated Zcmp tests should pass RTL cosimulation without register writeback or memory access mismatches.

In particular, the architectural state observed from the DUT should match the Spike reference model for Zcmp instructions such as cm.push, cm.pop, cm.popret, cm.popretz, cm.mva01s, and cm.mvsa01.

Steps to reproduce the issue

The issue was reproduced using the llvm-snippy flow from: #2444

Run the following command from dv/uvm/core_ibex:

make run_snippy \
  OUT=out \
  COV=1 \
  SIMULATOR=vcs \
  IBEX_CONFIG=opentitan \
  RV32ZC=ibex_pkg::RV32ZcaZcbZcmp \
  SNIPPY_ITERATIONS=2 \
  SNIPPY_YAML_DIR=snippy/yaml_tests/zcmp

After the run, inspect the logs under:

dv/uvm/core_ibex/out/run/tests

All generated Zcmp tests fail during cosimulation with errors similar to:

Cosim mismatch Register write index mismatch, DUT: x21 expected: x9

and:

Cosim mismatch A store at address 800a6e50 was expected but there are no pending accesses

My Environment

EDA tool and version:

Synopsys VCS S-2021.09
vcs script version: S-2021.09
machine OS: Linux 5.15.0-164-generic

Operating system:

Rocky Linux release 8.10

Version of the Ibex source code:

Ibex source based on this pr

Spike is used for cosimulation as described in the Ibex documentation, built from the ibex_cosim branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions