From 1335b3a355f7d0a3de9d4eba00a03adfe51008ca Mon Sep 17 00:00:00 2001 From: Lakshya A Agrawal Date: Fri, 16 Jul 2021 11:16:51 +0530 Subject: [PATCH] Add Usage instructions from Tycho Compiler readme --- README.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 10a68211..a76d30d2 100644 --- a/README.md +++ b/README.md @@ -46,14 +46,41 @@ cd streamblocks-tycho mvn -DskipTests install ``` -### 5. StreamBlocks Platforms +### 5. Usage +After installation, StreamBlocks Tycho can be used as +``` +tychoc --source-path --target-path +``` +#### Example +##### Compilation +Consider the following example. The following actor reads two streams of numbers and produces a stream that is the pairwise sum of two incoming streams. +``` +actor Add () uint(size=8) X, uint(size=8) Y ==> uint(size=8) Z : + action X:[x], Y:[y] ==> Z:[x + y] end +end +``` +The above snippet is saved to the file ```source/arith.cal```, then, to compile: +``` +tychoc --source-path source --target-path target Add +``` +##### Usage of compilation output +The C code generated by the Tycho compiler can be compiled to an executable by +``` +cc target/*.c -o Add +``` +Given two input files ```in-1``` and ```in-2``` the pairwise sum of their byte streams using the ```Add``` actor in file named ```out``` by running: +``` +./Add in-1 in-2 out +``` + +### 6. StreamBlocks Platforms The StreamBlocks dataflow compiler has a code generator for multicore platforms and another one for reconfigurable computing using High-Level synthesis. The repository for those code-generators are located at the following link : [streamblocks-platforms](https://github.com/streamblocks/streamblocks-platforms/blob/master/README.md). -### 6. Original Tycho dataflow compiler repository +### 7. Original Tycho dataflow compiler repository Tycho dataflow compiler compiler was developed by Lund University and the original repository is located [here](https://bitbucket.org/dataflow/dataflow/). -### 7. Support +### 8. Support If you have an issue with StreamBlocks-Tycho dataflow compiler please create a new issue in this repository.