data/full_repos/permissive/115771353/rtl/hworb/udp_server.v
[Errno 2] No such file or directory: 'preprocess.output'
1: b'%Warning-WIDTH: data/full_repos/permissive/115771353/rtl/hworb/udp_server.v:237: Operator LT expects 32 or 16 bits on the LHS, but LHS\'s VARREF \'cntXmit\' generates 11 bits.\n                                                                               : ... In instance udp_server\n          if (cntXmit < (UDPLEN-2)) begin\n                      ^\n                ... Use "/* verilator lint_off WIDTH */" and lint_on around source to disable this message.\n%Warning-WIDTH: data/full_repos/permissive/115771353/rtl/hworb/udp_server.v:243: Operator LT expects 32 or 16 bits on the LHS, but LHS\'s VARREF \'cntXmit\' generates 11 bits.\n                                                                               : ... In instance udp_server\n          if (cntXmit < (UDPLEN-1)) begin\n                      ^\n%Error: Exiting due to 2 warning(s)\n'
module udp_server #(
  parameter [15:0] DEVICE_UDP_PORT  = 16'hbed0,      
  parameter [31:0] DEST_IP          = 32'h0a0105ce,  
  parameter [15:0] DEST_UDP_PORT    = 16'h1b3b,
  parameter [31:0] DEVICE_IP        = 32'h0a0105dd
) 
(
  input              clk,
  input              reset_n,
  
  input              wr_complete,
  input              tx_done_MAC,
  
  input              instream_fifoempty,
  output wire        instream_rden,
  input [7:0]        instream_rddata,
  input [11:0]       instream_rcnt,

  output reg         wrRAM,
  output reg  [7:0]  wrData,
  output reg  [10:0] wrAddr,
  output wire [15:0] sendDatagramSize,
  output reg         sendDatagram,
  output wire [31:0] destinationIP,
  output wire [7:0]  protocolOut
);

  parameter [15:0] UDPLEN = 16'd1292;
  parameter [7:0]  UDPHEADERLEN = 8'd8;
  

  parameter  stMSB = 1'b0;
  parameter  stLSB = 1'b1;


  parameter [1:0]
  UDP_SERV_TX_IDLEXMIT        = 2'd0,  
  UDP_SERV_TX_SETWRHEADERXMIT = 2'd1,  
  UDP_SERV_TX_GETWRDATAXMIT   = 2'd2,  
  UDP_SERV_TX_WRITEFINISHXMIT = 2'd3;
  
  reg [1:0] udp_srv_tx_fsm;

  reg [10:0] cntXmit;

  reg        stream_read_d1;
  reg        stream_read_i;
  

  assign protocolOut =  8'h11;
  assign destinationIP = DEST_IP;
  assign sendDatagramSize = UDPLEN;   
  
  assign instream_rden = stream_read_i & ~instream_fifoempty;













































  
  


  always @(posedge clk or negedge reset_n) 
  begin
    if (!reset_n) begin

      udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
      
      stream_read_d1 <= 1'b0;
      
      stream_read_i <= 1'b0;
      wrRAM <= 1'b0;
      wrData <= 8'b0;
      wrAddr <= 11'b0;
      sendDatagram <= 1'b0;
      
      cntXmit <= 11'b0;
    end  

    else begin
      stream_read_i <= 1'b0;
      stream_read_d1 <= instream_rden;
      
      wrRAM <= 1'b0;
      wrData <= 8'b0;
      sendDatagram <= 1'b0;
      wrAddr <= cntXmit[10:0] + {3'b000,8'h22};
    
      case(udp_srv_tx_fsm)
        UDP_SERV_TX_IDLEXMIT:
        begin
          cntXmit <= 11'b0;
      
          if (instream_fifoempty) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
          end  
          else begin
            udp_srv_tx_fsm <= UDP_SERV_TX_SETWRHEADERXMIT;
          end
        end
        
        UDP_SERV_TX_SETWRHEADERXMIT:
        begin

          if (cntXmit < 11'd8) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_SETWRHEADERXMIT;
            wrRAM <= 1'b1;
            cntXmit <= cntXmit + 1;
          end  
          else begin
            udp_srv_tx_fsm <= UDP_SERV_TX_GETWRDATAXMIT;
          end  
          


          case(cntXmit)

            11'd0:
            begin
              wrData <= DEVICE_UDP_PORT[15:8];
            end  
              

            11'd1:
            begin
              wrData <= DEVICE_UDP_PORT[7:0];
            end  
                    

            11'd2:
            begin
              wrData <= DEST_UDP_PORT[15:8];
            end  
                    

            11'd3:
            begin
              wrData <= DEST_UDP_PORT[7:0];
            end  
                    

            11'd4:
            begin
              wrData <= UDPLEN[15:8];
            end  
                    

            11'd5:
            begin
              wrData <= UDPLEN[7:0];
            end  
                    

            11'd6, 11'd7:
            begin
              wrData <= 8'h00;
            end  
          
            default:
            begin
              wrData <= 8'b0;
            end
                  
          endcase
        
        end
    
        UDP_SERV_TX_GETWRDATAXMIT:
        begin
          wrData <= instream_rddata[7:0];
          wrAddr <= cntXmit[10:0] + {3'b000,8'h22};
          if (stream_read_d1) begin
            wrRAM <= 1'b1;
            cntXmit <= cntXmit + 1;      
          end  
      
          if (cntXmit < (UDPLEN-2)) begin
            if (!instream_fifoempty) begin
              stream_read_i <= 1'b1;
            end
          end  
          
          if (cntXmit < (UDPLEN-1)) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_GETWRDATAXMIT; 
          end  
          else begin

            udp_srv_tx_fsm <= UDP_SERV_TX_WRITEFINISHXMIT;
            sendDatagram <= 1'b1;
          end
        end
      
        UDP_SERV_TX_WRITEFINISHXMIT:
        begin
          if (tx_done_MAC) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
          end  
          else begin
            udp_srv_tx_fsm <= UDP_SERV_TX_WRITEFINISHXMIT;
          end  
        end
        
        default:
        begin
          udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
        end
      endcase
    end
  end
  
endmodule
module udp_server #(
  parameter [15:0] DEVICE_UDP_PORT  = 16'hbed0,      
  parameter [31:0] DEST_IP          = 32'h0a0105ce,  
  parameter [15:0] DEST_UDP_PORT    = 16'h1b3b,
  parameter [31:0] DEVICE_IP        = 32'h0a0105dd
) 
(
  input              clk,
  input              reset_n,
  
  input              wr_complete,
  input              tx_done_MAC,
  
  input              instream_fifoempty,
  output wire        instream_rden,
  input [7:0]        instream_rddata,
  input [11:0]       instream_rcnt,

  output reg         wrRAM,
  output reg  [7:0]  wrData,
  output reg  [10:0] wrAddr,
  output wire [15:0] sendDatagramSize,
  output reg         sendDatagram,
  output wire [31:0] destinationIP,
  output wire [7:0]  protocolOut
);


  parameter [15:0] UDPLEN = 16'd1292;
  parameter [7:0]  UDPHEADERLEN = 8'd8;
  

  parameter  stMSB = 1'b0;
  parameter  stLSB = 1'b1;


  parameter [1:0]
  UDP_SERV_TX_IDLEXMIT        = 2'd0,  
  UDP_SERV_TX_SETWRHEADERXMIT = 2'd1,  
  UDP_SERV_TX_GETWRDATAXMIT   = 2'd2,  
  UDP_SERV_TX_WRITEFINISHXMIT = 2'd3;
  
  reg [1:0] udp_srv_tx_fsm;

  reg [10:0] cntXmit;

  reg        stream_read_d1;
  reg        stream_read_i;
  

  assign protocolOut =  8'h11;
  assign destinationIP = DEST_IP;
  assign sendDatagramSize = UDPLEN;   
  
  assign instream_rden = stream_read_i & ~instream_fifoempty;













































  
  


  always @(posedge clk or negedge reset_n) 
  begin
    if (!reset_n) begin

      udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
      
      stream_read_d1 <= 1'b0;
      
      stream_read_i <= 1'b0;
      wrRAM <= 1'b0;
      wrData <= 8'b0;
      wrAddr <= 11'b0;
      sendDatagram <= 1'b0;
      
      cntXmit <= 11'b0;
    end  

    else begin
      stream_read_i <= 1'b0;
      stream_read_d1 <= instream_rden;
      
      wrRAM <= 1'b0;
      wrData <= 8'b0;
      sendDatagram <= 1'b0;
      wrAddr <= cntXmit[10:0] + {3'b000,8'h22};
    
      case(udp_srv_tx_fsm)
        UDP_SERV_TX_IDLEXMIT:
        begin
          cntXmit <= 11'b0;
      
          if (instream_fifoempty) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
          end  
          else begin
            udp_srv_tx_fsm <= UDP_SERV_TX_SETWRHEADERXMIT;
          end
        end
        
        UDP_SERV_TX_SETWRHEADERXMIT:
        begin

          if (cntXmit < 11'd8) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_SETWRHEADERXMIT;
            wrRAM <= 1'b1;
            cntXmit <= cntXmit + 1;
          end  
          else begin
            udp_srv_tx_fsm <= UDP_SERV_TX_GETWRDATAXMIT;
          end  
          


          case(cntXmit)

            11'd0:
            begin
              wrData <= DEVICE_UDP_PORT[15:8];
            end  
              

            11'd1:
            begin
              wrData <= DEVICE_UDP_PORT[7:0];
            end  
                    

            11'd2:
            begin
              wrData <= DEST_UDP_PORT[15:8];
            end  
                    

            11'd3:
            begin
              wrData <= DEST_UDP_PORT[7:0];
            end  
                    

            11'd4:
            begin
              wrData <= UDPLEN[15:8];
            end  
                    

            11'd5:
            begin
              wrData <= UDPLEN[7:0];
            end  
                    

            11'd6, 11'd7:
            begin
              wrData <= 8'h00;
            end  
          
            default:
            begin
              wrData <= 8'b0;
            end
                  
          endcase
        
        end
    
        UDP_SERV_TX_GETWRDATAXMIT:
        begin
          wrData <= instream_rddata[7:0];
          wrAddr <= cntXmit[10:0] + {3'b000,8'h22};
          if (stream_read_d1) begin
            wrRAM <= 1'b1;
            cntXmit <= cntXmit + 1;      
          end  
      
          if (cntXmit < (UDPLEN-2)) begin
            if (!instream_fifoempty) begin
              stream_read_i <= 1'b1;
            end
          end  
          
          if (cntXmit < (UDPLEN-1)) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_GETWRDATAXMIT; 
          end  
          else begin

            udp_srv_tx_fsm <= UDP_SERV_TX_WRITEFINISHXMIT;
            sendDatagram <= 1'b1;
          end
        end
      
        UDP_SERV_TX_WRITEFINISHXMIT:
        begin
          if (tx_done_MAC) begin
            udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
          end  
          else begin
            udp_srv_tx_fsm <= UDP_SERV_TX_WRITEFINISHXMIT;
          end  
        end
        
        default:
        begin
          udp_srv_tx_fsm <= UDP_SERV_TX_IDLEXMIT;
        end
      endcase
    end
  end
  
endmodule