Added check to pdriver for 0 fanout which can break compute_sizes.

This commit is contained in:
Hunter Nichols 2019-04-03 17:53:28 -07:00
parent edac60d2a8
commit 1438519495
1 changed files with 3 additions and 1 deletions

View File

@ -11,7 +11,7 @@ class pdriver(pgate.pgate):
"""
This instantiates an even or odd number of inverters sized for driving a load.
"""
def __init__(self, name, neg_polarity=False, fanout=1, size_list=None, height=None):
def __init__(self, name, neg_polarity=False, fanout=0, size_list=None, height=None):
self.stage_effort = 3
self.height = height
@ -19,6 +19,8 @@ class pdriver(pgate.pgate):
self.size_list = size_list
self.fanout = fanout
if size_list == None and self.fanout == 0:
debug.error("Either fanout or size list must be specified.", -1)
if self.size_list and self.fanout != 0:
debug.error("Cannot specify both size_list and fanout.", -1)
if self.size_list and self.neg_polarity: