From 6a7e2d257217f899710d89e1cabc5d298545ba45 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Wed, 20 Nov 2024 20:36:29 -0800 Subject: [PATCH] Beginnings of UPF support --- frontends/verific/verific.cc | 70 ++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/frontends/verific/verific.cc b/frontends/verific/verific.cc index 037c622bb..140926a51 100644 --- a/frontends/verific/verific.cc +++ b/frontends/verific/verific.cc @@ -72,6 +72,11 @@ USING_YOSYS_NAMESPACE #include "SynlibGroup.h" #endif +#ifdef VERIFIC_UPF_SUPPORT +#include "upf_file.h" +#include "UpfRuntimeFlags.h" +#endif + #include "VerificStream.h" #include "FileSystem.h" @@ -1289,6 +1294,49 @@ bool VerificImporter::import_netlist_instance_cells(Instance *inst, RTLIL::IdStr return true; } +#ifdef VERIFIC_UPF_SUPPORT + if (inst->Type() == PRIM_UPF_POWER_SWITCH) + { + log("TODO: PRIM_UPF_POWER_SWITCH\n"); + return true; + } + if (inst->Type() == PRIM_UPF_RETENTION_DLATCH) + { + log("TODO: PRIM_UPF_RETENTION_DLATCH\n"); + return true; + } + if (inst->Type() == PRIM_UPF_RETENTION_DLATCHRS) + { + log("TODO: PRIM_UPF_RETENTION_DLATCHRS\n"); + return true; + } + if (inst->Type() == PRIM_UPF_RETENTION_DFF) + { + log("TODO: PRIM_UPF_RETENTION_DFF\n"); + return true; + } + if (inst->Type() == PRIM_UPF_RETENTION_DFFRS) + { + log("TODO: PRIM_UPF_RETENTION_DFFRS\n"); + return true; + } + if (inst->Type() == PRIM_UPF_ISOLATION) + { + log("TODO: PRIM_UPF_ISOLATION\n"); + return true; + } + if (inst->Type() == PRIM_UPF_LEVEL_SHIFTER) + { + log("TODO: PRIM_UPF_LEVEL_SHIFTER\n"); + return true; + } + if (inst->Type() == PRIM_UPF_REPEATER) + { + log("TODO: PRIM_UPF_REPEATER\n"); + return true; + } +#endif + #ifdef YOSYSHQ_VERIFIC_API_VERSION if (inst->Type() == OPER_YOSYSHQ_SET_TAG) { @@ -2961,6 +3009,10 @@ std::string verific_import(Design *design, const std::map..\n"); + log("\n"); + log("Load the specified UPF files into IMPORT.\n"); + log("\n"); + log("\n"); +#endif #ifdef VERIFIC_SYSTEMVERILOG_SUPPORT log(" import {-f|-F} [-vlog95|-vlog2k|-sv2005|-sv2009|\n"); log(" -sv2012|-sv|-formal] \n"); @@ -3695,6 +3754,17 @@ struct VerificPass : public Pass { goto check_error; } +#ifdef VERIFIC_UPF_SUPPORT + if (GetSize(args) > argidx && (args[argidx] == "-upf")) { + if (++argidx >= GetSize(args)) + log_cmd_error("Missing UPF file name.\n"); + const char *top = args[argidx].c_str(); + for (argidx++; argidx < GetSize(args); argidx++) + upf_file::Analyze(args[argidx].c_str(), top); + goto check_error; + } +#endif + if (GetSize(args) > argidx && (args[argidx] == "-f" || args[argidx] == "-F" || args[argidx] == "-FF")) { unsigned verilog_mode = veri_file::SYSTEM_VERILOG;