![]() |
|
![]() |
|
Answers Database
FPGA Express: How to instantiate I/O pads in your HDL code
Record #6085
Product Family: Software entity LOWER is port (CLK, RST : in STD_LOGIC); -- note that DIN and DOUT are not listed here end LOWER; architecture lower_arch of LOWER is signal DIN, DOUT: STD_LOGIC; -- ports DIN and DOUT are declared here signal DIN_INT, DOUT_INT: STD_LOGIC; component IBUF port (I : in STD_LOGIC; O : out STD_LOGIC); end component ; component IPAD port (PAD : out STD_LOGIC); -- note the direction is OUT end component ; component OBUF port (I : in STD_LOGIC; O : out STD_LOGIC); end component ; component OPAD port (PAD : in STD_LOGIC); -- note the direction is IN end component ; begin clocked: process(CLK, RST) begin if (RST='1') then DOUT_INT <= '0'; elsif rising_edge(CLK) then DOUT_INT <= DIN_INT; end if; end process; IBUF_inst: IBUF port map (I => DIN, O => DIN_INT); IPAD_inst: IPAD port map (PAD => DIN); OBUF_inst: OBUF port map (I => DOUT_INT, O => DOUT); OPAD_inst: OPAD port map (PAD => DOUT); end lower_arch; Solution 2: Verilog: module LOWER (CLK, RST) ; // note that DIN and DOUT are not listed here input CLK, RST; wire DIN, DIN_INT, DOUT; // ports DIN and DOUT are declared here reg DOUT_INT; IBUF IBUF_inst (.I(DIN), .O(DIN_INT)); IPAD IPAD_inst (.PAD(DIN)); OBUF OBUF_inst (.I(DOUT_INT), .O(DOUT)); OPAD OPAD_inst (.PAD(DOUT)); always @ (posedge CLK or posedge RST) begin if (RST) DOUT_INT = 1'b0; else DOUT_INT = DIN_INT; end endmodule Solution 3: NOTE: FPGA Express will not recognize the IPAD and OPAD components because they are not in the synthesis libraries. You can ignore warnings like these: Warning: Cell 'IPAD_inst': 'IPAD' is not a primitive for 'XC4000XL'. (FPGA-INTERNAL-xlx-8) Warning: Cannot link cell 'LOWER/IPAD_inst' to its reference design 'IPAD'. (FPGA-LINK-2) Warning: Cell 'OPAD_inst': 'OPAD' is not a primitive for 'XC4000XL'. (FPGA-INTERNAL-xlx-8) Warning: Cannot link cell 'LOWER/OPAD_inst' to its reference design 'OPAD'. (FPGA-LINK-2) Warning: The cell '/TOP-1/U1/IPAD_inst' is not linked to any design. (FPGA-CHECK-4) Warning: The cell '/TOP-1/U1/OPAD_inst' is not linked to any design. (FPGA-CHECK-4) Check the PAD report from the Xilinx implementation tools to ensure that all your I/O have been connected properly. Remember that the final name of the port will include the hierarchical name if the port was instantiated at a lower level, so it will look like this in the pad report: U1_DIN INPUT P12 End of Record #6085 - Last Modified: 01/11/00 10:44 |
| For the latest news, design tips, and patch information on the Xilinx design environment, check out the Technical Tips! |