Skip to main content
Glama
NellyW8
by NellyW8

view_waveform

Open and analyze VCD waveform files in GTKWave viewer to visualize simulation results. Input project ID and VCD filename for effective waveform inspection in electronic design workflows.

Instructions

Open VCD waveform file in GTKWave viewer

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesProject ID from simulation (required)
vcd_fileNoVCD filename (default: output.vcd)output.vcd

Implementation Reference

  • The main handler function viewWaveform in the EDAServer class that validates the project and VCD file existence, checks for GTKWave installation, and launches GTKWave to display the waveform.
    async viewWaveform(projectId: string, vcdFile = "output.vcd"): Promise<string> { try { // Check if project exists const project = this.projects.get(projectId); if (!project) { return JSON.stringify({ success: false, error: `Project ${projectId} not found. Run a simulation first.`, }, null, 2); } const vcdPath = join(project.dir, vcdFile); // Check if VCD file exists try { await fs.access(vcdPath); } catch { // List available files to help user const files = await fs.readdir(project.dir); const vcdFiles = files.filter(f => f.endsWith('.vcd')); return JSON.stringify({ success: false, error: `VCD file '${vcdFile}' not found in project ${projectId}`, available_vcd_files: vcdFiles, note: "Make sure your testbench includes $dumpfile() and $dumpvars() commands" }, null, 2); } // Check if GTKWave is available if (!(await commandExists('gtkwave'))) { return JSON.stringify({ success: false, error: "GTKWave not found. Please install GTKWave to view waveforms.", install_instructions: { macos: "brew install gtkwave", linux: "sudo apt-get install gtkwave", windows: "Install GTKWave from http://gtkwave.sourceforge.net/" } }, null, 2); } // Launch GTKWave in background const gtkwaveCmd = `gtkwave "${vcdPath}" &`; await execAsync(gtkwaveCmd, { cwd: project.dir, timeout: 5000 }); return JSON.stringify({ success: true, message: `GTKWave launched for project ${projectId}`, vcd_file: vcdFile, vcd_path: vcdPath, project_type: project.type }, null, 2); } catch (error: any) { return JSON.stringify({ success: false, error: error.message || String(error), }, null, 2); } }
  • Input schema defining parameters for the view_waveform tool: project_id (required string) and optional vcd_file (default 'output.vcd').
    inputSchema: { type: "object", properties: { project_id: { type: "string", description: "Project ID from simulation (required)" }, vcd_file: { type: "string", description: "VCD filename (default: output.vcd)", default: "output.vcd" }, }, required: ["project_id"], },
  • src/index.ts:767-785 (registration)
    Tool registration in the list of tools returned by ListToolsRequestSchema, including name, description, and inputSchema.
    { name: "view_waveform", description: "Open VCD waveform file in GTKWave viewer", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "Project ID from simulation (required)" }, vcd_file: { type: "string", description: "VCD filename (default: output.vcd)", default: "output.vcd" }, }, required: ["project_id"], }, },
  • src/index.ts:891-901 (registration)
    Registration/dispatch in the CallToolRequestSchema handler switch statement, which extracts parameters and calls the viewWaveform handler.
    case "view_waveform": { const projectId = validateRequiredString(args, "project_id", name); const vcdFile = getStringProperty(args, "vcd_file", "output.vcd"); return { content: [{ type: "text", text: await edaServer.viewWaveform(projectId, vcdFile), }], }; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/NellyW8/mcp-EDA'

If you have feedback or need assistance with the MCP directory API, please join our Discord server