Exemplo n.º 1
0
def place(lamrate, lam_temperature_update, lambda_schedule):
    lamb = lambda_schedule
    lamtemp = lamrate
    db = PcbDB.kicadPcbDataBase(kpfile)
    placer = PcbPlacer.GridBasedPlacer(db)
    placer.set_bb_ec(False)
    placer.set_rtree(True)
    placer.set_two_sided(True)
    placer.set_base_lam(lamtemp)
    placer.set_lamtemp_update(lam_temperature_update)
    placer.set_lambda_schedule(lamb)
    wl = placer.test_placer_flow()
    db.printKiCad("./cache")
    subprocess.call('mv ./cache ./' + fname + '_lambsched_' + str(lamb) +
                    '_lamrate_' + str(lamtemp) + '_lam_temp_' +
                    str(lam_temperature_update),
                    shell=True)
    subprocess.call('mkdir ./cache', shell=True)
    subprocess.call('mkdir ./cache/img', shell=True)
    out = (str(lamb), str(lamtemp), str(lam_temperature_update), str(wl))

    with open('./' + fname + '_log.txt', 'a+') as f:
        f.write(out[0] + ',' + out[1] + ',' + out[2] + ',' + out[3] + '\n')
    return wl
Exemplo n.º 2
0
import sys
sys.path.append("../")
from ucsdpcb import PcbPlacer, PcbRouter, PcbDB

db = PcbDB.kicadPcbDataBase('../module/PCBBenchmarks/bm9/bm9.routed.kicad_pcb')
db.printNodes()
placer = PcbPlacer.GridBasedPlacer(db)
placer.set_inner_iter(1)
placer.set_outer_iter(1)
placer.test_placer_flow()
db.printNodes()
router = PcbRouter.GridBasedRouter(db)
router.set_num_ripup_reroute_iteration(1)
router.route_all_net_with_ripup_and_reroute()
db.printKiCad()
Exemplo n.º 3
0
import numpy as np
from ucsdpcb import PcbDB, PcbPlacer
import subprocess
import dlib
from tqdm import tqdm
import sys
import importlib

lamrates = [0.1, 0.25]
temperatures = [0.88, 0.95]
lambda_schedules = [0.95, 0.98]
is_integer_variable = [False, False, False]

fname = './module/PCBBenchmarks/' + sys.argv[1] + '/' + sys.argv[
    1] + '.routed.kicad_pcb'
db = PcbDB.kicadPcbDataBase(fname)
placer = PcbPlacer.GridBasedPlacer(db)

placer.set_rtree(False)
placer.set_two_sided(False)
placer.set_base_lam(0.1329209929630061)
placer.set_lamtemp_update(0.8853585421875213)
placer.set_lambda_schedule(0.9753893051539414)


def place():
    wl = placer.test_placer_flow()
    return wl


wls = []
Exemplo n.º 4
0
from ucsdpcb import PcbPlacer, PcbDB
import subprocess
from tqdm import tqdm

lamrates = [0.03,0.05,0.07,0.09,0.11,0.13,0.15,0.17,0.19,0.12, 0.14, 0.16, 0.18]
toremove = ['micro_accept_probs','micro_dcongestion','micro_dcost','micro_dhpwl','micro_doverlap','micro_movement','micro_window_coef_history','nodes.nodes',]
for lam in tqdm(lamrates):
    db = PcbDB.kicadPcbDataBase('./module/BBBC2.kicad_pcb')
    placer = PcbPlacer.GridBasedPlacer(db)
    placer.set_rtree(True)
    placer.set_two_sided(True)
    placer.set_base_lam(lam)
    placer.test_placer_flow()
    db.printKiCad("./cache")
    #subprocess.call('python3 plot.py',shell=True,cwd='/home/orange3xchicken/Documents/PCB-PR-App/util')
    #subprocess.call('rm ./cache/*.pl',shell=True)
    #subprocess.call('rm ./cache/*.rad',shell=True)
    #subprocess.call('rm -rf ./cache/img',shell=True)
    #subprocess.call('rm ./cache/*_history',shell=True)
    #for fm in toremove:
    #    subprocess.call('rm ./cache/'+fm,shell=True)
    subprocess.call('mv ./cache ./lam_'+str(lam),shell=True)
    subprocess.call('mkdir ./cache',shell=True)
    subprocess.call('mkdir ./cache/img',shell=True)
Exemplo n.º 5
0
from ucsdpcb import PcbPlacer, PcbDB
import subprocess
import os, sys

path = '/home/orange3xchicken/Documents/PCB-PR-App/module/PCBBenchmarks'

for subdir, dirs, files in os.walk(path):
    for f in files:
        if '.kicad_pcb' not in f or sys.argv[1] not in f:
            continue

        ec = True
        db = PcbDB.kicadPcbDataBase(os.path.join(subdir, f))
        placer = PcbPlacer.GridBasedPlacer(db)
        placer.set_rtree(True)
        placer.set_two_sided(False)
        placer.set_base_lam(0.1329209929630061)
        placer.set_lambda_schedule(0.9753893051539414)
        placer.set_lamtemp_update(0.8853585421875213)
        placer.set_num_iterations(2001)
        placer.set_iterations_moves(25)
        placer.set_bb_ec(ec)
        placer.test_placer_flow()

        db.printKiCad("./cache")
        subprocess.call('mv ./cache ./exp_' + f.split('.')[0], shell=True)
        subprocess.call('mkdir ./cache', shell=True)
        subprocess.call('mkdir ./cache/img', shell=True)
Exemplo n.º 6
0
import sys

sys.path.append("../")
from ucsdpcb import PcbPlacer, PcbRouter, PcbDB

db = PcbDB.kicadPcbDataBase('./')
db.printNodes()
placer = PcbPlacer.GridBasedPlacer(db)
placer.set_num_iterations(601)
placer.set_iterations_moves(28)
placer.set_two_sided(False)
placer.set_rtree(False)
placer.test_placer_flow()
db.printKiCad()
Exemplo n.º 7
0
from ucsdpcb import PcbPlacer, PcbDB
import sys

db = PcbDB.kicadPcbDataBase(sys.argv[1])
placer = PcbPlacer.GridBasedPlacer(db)
placer.set_bb_ec(False)
placer.set_rtree(True)
placer.set_two_sided(True)
placer.set_num_iterations(1)
placer.set_iterations_moves(1)
placer.test_placer_flow()
Exemplo n.º 8
0
lamtemprates = [0.25, 0.2, 0.18, 0.17, 0.15, 0.13, 0.11]
lambda_schedules = [0.975011, 0.973063, 0.971118]
wl_schedules = []
toremove = [
    'micro_accept_probs',
    'micro_dcongestion',
    'micro_dcost',
    'micro_dhpwl',
    'micro_doverlap',
    'micro_movement',
    'micro_window_coef_history',
    'nodes.nodes',
]
for lamb in tqdm(lambda_schedules):
    for lamtemp in lamtemprates:
        db = PcbDB.kicadPcbDataBase(
            './module/BBBC_testcase_with_temp_back_courtyards.kicad_pcb')
        placer = PcbPlacer.GridBasedPlacer(db)
        placer.set_rtree(True)
        placer.set_two_sided(True)
        placer.set_base_lam(lamtemp)
        placer.set_lamtemp_update(0.91)
        placer.set_lambda_schedule(lamb)
        placer.test_placer_flow()
        db.printKiCad("./cache")
        #subprocess.call('python3 plot.py',shell=True,cwd='/home/orange3xchicken/Documents/PCB-PR-App/util')
        #subprocess.call('rm ./cache/*.pl',shell=True)
        #subprocess.call('rm ./cache/*.rad',shell=True)
        #subprocess.call('rm -rf ./cache/img',shell=True)
        #subprocess.call('rm ./cache/*_history',shell=True)
        #for fm in toremove:
        #    subprocess.call('rm ./cache/'+fm,shell=True)
Exemplo n.º 9
0
import sys
sys.path.append("../")
from ucsdpcb import PcbPlacer, PcbRouter, PcbDB, check_output

db = PcbDB.kicadPcbDataBase('bm15.routed.kicad_pcb')
db.printNodes()
placer = PcbPlacer.GridBasedPlacer(db)
placer.set_num_iterations(2501)
placer.set_iterations_moves(30)
placer.set_two_sided(True)
placer.set_rtree(False)
placer.test_placer_flow()
db.printKiCad()
check_output.check_output('output.bm15.routed.kicad_pcb')
Exemplo n.º 10
0
import sys
sys.path.append("../")
from ucsdpcb import PcbPlacer, PcbRouter, PcbDB

db = PcbDB.kicadPcbDataBase('./output.bm12.routed.kicad_pcb')
db.printNodes()
router = PcbRouter.GridBasedRouter(db)
router.set_grid_scale(20)
router.set_num_iterations(10)
router.set_enlarge_boundary(20)
router.set_layer_change_weight(1000)
router.route()
db.printKiCad()