forked from f4pga/prjxray
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addrwidth.py
executable file
·39 lines (28 loc) · 916 Bytes
/
addrwidth.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
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()