Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions conformance/common-cells/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Upstream SystemVerilog testbench smoke test

Daily full CI runs the unmodified `cc_graycode_tb` from
Daily full CI runs the unmodified `cc_graycode_tb` and `cc_popcount_tb` from
[PULP common_cells](https://github.com/pulp-platform/common_cells), pinned by
[`revision`](revision). The same job runs on manual `ci.yml` dispatches and on
develop's nightly full CI. It exercises the `celox run --project` CLI with the
Expand All @@ -11,9 +11,15 @@ task, and immediate assertions. It checks binary/Gray round trips and changes
in the Gray code population count. This is a small combinational design smoke
test, not coverage of all common_cells modules or clocked testbenches.

The popcount TB covers widths 1, 5, 16, 32, 64, and 981 with unconstrained
scope randomization, explicit-unit `#5ns` delays, and immediate assertions
comparing the RTL with `$countones`. The randomizer supports arbitrary packed
widths; 981 is this upstream test's largest vector, not an implementation limit.

The gate first requires the original RTL/TB to exit successfully. It then forces
the Gray encoder output to zero in a separate RTL copy and requires exit code 1
with an assertion diagnostic. Compilation errors, crashes and timeouts do not
the Gray encoder output to zero and disables popcount accumulation in separate
RTL copies, requiring exit code 1 with the corresponding assertion diagnostic
for each. Compilation errors, crashes and timeouts do not
satisfy this negative control. Upstream files are never edited. Each execution
has a two-minute wall timeout and the CLI's default scheduler step limit.

Expand All @@ -29,7 +35,8 @@ node scripts/run-common-cells.mjs work/common-cells target/debug/celox work/comm
```

The output directory contains the generated `celox.toml`, negative-control
sources, both logs, and a `result.json` written only after both checks pass.
sources, the popcount manifests, four logs, and a `result.json` written only after all
four executions pass their positive or negative expectations.
Use a fresh output directory for each run. CI retains this directory for 14 days,
including on failure; failures feed the existing Full CI issue reporter.

Expand Down
2 changes: 2 additions & 0 deletions crates/celox-frontend-core/src/sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,7 @@ impl HiddenObjects<'_> {
},
array_dims: Vec::new(),
},
unpacked_ranges: Vec::new(),
packed_dims: vec![width],
source: None,
module_affiliated: false,
Expand Down Expand Up @@ -1817,6 +1818,7 @@ pub fn lower_frontend_artifact(
type_kind,
array_dims: Vec::new(),
},
unpacked_ranges: Vec::new(),
packed_dims: vec![signal.value_type().width()],
source: None,
module_affiliated: true,
Expand Down
2 changes: 2 additions & 0 deletions crates/celox-frontend-core/src/shared/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ pub struct VariableInfo {
/// arrays because that is the source-independent storage shape. The
/// testbench adapter also needs packed shape for chained selects.
pub packed_dims: Vec<usize>,
/// Declared unpacked bounds, in storage order; empty uses zero-based dimensions.
pub unpacked_ranges: Vec<(i128, i128)>,
}

impl std::ops::Deref for VariableInfo {
Expand Down
2 changes: 2 additions & 0 deletions crates/celox-frontend-core/src/symbolic/artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub struct SymbolicVariable {
pub signed: bool,
pub metadata: VariableMetadata,
pub packed_dims: Vec<usize>,
/// Declared unpacked bounds, in storage order; empty uses zero-based dimensions.
pub unpacked_ranges: Vec<(i128, i128)>,
pub source: Option<SourceLocation>,
pub module_affiliated: bool,
}
Expand Down
1 change: 1 addition & 0 deletions crates/celox-frontend-core/src/symbolic/assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,7 @@ fn module_variables(
var_kind: variable.kind,
signed: variable.signed,
packed_dims: variable.packed_dims.clone(),
unpacked_ranges: variable.unpacked_ranges.clone(),
metadata: variable.metadata.clone(),
},
);
Expand Down
1 change: 1 addition & 0 deletions crates/celox-frontend-core/src/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ pub fn declare_counter_slots(
type_kind: PortTypeKind::Bit,
array_dims: Vec::new(),
},
unpacked_ranges: Vec::new(),
packed_dims: vec![EVENT_COUNTER_WIDTH],
source: None,
module_affiliated: false,
Expand Down
Loading
Loading