The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 28th, 2024, 12:07am
Pages: 1
Send Topic Print
How to pass a real value across interfaces (Read 3321 times)
Sanjeev
Guest




How to pass a real value across interfaces
Dec 26th, 2005, 9:46pm
 
Hey i want to pass a real value through my testbench but my problem is my DUT takes an input XIN[7:0]


probably using $realtobits i can convert my real value into equivalent bitvector but since my input bus is just 8 bit and $realtobit converts the input real into 64 bit bit vector , so how on earth do i map my input real to my DUT..

Any ideas??

or any way of passing a real value to a input port of a ADC..
Back to top
 
 
  IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: How to pass a real value across interfaces
Reply #1 - Jan 2nd, 2006, 5:01am
 
Doesn't the answer depend completely on what your DUT understands those bits to represent?

If your DUT is expecting an integer (0 < XIN < 256), then what do you want to happen to real numbers outside that range, or to numbers with a fractional part?
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
View Profile WWW   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: How to pass a real value across interfaces
Reply #2 - Jan 2nd, 2006, 2:10pm
 
You could try to use an assignment to an OOMR. In other words, you could have a real variable inside your DUT that contains the input value, and you can assign to it directly from within your testbench using a hierarchical reference. There are some restrictions in the language you might have to try to work around. For example, this will not work if the real variable is owned by the analog context. It also will not work if the input changes continuously.

-Ken
Back to top
 
 
View Profile WWW   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.