File: synth_chdr_crossbar_nxn.py

package info (click to toggle)
uhd 3.13.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 207,120 kB
  • sloc: cpp: 167,245; ansic: 86,841; vhdl: 53,420; python: 40,839; xml: 13,167; tcl: 5,688; makefile: 2,167; sh: 1,719; pascal: 230; csh: 94; asm: 20; perl: 11
file content (37 lines) | stat: -rwxr-xr-x 1,507 bytes parent folder | download | duplicates (5)
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
#! /usr/bin/python3
#!/usr/bin/python3
#
# Copyright 2018 Ettus Research, a National Instruments Company
#
# SPDX-License-Identifier: LGPL-3.0-or-later
#

import argparse
import synth_run

modname = 'chdr_crossbar_nxn'

# Parse command line options
def get_options():
    parser = argparse.ArgumentParser(description='Generate synthesis results for ' + modname)
    parser.add_argument('--opt', type=str, default='AREA', help='Optimization strategies (CSV)')
    parser.add_argument('--ports', type=str, default='8', help='Number of ports (CSV)')
    parser.add_argument('--dataw', type=str, default='64', help='Router datapath width (CSV)')
    parser.add_argument('--mtu', type=str, default='10', help='MTU or Ingress buffer size (CSV)')
    parser.add_argument('--rlutsize', type=str, default='6', help='Router lookup table size (CSV)')
    return parser.parse_args()

def main():
    args = get_options()
    keys = ['opt', 'ports', 'dataw', 'mtu', 'rlutsize']
    for opt in args.opt.strip().split(','):
        for ports in args.ports.strip().split(','):
            for dataw in args.dataw.strip().split(','):
                for mtu in args.mtu.strip().split(','):
                    for rlutsize in args.rlutsize.strip().split(','):
                        # Collect parameters
                        transform = {'opt':opt, 'ports':ports, 'dataw':dataw, 'mtu':mtu, 'rlutsize':rlutsize}
                        synth_run.synth_run(modname, keys, transform)

if __name__ == '__main__':
    main()