module EMBEDDED_IO_HD (
  input SOC_IN,   // Input to drive the inpad signal
  output SOC_OUT, // Output the outpad signal
  output FPGA_IN, // Input data to FPGA
  input FPGA_OUT, // Output data from FPGA
  input FPGA_IO_DIR, 
  input CFG_DONE 
);

  wire cfg_done_b;
  sky130_fd_sc_hd__inv_1 INV		(
	  				.A(CFG_DONE),
					.Y(cfg_done_b)
					);
  sky130_fd_sc_hd__or3_1 OR3 		(
	  				.A(FPGA_IO_DIR),
                                        .B(FPGA_OUT),
                                        .C(cfg_done_b),
                                        .X(SOC_OUT)
                                        );
  sky130_fd_sc_hd__and2_1 AND2 		(
	  				.A(FPGA_IO_DIR),
                                        .B(SOC_IN),
                                        .X(FPGA_IN)
                                        );


endmodule