-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from ispras/dfcxx_sim
DFCxx simulation
- Loading branch information
Showing
59 changed files
with
1,835 additions
and
1,661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,9 @@ | |
"out_dfcir" : "", | ||
"out_firrtl" : "", | ||
"out_dot" : "" | ||
}, | ||
"sim": { | ||
"in" : "sim.txt", | ||
"out" : "sim_out.vcd" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## Latency Configuration | ||
|
||
Latency configuration is a JSON-based file describing characteristics of computational operations for the specific DFCxx kernel. | ||
|
||
Currently each operation has two specifications based on the types of its arguments: for integer values (`INT`) and floating point (`FLOAT`) values respectively. | ||
|
||
All the supported computational operations are listed below: | ||
|
||
* `ADD` - Addition | ||
* `SUB` - Subtraction | ||
* `MUL` - Multiplication | ||
* `DIV` - Division | ||
* `AND` - Logical conjunction | ||
* `OR` - Logical disjunction | ||
* `XOR` - Exclusive logical disjunction | ||
* `NOT` - Logical inversion | ||
* `NEG` - Negation | ||
* `LESS` - "less" comparison | ||
* `LESSEQ` - "less or equal" comparison | ||
* `GREATER` - "greater" comparison | ||
* `GREATEREQ` - "greater or equal" comparison | ||
* `EQ` - "equal" comparison | ||
* `NEQ` - "not equal" comparison | ||
|
||
JSON configuration structure states that for every operation with a specific configuration (each pair is represented as a separate JSON-field with `_` between pair's elements) present in the kernel, operation's latency has to be provided. | ||
|
||
Here is an example of a JSON configuration file, containing latencies for multiplication, addition and subtraction of integer numbers: | ||
|
||
```json | ||
{ | ||
"MUL_INT": 3, | ||
"ADD_INT": 1, | ||
"SUB_INT": 1 | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
## DFCxx Simulation | ||
|
||
DFCxx kernels can be simulated to check that they describe computations as expected. The simulation doesn't take scheduling into account and requires every computational node to use **and** accept some values at every simulation tick. | ||
|
||
### Input format | ||
|
||
The format to provide simulation input data is the following: | ||
|
||
* input data is divided into blocks separated with a newline character (`\n`) - one block for each simulation step | ||
* every block has a number of lines, each of which has the case-sensitive name of some **input** stream/scalar variable and its hex-value (these values do not have an explicit type - they will be casted to the types of related computational nodes) | ||
* stream/scalar value name and the hex-value are separated with a single space character (` `) | ||
* the provided value must be a valid hex-value: with or without `0x`, with either lower- or uppercase letters | ||
* if some stream/scalar hex-value is present twice or more in the same block - its latest described value is used | ||
|
||
Here is an example of an input simulation file for `MuxMul` kernel, which has two input streams: `x` (unsigned 32-bit integer values) and `ctrl` (unsigned 1-bit integer values). | ||
|
||
```txt | ||
x 0x32 | ||
ctrl 0x1 | ||
x 0x45 | ||
ctrl 0x0 | ||
x 0x56 | ||
ctrl 0x1 | ||
``` | ||
|
||
In this example, `x` accepts values `50` (`0x32`), `69` (`0x45`) and `86` (`0x56`), while `ctrl` accepts `1`, `0` and `1`. This means that 3 simulation ticks will be performed for the provided kernel. | ||
|
||
### Not Supported Constructions | ||
|
||
* *offsets* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
x 0x32 | ||
|
||
x 0x45 | ||
|
||
x 0x56 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
x0 0x0 | ||
x1 0x1 | ||
x2 0x2 | ||
x3 0x3 | ||
x4 0x4 | ||
x5 0x5 | ||
x6 0x6 | ||
x7 0x7 | ||
x8 0x8 | ||
x9 0x9 | ||
x10 0xA | ||
x11 0xB | ||
x12 0xC | ||
x13 0xD | ||
x14 0xE | ||
x15 0xF | ||
x16 0x10 | ||
x17 0x11 | ||
x18 0x12 | ||
x19 0x13 | ||
x20 0x14 | ||
x21 0x15 | ||
x22 0x16 | ||
x23 0x17 | ||
x24 0x18 | ||
x25 0x19 | ||
x26 0x1A | ||
x27 0x1B | ||
x28 0x1C | ||
x29 0x1D | ||
x30 0x1E | ||
x31 0x1F | ||
x32 0x20 | ||
x33 0x21 | ||
x34 0x22 | ||
x35 0x23 | ||
x36 0x24 | ||
x37 0x25 | ||
x38 0x26 | ||
x39 0x27 | ||
x40 0x28 | ||
x41 0x29 | ||
x42 0x2A | ||
x43 0x2B | ||
x44 0x2C | ||
x45 0x2D | ||
x46 0x2E | ||
x47 0x2F | ||
x48 0x30 | ||
x49 0x31 | ||
x50 0x32 | ||
x51 0x33 | ||
x52 0x34 | ||
x53 0x35 | ||
x54 0x36 | ||
x55 0x37 | ||
x56 0x38 | ||
x57 0x39 | ||
x58 0x3A | ||
x59 0x3B | ||
x60 0x3C | ||
x61 0x3D | ||
x62 0x3E | ||
x63 0x3F |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
x11 0x32 | ||
x12 0x64 | ||
x21 0x48 | ||
x22 0x99 | ||
y11 0x1 | ||
y12 0x0 | ||
y21 0x0 | ||
y22 0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
x 0x32 | ||
ctrl 0x1 | ||
|
||
x 0x45 | ||
ctrl 0x0 | ||
|
||
x 0x56 | ||
ctrl 0x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
x 0x32 | ||
|
||
x 0x45 | ||
|
||
x 0x56 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
x1 0x2 | ||
y1 0x32 | ||
x2 0x3 | ||
y2 0x32 | ||
x3 0x4 | ||
y3 0x32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.