data/full_repos/permissive/517777997/verilog/rtl/gpio_control_block.v
1: b"%Error: data/full_repos/permissive/517777997/verilog/rtl/gpio_control_block.v:139: Can't resolve module reference: 'gf180mcu_fd_sc_mcu7t5v0__dlya_2'\n    gf180mcu_fd_sc_mcu7t5v0__dlya_2 data_delay_1 (\n                                    ^~~~~~~~~~~~\n%Error: Exiting due to 1 error(s)\n"
module gpio_control_block #(
    parameter PAD_CTRL_BITS = 10
) (
    `ifdef USE_POWER_PINS
         inout VDD,
         inout VSS,
    `endif


    input [PAD_CTRL_BITS-1:0] gpio_defaults,


    input  	 resetn,
    output       resetn_out,
    input  	 serial_clock,
    output  	 serial_clock_out,
    input	 serial_load,
    output	 serial_load_out,

    output       mgmt_gpio_in,
    input        mgmt_gpio_out,
    input        mgmt_gpio_oeb,


    input  	 serial_data_in,
    output 	 serial_data_out,


    output	 user_gpio_in,
    input        user_gpio_out,
    input        user_gpio_oeb,


    output       pad_gpio_inen,
    output       pad_gpio_outen,
    output	 pad_gpio_out,
    input	 pad_gpio_in,
    output	 pad_gpio_slew_sel,
    output	 pad_gpio_schmitt_sel,
    output [1:0] pad_gpio_drive_sel,
    output	 pad_gpio_pullup_sel,
    output	 pad_gpio_pulldown_sel,



    output	 one,
    output	 zero
);



    localparam MGMT_EN = 0;
    localparam OE_OVR = 1;
    localparam IE = 2;
    localparam OE = 3;
    localparam SCHMITT = 4;
    localparam SLEW = 5;
    localparam PD = 6;
    localparam PU = 7;
    localparam DRIVE = 8;


    reg	 	mgmt_ena;
    reg		gpio_oe_override;
    reg		gpio_inen;
    reg		gpio_outen;
    reg		gpio_out;
    reg		gpio_slew_sel;
    reg		gpio_schmitt_sel;
    reg [1:0]	gpio_drive_sel;
    reg		gpio_pullup_sel;
    reg		gpio_pulldown_sel;


    wire	pad_gpio_slew_sel;
    wire      	pad_gpio_inen;
    wire        pad_gpio_outen;
    wire	pad_gpio_out;
    wire	pad_gpio_in;
    wire [1:0]  pad_gpio_drive_sel;
    wire	pad_gpio_schmitt_sel;
    wire	pad_gpio_pullup_sel;
    wire	pad_gpio_pulldown_sel;
    wire	one;
    wire	zero;

    wire user_gpio_in;
    wire serial_data_pre;
    wire serial_data_post_1;
    wire serial_data_post_2;


    reg [PAD_CTRL_BITS-1:0] shift_register;


    assign serial_data_pre = shift_register[PAD_CTRL_BITS-1]; 



    assign serial_clock_out = serial_clock;
    assign resetn_out = resetn;
    assign serial_load_out = serial_load;






    gf180mcu_fd_sc_mcu7t5v0__dlya_2 data_delay_1 (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .I(serial_data_pre),
            .Z(serial_data_post_1)
    );

    gf180mcu_fd_sc_mcu7t5v0__dlya_2 data_delay_2 (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .I(serial_data_post_1),
            .Z(serial_data_post_2)
    );

    assign serial_data_out = serial_data_post_2 & one;

    always @(posedge serial_clock or negedge resetn) begin
	if (resetn == 1'b0) begin

	    shift_register <= 'd0;
	end else begin

	    shift_register <= {shift_register[PAD_CTRL_BITS-2:0], serial_data_in};
	end
    end

    always @(posedge serial_load or negedge resetn) begin
	if (resetn == 1'b0) begin

            mgmt_ena 	      <= gpio_defaults[MGMT_EN];
	    gpio_oe_override  <= gpio_defaults[OE_OVR];
	    gpio_inen 	      <= gpio_defaults[IE];
	    gpio_outen        <= gpio_defaults[OE];
	    gpio_slew_sel     <= gpio_defaults[SLEW];
	    gpio_schmitt_sel  <= gpio_defaults[SCHMITT];
	    gpio_pullup_sel   <= gpio_defaults[PU];
	    gpio_pulldown_sel <= gpio_defaults[PD];
	    gpio_drive_sel    <= gpio_defaults[DRIVE+1:DRIVE];
	end else begin

	    mgmt_ena 	      <= shift_register[MGMT_EN];
	    gpio_oe_override  <= shift_register[OE_OVR];
	    gpio_inen 	      <= shift_register[IE];
	    gpio_outen        <= shift_register[OE];
	    gpio_slew_sel     <= shift_register[SLEW];
	    gpio_schmitt_sel  <= shift_register[SCHMITT];
	    gpio_pullup_sel   <= shift_register[PU];
	    gpio_pulldown_sel <= shift_register[PD];
	    gpio_drive_sel    <= shift_register[DRIVE+1:DRIVE];
	end
    end




    assign pad_gpio_inen            =   gpio_inen;
    assign pad_gpio_slew_sel        =   gpio_slew_sel;
    assign pad_gpio_schmitt_sel     =   gpio_schmitt_sel;
    assign pad_gpio_drive_sel       =   gpio_drive_sel;
    assign pad_gpio_pullup_sel      =   gpio_pullup_sel;
    assign pad_gpio_pulldown_sel    =   gpio_pulldown_sel;



    assign user_gpio_in = pad_gpio_in;
    assign mgmt_gpio_in = pad_gpio_in;


    assign pad_gpio_outen = (gpio_oe_override) ? gpio_outen :
			((mgmt_ena) ? ~mgmt_gpio_oeb  : ~user_gpio_oeb);

    assign pad_gpio_out = (mgmt_ena) ? mgmt_gpio_out : user_gpio_out;

    gf180mcu_fd_sc_mcu7t5v0__tieh const_source_one (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .Z(one)
    );

    gf180mcu_fd_sc_mcu7t5v0__tiel const_source_zero (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .ZN(zero)
    );

endmodule
module gpio_control_block #(
    parameter PAD_CTRL_BITS = 10
) (
    `ifdef USE_POWER_PINS
         inout VDD,
         inout VSS,
    `endif


    input [PAD_CTRL_BITS-1:0] gpio_defaults,


    input  	 resetn,
    output       resetn_out,
    input  	 serial_clock,
    output  	 serial_clock_out,
    input	 serial_load,
    output	 serial_load_out,

    output       mgmt_gpio_in,
    input        mgmt_gpio_out,
    input        mgmt_gpio_oeb,


    input  	 serial_data_in,
    output 	 serial_data_out,


    output	 user_gpio_in,
    input        user_gpio_out,
    input        user_gpio_oeb,


    output       pad_gpio_inen,
    output       pad_gpio_outen,
    output	 pad_gpio_out,
    input	 pad_gpio_in,
    output	 pad_gpio_slew_sel,
    output	 pad_gpio_schmitt_sel,
    output [1:0] pad_gpio_drive_sel,
    output	 pad_gpio_pullup_sel,
    output	 pad_gpio_pulldown_sel,



    output	 one,
    output	 zero
);




    localparam MGMT_EN = 0;
    localparam OE_OVR = 1;
    localparam IE = 2;
    localparam OE = 3;
    localparam SCHMITT = 4;
    localparam SLEW = 5;
    localparam PD = 6;
    localparam PU = 7;
    localparam DRIVE = 8;


    reg	 	mgmt_ena;
    reg		gpio_oe_override;
    reg		gpio_inen;
    reg		gpio_outen;
    reg		gpio_out;
    reg		gpio_slew_sel;
    reg		gpio_schmitt_sel;
    reg [1:0]	gpio_drive_sel;
    reg		gpio_pullup_sel;
    reg		gpio_pulldown_sel;


    wire	pad_gpio_slew_sel;
    wire      	pad_gpio_inen;
    wire        pad_gpio_outen;
    wire	pad_gpio_out;
    wire	pad_gpio_in;
    wire [1:0]  pad_gpio_drive_sel;
    wire	pad_gpio_schmitt_sel;
    wire	pad_gpio_pullup_sel;
    wire	pad_gpio_pulldown_sel;
    wire	one;
    wire	zero;

    wire user_gpio_in;
    wire serial_data_pre;
    wire serial_data_post_1;
    wire serial_data_post_2;


    reg [PAD_CTRL_BITS-1:0] shift_register;


    assign serial_data_pre = shift_register[PAD_CTRL_BITS-1]; 



    assign serial_clock_out = serial_clock;
    assign resetn_out = resetn;
    assign serial_load_out = serial_load;






    gf180mcu_fd_sc_mcu7t5v0__dlya_2 data_delay_1 (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .I(serial_data_pre),
            .Z(serial_data_post_1)
    );

    gf180mcu_fd_sc_mcu7t5v0__dlya_2 data_delay_2 (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .I(serial_data_post_1),
            .Z(serial_data_post_2)
    );

    assign serial_data_out = serial_data_post_2 & one;

    always @(posedge serial_clock or negedge resetn) begin
	if (resetn == 1'b0) begin

	    shift_register <= 'd0;
	end else begin

	    shift_register <= {shift_register[PAD_CTRL_BITS-2:0], serial_data_in};
	end
    end

    always @(posedge serial_load or negedge resetn) begin
	if (resetn == 1'b0) begin

            mgmt_ena 	      <= gpio_defaults[MGMT_EN];
	    gpio_oe_override  <= gpio_defaults[OE_OVR];
	    gpio_inen 	      <= gpio_defaults[IE];
	    gpio_outen        <= gpio_defaults[OE];
	    gpio_slew_sel     <= gpio_defaults[SLEW];
	    gpio_schmitt_sel  <= gpio_defaults[SCHMITT];
	    gpio_pullup_sel   <= gpio_defaults[PU];
	    gpio_pulldown_sel <= gpio_defaults[PD];
	    gpio_drive_sel    <= gpio_defaults[DRIVE+1:DRIVE];
	end else begin

	    mgmt_ena 	      <= shift_register[MGMT_EN];
	    gpio_oe_override  <= shift_register[OE_OVR];
	    gpio_inen 	      <= shift_register[IE];
	    gpio_outen        <= shift_register[OE];
	    gpio_slew_sel     <= shift_register[SLEW];
	    gpio_schmitt_sel  <= shift_register[SCHMITT];
	    gpio_pullup_sel   <= shift_register[PU];
	    gpio_pulldown_sel <= shift_register[PD];
	    gpio_drive_sel    <= shift_register[DRIVE+1:DRIVE];
	end
    end




    assign pad_gpio_inen            =   gpio_inen;
    assign pad_gpio_slew_sel        =   gpio_slew_sel;
    assign pad_gpio_schmitt_sel     =   gpio_schmitt_sel;
    assign pad_gpio_drive_sel       =   gpio_drive_sel;
    assign pad_gpio_pullup_sel      =   gpio_pullup_sel;
    assign pad_gpio_pulldown_sel    =   gpio_pulldown_sel;



    assign user_gpio_in = pad_gpio_in;
    assign mgmt_gpio_in = pad_gpio_in;


    assign pad_gpio_outen = (gpio_oe_override) ? gpio_outen :
			((mgmt_ena) ? ~mgmt_gpio_oeb  : ~user_gpio_oeb);

    assign pad_gpio_out = (mgmt_ena) ? mgmt_gpio_out : user_gpio_out;

    gf180mcu_fd_sc_mcu7t5v0__tieh const_source_one (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .Z(one)
    );

    gf180mcu_fd_sc_mcu7t5v0__tiel const_source_zero (
`ifdef USE_POWER_PINS
            .VDD(VDD),
            .VSS(VSS),
`endif
            .ZN(zero)
    );

endmodule