NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

User:DVT/UserDocumentation/DVT Component Reference Guide/DVT Data Sources

From Texas Instruments Wiki
Jump to: navigation, search

Text File Reader[edit]

Overview[edit]

The Text File Reader is used for importing data from a text file. Each line in the file, except those identified as header or comments, are stream out as a records. Headers and comments, which can be specified via the properties of the Text File Reader, are ignored.

Input Channel[edit]

None

Output Channel[edit]

The Text File Reader has one output channel which outputs a single record for each line in the text file. Each record contains two fields: SeqId and Line. SeqId is an automatic record index assigned by the Reader and Line contains the text read from the file.

Properties[edit]

Property Description Type Required Default
Comment If there are lines/comments in the text file that should be ignored, specify the syntax (e.g. // or /*) used at the beginning of the lines to identify comments. Text Optional
File Name Specify the name of the text file to import data from File Required
Flow Not supported Boolean
Header Lines To Ignore Specifies the number of lines to ignore at the top of the text file Integer Optional 0
Name Displays the name given to this component. Name can be changed through GSB Text Optional
Samples Per Run Use this property to control the number of records to stream each time the solution is RUN. Specify 0 (or a negative number) to stream the entire file. Note: Each time the solution is run the Text File Reader will resume from the last line read. A solution RESET will restart from the beginning. Integer Optional 0


Example[edit]

  • Input


A text file name mytrace.txt having the following lines

  
  * Time     Priority  Event   Size
  *
  1000     0          ReadCmd         8
  1100     0          ReadResp         8
  1200     2          WriteCmd          8
  1300     3          WriteCmd          8
  1400     1          ReadCmd         22
  1500     0          WriteCmd          8
  1600     1          ReadResp         16
  //End of trace
  
  • Properties

These are properties changed from the default values

Property Value
Comment //
File Name mytrace.txt
Header Lines To Ignore 2


  • Output


SeqID Line
0 1000 0 ReadCmd 8
1 1100 0 ReadResp 8
2 1200 2 WriteCmd 8
3 1300 3 WriteCmd 8
4 1400 1 ReadCmd 22
5 1500 0 WriteCmd 8
6 1600 1 ReadResp 16


Example Solution[edit]

<install>\dvt\Examples\TextFileReader\TextFileReader.sol

Also See[edit]

TODO: Add references to tutorials in which component is used

Enhancement Requests[edit]

Gforge Tracker ID:

Known Issues[edit]

Gforge Tracker ID: 652, 653