优化一键仿真

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 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, '..');

View File

@ -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;
}
}
}

View File

@ -480,6 +480,8 @@ class HdlParam {
return;
}
console.log('fast:', fast);
// 1. 更新 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",
"match": "^(\\[Launch - (.*?)\\])([\\s\\S]*)",