forked from pulp-platform/axi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add assertions, use split module in
axi_to_mem_split
- Loading branch information
1 parent
ded97ff
commit c7d995b
Showing
3 changed files
with
34 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
// - Tobias Senti <[email protected]> | ||
|
||
`include "axi/assign.svh" | ||
`include "common_cells/assertions.svh" | ||
|
||
/// Joins a read and a write slave into one single read / write master | ||
/// | ||
|
@@ -22,6 +23,8 @@ module axi_rw_join #( | |
parameter type axi_req_t = logic, | ||
parameter type axi_resp_t = logic | ||
) ( | ||
input logic clk_i, | ||
input logic rst_ni, | ||
// Read Slave | ||
input axi_req_t slv_read_req_i, | ||
output axi_resp_t slv_read_resp_o, | ||
|
@@ -44,7 +47,7 @@ module axi_rw_join #( | |
`AXI_ASSIGN_R_STRUCT ( slv_read_resp_o.r , mst_resp_i.r ) | ||
|
||
// Read B channel data | ||
assign slv_read_resp_o.b = 'b0; | ||
assign slv_read_resp_o.b = '0; | ||
|
||
|
||
//-------------------------------------- | ||
|
@@ -64,6 +67,10 @@ module axi_rw_join #( | |
assign slv_read_resp_o.w_ready = 1'b0; | ||
assign slv_read_resp_o.b_valid = 1'b0; | ||
|
||
// check for AW and W never to be valid | ||
`ASSERT_NEVER(slv_read_req_aw_valid, slv_read_req_i.aw_valid, clk_i, !rst_ni) | ||
`ASSERT_NEVER(slv_read_req_w_valid, slv_read_req_i.w_valid, clk_i, !rst_ni) | ||
|
||
//-------------------------------------- | ||
// Write channel data | ||
//-------------------------------------- | ||
|
@@ -85,6 +92,9 @@ module axi_rw_join #( | |
assign slv_write_resp_o.ar_ready = 1'b0; | ||
assign slv_write_resp_o.r_valid = 1'b0; | ||
|
||
// check for AR to never be valid | ||
`ASSERT_NEVER(slv_write_req_ar_valid, slv_write_req_i.ar_valid, clk_i, !rst_ni) | ||
|
||
// Write AW channel handshake | ||
assign mst_req_o.aw_valid = slv_write_req_i.aw_valid; | ||
assign slv_write_resp_o.aw_ready = mst_resp_i.aw_ready; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
// - Tobias Senti <[email protected]> | ||
|
||
`include "axi/assign.svh" | ||
`include "common_cells/assertions.svh" | ||
|
||
/// Splits a single read / write slave into one read and one write master | ||
/// | ||
|
@@ -22,6 +23,8 @@ module axi_rw_split #( | |
parameter type axi_req_t = logic, | ||
parameter type axi_resp_t = logic | ||
) ( | ||
input logic clk_i, | ||
input logic rst_ni, | ||
// Read / Write Slave | ||
input axi_req_t slv_req_i, | ||
output axi_resp_t slv_resp_o, | ||
|
@@ -65,6 +68,9 @@ module axi_rw_split #( | |
assign mst_read_req_o.w_valid = 1'b0; | ||
assign mst_read_req_o.b_ready = 1'b0; | ||
|
||
// check for B never to be valid | ||
`ASSERT_NEVER(mst_read_resp_b_valid, mst_read_resp_i.b_valid, clk_i, !rst_ni) | ||
|
||
|
||
//-------------------------------------- | ||
// Write channel data | ||
|
@@ -76,7 +82,7 @@ module axi_rw_split #( | |
`AXI_ASSIGN_B_STRUCT ( slv_resp_o.b , mst_write_resp_i.b ) | ||
|
||
// Write AR channel data | ||
assign mst_write_req_o.ar = 'b0; | ||
assign mst_write_req_o.ar = '0; | ||
|
||
|
||
//-------------------------------------- | ||
|
@@ -87,6 +93,9 @@ module axi_rw_split #( | |
assign mst_write_req_o.ar_valid = 1'b0; | ||
assign mst_write_req_o.r_ready = 1'b0; | ||
|
||
// check for R never to be valid | ||
`ASSERT_NEVER(mst_read_resp_r_valid, mst_read_resp_i.r_valid, clk_i, !rst_ni) | ||
|
||
// Write AW channel handshake | ||
assign mst_write_req_o.aw_valid = slv_req_i.aw_valid; | ||
assign slv_resp_o.aw_ready = mst_write_resp_i.aw_ready; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters