更新 property.json 文件结构
This commit is contained in:
parent
a1effbb279
commit
fb65524866
@ -12,6 +12,7 @@
|
|||||||
"progress.extract-digital-lsp": "Extract Digital LSP",
|
"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.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": "保存文件失败",
|
"error.save-file": "保存文件失败",
|
||||||
|
"warning.ppy-already-exist": "property.json 已经存在了!",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"save-as-view": "另存为视图文件",
|
"save-as-view": "另存为视图文件",
|
||||||
"vcd-view-file": "vcd 视图文件",
|
"vcd-view-file": "vcd 视图文件",
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"progress.extract-digital-lsp": "解压 Digital LSP 语言服务器",
|
"progress.extract-digital-lsp": "解压 Digital LSP 语言服务器",
|
||||||
"error.download-digital-lsp": "无法下载 Digital LSP 语言服务器,检查你的网络后重启 vscode,或者请手动去下方地址下载 https://github.com/Digital-EDA/Digital-IDE/releases/tag/",
|
"error.download-digital-lsp": "无法下载 Digital LSP 语言服务器,检查你的网络后重启 vscode,或者请手动去下方地址下载 https://github.com/Digital-EDA/Digital-IDE/releases/tag/",
|
||||||
"error.save-file": "保存文件失败",
|
"error.save-file": "保存文件失败",
|
||||||
|
"warning.ppy.already-exist": "property.json 已经存在了!",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"save-as-view": "另存为视图文件",
|
"save-as-view": "另存为视图文件",
|
||||||
"vcd-view-file": "vcd 视图文件",
|
"vcd-view-file": "vcd 视图文件",
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
"progress.extract-digital-lsp": "Extract Digital LSP",
|
"progress.extract-digital-lsp": "Extract Digital LSP",
|
||||||
"error.download-digital-lsp": "Fail to download digital lsp server, check your network and reload vscode",
|
"error.download-digital-lsp": "Fail to download digital lsp server, check your network and reload vscode",
|
||||||
"error.save-file": "保存文件失败",
|
"error.save-file": "保存文件失败",
|
||||||
|
"warning.ppy-already-exist": "property.json 已经存在了!",
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"save-as-view": "另存为视图文件",
|
"save-as-view": "另存为视图文件",
|
||||||
"vcd-view-file": "vcd 视图文件",
|
"vcd-view-file": "vcd 视图文件",
|
||||||
|
@ -393,11 +393,6 @@
|
|||||||
"category": "tool",
|
"category": "tool",
|
||||||
"title": "%digital-ide.treeView.arch.openFile.title%"
|
"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",
|
"command": "digital-ide.soft.launch",
|
||||||
"category": "tool",
|
"category": "tool",
|
||||||
|
@ -42,7 +42,7 @@ function registerFunctionCommands(context: vscode.ExtensionContext) {
|
|||||||
function registerTreeView(context: vscode.ExtensionContext) {
|
function registerTreeView(context: vscode.ExtensionContext) {
|
||||||
// register normal tree
|
// register normal tree
|
||||||
vscode.window.registerTreeDataProvider('digital-ide-treeView-arch', treeView.moduleTreeProvider);
|
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-hardware', treeView.hardwareTreeProvider);
|
||||||
// vscode.window.registerTreeDataProvider('digital-ide-treeView-software', treeView.softwareTreeProvider);
|
// vscode.window.registerTreeDataProvider('digital-ide-treeView-software', treeView.softwareTreeProvider);
|
||||||
|
|
||||||
|
@ -196,6 +196,9 @@ class ToolTreeProvider extends BaseCommandTreeProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async clean() {
|
public async clean() {
|
||||||
|
console.log('current removed');
|
||||||
|
return;
|
||||||
|
|
||||||
const workspacePath = opeParam.workspacePath;
|
const workspacePath = opeParam.workspacePath;
|
||||||
|
|
||||||
// remove prjPath & .xil
|
// 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!");
|
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
|
// move bd * ip
|
||||||
const plName = opeParam.prjInfo.prjName.PL;
|
const plName = opeParam.prjInfo.prjName.PL;
|
||||||
const targetPath = fspath.dirname(opeParam.prjInfo.arch.hardware.src);
|
const targetPath = fspath.dirname(opeParam.prjInfo.arch.hardware.src);
|
||||||
|
@ -100,6 +100,8 @@ interface Arch {
|
|||||||
prjPath: AbsPath
|
prjPath: AbsPath
|
||||||
hardware: SrcPath & SimPath & DataPath
|
hardware: SrcPath & SimPath & DataPath
|
||||||
software: SrcPath & DataPath
|
software: SrcPath & DataPath
|
||||||
|
// 'standard' | 'xilinx' | 'null' | 'custom'
|
||||||
|
structure: string
|
||||||
};
|
};
|
||||||
|
|
||||||
interface Soc {
|
interface Soc {
|
||||||
@ -398,9 +400,14 @@ class PrjInfo implements PrjInfoMeta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public updateArch(arch?: Arch) {
|
public updateArch(arch?: Arch) {
|
||||||
|
const { t } = vscode.l10n;
|
||||||
const workspacePath = this._workspacePath;
|
const workspacePath = this._workspacePath;
|
||||||
if (arch) {
|
if (arch) {
|
||||||
|
// 如果配置中存在,直接根据用户配置的项来赋值
|
||||||
|
this.arch.structure = 'custom';
|
||||||
|
|
||||||
this.updatePathWisely(this.arch, 'prjPath', arch.prjPath);
|
this.updatePathWisely(this.arch, 'prjPath', arch.prjPath);
|
||||||
|
|
||||||
if (arch.hardware) {
|
if (arch.hardware) {
|
||||||
this.updatePathWisely(this.arch.hardware, 'src', arch.hardware.src);
|
this.updatePathWisely(this.arch.hardware, 'src', arch.hardware.src);
|
||||||
this.updatePathWisely(this.arch.hardware, 'sim', arch.hardware.sim);
|
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);
|
this.updatePathWisely(this.arch.software, 'data', arch.software.data);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let hardwarePath: AbsPath = join(workspacePath, 'user');
|
// 如果没有,采用默认配置:https://nc-ai-lab.feishu.cn/wiki/IXTnw1K6giLApukuBITcfLitnKg
|
||||||
let softwarePath: AbsPath = join(workspacePath, 'user', 'Software');
|
/**
|
||||||
|
"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;
|
const socCore = this._soc.core;
|
||||||
if (socCore && socCore !== 'none') {
|
if (socCore && socCore !== 'none') {
|
||||||
hardwarePath = join(hardwarePath, 'Hardware');
|
this.arch.software.src = join(workspacePath, 'user', 'sdk');
|
||||||
this.arch.software.src = join(softwarePath, 'src');
|
this.arch.software.data = join(workspacePath, 'user', 'sdk', 'data');
|
||||||
this.arch.software.data = join(softwarePath, '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
|
// 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, 'src', workspacePath);
|
||||||
this.setDefaultValue(this.arch.hardware, 'sim', this.arch.hardware.src);
|
this.setDefaultValue(this.arch.hardware, 'sim', this.arch.hardware.src);
|
||||||
this.setDefaultValue(this.arch.hardware, 'data', workspacePath);
|
this.setDefaultValue(this.arch.hardware, 'data', workspacePath);
|
||||||
this.setDefaultValue(this.arch.software, 'src', workspacePath);
|
this.setDefaultValue(this.arch.software, 'src', workspacePath);
|
||||||
this.setDefaultValue(this.arch.software, 'data', workspacePath);
|
this.setDefaultValue(this.arch.software, 'data', workspacePath);
|
||||||
this.setDefaultValue(this.arch, 'prjPath', workspacePath);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public checkArchDirExist() {
|
public checkArchDirExist() {
|
||||||
|
@ -103,31 +103,34 @@ class LibManage {
|
|||||||
del.push(...this.curr.list);
|
del.push(...this.curr.list);
|
||||||
|
|
||||||
// copy file from remote to local
|
// copy file from remote to local
|
||||||
const remotePathList = this.getLibFiles(LibraryState.Remote);
|
|
||||||
this.remote2Local(remotePathList, (src, dist) => {
|
// TODO: 从新版本删除所有涉及删除的功能
|
||||||
hdlParam.deleteHdlFile(src);
|
// const remotePathList = this.getLibFiles(LibraryState.Remote);
|
||||||
hdlFile.copyFile(src, dist);
|
// this.remote2Local(remotePathList, (src, dist) => {
|
||||||
});
|
// hdlParam.deleteHdlFile(src);
|
||||||
|
// hdlFile.copyFile(src, dist);
|
||||||
|
// });
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'local-remote':
|
case 'local-remote':
|
||||||
add.push(...this.next.list);
|
add.push(...this.next.list);
|
||||||
|
|
||||||
// delete local files & data structure in hdlParam (async)
|
// TODO: 从新版本删除所有涉及删除的功能
|
||||||
await this.deleteLocalFiles();
|
// // delete local files & data structure in hdlParam (async)
|
||||||
|
// await this.deleteLocalFiles();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'local-local':
|
case 'local-local':
|
||||||
add.push(...diffElement(this.next.list, this.curr.list));
|
add.push(...diffElement(this.next.list, this.curr.list));
|
||||||
del.push(...diffElement(this.curr.list, this.next.list));
|
del.push(...diffElement(this.curr.list, this.next.list));
|
||||||
|
|
||||||
this.remote2Local(add, (src, dist) => {
|
// this.remote2Local(add, (src, dist) => {
|
||||||
hdlFile.copyFile(src, dist);
|
// hdlFile.copyFile(src, dist);
|
||||||
});
|
// });
|
||||||
|
|
||||||
this.remote2Local(del, (src, dist) => {
|
// this.remote2Local(del, (src, dist) => {
|
||||||
hdlFile.removeFile(dist);
|
// hdlFile.removeFile(dist);
|
||||||
});
|
// });
|
||||||
break;
|
break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user