优化一键仿真

This commit is contained in:
锦恢 2025-01-05 17:35:03 +08:00
parent a143ec8573
commit cff21c2572
4 changed files with 51 additions and 12 deletions

View File

@ -370,9 +370,9 @@ class IcarusSimulate extends Simulate {
const generateVvpName = hdlModule.name + '.vvp'; const generateVvpName = hdlModule.name + '.vvp';
const outVvpPath = hdlPath.join(simConfig.simulationHome, generateVvpName); const outVvpPath = hdlPath.join(simConfig.simulationHome, generateVvpName);
MainOutput.report(t('info.simulation.create-vvp', outVvpPath), { // MainOutput.report(t('info.simulation.create-vvp', outVvpPath), {
level: ReportType.Run // level: ReportType.Run
}); // });
const vvpPath = simConfig.vvpPath; const vvpPath = simConfig.vvpPath;
@ -382,7 +382,7 @@ class IcarusSimulate extends Simulate {
const vvpCwd = opeParam.openMode === 'file' ? cwd: opeParam.workspacePath; const vvpCwd = opeParam.openMode === 'file' ? cwd: opeParam.workspacePath;
const vvpCommand = `${vvpPath} ${outVvpPath}`; const vvpCommand = `${vvpPath} ${outVvpPath}`;
MainOutput.report(vvpCommand, { level: ReportType.Run }); // MainOutput.report(vvpCommand, { level: ReportType.Run });
this.runVvp(vvpCommand, vvpCwd); this.runVvp(vvpCommand, vvpCwd);
}); });
@ -427,7 +427,7 @@ class IcarusSimulate extends Simulate {
if (match) { if (match) {
const vcdPath = match[1]; const vcdPath = match[1];
const absVcdPath = hdlPath.resolve(cwd, vcdPath); 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 { } else {
MainOutput.report(line.slice(9).trim()); MainOutput.report(line.slice(9).trim());
} }
@ -448,7 +448,10 @@ class IcarusSimulate extends Simulate {
MainOutput.report(line.slice(10).trim(), { level: ReportType.Error }); MainOutput.report(line.slice(10).trim(), { level: ReportType.Error });
} }
} else { } else {
MainOutput.report(line, { level: ReportType.Info }); const displayMessage = line.trim();
if (displayMessage) {
MainOutput.report(displayMessage, { level: ReportType.PrintOuput});
}
} }
} }
} }

View File

@ -33,7 +33,15 @@ enum ReportType {
/** /**
* *
*/ */
Run = 'Run' Run = 'Run',
/**
*
*/
PrintOuput = 'PrintOutput',
/**
*
*/
Finish = 'Finish'
}; };
interface ReportOption { interface ReportOption {
@ -99,11 +107,22 @@ class Output {
if (!this.skipMessage(level) && message) { if (!this.skipMessage(level) && message) {
const currentTime = this.getCurrentTime(); const currentTime = this.getCurrentTime();
this._output.appendLine('[' + level + ' - ' + currentTime + '] ' + message);
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) { if (notify) {
this.showInWindows('' + message, level); this.showInWindows('' + message, level);
} }
break;
}
} }
} }

View File

@ -480,6 +480,8 @@ class HdlParam {
return; return;
} }
console.log('fast:', fast);
// 1. 更新 macro // 1. 更新 macro
moduleFile.updateMacro(fast.macro); moduleFile.updateMacro(fast.macro);

View File

@ -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", "name": "digital-ide.Launch",
"match": "^(\\[Launch - (.*?)\\])([\\s\\S]*)", "match": "^(\\[Launch - (.*?)\\])([\\s\\S]*)",