执行 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 += `port map(\n${port});\n`;
instContent += `port map(\n${port.trim()}\n);\n`;
return instContent;
}

View File

@ -207,7 +207,7 @@ class IcarusSimulate extends Simulate {
continue;
}
// 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 });
continue;
}

View File

@ -156,7 +156,21 @@ function exportFilelist(view: ModuleDataItem) {
deps.others.forEach(path => fileset.add(path));
deps.include.forEach(path => fileset.add(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);
} else {
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 { t } from '../../i18n';
let needExpand = true;
interface ModuleDataItem {
icon: string, // 图标
@ -118,10 +117,13 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
let collapsibleState;
if (!expandable) {
collapsibleState = vscode.TreeItemCollapsibleState.None;
} else if (needExpand) {
collapsibleState = vscode.TreeItemCollapsibleState.Expanded;
} else {
collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
} else {
// 默认只让 src 和 sim 展开
if (element.parent === undefined) {
collapsibleState = vscode.TreeItemCollapsibleState.Expanded;
} else {
collapsibleState = vscode.TreeItemCollapsibleState.Collapsed;
}
}
const treeItem = new vscode.TreeItem(itemName, collapsibleState);
@ -179,7 +181,7 @@ class ModuleTreeProvider implements vscode.TreeDataProvider<ModuleDataItem> {
const hardwarePath = opeParam.prjInfo.arch.hardware;
const moduleType = element.name as keyof (SrcPath & SimPath);
const topModules = hdlParam.getTopModulesByType(moduleType);
const topModules = hdlParam.getTopModulesByType(moduleType);
const topModuleItemList = topModules.map<ModuleDataItem>(module => ({
icon: this.judgeTopModuleIconByDoFastType(module.file.doFastType),
type: moduleType,

View File

@ -314,7 +314,7 @@ class HdlParam {
for (const p of pools) {
const increment = Math.floor(p.id / fileNum * 100);
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 });
}
pools.length = 0;
@ -351,7 +351,7 @@ class HdlParam {
for (const p of pools) {
const increment = Math.floor(p.id / fileNum * 100);
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 });
}
pools.length = 0;
@ -454,14 +454,15 @@ class HdlParam {
public updateFast(path: string, fast: common.Fast) {
const moduleFile = this.getHdlFile(path);
if (moduleFile === undefined) {
return;
}
// 1. update marco directly
// 1. 更新 macro
moduleFile.updateMacro(fast.macro);
// 2. update modules one by one
// 2. 增量更新所有 module
const uncheckedModuleNames = new Set<string>();
for (const name of moduleFile.getAllModuleNames()) {
uncheckedModuleNames.add(name);
@ -482,7 +483,7 @@ class HdlParam {
}
}
// 3. delete module not visited yet
// 3. 删除没有被访问到的 module
for (const moduleName of uncheckedModuleNames) {
moduleFile.deleteHdlModule(moduleName);
}
@ -1078,7 +1079,7 @@ export class HdlFile {
hdlParam.setHdlFile(this);
// make nameToModule
this.nameToModule = new Map<string, HdlModule>();
this.nameToModule = new Map<string, HdlModule>();
for (const rawHdlModule of modules) {
this.createHdlModule(rawHdlModule);
}

View File

@ -23,6 +23,13 @@ class HdlIgnore {
let relativePath = hdlPath.toPureRelativePath(hdlPath.relative(workspace, path));
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);
if (matched) {
return true;