This commit is contained in:
锦恢 2023-07-15 23:23:08 +08:00
parent 60bebe24f1
commit 8b1aa1a1a4
10 changed files with 54 additions and 38 deletions

View File

@ -618,10 +618,6 @@
{
"id": "digital-ide-treeView-hardware",
"name": "HARD Options"
},
{
"id": "digital-ide-treeView-software",
"name": "SOFT Options"
}
]
},

View File

@ -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);

View File

@ -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);

View File

@ -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);
if (this.soc.core !== 'none') {
this.checkDirExist(this.arch.software.src);
this.checkDirExist(this.arch.software.data);
}
this.checkDirExist(this.arch.prjPath);
}

View File

@ -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() {
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() {

View File

@ -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);
}
}
}

View 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';

View File

@ -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));

View File

@ -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) {