This function takes an existing array and creates a file that can be
read by AIEsimulator and x86simulator. The input array can be of any real or complex
data type.
- Complex data types are automatically detected, therefore only the data type
(for example,
int16
) needs to be specified. - The function also accepts the PLIO width and uses the data type to calculate the number of columns in the file. If the PLIO width is less than the size of the data type, the function will return an error.
Syntax
xmcVitisWrite(fileName,arrayIn,dataType,widthPLIO)
Where:
-
fileName
is the output file name. -
arrayIn
is the Input array. -
dataType
is the datatype of the data. -
widthPLIO
is the PLIO width (must be 32, 64, or 128)
The following table shows the list of datatypes and maximum possible columns in the output file, based on the PLIO width.
Data Types | Data Size (bits) | Maximum Possible Columns |
---|---|---|
int8 | 8 | 16 |
int16 | 16 | 8 |
int32 | 32 | 4 |
int64 | 64 | 2 |
uint8 | 8 | 16 |
uint16 | 16 | 8 |
uint32 | 32 | 4 |
uint64 | 64 | 2 |
cint16 | 32 | 4 |
cint32 | 64 | 2 |
float | 32 | 4 |
cfloat | 64 | 2 |
Example
Let A be an array of complex numbers of type
cfloat
and the PLIO width is set to
128.A = [
3.142 + 1.463i,
6.288 + 3.079i,
3.333 + 1.493i,
3.781 + 8.781i,
3.142 + 1.463i]
Note: The data can be either a row or column
vector.
The function call is as
follows.
→ xmcVitisWrite("Output.txt",A,'cfloat',128);
The file will be saved as Output.txt in the working directory, as specified in the function call. The file content is as follows.
"3.142 1.463
6.288 3.079
3.333 1.493
3.781 8.781
3.142 1.463"
The columns are calculated automatically from the size of the data type and the PLIO width. A complex number is divided into two columns in the file, corresponding to real and imaginary parts in that order. A file with complex values will have at least two columns, while one with real values will have at least one.