Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SandPiper #644

Merged
merged 44 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c3c1609
feat: init support for sandpiper
qarlosalberto Jun 19, 2024
5531091
Add Sandpiper TLv to sv conversion support
Aryann15 Jul 3, 2024
0eca255
Created function to utilise sandpiper SaaS.for conversion
Aryann15 Jul 3, 2024
5587896
utility function for conversion with error handling
Aryann15 Jul 3, 2024
ff4d574
frontend handler which executes when the task type is
Aryann15 Jul 3, 2024
f0ad73a
support init for diagram generation by sandpiper
Aryann15 Jul 3, 2024
fef4f0f
Updated to handle task type.
Aryann15 Jul 3, 2024
cec57f9
Implement Sandpiper diagram generation via SaaS
Aryann15 Jul 3, 2024
9ebbda9
Add frontend support for diagram generation and viewing
Aryann15 Jul 3, 2024
8197295
ntegrate diagram generation task in frontend manager
Aryann15 Jul 3, 2024
76b503b
tl verilog language init
Aryann15 Jul 5, 2024
cf06743
configuration file for tl verilog
Aryann15 Jul 5, 2024
4c417d8
some snippets for tl verilog
Aryann15 Jul 5, 2024
b967247
syntax highlighting rules for tlverilog
Aryann15 Jul 5, 2024
13505f4
updated package.json
Aryann15 Jul 5, 2024
7ee949d
new feature for tlv init
Aryann15 Jul 5, 2024
f48774d
Add support for Sandpiper nav tlv generation
Aryann15 Jul 5, 2024
ef52f02
Added generateTlv function to generate nav tlv html
Aryann15 Jul 5, 2024
65fa9bb
frontend support for navtlv tab
Aryann15 Jul 5, 2024
d561f84
nav tlv task in task tree
Aryann15 Jul 5, 2024
5bfa728
using the current file for tl verilog function instead of default inp…
Aryann15 Jul 10, 2024
6b9cda9
update to use the current file
Aryann15 Jul 10, 2024
7648592
implement sandpiper logs to display output
Aryann15 Jul 10, 2024
90525ec
updated functions for sandpiper
Aryann15 Jul 13, 2024
c25290d
updated frontend integrations
Aryann15 Jul 13, 2024
525a145
sandpiper tests init
Aryann15 Jul 15, 2024
d0f7e6a
succesfull tetsing
Jul 15, 2024
e81899e
helper sample tlv file
Aryann15 Jul 15, 2024
86580e8
adding a custom wrapper function that catches and logs warnings inste…
Aryann15 Jul 19, 2024
ee6121c
zoom functionality added in diagram tab
Aryann15 Jul 19, 2024
007e7da
Update utils.ts
Aryann15 Jul 31, 2024
64a094d
Update manager.ts
Aryann15 Jul 31, 2024
912343c
sandpiper util functions added
Aryann15 Jul 31, 2024
e4b72fa
removed the sandpiper functions
Aryann15 Jul 31, 2024
076e63a
exporting the sandiper fnctions
Aryann15 Jul 31, 2024
271996e
minor updates in importing functions
Aryann15 Jul 31, 2024
28a974b
minor updates in importing functions
Aryann15 Jul 31, 2024
247044d
Update utils.ts
Aryann15 Jul 31, 2024
d346d34
Update utils.ts
Aryann15 Jul 31, 2024
376f170
delete commented code
Aryann15 Jul 31, 2024
13c2df6
Update utils.ts
Aryann15 Jul 31, 2024
ede463c
better naming
Aryann15 Aug 14, 2024
bcfc885
accept m4 and m5 both format outputs
Aryann15 Aug 16, 2024
57912d7
fix lint
qarlosalberto Aug 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/colibri/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@types/node": "^17.0.31",
"@types/nunjucks": "^3.1.4",
"@yowasp/yosys": "0.41.721",
"axios": "^1.7.2",
"chokidar": "3.5.3",
"cli-color": "^2.0.3",
"clone": "^2.1.2",
Expand Down
4 changes: 4 additions & 0 deletions packages/colibri/src/config/config_declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ export enum e_tools_general_select_tool {
xsim = "xsim",
raptor = "raptor",
radiant = "radiant",
sandpiper = "sandPiper",
}
export enum e_tools_general_execution_mode {
gui = "gui",
Expand Down Expand Up @@ -1802,6 +1803,9 @@ export function get_config_from_json(json_config: any): e_config {
if ( current_value_72 === "radiant"){
default_config['tools']['general']['select_tool'] = e_tools_general_select_tool.radiant;
}
if ( current_value_72 === "sandPiper"){
default_config['tools']['general']['select_tool'] = e_tools_general_select_tool.sandpiper;
}

// tools -> general -> gtkwave_installation_path
const current_value_73 = json_config['tools']['general']['gtkwave_installation_path'];
Expand Down
1 change: 1 addition & 0 deletions packages/colibri/src/config/config_web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,7 @@ export const WEB_CONFIG = `
<option value='xsim'>XSIM</option>
<option value='raptor'>Raptor Design Suite</option>
<option value='radiant'>Radiant</option>
<option value='sandpiper'>SandPiper</option>
</select>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ select_tool:
xsim: "XSIM"
raptor: "Raptor Design Suite"
radiant: "Radiant"
sandpiper: "SandPiper"

value: "ghdl"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
installation_path:
description: "Installation path:"
type: string
value: ""
1 change: 1 addition & 0 deletions packages/colibri/src/config/web_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,7 @@ <h6 class="card-subtitle mb-2 text-muted"></h6>
<option value='xsim'>XSIM</option>
<option value='raptor'>Raptor Design Suite</option>
<option value='radiant'>Radiant</option>
<option value='sandpiper'>SandPiper</option>
</select>
</div>

Expand Down
1 change: 1 addition & 0 deletions packages/colibri/src/project_manager/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export type t_terminalCommandDefinition = {
export enum e_project_type {
GENERIC = "genericProject",
QUARTUS = "quartusProject",
SANDPIPER = "TL-VerilogProject",
}

/** Type of parameter */
Expand Down
4 changes: 3 additions & 1 deletion packages/colibri/src/project_manager/export_t.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ export * as tool_common from './tool/common';
export * as utils from './utils/utils';
export * as projectEmitter from './projectEmitter';
export * as quartusProjectManager from './tool/quartus/quartusProjectManager';
export * as sandpiperProjectManager from './tool/sandpiper/sandpiperProjectManager';
export * as quartusCommon from './tool/quartus/common';
export * as quartus from './tool/quartus/utils';
export * as quartus from './tool/quartus/utils';
export * as sandpiper from './tool/sandpiper/utils'
12 changes: 11 additions & 1 deletion packages/colibri/src/project_manager/multi_project_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { e_project_type } from "./common";
import { Project_manager } from "./project_manager";
import * as file_utils from "../utils/file_utils";
import { QuartusProjectManager } from "./tool/quartus/quartusProjectManager";
import { SandpiperProjectManager } from "./tool/sandpiper/sandpiperProjectManager";
import { ProjectEmitter, e_event } from "./projectEmitter";

class ProjectNotFoundError extends Error {
Expand Down Expand Up @@ -111,7 +112,16 @@ export class Multi_project_manager {
this.add_project(
await QuartusProjectManager.fromJson(prj_info, this.sync_file_path, emitterProject)
);
} else {
}
else if (prj_info.project_type === e_project_type.SANDPIPER) {
const prj = await SandpiperProjectManager.fromJson(
prj_info, this.sync_file_path, emitterProject
);
if (prj) {
this.add_project(prj);
}
}
else {
this.add_project(
await Project_manager.fromJson(prj_info, this.sync_file_path, emitterProject)
);
Expand Down
1 change: 1 addition & 0 deletions packages/colibri/src/project_manager/project_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export class Project_manager extends ConfigManager {
e_tools_general_select_tool.ise,
e_tools_general_select_tool.openfpga,
e_tools_general_select_tool.quartus,
e_tools_general_select_tool.sandpiper,
e_tools_general_select_tool.vivado,
e_tools_general_select_tool.raptor,
];
Expand Down
4 changes: 4 additions & 0 deletions packages/colibri/src/project_manager/tool/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export enum e_taskType {
QUARTUS_TIMING = "Timing Analysis (Signoff)",
QUARTUS_RTL_ANALYZER = "RTL Analyzer",
QUARTUS_ASSEMBLER = "Assembler (Generate programming files)",
// SandPiper tasks
SANDPIPER_TLVERILOGTOVERILOG = "TL-Verilog to Verilog",
SANDPIPER_DIAGRAM_TAB = "Open Diagram Tab",
SANDPIPER_NAV_TLV_TAB = "Open Nav TLV Tab",
// Common
OPENFOLDER = "Open Project Folder",
SETTINGS = "Settings",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,9 @@ export class QuartusProjectManager extends Project_manager {
[e_taskType.QUARTUS_FITTERIMPLEMENT]: "",
[e_taskType.QUARTUS_ASSEMBLER]: "asm",
[e_taskType.QUARTUS_RTL_ANALYZER]: "",
[e_taskType.SANDPIPER_TLVERILOGTOVERILOG]: "",
[e_taskType.SANDPIPER_DIAGRAM_TAB]:"",
[e_taskType.SANDPIPER_NAV_TLV_TAB]:""
};
let reportKeys = Object.keys(reportSufix);
if (reportType === e_reportType.REPORT && reportKeys.includes(taskType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ const taskDependencies: Record<e_taskType, e_taskType[]> = {
e_taskType.QUARTUS_ROUTE,
e_taskType.QUARTUS_FITTERFINALIZE,
],
[e_taskType.SANDPIPER_TLVERILOGTOVERILOG]: [],
[e_taskType.SANDPIPER_DIAGRAM_TAB]:[],
[e_taskType.SANDPIPER_NAV_TLV_TAB]:[]
};

function executeCommandList(projectName: string, commands: string[], cwd: string, emitter: ProjectEmitter,
Expand Down Expand Up @@ -200,7 +203,9 @@ export function runTask(taskType: e_taskType, taskManager: TaskStateManager, qua

[e_taskType.QUARTUS_ASSEMBLER]:
`${binASM} --read_settings_files=on --write_settings_files=off ${projectName} -c ${revisionName}`,

[e_taskType.SANDPIPER_TLVERILOGTOVERILOG]: "",
[e_taskType.SANDPIPER_DIAGRAM_TAB]:"",
[e_taskType.SANDPIPER_NAV_TLV_TAB]:"",
};

const cmdList: string[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/colibri/src/project_manager/tool/quartus/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -725,4 +725,4 @@ export function escapeBackslashes(path: string): string {
return path.replace(/\\/g, '\\\\');
}
return path;
}
}
34 changes: 34 additions & 0 deletions packages/colibri/src/project_manager/tool/sandpiper/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This code only can be used for Quartus boards

import { e_taskExecutionType, t_taskRep, e_taskType } from "../common";

export function getDefaultTaskList(): t_taskRep[] {
const taskList: t_taskRep[] = [
{
"name": e_taskType.OPENFOLDER,
"label": "Open Project Folder",
"executionType": e_taskExecutionType.OPENFOLDER,
},
{
"name": e_taskType.SETTINGS,
"label": "Settings",
"executionType": e_taskExecutionType.OPENSETTINGS,
},
{
"name": e_taskType.SANDPIPER_TLVERILOGTOVERILOG,
"label": "Convert TL-Verilog to Verilog",
"executionType": e_taskExecutionType.SIMPLECOMMAND,
},
{
"name": e_taskType.SANDPIPER_DIAGRAM_TAB,
"label": "Open Diagram Tab",
"executionType": e_taskExecutionType.SIMPLECOMMAND,
},
{
"name": e_taskType.SANDPIPER_NAV_TLV_TAB,
"label": "Open NAV TLV Tab",
"executionType": e_taskExecutionType.SIMPLECOMMAND,
},
];
return taskList;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
import { e_project_type, e_source_type } from "../../common";
import { Project_manager } from "../../project_manager";
import {
e_taskType, t_taskRep,
t_test_declaration,
t_test_result
} from "../common";
import { p_result } from "../../../process/common";
import { ChildProcess } from "child_process";
import { runTask } from "./taskRunner";
import { ProjectEmitter } from "../../projectEmitter";
import { TaskStateManager } from "../taskState";
import { getDefaultTaskList } from "./common";
import * as file_utils from "../../../utils/file_utils";
import { get_config_from_json } from "../../../config/config_declaration";

export class SandpiperProjectManager extends Project_manager {

constructor(name: string, emitterProject: ProjectEmitter, projectDiskPath: string) {
super(name, emitterProject);
this._projectDiskPath = projectDiskPath;
super.taskStateManager = new TaskStateManager(getDefaultTaskList());
}

public getProjectType(): e_project_type {
return e_project_type.SANDPIPER;
}

public getTaskStatus(): { "taskList": t_taskRep[], "currentTask": e_taskType | undefined } {
return {
"taskList": this.taskStateManager.getTaskList(),
"currentTask": this.taskStateManager.getCurrentTask()
};
}

public runTask(taskType: e_taskType, callback: (result: p_result) => void): ChildProcess {
this.taskStateManager.setCurrentTask(undefined);

return runTask(
taskType, this.taskStateManager, this._projectDiskPath, this.get_name(), this.emitterProject, callback
);
}

public getRunTitle(): string {
return "TESTBENCHES";
}

public async run(_test_list: t_test_declaration[],
_callback: (result: t_test_result[]) => void,
_callback_stream: (stream_c: any) => void): Promise<any> {

return "Not implemented";
}

static async fromJson(jsonContent: any, reference_path: string, emitterProject: ProjectEmitter)
: Promise<SandpiperProjectManager> {

let projectDiskPath = "";
try {
projectDiskPath = jsonContent.project_disk_path;
}
catch (error) {
console.log("Error reading project_disk_path from json");
}

const prj = new SandpiperProjectManager(jsonContent.name, emitterProject, projectDiskPath);

// Files
jsonContent.files.forEach((file: any) => {
const name = file_utils.get_absolute_path(file_utils.get_directory(reference_path), file.name);

const is_include_file = file?.["is_include_file"] ?? false;
const include_path = file?.["include_path"] ?? "";
const logical_name = file?.["logical_name"] ?? "";
const is_manual = file?.["is_manual"] ?? true;
const file_type = file_utils.get_language_from_filepath(name);
const file_version = file_utils.check_default_version_for_filepath(name, file.file_version);
const source_type = file?.["source_type"] ?? e_source_type.NONE;

prj.add_file({
name: name, is_include_file: is_include_file,
include_path: include_path, logical_name: logical_name,
is_manual: is_manual, file_type: file_type,
file_version: file_version,
source_type: source_type,
});
});
// Toplevel

if (jsonContent.toplevel !== undefined) {
const toplevel_path = file_utils.get_absolute_path(file_utils.get_directory(reference_path),
jsonContent.toplevel);
if (file_utils.check_if_path_exist(toplevel_path)) {
prj.add_toplevel_path(toplevel_path);
}
}

// Watchers
const watcher_list = jsonContent?.["watchers"] ?? [];
watcher_list.forEach((watcher: any) => {
prj.add_file_to_watcher(watcher);
});

if (jsonContent?.["configuration"] !== undefined) {
await prj.set_config(get_config_from_json(jsonContent?.["configuration"]));
}

return prj;
}

}
51 changes: 51 additions & 0 deletions packages/colibri/src/project_manager/tool/sandpiper/taskRunner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { ChildProcess, spawn } from "child_process";
import { p_result } from "../../../process/common";
import { e_taskType } from "../common";
import { ProjectEmitter } from "../../projectEmitter";
import { TaskStateManager } from "../taskState";

export function runTask(
taskType: e_taskType,
_taskManager: TaskStateManager,
projectDir: string,
_projectName: string,
_emitter: ProjectEmitter,
callback: (result: p_result) => void
): ChildProcess {
_taskManager.setCurrentTask(taskType);

let command: string;
let args: string[];

switch (taskType) {
case e_taskType.SANDPIPER_TLVERILOGTOVERILOG:
command = "echo";
args = ["TL-Verilog to Verilog conversion initiated"];
break;
case e_taskType.SANDPIPER_DIAGRAM_TAB:
command = "echo";
args = ["Diagram generation initiated"];
break;
case e_taskType.SANDPIPER_NAV_TLV_TAB:
command = "echo";
args = ["NavTLV generation initiated"];
break;
default:
command = "echo";
args = ["Unrecognized task type"];
}
const childProcess = spawn(command, args, { cwd: projectDir });

childProcess.on("close", (code) => {
const result: p_result = {
command: `${command} ${args.join(" ")}`,
stdout: code === 0 ? `${taskType} process completed.` : "",
stderr: code !== 0 ? `Error occurred during ${taskType}.` : "",
return_value: code ?? 0,
successful: code === 0,
};
callback(result);
});

return childProcess;
}
Loading
Loading