data/full_repos/permissive/492704601/verilog/rtl/pinmux/src/gpio_intr.sv
data/verilator_xmls/eb84b922-ec5a-444f-bd03-2a59763b4c92.xml
module gpio_intr_gen (
   input  logic         mclk                     ,
   input  logic         h_reset_n                ,
   input  logic [31:0]  gpio_prev_indata         ,
   input  logic [31:0]  cfg_gpio_data_in         ,
   input  logic [31:0]  cfg_gpio_out_data        ,
   input  logic [31:0]  cfg_gpio_dir_sel         ,
   input  logic [31:0]  cfg_gpio_posedge_int_sel ,
   input  logic [31:0]  cfg_gpio_negedge_int_sel ,
   
   
   output logic [31:0]  pad_gpio_out             ,
   output logic [31:0]  gpio_int_event
 
);


integer i;




reg [31:0]  local_gpio_int_event;
always_comb
begin
   for (i=0; i<32; i=i+1)
   begin 

      local_gpio_int_event[i] = ((cfg_gpio_posedge_int_sel[i] & ~gpio_prev_indata[i] 
                                   &  cfg_gpio_data_in[i]) | 
                                 (cfg_gpio_negedge_int_sel[i] & gpio_prev_indata[i] & 
                                     ~cfg_gpio_data_in[i]));

   end
end

assign gpio_int_event   = local_gpio_int_event[31:0];

assign pad_gpio_out     = cfg_gpio_out_data[31:0]     ;

endmodule
module gpio_intr_gen (
   input  logic         mclk                     ,
   input  logic         h_reset_n                ,
   input  logic [31:0]  gpio_prev_indata         ,
   input  logic [31:0]  cfg_gpio_data_in         ,
   input  logic [31:0]  cfg_gpio_out_data        ,
   input  logic [31:0]  cfg_gpio_dir_sel         ,
   input  logic [31:0]  cfg_gpio_posedge_int_sel ,
   input  logic [31:0]  cfg_gpio_negedge_int_sel ,
   
   
   output logic [31:0]  pad_gpio_out             ,
   output logic [31:0]  gpio_int_event
 
);



integer i;




reg [31:0]  local_gpio_int_event;
always_comb
begin
   for (i=0; i<32; i=i+1)
   begin 

      local_gpio_int_event[i] = ((cfg_gpio_posedge_int_sel[i] & ~gpio_prev_indata[i] 
                                   &  cfg_gpio_data_in[i]) | 
                                 (cfg_gpio_negedge_int_sel[i] & gpio_prev_indata[i] & 
                                     ~cfg_gpio_data_in[i]));

   end
end

assign gpio_int_event   = local_gpio_int_event[31:0];

assign pad_gpio_out     = cfg_gpio_out_data[31:0]     ;

endmodule