File size: 749 Bytes
cca9a63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Constants used across the ChipForge server environment.
"""

import os
from pathlib import Path

MAX_STEPS = 20
LOG_TRUNCATE = 2000  # max chars in observation logs
TOOL_TIMEOUT = 30  # seconds
STEP_COST = 0.02  # per-step penalty to encourage efficiency

# Tool paths — absolute for OSS CAD Suite in Docker
VERILATOR = "/opt/oss-cad-suite/bin/verilator"
YOSYS = "/opt/oss-cad-suite/bin/yosys"

VALID_ACTIONS = {
    "view_design",
    "view_testbench",
    "view_synthesis_log",
    "view_lint_log",
    "view_simulation_log",
    "run_simulation",
    "run_synthesis",
    "run_lint",
    "edit_line",
    "append_line",
    "insert_lines",
    "replace_lines",
    "write_file",
    "submit",
}

TASKS_DIR = Path(__file__).parent / "tasks"