Line data Source code
1 : // SPDX-License-Identifier: Apache-2.0
2 : // Copyright 2020 Western Digital Corporation or its affiliates.
3 : //
4 : // Licensed under the Apache License, Version 2.0 (the "License");
5 : // you may not use this file except in compliance with the License.
6 : // You may obtain a copy of the License at
7 : //
8 : // http://www.apache.org/licenses/LICENSE-2.0
9 : //
10 : // Unless required by applicable law or agreed to in writing, software
11 : // distributed under the License is distributed on an "AS IS" BASIS,
12 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 : // See the License for the specific language governing permissions and
14 : // limitations under the License.
15 :
16 : //********************************************************************************
17 : // $Id$
18 : //
19 : //
20 : // Owner:
21 : // Function: DEC Trigger Logic
22 : // Comments:
23 : //
24 : //********************************************************************************
25 : module el2_dec_trigger
26 : import el2_pkg::*;
27 : #(
28 : `include "el2_param.vh"
29 : )(
30 :
31 1 : input el2_trigger_pkt_t [3:0] trigger_pkt_any, // Packet from tlu. 'select':0-pc,1-Opcode 'Execute' needs to be set for dec triggers to fire. 'match'-1 do mask, 0: full match
32 3747 : input logic [31:1] dec_i0_pc_d, // i0 pc
33 :
34 2501 : output logic [3:0] dec_i0_trigger_match_d // Trigger match
35 : );
36 :
37 401 : logic [3:0][31:0] dec_i0_match_data;
38 2842 : logic [3:0] dec_i0_trigger_data_match;
39 :
40 : for (genvar i=0; i<4; i++) begin : genblock
41 : assign dec_i0_match_data[i][31:0] = ({32{~trigger_pkt_any[i].select & trigger_pkt_any[i].execute}} & {dec_i0_pc_d[31:1], trigger_pkt_any[i].tdata2[0]}); // select=0; do a PC match
42 :
43 : rvmaskandmatch trigger_i0_match (.mask(trigger_pkt_any[i].tdata2[31:0]), .data(dec_i0_match_data[i][31:0]), .masken(trigger_pkt_any[i].match), .match(dec_i0_trigger_data_match[i]));
44 :
45 : assign dec_i0_trigger_match_d[i] = trigger_pkt_any[i].execute & trigger_pkt_any[i].m & dec_i0_trigger_data_match[i];
46 : end
47 :
48 : endmodule // el2_dec_trigger
49 :
|