Skip to content

Commit

Permalink
Fixes regarding Pull Request comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Muxianesty committed Sep 3, 2024
1 parent fd31d82 commit 2a829bf
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ For the executable there are three general arguments: `-h,--help`, `-H,--help-al

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

`hls` mode is used to translate the provided DFCxx kernel to different output formats. The list of arguments for `hls`-mode is presented below:
`hls` mode is used to perform the high-level synthesis of digital hardware description from the input DFCxx kernel. The list of arguments for `hls`-mode is presented below:

* `-h,--help`: *optional* flag; used to print the help-message about other arguments.
* `--config <PATH>`: *required* filesystem-path option; used to specify the file for a JSON latency configuration file. Its format is presented in `docs/latency_config.md`.
Expand All @@ -232,7 +232,7 @@ Here is an example of an Utopia HLS CLI call:
umain hls --config ~/utopia-user/config.json --out-sv ~/outFile.sv --out-dfcir ~/outFile2.mlir -a
```

`sim` mode is used to simulate the provided DFCxx kernel. The list of arguments for `sim`-mode is presented below:
`sim` mode is used to simulate the input DFCxx kernel. The list of arguments for `sim`-mode is presented below:

* `-h,--help`: *optional* flag; used to print the help-message about other arguments.
* `--in <PATH>`: *optional* filesystem-path option; used to specify the input file for simulation data (default: `sim.txt`). Its format is presented in `docs/simulation.md`.
Expand Down
8 changes: 4 additions & 4 deletions docs/latency_config.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## JSON Configuration

Latency configuration for each computational operation (number of pipeline stages) used in a DFCxx kernel is provided via a JSON file.
Latency configuration (in terms of pipeline stages) for each computational operation used in a DFCxx kernel is provided via a JSON file.

Currently each operation has two specifications: for integer values (`INT`) and floating point (`FLOAT`) values.
Currently each operation has two specifications based on the types of its arguments: for integer values (`INT`) and floating point (`FLOAT`) values respectively.

The list of all computational operations is provided below:
All the supported computational operations are listed below:

* `ADD` - Addition
* `SUB` - Subtraction
Expand All @@ -22,7 +22,7 @@ The list of all computational operations is provided below:
* `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 will be provided.
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:

Expand Down
4 changes: 2 additions & 2 deletions docs/simulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ DFCxx kernels can be simulated to check that they describe computations as expec
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 name of some **input** stream/scalar value and its hex-value (these values do not have an explicit type - they will be casted to the types of related computational nodes)
* 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 -> boolean values).
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
Expand Down
2 changes: 1 addition & 1 deletion src/model/dfcxx/include/dfcxx/vars/var.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DFVariableImpl {
friend VarBuilder;

public:
enum IODirection{
enum IODirection {
NONE = 0,
INPUT,
OUTPUT
Expand Down
6 changes: 2 additions & 4 deletions src/model/dfcxx/lib/dfcxx/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ const std::unordered_set<Node> &Graph::getStartNodes() const {
return startNodes;
}

const std::unordered_map<Node,
std::vector<Channel>> &Graph::getInputs() const {
const std::unordered_map<Node, std::vector<Channel>> &Graph::getInputs() const {
return inputs;
}

const std::unordered_map<Node,
std::vector<Channel>> &Graph::getOutputs() const {
const std::unordered_map<Node, std::vector<Channel>> &Graph::getOutputs() const {
return outputs;
}

Expand Down
12 changes: 6 additions & 6 deletions src/model/dfcxx/lib/dfcxx/simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ static inline std::string valueToBinary(SimValue value, uint64_t width) {
return stream.str();
}

void DFCXXSimulator::writeOutput(ctemplate::TemplateDictionary *dict,
const RecordedValues &vals,
uint64_t startInd,
uint64_t iter,
const std::unordered_map<Node,
std::string> &idMap) {
void
DFCXXSimulator::writeOutput(ctemplate::TemplateDictionary *dict,
const RecordedValues &vals,
uint64_t startInd,
uint64_t iter,
const std::unordered_map<Node, std::string> &idMap) {
ctemplate::TemplateDictionary *tick =
dict->AddSectionDictionary("TICKS");
tick->SetValue("TICK", std::to_string(startInd + iter));
Expand Down

0 comments on commit 2a829bf

Please sign in to comment.