Simple framework for physical chip design (place & route) based on KLayout.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
2.0 KiB

<?xml version="1.0" encoding="utf-8"?>
Load Python libraries and setup logging.
import pya
import pya as db
import sys
import importlib
# Test if the klayout-pnr Python package can be found.
import kpnr
except ImportError as e:
python_version = sys.version[0:3]
pya.MessageBox.warning("Error", """`klayout-pnr` python module not installed (or not in the required version).
Please install with:
git clone
cd klayout-pnr
python{} develop --user
""".format(python_version), pya.MessageBox.Ok)
from liberty.parser import parse_liberty
from typing import Dict, List, Tuple
from kpnr.placer.quadratic_placer import QuadraticPlacer
from kpnr.placer.quadratic_placer_with_density_penalty import QuadraticDensityPlacer
from kpnr.legalizer.tetris import TetrisLegalizer
from kpnr.legalizer.annealing_legalizer import AnnealingLegalizer
from kpnr.netlist.verilog_reader import VerilogNetlistReader
from kpnr.netlist.liberty_reader import LibertyNetlistReader
from kpnr.test_data import *
from kpnr.netlist import util as net_util
from kpnr.layout import pin_detection
from kpnr.layout import polygon_label
from kpnr.simple_design import SimpleDesign
import math
import itertools
import collections
import os
import logging
import numpy as np
# Set up logging.
# Setup logger if it does not yet exist.
logger = logging.getLogger(__name__)
handler = logging.StreamHandler(sys.stdout)
handler.setFormatter(logging.Formatter(fmt='%(module)s %(levelname)s\t%(message)s'))