Beispiel #1
0
def setup_param():
    # ask for version to use
    version = isa.ask_version('{}/HW_filter'.format(repo_root),
                              'iir_filter.vhd')

    # ask for clock period
    while True:
        try:
            period = float(
                input(
                    '\nType the desired clock period and press enter (0 for minimum): '
                ))
        except ValueError:
            print('Error. Invalid value. Try again.')
        else:
            break

    # ask for forcing components from DW
    while True:
        add_choice = input(
            '\nDo you want to instantiate special implementations for adders? (y/n): '
        )
        if add_choice == 'y':
            print('Which one?')
            adder = isa.get_choice(
                ['Ripple carry', 'Carry lookahead', 'Parallel prefix'])
            break
        elif add_choice == 'n':
            adder = None
            break
        else:
            print('Please type "y" or "n" and press enter.')

    while True:
        mult_choice = input(
            '\nDo you want to instantiate special implementations for multipliers? (y/n): '
        )
        if mult_choice == 'y':
            print('Which one?')
            multiplier = isa.get_choice(['Carry save', 'Parallel prefix'])
            break
        elif mult_choice == 'n':
            multiplier = None
            break
        else:
            print('Please type "y" or "n" and press enter.')

    # ask for compile command
    print('\nWhich command do you want to use?')
    compile_cmd = isa.get_choice(['compile', 'compile_ultra'])

    gen_tcl(version, period, adder, multiplier, compile_cmd)
    return version
Beispiel #2
0
)
pow_syn_n = isa.get_choice(['Synthesize design', 'Do power report']) - 1

if not pow_syn_n:
    # generate synthesis script
    with isa.cd('{}/HW_filter/syn'.format(repo_root)):
        version = setup_param()

    # run initial commands on server
    print('\nClean server side syn folder')
    session.run_commands("""cd {}
            rm -r syn/*""".format(remote_root))

else:
    # ask for version to use
    version = isa.ask_version('{}/HW_filter'.format(repo_root),
                              'iir_filter.vhd')

    # generate power report script
    with isa.cd('{}/HW_filter/syn'.format(repo_root)):
        with open('py-power-script.tcl', 'w') as pow_script:
            pow_script.write("""# read netlist
read_verilog -netlist ../version{ver}/iir_filter.v

# read switching activity
read_saif -input ../version{ver}/iir_filter_back.saif -instance iir_filterTB/UUT -unit ns -scale 1

# create clock
create_clock -name CLOCK clk

# report power
report_power > ./reports/power-report.txt""".format(ver=version))