Skip to content

Commit 031d2d7

Browse files
author
Muxianesty
committed
README.md was updated.
1 parent 6c48c88 commit 031d2d7

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

README.md

+44-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ The compiled Utopia HLS executable has a CLI to accept a number of parameters af
211211

212212
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.
213213

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`.
215215

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:
217217

218218
* `-h,--help`: *optional* flag; used to print the help-message about other arguments.
219219
* `--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:
232232
umain hls --config ~/utopia-user/config.json --out-sv ~/outFile.sv --out-dfcir ~/outFile2.mlir -a
233233
```
234234

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+
235241
### JSON Configuration
236242

237243
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
268274
}
269275
```
270276

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+
271304
## Examples
272305

273306
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
282315

283316
The execution command is going to pass a JSON configuration file (with 2 and 3 pipeline stages for integer addition
284317
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.
319+
320+
The same kernel can be simulated with:
321+
322+
```bash
323+
build/src/umain sim --in examples/polynomial2/sim.txt --out output.vcd
324+
```
325+
326+
This command uses the simulation data from `sim.txt` file to output a VCD-file `output.vcd`.
286327

287328
## DFCxx Documentation
288329

0 commit comments

Comments
 (0)