From: Daniel Kirschten Date: Sun, 5 Jan 2020 22:40:32 +0000 (+0100) Subject: VerilogExporter: Fixed serializing components without params X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=1ba2964fff70dc12a24084e027488d17c3924706;p=Mograsim.git VerilogExporter: Fixed serializing components without params --- diff --git a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java index 1f9c72f0..e5c24435 100644 --- a/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java +++ b/plugins/net.mograsim.logic.model.am2900/src/net/mograsim/logic/model/examples/VerilogExporter.java @@ -18,6 +18,7 @@ import java.util.Set; import java.util.stream.Collectors; import com.google.gson.JsonElement; +import com.google.gson.JsonNull; import net.mograsim.logic.model.am2900.Am2900Loader; import net.mograsim.logic.model.model.LogicModelModifiable; @@ -420,7 +421,8 @@ public class VerilogExporter } result.append(COMPONENT_PREFIX); - result.append(sanitizeVerilog(subcomponentID + subcomponentParams.params)); + String paramsString = subcomponentParams.params == JsonNull.INSTANCE ? "" : subcomponentParams.params.toString(); + result.append(sanitizeVerilog(subcomponentID + paramsString)); result.append(" ("); for (int i = 0; i < subcomponentInterfacePinNames.size(); i++) {