From 99616b37fe71c8daf4dbc1790038b6f6cb3cb637 Mon Sep 17 00:00:00 2001 From: qarlosalberto Date: Sun, 3 Nov 2024 19:32:43 +0100 Subject: [PATCH] expose Quartus commands --- auto_package/command.yml | 42 ++++++++++++ auto_package/templates/info.nj | 2 +- package.json | 58 +++++++++++++++- .../features/tree_views/tasks/manager.ts | 67 ++++++++++++++++++- 4 files changed, 166 insertions(+), 3 deletions(-) diff --git a/auto_package/command.yml b/auto_package/command.yml index 678c0c70..0a0d1809 100644 --- a/auto_package/command.yml +++ b/auto_package/command.yml @@ -203,6 +203,48 @@ when: "viewItem =~ /snapshotviewer/" group: "inline" +- name: project.quartus.rtlAnalyzer + title: "TerosHDL [Quartus]: Open RTL Analyzer" + +- name: project.quartus.compileDesigh + title: "TerosHDL [Quartus]: Run Compile Design" + +- name: project.quartus.analysisAndSynthesis + title: "TerosHDL [Quartus]: run Analysis and Synthesis" + +- name: project.quartus.analysisAndElaboration + title: "TerosHDL [Quartus]: run Analysis and Elaboration" + +- name: project.quartus.synthesis + title: "TerosHDL [Quartus]: run Synthesis" + +- name: project.quartus.earlyTimingAnalysis + title: "TerosHDL [Quartus]: run Early Timing Analysis" + +- name: project.quartus.fitter + title: "TerosHDL [Quartus]: run Fitter" + +- name: project.quartus.fitterImplement + title: "TerosHDL [Quartus]: run Fitter Implement" + +- name: project.quartus.plan + title: "TerosHDL [Quartus]: run Plan" + +- name: project.quartus.place + title: "TerosHDL [Quartus]: run Place" + +- name: project.quartus.route + title: "TerosHDL [Quartus]: run Route" + +- name: project.quartus.fitterFinalize + title: "TerosHDL [Quartus]: run Fitter Finalize" + +- name: project.quartus.timingAnalysisSignoff + title: "TerosHDL [Quartus]: run Timing Analysis Signoff" + +- name: project.quartus.assembler + title: "TerosHDL [Quartus]: run Assembler" + ## Watcher - name: view.watcher.add title: "Add" diff --git a/auto_package/templates/info.nj b/auto_package/templates/info.nj index 719ca01c..72d16f99 100644 --- a/auto_package/templates/info.nj +++ b/auto_package/templates/info.nj @@ -2,7 +2,7 @@ "displayName": "TerosHDL", "publisher": "teros-technology", "description": "Powerful toolbox for ASIC/FPGA: state machine viewer, linter, documentation, snippets... and more! ", -"version": "6.0.13", +"version": "6.0.14", "engines": { "vscode": "^1.74.0" }, diff --git a/package.json b/package.json index 312fc710..aa50d4eb 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "TerosHDL", "publisher": "teros-technology", "description": "Powerful toolbox for ASIC/FPGA: state machine viewer, linter, documentation, snippets... and more! ", - "version": "6.0.13", + "version": "6.0.14", "engines": { "vscode": "^1.74.0" }, @@ -645,6 +645,62 @@ }, "title": "Open Snapshop Viewer" }, + { + "command": "teroshdl.project.quartus.rtlAnalyzer", + "title": "TerosHDL [Quartus]: Open RTL Analyzer" + }, + { + "command": "teroshdl.project.quartus.compileDesigh", + "title": "TerosHDL [Quartus]: Run Compile Design" + }, + { + "command": "teroshdl.project.quartus.analysisAndSynthesis", + "title": "TerosHDL [Quartus]: run Analysis and Synthesis" + }, + { + "command": "teroshdl.project.quartus.analysisAndElaboration", + "title": "TerosHDL [Quartus]: run Analysis and Elaboration" + }, + { + "command": "teroshdl.project.quartus.synthesis", + "title": "TerosHDL [Quartus]: run Synthesis" + }, + { + "command": "teroshdl.project.quartus.earlyTimingAnalysis", + "title": "TerosHDL [Quartus]: run Early Timing Analysis" + }, + { + "command": "teroshdl.project.quartus.fitter", + "title": "TerosHDL [Quartus]: run Fitter" + }, + { + "command": "teroshdl.project.quartus.fitterImplement", + "title": "TerosHDL [Quartus]: run Fitter Implement" + }, + { + "command": "teroshdl.project.quartus.plan", + "title": "TerosHDL [Quartus]: run Plan" + }, + { + "command": "teroshdl.project.quartus.place", + "title": "TerosHDL [Quartus]: run Place" + }, + { + "command": "teroshdl.project.quartus.route", + "title": "TerosHDL [Quartus]: run Route" + }, + { + "command": "teroshdl.project.quartus.fitterFinalize", + "title": "TerosHDL [Quartus]: run Fitter Finalize" + }, + { + "command": "teroshdl.project.quartus.timingAnalysisSignoff", + "title": "TerosHDL [Quartus]: run Timing Analysis Signoff" + }, + { + "command": "teroshdl.project.quartus.assembler", + "title": "TerosHDL [Quartus]: run Assembler" + }, { "command": "teroshdl.view.watcher.add", "icon": { diff --git a/src/teroshdl/features/tree_views/tasks/manager.ts b/src/teroshdl/features/tree_views/tasks/manager.ts index bcdb8f9f..dd02f374 100644 --- a/src/teroshdl/features/tree_views/tasks/manager.ts +++ b/src/teroshdl/features/tree_views/tasks/manager.ts @@ -20,7 +20,7 @@ import * as vscode from "vscode"; import * as element from "./element"; import { Multi_project_manager } from 'colibri/project_manager/multi_project_manager'; -import { TaskDecorator } from "./element"; +import { Task, TaskDecorator } from "./element"; import { ChildProcess, spawn } from "child_process"; import { LogView } from "../../views/logs"; import * as tree_kill from 'tree-kill'; @@ -95,6 +95,71 @@ export class Tasks_manager extends BaseView { vscode.commands.registerCommand("teroshdl.view.tasks.clean", () => this.clean()); vscode.commands.registerCommand("teroshdl.view.tasks.device", () => this.device()); vscode.commands.registerCommand("teroshdl.view.tasks.console", () => this.openConsole()); + + + // Quartus Commands + vscode.commands.registerCommand("teroshdl.project.quartus.rtlAnalyzer", + () => this.runQuartusTask(e_taskType.QUARTUS_RTL_ANALYZER)); + + vscode.commands.registerCommand("teroshdl.project.quartus.compileDesigh", + () => this.runQuartusTask(e_taskType.QUARTUS_COMPILEDESIGN)); + + vscode.commands.registerCommand("teroshdl.project.quartus.analysisAndSynthesis", + () => this.runQuartusTask(e_taskType.QUARTUS_ANALYSISSYNTHESIS)); + + vscode.commands.registerCommand("teroshdl.project.quartus.analysisAndElaboration", + () => this.runQuartusTask(e_taskType.QUARTUS_ANALYSISELABORATION)); + + vscode.commands.registerCommand("teroshdl.project.quartus.synthesis", + () => this.runQuartusTask(e_taskType.QUARTUS_SYNTHESIS)); + + vscode.commands.registerCommand("teroshdl.project.quartus.earlyTimingAnalysis", + () => this.runQuartusTask(e_taskType.QUARTUS_EARLYTIMINGANALYSIS)); + + vscode.commands.registerCommand("teroshdl.project.quartus.fitter", + () => this.runQuartusTask(e_taskType.QUARTUS_FITTER)); + + vscode.commands.registerCommand("teroshdl.project.quartus.fitterImplement", + () => this.runQuartusTask(e_taskType.QUARTUS_FITTERIMPLEMENT)); + + vscode.commands.registerCommand("teroshdl.project.quartus.plan", + () => this.runQuartusTask(e_taskType.QUARTUS_PLAN)); + + vscode.commands.registerCommand("teroshdl.project.quartus.place", + () => this.runQuartusTask(e_taskType.QUARTUS_PLACE)); + + vscode.commands.registerCommand("teroshdl.project.quartus.route", + () => this.runQuartusTask(e_taskType.QUARTUS_ROUTE)); + + vscode.commands.registerCommand("teroshdl.project.quartus.fitterFinalize", + () => this.runQuartusTask(e_taskType.QUARTUS_FITTERFINALIZE)); + + vscode.commands.registerCommand("teroshdl.project.quartus.timingAnalysisSignoff", + () => this.runQuartusTask(e_taskType.QUARTUS_TIMING)); + + vscode.commands.registerCommand("teroshdl.project.quartus.assembler", + () => this.runQuartusTask(e_taskType.QUARTUS_ASSEMBLER)); + } + + private runQuartusTask(task: e_taskType) { + const allTaskItems = this.tree.data; + function searchTask(taskItesm: element.Task[]) { + for (const taskItem of taskItesm) { + if (taskItem.taskDefinition.name === task) { + return taskItem; + } + if (taskItem.children) { + const result = searchTask(taskItem.children); + if (result) { + return result; + } + } + } + } + const taskItem = searchTask(allTaskItems); + if (taskItem) { + this.run(taskItem); + } } /**