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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
zoom functionality added in diagram tab
  • Loading branch information
Aryann15 authored and qarlosalberto committed Jul 31, 2024
commit ee6121c2bd80439255cdbcf265451e517b98251b
148 changes: 105 additions & 43 deletions packages/teroshdl/src/features/tree_views/tasks/sandpiper_utils.ts
Original file line number Diff line number Diff line change
@@ -12,15 +12,15 @@ export async function runSandpiperConversion(
emitterProject: teroshdl2.project_manager.projectEmitter.ProjectEmitter
) {
try {
sandpiperLogger(emitterProject);
sandpiperLogger(emitterProject);
const selectedProject = project.get_selected_project();
const editor = vscode.window.activeTextEditor;

if (!editor) {
vscode.window.showWarningMessage('No active editor found. Please open a file to run the conversion.');
return;
}

const currentFileContent = editor.document.getText();
const currentFileName = path.basename(editor.document.fileName);

@@ -29,7 +29,6 @@ export async function runSandpiperConversion(
return;
}


vscode.window.showInformationMessage('Starting Sandpiper TL-Verilog to Verilog conversion...');

await teroshdl2.project_manager.quartus.runTLVerilogToVerilogConversion(
@@ -57,7 +56,7 @@ export async function runSandpiperDiagramGeneration(
vscode.window.showWarningMessage('No active editor found. Please open a file to generate the diagram.');
return;
}

const currentFileContent = editor.document.getText();
const currentFileName = path.basename(editor.document.fileName);

@@ -105,40 +104,109 @@ function showSvgInWebview(svgFilePath: string) {
vscode.ViewColumn.Two,
{
enableScripts: true,
retainContextWhenHidden: true,
retainContextWhenHidden: true
}
);

const svg = fs.readFileSync(svgFilePath, 'utf8');
const webviewContent = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sandpiper Diagram Viewer</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
}
svg {
max-width: 100%;
max-height: 100%;
border: 1px solid #ccc;
background-color: white;
}
</style>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sandpiper Diagram Viewer</title>
<style>
body {
margin: 0;
padding: 0;
height: 100vh;
display: flex;
flex-direction: column;
background-color: #f0f0f0;
}
.controls-container {
position: fixed;
top: 10px;
right: 10px;
z-index: 1000;
}
.zoom-controls {
display: flex;
flex-direction: column;
background-color: white;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.zoom-button {
padding: 5px 10px;
font-size: 18px;
cursor: pointer;
border: none;
background-color: transparent;
}
.zoom-button:hover {
background-color: #f0f0f0;
}
.zoom-reset {
border-top: 1px solid #ccc;
font-size: 14px;
}
.svg-container {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
svg {
max-width: 100%;
max-height: 100%;
border: 1px solid #ccc;
background-color: white;
}
</style>
</head>
<body>
<div class="controls-container">
<div class="zoom-controls">
<button class="zoom-button" onclick="zoomIn()">+</button>
<button class="zoom-button" onclick="zoomOut()">-</button>
<button class="zoom-button zoom-reset" onclick="resetZoom()">RESET</button>
</div>
</div>
<div class="svg-container" id="svg-container">
${svg}
</body>
</html>
`;
</div>

<script>
//@ts-nocheck
let currentZoom = 1;
const svgContainer = document.getElementById('svg-container');
const svg = svgContainer.querySelector('svg');

function zoomIn() {
currentZoom *= 1.2;
updateZoom();
}

function zoomOut() {
currentZoom /= 1.2;
updateZoom();
}

function resetZoom() {
currentZoom = 1;
updateZoom();
}

function updateZoom() {
svg.style.transform = \`scale(\${currentZoom})\`;
}
</script>
</body>
</html>
` as const;

panel.webview.html = webviewContent;
}
@@ -154,7 +222,7 @@ export async function runSandpiperNavTlvGeneration(
vscode.window.showWarningMessage('No active editor found. Please open a file to generate NavTLV.');
return;
}

const currentFileContent = editor.document.getText();
const currentFileName = path.basename(editor.document.fileName);

@@ -196,15 +264,10 @@ export async function runSandpiperNavTlvGeneration(
}

function showNavTlvInWebview(navTlvHtml: string) {
const panel = vscode.window.createWebviewPanel(
'navTlvViewer',
'Nav TLV Viewer',
vscode.ViewColumn.Two,
{
enableScripts: true,
retainContextWhenHidden: true,
}
);
const panel = vscode.window.createWebviewPanel('navTlvViewer', 'Nav TLV Viewer', vscode.ViewColumn.Two, {
enableScripts: true,
retainContextWhenHidden: true
});

const modifiedHtml = `
<!DOCTYPE html>
@@ -238,4 +301,3 @@ function showNavTlvInWebview(navTlvHtml: string) {

panel.webview.html = modifiedHtml;
}