addrwidth utility

Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
John McMaster 2019-01-08 11:42:40 +01:00
parent b8c5af8052
commit 06347fdd3a
1 changed files with 30 additions and 0 deletions

30
utils/addrwidth.py Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import json
from prjxray import bitstream
def gen_addrs():
for block_type, top_bottom, cfg_row, cfg_col, frame_count in bitstream.gen_part_base_addrs(
):
yield bitstream.addr_bits2word(
block_type, top_bottom, cfg_row, cfg_col, 0), frame_count
def run(verbose=False):
for addr, frame_count in sorted(gen_addrs()):
print("0x%08X: %u" % (addr, frame_count))
def main():
import argparse
parser = argparse.ArgumentParser(
description='Print number of frames at a base address')
args = parser.parse_args()
run(verbose=False)
if __name__ == '__main__':
main()