compileAndSend.sh 679 B

12345678910111213141516171819
  1. #!/bin/bash
  2. echo "Assembling B32P ASM code"
  3. if (python3 Assembler.py > ../Programmer/code.list) # compile and write to code.list in Programmer folder
  4. then
  5. echo "B32P ASM code successfully assembled"
  6. # convert list to binary files and send to FPGC
  7. if [[ $1 == "flash" || $1 == "write" ]]
  8. then
  9. (cd ../Programmer && bash compileROM.sh && echo "Flashing binary to SPI flash" && python3 flash.py write)
  10. else
  11. (cd ../Programmer && bash compileROM.sh noPadding && echo "Sending binary to FPGC" && python3 uartFlasher.py)
  12. fi
  13. else # assemble failed, run again to show error
  14. echo "Failed to assemble B32P ASM code"
  15. python3 Assembler.py
  16. fi