Skip to content

Commit

Permalink
Merge pull request #1 from Fraunhofer-IMS/stnolting-ims-patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
hoyer-ims committed Apr 8, 2024
2 parents 84938ff + 5145f8e commit 52ab5bd
Showing 1 changed file with 52 additions and 28 deletions.
80 changes: 52 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,89 @@
![tinyHLS](tinyHLS_Logo.png)
[![Fraunhofer_IMS](https://img.shields.io/badge/Fraunhofer-IMS-179c7d.svg?longCache=true&style=flat-square&logo=fraunhofergesellschaft&logoColor=179c7d)](https://www.ims.fraunhofer.de/en.html)
[![tinyHLS-sim](https://img.shields.io/github/actions/workflow/status/Fraunhofer-IMS/tinyHLS/main.yml?branch=main&longCache=true&style=flat-square&label=tinyHLS-check&logo=Github%20Actions&logoColor=fff)](https://github.com/Fraunhofer-IMS/tinyHLS/actions/workflows/main.yml)
[![license](https://img.shields.io/github/license/Fraunhofer-IMS/tinyHLS?longCache=true&style=flat-square)](LICENSE)


# TinyHLS

**tinyHLS** is a compact Hardware-Compiler developed by Fraunhofer IMS. It processes tensorflow.keras neural networks and translates them into equivalent Verilog-Code.
Different configurations can be made. The output is platform independent Verilog HDL code.
**tinyHLS** is a compact hardware compiler developed by Fraunhofer IMS. It processes tensorflow.keras
neural networks and translates them into a dedicated co-processor unit. The generated outputs are platform
independent and consist entirely of synthesizable Verilog HDL code. The co-processor is wrapped with a
[AHB-lite interface](output/tinyHLS_AHB_interface.v) to allow easy integration into custom processor systems.


## Features

tinyHLS supports following layers.
tinyHLS currently supports the following layers:

- conv1D
- maxpool1D
- globalaveragepool1D
- dense
Linear and ReLU activation can be implemented.
- linear and ReLU activation functions can be implemented

The conv1D is currently configurable as a resource and as a fast option. This enables a resource friendly utilitization and a fast, more resource intense version.
The conv1D layer is configurable either as a resource-efficient or as performance-optimized version.

tinyHLS is currently under development.
> [!NOTE]
> tinyHLS is under active development and will be expanded with more features.
> Contributions and feedback are highly welcome!
## Quickstart

### Conda Installation
It is recommended to use the framework in a [conda](https://docs.conda.io/en/latest/) environment. To setup the environment and activate it, the following commands have to be run after cloning the repository:

`$ conda env create -f environment.yml`
`$ conda activate tinyHLS`
`$ pip install. `
It is recommended to use the framework in a [conda](https://docs.conda.io/en/latest/) environment.
To setup the environment and activate it, the following commands have to be run after cloning the repository:

```
$ conda env create -f environment.yml
$ conda activate tinyHLS
$ pip install
```


### Usage
A model can be trained or loaded using the standard workflow in Python TensorFlow Keras. The first part of the translation process is, to convert the weights of the user CNN into verilog includes by running the following commands:

`tinyhls.extract_weights()`
`tinyhls.convert_weights_to_hex()`
`tinyhls.create_verilog_includes()`
A model can be trained or loaded using the standard workflow in Python TensorFlow Keras.
The first part of the translation process is, to convert the weights of the user CNN into Verilog
includes by running the following commands:

Second, the model is translated into HDL and a testbench with examplary values generated by the following commands
```
tinyhls.extract_weights()
tinyhls.convert_weights_to_hex()
tinyhls.create_verilog_includes()
```

`tinyhls.translate_model()`
`tinyhls.create_testbench()`
Second, the model is translated into HDL and a testbench with examplary values generated by the following commands

```
tinyhls.translate_model()
tinyhls.create_testbench()
```

### Example
An example of a small CNN is provided in the `test.py` file.
### Example

### Simulation
A simulation environment using a free version of vivado should soon be provided.
An example of a small CNN is provided in the [`test.py`](test.py) file.
This example is also executed by the project's [GitHub actions workflow](https://github.com/Fraunhofer-IMS/tinyHLS/actions).

> [!TIP]
> See the action's artifacts for tool logs and the generated HDL example.
### Requirements
### Simulation

tensorflow==2.11.0
numpy==1.22.3
The generated Verilog code can be simulated using any open-source or commercial HDL simulator tools.
The GitHub actions workflow of this project uses Icarus Verilog as open-source simulation example.
The according simulation scripts can be found in the [`ci`](.ci) folder.

> [!NOTE]
> A simulation environment using free AMD Vivado WebPack will be provided soon.
### License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
### Requirements

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* tensorflow==2.11.0
* numpy==1.22.3

You should have received a [copy of the GNU General Public License](https://gitlab.cc-asp.fraunhofer.de/risc-v/tinyhls/-/blob/develop/License.md) along with this program. If not, see <https://www.gnu.org/licenses/>.

## Contact

Expand Down

0 comments on commit 52ab5bd

Please sign in to comment.