forked from ferrandi/PandA-bambu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
144 changed files
with
10,557 additions
and
1,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
documentation/tutorial_fpl_2022/01-introduction/Exercise1/bambu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
script=$(readlink -e $0) | ||
root_dir=$(dirname $script) | ||
|
||
rm -rf icrc1 | ||
mkdir -p icrc1 | ||
cd icrc1 | ||
echo "#synthesis of icrc1" | ||
bambu ../icrc.c --top-fname=icrc1 \ | ||
--generate-tb=../test_icrc1.xml --simulator=VERILATOR --simulate \ | ||
-v2 --print-dot --pretty-print=a.c "$@" |& tee icrc1.log |
14 changes: 14 additions & 0 deletions
14
documentation/tutorial_fpl_2022/01-introduction/Exercise1/icrc.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
unsigned short icrc1(unsigned short crc, unsigned char onech) | ||
{ | ||
int i; | ||
unsigned short ans=(crc^onech << 8); | ||
|
||
for (i=0;i<8;i++) { | ||
if (ans & 0x8000) | ||
ans = (ans <<= 1) ^ 4129; | ||
else | ||
ans <<= 1; | ||
} | ||
return ans; | ||
} | ||
|
19 changes: 19 additions & 0 deletions
19
documentation/tutorial_fpl_2022/01-introduction/Exercise2/solution/minmax.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
void min_max(int * input, int num_elements, int * max, int * min) | ||
{ | ||
int local_max = input[0]; | ||
int local_min = input[0]; | ||
int i = 0; | ||
for(i = 0; i < num_elements; i++) | ||
{ | ||
if(input[i] > local_max) | ||
{ | ||
local_max = input[i]; | ||
} | ||
else if(input[i] < local_min) | ||
{ | ||
local_min = input[i]; | ||
} | ||
} | ||
*min = local_min; | ||
*max = local_max; | ||
} |
2 changes: 2 additions & 0 deletions
2
documentation/tutorial_fpl_2022/01-introduction/Exercise2/solution/synthesize.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bambu minmax.c --generate-tb=testbench.xml --simulate "$@" |& tee log.txt |
7 changes: 7 additions & 0 deletions
7
documentation/tutorial_fpl_2022/01-introduction/Exercise2/solution/testbench.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<function> | ||
<testbench input="{0,1,2,3,4}" num_elements="5" max="{0}" min="{0}"/> | ||
<testbench input="{0,1,2,3,4,5,6,7,8,9}" num_elements="10" max="{0}" min="{0}"/> | ||
<testbench input="{0,0,0,0,0,0,0,0,0,0}" num_elements="10" max="{0}" min="{0}"/> | ||
<testbench input="{0}" num_elements="1" max="{0}" min="{0}"/> | ||
</function> |
2 changes: 2 additions & 0 deletions
2
documentation/tutorial_fpl_2022/01-introduction/Exercise3/bambu.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bambu matmul.ll --top-fname=main_kernel --generate-tb=test.xml --simulate --simulator=VERILATOR --compiler=I386_CLANG12 "$@" |& tee log.txt |
Oops, something went wrong.