Skip to content

Commit

Permalink
stream-xbar: Add payload assertion stability mask
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsc96 committed Apr 2, 2024
1 parent ad22699 commit 56bd356
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/stream_omega_net.sv
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ module stream_omega_net #(
/// When this is set, valids have to be asserted until the corresponding transaction is indicated
/// by ready.
parameter int unsigned LockIn = 1'b1,
/// If `AxiVldReady` is 1, which bits of the payload to check for stability on valid inputs.
/// In some cases, we may want to allow parts of the payload to change depending on the value of
/// other parts (e.g. write data in read requests), requiring more nuanced external assertions.
parameter payload_t AxiVldMask = '1,
/// Derived parameter, do **not** overwrite!
///
/// Width of the output selection signal.
Expand Down Expand Up @@ -274,7 +278,7 @@ module stream_omega_net #(
if (AxiVldRdy) begin : gen_handshake_assertions
for (genvar i = 0; unsigned'(i) < NumInp; i++) begin : gen_inp_assertions
assert property (@(posedge clk_i) disable iff (~rst_ni)
(valid_i[i] && !ready_o[i] |=> $stable(data_i[i]))) else
(valid_i[i] && !ready_o[i] |=> $stable(data_i[i] & AxiVldMask))) else
$error("data_i is unstable at input: %0d", i);
assert property (@(posedge clk_i) disable iff (~rst_ni)
(valid_i[i] && !ready_o[i] |=> $stable(sel_i[i]))) else
Expand Down
6 changes: 5 additions & 1 deletion src/stream_xbar.sv
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ module stream_xbar #(
/// When this is set, valids have to be asserted until the corresponding transaction is indicated
/// by ready.
parameter int unsigned LockIn = 1'b1,
/// If `AxiVldReady` is 1, which bits of the payload to check for stability on valid inputs.
/// In some cases, we may want to allow parts of the payload to change depending on the value of
/// other parts (e.g. write data in read requests), requiring more nuanced external assertions.
parameter payload_t AxiVldMask = '1,
/// Derived parameter, do **not** overwrite!
///
/// Width of the output selection signal.
Expand Down Expand Up @@ -178,7 +182,7 @@ module stream_xbar #(
if (AxiVldRdy) begin : gen_handshake_assertions
for (genvar i = 0; unsigned'(i) < NumInp; i++) begin : gen_inp_assertions
assert property (@(posedge clk_i) disable iff (~rst_ni)
(valid_i[i] && !ready_o[i] |=> $stable(data_i[i]))) else
(valid_i[i] && !ready_o[i] |=> $stable(data_i[i] & AxiVldMask))) else
$error("data_i is unstable at input: %0d", i);
assert property (@(posedge clk_i) disable iff (~rst_ni)
(valid_i[i] && !ready_o[i] |=> $stable(sel_i[i]))) else
Expand Down

0 comments on commit 56bd356

Please sign in to comment.