#fix soc.core

This commit is contained in:
锦恢 2023-07-16 00:49:38 +08:00
parent dd5bd10963
commit 5f8a573a9b
8 changed files with 58 additions and 49 deletions

View File

@ -43,15 +43,10 @@ class PlManage extends BaseManage {
}
}
public launch() {
if (!this.config.terminal) {
this.config.terminal = this.createTerminal('Hardware');
this.config.terminal.show(true);
this.config.ope.launch(this.config);
} else {
vscode.window.showInformationMessage('Hardware Terminal is launched !');
}
}
public simulate() {
@ -117,7 +112,7 @@ class PlManage extends BaseManage {
}
setSrcTop(item: ModuleDataItem) {
public setSrcTop(item: ModuleDataItem) {
this.config.ope.setSrcTop(item.name, this.config);
const type = moduleTreeProvider.getItemType(item);
if (type === HdlFileType.Src) {
@ -126,7 +121,7 @@ class PlManage extends BaseManage {
}
}
setSimTop(item: ModuleDataItem) {
public setSimTop(item: ModuleDataItem) {
this.config.ope.setSimTop(item.name, this.config);
const type = moduleTreeProvider.getItemType(item);
if (type === HdlFileType.Sim) {

View File

@ -174,6 +174,7 @@ class PpyAction extends BaseAction {
console.log('PpyAction change');
assert.equal(hdlPath.toSlash(path), opeParam.propertyJsonPath);
await this.updateProperty(Event.Change, m);
console.log(hdlParam);
}
// get path set from opeParam that used to tell if need to remake HdlMonitor
@ -203,7 +204,6 @@ class PpyAction extends BaseAction {
}
opeParam.mergePrjInfo(rawPrjInfo);
await this.updatePL(originalHdlFiles);
await prjManage.refreshPrjFolder();
const currentPathSet = this.getImportantPathSet();
@ -219,49 +219,63 @@ class PpyAction extends BaseAction {
} else {
// update hdl monitor
const options: vscode.ProgressOptions = { location: vscode.ProgressLocation.Notification, title: 'modify the project' };
await vscode.window.withProgress(options, async () => await this.refreshHdlMonitor(m));
await vscode.window.withProgress(options, async () => await this.refreshHdlMonitor(m, originalHdlFiles));
}
refreshArchTree();
}
public async refreshHdlMonitor(m: HdlMonitor) {
m.remakeHdlMonitor();
}
public async updatePL(oldFiles: AbsPath[]) {
// current only support xilinx
const options: vscode.ProgressOptions = { location: vscode.ProgressLocation.Notification };
if (opeParam.prjInfo.toolChain === ToolChainType.Xilinx) {
options.title = 'update Xilinx PL';
await vscode.window.withProgress(options, async () => await this.updateXilinxPL(oldFiles));
}
}
public async updateXilinxPL(oldFiles: AbsPath[]) {
const newFiles = await prjManage.getPrjHardwareFiles();
if (prjManage.pl) {
public diffNewOld(newFiles: AbsPath[], oldFiles: AbsPath[]) {
const uncheckHdlFileSet = new Set<AbsPath>(oldFiles);
const addFiles: AbsPath[] = [];
const delFiles: AbsPath[] = [];
for (const path of newFiles) {
if (!uncheckHdlFileSet.has(path)) {
await hdlParam.addHdlPath(path);
addFiles.push(path);
} else {
uncheckHdlFileSet.delete(path);
}
}
const vivadoAddPromise = prjManage.pl.addFiles(addFiles);
for (const path of uncheckHdlFileSet) {
hdlParam.deleteHdlFile(path);
delFiles.push(path);
}
const vivadoDelPromise = prjManage.pl.delFiles(delFiles);
return {
addFiles, delFiles
};
}
await vivadoAddPromise;
await vivadoDelPromise;
public async refreshHdlMonitor(m: HdlMonitor, originalHdlFiles: AbsPath[]) {
m.remakeHdlMonitor();
const newFiles = await prjManage.getPrjHardwareFiles();
const { addFiles, delFiles } = this.diffNewOld(newFiles, originalHdlFiles);
const options: vscode.ProgressOptions = { location: vscode.ProgressLocation.Notification };
options.title = 'update HdlParam';
await vscode.window.withProgress(options, async () => await this.updateHdlParam(addFiles, delFiles));
if (opeParam.prjInfo.toolChain === ToolChainType.Xilinx) {
options.title = 'update PL';
await vscode.window.withProgress(options, async () => await this.updatePL(addFiles, delFiles));
}
}
public async updateHdlParam(addFiles: AbsPath[], delFiles: AbsPath[]) {
for (const path of addFiles) {
await hdlParam.addHdlFile(path);
}
for (const path of delFiles) {
hdlParam.deleteHdlFile(path);
}
}
public async updatePL(addFiles: AbsPath[], delFiles: AbsPath[]) {
// current only support xilinx
if (prjManage.pl) {
await prjManage.pl.addFiles(addFiles);
await prjManage.pl.delFiles(delFiles);
} else {
MainOutput.report('PL is not registered', ReportType.Warn);
}

View File

@ -4,7 +4,7 @@
"PL": "template"
},
"soc": {
"core": "none"
"core": "cortexM3"
},
"enableShowLog": false,
"device": "none"