2020-11-02 12:28:29 -06:00
|
|
|
`timescale 1ns/1ps
|
|
|
|
|
2020-11-03 10:05:20 -06:00
|
|
|
//-----------------------------------------------------
|
2020-11-17 20:17:48 -06:00
|
|
|
// Function : An embedded I/O with
|
|
|
|
// - An I/O isolation signal to set
|
|
|
|
// the I/O in input mode. This is to avoid
|
|
|
|
// any unexpected output signals to damage
|
|
|
|
// circuits outside the FPGA due to configurable
|
|
|
|
// memories are not properly initialized
|
|
|
|
// This feature may not be needed if the configurable
|
|
|
|
// memory cell has a built-in set/reset functionality
|
|
|
|
// - Internal protection circuitry to ensure
|
|
|
|
// clean signals at all the SOC I/O ports
|
|
|
|
// This is to avoid
|
|
|
|
// - output any random signal
|
|
|
|
// when the I/O is in input mode, also avoid
|
|
|
|
// - driven by any random signal
|
|
|
|
// when the I/O is output mode
|
|
|
|
//
|
|
|
|
// Note: This cell is built with Standard Cells from HD library
|
|
|
|
// It is already technology mapped and can be directly used
|
|
|
|
// for physical design
|
2020-11-03 10:05:20 -06:00
|
|
|
//-----------------------------------------------------
|
2020-11-17 20:17:48 -06:00
|
|
|
module EMBEDDED_IO_HD (
|
|
|
|
input SOC_IN, // Input to drive the inpad signal
|
2020-11-05 11:18:52 -06:00
|
|
|
output SOC_OUT, // Output the outpad signal
|
|
|
|
output SOC_DIR, // Output the directionality
|
|
|
|
output FPGA_IN, // Input data to FPGA
|
|
|
|
input FPGA_OUT, // Output data from FPGA
|
2020-11-17 20:17:48 -06:00
|
|
|
input FPGA_DIR, // direction control
|
2020-11-17 20:33:53 -06:00
|
|
|
input IO_ISOL_N // Isolation enable signal
|
2020-11-05 11:18:52 -06:00
|
|
|
);
|
|
|
|
|
2020-11-19 17:31:06 -06:00
|
|
|
wire SOC_DIR_N;
|
|
|
|
|
|
|
|
// Use drive-strength 4 for a high fan-out from SoC components
|
|
|
|
sky130_fd_sc_hd__or2b_4 ISOL_EN_GATE (.B_N(IO_ISOL_N),
|
|
|
|
.A(FPGA_DIR),
|
2020-11-17 20:17:48 -06:00
|
|
|
.X(SOC_DIR)
|
|
|
|
);
|
|
|
|
|
2020-11-18 12:58:21 -06:00
|
|
|
// Use drive-strength 4 for a high fan-out from global routing architecture
|
2020-11-19 17:31:06 -06:00
|
|
|
sky130_fd_sc_hd__inv_1 INV_SOC_DIR (.A(SOC_DIR), .Y(SOC_DIR_N));
|
|
|
|
sky130_fd_sc_hd__ebufn_4 IN_PROTECT_GATE (.TE_B(SOC_DIR_N),
|
|
|
|
.A(SOC_IN),
|
|
|
|
.Z(FPGA_IN)
|
|
|
|
);
|
2020-11-17 20:17:48 -06:00
|
|
|
|
2020-11-18 12:58:21 -06:00
|
|
|
// Use drive-strength 4 for a potential high fan-out from SoC components
|
2020-11-19 17:31:06 -06:00
|
|
|
sky130_fd_sc_hd__ebufn_4 OUT_PROTECT_GATE (.TE_B(SOC_DIR),
|
|
|
|
.A(FPGA_OUT),
|
|
|
|
.Z(SOC_OUT)
|
|
|
|
);
|
2020-11-17 20:17:48 -06:00
|
|
|
|
2020-11-05 11:18:52 -06:00
|
|
|
endmodule
|
|
|
|
|