From 63fcb7a163f1f8607ea511f015a3f8aae7204872 Mon Sep 17 00:00:00 2001 From: Nitcloud Date: Fri, 14 Mar 2025 23:28:38 +0800 Subject: [PATCH] fix xilinx ip import issues --- src/manager/PL/efinity.ts | 8 ++++---- src/manager/PL/xilinx.ts | 10 +++++++--- src/manager/prj.ts | 9 ++++++--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/manager/PL/efinity.ts b/src/manager/PL/efinity.ts index decb4d4..4c763c0 100644 --- a/src/manager/PL/efinity.ts +++ b/src/manager/PL/efinity.ts @@ -147,7 +147,7 @@ export class EfinityOperation { private getSynthInfo(): string { return ` - + @@ -183,7 +183,7 @@ export class EfinityOperation { private getPnRInfo(): string { return ` - + @@ -196,7 +196,7 @@ export class EfinityOperation { } private getBitstreamInfo(): string { - return ` + return ` @@ -220,7 +220,7 @@ export class EfinityOperation { private getDebugInfo(): string { return ` - + `; diff --git a/src/manager/PL/xilinx.ts b/src/manager/PL/xilinx.ts index 6b28751..06a2891 100644 --- a/src/manager/PL/xilinx.ts +++ b/src/manager/PL/xilinx.ts @@ -286,8 +286,13 @@ class XilinxOperation { const plName = opeParam.prjInfo.prjName.PL; const targetPath = fspath.dirname(opeParam.prjInfo.arch.hardware.src); - const sourceIpPath = `${workspacePath}/prj/xilinx/${plName}.srcs/sources_1/ip`; - const sourceBdPath = `${workspacePath}/prj/xilinx/${plName}.srcs/sources_1/bd`; + let type = 'srcs'; + if (hdlDir.isDir(`${workspacePath}/prj/xilinx/${plName}.gen`)) { + type = 'gen' + } + + 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); HardwareOutput.report("move dir from " + sourceIpPath + " to " + targetPath); @@ -1082,7 +1087,6 @@ const tools = { } }; - export { XilinxOperation, tools, diff --git a/src/manager/prj.ts b/src/manager/prj.ts index 4feacd7..ad635f8 100644 --- a/src/manager/prj.ts +++ b/src/manager/prj.ts @@ -398,10 +398,13 @@ class PrjManage { workspace: string, plname: string ) { - const xilinxSrcsPath = hdlPath.join(workspace, plname + '.srcs'); - const standardIpPath = hdlPath.join(workspace, 'user', 'ip'); + let standardIpPath = hdlPath.join(workspace, 'user', 'ip'); + let xilinxSrcsPath = hdlPath.join(workspace, plname + '.gen'); if (!fs.existsSync(xilinxSrcsPath)) { - return; + xilinxSrcsPath = hdlPath.join(workspace, plname + '.srcs'); + if (!fs.existsSync(xilinxSrcsPath)) { + return; + } } const sourceNames = fs.readdirSync(xilinxSrcsPath).filter(filename => filename.startsWith(matchPrefix)); for (const sn of sourceNames) {