File size: 2,658 Bytes
f4177c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Workflow 3: Local RTL Debug (Privacy Mode)
# Endpoint: POST /webhook/local-debug

# โ”€โ”€ Case 1: Incomplete MUX / latch inferred โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
curl -X POST http://localhost:5678/webhook/local-debug \
  -H "Content-Type: application/json" \
  -d '{
    "buggy_snippet": "always @(posedge clk) begin\n  if (sel == 2b00) out = a;\n  else if (sel == 2b01) out = b;\nend",
    "context": "MUX with incomplete case, possible latch inferred",
    "top_k": 3
  }'

# โ”€โ”€ Case 2: Multi-driven net โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
curl -X POST http://localhost:5678/webhook/local-debug \
  -H "Content-Type: application/json" \
  -d '{
    "buggy_snippet": "assign net_reset_sync = rst_gen_out;\nassign net_reset_sync = por_cell_rst;",
    "context": "Multiple drivers on reset sync net",
    "top_k": 3
  }'

# โ”€โ”€ Case 3: FSM latch inferred โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
curl -X POST http://localhost:5678/webhook/local-debug \
  -H "Content-Type: application/json" \
  -d '{
    "buggy_snippet": "always @(*) begin\n  case (state)\n    2b00: next = 2b01;\n    2b01: next = 2b10;\n  endcase\nend",
    "context": "FSM missing default case, latch may be inferred",
    "top_k": 3
  }'

# โ”€โ”€ Case 4: Full RTL via buggy_verilog โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
curl -X POST http://localhost:5678/webhook/local-debug \
  -H "Content-Type: application/json" \
  -d '{
    "buggy_verilog": "module adder(input clk, input [7:0] a, b, output reg [7:0] sum);\nalways @(posedge clk) begin\n  if (a > 0) sum = a + b;\nend\nendmodule",
    "context": "Adder with incomplete always block",
    "top_k": 3
  }'

# โ”€โ”€ Expected Response โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
# {
#   "success": true,
#   "session_id": "local_<timestamp>",
#   "privacy_attestation": {
#     "data_stayed_local": true,
#     "cloud_api_used": false,
#     "embedding_model": "nomic-embed-text:v1.5 (Ollama local)",
#     "llm_model": "qwen3:8b (Ollama local)"
#   },
#   "confidence_tier": "LOW|MEDIUM|HIGH",
#   "top_match_score": <float>,
#   "llm_fix_suggestion": "...",
#   "historical_matches": [...],
#   "latency_ms": <int>
# }