data/full_repos/permissive/153023217/mfp_ahb_gpio.v
1: b'%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:7: Cannot find include file: mfp_ahb_const.vh\n`include "mfp_ahb_const.vh" \n         ^~~~~~~~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/153023217,data/full_repos/permissive/153023217/mfp_ahb_const.vh\n             data/full_repos/permissive/153023217,data/full_repos/permissive/153023217/mfp_ahb_const.vh.v\n             data/full_repos/permissive/153023217,data/full_repos/permissive/153023217/mfp_ahb_const.vh.sv\n             mfp_ahb_const.vh\n             mfp_ahb_const.vh.v\n             mfp_ahb_const.vh.sv\n             obj_dir/mfp_ahb_const.vh\n             obj_dir/mfp_ahb_const.vh.v\n             obj_dir/mfp_ahb_const.vh.sv\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:20: Define or directive not defined: \'`MFP_N_SW\'\n    input      [`MFP_N_SW-1  :0] IO_Switch,\n                ^~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:21: Define or directive not defined: \'`MFP_N_PB\'\n    input      [`MFP_N_PB-1  :0] IO_PB,\n                ^~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:22: Define or directive not defined: \'`MFP_N_LED\'\n    output reg [`MFP_N_LED-1 :0] IO_LED\n                ^~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:49: Define or directive not defined: \'`HTRANS_IDLE\'\n  assign we = (HTRANS_d != `HTRANS_IDLE) & HSEL_d & HWRITE_d;\n                           ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:49: syntax error, unexpected \')\', expecting TYPE-IDENTIFIER\n  assign we = (HTRANS_d != `HTRANS_IDLE) & HSEL_d & HWRITE_d;\n                                       ^\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:53: Define or directive not defined: \'`MFP_N_LED\'\n         IO_LED <= `MFP_N_LED\'b0;  \n                   ^~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:56: Define or directive not defined: \'`H_LED_IONUM\'\n           `H_LED_IONUM: IO_LED <= HWDATA[`MFP_N_LED-1:0];\n           ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:56: syntax error, unexpected \':\', expecting endcase\n           `H_LED_IONUM: IO_LED <= HWDATA[`MFP_N_LED-1:0];\n                       ^\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:56: Define or directive not defined: \'`MFP_N_LED\'\n           `H_LED_IONUM: IO_LED <= HWDATA[`MFP_N_LED-1:0];\n                                          ^~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:64: Define or directive not defined: \'`H_SW_IONUM\'\n           `H_SW_IONUM: HRDATA <= { {32 - `MFP_N_SW {1\'b0}}, IO_Switch };\n           ^~~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:64: Define or directive not defined: \'`MFP_N_SW\'\n           `H_SW_IONUM: HRDATA <= { {32 - `MFP_N_SW {1\'b0}}, IO_Switch };\n                                          ^~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:65: Define or directive not defined: \'`H_PB_IONUM\'\n           `H_PB_IONUM: HRDATA <= { {32 - `MFP_N_PB {1\'b0}}, IO_PB };\n           ^~~~~~~~~~~\n%Error: data/full_repos/permissive/153023217/mfp_ahb_gpio.v:65: Define or directive not defined: \'`MFP_N_PB\'\n           `H_PB_IONUM: HRDATA <= { {32 - `MFP_N_PB {1\'b0}}, IO_PB };\n                                          ^~~~~~~~~\n%Error: Cannot continue\n'
module mfp_ahb_gpio(
    input                        HCLK,
    input                        HRESETn,
    input      [  3          :0] HADDR,
    input      [  1          :0] HTRANS,
    input      [ 31          :0] HWDATA,
    input                        HWRITE,
    input                        HSEL,
    output reg [ 31          :0] HRDATA,


    input      [`MFP_N_SW-1  :0] IO_Switch,
    input      [`MFP_N_PB-1  :0] IO_PB,
    output reg [`MFP_N_LED-1 :0] IO_LED
);

  reg  [3:0]  HADDR_d;
  reg         HWRITE_d;
  reg         HSEL_d;
  reg  [1:0]  HTRANS_d;
  wire        we;
  

  wire [15:0] swtch_db;
  wire [5:0]  ptbn_db;
  


  debounce debounce(HCLK,IO_PB,IO_Switch,ptbn_db,swtch_db);


  always @ (posedge HCLK) 
  begin
    HADDR_d  <= HADDR;
	HWRITE_d <= HWRITE;
	HSEL_d   <= HSEL;
	HTRANS_d <= HTRANS;
  end
  

  assign we = (HTRANS_d != `HTRANS_IDLE) & HSEL_d & HWRITE_d;

    always @(posedge HCLK or negedge HRESETn)
       if (~HRESETn) begin
         IO_LED <= `MFP_N_LED'b0;  
       end else if (we)
         case (HADDR_d)
           `H_LED_IONUM: IO_LED <= HWDATA[`MFP_N_LED-1:0];
         endcase
    
	always @(posedge HCLK or negedge HRESETn)
       if (~HRESETn)
         HRDATA <= 32'h0;
       else
	     case (HADDR)
           `H_SW_IONUM: HRDATA <= { {32 - `MFP_N_SW {1'b0}}, IO_Switch };
           `H_PB_IONUM: HRDATA <= { {32 - `MFP_N_PB {1'b0}}, IO_PB };
            default:    HRDATA <= 32'h00000000;
         endcase
		 
endmodule
module mfp_ahb_gpio(
    input                        HCLK,
    input                        HRESETn,
    input      [  3          :0] HADDR,
    input      [  1          :0] HTRANS,
    input      [ 31          :0] HWDATA,
    input                        HWRITE,
    input                        HSEL,
    output reg [ 31          :0] HRDATA,


    input      [`MFP_N_SW-1  :0] IO_Switch,
    input      [`MFP_N_PB-1  :0] IO_PB,
    output reg [`MFP_N_LED-1 :0] IO_LED
);


  reg  [3:0]  HADDR_d;
  reg         HWRITE_d;
  reg         HSEL_d;
  reg  [1:0]  HTRANS_d;
  wire        we;
  

  wire [15:0] swtch_db;
  wire [5:0]  ptbn_db;
  


  debounce debounce(HCLK,IO_PB,IO_Switch,ptbn_db,swtch_db);


  always @ (posedge HCLK) 
  begin
    HADDR_d  <= HADDR;
	HWRITE_d <= HWRITE;
	HSEL_d   <= HSEL;
	HTRANS_d <= HTRANS;
  end
  

  assign we = (HTRANS_d != `HTRANS_IDLE) & HSEL_d & HWRITE_d;

    always @(posedge HCLK or negedge HRESETn)
       if (~HRESETn) begin
         IO_LED <= `MFP_N_LED'b0;  
       end else if (we)
         case (HADDR_d)
           `H_LED_IONUM: IO_LED <= HWDATA[`MFP_N_LED-1:0];
         endcase
    
	always @(posedge HCLK or negedge HRESETn)
       if (~HRESETn)
         HRDATA <= 32'h0;
       else
	     case (HADDR)
           `H_SW_IONUM: HRDATA <= { {32 - `MFP_N_SW {1'b0}}, IO_Switch };
           `H_PB_IONUM: HRDATA <= { {32 - `MFP_N_PB {1'b0}}, IO_PB };
            default:    HRDATA <= 32'h00000000;
         endcase
		 
endmodule