Skip to content

Commit

Permalink
fix: delete auxilar files for vivado linter
Browse files Browse the repository at this point in the history
  • Loading branch information
qarlosalberto committed Jul 30, 2023
1 parent e5195d5 commit b770edc
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
8 changes: 4 additions & 4 deletions packages/colibri/src/linter/base_linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,27 @@ export abstract class Base_linter {
}

async exec_linter(file: string, options: common.l_options) {
this.delete_previus_lint();
const file_dir = get_directory(file);
this.delete_previus_lint(file_dir);

const command = this.get_command(file, options);

const msg = `Linting with command: ${command} `;
logger.Logger.log(msg, logger.T_SEVERITY.INFO);

const P = new Process();
const file_dir = get_directory(file);
const opt: p_options = {
cwd: file_dir,
};
const result = await P.exec_wait(command, opt);

this.delete_previus_lint();
this.delete_previus_lint(file_dir);
return result;
}

abstract lint(file: string, options: common.l_options): Promise<common.l_error[]>;

abstract delete_previus_lint(): void;
abstract delete_previus_lint(working_dir: string): void;

public async lint_from_project(file_path: string, _prj_file_list: t_file[],
options: common.l_options): Promise<common.l_error[]> {
Expand Down
18 changes: 12 additions & 6 deletions packages/colibri/src/linter/vivado.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { get_os } from "../process/utils";
import { Process } from "../process/process";
import { OS } from "../process/common";
import { OS, p_options } from "../process/common";

import { get_hdl_language } from "../utils/common_utils";
import { HDL_LANG } from "../common/general";
Expand Down Expand Up @@ -51,20 +51,26 @@ export class Vivado extends Base_linter {
this.binary = binary;
}

async delete_previus_lint() {
async delete_previus_lint(working_dir: string) {
const opt: p_options = {
cwd: working_dir,
};

const os = get_os();
const p = new Process();
if (os === OS.WINDOWS) {
let command = 'del xvhdl.pb && del xvhdl.log && rmdir xsim.dir';
await p.exec_wait(command);
await p.exec_wait(command, opt);

command = 'del xvlog.pb && del xvlog.log && rmdir xsim.dir';
await p.exec_wait(command);
await p.exec_wait(command, opt);
}
else {
let command = 'rm xvhdl.pb; rm xvhdl.log; rm -R xsim.dir';
await p.exec_wait(command);
await p.exec_wait(command, opt);

command = 'rm xvlog.pb; rm xvlog.log; rm -R xsim.dir';
await p.exec_wait(command);
await p.exec_wait(command, opt);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/teroshdl/auto_package/templates/info.nj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"displayName": "TerosHDL",
"publisher": "teros-technology",
"description": "Powerful IDE for ASIC/FPGA: state machine viewer, linter, documentation, snippets... and more! ",
"version": "5.0.7",
"version": "5.0.8",
"engines": {
"vscode": "^1.74.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/teroshdl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "TerosHDL",
"publisher": "teros-technology",
"description": "Powerful IDE for ASIC/FPGA: state machine viewer, linter, documentation, snippets... and more! ",
"version": "5.0.7",
"version": "5.0.8",
"engines": {
"vscode": "^1.74.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ <h4 id="release-notes"> Minor changes v5.0.5 and v5.0.7</h4>
<li> Support for GUI in VUnit</li>
<li> Support for "copy as VHDL component" in Verilog/SV templates</li>
<li> Fix bug verilog arguments ModelSim</li>
<li> Delete auxiliar files in Vivado linter</li>
</ul>
</p>

Expand Down

0 comments on commit b770edc

Please sign in to comment.