v2x: Check input values are uppercase. Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
diff --git a/vlog_to_model.py b/vlog_to_model.py index 0667eab..72ddfa8 100755 --- a/vlog_to_model.py +++ b/vlog_to_model.py
@@ -188,6 +188,8 @@ else: # Is a leaf model topname = tmod.attr("MODEL_NAME", top) + assert topname == topname.upper( + ), "Leaf model names should be all uppercase!" modclass = tmod.attr("CLASS", "") if modclass not in ("lut", "routing", "flipflop"):
diff --git a/vlog_to_pbtype.py b/vlog_to_pbtype.py index 1a82693..cbbbc2a 100755 --- a/vlog_to_pbtype.py +++ b/vlog_to_pbtype.py
@@ -365,6 +365,8 @@ if modes is not None: modes = modes.split(";") mod_pname = mod_pb_name(mod) + assert mod_pname == mod_pname.upper( + ), "pb_type name should be all uppercase. {}".format(mod_pname) pb_xml_attrs = dict() pb_xml_attrs["name"] = mod_pname @@ -375,6 +377,9 @@ print("is_blackbox", is_blackbox, "has_modes?", has_modes) # Process type and class of module + model_name = mod.attr("MODEL_NAME", mod.name) + assert model_name == model_name.upper( + ), "Model name should be uppercase. {}".format(model_name) mod_cls = mod.CLASS if mod_cls is not None: if mod_cls == "lut": @@ -392,8 +397,7 @@ else: assert False, "unknown class {}".format(mod_cls) elif is_blackbox and not has_modes: - pb_xml_attrs["blif_model" - ] = ".subckt " + mod.attr("MODEL_NAME", mod.name) + pb_xml_attrs["blif_model"] = ".subckt " + model_name # set num_pb to 1, it will be updated if this pb_type # will be included by another one @@ -503,6 +507,9 @@ ) sys.exit(1) + assert top == top.upper( + ), "Top module name should be all uppercase. {}".format(top) + tmod = yj.module(top) pb_type_xml = make_pb_type(yj, tmod)