Added support for "input" and "output" classes. Signed-off-by: Maciej Kurc <mkurc@antmicro.com>
diff --git a/v2x/vlog_to_model.py b/v2x/vlog_to_model.py index 0a0a7dc..faf2444 100755 --- a/v2x/vlog_to_model.py +++ b/v2x/vlog_to_model.py
@@ -162,7 +162,7 @@ ), "Leaf model names should be all uppercase!" modclass = tmod.attr("CLASS", "") - if modclass not in ("lut", "routing", "flipflop"): + if modclass not in ("input", "output", "lut", "routing", "flipflop"): model_xml = ET.SubElement(models_xml, "model", {'name': topname}) ports = tmod.ports
diff --git a/v2x/vlog_to_pbtype.py b/v2x/vlog_to_pbtype.py index 66f100e..8164c63 100755 --- a/v2x/vlog_to_pbtype.py +++ b/v2x/vlog_to_pbtype.py
@@ -9,8 +9,8 @@ This will also set the BLIF model to be `.subckt <name>` unless CLASS is also specified. - - `(* CLASS="lut|routing|mux|flipflop|mem" *)` : specify the class of an - given instance. + - `(* CLASS="input|output|lut|routing|mux|flipflop|mem" *)` : specify + the class of an given instance. - `(* MODES="mode1; mode2; ..." *)` : specify that the module has more than one functional mode, each with a given name. The module will be @@ -715,7 +715,11 @@ ), "Model name should be uppercase. {}".format(model_name) mod_cls = mod.CLASS if mod_cls is not None: - if mod_cls == "lut": + if mod_cls == "input": + pb_attrs["blif_model"] = ".input" + elif mod_cls == "output": + pb_attrs["blif_model"] = ".output" + elif mod_cls == "lut": pb_attrs["blif_model"] = ".names" pb_attrs["class"] = "lut" elif mod_cls == "routing":