[HDL] Add a new IO cell with config_done support

This commit is contained in:
tangxifan 2022-02-24 09:46:55 -08:00
parent a615c9d4e3
commit fcaff28e24
1 changed files with 18 additions and 0 deletions

View File

@ -19,6 +19,24 @@ module GPIO (
assign PAD = DIR ? 1'bz : A;
endmodule
//-----------------------------------------------------
// Function : A minimum general purpose I/O with config_done signal
// which can block signals during configuration phase
//-----------------------------------------------------
module GPIO (
input CONFIG_DONE, // Control signal to block signals
input A, // Data output
output Y, // Data input
inout PAD, // bi-directional pad
input DIR // direction control
);
//----- when direction enabled, the signal is propagated from PAD to data input
assign Y = CONFIG_DONE ? (DIR ? PAD : 1'bz) : 1'bz;
//----- when direction is disabled, the signal is propagated from data out to pad
assign PAD = CONFIG_DONE ? (DIR ? 1'bz : A) : 1'bz;
endmodule
//-----------------------------------------------------
// Function : A minimum input pad
//-----------------------------------------------------