Skip to content

Commit

Permalink
Merge pull request #62 from ferrandi/doc/bambu101
Browse files Browse the repository at this point in the history
Doc/bambu101
  • Loading branch information
Ansaya authored May 12, 2022
2 parents 8b59b7a + d562aca commit 43c682a
Show file tree
Hide file tree
Showing 139 changed files with 112,393 additions and 129 deletions.
18 changes: 9 additions & 9 deletions .devcontainer/library-scripts/compiler-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,31 @@ inflate() {
wget https://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
gcc-4.5 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.6 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.7 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.8 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.9 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.9-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.9-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-5 )
wget https://release.bambuhls.eu:8080/compiler/gcc-5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-6 )
wget https://release.bambuhls.eu:8080/compiler/gcc-6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-7 )
wget https://release.bambuhls.eu:8080/compiler/gcc-7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-8 )
wget https://release.bambuhls.eu:8080/compiler/gcc-8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
* )
;;
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,31 +108,31 @@ jobs:
wget https://releases.llvm.org/4.0.0/clang+llvm-4.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -nv -O - | tar -C $2 -xJf - &
;;
gcc-4.5 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.6 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.7 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.8 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-4.9 )
wget https://release.bambuhls.eu:8080/compiler/gcc-4.9-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-4.9-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-5 )
wget https://release.bambuhls.eu:8080/compiler/gcc-5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-5-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-6 )
wget https://release.bambuhls.eu:8080/compiler/gcc-6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-6-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-7 )
wget https://release.bambuhls.eu:8080/compiler/gcc-7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-7-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
gcc-8 )
wget https://release.bambuhls.eu:8080/compiler/gcc-8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
wget https://release.bambuhls.eu/compiler/gcc-8-bambu-Ubuntu_16.04.tar.xz --no-check-certificate -nv -O - | tar -C $2 -xJf -
;;
* )
;;
Expand Down Expand Up @@ -162,4 +162,4 @@ jobs:
APP_FILE="${{env.dist-pkg}}.AppImage"
STORAGE_URL="${{env.storage-url}}/${{env.storage-path}}/$APP_FILE"
curl -L --fail -u '${{env.storage-user}}':'${{env.storage-token}}' -T "${{steps.build.outputs.appimage}}" "$STORAGE_URL"
echo "::notice New release available at https://release.bambuhls.eu:8080/appimage/$APP_FILE"
echo "::notice New release available at https://release.bambuhls.eu/appimage/$APP_FILE"
133 changes: 133 additions & 0 deletions documentation/bambu101/IP_Integration/bambu.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": ""
},
"source": [
"# **Initial setup**\n",
"\n",
"Install Bambu and required packages:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": ""
},
"outputs": [],
"source": [
"!echo \"deb http://ppa.launchpad.net/git-core/ppa/ubuntu $(cat /etc/os-release | grep UBUNTU_CODENAME | sed 's/.*=//g') main\" >> /etc/apt/sources.list.d/git-core.list\n",
"!apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A1715D88E1DF1F24\n",
"!apt-get update\n",
"!apt-get install -y --no-install-recommends build-essential ca-certificates gcc-multilib git iverilog verilator wget\n",
"!wget https://release.bambuhls.eu/appimage/bambu-0.9.7.AppImage\n",
"!chmod +x bambu-*.AppImage\n",
"!ln -sf $PWD/bambu-*.AppImage /bin/bambu\n",
"!ln -sf $PWD/bambu-*.AppImage /bin/spider\n",
"!ln -sf $PWD/bambu-*.AppImage /bin/tree-panda-gcc\n",
"!git clone --depth 1 --filter=blob:none --branch doc/bambu101 --sparse https://github.com/ferrandi/PandA-bambu.git\n",
"%cd PandA-bambu\n",
"!git sparse-checkout set documentation/bambu101\n",
"%cd ..\n",
"!mv PandA-bambu/documentation/bambu101/* ."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Integrate external IPs into an HLS generated design\n",
"Bambu HLS offers the possibility to integrate RTL modules into the design generated through the High-Level Synthesis flow.\n",
"Here we will run through a simple example to show how this is achieved in practice."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Sample application\n",
"A sample application featuring four external IPs will be used.\n",
"The file tree is explained in the following to identify each of the necessary bits:\n",
"\n",
"── IP_Integration<br>\n",
"&emsp;&emsp;├── module_lib&emsp;&emsp;&emsp;&emsp;&emsp; : External IPs library<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── module_lib.h&emsp; &nbsp; : Library header declaring Verilog IPs C stub interfaces<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── module_lib.xml&ensp; : XML file describing Verilog IPs interfaces<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── module1.v&emsp;&emsp;&ensp; : Verilog IP implementation of module1<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── module2.v&emsp;&emsp;&ensp; : Verilog IP implementation of module2<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── printer1.v&emsp;&emsp;&emsp; : Verilog IP implementation of printer1<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── printer2.v&emsp;&emsp;&emsp; : Verilog IP implementation of printer2<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── module1.c&emsp;&emsp;&ensp; : C stub used to emulate module1 Verilog IP<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── module2.c&emsp;&emsp;&ensp; : C stub used to emulate module2 Verilog IP<br>\n",
"&emsp;&emsp;│&emsp;&emsp;├── printer1.c&emsp;&emsp;&emsp; : C stub used to emulate printer1 Verilog IP<br>\n",
"&emsp;&emsp;│&emsp;&emsp;└── printer2.c&emsp;&emsp;&emsp; : C stub used to emulate printer2 Verilog IP<br>\n",
"&emsp;&emsp;├── test.my_ip.xml&emsp;&emsp;&emsp;&emsp;: XML testbench definition file<br>\n",
"&emsp;&emsp;└── top.c&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;: C application to feed into the HLS tool"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## XML interface description\n",
"The HLS tool needs an XML description of the interface of the external IPs to be integrated into the HLS generation flow.\n",
"The user must define each external IP interface specifying module name, I/O ports, other IPs which may be used by the implementation, and the IP implementation.\n",
"\n",
"The definition of the library for current example is available in [module_lib/module_lib.xml](module_lib/module_lib.xml) along with the external IPs implementation files [module_lib/module1.v](module_lib/module1.v), [module_lib/module2.v](module_lib/module2.v), [module_lib/printer1.v](module_lib/printer1.v), [module_lib/printer2.v](module_lib/printer2.v)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## C stub for simulation\n",
"Also a C definition of the external IPs is needed along with the Verilog implmenetation and the XML interface description.\n",
"This is useful to generate the verification testebench results to be compared with the generated design simulation.\n",
"\n",
"C stub definition for external IPs of this example can be found in [module_lib/module1.c](module_lib/module1.c), [module_lib/module2.c](module_lib/module2.c), [module_lib/printer1.c](module_lib/printer1.c), [module_lib/printer2.c](IP_Integration/module_lib/printer2.c)."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Initializing the HLS tool\n",
"To let the HLS tool know about external IPs all previously discussed files must be passed to the tool alongside standard command line options.\n",
"\n",
"The XML interface description is fed as a standard input file.\n",
"\n",
"The external IPs Verilog implementation files are passed through the --file-input-data command line option.\n",
"\n",
"The external IPs C stubs for simulation are passed through the --C-no-parse command line option to be used for simulation only."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%cd /content/IP_Integration\n",
"!bambu top.c --top-fname=my_ip $PWD/module_lib/module_lib.xml --channels-type=MEM_ACC_11 --generate-tb=test.my_ip.xml --simulate --file-input-data=module_lib/module1.v,module_lib/module2.v,module_lib/printer1.v,module_lib/printer2.v --C-no-parse=module_lib/module1.c,module_lib/module2.c,module_lib/printer1.c,module_lib/printer2.c"
]
}
],
"metadata": {
"colab": {
"collapsed_sections": [],
"name": "bambu.ipynb",
"provenance": [],
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
8 changes: 8 additions & 0 deletions documentation/bambu101/IP_Integration/module_lib/module1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include "module_lib.h"
void module1(uint32_t input1, uint16_t input2, module1_output_t *outputs)
{
outputs->output1 = input1 * input2;
outputs->output2 = input1 + input2;
outputs->output3 = (~input2) + 1;
outputs->output4 = input2 | (((uint32_t)input2)<<16);
}
Loading

0 comments on commit 43c682a

Please sign in to comment.