diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-07-16 11:10:02 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-07-16 11:11:45 +0200 |
commit | d8c3157bf889f3d57f014805417172d7f227b5fc (patch) | |
tree | 51731c74ac38ddf25f970708a364b22a6ec025da /firmware | |
parent | 0249d538fa61a5436b0e1f881b21d1c60960a32f (diff) | |
download | picorv32-d8c3157bf889f3d57f014805417172d7f227b5fc.tar.gz picorv32-d8c3157bf889f3d57f014805417172d7f227b5fc.zip |
Improved firmware for vivado "system" example
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/makehex.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/makehex.py b/firmware/makehex.py index 1735d86..70282c2 100644 --- a/firmware/makehex.py +++ b/firmware/makehex.py @@ -9,13 +9,16 @@ from sys import argv -with open(argv[1], "rb") as f: +binfile = argv[1] +nwords = int(argv[2]) + +with open(binfile, "rb") as f: bindata = f.read() -assert len(bindata) < 60*1024 +assert len(bindata) < 4*nwords assert len(bindata) % 4 == 0 -for i in range(64*1024//4): +for i in range(nwords): if i < len(bindata) // 4: w = bindata[4*i : 4*i+4] print("%02x%02x%02x%02x" % (w[3], w[2], w[1], w[0])) |