From 51e2b9ea6fb0f4c07376f0fe9a4962acd674062d Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Tue, 7 Dec 2021 13:16:38 -0600 Subject: [PATCH] Added information on how to copy the linux image to flash card. --- fpga/README.md | 6 ++++++ .../linux-testgen/linux-testvectors/convert2bin.py | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100755 wally-pipelined/linux-testgen/linux-testvectors/convert2bin.py diff --git a/fpga/README.md b/fpga/README.md index 4dded4b1d..eb08171a6 100644 --- a/fpga/README.md +++ b/fpga/README.md @@ -14,6 +14,12 @@ wallypipelinedsoc.sv and the 4 IP blocks. The FPGA include and ILA (In logic analyzer) which provides the current instruction PCM, instrM, etc along with a large number of debuging signals. +* Programming the flash card +You'll need to write the linux image to the flash card. Use the convert2bin.py +script in wally-pipelined/linux-testgen/linux-testvectors/ to convert the ram.txt +file from QEMU's preload to generate the binary. Then to copy + sudo dd if=ram.bin of=. + * Loading the FPGA After the build process is complete about 2 hrs on an i9-7900x. Launch vivado's diff --git a/wally-pipelined/linux-testgen/linux-testvectors/convert2bin.py b/wally-pipelined/linux-testgen/linux-testvectors/convert2bin.py new file mode 100755 index 000000000..78349a5d6 --- /dev/null +++ b/wally-pipelined/linux-testgen/linux-testvectors/convert2bin.py @@ -0,0 +1,13 @@ +#!/usr/bin/python3 + +asciiBinFile = 'ram.txt' +binFile = 'ram.bin' + +asciiBinFP = open(asciiBinFile, 'r') +binFP = open (binFile, 'wb') + +for line in asciiBinFP.readlines(): + binFP.write(int(line, 16).to_bytes(8, byteorder='little', signed=False)) + +asciiBinFP.close() +binFP.close()