diff --git a/src/deprecated/pad_functional.sv b/src/deprecated/pad_functional.sv index 720b332..3765b87 100644 --- a/src/deprecated/pad_functional.sv +++ b/src/deprecated/pad_functional.sv @@ -79,4 +79,42 @@ module pad_functional_pu ( bufif0 (PAD_wi, 1'b1, PEN); rpmos (PAD, PAD_wi, 1'b0); -endmodule \ No newline at end of file +endmodule + +module pad_functional ( + input logic OEN, + input logic I, + output logic O, + input logic PUEN, + input logic PEN, + inout wire PAD +); + +/* + X Unknown + Z Hi-Z + H Pull High + L Pull Low +*/ + +/* + OEN I PAD PUEN PEN | PAD O + | + 0 0 - 0/1 0/1 | 0 0 + 0 1 - 0/1 0/1 | 1 1 + 1 0/1 0 0/1 0/1 | - 0 + 1 0/1 1 0/1 0/1 | - 1 + 1 0/1 Z 0 0 | H H + 1 0/1 Z 1 0 | L L + 1 0/1 Z 0/1 1 | - X + +*/ + + wire PAD_wi; + + bufif0 (PAD, I, OEN); + buf (O, PAD); + bufif0 (PAD_wi, ~PUEN, PEN); + rpmos (PAD, PAD_wi, 1'b0); + +endmodule diff --git a/src/fpga/pad_functional_xilinx.sv b/src/fpga/pad_functional_xilinx.sv index 665c113..59b7cd1 100644 --- a/src/fpga/pad_functional_xilinx.sv +++ b/src/fpga/pad_functional_xilinx.sv @@ -20,7 +20,7 @@ module pad_functional_pd (* PULLDOWN = "YES" *) IOBUF iobuf_i ( - .T ( OEN ), + .T ( OEN ), .I ( I ), .O ( O ), .IO( PAD ) @@ -39,7 +39,25 @@ module pad_functional_pu (* PULLUP = "YES" *) IOBUF iobuf_i ( - .T ( OEN ), + .T ( OEN ), + .I ( I ), + .O ( O ), + .IO( PAD ) + ); + +endmodule + +module pad_functional +( + input logic OEN, + input logic I, + output logic O, + input logic PEN, + inout logic PAD +); + + IOBUF iobuf_i ( + .T ( OEN ), .I ( I ), .O ( O ), .IO( PAD )