执行 0.4.0 第二轮迭代测试

This commit is contained in:
锦恢 2024-12-02 00:30:09 +08:00
parent 1b5f821f38
commit f6d6f47b62
7 changed files with 39 additions and 15 deletions

View File

@ -75,7 +75,7 @@ function instanceVhdlCode(module: HdlModule) {
instContent += `generic map(\n${param})\n`; instContent += `generic map(\n${param})\n`;
} }
instContent += `port map(\n${port});\n`; instContent += `port map(\n${port.trim()}\n);\n`;
return instContent; return instContent;
} }

View File

@ -207,7 +207,7 @@ class IcarusSimulate extends Simulate {
continue; continue;
} }
// icarus 不支持 IP // icarus 不支持 IP
if (dep.startsWith(opeParam.prjInfo.ipPath)) { if (opeParam.prjInfo.ipPath.length > 0 && dep.startsWith(opeParam.prjInfo.ipPath)) {
MainOutput.report(t('error.simluate.icarus.use-ip', dep), { level: ReportType.Error }); MainOutput.report(t('error.simluate.icarus.use-ip', dep), { level: ReportType.Error });
continue; continue;
} }

View File

@ -156,7 +156,21 @@ function exportFilelist(view: ModuleDataItem) {
deps.others.forEach(path => fileset.add(path)); deps.others.forEach(path => fileset.add(path));
deps.include.forEach(path => fileset.add(path)); deps.include.forEach(path => fileset.add(path));
const filelist = [view.path]; const filelist = [view.path];
filelist.push(...fileset);
for (const dep of fileset) {
// 去除其中的原语
if (dep === 'xilinx-primitives') {
continue;
}
// 去除其中的 IP 文件
if (opeParam.prjInfo.ipPath.length > 0 && dep.startsWith(opeParam.prjInfo.ipPath)) {
continue;
}
filelist.push(dep);
}
askUserToSaveFilelist(filelist); askUserToSaveFilelist(filelist);
} else { } else {
vscode.window.showErrorMessage('fail to get deps of view ' + view.name); vscode.window.showErrorMessage('fail to get deps of view ' + view.name);

View File

@ -10,7 +10,6 @@ import { getIconConfig } from '../../hdlFs/icons';
import { DoFastFileType } from '../../global/lsp'; import { DoFastFileType } from '../../global/lsp';
import { t } from '../../i18n'; import { t } from '../../i18n';
let needExpand = true;
interface ModuleDataItem { interface ModuleDataItem {
icon: string, // 图标 icon: string, // 图标
@ -118,11 +117,14 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
let collapsibleState; let collapsibleState;
if (!expandable) { if (!expandable) {
collapsibleState = vscode.TreeItemCollapsibleState.None; collapsibleState = vscode.TreeItemCollapsibleState.None;
} else if (needExpand) { } else {
// 默认只让 src 和 sim 展开
if (element.parent === undefined) {
collapsibleState = vscode.TreeItemCollapsibleState.Expanded; collapsibleState = vscode.TreeItemCollapsibleState.Expanded;
} else { } else {
collapsibleState = vscode.TreeItemCollapsibleState.Collapsed; collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
} }
}
const treeItem = new vscode.TreeItem(itemName, collapsibleState); const treeItem = new vscode.TreeItem(itemName, collapsibleState);
// set contextValue file -> simulate / netlist // set contextValue file -> simulate / netlist

View File

@ -314,7 +314,7 @@ class HdlParam {
for (const p of pools) { for (const p of pools) {
const increment = Math.floor(p.id / fileNum * 100); const increment = Math.floor(p.id / fileNum * 100);
await p.promise; await p.promise;
console.log("handle id " + p.id + ' increment: ' + increment); // console.log("handle id " + p.id + ' increment: ' + increment);
progress?.report({ message: reportTitle + ` ${p.id}/${fileNum}`, increment }); progress?.report({ message: reportTitle + ` ${p.id}/${fileNum}`, increment });
} }
pools.length = 0; pools.length = 0;
@ -351,7 +351,7 @@ class HdlParam {
for (const p of pools) { for (const p of pools) {
const increment = Math.floor(p.id / fileNum * 100); const increment = Math.floor(p.id / fileNum * 100);
await p.promise; await p.promise;
console.log("handle id " + p.id + ' increment: ' + increment); // console.log("handle id " + p.id + ' increment: ' + increment);
progress?.report({ message: reportTitle + ` ${p.id}/${fileNum}`, increment }); progress?.report({ message: reportTitle + ` ${p.id}/${fileNum}`, increment });
} }
pools.length = 0; pools.length = 0;
@ -454,14 +454,15 @@ class HdlParam {
public updateFast(path: string, fast: common.Fast) { public updateFast(path: string, fast: common.Fast) {
const moduleFile = this.getHdlFile(path); const moduleFile = this.getHdlFile(path);
if (moduleFile === undefined) { if (moduleFile === undefined) {
return; return;
} }
// 1. update marco directly // 1. 更新 macro
moduleFile.updateMacro(fast.macro); moduleFile.updateMacro(fast.macro);
// 2. update modules one by one // 2. 增量更新所有 module
const uncheckedModuleNames = new Set<string>(); const uncheckedModuleNames = new Set<string>();
for (const name of moduleFile.getAllModuleNames()) { for (const name of moduleFile.getAllModuleNames()) {
uncheckedModuleNames.add(name); uncheckedModuleNames.add(name);
@ -482,7 +483,7 @@ class HdlParam {
} }
} }
// 3. delete module not visited yet // 3. 删除没有被访问到的 module
for (const moduleName of uncheckedModuleNames) { for (const moduleName of uncheckedModuleNames) {
moduleFile.deleteHdlModule(moduleName); moduleFile.deleteHdlModule(moduleName);
} }

View File

@ -23,6 +23,13 @@ class HdlIgnore {
let relativePath = hdlPath.toPureRelativePath(hdlPath.relative(workspace, path)); let relativePath = hdlPath.toPureRelativePath(hdlPath.relative(workspace, path));
for (const pattern of this.patterns) { for (const pattern of this.patterns) {
// 1. 如果当前 pattern 是一个文件夹,则通过包含前缀匹配
const patternAbsPath = hdlPath.join(workspace, pattern);
if (fspath.isAbsolute(patternAbsPath) && relativePath.startsWith(pattern)) {
return true;
}
// 2. 通过 glob 进行匹配
const matched = minimatch(relativePath, pattern); const matched = minimatch(relativePath, pattern);
if (matched) { if (matched) {
return true; return true;