Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 Discussions

Tri-state fanout converted to OR gate

Altera_Forum
Honored Contributor II
2,264 Views

Hi, 

 

I'm writing Verilog code for an I2C expander with bidirectional 16-bit output. 

 

If I need to read the status of the pins into a register, which means I the tr-state output pins are connected to a reg variable (along with the output pins), I get the below mentioned warning from Quartus. 

 

Warning: Converted the fan-out from the tri-state buffer "i2c_expander_v2:i2c1|register_logic_v2:reg1|bidir_io:gpio15|io" to the node "i2c_expander_v2:i2c1|register_logic_v2:reg1|input_reg2[7]" into an OR gate 

 

This occurs for all the 16-bits. 

The device is Max II CPLD. 

 

Any help how I go about this? 

 

Ram
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
1,030 Views

Sounds like your code doesn't utilize the pins bidirectionally.

0 Kudos
Altera_Forum
Honored Contributor II
1,030 Views

Make sure to follow the coding guideline on page 54 of this document: http://www.altera.com/literature/hb/qts/qts_qii51007.pdf

0 Kudos
Altera_Forum
Honored Contributor II
1,030 Views

My bidirectional primitive is 

 

 

module bidir_io ( 

 

input wire in, 

input wire oe, 

output out, 

inout wire io 

); 

 

 

assign io = oe ? in : 1'bz; 

assign out = io; 

 

endmodule 

 

I only use the 'out' to sense any changes to 'io' pin. So I'm not sure why the error points to 'io'.
0 Kudos
Altera_Forum
Honored Contributor II
1,030 Views

The tri-state logic is burried in the I/O so it's not possible to assign a tristate signal directly to another signal. If you take a look at a diagram of the I/O logic of the FPGA this will become more clear.

0 Kudos
Altera_Forum
Honored Contributor II
1,030 Views

So if I need to read in the state of the bidirectional line, how do I do it without connecting anything to it?

0 Kudos
Altera_Forum
Honored Contributor II
1,030 Views

Take a look at the design examples page on www.altera.com and search for "tristate". You'll find examples of what you are attempting to do.

0 Kudos
Altera_Forum
Honored Contributor II
1,030 Views

Thank you all.. I understood the issue after reading the above mentioned Altera doc link. 

 

Thanks 

Ram
0 Kudos
Reply