The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Design Languages >> VHDL-AMS >> read signal from type "1e-5" with VHDL
https://designers-guide.org/forum/YaBB.pl?num=1291212748

Message started by jerome_ams on Dec 1st, 2010, 6:12am

Title: read signal from type "1e-5" with VHDL
Post by jerome_ams on Dec 1st, 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

Title: Re: read signal from type "1e-5" with VHDL
Post by carlgrace on 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

Title: Re: read signal from type "1e-5" with VHDL
Post by jerome_ams on 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, ...

Title: Re: read signal from type "1e-5" with VHDL
Post by jerome_ams on 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)

Title: Re: read signal from type "1e-5" with VHDL
Post by Andrew Beckett on 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.

Title: Re: read signal from type "1e-5" with VHDL
Post by jerome_ams on 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.

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