#fix bug
This commit is contained in:
parent
60bebe24f1
commit
8b1aa1a1a4
@ -618,10 +618,6 @@
|
||||
{
|
||||
"id": "digital-ide-treeView-hardware",
|
||||
"name": "HARD Options"
|
||||
},
|
||||
{
|
||||
"id": "digital-ide-treeView-software",
|
||||
"name": "SOFT Options"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -42,7 +42,7 @@ function registerTreeView(context: vscode.ExtensionContext) {
|
||||
vscode.window.registerTreeDataProvider('digital-ide-treeView-arch', treeView.moduleTreeProvider);
|
||||
vscode.window.registerTreeDataProvider('digital-ide-treeView-tool', treeView.toolTreeProvider);
|
||||
vscode.window.registerTreeDataProvider('digital-ide-treeView-hardware', treeView.hardwareTreeProvider);
|
||||
vscode.window.registerTreeDataProvider('digital-ide-treeView-software', treeView.softwareTreeProvider);
|
||||
// vscode.window.registerTreeDataProvider('digital-ide-treeView-software', treeView.softwareTreeProvider);
|
||||
|
||||
// constant used in tree
|
||||
vscode.commands.executeCommand('setContext', 'TOOL-tree-expand', false);
|
||||
|
@ -58,7 +58,7 @@ class Output {
|
||||
*/
|
||||
public report(message: string | unknown, type: ReportType = ReportType.Info, reportInWindows: boolean = false) {
|
||||
if (!this.skipMessage(type) && message) {
|
||||
this._output.show(true);
|
||||
// this._output.show(true);
|
||||
const currentTime = this.getCurrentTime();
|
||||
this._output.appendLine('[' + type + ' - ' + currentTime + '] ' + message);
|
||||
|
||||
|
@ -411,22 +411,16 @@ class PrjInfo implements PrjInfoMeta {
|
||||
this.setDefaultValue(this.arch.software, 'src', workspacePath);
|
||||
this.setDefaultValue(this.arch.software, 'data', workspacePath);
|
||||
this.setDefaultValue(this.arch, 'prjPath', workspacePath);
|
||||
|
||||
// // check existence & make dir
|
||||
// this.checkDirExist(this.arch.hardware.sim);
|
||||
// this.checkDirExist(this.arch.hardware.src);
|
||||
// this.checkDirExist(this.arch.hardware.data);
|
||||
// this.checkDirExist(this.arch.software.src);
|
||||
// this.checkDirExist(this.arch.software.data);
|
||||
// this.checkDirExist(this.arch.prjPath);
|
||||
}
|
||||
|
||||
public checkArchDirExist() {
|
||||
this.checkDirExist(this.arch.hardware.sim);
|
||||
this.checkDirExist(this.arch.hardware.src);
|
||||
this.checkDirExist(this.arch.hardware.data);
|
||||
this.checkDirExist(this.arch.software.src);
|
||||
this.checkDirExist(this.arch.software.data);
|
||||
if (this.soc.core !== 'none') {
|
||||
this.checkDirExist(this.arch.software.src);
|
||||
this.checkDirExist(this.arch.software.data);
|
||||
}
|
||||
this.checkDirExist(this.arch.prjPath);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* PL: program logic
|
||||
* Hardware Programming
|
||||
*/
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import { PLConfig, XilinxOperation } from './xilinx';
|
||||
@ -18,7 +22,7 @@ class PlManage extends BaseManage {
|
||||
tool: 'default',
|
||||
path: '',
|
||||
ope: new XilinxOperation(),
|
||||
terminal: this.createTerminal('Hardware')
|
||||
terminal: null
|
||||
};
|
||||
|
||||
if (opeParam.prjInfo.toolChain) {
|
||||
@ -41,7 +45,13 @@ class PlManage extends BaseManage {
|
||||
|
||||
|
||||
public launch() {
|
||||
this.config.ope.launch(this.config);
|
||||
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() {
|
||||
|
@ -126,6 +126,11 @@ class XilinxOperation {
|
||||
* @param config
|
||||
*/
|
||||
async launch(config: PLConfig): Promise<string | undefined> {
|
||||
const vivadoTerminal = config.terminal;
|
||||
if (!vivadoTerminal) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let scripts: string[] = [];
|
||||
|
||||
let prjFilePath = this.prjPath as AbsPath;
|
||||
@ -152,7 +157,7 @@ class XilinxOperation {
|
||||
}
|
||||
|
||||
const tclPath = hdlPath.join(this.xilinxPath, 'launch.tcl');
|
||||
scripts.push(this.refresh());
|
||||
scripts.push(this.getRefreshCmd());
|
||||
scripts.push(`file delete ${tclPath} -force`);
|
||||
const tclCommands = scripts.join('\n') + '\n';
|
||||
|
||||
@ -160,8 +165,9 @@ class XilinxOperation {
|
||||
|
||||
const argu = `-notrace -nolog -nojournal`;
|
||||
const cmd = `${config.path} -mode tcl -s ${tclPath} ${argu}`;
|
||||
config.terminal?.show(true);
|
||||
config.terminal?.sendText(cmd);
|
||||
|
||||
vivadoTerminal.show(true);
|
||||
vivadoTerminal.sendText(cmd);
|
||||
}
|
||||
|
||||
create(scripts: string[]) {
|
||||
@ -177,7 +183,7 @@ class XilinxOperation {
|
||||
scripts.push(`open_project ${path} -quiet`);
|
||||
}
|
||||
|
||||
refresh(terminal?: vscode.Terminal): string {
|
||||
private getRefreshCmd(): string {
|
||||
const scripts: string[] = [];
|
||||
// 清除所有源文件
|
||||
scripts.push(`remove_files -quiet [get_files]`);
|
||||
@ -259,9 +265,8 @@ class XilinxOperation {
|
||||
for (const file of HDLFiles) {
|
||||
if (file.type === "src") {
|
||||
scripts.push(`add_files ${file.path} -quiet`);
|
||||
} else if (file.type === "sim") {
|
||||
scripts.push(`add_files -fileset sim_1 ${file.path} -quiet`);
|
||||
}
|
||||
scripts.push(`add_files -fileset sim_1 ${file.path} -quiet`);
|
||||
}
|
||||
|
||||
scripts.push(`add_files -fileset constrs_1 ${this.datPath} -quiet`);
|
||||
@ -283,11 +288,14 @@ class XilinxOperation {
|
||||
script += `file delete ${scriptPath} -force\n`;
|
||||
hdlFile.writeFile(scriptPath, script);
|
||||
const cmd = `source ${scriptPath} -quiet`;
|
||||
|
||||
terminal?.sendText(cmd);
|
||||
return cmd;
|
||||
}
|
||||
|
||||
refresh(terminal: vscode.Terminal) {
|
||||
const cmd = this.getRefreshCmd();
|
||||
terminal.sendText(cmd);
|
||||
}
|
||||
|
||||
simulate(config: PLConfig) {
|
||||
this.simulateCli(config);
|
||||
}
|
||||
@ -507,7 +515,9 @@ class XilinxOperation {
|
||||
processFileInPrj(files: string[], config: PLConfig, command: string) {
|
||||
const terminal = config.terminal;
|
||||
if (terminal) {
|
||||
files.forEach(file => terminal.sendText(`${command} ${file}`));
|
||||
for (const file of files) {
|
||||
terminal.sendText(command + ' ' + file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
/**
|
||||
* PS: processing system
|
||||
* software of cpu
|
||||
*/
|
||||
import * as vscode from 'vscode';
|
||||
import { opeParam } from '../../global';
|
||||
import { ToolChainType } from '../../global/enum';
|
||||
|
@ -7,10 +7,10 @@ import { pickLibrary } from './libPick';
|
||||
function registerManagerCommands(context: vscode.ExtensionContext) {
|
||||
// make ps and ps have been prepared
|
||||
assert(prjManage.pl, 'pl is undefined');
|
||||
assert(prjManage.ps, 'ps is undefined');
|
||||
// assert(prjManage.ps, 'ps is undefined');
|
||||
|
||||
const plManage = prjManage.pl;
|
||||
const psManage = prjManage.ps;
|
||||
// const psManage = prjManage.ps;
|
||||
|
||||
vscode.commands.registerCommand('digital-ide.property-json.generate', prjManage.generatePropertyJson);
|
||||
vscode.commands.registerCommand('digital-ide.property-json.overwrite', prjManage.overwritePropertyJson);
|
||||
@ -20,9 +20,9 @@ function registerManagerCommands(context: vscode.ExtensionContext) {
|
||||
|
||||
// ps toolbox commands (soft tool in treeView)
|
||||
// TODO : finish digital-ide.soft.download
|
||||
vscode.commands.registerCommand('digital-ide.soft.launch', () => psManage.launch());
|
||||
vscode.commands.registerCommand('digital-ide.soft.build', () => psManage.build());
|
||||
vscode.commands.registerCommand('digital-ide.soft.download', () => psManage.program());
|
||||
// vscode.commands.registerCommand('digital-ide.soft.launch', () => psManage.launch());
|
||||
// vscode.commands.registerCommand('digital-ide.soft.build', () => psManage.build());
|
||||
// vscode.commands.registerCommand('digital-ide.soft.download', () => psManage.program());
|
||||
|
||||
// pl functional commands
|
||||
vscode.commands.registerCommand('digital-ide.pl.setSrcTop', (item) => plManage.setSrcTop(item));
|
||||
|
@ -142,8 +142,10 @@ class PrjManage {
|
||||
MainOutput.report(`finish analyse ${hdlFiles.length} hdl files, find ${unhandleNum} unsolved instances`, ReportType.Info);
|
||||
|
||||
this.pl = new PlManage();
|
||||
this.ps = new PsManage();
|
||||
MainOutput.report('create pl and ps', ReportType.Info);
|
||||
|
||||
// TODO : finish it later
|
||||
// this.ps = new PsManage();
|
||||
MainOutput.report('create pl', ReportType.Info);
|
||||
|
||||
|
||||
if (countTimeCost) {
|
||||
@ -199,11 +201,11 @@ class PrjManage {
|
||||
|
||||
const nextmode = this.getNextMode(rawPrjInfo);
|
||||
const currmode = this.getCurrentMode(softwarePath, hardwarePath);
|
||||
|
||||
|
||||
if (currmode === nextmode) {
|
||||
const hardware = opeParam.prjInfo.arch.hardware;
|
||||
const software = opeParam.prjInfo.arch.software;
|
||||
|
||||
const software = opeParam.prjInfo.arch.software;
|
||||
|
||||
hdlDir.mkdir(hardware.src);
|
||||
hdlDir.mkdir(hardware.sim);
|
||||
hdlDir.mkdir(hardware.data);
|
||||
|
@ -206,7 +206,7 @@ class PpyAction extends BaseAction {
|
||||
|
||||
const currentPathSet = this.getImportantPathSet();
|
||||
const currentLibState = opeParam.prjInfo.library.state;
|
||||
|
||||
|
||||
if (isSameSet(originalPathSet, currentPathSet)) {
|
||||
// skip hdl remake
|
||||
if (originalLibState !== currentLibState) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user