-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DFCxx simulation #49
DFCxx simulation #49
Changes from 21 commits
ddd2366
4505cce
80a8097
5aabc77
4ebe450
8a0fe36
29dac55
6e0e750
58b7a0d
ddac5f9
38d04cf
bd65dbb
596a936
df531b0
9673380
424f328
6c48c88
031d2d7
252e0c4
fd31d82
2a829bf
8eb9020
97d413d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## JSON Configuration | ||
|
||
Latency configuration (in terms of pipeline stages) for each computational operation used in a DFCxx kernel is provided via a JSON file. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no information about pipeline stages in this document, so the refinement looks like "hanging in the air" fact. Also passive voice is used, it makes sentence complicated. It would be more clear to start like "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 | ||
} | ||
``` |
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* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
x 0x32 | ||
|
||
x 0x45 | ||
|
||
x 0x56 |
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 |
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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
x 0x32 | ||
|
||
x 0x45 | ||
|
||
x 0x56 |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File was renamed, but the title remains the same -- is it ok?