diff --git a/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_sl_fifo.sv b/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_sl_fifo.sv new file mode 100644 index 0000000000..ba0a61bdd8 --- /dev/null +++ b/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_sl_fifo.sv @@ -0,0 +1,107 @@ +// Copyright 2022 Silicon Labs, Inc. +// +// Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://solderpad.org/licenses/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 + +/* + +This is a configurable FIFO. +It inputs item_in when add_item is set. +It always outputs the "oldest" fifo item. +It shifts the fifo on the next clock cycle when shift_fifo is set. + +The figure shows how the FIFO behaves: + +t1: | t2: | t3: | +add_item | add_item | !add_item | +&& !shift_fifo | && !shift_fifo | && !shift_fifo | +_____________ | _____________ | _____________ | +| | | | | | | | | | | | | | | +| | | X | | | i1| | X | | | i1| i2| X | | +|___|___|___| | |___|___|___| | |___|___|___| | + ^ ^ ^ +t4: | t5: | t6: | +!add_item | !add_item | !add_item | +&& shift_fifo | && shift_fifo | && !shift_fifo | +_____________ | _____________ | _____________ | +| | | | | | | | | | | | | | | +| i1| i2| X | | | i2| | X | | | | | X | | +|___|___|___| | |___|___|___| | |___|___|___| | + ^ ^ ^ +t7: | t8: | t9: | +add_item | add_item | !add_item | +&& !shift_fifo | && shift_fifo | && !shift_fifo | +_____________ | _____________ | _____________ | +| | | | | | | | | | | | | | | +| | | X | | | i3| | X | | | i4| | X | | +|___|___|___| | |___|___|___| | |___|___|___| | + ^ ^ ^ +*/ + +module uvmt_cv32e40s_sl_fifo + import cv32e40s_pkg::*; + #( + parameter type FIFO_TYPE_T = obi_inst_req_t, + parameter FIFO_SIZE = 2 + ) + ( + input logic rst_ni, + input logic clk_i, + + input logic add_item, + input logic shift_fifo, + + input FIFO_TYPE_T item_in, + output FIFO_TYPE_T item_out + ); + + // Extend the FIFO with one elemet to make sure the pointer will not underflow + localparam FIFO_PTR_SIZE = $clog2(FIFO_SIZE+1); + + // Extend the FIFO with one elemet to make sure the pointer will not underflow + FIFO_TYPE_T [FIFO_SIZE:0] fifo; + logic [FIFO_PTR_SIZE-1:0] ptr; + FIFO_TYPE_T zero; + + assign item_out = fifo[FIFO_SIZE]; + + always_ff @(posedge clk_i, negedge rst_ni) begin + if(!rst_ni) begin + fifo <= '0; + ptr <= FIFO_SIZE; + zero <= '0; + end else begin + if (add_item && !shift_fifo) begin + fifo[ptr] <= item_in; + ptr <= ptr - 1'b1; + + end else if (!add_item && shift_fifo) begin + ptr <= ptr + 1'b1; + + fifo[FIFO_SIZE:1] <= fifo[FIFO_SIZE-1:0]; + fifo[0] <= zero; + + // If used correctly the fifo should not shift unless there already is an item in the fifo. + // For safety we add this as a requirement for entering this fifo state. + end else if (add_item && shift_fifo && ptr < FIFO_SIZE) begin + fifo[FIFO_SIZE:1] <= fifo[FIFO_SIZE-1:0]; + fifo[0] <= zero; + + fifo[ptr+1'b1] <= item_in; + end + end + end + + +endmodule : uvmt_cv32e40s_sl_fifo diff --git a/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_sl_req_attribute_fifo.sv b/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_sl_req_attribute_fifo.sv deleted file mode 100644 index e95d041af4..0000000000 --- a/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_sl_req_attribute_fifo.sv +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2022 Silicon Labs, Inc. -// -// Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://solderpad.org/licenses/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0 - -/* -This support logic submodule monitors the OBI handshake, which consists of a request and a response. -The request can contain attributes that affect the response. -This module aims to monitor an attribute of the request, and when receiving the corresponding response, output the response's request's attribute value. -What complicates the described task is that a request is not always directly followed by a response. -In other words, we need to keep track of which request belongs to which response. -The module uses a FIFO to keep track of the requests and the responses. -The FIFO can only hold 2 requests at once. -The figure shows how the FIFO behaves when requests are generated ((gnt && reg)==1) and responses are received (rvalid==1). -In the figure, the FIFO is the container, the pointer is illustrated as a ^, and rN is the request number N's attribute value. -The attribute value in FIFO[2] is read whenever rvalid==1. -t1: | t2: | t3: | -gnt && req | gnt && req | !(gnt && req) | -&& !rvalid | && !rvalid | && !rvalid | -_____________ | _____________ | _____________ | -| | | | | | | | | | | | | | | -| X | | | | | X | | r1| | | X | r2| r1| | -|___|___|___| | |___|___|___| | |___|___|___| | - ^ ^ ^ -t4: | t5: | t6: | -!(gnt && req) | !(gnt && req) | !(gnt && req) | -&& rvalid | && rvalid | && !rvalid | -_____________ | _____________ | _____________ | -| | | | | | | | | | | | | | | -| X | r2| r1| | | X | | r2| | | X | | | | -|___|___|___| | |___|___|___| | |___|___|___| | - ^ ^ ^ -t7: | t8: | t9: | -gnt && req | gnt && req | !(gnt && req) | -&& !rvalid | && rvalid | && !rvalid | -_____________ | _____________ | _____________ | -| | | | | | | | | | | | | | | -| X | | | | | X | | r3| | | X | | r4| | -|___|___|___| | |___|___|___| | |___|___|___| | - ^ ^ ^ -*/ - - -module uvmt_cv32e40s_sl_req_attribute_fifo - #( - parameter int XLEN = 1 - ) - ( - input logic rst_ni, - input logic clk_i, - - //OBI handshake signals - input logic gnt, - input logic req, - input logic rvalid, - - //Attribute in the current request - input logic [XLEN-1:0] req_attribute_i, - - //Indicates if the response's request contained the attribute or not - output logic [XLEN-1:0] is_req_attribute_in_response_o - ); - - logic [2:0][XLEN-1:0] fifo; - logic [1:0] pointer; - - assign is_req_attribute_in_response_o = rvalid ? fifo[2] : '0; - - always @(posedge clk_i, negedge rst_ni) begin - if(!rst_ni) begin - fifo <= 3'b000; - pointer = 2'd2; - end else begin - //This logic is demonstrated in time t1, t2 and t3 in the figure above - if ((gnt && req) && !rvalid) begin - fifo[pointer] = req_attribute_i; - pointer <= pointer - 2'd1; - - //This logic is demonstrated in time t4, t5 and t6 in the figure above - end else if (!(gnt && req) && rvalid) begin - pointer <= pointer + 2'd1; - fifo <= {fifo[1:0], '0}; - - //This logic is demonstrated in time t8 and t9 in the figure above (and uses t7 to generate a situation where this part of the logic can be used) - end else if ((gnt && req) && rvalid) begin - fifo[pointer] = req_attribute_i; - fifo <= {fifo[1:0], '0}; - - end - end - end - -endmodule : uvmt_cv32e40s_sl_req_attribute_fifo diff --git a/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_support_logic.sv b/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_support_logic.sv index c9d9892141..bdbfec8f38 100644 --- a/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_support_logic.sv +++ b/cv32e40s/tb/uvmt/support_logic/uvmt_cv32e40s_support_logic.sv @@ -25,7 +25,9 @@ module uvmt_cv32e40s_support_logic ( uvma_rvfi_instr_if_t rvfi, uvmt_cv32e40s_support_logic_module_i_if_t.driver_mp in_support_if, - uvmt_cv32e40s_support_logic_module_o_if_t.master_mp out_support_if + uvmt_cv32e40s_support_logic_module_o_if_t.master_mp out_support_if, + uvma_obi_memory_if_t data_obi_if, + uvma_obi_memory_if_t instr_obi_if ); @@ -36,11 +38,11 @@ module uvmt_cv32e40s_support_logic default clocking @(posedge in_support_if.clk); endclocking default disable iff (!in_support_if.rst_n); - // --------------------------------------------------------------------------- // Local parameters // --------------------------------------------------------------------------- + localparam MAX_NUM_OUTSTANDING_OBI_REQUESTS = 2; // --------------------------------------------------------------------------- // Local variables @@ -63,6 +65,25 @@ module uvmt_cv32e40s_support_logic int req_vs_valid_cnt; + obi_data_req_t data_obi_req; + assign data_obi_req.addr = data_obi_if.addr; + assign data_obi_req.we = data_obi_if.we; + assign data_obi_req.be = data_obi_if.be; + assign data_obi_req.wdata = data_obi_if.wdata; + assign data_obi_req.memtype = data_obi_if.memtype; + assign data_obi_req.prot = data_obi_if.prot; + assign data_obi_req.dbg = data_obi_if.dbg; + assign data_obi_req.achk = data_obi_if.achk; + assign data_obi_req.integrity = '0; + + obi_inst_req_t instr_obi_req; + assign instr_obi_req.addr = instr_obi_if.addr; + assign instr_obi_req.memtype = instr_obi_if.memtype; + assign instr_obi_req.prot = instr_obi_if.prot; + assign instr_obi_req.dbg = instr_obi_if.dbg; + assign instr_obi_req.achk = instr_obi_if.achk; + assign instr_obi_req.integrity = '0; + // --------------------------------------------------------------------------- // Support logic blocks // --------------------------------------------------------------------------- @@ -299,81 +320,89 @@ end ); - //The submodule instance under will tell if the - //the response's request required a store operation. + //The submodule instances under will tell if the + //the response's request had integrity - uvmt_cv32e40s_sl_req_attribute_fifo + uvmt_cv32e40s_sl_fifo #( - .XLEN (1) - ) req_was_store_i + .FIFO_TYPE_T (logic), + .FIFO_SIZE (MAX_NUM_OUTSTANDING_OBI_REQUESTS) + ) instr_req_had_integrity_i ( .clk_i (in_support_if.clk), .rst_ni (in_support_if.rst_n), - .gnt (in_support_if.data_bus_gnt), - .req (in_support_if.data_bus_req), - .rvalid (in_support_if.data_bus_rvalid), - .req_attribute_i (in_support_if.req_is_store & in_support_if.rst_n), + .add_item (in_support_if.instr_bus_gnt && in_support_if.instr_bus_req), + .shift_fifo (in_support_if.instr_bus_rvalid), - .is_req_attribute_in_response_o (out_support_if.req_was_store) + .item_in (in_support_if.req_instr_integrity), + .item_out (out_support_if.instr_req_had_integrity) ); - uvmt_cv32e40s_sl_req_attribute_fifo + uvmt_cv32e40s_sl_fifo #( - .XLEN (32) - ) instr_resp_pc_i + .FIFO_TYPE_T (logic), + .FIFO_SIZE (MAX_NUM_OUTSTANDING_OBI_REQUESTS) + ) data_req_had_integrity_i ( .clk_i (in_support_if.clk), .rst_ni (in_support_if.rst_n), - .gnt (in_support_if.instr_bus_gnt), - .req (in_support_if.instr_bus_req), - .rvalid (in_support_if.instr_bus_rvalid), - .req_attribute_i (in_support_if.instr_req_pc & !in_support_if.rst_n), + .add_item (in_support_if.data_bus_gnt && in_support_if.data_bus_req), + .shift_fifo (in_support_if.data_bus_rvalid), - .is_req_attribute_in_response_o (out_support_if.instr_resp_pc) + .item_in (in_support_if.req_data_integrity), + .item_out (out_support_if.data_req_had_integrity) ); - //The submodule instance under will tell if the - //the response's request had integrity - //in the transfere of instructions on the OBI instruction bus. - - uvmt_cv32e40s_sl_req_attribute_fifo + uvmt_cv32e40s_sl_fifo #( - .XLEN (1) - ) instr_req_had_integrity_i + .FIFO_TYPE_T (obi_data_req_t), + .FIFO_SIZE (MAX_NUM_OUTSTANDING_OBI_REQUESTS) + ) fifo_obi_data_req ( .clk_i (in_support_if.clk), .rst_ni (in_support_if.rst_n), - .gnt (in_support_if.instr_bus_gnt), - .req (in_support_if.instr_bus_req), - .rvalid (in_support_if.instr_bus_rvalid), - .req_attribute_i (in_support_if.req_instr_integrity & in_support_if.rst_n), + .add_item (data_obi_if.gnt && data_obi_if.req), + .shift_fifo (data_obi_if.rvalid), - .is_req_attribute_in_response_o (out_support_if.instr_req_had_integrity) + .item_in (data_obi_req), + .item_out (out_support_if.obi_data_packet.req) ); - //The submodule instance under will tell if the - //the response's request had integrity - //in the transfere of data on the OBI data bus. + assign out_support_if.obi_data_packet.resp.rdata = data_obi_if.rdata; + assign out_support_if.obi_data_packet.resp.err = data_obi_if.err; + assign out_support_if.obi_data_packet.resp.rchk = data_obi_if.rchk; + assign out_support_if.obi_data_packet.resp.integrity_err = '0; + assign out_support_if.obi_data_packet.resp.integrity = '0; + assign out_support_if.obi_data_packet.valid = data_obi_if.rvalid; + - uvmt_cv32e40s_sl_req_attribute_fifo + uvmt_cv32e40s_sl_fifo #( - .XLEN (1) - ) data_req_had_integrity_i + .FIFO_TYPE_T (obi_inst_req_t), + .FIFO_SIZE (MAX_NUM_OUTSTANDING_OBI_REQUESTS) + ) fifo_obi_instr_req ( .clk_i (in_support_if.clk), .rst_ni (in_support_if.rst_n), - .gnt (in_support_if.data_bus_gnt), - .req (in_support_if.data_bus_req), - .rvalid (in_support_if.data_bus_rvalid), - .req_attribute_i (in_support_if.req_data_integrity & in_support_if.rst_n), + .add_item (instr_obi_if.gnt && instr_obi_if.req), + .shift_fifo (instr_obi_if.rvalid), - .is_req_attribute_in_response_o (out_support_if.data_req_had_integrity) + .item_in (instr_obi_req), + .item_out (out_support_if.obi_instr_packet.req) ); + assign out_support_if.obi_instr_packet.resp.rdata = instr_obi_if.rdata; + assign out_support_if.obi_instr_packet.resp.err = instr_obi_if.err; + assign out_support_if.obi_instr_packet.resp.rchk = instr_obi_if.rchk; + assign out_support_if.obi_instr_packet.resp.integrity_err = '0; + assign out_support_if.obi_instr_packet.resp.integrity = '0; + assign out_support_if.obi_instr_packet.valid = instr_obi_if.rvalid; + + //The submodule instance under will tell if the //the response's request had a gntpar error //in the transfere of instructions on the OBI instruction bus. @@ -407,40 +436,40 @@ end end end - uvmt_cv32e40s_sl_req_attribute_fifo + uvmt_cv32e40s_sl_fifo #( - .XLEN (1) + .FIFO_TYPE_T (logic), + .FIFO_SIZE (MAX_NUM_OUTSTANDING_OBI_REQUESTS) ) sl_req_gntpar_error_in_resp_instr_i ( - .clk_i (in_support_if.clk), + .clk_i (in_support_if.clk), .rst_ni (in_support_if.rst_n), - .gnt (in_support_if.instr_bus_gnt), - .req (in_support_if.instr_bus_req), - .rvalid (in_support_if.instr_bus_rvalid), - .req_attribute_i (instr_gntpar_error), + .add_item (in_support_if.instr_bus_gnt && in_support_if.instr_bus_req), + .shift_fifo (in_support_if.instr_bus_rvalid), - .is_req_attribute_in_response_o (out_support_if.gntpar_error_in_response_instr) + .item_in (instr_gntpar_error), + .item_out (out_support_if.gntpar_error_in_response_instr) ); //The submodule instance under will tell if the //the response's request had a gntpar error //in the transfere of data on the OBI data bus. - uvmt_cv32e40s_sl_req_attribute_fifo + uvmt_cv32e40s_sl_fifo #( - .XLEN (1) + .FIFO_TYPE_T (logic), + .FIFO_SIZE (MAX_NUM_OUTSTANDING_OBI_REQUESTS) ) sl_req_gntpar_error_in_resp_data_i ( - .clk_i (in_support_if.clk), + .clk_i (in_support_if.clk), .rst_ni (in_support_if.rst_n), - .gnt (in_support_if.data_bus_gnt), - .req (in_support_if.data_bus_req), - .rvalid (in_support_if.data_bus_rvalid), - .req_attribute_i (data_gntpar_error), + .add_item (in_support_if.data_bus_gnt && in_support_if.data_bus_req), + .shift_fifo (in_support_if.data_bus_rvalid), - .is_req_attribute_in_response_o (out_support_if.gntpar_error_in_response_data) + .item_in (data_gntpar_error), + .item_out (out_support_if.gntpar_error_in_response_data) ); endmodule : uvmt_cv32e40s_support_logic diff --git a/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb.sv b/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb.sv index c10a3116a6..9bb18da420 100644 --- a/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb.sv +++ b/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb.sv @@ -1440,10 +1440,8 @@ module uvmt_cv32e40s_tb; .lrfodi_bus_req (core_i.load_store_unit_i.buffer_trans_valid), .lrfodi_bus_gnt (core_i.load_store_unit_i.buffer_trans_ready), - .req_is_store (core_i.m_c_obi_data_if.req_payload.we), .req_instr_integrity (core_i.m_c_obi_instr_if.req_payload.integrity), - .req_data_integrity (core_i.m_c_obi_data_if.req_payload.integrity), - .instr_req_pc ({core_i.m_c_obi_instr_if.req_payload.addr[31:2], 2'b0}) + .req_data_integrity (core_i.m_c_obi_data_if.req_payload.integrity) ); bind cv32e40s_wrapper @@ -1641,7 +1639,9 @@ module uvmt_cv32e40s_tb; bind cv32e40s_wrapper uvmt_cv32e40s_support_logic u_support_logic(.rvfi (rvfi_instr_if), .in_support_if (support_logic_module_i_if.driver_mp), - .out_support_if (support_logic_module_o_if.master_mp) + .out_support_if (support_logic_module_o_if.master_mp), + .data_obi_if (dut_wrap.obi_data_if), + .instr_obi_if (dut_wrap.obi_instr_if) ); diff --git a/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_files.flist b/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_files.flist index daac323490..151a476c59 100644 --- a/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_files.flist +++ b/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_files.flist @@ -46,7 +46,7 @@ ${DV_UVMT_PATH}/uvmt_cv32e40s_zc_assert.sv ${DV_UVMT_PATH}/../assertions/uvmt_cv32e40s_pma_model.sv ${DV_UVMT_PATH}/../assertions/uvmt_cv32e40s_pmp_model.sv ${DV_UVMT_PATH}/support_logic/uvmt_cv32e40s_sl_obi_phases_monitor.sv -${DV_UVMT_PATH}/support_logic/uvmt_cv32e40s_sl_req_attribute_fifo.sv +${DV_UVMT_PATH}/support_logic/uvmt_cv32e40s_sl_fifo.sv ${DV_UVMT_PATH}/support_logic/uvmt_cv32e40s_sl_trigger_match_mem.sv ${DV_UVMT_PATH}/support_logic/uvmt_cv32e40s_sl_trigger_match.sv ${DV_UVMT_PATH}/support_logic/uvmt_cv32e40s_support_logic.sv diff --git a/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_ifs.sv b/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_ifs.sv index 65e6bd0f5b..54aaeacee1 100644 --- a/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_ifs.sv +++ b/cv32e40s/tb/uvmt/uvmt_cv32e40s_tb_ifs.sv @@ -320,10 +320,8 @@ interface uvmt_cv32e40s_support_logic_module_i_if_t input logic lrfodi_bus_req, //Obi request information - input logic req_is_store, input logic req_instr_integrity, - input logic req_data_integrity, - input logic [31:0] instr_req_pc + input logic req_data_integrity ); @@ -371,10 +369,8 @@ interface uvmt_cv32e40s_support_logic_module_i_if_t lrfodi_bus_gnt, lrfodi_bus_req, - req_is_store, req_instr_integrity, - req_data_integrity, - instr_req_pc + req_data_integrity ); endinterface : uvmt_cv32e40s_support_logic_module_i_if_t @@ -393,6 +389,10 @@ interface uvmt_cv32e40s_support_logic_module_o_if_t; asm_t asm_wb; asm_t asm_rvfi; + //OBI packets: + obi_data_packet_t obi_data_packet; + obi_instr_packet_t obi_instr_packet; + // Indicates that a new obi data req arrives after an exception is triggered. // Used to verify exception timing with multiop instruction logic req_after_exception; @@ -433,12 +433,10 @@ interface uvmt_cv32e40s_support_logic_module_o_if_t; logic [31:0] cnt_rvfi_irqs; //Signals stating whether the request for the current response had the attribute value or not - logic req_was_store; - logic instr_req_had_integrity; - logic data_req_had_integrity; - logic gntpar_error_in_response_instr; - logic gntpar_error_in_response_data; - logic [31:0] instr_resp_pc; + logic instr_req_had_integrity; + logic data_req_had_integrity; + logic gntpar_error_in_response_instr; + logic gntpar_error_in_response_data; // indicates that the current rvfi_valid instruction is the first in a debug handler logic first_debug_ins; @@ -486,12 +484,12 @@ interface uvmt_cv32e40s_support_logic_module_o_if_t; cnt_irq_ack, cnt_rvfi_irqs, - req_was_store, + obi_data_packet, + obi_instr_packet, instr_req_had_integrity, data_req_had_integrity, gntpar_error_in_response_instr, gntpar_error_in_response_data, - instr_resp_pc, first_debug_ins, first_fetch, recorded_dbg_req @@ -532,12 +530,12 @@ interface uvmt_cv32e40s_support_logic_module_o_if_t; cnt_irq_ack, cnt_rvfi_irqs, - req_was_store, + obi_data_packet, + obi_instr_packet, instr_req_had_integrity, data_req_had_integrity, gntpar_error_in_response_instr, gntpar_error_in_response_data, - instr_resp_pc, first_debug_ins, first_fetch, recorded_dbg_req diff --git a/cv32e40s/tb/uvmt/uvmt_cv32e40s_xsecure_assert/uvmt_cv32e40s_xsecure_interface_integrity_assert.sv b/cv32e40s/tb/uvmt/uvmt_cv32e40s_xsecure_assert/uvmt_cv32e40s_xsecure_interface_integrity_assert.sv index 56a80d9ad6..4edd10ade1 100644 --- a/cv32e40s/tb/uvmt/uvmt_cv32e40s_xsecure_assert/uvmt_cv32e40s_xsecure_interface_integrity_assert.sv +++ b/cv32e40s/tb/uvmt/uvmt_cv32e40s_xsecure_assert/uvmt_cv32e40s_xsecure_interface_integrity_assert.sv @@ -298,7 +298,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert a_xsecure_integrity_store_data_rchk: assert property ( p_checksum_data_rchk( - support_if.req_was_store, + support_if.obi_data_packet.req.we, obi_data_rvalid, obi_data_resp_packet.rchk[RCHK_STORE], rchk_data_calculated[RCHK_STORE]) @@ -307,7 +307,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert a_xsecure_integrity_load_data_rchk: assert property ( p_checksum_data_rchk( - !support_if.req_was_store, + !support_if.obi_data_packet.req.we, obi_data_rvalid, obi_data_resp_packet.rchk, rchk_data_calculated) @@ -394,7 +394,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert ##0 seq_checksum_fault( obi_data_rvalid, support_if.data_req_had_integrity, - support_if.req_was_store, + support_if.obi_data_packet.req.we, obi_data_resp_packet.rchk[RCHK_STORE], rchk_data_calculated[RCHK_STORE]) @@ -408,7 +408,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert ##0 seq_checksum_fault( obi_data_rvalid, support_if.data_req_had_integrity, - !support_if.req_was_store, + !support_if.obi_data_packet.req.we, obi_data_resp_packet.rchk, rchk_data_calculated) @@ -442,7 +442,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert ##0 seq_checksum_fault( obi_data_rvalid, support_if.data_req_had_integrity, - support_if.req_was_store, + support_if.obi_data_packet.req.we, obi_data_resp_packet.rchk[RCHK_STORE], rchk_data_calculated[RCHK_STORE]) @@ -457,7 +457,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert ##0 seq_checksum_fault( obi_data_rvalid, support_if.data_req_had_integrity, - !support_if.req_was_store, + !support_if.obi_data_packet.req.we, obi_data_resp_packet.rchk, rchk_data_calculated) @@ -554,7 +554,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert a_glitch_xsecure_integrity_data_rchk_fault_integrity_err_store: assert property ( p_rchk_fault_integrity_err( support_if.data_req_had_integrity, - support_if.req_was_store, + support_if.obi_data_packet.req.we, obi_data_rvalid, obi_data_resp_packet.rchk[RCHK_STORE], rchk_data_calculated[RCHK_STORE], @@ -564,7 +564,7 @@ module uvmt_cv32e40s_xsecure_interface_integrity_assert a_glitch_xsecure_integrity_data_rchk_fault_integrity_err_load: assert property ( p_rchk_fault_integrity_err( support_if.data_req_had_integrity, - !support_if.req_was_store, + !support_if.obi_data_packet.req.we, obi_data_rvalid, obi_data_resp_packet.rchk, rchk_data_calculated, diff --git a/cv32e40s/tests/uvmt/base-tests/uvmt_cv32e40s_base_test_tdefs.sv b/cv32e40s/tests/uvmt/base-tests/uvmt_cv32e40s_base_test_tdefs.sv index ba160bed8c..e64405f7f3 100644 --- a/cv32e40s/tests/uvmt/base-tests/uvmt_cv32e40s_base_test_tdefs.sv +++ b/cv32e40s/tests/uvmt/base-tests/uvmt_cv32e40s_base_test_tdefs.sv @@ -126,5 +126,17 @@ typedef struct packed { logic accesses_jvt; } pma_status_t; +typedef struct packed { + obi_data_req_t req; + obi_data_resp_t resp; + logic valid; +} obi_data_packet_t; + +typedef struct packed { + obi_inst_req_t req; + obi_inst_resp_t resp; + logic valid; +} obi_instr_packet_t; + `endif // __UVMT_CV32E40S_BASE_TEST_TDEFS_SV__