data/full_repos/permissive/121277233/ons20-app52-ref_ofshw/vivado/onets_7020_4x_ref_ofshw/ip/packet_pipeline_v1_0/src/user_data_path/configuration.v
 line:101: before: "i"
1: b"%Error: data/full_repos/permissive/121277233/ons20-app52-ref_ofshw/vivado/onets_7020_4x_ref_ofshw/ip/packet_pipeline_v1_0/src/user_data_path/configuration.v:68: Define or directive not defined: '`CONFIG_SW_STARTED'\n          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i==0)\n                                                             ^~~~~~~~~~~~~~~~~~\n%Error: data/full_repos/permissive/121277233/ons20-app52-ref_ofshw/vivado/onets_7020_4x_ref_ofshw/ip/packet_pipeline_v1_0/src/user_data_path/configuration.v:68: syntax error, unexpected '}', expecting TYPE-IDENTIFIER\n          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i==0)\n                                                                               ^\n%Error: Exiting due to 2 error(s)\n"
module configuration(
   input [31:0]   data_config_i,
   input [31:0]   addr_config_i,
   input req_config_i,
   input rw_config_i,
   output reg ack_config_o,
   output reg [31:0]data_config_o,
   
   input clk,
   input reset,
   
   output reg config_sw_ok
   
    );
    
    reg [2:0]cur_st,nxt_st;
    localparam IDLE=0,
               ACK=1;
    
    
       always@(posedge clk)
          if(reset)
            cur_st<=0;
          else cur_st<=nxt_st;
       
       always@(*)
       begin
         nxt_st=cur_st;
         case(cur_st)
            IDLE:if(req_config_i) nxt_st=ACK;
            ACK:nxt_st=IDLE;
            default:nxt_st=IDLE;
         endcase
       end
       
       always@(*)
          if(reset)
            ack_config_o=0;
          else if(cur_st==ACK)
            ack_config_o=1;
          else ack_config_o=0;
       
       always@(posedge clk)
          if(reset)
            config_sw_ok<=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i==0)
            config_sw_ok<=data_config_i[0]; 
         
   `ifdef ONETS20
    begin
       always@(*)
          if(reset)
            data_config_o=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i)
            data_config_o=config_sw_ok;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_CARD} && rw_config_i)
            data_config_o=20;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_VERSION} && rw_config_i)
            data_config_o=`VERSION;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_TABLE_NUM} && rw_config_i)
            data_config_o=`TABLE_NUM;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_DEPTH} && rw_config_i)
            data_config_o=`T0_OPENFLOW_WILDCARD_TABLE_SIZE;
          else data_config_o=32'hdeadbeef;
    end
    `elsif ONETS30
    begin
       always@(*)
          if(reset)
            data_config_o=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i)
            data_config_o=config_sw_ok;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_CARD} && rw_config_i)
            data_config_o=30;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_VERSION} && rw_config_i)
            data_config_o=`VERSION;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_TABLE_NUM} && rw_config_i)
            data_config_o=`TABLE_NUM;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_DEPTH} && rw_config_i)
            data_config_o=`T0_OPENFLOW_WILDCARD_TABLE_SIZE;
          else data_config_o=32'hdeadbeef;
    end     
    `elsif ONETS45
    begin
       always@(*)
          if(reset)
            data_config_o=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i)
            data_config_o=config_sw_ok;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_CARD} && rw_config_i)
            data_config_o=45;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_VERSION} && rw_config_i)
            data_config_o=`VERSION;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_TABLE_NUM} && rw_config_i)
            data_config_o=`TABLE_NUM;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_DEPTH} && rw_config_i)
            data_config_o=`T0_OPENFLOW_WILDCARD_TABLE_SIZE;
          else data_config_o=32'hdeadbeef;
    end     
    `endif
    
    
endmodule
module configuration(
   input [31:0]   data_config_i,
   input [31:0]   addr_config_i,
   input req_config_i,
   input rw_config_i,
   output reg ack_config_o,
   output reg [31:0]data_config_o,
   
   input clk,
   input reset,
   
   output reg config_sw_ok
   
    );

    
    reg [2:0]cur_st,nxt_st;
    localparam IDLE=0,
               ACK=1;
    
    
       always@(posedge clk)
          if(reset)
            cur_st<=0;
          else cur_st<=nxt_st;
       
       always@(*)
       begin
         nxt_st=cur_st;
         case(cur_st)
            IDLE:if(req_config_i) nxt_st=ACK;
            ACK:nxt_st=IDLE;
            default:nxt_st=IDLE;
         endcase
       end
       
       always@(*)
          if(reset)
            ack_config_o=0;
          else if(cur_st==ACK)
            ack_config_o=1;
          else ack_config_o=0;
       
       always@(posedge clk)
          if(reset)
            config_sw_ok<=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i==0)
            config_sw_ok<=data_config_i[0]; 
         
   `ifdef ONETS20
    begin
       always@(*)
          if(reset)
            data_config_o=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i)
            data_config_o=config_sw_ok;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_CARD} && rw_config_i)
            data_config_o=20;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_VERSION} && rw_config_i)
            data_config_o=`VERSION;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_TABLE_NUM} && rw_config_i)
            data_config_o=`TABLE_NUM;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_DEPTH} && rw_config_i)
            data_config_o=`T0_OPENFLOW_WILDCARD_TABLE_SIZE;
          else data_config_o=32'hdeadbeef;
    end
    `elsif ONETS30
    begin
       always@(*)
          if(reset)
            data_config_o=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i)
            data_config_o=config_sw_ok;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_CARD} && rw_config_i)
            data_config_o=30;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_VERSION} && rw_config_i)
            data_config_o=`VERSION;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_TABLE_NUM} && rw_config_i)
            data_config_o=`TABLE_NUM;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_DEPTH} && rw_config_i)
            data_config_o=`T0_OPENFLOW_WILDCARD_TABLE_SIZE;
          else data_config_o=32'hdeadbeef;
    end     
    `elsif ONETS45
    begin
       always@(*)
          if(reset)
            data_config_o=0;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_SW_STARTED} && rw_config_i)
            data_config_o=config_sw_ok;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_CARD} && rw_config_i)
            data_config_o=45;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_VERSION} && rw_config_i)
            data_config_o=`VERSION;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_TABLE_NUM} && rw_config_i)
            data_config_o=`TABLE_NUM;
          else if(cur_st==ACK && addr_config_i[23:0]=={16'h0,`CONFIG_DEPTH} && rw_config_i)
            data_config_o=`T0_OPENFLOW_WILDCARD_TABLE_SIZE;
          else data_config_o=32'hdeadbeef;
    end     
    `endif
    
    
endmodule