diff --git a/bin/verilator_profcfunc b/bin/verilator_profcfunc index dabd8af97a7..51ed57a5826 100755 --- a/bin/verilator_profcfunc +++ b/bin/verilator_profcfunc @@ -135,8 +135,7 @@ def profcfunc(filename): design_width = 1 for func, func_item in vfuncs.items(): - if design_width < len(func_item['design']): - design_width = len(func_item['design']) + design_width = max(design_width, len(func_item['design'])) print("Verilog code profile:") print(" These are split into three categories:") diff --git a/src/astgen b/src/astgen index 70aa3941cfb..8a4dbdb3cf6 100755 --- a/src/astgen +++ b/src/astgen @@ -852,6 +852,10 @@ def write_type_tests(prefix, nodeList): base = "DfgVertex" variable = "vtxp" enum = "VDfgType" + else: + base = None + variable = None + enum = None for node in nodeList: fh.write( "template<> inline bool {b}::privateTypeTest<{p}{n}>(const {b}* {v}) {{ ".format( diff --git a/src/bisonpre b/src/bisonpre index e684256eac1..b330c3d7b6e 100755 --- a/src/bisonpre +++ b/src/bisonpre @@ -11,11 +11,26 @@ import sys ###################################################################### +def bison_version_check(): + with subprocess.Popen(Args.yacc + " --version", shell=True, stdout=subprocess.PIPE) as sp: + out = str(sp.stdout.read()) + match = re.search(r'([0-9]+\.[0-9]+)', out) + if match: + v = float(match.group(1)) + if v < 1.875: + sys.exit("bisonpre: %Error: '" + Args.yacc + "' is version " + v + + "; version 1.875 or newer is required\n") + return v + + sys.exit("bisonpre: %Error: '" + Args.yacc + "' is not installed, or not working\n") + + +Bison_Version = bison_version_check() + def process(): unlink_outputs() - bison_version_check() supports_report = Bison_Version >= 2.3 # supports_counter_examples = Bison_Version >= 3.8 @@ -84,22 +99,6 @@ def unlink_outputs(): # We don't remove .output file, as it's useful for debugging errors -def bison_version_check(): - with subprocess.Popen(Args.yacc + " --version", shell=True, stdout=subprocess.PIPE) as sp: - out = str(sp.stdout.read()) - match = re.search(r'([0-9]+\.[0-9]+)', out) - if match: - v = float(match.group(1)) - if v < 1.875: - sys.exit("bisonpre: %Error: '" + Args.yacc + "' is version " + v + - "; version 1.875 or newer is required\n") - global Bison_Version # pylint: disable=global-variable-undefined - Bison_Version = v - return - - sys.exit("bisonpre: %Error: '" + Args.yacc + "' is not installed, or not working\n") - - def clean_output(filename, outname, is_output, is_c): print(" edit " + filename + " " + outname)