module top_sapphire (

  	output	 wire    	my_pll_rstn,
  	input	wire	    my_pll_locked,
	//SOC
  	input    wire       io_systemClk,
  	input    wire       io_asyncReset,
  	output   wire       system_uart_0_io_txd,
  	input    wire       system_uart_0_io_rxd,
  	output   wire       system_i2c_0_io_sda_writeEnable,
  	output   wire       system_i2c_0_io_sda_write,
  	input    wire       system_i2c_0_io_sda_read,
  	output   wire       system_i2c_0_io_scl_writeEnable,
  	output   wire       system_i2c_0_io_scl_write,
  	input    wire       system_i2c_0_io_scl_read,
  	input    wire [15:0]system_gpio_0_io_read,
  	output   wire [15:0]system_gpio_0_io_write,
  	output   wire [15:0]system_gpio_0_io_writeEnable,
  	output   wire     	system_spi_0_io_sclk_write,
  	output   wire       system_spi_0_io_data_0_writeEnable,
  	input    wire     	system_spi_0_io_data_0_read,
  	output   wire     	system_spi_0_io_data_0_write,
  	output   wire       system_spi_0_io_data_1_writeEnable,
  	input    wire     	system_spi_0_io_data_1_read,
  	output   wire     	system_spi_0_io_data_1_write,
  	output   wire     	system_spi_0_io_ss,
			 
	output   wire     	system_spi_1_io_sclk_write,
  	output   wire       system_spi_1_io_data_0_writeEnable,
  	input    wire     	system_spi_1_io_data_0_read,
  	output   wire     	system_spi_1_io_data_0_write,
  	output   wire       system_spi_1_io_data_1_writeEnable,
  	input    wire     	system_spi_1_io_data_1_read,
  	output   wire     	system_spi_1_io_data_1_write,
  	output   wire     	system_spi_1_io_ss,
	//JTAG		 
	input    wire       jtag_inst1_TCK,
  	input    wire       jtag_inst1_TDI,
  	output   wire       jtag_inst1_TDO,
  	input    wire       jtag_inst1_SEL,
  	input    wire       jtag_inst1_CAPTURE,
  	input    wire       jtag_inst1_SHIFT,
  	input    wire       jtag_inst1_UPDATE,
  	input    wire       jtag_inst1_RESET

);
/////////////////////////////////////////////////////////////////////////////
//Reset and PLL
wire 		mcuReset;
wire		io_systemReset;
wire        userInterrupt;


/////////////////////////////////////////////////////////////////////////////
//Reset and PLL
assign mcuReset 	= ~( io_asyncReset & my_pll_locked );
assign my_pll_rstn 	= 1'b1;
//I2C
assign system_i2c_0_io_sda_writeEnable = !system_i2c_0_io_sda_write;
assign system_i2c_0_io_scl_writeEnable = !system_i2c_0_io_scl_write;

sapphire0 sapphire0_inst
(
  .io_systemClk				            (io_systemClk),
  .io_asyncReset			            (mcuReset),
  .io_systemReset			            (io_systemReset),
  .system_uart_0_io_txd			        (system_uart_0_io_txd),
  .system_uart_0_io_rxd			        (system_uart_0_io_rxd),
  .system_i2c_0_io_sda_write		    (system_i2c_0_io_sda_write),
  .system_i2c_0_io_sda_read		        (system_i2c_0_io_sda_read),
  .system_i2c_0_io_scl_write		    (system_i2c_0_io_scl_write),
  .system_i2c_0_io_scl_read		        (system_i2c_0_io_scl_read),
  .system_gpio_0_io_read		        (system_gpio_0_io_read[15:0]),
  .system_gpio_0_io_write		        (system_gpio_0_io_write[15:0]),
  .system_gpio_0_io_writeEnable		    (system_gpio_0_io_writeEnable[15:0]),
  .userInterruptA			            (userInterrupt),				
  .system_spi_0_io_sclk_write		    (system_spi_0_io_sclk_write),
  .system_spi_0_io_data_0_writeEnable	(system_spi_0_io_data_0_writeEnable),
  .system_spi_0_io_data_0_read		    (system_spi_0_io_data_0_read),
  .system_spi_0_io_data_0_write		    (system_spi_0_io_data_0_write),
  .system_spi_0_io_data_1_writeEnable	(system_spi_0_io_data_1_writeEnable),
  .system_spi_0_io_data_1_read		    (system_spi_0_io_data_1_read),
  .system_spi_0_io_data_1_write		    (system_spi_0_io_data_1_write),
  .system_spi_0_io_ss			        (system_spi_0_io_ss),
		  
  .system_spi_1_io_sclk_write		    (system_spi_1_io_sclk_write),
  .system_spi_1_io_data_0_writeEnable	(system_spi_1_io_data_0_writeEnable),
  .system_spi_1_io_data_0_read		    (system_spi_1_io_data_0_read),
  .system_spi_1_io_data_0_write		    (system_spi_1_io_data_0_write),
  .system_spi_1_io_data_1_writeEnable	(system_spi_1_io_data_1_writeEnable),
  .system_spi_1_io_data_1_read		    (system_spi_1_io_data_1_read),
  .system_spi_1_io_data_1_write		    (system_spi_1_io_data_1_write),
  .system_spi_1_io_ss			        (system_spi_1_io_ss),
		  
  .jtagCtrl_tck				    (jtag_inst1_TCK),
  .jtagCtrl_tdi				    (jtag_inst1_TDI),
  .jtagCtrl_tdo				    (jtag_inst1_TDO),
  .jtagCtrl_enable			    (jtag_inst1_SEL),
  .jtagCtrl_capture			    (jtag_inst1_CAPTURE),
  .jtagCtrl_shift			    (jtag_inst1_SHIFT),
  .jtagCtrl_update			    (jtag_inst1_UPDATE),
  .jtagCtrl_reset			    (jtag_inst1_RESET)
		
);

endmodule