The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Modeling >> Behavioral Models >> How to do line-manuplating after read in data file https://designers-guide.org/forum/YaBB.pl?num=1145128159 Message started by yaxazaa on Apr 15th, 2006, 12:09pm |
Title: How to do line-manuplating after read in data file Post by yaxazaa on Apr 15th, 2006, 12:09pm My question is how I do line by line manuplation in Verilog-A after I read in a data file contains two columns. For example: data file name is data.dat contains: 1 10 2 20 3 30 etc; in Verilog-A: integrer infile; real x[0:100], y[0:100] real z[0:100]; ...... infile = $fopen("$path/data.dat"); Then What I am going to do is to assign column one as x, column two as y, and z = pow(y,x/20). HOw should I do it? Can someone help? Thanks. |
Title: Re: How to do line-manuplating after read in data Post by jbdavid on Apr 15th, 2006, 3:50pm for details look at $fread $fscanf functions.. you may want to refer to Verilog-2004 manual (or Verilog-AMS 2.2 ) manual for all the details on reading files.. Jonathan |
Title: Re: How to do line-manuplating after read in data Post by Geoffrey_Coram on Apr 25th, 2006, 5:37am It looks like the data file might be formatted in a way that $table_model would work. This was added in LRM 2.2, but was already available in some simulators. Check your simulator documentation. |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |