The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Apr 24th, 2024, 8:37pm
Pages: 1
Send Topic Print
read signal from type "1e-5" with VHDL (Read 1441 times)
jerome_ams
Community Member
***
Offline



Posts: 36

read signal from type "1e-5" with VHDL
Dec 01st, 2010, 6:12am
 
Hi,
I need to read some stimuli files which were initially created for spectre models (vpwlf).
The format "1e-5" is read by spectre but how to read it using VHDL? Read it as a string and then convert it to a real or time would be an alternative, but I m looking for something else, something more straight forward...
Any ideas?

Thx,
Jerome
Back to top
 
 
View Profile   IP Logged
carlgrace
Senior Member
****
Offline



Posts: 231
Berkeley, CA
Re: read signal from type "1e-5" with VHDL
Reply #1 - Dec 1st, 2010, 4:12pm
 
Hi Jerome,

Exponential notation is allowed for real numbers in VHDL.  There shouldn't be any need to read the values in as strings and convert to reals.  Read them in directly as reals and it should work fine.

Carl
Back to top
 
 
View Profile   IP Logged
jerome_ams
Community Member
***
Offline



Posts: 36

Re: read signal from type "1e-5" with VHDL
Reply #2 - Dec 2nd, 2010, 1:34am
 
Hi carl,

You are right, 1.0e-5 for instance would be read fine.
But not 1e-5, which is neither a real, nor an integer... I really have to deal with such numbers, like 1e-5,  1e3, ...
Back to top
 
 
View Profile   IP Logged
jerome_ams
Community Member
***
Offline



Posts: 36

Re: read signal from type "1e-5" with VHDL
Reply #3 - Dec 10th, 2010, 3:16am
 
Actually, I could wrap my VHDL code inside a VerilogAMS description...
Does anyone see a possibility to handle a value like 1e-5 in Verilog? (a possibility that VHDL would not have provided)
Back to top
 
 
View Profile   IP Logged
Andrew Beckett
Senior Fellow
******
Offline

Life, don't talk to
me about Life...

Posts: 1742
Bracknell, UK
Re: read signal from type "1e-5" with VHDL
Reply #4 - Jan 3rd, 2011, 12:09am
 
Can you give an example of some syntax that does not work (in VHDL and Verilog) as I'm struggling to understand what the actual problem is. I can't see why there should be an issue with floating point numbers in exponential syntax in either language.

Regards,

Andrew.
Back to top
 
 
View Profile WWW   IP Logged
jerome_ams
Community Member
***
Offline



Posts: 36

Re: read signal from type "1e-5" with VHDL
Reply #5 - Jan 19th, 2011, 6:59am
 
Hi,
The problem has been solved. Actually the way the stimulus generator is written induced the problem...
A value written from a stimulus file is splited in an integer and decimal parts, which leads to problems if the target value did not have a decimal part.
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.