Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Inout port problem in verilog test bench

Status
Not open for further replies.

bhatnidhibhat

Newbie level 3
Joined
May 4, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Bangalore
Activity points
1,304
Hi all,
This is the very old problem which is already discussed in this board. But still i didn't get the clear understanding. Please help me in this regard. I have written a verilog code for one of the bi-directional IO cell. It contains one core input A, one control pin CNTL, one inout pin Y and one output pin Z. Here Y will be operated both in driver mode and receiver mode.

When CNTL=0, A will be input and Y will be output. And Z will follow the Y.
When CNTL=1, driver will be disabled. i.e. through bufif0 i will make Y to tri-state.
In this case i want to use Y as a input and drive Z.

This is the simple and brief functionality of my IO cell. Now i want to write a verilog test bench for this code. I need to test it for both driver mode and receiver modes in single test bench.

Please let me know how to declare Y pin in tb and how to give the input to Y?

--
Shrinidhi.
 

The testbench pin should be of inout type as well and be tristated, when the connected D.U.T. pin is driving out and vice versa.
I don't see a general problem with this.
 

FvM said:
The testbench pin should be of inout type as well and be tristated, when the connected D.U.T. pin is driving out and vice versa.
I don't see a general problem with this.

Hi ,
use it as tri signal.
 

But in test bench we never use inout right? Either it should be reg or wire right?

Making tri-state means, whenever i am giving input to Y, i need to keep CNTL=1 right? That i have did. Still i will get Y=U throughout my simulation
 

bhatnidhibhat said:
But in test bench we never use inout right? Either it should be reg or wire right?

Making tri-state means, whenever i am giving input to Y, i need to keep CNTL=1 right? That i have did. Still i will get Y=U throughout my simulation

Hi,
If tri doesn't work then the only option is to write some logic for it.
Please check the attached doc for logic.
 

Hi..
Thanks for the doc. Will try and let u know the result. If i still face the problem, will provide my test bench. Then u may get more clear picture.

Regards,
Shrinidhi.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top