data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv
1: b'%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:126: Operator COND expects 32 bits on the Conditional False, but Conditional False\'s CONST \'9\'h0\' generates 9 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s0_wb_adr_o = (m0_wb_tid_reg == 2\'b00) ? m0_wb_adr_reg : 9\'d0;\n                                                ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:126: Operator ASSIGNW expects 9 bits on the Assign RHS, but Assign RHS\'s COND generates 32 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s0_wb_adr_o = (m0_wb_tid_reg == 2\'b00) ? m0_wb_adr_reg : 9\'d0;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:133: Operator COND expects 32 bits on the Conditional False, but Conditional False\'s CONST \'9\'h0\' generates 9 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s1_wb_adr_o = (m0_wb_tid_reg == 2\'b01) ? m0_wb_adr_reg : 9\'d0;\n                                                ^\n%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:133: Operator ASSIGNW expects 9 bits on the Assign RHS, but Assign RHS\'s COND generates 32 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s1_wb_adr_o = (m0_wb_tid_reg == 2\'b01) ? m0_wb_adr_reg : 9\'d0;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:140: Operator ASSIGNW expects 9 bits on the Assign RHS, but Assign RHS\'s COND generates 32 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s2_wb_adr_o = (m0_wb_tid_reg == 2\'b10) ? m0_wb_adr_reg :   \'h0;\n                     ^\n%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:147: Operator COND expects 32 bits on the Conditional False, but Conditional False\'s CONST \'9\'h0\' generates 9 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s3_wb_adr_o = (m0_wb_tid_reg == 2\'b11) ? m0_wb_adr_reg : 9\'d0;\n                                                ^\n%Warning-WIDTH: data/full_repos/permissive/472671476/verilog/rtl/wb_interconnect/wb_interconnect.sv:147: Operator ASSIGNW expects 9 bits on the Assign RHS, but Assign RHS\'s COND generates 32 bits.\n                                                                                                       : ... In instance wb_interconnect\n  assign s3_wb_adr_o = (m0_wb_tid_reg == 2\'b11) ? m0_wb_adr_reg : 9\'d0;\n                     ^\n%Error: Exiting due to 7 warning(s)\n'
module wb_interconnect (
`ifdef USE_POWER_PINS
  input  wire        vccd1      ,
  input  wire        vssd1      ,
`endif
  input  wire        clk_i      ,
  input  wire        rst        ,

  input  wire [31:0] m0_wb_dat_i,
  input  wire [31:0] m0_wb_adr_i,
  input  wire [ 3:0] m0_wb_sel_i,
  input  wire        m0_wb_we_i ,
  input  wire        m0_wb_cyc_i,
  input  wire        m0_wb_stb_i,
  output wire [31:0] m0_wb_dat_o,
  output wire        m0_wb_ack_o,

  input  wire [31:0] s0_wb_dat_i,
  input  wire        s0_wb_ack_i,
  output wire [31:0] s0_wb_dat_o,
  output wire [ 8:0] s0_wb_adr_o,
  output wire [ 3:0] s0_wb_sel_o,
  output wire        s0_wb_we_o ,
  output wire        s0_wb_cyc_o,
  output wire        s0_wb_stb_o,

  input  wire [31:0] s1_wb_dat_i,
  input  wire        s1_wb_ack_i,
  output wire [31:0] s1_wb_dat_o,
  output wire [8:0] s1_wb_adr_o,
  output wire [ 3:0] s1_wb_sel_o,
  output wire        s1_wb_we_o ,
  output wire        s1_wb_cyc_o,
  output wire        s1_wb_stb_o,

  input	logic [31:0]   s2_wb_dat_i,
  input	logic 	       s2_wb_ack_i,
  output	wire  [31:0]   s2_wb_dat_o,
  output	wire  [8:0]    s2_wb_adr_o,
  output	wire  [3:0]    s2_wb_sel_o,
  output	wire  	       s2_wb_we_o,
  output	wire  	       s2_wb_cyc_o,
  output	wire  	       s2_wb_stb_o,

  input	logic [31:0]   s3_wb_dat_i,
  input	logic 	       s3_wb_ack_i,
  output	wire  [31:0]   s3_wb_dat_o,
  output	wire  [8:0]    s3_wb_adr_o,
  output	wire  [3:0]    s3_wb_sel_o,
  output	wire  	       s3_wb_we_o,
  output	wire  	       s3_wb_cyc_o,
  output	wire  	       s3_wb_stb_o
  
  
);



  reg [31:0] m0_wb_dat_i_reg;
  reg [31:0] m0_wb_adr_reg  ;
  reg [ 3:0] m0_wb_sel_reg  ;
  reg        m0_wb_we_reg   ;
  reg        m0_wb_cyc_reg  ;
  reg        m0_wb_stb_reg  ;
  reg [ 1:0] m0_wb_tid_reg  ;



  wire [31:0] s_bus_rd_wb_dat = (m0_wb_adr_i[13:12] == 2'b00) ? s0_wb_dat_i :
    (m0_wb_adr_i[13:12] == 2'b01) ? s1_wb_dat_i :  
    (m0_wb_adr_i[13:12] == 2'b10) ? s2_wb_dat_i :
    (m0_wb_adr_i[13:12] == 2'b11) ? s3_wb_dat_i : 32'd0;
  wire        s_bus_rd_wb_ack = (m0_wb_adr_i[13:12] == 2'b00) ? s0_wb_ack_i :
    (m0_wb_adr_i[13:12] == 2'b01) ? s1_wb_ack_i :
    (m0_wb_adr_i[13:12] == 2'b10) ? s2_wb_ack_i :
    (m0_wb_adr_i[13:12] == 2'b11) ? s3_wb_ack_i : 1'b0 ;











  wire [1:0] m0_wb_tid_i = m0_wb_adr_i[13:12];











  assign s0_wb_dat_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_dat_i_reg : 32'd00;
  assign s0_wb_adr_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_adr_reg : 9'd0;
  assign s0_wb_sel_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_sel_reg : 4'd0;
  assign s0_wb_we_o  = (m0_wb_tid_reg == 2'b00) ? m0_wb_we_reg  : 1'b0;
  assign s0_wb_cyc_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_cyc_reg : 1'b0;
  assign s0_wb_stb_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_stb_reg : 1'b0;

  assign s1_wb_dat_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_dat_i_reg : 32'd0;
  assign s1_wb_adr_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_adr_reg : 9'd0;
  assign s1_wb_sel_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_sel_reg : 4'd0;
  assign s1_wb_we_o  = (m0_wb_tid_reg == 2'b01) ? m0_wb_we_reg  : 1'b0;
  assign s1_wb_cyc_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_cyc_reg : 1'b0;
  assign s1_wb_stb_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_stb_reg : 1'b0;

  assign s2_wb_dat_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_dat_i_reg : 'h0;
  assign s2_wb_adr_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_adr_reg :   'h0;
  assign s2_wb_sel_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_sel_reg :   'h0;
  assign s2_wb_we_o  = (m0_wb_tid_reg == 2'b10) ? m0_wb_we_reg  :   'h0;
  assign s2_wb_cyc_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_cyc_reg :   'h0;
  assign s2_wb_stb_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_stb_reg :   'h0;

  assign s3_wb_dat_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_dat_i_reg : 32'd0;
  assign s3_wb_adr_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_adr_reg : 9'd0;
  assign s3_wb_sel_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_sel_reg : 4'd0;
  assign s3_wb_we_o  = (m0_wb_tid_reg == 2'b11) ? m0_wb_we_reg  : 1'b0;
  assign s3_wb_cyc_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_cyc_reg : 1'b0;
  assign s3_wb_stb_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_stb_reg : 1'b0;

  assign m0_wb_dat_o = s_bus_rd_wb_dat;
  assign m0_wb_ack_o = s_bus_rd_wb_ack;

  always @(posedge clk_i)
    begin
      if(rst == 1'b1)
        begin

          m0_wb_dat_i_reg <= 'h0;
          m0_wb_adr_reg   <= 'h0;
          m0_wb_sel_reg   <= 'h0;
          m0_wb_we_reg    <= 'h0;
          m0_wb_cyc_reg   <= 'h0;
          m0_wb_stb_reg   <= 'h0;
          m0_wb_tid_reg   <= 'h0;


        end
      else
        begin
          m0_wb_dat_i_reg <= 'h0;
          m0_wb_adr_reg   <= 'h0;
          m0_wb_sel_reg   <= 'h0;
          m0_wb_we_reg    <= 'h0;
          m0_wb_cyc_reg   <= 'h0;
          m0_wb_stb_reg   <= 'h0;
          m0_wb_tid_reg   <= 'h0;

          if(m0_wb_stb_i && m0_wb_cyc_i && s_bus_rd_wb_ack == 0)
            begin

              m0_wb_dat_i_reg <= m0_wb_dat_i;
              m0_wb_adr_reg   <= {2'b00,m0_wb_adr_i[31:2]};
              m0_wb_sel_reg   <= m0_wb_sel_i;
              m0_wb_we_reg    <= m0_wb_we_i;
              m0_wb_cyc_reg   <= m0_wb_cyc_i;
              m0_wb_stb_reg   <= m0_wb_stb_i;
              m0_wb_tid_reg   <= m0_wb_tid_i;

            end
        end
    end

endmodule
module wb_interconnect (
`ifdef USE_POWER_PINS
  input  wire        vccd1      ,
  input  wire        vssd1      ,
`endif
  input  wire        clk_i      ,
  input  wire        rst        ,

  input  wire [31:0] m0_wb_dat_i,
  input  wire [31:0] m0_wb_adr_i,
  input  wire [ 3:0] m0_wb_sel_i,
  input  wire        m0_wb_we_i ,
  input  wire        m0_wb_cyc_i,
  input  wire        m0_wb_stb_i,
  output wire [31:0] m0_wb_dat_o,
  output wire        m0_wb_ack_o,

  input  wire [31:0] s0_wb_dat_i,
  input  wire        s0_wb_ack_i,
  output wire [31:0] s0_wb_dat_o,
  output wire [ 8:0] s0_wb_adr_o,
  output wire [ 3:0] s0_wb_sel_o,
  output wire        s0_wb_we_o ,
  output wire        s0_wb_cyc_o,
  output wire        s0_wb_stb_o,

  input  wire [31:0] s1_wb_dat_i,
  input  wire        s1_wb_ack_i,
  output wire [31:0] s1_wb_dat_o,
  output wire [8:0] s1_wb_adr_o,
  output wire [ 3:0] s1_wb_sel_o,
  output wire        s1_wb_we_o ,
  output wire        s1_wb_cyc_o,
  output wire        s1_wb_stb_o,

  input	logic [31:0]   s2_wb_dat_i,
  input	logic 	       s2_wb_ack_i,
  output	wire  [31:0]   s2_wb_dat_o,
  output	wire  [8:0]    s2_wb_adr_o,
  output	wire  [3:0]    s2_wb_sel_o,
  output	wire  	       s2_wb_we_o,
  output	wire  	       s2_wb_cyc_o,
  output	wire  	       s2_wb_stb_o,

  input	logic [31:0]   s3_wb_dat_i,
  input	logic 	       s3_wb_ack_i,
  output	wire  [31:0]   s3_wb_dat_o,
  output	wire  [8:0]    s3_wb_adr_o,
  output	wire  [3:0]    s3_wb_sel_o,
  output	wire  	       s3_wb_we_o,
  output	wire  	       s3_wb_cyc_o,
  output	wire  	       s3_wb_stb_o
  
  
);




  reg [31:0] m0_wb_dat_i_reg;
  reg [31:0] m0_wb_adr_reg  ;
  reg [ 3:0] m0_wb_sel_reg  ;
  reg        m0_wb_we_reg   ;
  reg        m0_wb_cyc_reg  ;
  reg        m0_wb_stb_reg  ;
  reg [ 1:0] m0_wb_tid_reg  ;



  wire [31:0] s_bus_rd_wb_dat = (m0_wb_adr_i[13:12] == 2'b00) ? s0_wb_dat_i :
    (m0_wb_adr_i[13:12] == 2'b01) ? s1_wb_dat_i :  
    (m0_wb_adr_i[13:12] == 2'b10) ? s2_wb_dat_i :
    (m0_wb_adr_i[13:12] == 2'b11) ? s3_wb_dat_i : 32'd0;
  wire        s_bus_rd_wb_ack = (m0_wb_adr_i[13:12] == 2'b00) ? s0_wb_ack_i :
    (m0_wb_adr_i[13:12] == 2'b01) ? s1_wb_ack_i :
    (m0_wb_adr_i[13:12] == 2'b10) ? s2_wb_ack_i :
    (m0_wb_adr_i[13:12] == 2'b11) ? s3_wb_ack_i : 1'b0 ;











  wire [1:0] m0_wb_tid_i = m0_wb_adr_i[13:12];











  assign s0_wb_dat_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_dat_i_reg : 32'd00;
  assign s0_wb_adr_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_adr_reg : 9'd0;
  assign s0_wb_sel_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_sel_reg : 4'd0;
  assign s0_wb_we_o  = (m0_wb_tid_reg == 2'b00) ? m0_wb_we_reg  : 1'b0;
  assign s0_wb_cyc_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_cyc_reg : 1'b0;
  assign s0_wb_stb_o = (m0_wb_tid_reg == 2'b00) ? m0_wb_stb_reg : 1'b0;

  assign s1_wb_dat_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_dat_i_reg : 32'd0;
  assign s1_wb_adr_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_adr_reg : 9'd0;
  assign s1_wb_sel_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_sel_reg : 4'd0;
  assign s1_wb_we_o  = (m0_wb_tid_reg == 2'b01) ? m0_wb_we_reg  : 1'b0;
  assign s1_wb_cyc_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_cyc_reg : 1'b0;
  assign s1_wb_stb_o = (m0_wb_tid_reg == 2'b01) ? m0_wb_stb_reg : 1'b0;

  assign s2_wb_dat_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_dat_i_reg : 'h0;
  assign s2_wb_adr_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_adr_reg :   'h0;
  assign s2_wb_sel_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_sel_reg :   'h0;
  assign s2_wb_we_o  = (m0_wb_tid_reg == 2'b10) ? m0_wb_we_reg  :   'h0;
  assign s2_wb_cyc_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_cyc_reg :   'h0;
  assign s2_wb_stb_o = (m0_wb_tid_reg == 2'b10) ? m0_wb_stb_reg :   'h0;

  assign s3_wb_dat_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_dat_i_reg : 32'd0;
  assign s3_wb_adr_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_adr_reg : 9'd0;
  assign s3_wb_sel_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_sel_reg : 4'd0;
  assign s3_wb_we_o  = (m0_wb_tid_reg == 2'b11) ? m0_wb_we_reg  : 1'b0;
  assign s3_wb_cyc_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_cyc_reg : 1'b0;
  assign s3_wb_stb_o = (m0_wb_tid_reg == 2'b11) ? m0_wb_stb_reg : 1'b0;

  assign m0_wb_dat_o = s_bus_rd_wb_dat;
  assign m0_wb_ack_o = s_bus_rd_wb_ack;

  always @(posedge clk_i)
    begin
      if(rst == 1'b1)
        begin

          m0_wb_dat_i_reg <= 'h0;
          m0_wb_adr_reg   <= 'h0;
          m0_wb_sel_reg   <= 'h0;
          m0_wb_we_reg    <= 'h0;
          m0_wb_cyc_reg   <= 'h0;
          m0_wb_stb_reg   <= 'h0;
          m0_wb_tid_reg   <= 'h0;


        end
      else
        begin
          m0_wb_dat_i_reg <= 'h0;
          m0_wb_adr_reg   <= 'h0;
          m0_wb_sel_reg   <= 'h0;
          m0_wb_we_reg    <= 'h0;
          m0_wb_cyc_reg   <= 'h0;
          m0_wb_stb_reg   <= 'h0;
          m0_wb_tid_reg   <= 'h0;

          if(m0_wb_stb_i && m0_wb_cyc_i && s_bus_rd_wb_ack == 0)
            begin

              m0_wb_dat_i_reg <= m0_wb_dat_i;
              m0_wb_adr_reg   <= {2'b00,m0_wb_adr_i[31:2]};
              m0_wb_sel_reg   <= m0_wb_sel_i;
              m0_wb_we_reg    <= m0_wb_we_i;
              m0_wb_cyc_reg   <= m0_wb_cyc_i;
              m0_wb_stb_reg   <= m0_wb_stb_i;
              m0_wb_tid_reg   <= m0_wb_tid_i;

            end
        end
    end

endmodule