fix gen file issues
This commit is contained in:
parent
b949289ece
commit
f372aa4db0
@ -245,18 +245,27 @@ export async function clean() {
|
|||||||
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);
|
||||||
|
|
||||||
let type = 'srcs';
|
|
||||||
if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.gen`)) {
|
if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.gen`)) {
|
||||||
type = 'gen';
|
const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.gen/sources_1/ip`;
|
||||||
}
|
const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.gen/sources_1/bd`;
|
||||||
const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.${type}/sources_1/ip`;
|
|
||||||
const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.${type}/sources_1/bd`;
|
|
||||||
|
|
||||||
hdlDir.mvdir(sourceIpPath, targetPath, true);
|
hdlDir.mvdir(sourceIpPath, targetPath, true);
|
||||||
MainOutput.report("move dir from " + sourceIpPath + " to " + targetPath);
|
MainOutput.report("move dir from " + sourceIpPath + " to " + targetPath);
|
||||||
|
|
||||||
hdlDir.mvdir(sourceBdPath, targetPath, true);
|
hdlDir.mvdir(sourceBdPath, targetPath, true);
|
||||||
MainOutput.report("move dir from " + sourceBdPath + " to " + targetPath);
|
MainOutput.report("move dir from " + sourceBdPath + " to " + targetPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.srcs`)) {
|
||||||
|
const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.srcs/sources_1/ip`;
|
||||||
|
const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.srcs/sources_1/bd`;
|
||||||
|
|
||||||
|
hdlDir.mvdir(sourceIpPath, targetPath, true);
|
||||||
|
MainOutput.report("move dir from " + sourceIpPath + " to " + targetPath);
|
||||||
|
|
||||||
|
hdlDir.mvdir(sourceBdPath, targetPath, true);
|
||||||
|
MainOutput.report("move dir from " + sourceBdPath + " to " + targetPath);
|
||||||
|
}
|
||||||
|
|
||||||
if (prjPath !== opeParam.workspacePath) {
|
if (prjPath !== opeParam.workspacePath) {
|
||||||
hdlDir.rmdir(prjPath);
|
hdlDir.rmdir(prjPath);
|
||||||
|
@ -286,19 +286,27 @@ class XilinxOperation {
|
|||||||
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);
|
||||||
|
|
||||||
let type = 'srcs';
|
|
||||||
if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.gen`)) {
|
if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.gen`)) {
|
||||||
type = 'gen'
|
const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.gen/sources_1/ip`;
|
||||||
}
|
const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.gen/sources_1/bd`;
|
||||||
|
|
||||||
const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.${type}/sources_1/ip`;
|
|
||||||
const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.${type}/sources_1/bd`;
|
|
||||||
|
|
||||||
hdlDir.mvdir(sourceIpPath, targetPath, true);
|
hdlDir.mvdir(sourceIpPath, targetPath, true);
|
||||||
HardwareOutput.report("move dir from " + sourceIpPath + " to " + targetPath);
|
HardwareOutput.report("move dir from " + sourceIpPath + " to " + targetPath);
|
||||||
|
|
||||||
hdlDir.mvdir(sourceBdPath, targetPath, true);
|
hdlDir.mvdir(sourceBdPath, targetPath, true);
|
||||||
HardwareOutput.report("move dir from " + sourceBdPath + " to " + targetPath);
|
HardwareOutput.report("move dir from " + sourceBdPath + " to " + targetPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.srcs`)) {
|
||||||
|
const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.srcs/sources_1/ip`;
|
||||||
|
const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.srcs/sources_1/bd`;
|
||||||
|
|
||||||
|
hdlDir.mvdir(sourceIpPath, targetPath, true);
|
||||||
|
HardwareOutput.report("move dir from " + sourceIpPath + " to " + targetPath);
|
||||||
|
|
||||||
|
hdlDir.mvdir(sourceBdPath, targetPath, true);
|
||||||
|
HardwareOutput.report("move dir from " + sourceBdPath + " to " + targetPath);
|
||||||
|
}
|
||||||
|
|
||||||
await this.closeAllWindows();
|
await this.closeAllWindows();
|
||||||
}
|
}
|
||||||
|
@ -398,14 +398,11 @@ class PrjManage {
|
|||||||
workspace: string,
|
workspace: string,
|
||||||
plname: string
|
plname: string
|
||||||
) {
|
) {
|
||||||
let standardIpPath = hdlPath.join(workspace, 'user', 'ip');
|
const standardIpPath = hdlPath.join(workspace, 'user', 'ip');
|
||||||
let xilinxSrcsPath = hdlPath.join(workspace, plname + '.gen');
|
|
||||||
if (!fs.existsSync(xilinxSrcsPath)) {
|
if (hdlDir.isDir(hdlPath.join(workspace, plname + '.gen'))) {
|
||||||
xilinxSrcsPath = hdlPath.join(workspace, plname + '.srcs');
|
const xilinxSrcsPath = hdlPath.join(workspace, plname + '.gen');
|
||||||
if (!fs.existsSync(xilinxSrcsPath)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const sourceNames = fs.readdirSync(xilinxSrcsPath).filter(filename => filename.startsWith(matchPrefix));
|
const sourceNames = fs.readdirSync(xilinxSrcsPath).filter(filename => filename.startsWith(matchPrefix));
|
||||||
for (const sn of sourceNames) {
|
for (const sn of sourceNames) {
|
||||||
const ipPath = hdlPath.join(xilinxSrcsPath, sn, 'ip');
|
const ipPath = hdlPath.join(xilinxSrcsPath, sn, 'ip');
|
||||||
@ -422,6 +419,26 @@ class PrjManage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hdlDir.isDir(hdlPath.join(workspace, plname + '.srcs'))) {
|
||||||
|
const xilinxSrcsPath = hdlPath.join(workspace, plname + '.srcs');
|
||||||
|
|
||||||
|
const sourceNames = fs.readdirSync(xilinxSrcsPath).filter(filename => filename.startsWith(matchPrefix));
|
||||||
|
for (const sn of sourceNames) {
|
||||||
|
const ipPath = hdlPath.join(xilinxSrcsPath, sn, 'ip');
|
||||||
|
|
||||||
|
if (!hdlFile.isDir(ipPath)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const ipname of fs.readdirSync(ipPath)) {
|
||||||
|
const sourcePath = hdlPath.join(ipPath, ipname);
|
||||||
|
hdlDir.mvdir(sourcePath, standardIpPath, true);
|
||||||
|
}
|
||||||
|
hdlDir.rmdir(ipPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description 将文件从 Xilinx 中迁移到标准结构去
|
* @description 将文件从 Xilinx 中迁移到标准结构去
|
||||||
* 根据 ${workspace}/${plname}.srcs 下以 source_ 开头的前缀分两种情况:
|
* 根据 ${workspace}/${plname}.srcs 下以 source_ 开头的前缀分两种情况:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user