The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 8:25am
Pages: 1
Send Topic Print
problems about bidirectional pin (Read 120 times)
bsaqycx
Junior Member
**
Offline



Posts: 11
Asia
problems about bidirectional pin
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?
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1999
Massachusetts, USA
Re: problems about bidirectional pin
Reply #1 - 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;
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
bsaqycx
Junior Member
**
Offline



Posts: 11
Asia
Re: problems about bidirectional pin
Reply #2 - 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.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.