From 1b3b5e380728a459cd3c550b26bfbc48cb9445cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20R=C3=B6nninger?= Date: Tue, 19 May 2020 15:36:47 +0200 Subject: [PATCH] stream_xbar: Move selection assertion outside handshake assertion block --- src/stream_xbar.sv | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stream_xbar.sv b/src/stream_xbar.sv index c640ccb3..28d8fa4c 100644 --- a/src/stream_xbar.sv +++ b/src/stream_xbar.sv @@ -165,6 +165,11 @@ module stream_xbar #( // pragma translate_off `ifndef VERILATOR default disable iff rst_ni; + for (genvar i = 0; unsigned'(i) < NumInp; i++) begin : gen_sel_assertions + assert property (@(posedge clk_i) (valid_i[i] |-> sel_i[i] < sel_oup_t'(NumOut))) else + $fatal(1, "Non-existing output is selected!"); + end + if (AxiVldRdy) begin : gen_handshake_assertions for (genvar i = 0; unsigned'(i) < NumInp; i++) begin : gen_inp_assertions assert property (@(posedge clk_i) (valid_i[i] && !ready_o[i] |=> $stable(data_i[i]))) else @@ -173,8 +178,6 @@ module stream_xbar #( $error("sel_i is unstable at input: %0d", i); assert property (@(posedge clk_i) (valid_i[i] && !ready_o[i] |=> valid_i[i])) else $error("valid_i at input %0d has been taken away without a ready."); - assert property (@(posedge clk_i) (valid_i[i] |-> sel_i[i] < sel_oup_t'(NumOut))) else - $fatal(1, "Non-existing output is selected!"); end for (genvar i = 0; unsigned'(i) < NumOut; i++) begin : gen_out_assertions assert property (@(posedge clk_i) (valid_o[i] && !ready_i[i] |=> $stable(data_o[i]))) else