diff --git a/digital-netlist-render b/digital-netlist-render new file mode 160000 index 0000000..f148e9a --- /dev/null +++ b/digital-netlist-render @@ -0,0 +1 @@ +Subproject commit f148e9a24fbafd144c3961b36ebd6c3266335beb diff --git a/l10n/bundle.l10n.de.json b/l10n/bundle.l10n.de.json index 752db82..6414d43 100644 --- a/l10n/bundle.l10n.de.json +++ b/l10n/bundle.l10n.de.json @@ -100,5 +100,9 @@ "info.netlist.launch-netlist": "Netlist wird gestartet", "info.netlist.not-found-payload": "Die Lastressource des Netlists konnte nicht gefunden werden. Bitte überprüfen Sie, ob das Installationsverzeichnis beschädigt ist!", "info.netlist.not-support-vhdl": "Das aktuelle Netlist unterstützt vorübergehend kein VHDL und andere Sprachen!", - "info.netlist.generate-network": "Netzwerktopologie wird generiert" + "info.netlist.generate-network": "Netzwerktopologie wird generiert", + "error.cannot-gen-netlist": "Netlist-Datei konnte nicht generiert werden!", + "info.common.confirm": "Bestätigen", + "info.command.structure.reload-vscode": "Vscode neu starten", + "error.look-up-log": "Fehlerprotokoll anzeigen" } \ No newline at end of file diff --git a/l10n/bundle.l10n.en.json b/l10n/bundle.l10n.en.json index 2d2eb9b..95e7c19 100644 --- a/l10n/bundle.l10n.en.json +++ b/l10n/bundle.l10n.en.json @@ -100,5 +100,9 @@ "info.netlist.launch-netlist": "Starting Netlist", "info.netlist.not-found-payload": "Unable to find the load resource of the netlist, please check if the installation directory is corrupted!", "info.netlist.not-support-vhdl": "The current netlist temporarily does not support VHDL and other languages!", - "info.netlist.generate-network": "Generating network topology" + "info.netlist.generate-network": "Generating network topology", + "error.cannot-gen-netlist": "Unable to generate Netlist file!", + "info.common.confirm": "Confirm", + "info.command.structure.reload-vscode": "Restart Vscode", + "error.look-up-log": "View error log" } \ No newline at end of file diff --git a/l10n/bundle.l10n.ja.json b/l10n/bundle.l10n.ja.json index 7257a47..a3b9a9a 100644 --- a/l10n/bundle.l10n.ja.json +++ b/l10n/bundle.l10n.ja.json @@ -100,5 +100,9 @@ "info.netlist.launch-netlist": "Netlistを起動中", "info.netlist.not-found-payload": "ネットリストのロードリソースが見つかりません。インストールディレクトリが破損していないか確認してください!", "info.netlist.not-support-vhdl": "現在のネットリストは一時的にVHDLやその他の言語をサポートしていません!", - "info.netlist.generate-network": "ネットワークトポロジを生成中" + "info.netlist.generate-network": "ネットワークトポロジを生成中", + "error.cannot-gen-netlist": "ネットリストファイルを生成できません!", + "info.common.confirm": "確認", + "info.command.structure.reload-vscode": "Vscodeを再起動", + "error.look-up-log": "エラーログを表示" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-cn.json b/l10n/bundle.l10n.zh-cn.json index 4176b2e..81e7538 100644 --- a/l10n/bundle.l10n.zh-cn.json +++ b/l10n/bundle.l10n.zh-cn.json @@ -100,5 +100,9 @@ "info.netlist.launch-netlist": "正在启动 Netlist", "info.netlist.not-found-payload": "无法找到 netlist 的负载资源,请检查安装目录是否损坏!", "info.netlist.not-support-vhdl": "当前 netlist 暂时不支持 VHDL 和其他语言!", - "info.netlist.generate-network": "正在生成网络拓扑" + "info.netlist.generate-network": "正在生成网络拓扑", + "error.cannot-gen-netlist": "无法生成 Netlist 文件!", + "info.common.confirm": "确认", + "info.command.structure.reload-vscode": "重启 Vscode", + "error.look-up-log": "查看错误日志" } \ No newline at end of file diff --git a/l10n/bundle.l10n.zh-tw.json b/l10n/bundle.l10n.zh-tw.json index 2f4a3e8..0b1209d 100644 --- a/l10n/bundle.l10n.zh-tw.json +++ b/l10n/bundle.l10n.zh-tw.json @@ -100,5 +100,9 @@ "info.netlist.launch-netlist": "正在啟動Netlist", "info.netlist.not-found-payload": "無法找到 netlist 的負載資源,請檢查安裝目錄是否損壞!", "info.netlist.not-support-vhdl": "當前 netlist 暫時不支援 VHDL 和其他語言!", - "info.netlist.generate-network": "正在生成網路拓撲" + "info.netlist.generate-network": "正在生成網路拓撲", + "error.cannot-gen-netlist": "無法生成Netlist檔案!", + "info.common.confirm": "確認", + "info.command.structure.reload-vscode": "重啟 Vscode", + "error.look-up-log": "查看錯誤日誌" } \ No newline at end of file diff --git a/package.json b/package.json index deeb701..00ea4a0 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "l10n": "./l10n", "icon": "images/icon.png", "engines": { - "vscode": "^1.95.0" + "vscode": "^1.94.0" }, "keywords": [ "FPGA Develop Support", diff --git a/src/function/dide-netlist/index.ts b/src/function/dide-netlist/index.ts index 5d05994..9b5dd67 100644 --- a/src/function/dide-netlist/index.ts +++ b/src/function/dide-netlist/index.ts @@ -83,6 +83,10 @@ class Netlist { const wasm = this.wasm; const wasi = this.makeWasi(targetYs); + const netlistPayloadFolder = hdlPath.join(opeParam.prjInfo.prjPath, 'netlist'); + const targetJson = hdlPath.join(netlistPayloadFolder, moduleName + '.json'); + hdlFile.rmSync(targetJson); + await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: t('info.netlist.generate-network'), @@ -94,6 +98,19 @@ class Netlist { const exitCode = wasi.start(instance); }); + if (!fs.existsSync(targetJson)) { + const logFilePath = hdlPath.join(opeParam.prjInfo.prjPath, 'netlist', 'netlist.log'); + const res = await vscode.window.showErrorMessage( + t('error.cannot-gen-netlist'), + { title: t('error.look-up-log'), value: true } + ) + if (res?.value) { + const document = await vscode.workspace.openTextDocument(vscode.Uri.file(logFilePath)); + await vscode.window.showTextDocument(document); + } + return; + } + this.create(moduleName); } @@ -145,10 +162,9 @@ class Netlist { private makeWasi(target: string) { // 创建日志文件路径 - // const logFilePath = hdlPath.join(opeParam.workspacePath, 'wasi_log.txt'); - // hdlFile.removeFile(logFilePath); - // 创建可写流,将标准输出和标准错误重定向到日志文件 - // const logFd = fs.openSync(logFilePath, 'a'); + const logFilePath = hdlPath.join(opeParam.prjInfo.prjPath, 'netlist', 'netlist.log'); + hdlFile.removeFile(logFilePath); + const logFd = fs.openSync(logFilePath, 'a'); return new WASI({ version: 'preview1', @@ -164,7 +180,7 @@ class Netlist { }, stdin: process.stdin.fd, stdout: process.stdout.fd, - stderr: process.stderr.fd, + stderr: logFd, // stdout: logFd, // stderr: logFd, env: process.env