The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Modeling >> Behavioral Models >> problems about bidirectional pin
https://designers-guide.org/forum/YaBB.pl?num=1281456444

Message started by bsaqycx on Aug 10th, 2010, 9:07am

Title: problems about bidirectional pin
Post by bsaqycx on Aug 10th, 2010, 9:07am

Now I'm building a verilog-a model for a PAD. The problem is that there's a bidirectional pin. When en_input is high, the pin is worked as an input; While the en_output is high, the pin is worked as an output. How could I describe this pin?

Title: Re: problems about bidirectional pin
Post by Geoffrey_Coram on Aug 11th, 2010, 5:34am

It seems a standard switch branch would cover this situation:

if (V(en_input) > vthresh)
 input_val = V(bidir_pin);
else
 V(bidir_pin) <+ output_val;

Title: Re: problems about bidirectional pin
Post by bsaqycx on Aug 11th, 2010, 8:30pm

thanks for your reply. The voltage level of input is different from output, i.e., the input is 0~1.8V and the output is 0~5V. Therefore, I think it could not be done by " <+ " command directly. I choose "transition" function.

The key problem is that the bidirectional pin is used as input and output in the application. So I'm afraid there would be violations when the bidirectional pin is used as input pin but the module set its value to gnd/vdd.

Now I use " transition(v,td,tr,tf) + transition (r,0,tr,tf)*I(bidir_pin) " to solve this problem by changing the value of r in different mode.

I'm wondering whether there's any easier method to solve it.

The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.