| #-------------------------------------------------------------------- |
| # Workaround for the problem that xyce does not ignore ACM model |
| # parameters passed to bsim3 models, and throws an error. These |
| # parameters have no known effect on simulation and therefore |
| #-------------------------------------------------------------------- |
| plist = ["ldif", "hdif", "rd", "rs", "rsc", "rdc", "nqsmod"] |
| regexps.append(re.compile('^\+[ \t]*' + parm + '[ \t]*=[ \t]*0.0', re.IGNORECASE)) |
| print('Usage: xyce_hack2.py <path_to_file>') |
| infile_name = sys.argv[1] |
| filepath = os.path.split(infile_name)[0] |
| outfile_name = os.path.join(filepath, 'temp') |
| infile = open(infile_name, 'r') |
| outfile = open(outfile_name, 'w') |
| replaced_something = False |
| # If a match is found, comment out the line. |
| replaced_something = True |
| newline = re.sub('^\+', '* +', line) |
| print("Something was replaced in '{}'".format(infile_name)) |
| os.rename(outfile_name, infile_name) |
| print("Nothing was replaced in '{}'.".format(infile_name)) |