mirror of https://github.com/openXC7/prjxray.git
timfuz: fix ZERO removal support
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
parent
06d47dcb5e
commit
7fd5e77935
|
|
@ -46,15 +46,17 @@ def gen_flat(fns_in, sub_json, corner=None):
|
|||
# should they be fixed 0?
|
||||
if zero_row:
|
||||
print('zero_row', len(group_zeros), len(violations))
|
||||
for zero in sub_json['zero_names']:
|
||||
yield zero, zero_row
|
||||
for zero in group_zeros - violations:
|
||||
print('zero', zero)
|
||||
yield zero, zero_row
|
||||
|
||||
|
||||
def run(fns_in, fnout, sub_json, corner=None, verbose=False):
|
||||
with open(fnout, 'w') as fout:
|
||||
fout.write('ico,fast_max fast_min slow_max slow_min,rows...\n')
|
||||
for name, corners in sorted(list(gen_flat(fns_in, sub_json, corner=corner))):
|
||||
for name, corners in sorted(list(gen_flat(fns_in, sub_json,
|
||||
corner=corner))):
|
||||
row_ico = 1
|
||||
items = [str(row_ico), corners2csv(corners)]
|
||||
items.append('%u %s' % (1, name))
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import sympy
|
|||
from collections import OrderedDict
|
||||
from fractions import Fraction
|
||||
|
||||
|
||||
def rm_zero_cols(Ads, verbose=True):
|
||||
removed = OrderedSet()
|
||||
|
||||
|
|
@ -24,6 +25,7 @@ def rm_zero_cols(Ads, verbose=True):
|
|||
print(' Removing %s' % k)
|
||||
return removed
|
||||
|
||||
|
||||
def fracr_quick(r):
|
||||
return [Fraction(numerator=int(x), denominator=1) for x in r]
|
||||
|
||||
|
|
@ -34,6 +36,7 @@ def fracm_quick(m):
|
|||
print('fracm_quick type: %s' % t)
|
||||
return [fracr_quick(r) for r in m]
|
||||
|
||||
|
||||
class State(object):
|
||||
def __init__(self, Ads, zero_names=[]):
|
||||
self.Ads = Ads
|
||||
|
|
@ -193,7 +196,8 @@ def run(fnout, fn_ins, simplify=False, corner=None, rm_zero=False, verbose=0):
|
|||
print('Loading data')
|
||||
|
||||
assert len(fn_ins) > 0
|
||||
state = State.load(fn_ins, simplify=simplify, corner=corner, rm_zero=rm_zero)
|
||||
state = State.load(
|
||||
fn_ins, simplify=simplify, corner=corner, rm_zero=rm_zero)
|
||||
state_rref(state, verbose=verbose)
|
||||
state.print_stats()
|
||||
if fnout:
|
||||
|
|
@ -212,7 +216,8 @@ def main():
|
|||
parser.add_argument('--verbose', action='store_true', help='')
|
||||
parser.add_argument('--simplify', action='store_true', help='')
|
||||
parser.add_argument('--corner', default="slow_max", help='')
|
||||
parser.add_argument('--rm-zero', action='store_true', help='Remove ZERO elements')
|
||||
parser.add_argument(
|
||||
'--rm-zero', action='store_true', help='Remove ZERO elements')
|
||||
parser.add_argument(
|
||||
'--speed-json',
|
||||
default='build_speed/speed.json',
|
||||
|
|
|
|||
|
|
@ -142,7 +142,8 @@ def run_corner(
|
|||
print('Delay on %d / %d' % (nonzeros, len(res.x)))
|
||||
|
||||
if outfn:
|
||||
timfuz_solve.solve_save(outfn, res.x, names, corner, verbose=verbose)
|
||||
timfuz_solve.solve_save(
|
||||
outfn, res.x, names, corner, verbose=verbose)
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
|||
|
|
@ -910,6 +910,7 @@ def tilej_stats(tilej):
|
|||
' %s: %u / %u solved, %u / %u covered' %
|
||||
(etype, solved, net, covered, net))
|
||||
|
||||
|
||||
def load_bounds(bounds_csv, corner, ico=True):
|
||||
Ads, b = loadc_Ads_b([bounds_csv], corner, ico=ico)
|
||||
return Ads2bounds(Ads, b)
|
||||
|
|
|
|||
Loading…
Reference in New Issue