OpenFPGA/vpr7_x2p/vpr/VerilogNetlists/io.v

17 lines
604 B
Coq
Raw Normal View History

2018-07-26 12:28:21 -05:00
//------ Module: iopad -----//
//------ Verilog file: io.v -----//
//------ Author: Xifan TANG -----//
module iopad(
2019-05-10 15:07:32 -05:00
//input zin, // Set output to be Z
2019-07-09 10:18:06 -05:00
input outpad, // Data output
output inpad, // Data input
2018-07-26 12:28:21 -05:00
inout pad, // bi-directional pad
2019-07-09 10:18:06 -05:00
input en // enable signal to control direction of iopad
2019-04-26 13:23:47 -05:00
//input direction_inv // enable signal to control direction of iopad
2018-07-26 12:28:21 -05:00
);
//----- when direction enabled, the signal is propagated from pad to din
2019-07-09 10:18:06 -05:00
assign inpad = en ? pad : 1'bz;
2018-07-26 12:28:21 -05:00
//----- when direction is disabled, the signal is propagated from dout to pad
2019-07-09 10:18:06 -05:00
assign pad = en ? 1'bz : outpad;
2018-07-26 12:28:21 -05:00
endmodule