# Send assembler file to remote machine to run
scp start.S home-1:/home/akilan/cheri/output/sdk/bin/
scp main.c home-1:/home/akilan/cheri/output/sdk/bin/
scp malloc_test.c home-1:/home/akilan/cheri/output/sdk/bin/
scp malloc.c home-1:/home/akilan/cheri/output/sdk/bin/
scp link.ld home-1:/home/akilan/cheri/output/sdk/bin/

# scp cheri.S home:/home/akilan/cheri/output/sdk/bin/

# Run compiled instruction remotely
# ssh home 'cd /home/akilan/cheri/output/sdk/bin/ && ./clang   --target=riscv64-unknown-elf   -march=rv64gcxcheri -mabi=l64pc128 -nostdlib -nostartfiles   -Wl,-Ttext=0x80000000 -o testC cheri.S'

# ssh home-1 'cd /home/akilan/cheri/output/sdk/bin/ && ./clang   --target=riscv64-unknown-elf   -march=rv64gcxcheri -mabi=l64pc128 -nostdlib -nostartfiles   -Wl,-Ttext=0x80000000 -o testC start.S main.c'

# ssh home-1 'cd /home/akilan/cheri/output/sdk/bin/ && ./clang   --target=riscv64-unknown-elf   -march=rv64gcxcheri -mabi=lp64d -nostdlib -nostartfiles   -Wl,-Ttext=0x80000000 -o testC start.S main.c'

# Malloc test implementation
ssh home-1 'cd /home/akilan/cheri/output/sdk/bin/ && ./clang   --target=riscv64-unknown-elf   -march=rv64gcxcheri -mabi=lp64d -DDEFINE_MALLOC -DDEFINE_FREE -nostdlib -nostartfiles -fno-builtin-malloc -mcmodel=medany  -T link.ld -o testC start.S main.c malloc.c malloc_test.c'

# Disassembly ouput
# ssh home-1 'cd /home/akilan/cheri/output/sdk/bin/ && ./llvm-objdump -d testC'

# Copy file back for testing
scp home-1:/home/akilan/cheri/output/sdk/bin/testC ../
