更新 property.json 文件结构

This commit is contained in:
锦恢 2024-10-27 19:30:09 +08:00
parent a1effbb279
commit fb65524866
8 changed files with 59 additions and 32 deletions

View File

@ -12,6 +12,7 @@
"progress.extract-digital-lsp": "Extract Digital LSP",
"error.download-digital-lsp": "Fail to download digital lsp server, check your network and reload vscode. You can also visit following site and download manually: https://github.com/Digital-EDA/Digital-IDE/releases/tag/",
"error.save-file": "保存文件失败",
"warning.ppy-already-exist": "property.json 已经存在了!",
"save": "保存",
"save-as-view": "另存为视图文件",
"vcd-view-file": "vcd 视图文件",

View File

@ -12,6 +12,7 @@
"progress.extract-digital-lsp": "解压 Digital LSP 语言服务器",
"error.download-digital-lsp": "无法下载 Digital LSP 语言服务器,检查你的网络后重启 vscode或者请手动去下方地址下载 https://github.com/Digital-EDA/Digital-IDE/releases/tag/",
"error.save-file": "保存文件失败",
"warning.ppy.already-exist": "property.json 已经存在了!",
"save": "保存",
"save-as-view": "另存为视图文件",
"vcd-view-file": "vcd 视图文件",

View File

@ -12,6 +12,7 @@
"progress.extract-digital-lsp": "Extract Digital LSP",
"error.download-digital-lsp": "Fail to download digital lsp server, check your network and reload vscode",
"error.save-file": "保存文件失败",
"warning.ppy-already-exist": "property.json 已经存在了!",
"save": "保存",
"save-as-view": "另存为视图文件",
"vcd-view-file": "vcd 视图文件",

View File

@ -393,11 +393,6 @@
"category": "tool",
"title": "%digital-ide.treeView.arch.openFile.title%"
},
{
"command": "digital-ide.tool.clean",
"category": "tool",
"title": "%digital-ide.tool.clean.title%"
},
{
"command": "digital-ide.soft.launch",
"category": "tool",

View File

@ -42,7 +42,7 @@ function registerFunctionCommands(context: vscode.ExtensionContext) {
function registerTreeView(context: vscode.ExtensionContext) {
// register normal tree
vscode.window.registerTreeDataProvider('digital-ide-treeView-arch', treeView.moduleTreeProvider);
vscode.window.registerTreeDataProvider('digital-ide-treeView-tool', treeView.toolTreeProvider);
// vscode.window.registerTreeDataProvider('digital-ide-treeView-tool', treeView.toolTreeProvider);
vscode.window.registerTreeDataProvider('digital-ide-treeView-hardware', treeView.hardwareTreeProvider);
// vscode.window.registerTreeDataProvider('digital-ide-treeView-software', treeView.softwareTreeProvider);

View File

@ -196,6 +196,9 @@ class ToolTreeProvider extends BaseCommandTreeProvider {
}
public async clean() {
console.log('current removed');
return;
const workspacePath = opeParam.workspacePath;
// remove prjPath & .xil
@ -212,7 +215,6 @@ class ToolTreeProvider extends BaseCommandTreeProvider {
vscode.window.showWarningMessage("arch.prjPath is the same as the workspace path, the clean will delete the project, please check your arch.prjPath!");
}
// move bd * ip
const plName = opeParam.prjInfo.prjName.PL;
const targetPath = fspath.dirname(opeParam.prjInfo.arch.hardware.src);

View File

@ -100,6 +100,8 @@ interface Arch {
prjPath: AbsPath
hardware: SrcPath & SimPath & DataPath
software: SrcPath & DataPath
// 'standard' | 'xilinx' | 'null' | 'custom'
structure: string
};
interface Soc {
@ -398,9 +400,14 @@ class PrjInfo implements PrjInfoMeta {
}
public updateArch(arch?: Arch) {
const { t } = vscode.l10n;
const workspacePath = this._workspacePath;
if (arch) {
this.updatePathWisely(this.arch, 'prjPath', arch.prjPath);
// 如果配置中存在,直接根据用户配置的项来赋值
this.arch.structure = 'custom';
this.updatePathWisely(this.arch, 'prjPath', arch.prjPath);
if (arch.hardware) {
this.updatePathWisely(this.arch.hardware, 'src', arch.hardware.src);
this.updatePathWisely(this.arch.hardware, 'sim', arch.hardware.sim);
@ -412,28 +419,45 @@ class PrjInfo implements PrjInfoMeta {
this.updatePathWisely(this.arch.software, 'data', arch.software.data);
}
} else {
let hardwarePath: AbsPath = join(workspacePath, 'user');
let softwarePath: AbsPath = join(workspacePath, 'user', 'Software');
// 如果没有采用默认配置https://nc-ai-lab.feishu.cn/wiki/IXTnw1K6giLApukuBITcfLitnKg
/**
"arch" : {
"structure" : "standard",
"prjPath": "${workspace}/prj",
"hardware" : {
"src" : "${workspace}/user/src", // 放置设计源文件,注: src上一级为IP&bd
"sim" : "${workspace}/user/sim", // 放置仿真文件,会直接反应在树状结构上
"data" : "${workspace}/user/data" // 放置约束、数据文件约束会自动添加进vivado工程
},
"software" : {
"src" : "${workspace}/user/sdk",
"data" : "${workspace}/user/sdk/data"
}
},
*/
this.arch.structure = 'standard';
this.arch.prjPath = join(workspacePath, 'prj');
this.arch.hardware.src = join(workspacePath, 'user', 'src');
this.arch.hardware.sim = join(workspacePath, 'user', 'sim');
this.arch.hardware.data = join(workspacePath, 'user', 'data');
const socCore = this._soc.core;
if (socCore && socCore !== 'none') {
hardwarePath = join(hardwarePath, 'Hardware');
this.arch.software.src = join(softwarePath, 'src');
this.arch.software.data = join(softwarePath, 'data');
this.arch.software.src = join(workspacePath, 'user', 'sdk');
this.arch.software.data = join(workspacePath, 'user', 'sdk', 'data');
}
this.arch.prjPath = join(workspacePath, 'prj');
this.arch.hardware.src = join(hardwarePath, 'src');
this.arch.hardware.sim = join(hardwarePath, 'sim');
this.arch.hardware.data = join(hardwarePath, 'data');
}
// if path is '', set as workspace
this.setDefaultValue(this.arch, 'structure', 'null');
this.setDefaultValue(this.arch, 'prjPath', workspacePath);
this.setDefaultValue(this.arch.hardware, 'src', workspacePath);
this.setDefaultValue(this.arch.hardware, 'sim', this.arch.hardware.src);
this.setDefaultValue(this.arch.hardware, 'data', workspacePath);
this.setDefaultValue(this.arch.software, 'src', workspacePath);
this.setDefaultValue(this.arch.software, 'data', workspacePath);
this.setDefaultValue(this.arch, 'prjPath', workspacePath);
}
public checkArchDirExist() {

View File

@ -103,31 +103,34 @@ class LibManage {
del.push(...this.curr.list);
// copy file from remote to local
const remotePathList = this.getLibFiles(LibraryState.Remote);
this.remote2Local(remotePathList, (src, dist) => {
hdlParam.deleteHdlFile(src);
hdlFile.copyFile(src, dist);
});
// TODO: 从新版本删除所有涉及删除的功能
// const remotePathList = this.getLibFiles(LibraryState.Remote);
// this.remote2Local(remotePathList, (src, dist) => {
// hdlParam.deleteHdlFile(src);
// hdlFile.copyFile(src, dist);
// });
break;
case 'local-remote':
add.push(...this.next.list);
// delete local files & data structure in hdlParam (async)
await this.deleteLocalFiles();
// TODO: 从新版本删除所有涉及删除的功能
// // delete local files & data structure in hdlParam (async)
// await this.deleteLocalFiles();
break;
case 'local-local':
add.push(...diffElement(this.next.list, this.curr.list));
del.push(...diffElement(this.curr.list, this.next.list));
this.remote2Local(add, (src, dist) => {
hdlFile.copyFile(src, dist);
});
// this.remote2Local(add, (src, dist) => {
// hdlFile.copyFile(src, dist);
// });
this.remote2Local(del, (src, dist) => {
hdlFile.removeFile(dist);
});
// this.remote2Local(del, (src, dist) => {
// hdlFile.removeFile(dist);
// });
break;
default: break;
}