The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 6th, 2024, 11:03pm
Pages: 1
Send Topic Print
Read data from external file (Read 3250 times)
prego64
New Member
*
Offline



Posts: 1
Irvine
Read data from external file
May 22nd, 2006, 8:57am
 
Can somebody show me howto read in external data from a ASCII file into an array ?
For example: I have a file with three integer numbers (one number per line), that I want to assign to an array x[0]...x{2].

The documentation on fread() is very limited or non-existant.

Thanks !

Bernd
Back to top
 
 
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Read data from external file
Reply #1 - May 24th, 2006, 4:22am
 
1364-2005 has $fscanf -- as well as more documentation on the system tasks for handling files than the AMS LRM does.
Some simulators already support the new 1364 for the digital engine and have brought that support over for AMS.

You might also consider the $table_model in AMS.
Back to top
 
 

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



Posts: 220
UK
Re: Read data from external file
Reply #2 - May 31st, 2006, 7:56am
 
Is there any equivalent table model concept in VerilogA??
Back to top
 
 

Design is fun, verification is a requirement.
View Profile   IP Logged
Geoffrey_Coram
Senior Fellow
******
Offline



Posts: 1998
Massachusetts, USA
Re: Read data from external file
Reply #3 - May 31st, 2006, 9:33am
 
$table_model is in Verilog-A.  (That is, it's in AMS, and the LRM doesn't exclude $table_model from the "analog only subset"; ergo, it is in Verilog-A.)
Back to top
 
 

If at first you do succeed, STOP, raise your standards, and stop wasting your time.
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.