You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-3
Original file line number
Diff line number
Diff line change
@@ -211,9 +211,9 @@ The compiled Utopia HLS executable has a CLI to accept a number of parameters af
211
211
212
212
For the executable there are three general arguments: `-h,--help`, `-H,--help-all` and `-v,--version` for printing simple and extended help-messages, and printing current executable's version respectively.
213
213
214
-
Unless neither of the three arguments is used, first argument is the mode which the executable has to function in. Currently there is only one available mode`hls`.
214
+
Unless neither of the three arguments is used, first argument is the mode which the executable has to function in. Currently there are only two available modes:`hls` and `sim`.
215
215
216
-
The list of arguments for `hls`-mode is presented below:
216
+
`hls` mode is used to translate the provided DFCxx kernel to different output formats. The list of arguments for `hls`-mode is presented below:
217
217
218
218
*`-h,--help`: *optional* flag; used to print the help-message about other arguments.
219
219
*`--config <PATH>`: *required* filesystem-path option; used to specify the file for a JSON latency configuration file. Its format is presented in *JSON Configuration* section.
@@ -232,6 +232,12 @@ Here is an example of an Utopia HLS CLI call:
232
232
umain hls --config ~/utopia-user/config.json --out-sv ~/outFile.sv --out-dfcir ~/outFile2.mlir -a
233
233
```
234
234
235
+
`sim` mode is used to simulate the provided DFCxx kernel. The list of arguments for `sim`-mode is presented below:
236
+
237
+
*`-h,--help`: *optional* flag; used to print the help-message about other arguments.
238
+
*`--in <PATH>`: *optional* filesystem-path option; used to specify the input file for simulation data (default: `sim.txt`). Its format is presented in *DFCxx Simulation Input Format* section.
239
+
*`--out <PATH>`: *optional* filesystem-path option; used to specify the output VCD file (default: `sim_out.txt`).
240
+
235
241
### JSON Configuration
236
242
237
243
Latency configuration for each computational operation (number of pipeline stages) used in a DFCxx kernel is provided via a JSON file.
@@ -268,6 +274,33 @@ Here is an example of a JSON configuration file, containing latencies for multip
268
274
}
269
275
```
270
276
277
+
### DFCxx Simulation Input Format
278
+
279
+
DFCxx kernels can be simulated to check that they describe computations as expected. The simulation doesn't include scheduling-related characteristics, thus DFCxx concepts like *offsets* are not supported, every computational node has to use **and** accept some value.
280
+
The format to provide simulation input data is the following:
281
+
282
+
* input data is divided into blocks separated with a newline character (`\n`) - one block for each clock period
283
+
* every block has a number of lines, each of which has the name of some **input** stream/scalar value and its hex-value (these values do not have a type - it is assumed from the corresponding computational nodes)
284
+
* stream/scalar value name and the value are separated with a single space character (``)
285
+
* the provided value must be a valid hex-value: with or without `0x`, with either lower- or uppercase letters
286
+
* if some stream/scalar value is present twice or more in the same block - its latest described value is used
287
+
* after the last block **no newline character can be present**
288
+
289
+
Here is an example of an input simulation file for `MuxMul` kernel, which has two input streams `x` and `ctrl`.
290
+
291
+
```txt
292
+
x 0x32
293
+
ctrl 0x1
294
+
295
+
x 0x45
296
+
ctrl 0x0
297
+
298
+
x 0x56
299
+
ctrl 0x1
300
+
```
301
+
302
+
In this example, `x` accepts values `50` (`0x32`), `69` (`0x45`) and `86` (`0x56`), while `ctrl` accepts `1`, `0` and `1`. This means that 3 clock periods will be simulated for the provided kernel.
303
+
271
304
## Examples
272
305
273
306
Root subdirectory `examples` contains different examples of DFCxx kernels, `start`-function definitions and JSON configuration files.
@@ -282,7 +315,15 @@ build/src/umain hls --config examples/polynomial2/add_int_2_mul_int3.json -a --o
282
315
283
316
The execution command is going to pass a JSON configuration file (with 2 and 3 pipeline stages for integer addition
284
317
and multiplication respectively) to Utopia HLS, resulting in the creation of the file `output`, containing a SystemVerilog
285
-
module for Polynomial2 kernel with a greedy ASAP-scheduling.
318
+
module for `Polynomial2` kernel with a greedy ASAP-scheduling.
0 commit comments