#fix soc.core
This commit is contained in:
parent
dd5bd10963
commit
5f8a573a9b
@ -43,15 +43,10 @@ class PlManage extends BaseManage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public launch() {
|
public launch() {
|
||||||
if (!this.config.terminal) {
|
|
||||||
this.config.terminal = this.createTerminal('Hardware');
|
this.config.terminal = this.createTerminal('Hardware');
|
||||||
this.config.terminal.show(true);
|
this.config.terminal.show(true);
|
||||||
this.config.ope.launch(this.config);
|
this.config.ope.launch(this.config);
|
||||||
} else {
|
|
||||||
vscode.window.showInformationMessage('Hardware Terminal is launched !');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public simulate() {
|
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);
|
this.config.ope.setSrcTop(item.name, this.config);
|
||||||
const type = moduleTreeProvider.getItemType(item);
|
const type = moduleTreeProvider.getItemType(item);
|
||||||
if (type === HdlFileType.Src) {
|
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);
|
this.config.ope.setSimTop(item.name, this.config);
|
||||||
const type = moduleTreeProvider.getItemType(item);
|
const type = moduleTreeProvider.getItemType(item);
|
||||||
if (type === HdlFileType.Sim) {
|
if (type === HdlFileType.Sim) {
|
||||||
|
@ -174,6 +174,7 @@ class PpyAction extends BaseAction {
|
|||||||
console.log('PpyAction change');
|
console.log('PpyAction change');
|
||||||
assert.equal(hdlPath.toSlash(path), opeParam.propertyJsonPath);
|
assert.equal(hdlPath.toSlash(path), opeParam.propertyJsonPath);
|
||||||
await this.updateProperty(Event.Change, m);
|
await this.updateProperty(Event.Change, m);
|
||||||
|
console.log(hdlParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
// get path set from opeParam that used to tell if need to remake HdlMonitor
|
// 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);
|
opeParam.mergePrjInfo(rawPrjInfo);
|
||||||
await this.updatePL(originalHdlFiles);
|
|
||||||
await prjManage.refreshPrjFolder();
|
await prjManage.refreshPrjFolder();
|
||||||
|
|
||||||
const currentPathSet = this.getImportantPathSet();
|
const currentPathSet = this.getImportantPathSet();
|
||||||
@ -219,49 +219,63 @@ class PpyAction extends BaseAction {
|
|||||||
} else {
|
} else {
|
||||||
// update hdl monitor
|
// update hdl monitor
|
||||||
const options: vscode.ProgressOptions = { location: vscode.ProgressLocation.Notification, title: 'modify the project' };
|
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();
|
refreshArchTree();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async refreshHdlMonitor(m: HdlMonitor) {
|
public diffNewOld(newFiles: AbsPath[], oldFiles: AbsPath[]) {
|
||||||
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) {
|
|
||||||
const uncheckHdlFileSet = new Set<AbsPath>(oldFiles);
|
const uncheckHdlFileSet = new Set<AbsPath>(oldFiles);
|
||||||
const addFiles: AbsPath[] = [];
|
const addFiles: AbsPath[] = [];
|
||||||
const delFiles: AbsPath[] = [];
|
const delFiles: AbsPath[] = [];
|
||||||
|
|
||||||
for (const path of newFiles) {
|
for (const path of newFiles) {
|
||||||
if (!uncheckHdlFileSet.has(path)) {
|
if (!uncheckHdlFileSet.has(path)) {
|
||||||
await hdlParam.addHdlPath(path);
|
|
||||||
addFiles.push(path);
|
addFiles.push(path);
|
||||||
} else {
|
} else {
|
||||||
uncheckHdlFileSet.delete(path);
|
uncheckHdlFileSet.delete(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const vivadoAddPromise = prjManage.pl.addFiles(addFiles);
|
|
||||||
|
|
||||||
for (const path of uncheckHdlFileSet) {
|
for (const path of uncheckHdlFileSet) {
|
||||||
hdlParam.deleteHdlFile(path);
|
hdlParam.deleteHdlFile(path);
|
||||||
delFiles.push(path);
|
delFiles.push(path);
|
||||||
}
|
}
|
||||||
const vivadoDelPromise = prjManage.pl.delFiles(delFiles);
|
return {
|
||||||
|
addFiles, delFiles
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
await vivadoAddPromise;
|
public async refreshHdlMonitor(m: HdlMonitor, originalHdlFiles: AbsPath[]) {
|
||||||
await vivadoDelPromise;
|
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 {
|
} else {
|
||||||
MainOutput.report('PL is not registered', ReportType.Warn);
|
MainOutput.report('PL is not registered', ReportType.Warn);
|
||||||
}
|
}
|
||||||
|
2
src/test/.vscode/property.json
vendored
2
src/test/.vscode/property.json
vendored
@ -4,7 +4,7 @@
|
|||||||
"PL": "template"
|
"PL": "template"
|
||||||
},
|
},
|
||||||
"soc": {
|
"soc": {
|
||||||
"core": "none"
|
"core": "cortexM3"
|
||||||
},
|
},
|
||||||
"enableShowLog": false,
|
"enableShowLog": false,
|
||||||
"device": "none"
|
"device": "none"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user