diff --git a/src/function/sim/simulate.ts b/src/function/sim/simulate.ts index 7bce328..049b4eb 100644 --- a/src/function/sim/simulate.ts +++ b/src/function/sim/simulate.ts @@ -370,9 +370,9 @@ class IcarusSimulate extends Simulate { const generateVvpName = hdlModule.name + '.vvp'; const outVvpPath = hdlPath.join(simConfig.simulationHome, generateVvpName); - MainOutput.report(t('info.simulation.create-vvp', outVvpPath), { - level: ReportType.Run - }); + // MainOutput.report(t('info.simulation.create-vvp', outVvpPath), { + // level: ReportType.Run + // }); const vvpPath = simConfig.vvpPath; @@ -382,7 +382,7 @@ class IcarusSimulate extends Simulate { const vvpCwd = opeParam.openMode === 'file' ? cwd: opeParam.workspacePath; const vvpCommand = `${vvpPath} ${outVvpPath}`; - MainOutput.report(vvpCommand, { level: ReportType.Run }); + // MainOutput.report(vvpCommand, { level: ReportType.Run }); this.runVvp(vvpCommand, vvpCwd); }); @@ -427,7 +427,7 @@ class IcarusSimulate extends Simulate { if (match) { const vcdPath = match[1]; const absVcdPath = hdlPath.resolve(cwd, vcdPath); - MainOutput.report(t('info.simulate.vvp.vcd-generate', absVcdPath)); + MainOutput.report(t('info.simulate.vvp.vcd-generate', absVcdPath), { level: ReportType.Finish }); } else { MainOutput.report(line.slice(9).trim()); } @@ -448,7 +448,10 @@ class IcarusSimulate extends Simulate { MainOutput.report(line.slice(10).trim(), { level: ReportType.Error }); } } else { - MainOutput.report(line, { level: ReportType.Info }); + const displayMessage = line.trim(); + if (displayMessage) { + MainOutput.report(displayMessage, { level: ReportType.PrintOuput}); + } } } } @@ -489,7 +492,7 @@ class IcarusSimulate extends Simulate { // return; // } - const dependences = this.getAllOtherDependences(path, name); + const dependences = this.getAllOtherDependences(path, name); const simulationCommand = this.getCommand(name, path, dependences); if (simulationCommand) { const cwd = hdlPath.resolve(path, '..'); diff --git a/src/global/outputChannel.ts b/src/global/outputChannel.ts index d6499f6..66fe85d 100644 --- a/src/global/outputChannel.ts +++ b/src/global/outputChannel.ts @@ -33,7 +33,15 @@ enum ReportType { /** * 某些功能或者子进程在运行中产出的信息 */ - Run = 'Run' + Run = 'Run', + /** + * 展示程序的输出 + */ + PrintOuput = 'PrintOutput', + /** + * 代表程序的结束 + */ + Finish = 'Finish' }; interface ReportOption { @@ -96,13 +104,24 @@ class Output { option = option || { level: ReportType.Info, notify: false } as ReportOption; const level = option.level || ReportType.Info; const notify = option.notify || false; - + if (!this.skipMessage(level) && message) { const currentTime = this.getCurrentTime(); - this._output.appendLine('[' + level + ' - ' + currentTime + '] ' + message); - if (notify) { - this.showInWindows('' + message, level); + switch (option.level) { + case ReportType.PrintOuput: + this._output.appendLine(message.toString()); + break; + case ReportType.Finish: + this._output.appendLine('\n[' + level + ' - ' + currentTime + '] ' + message); + break; + + default: + this._output.appendLine('[' + level + ' - ' + currentTime + '] ' + message); + if (notify) { + this.showInWindows('' + message, level); + } + break; } } } diff --git a/src/hdlParser/core.ts b/src/hdlParser/core.ts index 93d0ac9..52fc71a 100644 --- a/src/hdlParser/core.ts +++ b/src/hdlParser/core.ts @@ -480,6 +480,8 @@ class HdlParam { return; } + console.log('fast:', fast); + // 1. 更新 macro moduleFile.updateMacro(fast.macro); diff --git a/syntaxes/digital-ide-output.json b/syntaxes/digital-ide-output.json index 13a59d0..e3dc672 100644 --- a/syntaxes/digital-ide-output.json +++ b/syntaxes/digital-ide-output.json @@ -71,6 +71,21 @@ } } }, + { + "name": "digital-ide.Finish", + "match": "^(\\[Finish - (.*?)\\])(.*)", + "captures": { + "1": { + "name": "token.warn-token" + }, + "2": { + "name": "string" + }, + "3": { + "name": "token.warn-token" + } + } + }, { "name": "digital-ide.Launch", "match": "^(\\[Launch - (.*?)\\])([\\s\\S]*)",