Skip to content
Merged
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
14 changes: 14 additions & 0 deletions conformance/sv-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ class with constraints is rejected. `18.5.8.1--foreach-iterative-constraints_0`,
static random properties. Full official runs at the pinned revision report 1112
passing cases in 2state and 1123 in 4state, with no passing case regressing.

Dynamic container support updates 22 rows: both state modes of eleven chapter 7
cases change from fail to pass. Eight cases execute simulations and their
`:assert:` output passes: associative assignment, `exists`, `first`, `last`,
`next`, `prev`, traversal with a byte key, and dynamic-array `new[]`. The traversal
case declares both its key and output as `byte`; the stored key is already
truncated before traversal, so returning 1 is correct. The integral-key and
string-key associative declaration cases and `queues/basic` pass elaboration
only; they do not establish runtime behavior. Queue mutations and other container
behavior are exercised by the shared container simulation cases.
The [reviewed CI run](https://github.com/celox-sim/celox/actions/runs/40323383639)
contains 3,300 case/mode verdicts at the pinned revision. These are its only
changed rows, with no passing case regressing: 1,201 cases pass in 2state and
1,212 in 4state. Only these reviewed expectations are updated.

## Running locally

Use the locked development shell and install the pinned [`requirements.txt`](requirements.txt) in a Python environment.
Expand Down
44 changes: 22 additions & 22 deletions conformance/sv-tests/expected.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -1259,12 +1259,12 @@ chapter-7/arrays/associative/alloc.sv 2state fail
chapter-7/arrays/associative/alloc.sv 4state fail
chapter-7/arrays/associative/arguments.sv 2state fail
chapter-7/arrays/associative/arguments.sv 4state fail
chapter-7/arrays/associative/assignment.sv 2state fail
chapter-7/arrays/associative/assignment.sv 4state fail
chapter-7/arrays/associative/assignment.sv 2state pass
chapter-7/arrays/associative/assignment.sv 4state pass
chapter-7/arrays/associative/class.sv 2state fail
chapter-7/arrays/associative/class.sv 4state fail
chapter-7/arrays/associative/integral.sv 2state fail
chapter-7/arrays/associative/integral.sv 4state fail
chapter-7/arrays/associative/integral.sv 2state pass
chapter-7/arrays/associative/integral.sv 4state pass
chapter-7/arrays/associative/literals.sv 2state fail
chapter-7/arrays/associative/literals.sv 4state fail
chapter-7/arrays/associative/locator-methods/find-first-index.sv 2state fail
Expand All @@ -1289,36 +1289,36 @@ chapter-7/arrays/associative/locator-methods/unique.sv 2state fail
chapter-7/arrays/associative/locator-methods/unique.sv 4state fail
chapter-7/arrays/associative/methods/delete.sv 2state fail
chapter-7/arrays/associative/methods/delete.sv 4state fail
chapter-7/arrays/associative/methods/exists.sv 2state fail
chapter-7/arrays/associative/methods/exists.sv 4state fail
chapter-7/arrays/associative/methods/first.sv 2state fail
chapter-7/arrays/associative/methods/first.sv 4state fail
chapter-7/arrays/associative/methods/last.sv 2state fail
chapter-7/arrays/associative/methods/last.sv 4state fail
chapter-7/arrays/associative/methods/next.sv 2state fail
chapter-7/arrays/associative/methods/next.sv 4state fail
chapter-7/arrays/associative/methods/exists.sv 2state pass
chapter-7/arrays/associative/methods/exists.sv 4state pass
chapter-7/arrays/associative/methods/first.sv 2state pass
chapter-7/arrays/associative/methods/first.sv 4state pass
chapter-7/arrays/associative/methods/last.sv 2state pass
chapter-7/arrays/associative/methods/last.sv 4state pass
chapter-7/arrays/associative/methods/next.sv 2state pass
chapter-7/arrays/associative/methods/next.sv 4state pass
chapter-7/arrays/associative/methods/num.sv 2state fail
chapter-7/arrays/associative/methods/num.sv 4state fail
chapter-7/arrays/associative/methods/prev.sv 2state fail
chapter-7/arrays/associative/methods/prev.sv 4state fail
chapter-7/arrays/associative/methods/prev.sv 2state pass
chapter-7/arrays/associative/methods/prev.sv 4state pass
chapter-7/arrays/associative/methods/size.sv 2state fail
chapter-7/arrays/associative/methods/size.sv 4state fail
chapter-7/arrays/associative/methods/traversal.sv 2state fail
chapter-7/arrays/associative/methods/traversal.sv 4state fail
chapter-7/arrays/associative/methods/traversal.sv 2state pass
chapter-7/arrays/associative/methods/traversal.sv 4state pass
chapter-7/arrays/associative/nonexistent.sv 2state fail
chapter-7/arrays/associative/nonexistent.sv 4state fail
chapter-7/arrays/associative/other.sv 2state fail
chapter-7/arrays/associative/other.sv 4state fail
chapter-7/arrays/associative/string.sv 2state fail
chapter-7/arrays/associative/string.sv 4state fail
chapter-7/arrays/associative/string.sv 2state pass
chapter-7/arrays/associative/string.sv 4state pass
chapter-7/arrays/associative/wildcard.sv 2state fail
chapter-7/arrays/associative/wildcard.sv 4state fail
chapter-7/arrays/dynamic/basic.sv 2state pass
chapter-7/arrays/dynamic/basic.sv 4state pass
chapter-7/arrays/dynamic/op-delete.sv 2state fail
chapter-7/arrays/dynamic/op-delete.sv 4state fail
chapter-7/arrays/dynamic/op-new.sv 2state fail
chapter-7/arrays/dynamic/op-new.sv 4state fail
chapter-7/arrays/dynamic/op-new.sv 2state pass
chapter-7/arrays/dynamic/op-new.sv 4state pass
chapter-7/arrays/dynamic/op-size.sv 2state fail
chapter-7/arrays/dynamic/op-size.sv 4state fail
chapter-7/arrays/multidimensional/basic.sv 2state pass
Expand Down Expand Up @@ -1407,8 +1407,8 @@ chapter-7/memories/basic.sv 2state pass
chapter-7/memories/basic.sv 4state pass
chapter-7/memories/read-write.sv 2state pass
chapter-7/memories/read-write.sv 4state pass
chapter-7/queues/basic.sv 2state fail
chapter-7/queues/basic.sv 4state fail
chapter-7/queues/basic.sv 2state pass
chapter-7/queues/basic.sv 4state pass
chapter-7/queues/bounded.sv 2state fail
chapter-7/queues/bounded.sv 4state fail
chapter-7/queues/delete.sv 2state fail
Expand Down
17 changes: 17 additions & 0 deletions crates/celox-frontend-sv/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,13 @@ fn kernel_written_names(
});
}
while let Some((callee, args)) = calls.pop() {
if let sv::ir::Callee::Object(op) = &callee {
names.extend(
procedural::written_object_arguments(op, &args)
.iter()
.map(|lhs| lhs.name().to_string()),
);
}
let name = match callee {
sv::ir::Callee::System(function) => {
names.extend(
Expand Down Expand Up @@ -1647,6 +1654,11 @@ impl DriverScan<'_> {
});
}
while let Some((callee, args)) = calls.pop() {
if let sv::ir::Callee::Object(op) = &callee {
for lhs in procedural::written_object_arguments(op, &args) {
record(&lhs);
}
}
let name = match callee {
sv::ir::Callee::System(function) => {
for lvalue in procedural::written_system_arguments(function, &args) {
Expand Down Expand Up @@ -10556,6 +10568,11 @@ mod tests {
});
}
while let Some((callee, args)) = calls.pop() {
if let sv::ir::Callee::Object(op) = &callee {
for lhs in procedural::written_object_arguments(op, &args) {
record(drivers, &lhs);
}
}
let name = match callee {
sv::ir::Callee::System(function) => {
for lvalue in procedural::written_system_arguments(function, &args) {
Expand Down
20 changes: 19 additions & 1 deletion crates/celox-frontend-sv/src/lowering/ff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//! Expressions are lowered through SLT, which keeps their width and
//! four-state semantics identical to the combinational lowering.

mod containers;
mod file_io;
mod fread;
mod objects;
Expand Down Expand Up @@ -807,6 +808,13 @@ impl<'p, 'a> Ff<'p, 'a> {
let mut assigned = HashSet::default();
let mut visited = HashSet::default();
while let Some((callee, args)) = calls.pop() {
if let sv::ir::Callee::Object(op) = &callee {
assigned.extend(
written_object_arguments(op, &args)
.iter()
.filter_map(|lhs| self.m.id(lhs.name())),
);
}
let sv::ir::Callee::Subroutine(name) = callee else {
continue;
};
Expand Down Expand Up @@ -867,6 +875,11 @@ impl<'p, 'a> Ff<'p, 'a> {
stmt.walk(&mut |stmt| stmt_calls(stmt, &mut calls));
}
while let Some((callee, args)) = calls.pop() {
if let sv::ir::Callee::Object(op) = &callee {
for lhs in written_object_arguments(op, &args) {
self.record_target(&lhs, true);
}
}
let name = match callee {
sv::ir::Callee::System(function) => {
use sv::ir::SystemFunction;
Expand Down Expand Up @@ -1595,7 +1608,12 @@ impl<'p, 'a> Ff<'p, 'a> {
callee: sv::ir::Callee::Object(op),
args,
..
} => self.object_call(op, args)?,
} => match &**op {
sv::ir::ObjectOp::Container { op, layout } => {
self.container_call(*op, *layout, args)?
}
_ => self.object_call(op, args)?,
},
Expr::Call {
callee: sv::ir::Callee::System(sv::ir::SystemFunction::Fopen),
args,
Expand Down
Loading
Loading