Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws2.0 #103

Open
wants to merge 39 commits into
base: openpiton-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bfba99d
add dma support through pcie
grigoriy-chirkov Oct 2, 2019
d921c19
add virtual devices
grigoriy-chirkov Oct 2, 2019
68e318b
add PCIe DMA and config options for xupp3r
grigoriy-chirkov Nov 4, 2019
7b598b1
Merge branch 'openpiton-dev' of github.com:grigoriy-chirkov/openpiton…
grigoriy-chirkov Nov 4, 2019
fa154b8
Cleared out mc_top.v, merged DMA infrastructure for XUPP3R and F1
grigoriy-chirkov Feb 3, 2020
601b1e7
revert xilinx IP to 2016.4 versions
grigoriy-chirkov Feb 3, 2020
a41cd1d
update fifo IPs on vu9p boards
grigoriy-chirkov Feb 4, 2020
1c5ee34
removed aws submodule
grigoriy-chirkov Feb 4, 2020
a31249a
copy f1 files and scripts into main repo
grigoriy-chirkov Feb 6, 2020
c1967e8
fix f1 synthesis
grigoriy-chirkov Feb 6, 2020
0412e66
fix protosyn f1 flow
grigoriy-chirkov Feb 6, 2020
0721518
add option for second uart (works with ariane only)
grigoriy-chirkov Feb 6, 2020
448ce7e
fix typos
grigoriy-chirkov Feb 7, 2020
fb6c08a
add aws clocks to gitignore
grigoriy-chirkov Feb 7, 2020
93967e2
dma_os utility for pci enabled boards
grigoriy-chirkov Feb 11, 2020
3d26996
migrate uart script to openpiton repo
grigoriy-chirkov Feb 11, 2020
4fdf666
unified script for reset
grigoriy-chirkov Feb 11, 2020
add572c
enable reset script for pci boards
grigoriy-chirkov Feb 11, 2020
5b69264
fix confusing DDR3 defines
grigoriy-chirkov Feb 11, 2020
e7e04ae
sudo privileges for xdma scripts
grigoriy-chirkov Feb 11, 2020
007abb9
fix license headers
Feb 12, 2020
3ff2c52
off scripts
grigoriy-chirkov Feb 12, 2020
d24053c
built-in reversing of bytes in dma_os
grigoriy-chirkov Feb 12, 2020
c1361ba
raise freq to 100 MHz on xupp3r
grigoriy-chirkov Feb 6, 2020
141f560
add usage printout in dma_os
grigoriy-chirkov Feb 13, 2020
ea3c988
interrupts in chipset_impl are now taken from devices.xml
grigoriy-chirkov Feb 15, 2020
7bfadcf
add ariane debug via jtag on f1
grigoriy-chirkov Jun 10, 2021
be64e6d
add f1 utilities binaries to .gitignore
grigoriy-chirkov Jun 10, 2021
919e631
Merge branch 'openpiton-dev' of github.com:PrincetonUniversity/openpi…
grigoriy-chirkov Jun 11, 2021
bdd5193
fix python2 code in virtual_dev_translator.v.pyv
grigoriy-chirkov Jun 15, 2021
6a4ba69
simplify resets/switches/leds in piton_aws top module
grigoriy-chirkov Jun 15, 2021
22d350d
fixes for sparc core
grigoriy-chirkov Jun 17, 2021
98e0426
remove ila leftover
grigoriy-chirkov Jun 17, 2021
8cff78b
fix packet ordering to/from memory in noc_axi4_bridge
grigoriy-chirkov Jun 17, 2021
607c376
ariane jtag doesnt work on f1, remove for now
grigoriy-chirkov Jun 18, 2021
5ee37e0
fix for uart2 (now works)
grigoriy-chirkov Jun 20, 2021
ba7cd83
fix license headers
grigoriy-chirkov Jun 23, 2021
02bfa22
modified readme section about f1
grigoriy-chirkov Jun 23, 2021
94a736f
fix in axi4_bridge_ser
grigoriy-chirkov Oct 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ ucli.key
*.tmp.v
*.tmp.h

# Ignore aws file with generated clocks
piton/design/piton_aws/xilinx/f1/cl_clocks_aws.xdc

# Ignore fpga ctrl utilities
piton/tools/src/xdma/f1_uart
piton/tools/src/xdma/dma_os

# Ignore generated .pyc files (specifically for pyhplib)
*.pyc

Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "piton/design/chip/tile/ariane"]
path = piton/design/chip/tile/ariane
url = https://github.com/pulp-platform/ariane.git
[submodule "aws"]
path = piton/design/aws
url = https://github.com/PrincetonUniversity/openpiton-aws.git
70 changes: 32 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,61 +400,57 @@ or playing tetris (`# /tetris`).

#### Running OpenPiton simulations on F1 instances in AWS: step guide

Here is the generic flow to run OpenPiton on F1 instance. We created a public image (agfi-0d87a634f93fe7c83), which you can use to try OpenPiton on F1 without synthesizing it.
Here is the generic flow to run OpenPiton on F1 instance. We created a public image (agfi-0ff8bf893f69a5920), which you can use to try OpenPiton on F1 without synthesizing it.

1. We assume that you already have F1 instance up and running. If not - steps 1,2,4,5 from this (https://github.com/vegaluisjose/aws-fpga-notes) guide will help you.

2. ssh into your instance, clone OpenPiton repo (https://github.com/PrincetonUniversity/openpiton).
2. ssh into your instance, clone OpenPiton repo (https://github.com/PrincetonUniversity/openpiton) and aws-fpga repo (https://github.com/aws/aws-fpga).

3. cd into repo, run these bash commands:
3. Setup the environment:
```
export PITON_ROOT=`pwd`
export AWS_FPGA_REPO_DIR="$PITON_ROOT/piton/design/aws"
export CL_DIR="$AWS_FPGA_REPO_DIR/hdk/cl/developer_designs/piton_aws"
source piton/piton_settings.bash
cd AWS_FPGA_LOCATION
source sdk_setup.sh
cd OPENPITON_LOCATION
source piton/ariane_setup.sh
```

4. Load the fpga image into board:
4. Compile software
```
fpga-load-local-image -S 0 -I agfi-0d87a634f93fe7c83
cd $DV_ROOT/tools/src/xdma
make
```
After this step the fpga is programmed, but the reset signal is high, so the system is still not working.
This will compile programs "f1_uart" and "dma_os". You should have xdma driver preinstalled (https://github.com/Xilinx/dma_ip_drivers/tree/master/XDMA/linux-kernel).

5. Compile software
5. Load the fpga image into board:
```
cd $CL_DIR/software/src
make
fpga-load-local-image -S 0 -I agfi-0ff8bf893f69a5920
```
This will compile programs "uart" and "dma_os". You should have xdma driver preinstalled (https://github.com/Xilinx/dma_ip_drivers/tree/master/XDMA/linux-kernel).
After this step the fpga is programmed, but the reset signal is high, so the system is still not working.

6. Run "uart" program
```
./uart &
f1_uart
```
This will create a pseudo-terminal and tell you the location of the corresponding file (e.g. /dev/pts/3)

7. Write OS image in memory:
```
./dma_os $FILE_LOCATION
```
This will put the os image from FILE_LOCATION in the appropriate place in memory. Note, before writing the image you should revert each 8 bytes of it (consequences of strange behavior of xdma driver). You can do this with
```
objcopy -I binary -O binary --reverse-bytes=8 $FILE_LOCATION
dma_os -b f1 -f $FILE_LOCATION
```
This will put the os image from FILE_LOCATION in the appropriate place in memory.

8. Reset fpga:
```
./fpga-reset
piton_reset -b f1
```
After this the processor will start working and printing UART data in your pseudo-terminal. You can connect to the terminal using your favourite terminal program (e.g. screen, tio).

9. Managing the fpga:
In the software directory we provide you with some useful programs:
- uart : starts pseudo-terminal, connected to the OpenPiton's uart
- f1_uart : starts pseudo-terminal, connected to the OpenPiton's uart
- dma_os : copies file from argument into the SD part of the memory
- fpga-reset : resets the fpga
- fpga-poweroff : sets the reset in the fpga to high, basically powering off OpenPiton so that you could write the data into memory without memory corruptions.
- piton_reset : resets the fpga
- piton_off : sets the reset in the fpga to high, basically powering off OpenPiton so that you could write the data into memory without memory corruptions.

Besides, you might find useful some utilities, provided by AWS themselves:
- fpga-clear-local-image : clears the image from FPGA
Expand All @@ -467,43 +463,41 @@ The flow is very simillar to synthesizing image for any other FPGA we support, b

1. Create the S3 credentials and configure your S3 bucket. You can find step guides here (https://github.com/vegaluisjose/aws-fpga-notes).

2. Clone OpenPiton repo (https://github.com/PrincetonUniversity/openpiton).
2. Clone OpenPiton repo (https://github.com/PrincetonUniversity/openpiton) and aws-fpga repo (https://github.com/aws/aws-fpga).

3. cd into repo, run these bash commands:
3. Setup the environment:
```
export PITON_ROOT=`pwd`
export AWS_FPGA_REPO_DIR="$PITON_ROOT/piton/design/aws"
export CL_DIR="$AWS_FPGA_REPO_DIR/hdk/cl/developer_designs/piton_aws"
source piton/piton_settings.bash
cd AWS_FPGA_LOCATION
source hdk_setup.sh
cd OPENPITON_LOCATION
source piton/ariane_setup.sh
source "$AWS_FPGA_REPO_DIR/hdk_setup.sh"
```
The last command will try to ask for root password to apply patch for Vivado, but you don't have to do it - the flow still works even without patch.
The second command will ask for the root password to apply patch for Vivado, but you don't have to do it - the flow still works even without patch.

4. Run the synthesis:
```
protosyn -b f1 -c ariane ...
```
This will create the custom logic tar archive, which we'll later upload on AWS servers. The synthesis itself is run in nohup, but protosyn will tell you the location of the log files, so that you can follow the progress.
This will create the custom logic tar archive, which will be later uploaded on AWS servers.

5. After the synthesis is complete (takes about 2-3 hours on fast PC), go to results folder:
5. After the synthesis is complete (takes about 2-3 hours on fast PC), go to the results folder:
```
cd $PITON_ROOT/build/f1/piton_aws/build/checkpoints/to_aws
```
This is the folder, where all the result tars are located.
This is where all the result tars are located.

6. Copy the resulting tar archive in the S3 bucket you created before
6. Copy the resulting tar archive to the S3 bucket you created before

7. Send the command for final synthesis:
```
aws ec2 create-fpga-image --name NAME_OF_IMAGE --input-storage-location Bucket=YOUR_S3_BUCKET,Key=NAME_OF_YOUR_TAR_ARCHIVE
```
The command will tell print the afi and agfi of your image. You can track the synthesis progress with
The command will print the afi and agfi of your image. You can track the synthesis progress with
```
aws ec2 describe-fpga-images --fpga-image-ids AFI_OF_YOUR_IMAGE
```

8. After the synthesis is done - you can go load it in your F1 instance!
8. After the synthesis is done - you can go load it into your F1 instance!

#### Planned Improvements

Expand Down
1 change: 0 additions & 1 deletion piton/design/aws
Submodule aws deleted from 40fec5
Loading