diff --git a/src/manager/PL/efinity.ts b/src/manager/PL/efinity.ts index b4ea9a5..decb4d4 100644 --- a/src/manager/PL/efinity.ts +++ b/src/manager/PL/efinity.ts @@ -15,91 +15,10 @@ import { debounce, getPIDsWithName, killProcess } from '../../global/util'; import { t } from '../../i18n'; import { HdlFileProjectType } from '../../hdlParser/common'; import { integer } from 'vscode-languageclient'; +import { AnyARecord } from 'dns'; type ChainInfo = [number, number, number, number]; -const syn = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - `; - -const pnr = ` - - - - - - - - - - `; - -const bit = ` - - - - - - - - - - - - - - - - - - - `; - -const debug = ` - - - - `; - -const security = ` - - - - - - - `; - export class EfinityOperation { prjScript: string; efxPath: string; @@ -108,58 +27,8 @@ export class EfinityOperation { this.efxPath = hdlPath.join(opeParam.workspacePath, `${opeParam.prjInfo.prjName.PL}.xml`); } - private getDeviceInfo(device: string): string { - const deviceInfo = device.split('-'); - let family = 'Trion'; - if (device.slice(0, 2).toLowerCase() === 'ti') { - family = 'Titanium'; - } - - return ` - - - - `; - } - - private getDesignInfo(): string { - let designFile = ` \n`; - for (const hdlFile of hdlParam.getAllHdlFiles()) { - switch (hdlFile.projectType) { - case HdlFileProjectType.Src: - case HdlFileProjectType.LocalLib: - case HdlFileProjectType.RemoteLib: - case HdlFileProjectType.Sim: - designFile += ` \n`; - break; - case HdlFileProjectType.IP: - case HdlFileProjectType.Primitive: - // IP 和 原语不用管 - break; - default: - break; - } - } - designFile += ` ` - return ` \n${designFile} - ` - }; - - private getConstraintInfo(): string { - let constraintFile = ''; - hdlFile.pickFileRecursive(opeParam.prjInfo.arch.hardware.data, filePath => { - if (filePath.endsWith('.sdc')) { - constraintFile += ` \n`; - } - }); - - constraintFile += ` \n`; - - return ` \n${constraintFile} `; - } - public launch() { - this.prjScript = `\n${this.getDeviceInfo(opeParam.prjInfo.device)}\n${this.getDesignInfo()}\n${this.getConstraintInfo()}\n \n \n \n${syn}\n${pnr}\n${bit}\n${debug}\n${security}\n`; + this.prjScript = `\n${this.getDeviceInfo(opeParam.prjInfo.device)}\n${this.getDesignInfo()}\n${this.getConstraintInfo()}\n \n \n \n${this.getSynthInfo()}\n${this.getPnRInfo()}\n${this.getBitstreamInfo()}\n${this.getDebugInfo()}\n${this.getSecurityInfo()}\n`; fs.writeFileSync(this.efxPath, this.prjScript); @@ -226,6 +95,244 @@ export class EfinityOperation { } + private getDeviceInfo(device: string): string { + const deviceInfo = device.split('-'); + let family = 'Trion'; + if (device.slice(0, 2).toLowerCase() === 'ti') { + family = 'Titanium'; + } + + return ` + + + + `; + } + + private getDesignInfo(): string { + let designFile = ` \n`; + for (const hdlFile of hdlParam.getAllHdlFiles()) { + switch (hdlFile.projectType) { + case HdlFileProjectType.Src: + case HdlFileProjectType.LocalLib: + case HdlFileProjectType.RemoteLib: + case HdlFileProjectType.Sim: + designFile += ` \n`; + break; + case HdlFileProjectType.IP: + case HdlFileProjectType.Primitive: + // IP 和 原语不用管 + break; + default: + break; + } + } + designFile += ` ` + return ` \n${designFile} + ` + }; + + private getConstraintInfo(): string { + let constraintFile = ''; + hdlFile.pickFileRecursive(opeParam.prjInfo.arch.hardware.data, filePath => { + if (filePath.endsWith('.sdc')) { + constraintFile += ` \n`; + } + }); + + constraintFile += ` \n`; + + return ` \n${constraintFile} `; + } + + private getSynthInfo(): string { + return ` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + `; + } + + private getPnRInfo(): string { + return ` + + + + + + + + + + `; + } + + private getBitstreamInfo(): string { + return ` + + + + + + + + + + + + + + + + + + + `; + } + + private getDebugInfo(): string { + return ` + + + + `; + } + + private getSecurityInfo(): string { + return ` + + + + + + + `; + } + + private getIODeviceConfig(): string { + + function getIOBankInfo(params:Record): string { + let iobankInfo = ''; + for (const [key, value] of Object.entries(params)) { + iobankInfo += ` \n`; + } + return ` \n${iobankInfo} `; + } + + function getReconfigInfo(params:Record): string { + let ctrlInfo = ''; + for (const [key, value] of Object.entries(params)) { + ctrlInfo += ` \n`; + } + return ` \n${ctrlInfo} `; + } + + function getSeuInfo(params:Record): string { + let seuInfo = ''; + for (const [key, value] of Object.entries(params)) { + seuInfo += ` \n \n \n \n \n \n \n \n \n \n`; + } + return ` \n${seuInfo} `; + } + + function getCLKMUXInfo(params:Record): string { + let clkmuxInfo = ''; + for (const [key, value] of Object.entries(params)) { + clkmuxInfo += ` \n \n \n \n \n \n \n \n \n \n \n \n`; + } + return ` \n${clkmuxInfo} `; + } + + return ` \n${getIOBankInfo({ + "1A_4B" : "1.8 V LVCMOS", + "1B" : "1.8 V LVCMOS", + "2A_2B" : "1.8 V LVCMOS", + "3A" : "1.8 V LVCMOS", + "3B_4A" : "1.8 V LVCMOS", + "BL" : "1.8 V LVCMOS" + })}\n${getReconfigInfo({ + "cfg" : "CONFIG_CTRL0" + })}\n${getSeuInfo({ + "seu" : "CONFIG_SEU0" + })}\n${getCLKMUXInfo({ + "CLKMUX_B" : "CLKMUX_B", + "CLKMUX_L" : "CLKMUX_L", + "CLKMUX_R" : "CLKMUX_R", + "CLKMUX_T" : "CLKMUX_T" + })} + + + + ` + } + + private setCompInputGPIO(param:Record): string { + return ` + + + + + + + ` + } + + private getHBRAMConfig(): string { + return ` + + + + + + + + + + + + + + + + + + + + + + + + ` + } + private convert_to_SVF_TrionX( inputFile: string, destSVFFile: string,