Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+6
- Dockerfile+22-5
- README.md+35-15
- client.py+1-1
- inference.py+25-25
- openenv.yaml+4-4
- requirements.txtAdded+12
- server/app.py+5-5
- server/graders.py+103-19
- server/rtl_debugger_environment.py+10-7
- tasks/task1/design_active.v+3-5
- tasks/task1/results.xml+2-2
- tasks/task1/sim_build/VtopAdded+3
- tasks/task1/sim_build/Vtop.cppAdded+99
- tasks/task1/sim_build/Vtop.hAdded+92
- tasks/task1/sim_build/Vtop.mkAdded+72
- tasks/task1/sim_build/Vtop__ALL.aAdded
- tasks/task1/sim_build/Vtop__ALL.cppAdded+10
- tasks/task1/sim_build/Vtop__ALL.dAdded+14
- tasks/task1/sim_build/Vtop__ALL.oAdded
- tasks/task1/sim_build/Vtop__Dpi.cppAdded+16
- tasks/task1/sim_build/Vtop__Dpi.hAdded+22
- tasks/task1/sim_build/Vtop__Syms.cppAdded+50
- tasks/task1/sim_build/Vtop__Syms.hAdded+47
- tasks/task1/sim_build/Vtop___024root.hAdded+47
- tasks/task1/sim_build/Vtop___024root__DepSet_h84412442__0.cppAdded+40
- tasks/task1/sim_build/Vtop___024root__DepSet_h84412442__0__Slow.cppAdded+24
- tasks/task1/sim_build/Vtop___024root__DepSet_heccd7ead__0.cppAdded+179
- tasks/task1/sim_build/Vtop___024root__DepSet_heccd7ead__0__Slow.cppAdded+154
- tasks/task1/sim_build/Vtop___024root__Slow.cppAdded+24
- tasks/task1/sim_build/Vtop__pch.hAdded+29
- tasks/task1/sim_build/Vtop__ver.dAdded+1
- tasks/task1/sim_build/Vtop__verFiles.datAdded+23
- tasks/task1/sim_build/Vtop_classes.mkAdded+57
- tasks/task1/sim_build/sim.vvp+10-10
- tasks/task1/sim_build/verilated.dAdded+12
- tasks/task1/sim_build/verilated.oAdded+3
- tasks/task1/sim_build/verilated_dpi.dAdded+12
- tasks/task1/sim_build/verilated_dpi.oAdded
- tasks/task1/sim_build/verilated_threads.dAdded+8
- tasks/task1/sim_build/verilated_threads.oAdded
- tasks/task1/sim_build/verilated_vpi.dAdded+13
- tasks/task1/sim_build/verilated_vpi.oAdded+3
- tasks/task1/sim_build/verilator.dAdded+14
- tasks/task1/sim_build/verilator.oAdded
- tasks/task2/design_active.v+15-18
- tasks/task2/result.json+24-24
- tasks/task2/results.xml+4-2
- tasks/task2/sim_build/sim.vvp+19-42
- tasks/task3/design_active.v+37-37
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines33343536373839404132 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttasks/task1/sim_build/Vtop filter=lfs diff=lfs merge=lfs -texttasks/task1/sim_build/verilated.o filter=lfs diff=lfs merge=lfs -texttasks/task1/sim_build/verilated_vpi.o filter=lfs diff=lfs merge=lfs -texttasks/task3/sim_build/Vtop filter=lfs diff=lfs merge=lfs -texttasks/task3/sim_build/verilated.o filter=lfs diff=lfs merge=lfs -texttasks/task3/sim_build/verilated_vpi.o filter=lfs diff=lfs merge=lfs -text
15 unmodified lines161718192021222324252634 unmodified lines616263646566674 unmodified lines7273747576774 unmodified lines828384858687888915 unmodified linesWORKDIR /app# Ensure git, iverilog, and make are availableARG DEBIAN_FRONTEND=noninteractiveRUN apt-get update && \apt-get install -y --no-install-recommends git iverilog make && \rm -rf /var/lib/apt/lists/*# Build argument to control whether we're building standalone or in-repoARG BUILD_MODE=in-repoARG ENV_NAME=rtl_debugger34 unmodified lines# Install runtime dependencies (iverilog and make)ARG DEBIAN_FRONTEND=noninteractiveRUN apt-get update && \apt-get install -y --no-install-recommends iverilog make && \rm -rf /var/lib/apt/lists/*WORKDIR /app4 unmodified lines# Copy the environment codeCOPY --from=builder /app/env /app/env# Set PATH to use the virtual environmentENV PATH="/app/.venv/bin:$PATH"4 unmodified lines# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \CMD curl -f http://localhost:8000/health || exit 1# Run the FastAPI server# The module path is constructed to work with the /app/env structureCMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port 8000"]15 unmodified lines16171819202122232425262728293031323334353637383934 unmodified lines7475767778798081824 unmodified lines87888990919293944 unmodified lines9910010110210310410510615 unmodified linesWORKDIR /app# Ensure git, iverilog, and make are availableRUN apt-get update && \apt-get install -y --no-install-recommends \git make autoconf g++ flex bison help2man \libfl-dev zlib1g-dev python3 \iverilog && \rm -rf /var/lib/apt/lists/*# Install Verilator (required version)RUN git clone https://github.com/verilator/verilator && \cd verilator && \git checkout v5.036 && \autoconf && \./configure && \make -j$(nproc) && \make install && \cd .. && \rm -rf verilator# Build argument to control whether we're building standalone or in-repoARG BUILD_MODE=in-repoARG ENV_NAME=rtl_debugger34 unmodified lines# Install runtime dependencies (iverilog and make)ARG DEBIAN_FRONTEND=noninteractiveRUN apt-get update && \apt-get install -y --no-install-recommends \git make \iverilog && \rm -rf /var/lib/apt/lists/*WORKDIR /app4 unmodified lines# Copy the environment codeCOPY --from=builder /app/env /app/envCOPY --from=builder /usr/local/bin/verilator /usr/local/bin/verilatorCOPY --from=builder /usr/local/share/verilator /usr/local/share/verilator# Set PATH to use the virtual environmentENV PATH="/app/.venv/bin:$PATH"4 unmodified lines# Health checkHEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \CMD curl -f http://localhost:7860/health || exit 1# Run the FastAPI server# The module path is constructed to work with the /app/env structureCMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port 7860"]
4 unmodified lines5678910114 unmodified lines161718192021227 unmodified lines3031323334353637389 unmodified lines48495051525354555657585960616263646566674 unmodified linescolorTo: greensdk: dockerpinned: falseapp_port: 8000base_path: /webtags:- openenv4 unmodified lines# RTL Debugger EnvironmentThe **RTL Debugger** is a Reinforcement Learning environment designed for automated hardware design fixing. It enables LLM-based agents to iteratively debug Verilog code.## Quick Start7 unmodified lines### 2. Launch the Environment Server```bashdocker run -p 8000:8000 --rm rtl_debugger-env:latest```Access the interactive web-playground at: [http://localhost:8000/web](http://localhost:8000/web)### 3. Run the Inference AgentWe provide a reference inference script that uses LLM to play the environment:9 unmodified lines## Environment Details### Action Model (`RtlDebuggerAction`)Agents submit their corrected Verilog module:- `fixed_code` (str): The full Verilog module source.### Observation: `RtlDebuggerObservation`| Field | Type | Description || :--- | :--- | :--- || `task_id` | `str` | Name of the selected task (e.g., `task0`). || `feedback` | `str` | Combined compiler errors and testbench results. || `pass_rate` | `float` | Percent of testcases passed [0.0 - 1.0]. || `progress_ratio` | `float` | Percent of simulation sequence completed before the first failure. || `compiled` | `bool` | Whether the Verilog code is syntactically valid. || `lev_distance` | `int` | Number of modified lines compared to the previous attempt. || `score` | `float` | Final normalized grader score [0.0 - 1.0]. |---4 unmodified lines5678910114 unmodified lines161718192021222324252627282930317 unmodified lines3940414243444546479 unmodified lines575859606162636465666768697071727374757677787980818283848586874 unmodified linescolorTo: greensdk: dockerpinned: falseapp_port: 7860base_path: /webtags:- openenv4 unmodified lines# RTL Debugger EnvironmentThe **RTL Debugger** is a Reinforcement Learning environment designed for automated hardware design fixing. It enables LLM-based agents to iteratively debug Verilog code through high-fidelity simulation feedback.## 🚀 MotivationHardware debugging is a high-cost, iterative process. While LLMs are proficient at syntax-level code generation, fixing semantic bugs in RTL (Register Transfer Level) designs requires a deep understanding of timing, cycle-by-cycle logic, and state transitions. This environment provides a standardized sandbox for training and evaluating agents capable of interprets complex simulation logs and autonomously resolving hardware logic flaws.## 🛠️ Environment DescriptionThe RTL Debugger is an OpenEnv-compliant environment that wraps industry-standard hardware tools:- **Simulation Engines**: Supports both **Icarus Verilog** and **Verilator** for fast, cycle-accurate simulation.- **Feedback Loop**: For every submitted design, the environment provides a detailed diagnostic report, including compilation errors, failed test cycles, and FSM transition mismatches.- **Iterative Debugging**: Agents can build upon their previous attempts, utilizing line-based edit distance (Levenshtein) and pass-rate progress to guide their refinement.## Quick Start7 unmodified lines### 2. Launch the Environment Server```bashdocker run -p 7860:7860 --rm rtl_debugger-env:latest```Access the interactive web-playground at: [http://localhost:7860/web](http://localhost:7860/web)### 3. Run the Inference AgentWe provide a reference inference script that uses LLM to play the environment:9 unmodified lines## Environment Details### Action Space (`RtlDebuggerAction`)The action space is **unstructured text** representing the revised hardware design:- `fixed_code` (str): The full Verilog module source intended to replace the current `design_active.v`.### Observation Space: `RtlDebuggerObservation`Agents receive a rich observation after every edit, containing both raw technical feedback and normalized metrics:| Field | Type | Description || :--- | :--- | :--- || `task_id` | `str` | Name of the selected task (e.g., `task1`). || `feedback` | `str` | Human-readable diagnostics: compiler logs or a cycle-by-cycle breakdown of test failures. || `pass_rate` | `float` | Continuous metric [0.0 - 1.0] representing the percentage of test cases passed. || `progress_ratio` | `float` | Percent of the test sequence completed before the first failure (measures sequential depth). || `compiled` | `bool` | Boolean flag indicating if the Verilog code is syntactically valid and compilation succeeded. || `lev_distance` | `int` | Line-based edit distance from the *previous* attempt, encouraging minimal, targeted fixes. || `score` | `float` | The final grading metric [0.0 - 1.0]. High scores reward both correctness and minimal steps. |## 🎯 Tasks and DifficultyThe environment features curated hardware modules designed to test specific debugging capabilities:| Task Tier | Name | Description | Grading Focus || :--- | :--- | :--- | :--- || **Easy** | Task 1 | Syntax & Compilation: Fixing basic wiring or keyword errors. | Compilation OK, Step Count || **Medium** | Task 2 | Combinational Logic: Fixing XOR maps, Decoders, or Binary-to-Gray logic. | Test Case Pass Rate || **Hard** | Task 3 | Sequential Logic: Debugging FSMs (e.g., Moore/Mealy sequence detectors). | Transition Accuracy, Reset Logic |---
29 unmodified lines3031323334353629 unmodified linesExample:>>> # Connect to a running server>>> with RtlDebuggerEnv(base_url="http://localhost:8000") as client:... result = client.reset()... print(result.observation.echoed_message)...29 unmodified lines3031323334353629 unmodified linesExample:>>> # Connect to a running server>>> with RtlDebuggerEnv(base_url="http://localhost:7860") as client:... result = client.reset()... print(result.observation.echoed_message)...
35 unmodified lines3637383940414243444546474849505152535455565758596061626364654 unmodified lines7071727374757635 unmodified linesfrom models import RtlDebuggerAction # type: ignore# --- Configuration -------------------------------------------------------------OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")HF_TOKEN = os.getenv("HF_TOKEN")if OPENAI_API_KEY:# Use OpenAI directlyAPI_BASE_URL = os.getenv("API_BASE_URL") # use default (None) for OpenAIAPI_KEY = OPENAI_API_KEYMODEL_NAME = "gpt-4o"elif GEMINI_API_KEY:# Set defaults for Gemini (which uses an OpenAI-compatible endpoint)API_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/openai/"API_KEY = GEMINI_API_KEYMODEL_NAME = "gemini-2.5-flash"else:# Fall back to Hugging Face routerAPI_BASE_URL = "https://router.huggingface.co/v1"API_KEY = HF_TOKEN or os.getenv("API_KEY")MODEL_NAME = os.getenv("MODEL_NAME") or "Qwen/Qwen2.5-72B-Instruct:novita"# API_BASE_URL = os.getenv("API_BASE_URL") or "https://router.huggingface.co/v1"# API_KEY = os.getenv("API_KEY") or os.getenv("HF_TOKEN")# MODEL_NAME = os.getenv("MODEL_NAME") or "Qwen/Qwen2.5-72B-Instruct:novita"TASK_NAME = os.getenv("RTL_DEBUGGER_TASK_NAME", "unknown-task")IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")4 unmodified linesSUCCESS_SCORE_THRESHOLD = 0.1ENV_BASE_URL = os.getenv("ENV_BASE_URL ", "http://localhost:8000")# --- Prompts -------------------------------------------------------------------35 unmodified lines3637383940414243444546474849505152535455565758596061626364654 unmodified lines7071727374757635 unmodified linesfrom models import RtlDebuggerAction # type: ignore# --- Configuration -------------------------------------------------------------# OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")# GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")# HF_TOKEN = os.getenv("HF_TOKEN")# if OPENAI_API_KEY:# # Use OpenAI directly# API_BASE_URL = os.getenv("API_BASE_URL") # use default (None) for OpenAI# API_KEY = OPENAI_API_KEY# MODEL_NAME = "gpt-4o"# elif GEMINI_API_KEY:# # Set defaults for Gemini (which uses an OpenAI-compatible endpoint)# API_BASE_URL = "https://generativelanguage.googleapis.com/v1beta/openai/"# API_KEY = GEMINI_API_KEY# MODEL_NAME = "gemini-2.5-flash"# else:# # Fall back to Hugging Face router# API_BASE_URL = "https://router.huggingface.co/v1"# API_KEY = HF_TOKEN or os.getenv("API_KEY")# MODEL_NAME = os.getenv("MODEL_NAME") or "Qwen/Qwen2.5-72B-Instruct:novita"API_BASE_URL = os.getenv("API_BASE_URL") or "https://router.huggingface.co/v1"API_KEY = os.getenv("API_KEY") or os.getenv("HF_TOKEN")MODEL_NAME = os.getenv("MODEL_NAME") or "Qwen/Qwen2.5-72B-Instruct:novita"TASK_NAME = os.getenv("RTL_DEBUGGER_TASK_NAME", "unknown-task")IMAGE_NAME = os.getenv("LOCAL_IMAGE_NAME")4 unmodified linesSUCCESS_SCORE_THRESHOLD = 0.1ENV_BASE_URL = os.getenv("ENV_BASE_URL", "http://localhost:7860")# --- Prompts -------------------------------------------------------------------
2 unmodified lines3456789101112131415161718192021222324252 unmodified linestype: spaceruntime: fastapiapp: server.app:appport: 8000tasks:- id: task1description: "Easy — syntax/compilation errors"difficulty: easymax_steps: 10grader: server.graders:RtlGrader- id: task2description: "Medium — logic errors in combinational circuit"difficulty: mediummax_steps: 10grader: server.graders:RtlGrader- id: task3description: "Hard — logic errors in sequential circuit"difficulty: hardmax_steps: 10grader: server.graders:RtlGraderconstraints:max_runtime_seconds: 12002 unmodified lines3456789101112131415161718192021222324252 unmodified linestype: spaceruntime: fastapiapp: server.app:appport: 7860tasks:- id: task1description: "Easy — syntax/compilation errors"difficulty: easymax_steps: 10grader: server.graders:Task1Grader- id: task2description: "Medium — logic errors in combinational circuit"difficulty: mediummax_steps: 10grader: server.graders:Task2Grader- id: task3description: "Hard — logic errors in sequential circuit"difficulty: hardmax_steps: 10grader: server.graders:Task3Graderconstraints:max_runtime_seconds: 1200
123456789101112cocotb>=2.0.1fastapi>=0.135.2openai>=2.30.0openenv-core[core]>=0.2.3pydantic>=2.12.5uvicorn>=0.42.0python-dotenv
# System dependencies (installed in Docker but listed here for context):# iverilog# make# verilator (v5.036)18 unmodified lines1920212223242526272840 unmodified lines69707172737475767778794 unmodified lines8485868788899018 unmodified linesUsage:# Development (with auto-reload):uvicorn server.app:app --reload --host 0.0.0.0 --port 8000# Production:uvicorn server.app:app --host 0.0.0.0 --port 8000 --workers 4# Or run directly:python -m server.app40 unmodified linesRtlDebuggerAction,RtlDebuggerObservation,env_name="rtl_debugger",max_concurrent_envs=1, # increase this number to allow more concurrent WebSocket sessions)def main(host: str = "0.0.0.0", port: int = 8000):"""Entry point for direct execution via uv run or python -m.4 unmodified linesArgs:host: Host address to bind to (default: "0.0.0.0")port: Port number to listen on (default: 8000)For production deployments, consider using uvicorn directly withmultiple workers:18 unmodified lines1920212223242526272840 unmodified lines69707172737475767778794 unmodified lines8485868788899018 unmodified linesUsage:# Development (with auto-reload):uvicorn server.app:app --reload --host 0.0.0.0 --port 7860# Production:uvicorn server.app:app --host 0.0.0.0 --port 7860 --workers 4# Or run directly:python -m server.app40 unmodified linesRtlDebuggerAction,RtlDebuggerObservation,env_name="rtl_debugger",max_concurrent_envs=10, # increase this number to allow more concurrent WebSocket sessions)def main(host: str = "0.0.0.0", port: int = 7860):"""Entry point for direct execution via uv run or python -m.4 unmodified linesArgs:host: Host address to bind to (default: "0.0.0.0")port: Port number to listen on (default: 7860)For production deployments, consider using uvicorn directly withmultiple workers:
1 unmodified line234567891011121314151617181920213 unmodified lines25262728293031323334353637383940414243441 unmodified lineimport osfrom openenv.core.env_server.types import Stateclass RtlGrader:"""External Grader for the RTL Debugger Environment.Evaluates the final state of the environment after the episode finishes."""def __call__(self, state: State, env: "RtlDebuggerEnvironment") -> float:"""OpenEnv interface for grading.Reads the final result.json from the active task directory and computes the score."""result_path = os.path.join(env._task_dir, "result.json")# If no result.json exists, the simulation crashed or failed to compileif not os.path.exists(result_path):return 0.013 unmodified linesexcept json.JSONDecodeError:return 0.01num_tests = result_json.get("num_tests", 1)num_passed = result_json.get("num_passed", 0)passed_all = result_json.get("passed", False)pass_rate = num_passed / num_tests if num_tests > 0 else 0.0max_steps = 8step_efficiency = (state.step_count / max_steps)if passed_all:# Solved — difficulty determined by how many steps it neededscore = 1.0 - step_efficiencyelse:# Not solved — difficulty = how far it got from a full solutionscore = (pass_rate * 0.7)# Clamp to (0, 1) range strictlyreturn max(0.01, min(0.99, score))1 unmodified line2345678910111213141516171819202122232425262728293031323334353637383940414243444546473 unmodified lines515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281 unmodified lineimport osfrom openenv.core.env_server.types import Stateclass Task1Grader:"""Grader for Task 1 (Syntax/Compilation Errors).Evaluates based on:- Linting and Compilation passed.- Number of steps needed."""def __init__(self, max_steps: int = 10):self.max_steps = max_stepsdef __call__(self, state: State, env: "RtlDebuggerEnvironment") -> float:result_path = os.path.join(env._task_dir, "result.json")if not os.path.exists(result_path):return 0.01try:with open(result_path, "r") as f:result_json = json.load(f)except json.JSONDecodeError:return 0.01step_efficiency = (state.step_count / self.max_steps)score = 1.0 - step_efficiencyreturn max(0.01, min(0.99, score))class Task2Grader:"""Grader for Task 2 (Combinational Logic).Evaluates based on:- Number of test cases passed.- Number of steps needed."""def __init__(self, max_steps: int = 10):self.max_steps = max_stepsdef __call__(self, state: State, env: "RtlDebuggerEnvironment") -> float:result_path = os.path.join(env._task_dir, "result.json")if not os.path.exists(result_path):return 0.013 unmodified linesexcept json.JSONDecodeError:return 0.01num_passed = result_json.get("num_passed", 0)num_tests = result_json.get("num_tests", 1)passed_all = result_json.get("passed", False)pass_rate = num_passed / num_tests if num_tests > 0 else 0.0if passed_all:step_efficiency = (state.step_count / self.max_steps)score = 1.0 - step_efficiencyelse:score = pass_rate * 0.7return max(0.01, min(0.99, score))class Task3Grader:"""Grader for Task 3 (Sequential Logic).Evaluates based on:- Sequence correctness- Transition correctness- Penalties for deadlock, oscillation, wrong encoding- Reset working"""def __init__(self, max_steps: int = 10):self.max_steps = max_stepsdef __call__(self, state: State, env: "RtlDebuggerEnvironment") -> float:result_path = os.path.join(env._task_dir, "result.json")if not os.path.exists(result_path):# No result.json usually means compilation error or simulation timeout (deadlock/oscillation)return 0.01try:with open(result_path, "r") as f:result_json = json.load(f)except json.JSONDecodeError:return 0.01seq_count = result_json.get("sequence_correctness", 0)trans_count = result_json.get("transition_correctness", 0)num_passed = result_json.get("num_passed", 0)num_tests = result_json.get("num_tests", 1)seq_rate = seq_count / num_tests if num_tests > 0 else 0.0trans_rate = trans_count / num_tests if num_tests > 0 else 0.0pass_rate = num_passed / num_tests if num_tests > 0 else 0.0passed_all = result_json.get("passed", False)score = 0.0# Partial credit based on sequential milestonesscore += seq_rate * 0.4score += trans_rate * 0.4# Note: reset_working was removed from testbench or ignored for now,# but we could add it back if needed. For now let's use the remaining 0.2# as a bonus for passing everything.if passed_all:score += 0.2step_efficiency = (state.step_count / self.max_steps)score = 1.0 - step_efficiencyreturn max(0.01, min(0.99, score))def get_grader(task_id: str):"""Factory function to retrieve the appropriate grader for a task."""graders = {"task1": Task1Grader(),"task2": Task2Grader(),"task3": Task3Grader(),}return graders.get(task_id, Task1Grader())
34 unmodified lines3536373839404142264 unmodified lines3073083093103113123133145 unmodified lines3203213223233243253263273283293302 unmodified lines33333433533633733833934 unmodified linesexcept ImportError:from models import RtlDebuggerAction, RtlDebuggerObservationfrom .graders import RtlGrader_rtl_grader_instance = RtlGrader()# Tasks directory is usually at the project root.# We first try the current working directory (e.g. /app/env in Docker),264 unmodified linesif passed_all:reward += 20.0feedback_lines = [f"Compiled: OK | Tests: {num_passed}/{num_tests} passed | First failure after: {progress_ratio:.2f} of sequence | Levenshtein distance: {lev_distance}"]# Parse failed test cases from result.json5 unmodified linesinp = ft.get("inputs") or ft.get("input", {})inputs_str = ", ".join(f"{k}={v}" for k, v in inp.items()) if isinstance(inp, dict) else str(inp)cycle = ft.get("test_id", "?")expected = ft.get("expected_output", ft.get("expected_next_state", ft.get("expected", "?")))actual = ft.get("actual_output", ft.get("actual", "?"))state_info = ""if "actual_state" in ft or "transition_to" in ft:was_s = ft.get("actual_state_meaning", ft.get("actual_state", "?"))went_s = ft.get("transition_to_meaning", ft.get("transition_to", "?"))exp_s = ft.get("expected_next_state_meaning", ft.get("expected_next_state", "?"))2 unmodified linesfeedback_lines.append(f"- Cycle {cycle}: [{inputs_str}] -> Expected: {expected}, Got: {actual}{state_info}")feedback = "\n".join(filter(None, feedback_lines))final_score = _rtl_grader_instance(self._state, self)return RtlDebuggerObservation(task_id=self._task_name,34 unmodified lines35363738394041264 unmodified lines3063073083093103113123133143153165 unmodified lines3223233243253263273283293303313322 unmodified lines33533633733833934034134234 unmodified linesexcept ImportError:from models import RtlDebuggerAction, RtlDebuggerObservationfrom .graders import get_grader# Tasks directory is usually at the project root.# We first try the current working directory (e.g. /app/env in Docker),264 unmodified linesif passed_all:reward += 20.0seq_count = result_data.get("sequence_correctness", "?")trans_count = result_data.get("transition_correctness", "?")feedback_lines = [f"Compiled: OK | Tests: {num_passed}/{num_tests} passed | Seq: {seq_count}/{num_tests} | Trans: {trans_count}/{num_tests} | First failure after: {progress_ratio:.2f} of sequence"]# Parse failed test cases from result.json5 unmodified linesinp = ft.get("inputs") or ft.get("input", {})inputs_str = ", ".join(f"{k}={v}" for k, v in inp.items()) if isinstance(inp, dict) else str(inp)cycle = ft.get("test_id", "?")expected = ft.get("expected_output", "?")actual = ft.get("actual_output", "?")state_info = ""if "transition_to" in ft:was_s = ft.get("actual_state_meaning", ft.get("actual_state", "?"))went_s = ft.get("transition_to_meaning", ft.get("transition_to", "?"))exp_s = ft.get("expected_next_state_meaning", ft.get("expected_next_state", "?"))2 unmodified linesfeedback_lines.append(f"- Cycle {cycle}: [{inputs_str}] -> Expected: {expected}, Got: {actual}{state_info}")feedback = "\n".join(filter(None, feedback_lines))grader = get_grader(self._task_name)final_score = grader(self._state, self)return RtlDebuggerObservation(task_id=self._task_name,
123456789module half_adder(input a,input b,output sum,output carry);assign sum = a ^ b;assign carry = a & b;endmodule1234567module half_adder(input a, b,output sum, carry);assign sum = a ^ b;assign carry = a & b;endmodule
123456<testsuites name="results"><testsuite name="all" package="all"><property name="random_seed" value="1775630252" /><testcase name="test_half_adder" classname="test_half_adder" file="/mnt/c/Users/npkas/Agentic-RL/rtl_debugger/tasks/task0/test_half_adder.py" lineno="1" time="0.01133418083190918" sim_time_ns="4.0" ratio_time="352.91478575485394" /></testsuite></testsuites>123456<testsuites name="results"><testsuite name="all" package="all"><property name="random_seed" value="1775636841" /><testcase name="test_half_adder" classname="test_half_adder" file="/mnt/c/Users/npkas/Agentic-RL/rtl_debugger/tasks/task0/test_half_adder.py" lineno="1" time="0.0024442672729492188" sim_time_ns="4.0" ratio_time="1636.4822473663676" /></testsuite></testsuites>
123version https://git-lfs.github.com/spec/v1oid sha256:790e2bb6d9bf1dac2b0fdd8304ef96f7bc47313da65fc484139a5335e6105db7size 320920123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Model implementation (design independent parts)
#include "Vtop__pch.h"
//============================================================// Constructors
Vtop::Vtop(VerilatedContext* _vcontextp__, const char* _vcname__) : VerilatedModel{*_vcontextp__} , vlSymsp{new Vtop__Syms(contextp(), _vcname__, this)} , a{vlSymsp->TOP.a} , b{vlSymsp->TOP.b} , sum{vlSymsp->TOP.sum} , carry{vlSymsp->TOP.carry} , rootp{&(vlSymsp->TOP)}{ // Register model with the context contextp()->addModel(this);}
Vtop::Vtop(const char* _vcname__) : Vtop(Verilated::threadContextp(), _vcname__){}
//============================================================// Destructor
Vtop::~Vtop() { delete vlSymsp;}
//============================================================// Evaluation function
#ifdef VL_DEBUGvoid Vtop___024root___eval_debug_assertions(Vtop___024root* vlSelf);#endif // VL_DEBUGvoid Vtop___024root___eval_static(Vtop___024root* vlSelf);void Vtop___024root___eval_initial(Vtop___024root* vlSelf);void Vtop___024root___eval_settle(Vtop___024root* vlSelf);void Vtop___024root___eval(Vtop___024root* vlSelf);
void Vtop::eval_step() { VL_DEBUG_IF(VL_DBG_MSGF("+++++TOP Evaluate Vtop::eval_step\n"); );#ifdef VL_DEBUG // Debug assertions Vtop___024root___eval_debug_assertions(&(vlSymsp->TOP));#endif // VL_DEBUG vlSymsp->__Vm_deleter.deleteAll(); if (VL_UNLIKELY(!vlSymsp->__Vm_didInit)) { vlSymsp->__Vm_didInit = true; VL_DEBUG_IF(VL_DBG_MSGF("+ Initial\n");); Vtop___024root___eval_static(&(vlSymsp->TOP)); Vtop___024root___eval_initial(&(vlSymsp->TOP)); Vtop___024root___eval_settle(&(vlSymsp->TOP)); } VL_DEBUG_IF(VL_DBG_MSGF("+ Eval\n");); Vtop___024root___eval(&(vlSymsp->TOP)); // Evaluate cleanup Verilated::endOfEval(vlSymsp->__Vm_evalMsgQp);}
//============================================================// Events and timingbool Vtop::eventsPending() { return false; }
uint64_t Vtop::nextTimeSlot() { VL_FATAL_MT(__FILE__, __LINE__, "", "No delays in the design"); return 0;}
//============================================================// Utilities
const char* Vtop::name() const { return vlSymsp->name();}
//============================================================// Invoke final blocks
void Vtop___024root___eval_final(Vtop___024root* vlSelf);
VL_ATTR_COLD void Vtop::final() { Vtop___024root___eval_final(&(vlSymsp->TOP));}
//============================================================// Implementations of abstract methods from VerilatedModel
const char* Vtop::hierName() const { return vlSymsp->name(); }const char* Vtop::modelName() const { return "Vtop"; }unsigned Vtop::threads() const { return 1; }void Vtop::prepareClone() const { contextp()->prepareClone(); }void Vtop::atClone() const { contextp()->threadPoolpOnClone();}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Primary model header//// This header should be included by all source files instantiating the design.// The class here is then constructed to instantiate the design.// See the Verilator manual for examples.
#ifndef VERILATED_VTOP_H_#define VERILATED_VTOP_H_ // guard
#include "verilated.h"#include "svdpi.h"
class Vtop__Syms;class Vtop___024root;
// This class is the main interface to the Verilated modelclass alignas(VL_CACHE_LINE_BYTES) Vtop VL_NOT_FINAL : public VerilatedModel { private: // Symbol table holding complete model state (owned by this class) Vtop__Syms* const vlSymsp;
public:
// CONSTEXPR CAPABILITIES // Verilated with --trace? static constexpr bool traceCapable = false;
// PORTS // The application code writes and reads these signals to // propagate new values into/out from the Verilated model. VL_IN8(&a,0,0); VL_IN8(&b,0,0); VL_OUT8(&sum,0,0); VL_OUT8(&carry,0,0);
// CELLS // Public to allow access to /* verilator public */ items. // Otherwise the application code can consider these internals.
// Root instance pointer to allow access to model internals, // including inlined /* verilator public_flat_* */ items. Vtop___024root* const rootp;
// CONSTRUCTORS /// Construct the model; called by application code /// If contextp is null, then the model will use the default global context /// If name is "", then makes a wrapper with a /// single model invisible with respect to DPI scope names. explicit Vtop(VerilatedContext* contextp, const char* name = "TOP"); explicit Vtop(const char* name = "TOP"); /// Destroy the model; called (often implicitly) by application code virtual ~Vtop(); private: VL_UNCOPYABLE(Vtop); ///< Copying not allowed
public: // API METHODS /// Evaluate the model. Application must call when inputs change. void eval() { eval_step(); } /// Evaluate when calling multiple units/models per time step. void eval_step(); /// Evaluate at end of a timestep for tracing, when using eval_step(). /// Application must call after all eval() and before time changes. void eval_end_step() {} /// Simulation complete, run final blocks. Application must call on completion. void final(); /// Are there scheduled events to handle? bool eventsPending(); /// Returns time at next time slot. Aborts if !eventsPending() uint64_t nextTimeSlot(); /// Trace signals in the model; called by application code void trace(VerilatedTraceBaseC* tfp, int levels, int options = 0) { contextp()->trace(tfp, levels, options); } /// Retrieve name of this model instance (as passed to constructor). const char* name() const;
// Abstract methods from VerilatedModel const char* hierName() const override final; const char* modelName() const override final; unsigned threads() const override final; /// Prepare for cloning the model at the process level (e.g. fork in Linux) /// Release necessary resources. Called before cloning. void prepareClone() const; /// Re-init after cloning the model at the process level (e.g. fork in Linux) /// Re-allocate necessary resources. Called after cloning. void atClone() const; private: // Internal functions - trace registration void traceBaseModel(VerilatedTraceBaseC* tfp, int levels, int options);};
#endif // guard123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172# Verilated -*- Makefile -*-# DESCRIPTION: Verilator output: Makefile for building Verilated archive or executable## Execute this makefile from the object directory:# make -f Vtop.mk
default: Vtop
### Constants...# Perl executable (from $PERL, defaults to 'perl' if not set)PERL = perl# Python3 executable (from $PYTHON3, defaults to 'python3' if not set)PYTHON3 = python3# Path to Verilator kit (from $VERILATOR_ROOT)VERILATOR_ROOT = /usr/local/share/verilator# SystemC include directory with systemc.h (from $SYSTEMC_INCLUDE)SYSTEMC_INCLUDE ?= # SystemC library directory with libsystemc.a (from $SYSTEMC_LIBDIR)SYSTEMC_LIBDIR ?=
### Switches...# C++ code coverage 0/1 (from --prof-c)VM_PROFC = 0# SystemC output mode? 0/1 (from --sc)VM_SC = 0# Legacy or SystemC output mode? 0/1 (from --sc)VM_SP_OR_SC = $(VM_SC)# DeprecatedVM_PCLI = 1# Deprecated: SystemC architecture to find link library path (from $SYSTEMC_ARCH)VM_SC_TARGET_ARCH = linux
### Vars...# Design prefix (from --prefix)VM_PREFIX = Vtop# Module prefix (from --prefix)VM_MODPREFIX = Vtop# User CFLAGS (from -CFLAGS on Verilator command line)VM_USER_CFLAGS = \
# User LDLIBS (from -LDFLAGS on Verilator command line)VM_USER_LDLIBS = \ -Wl,-rpath,/mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/libs -L/mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/libs -lcocotbvpi_verilator \
# User .cpp files (from .cpp's on Verilator command line)VM_USER_CLASSES = \ verilator \
# User .cpp directories (from .cpp's on Verilator command line)VM_USER_DIR = \ .. \ ../../../../open_venv/lib/python3.12/site-packages/cocotb/share/lib/verilator \
### Default rules...# Include list of all generated classesinclude Vtop_classes.mk# Include global rulesinclude $(VERILATOR_ROOT)/include/verilated.mk
### Executable rules... (from --exe)VPATH += $(VM_USER_DIR)
verilator.o: /mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/share/lib/verilator/verilator.cpp $(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_FAST) -c -o $@ $<
### Link rules... (from --exe)Vtop: $(VK_USER_OBJS) $(VK_GLOBAL_OBJS) $(VM_PREFIX)__ALL.a $(VM_HIER_LIBS) $(LINK) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LIBS) $(SC_LIBS) -o $@
# Verilated -*- Makefile -*-12345678910// DESCRIPTION: Generated by verilator_includer via makefile#define VL_INCLUDE_OPT include#include "Vtop.cpp"#include "Vtop___024root__DepSet_h84412442__0.cpp"#include "Vtop___024root__DepSet_heccd7ead__0.cpp"#include "Vtop__Dpi.cpp"#include "Vtop___024root__Slow.cpp"#include "Vtop___024root__DepSet_h84412442__0__Slow.cpp"#include "Vtop___024root__DepSet_heccd7ead__0__Slow.cpp"#include "Vtop__Syms.cpp"1234567891011121314Vtop__ALL.o: Vtop__ALL.cpp Vtop.cpp Vtop__pch.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilatedos.h \ /usr/local/share/verilator/include/verilated_config.h \ /usr/local/share/verilator/include/verilated_types.h \ /usr/local/share/verilator/include/verilated_funcs.h \ /usr/local/share/verilator/include/verilated_dpi.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilated_sym_props.h \ /usr/local/share/verilator/include/vltstd/svdpi.h Vtop__Syms.h Vtop.h \ Vtop___024root.h Vtop___024root__DepSet_h84412442__0.cpp \ Vtop___024root__DepSet_heccd7ead__0.cpp Vtop__Dpi.cpp Vtop__Dpi.h \ Vtop___024root__Slow.cpp Vtop___024root__DepSet_h84412442__0__Slow.cpp \ Vtop___024root__DepSet_heccd7ead__0__Slow.cpp Vtop__Syms.cpp12345678910111213141516// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Implementation of DPI export functions.//// Verilator compiles this file in when DPI functions are used.// If you have multiple Verilated designs with the same DPI exported// function names, you will get multiple definition link errors from here.// This is an unfortunate result of the DPI specification.// To solve this, either// 1. Call Vtop::{export_function} instead,// and do not even bother to compile this file// or 2. Compile all __Dpi.cpp files in the same compiler run,// and #ifdefs already inserted here will sort everything out.
#include "Vtop__Dpi.h"#include "Vtop.h"
12345678910111213141516171819202122// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Prototypes for DPI import and export functions.//// Verilator includes this file in all generated .cpp files that use DPI functions.// Manually include this file where DPI .c import functions are declared to ensure// the C functions match the expectations of the DPI imports.
#ifndef VERILATED_VTOP__DPI_H_#define VERILATED_VTOP__DPI_H_ // guard
#include "svdpi.h"
#ifdef __cplusplusextern "C" {#endif
#ifdef __cplusplus}#endif
#endif // guard1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Symbol table implementation internals
#include "Vtop__pch.h"#include "Vtop.h"#include "Vtop___024root.h"
// FUNCTIONSVtop__Syms::~Vtop__Syms(){
// Tear down scope hierarchy __Vhier.remove(0, &__Vscope_half_adder);
}
Vtop__Syms::Vtop__Syms(VerilatedContext* contextp, const char* namep, Vtop* modelp) : VerilatedSyms{contextp} // Setup internal state of the Syms class , __Vm_modelp{modelp} // Setup module instances , TOP{this, namep}{ // Check resources Verilated::stackCheck(25); // Configure time unit / time precision _vm_contextp__->timeunit(-9); _vm_contextp__->timeprecision(-12); // Setup each module's pointers to their submodules // Setup each module's pointer back to symbol table (for public functions) TOP.__Vconfigure(true); // Setup scopes __Vscope_TOP.configure(this, name(), "TOP", "TOP", "<null>", 0, VerilatedScope::SCOPE_OTHER); __Vscope_half_adder.configure(this, name(), "half_adder", "half_adder", "half_adder", -9, VerilatedScope::SCOPE_MODULE);
// Set up scope hierarchy __Vhier.add(0, &__Vscope_half_adder);
// Setup export functions for (int __Vfinal = 0; __Vfinal < 2; ++__Vfinal) { __Vscope_TOP.varInsert(__Vfinal,"a", &(TOP.a), false, VLVT_UINT8,VLVD_IN|VLVF_PUB_RW,0,0); __Vscope_TOP.varInsert(__Vfinal,"b", &(TOP.b), false, VLVT_UINT8,VLVD_IN|VLVF_PUB_RW,0,0); __Vscope_TOP.varInsert(__Vfinal,"carry", &(TOP.carry), false, VLVT_UINT8,VLVD_OUT|VLVF_PUB_RW,0,0); __Vscope_TOP.varInsert(__Vfinal,"sum", &(TOP.sum), false, VLVT_UINT8,VLVD_OUT|VLVF_PUB_RW,0,0); __Vscope_half_adder.varInsert(__Vfinal,"a", &(TOP.half_adder__DOT__a), false, VLVT_UINT8,VLVD_NODIR|VLVF_PUB_RW,0,0); __Vscope_half_adder.varInsert(__Vfinal,"b", &(TOP.half_adder__DOT__b), false, VLVT_UINT8,VLVD_NODIR|VLVF_PUB_RW,0,0); __Vscope_half_adder.varInsert(__Vfinal,"carry", &(TOP.half_adder__DOT__carry), false, VLVT_UINT8,VLVD_NODIR|VLVF_PUB_RW,0,0); __Vscope_half_adder.varInsert(__Vfinal,"sum", &(TOP.half_adder__DOT__sum), false, VLVT_UINT8,VLVD_NODIR|VLVF_PUB_RW,0,0); }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Symbol table internal header//// Internal details; most calling programs do not need this header,// unless using verilator public meta comments.
#ifndef VERILATED_VTOP__SYMS_H_#define VERILATED_VTOP__SYMS_H_ // guard
#include "verilated.h"
// INCLUDE MODEL CLASS
#include "Vtop.h"
// INCLUDE MODULE CLASSES#include "Vtop___024root.h"
// DPI TYPES for DPI Export callbacks (Internal use)
// SYMS CLASS (contains all model state)class alignas(VL_CACHE_LINE_BYTES)Vtop__Syms final : public VerilatedSyms { public: // INTERNAL STATE Vtop* const __Vm_modelp; VlDeleter __Vm_deleter; bool __Vm_didInit = false;
// MODULE INSTANCE STATE Vtop___024root TOP;
// SCOPE NAMES VerilatedScope __Vscope_TOP; VerilatedScope __Vscope_half_adder;
// SCOPE HIERARCHY VerilatedHierarchy __Vhier;
// CONSTRUCTORS Vtop__Syms(VerilatedContext* contextp, const char* namep, Vtop* modelp); ~Vtop__Syms();
// METHODS const char* name() { return TOP.name(); }};
#endif // guard1234567891011121314151617181920212223242526272829303132333435363738394041424344454647// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Design internal header// See Vtop.h for the primary calling header
#ifndef VERILATED_VTOP___024ROOT_H_#define VERILATED_VTOP___024ROOT_H_ // guard
#include "verilated.h"
class Vtop__Syms;
class alignas(VL_CACHE_LINE_BYTES) Vtop___024root final : public VerilatedModule { public:
// DESIGN SPECIFIC STATE VL_IN8(a,0,0); VL_IN8(b,0,0); VL_OUT8(sum,0,0); VL_OUT8(carry,0,0); CData/*0:0*/ half_adder__DOT__a; CData/*0:0*/ half_adder__DOT__b; CData/*0:0*/ half_adder__DOT__sum; CData/*0:0*/ half_adder__DOT__carry; CData/*0:0*/ __VstlFirstIteration; CData/*0:0*/ __VicoFirstIteration; CData/*0:0*/ __VactContinue; IData/*31:0*/ __VactIterCount; VlTriggerVec<1> __VstlTriggered; VlTriggerVec<1> __VicoTriggered; VlTriggerVec<0> __VactTriggered; VlTriggerVec<0> __VnbaTriggered;
// INTERNAL VARIABLES Vtop__Syms* const vlSymsp;
// CONSTRUCTORS Vtop___024root(Vtop__Syms* symsp, const char* v__name); ~Vtop___024root(); VL_UNCOPYABLE(Vtop___024root);
// INTERNAL METHODS void __Vconfigure(bool first);};
#endif // guard12345678910111213141516171819202122232425262728293031323334353637383940// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Design implementation internals// See Vtop.h for the primary calling header
#include "Vtop__pch.h"#include "Vtop__Syms.h"#include "Vtop___024root.h"
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__ico(Vtop___024root* vlSelf);#endif // VL_DEBUG
void Vtop___024root___eval_triggers__ico(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_triggers__ico\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body vlSelfRef.__VicoTriggered.setBit(0U, (IData)(vlSelfRef.__VicoFirstIteration));#ifdef VL_DEBUG if (VL_UNLIKELY(vlSymsp->_vm_contextp__->debug())) { Vtop___024root___dump_triggers__ico(vlSelf); }#endif}
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__act(Vtop___024root* vlSelf);#endif // VL_DEBUG
void Vtop___024root___eval_triggers__act(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_triggers__act\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body#ifdef VL_DEBUG if (VL_UNLIKELY(vlSymsp->_vm_contextp__->debug())) { Vtop___024root___dump_triggers__act(vlSelf); }#endif}123456789101112131415161718192021222324// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Design implementation internals// See Vtop.h for the primary calling header
#include "Vtop__pch.h"#include "Vtop__Syms.h"#include "Vtop___024root.h"
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__stl(Vtop___024root* vlSelf);#endif // VL_DEBUG
VL_ATTR_COLD void Vtop___024root___eval_triggers__stl(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_triggers__stl\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body vlSelfRef.__VstlTriggered.setBit(0U, (IData)(vlSelfRef.__VstlFirstIteration));#ifdef VL_DEBUG if (VL_UNLIKELY(vlSymsp->_vm_contextp__->debug())) { Vtop___024root___dump_triggers__stl(vlSelf); }#endif}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Design implementation internals// See Vtop.h for the primary calling header
#include "Vtop__pch.h"#include "Vtop___024root.h"
void Vtop___024root___ico_sequent__TOP__0(Vtop___024root* vlSelf);
void Vtop___024root___eval_ico(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_ico\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if ((1ULL & vlSelfRef.__VicoTriggered.word(0U))) { Vtop___024root___ico_sequent__TOP__0(vlSelf); }}
VL_INLINE_OPT void Vtop___024root___ico_sequent__TOP__0(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___ico_sequent__TOP__0\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body vlSelfRef.half_adder__DOT__a = vlSelfRef.a; vlSelfRef.half_adder__DOT__b = vlSelfRef.b; vlSelfRef.carry = ((IData)(vlSelfRef.a) & (IData)(vlSelfRef.b)); vlSelfRef.half_adder__DOT__sum = ((IData)(vlSelfRef.a) ^ (IData)(vlSelfRef.b)); vlSelfRef.half_adder__DOT__carry = vlSelfRef.carry; vlSelfRef.sum = vlSelfRef.half_adder__DOT__sum;}
void Vtop___024root___eval_triggers__ico(Vtop___024root* vlSelf);
bool Vtop___024root___eval_phase__ico(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_phase__ico\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Init CData/*0:0*/ __VicoExecute; // Body Vtop___024root___eval_triggers__ico(vlSelf); __VicoExecute = vlSelfRef.__VicoTriggered.any(); if (__VicoExecute) { Vtop___024root___eval_ico(vlSelf); } return (__VicoExecute);}
void Vtop___024root___eval_act(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_act\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get();}
void Vtop___024root___eval_nba(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_nba\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get();}
void Vtop___024root___eval_triggers__act(Vtop___024root* vlSelf);
bool Vtop___024root___eval_phase__act(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_phase__act\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Init VlTriggerVec<0> __VpreTriggered; CData/*0:0*/ __VactExecute; // Body Vtop___024root___eval_triggers__act(vlSelf); __VactExecute = vlSelfRef.__VactTriggered.any(); if (__VactExecute) { __VpreTriggered.andNot(vlSelfRef.__VactTriggered, vlSelfRef.__VnbaTriggered); vlSelfRef.__VnbaTriggered.thisOr(vlSelfRef.__VactTriggered); Vtop___024root___eval_act(vlSelf); } return (__VactExecute);}
bool Vtop___024root___eval_phase__nba(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_phase__nba\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Init CData/*0:0*/ __VnbaExecute; // Body __VnbaExecute = vlSelfRef.__VnbaTriggered.any(); if (__VnbaExecute) { Vtop___024root___eval_nba(vlSelf); vlSelfRef.__VnbaTriggered.clear(); } return (__VnbaExecute);}
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__ico(Vtop___024root* vlSelf);#endif // VL_DEBUG#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__nba(Vtop___024root* vlSelf);#endif // VL_DEBUG#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__act(Vtop___024root* vlSelf);#endif // VL_DEBUG
void Vtop___024root___eval(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Init IData/*31:0*/ __VicoIterCount; CData/*0:0*/ __VicoContinue; IData/*31:0*/ __VnbaIterCount; CData/*0:0*/ __VnbaContinue; // Body __VicoIterCount = 0U; vlSelfRef.__VicoFirstIteration = 1U; __VicoContinue = 1U; while (__VicoContinue) { if (VL_UNLIKELY(((0x64U < __VicoIterCount)))) {#ifdef VL_DEBUG Vtop___024root___dump_triggers__ico(vlSelf);#endif VL_FATAL_MT("design_active.v", 1, "", "Input combinational region did not converge."); } __VicoIterCount = ((IData)(1U) + __VicoIterCount); __VicoContinue = 0U; if (Vtop___024root___eval_phase__ico(vlSelf)) { __VicoContinue = 1U; } vlSelfRef.__VicoFirstIteration = 0U; } __VnbaIterCount = 0U; __VnbaContinue = 1U; while (__VnbaContinue) { if (VL_UNLIKELY(((0x64U < __VnbaIterCount)))) {#ifdef VL_DEBUG Vtop___024root___dump_triggers__nba(vlSelf);#endif VL_FATAL_MT("design_active.v", 1, "", "NBA region did not converge."); } __VnbaIterCount = ((IData)(1U) + __VnbaIterCount); __VnbaContinue = 0U; vlSelfRef.__VactIterCount = 0U; vlSelfRef.__VactContinue = 1U; while (vlSelfRef.__VactContinue) { if (VL_UNLIKELY(((0x64U < vlSelfRef.__VactIterCount)))) {#ifdef VL_DEBUG Vtop___024root___dump_triggers__act(vlSelf);#endif VL_FATAL_MT("design_active.v", 1, "", "Active region did not converge."); } vlSelfRef.__VactIterCount = ((IData)(1U) + vlSelfRef.__VactIterCount); vlSelfRef.__VactContinue = 0U; if (Vtop___024root___eval_phase__act(vlSelf)) { vlSelfRef.__VactContinue = 1U; } } if (Vtop___024root___eval_phase__nba(vlSelf)) { __VnbaContinue = 1U; } }}
#ifdef VL_DEBUGvoid Vtop___024root___eval_debug_assertions(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_debug_assertions\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if (VL_UNLIKELY(((vlSelfRef.a & 0xfeU)))) { Verilated::overWidthError("a");} if (VL_UNLIKELY(((vlSelfRef.b & 0xfeU)))) { Verilated::overWidthError("b");}}#endif // VL_DEBUG123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Design implementation internals// See Vtop.h for the primary calling header
#include "Vtop__pch.h"#include "Vtop___024root.h"
VL_ATTR_COLD void Vtop___024root___eval_static(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_static\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get();}
VL_ATTR_COLD void Vtop___024root___eval_initial(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_initial\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get();}
VL_ATTR_COLD void Vtop___024root___eval_final(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_final\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get();}
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__stl(Vtop___024root* vlSelf);#endif // VL_DEBUGVL_ATTR_COLD bool Vtop___024root___eval_phase__stl(Vtop___024root* vlSelf);
VL_ATTR_COLD void Vtop___024root___eval_settle(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_settle\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Init IData/*31:0*/ __VstlIterCount; CData/*0:0*/ __VstlContinue; // Body __VstlIterCount = 0U; vlSelfRef.__VstlFirstIteration = 1U; __VstlContinue = 1U; while (__VstlContinue) { if (VL_UNLIKELY(((0x64U < __VstlIterCount)))) {#ifdef VL_DEBUG Vtop___024root___dump_triggers__stl(vlSelf);#endif VL_FATAL_MT("design_active.v", 1, "", "Settle region did not converge."); } __VstlIterCount = ((IData)(1U) + __VstlIterCount); __VstlContinue = 0U; if (Vtop___024root___eval_phase__stl(vlSelf)) { __VstlContinue = 1U; } vlSelfRef.__VstlFirstIteration = 0U; }}
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__stl(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___dump_triggers__stl\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if ((1U & (~ vlSelfRef.__VstlTriggered.any()))) { VL_DBG_MSGF(" No triggers active\n"); } if ((1ULL & vlSelfRef.__VstlTriggered.word(0U))) { VL_DBG_MSGF(" 'stl' region trigger index 0 is active: Internal 'stl' trigger - first iteration\n"); }}#endif // VL_DEBUG
void Vtop___024root___ico_sequent__TOP__0(Vtop___024root* vlSelf);
VL_ATTR_COLD void Vtop___024root___eval_stl(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_stl\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if ((1ULL & vlSelfRef.__VstlTriggered.word(0U))) { Vtop___024root___ico_sequent__TOP__0(vlSelf); }}
VL_ATTR_COLD void Vtop___024root___eval_triggers__stl(Vtop___024root* vlSelf);
VL_ATTR_COLD bool Vtop___024root___eval_phase__stl(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___eval_phase__stl\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Init CData/*0:0*/ __VstlExecute; // Body Vtop___024root___eval_triggers__stl(vlSelf); __VstlExecute = vlSelfRef.__VstlTriggered.any(); if (__VstlExecute) { Vtop___024root___eval_stl(vlSelf); } return (__VstlExecute);}
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__ico(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___dump_triggers__ico\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if ((1U & (~ vlSelfRef.__VicoTriggered.any()))) { VL_DBG_MSGF(" No triggers active\n"); } if ((1ULL & vlSelfRef.__VicoTriggered.word(0U))) { VL_DBG_MSGF(" 'ico' region trigger index 0 is active: Internal 'ico' trigger - first iteration\n"); }}#endif // VL_DEBUG
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__act(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___dump_triggers__act\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if ((1U & (~ vlSelfRef.__VactTriggered.any()))) { VL_DBG_MSGF(" No triggers active\n"); }}#endif // VL_DEBUG
#ifdef VL_DEBUGVL_ATTR_COLD void Vtop___024root___dump_triggers__nba(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___dump_triggers__nba\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body if ((1U & (~ vlSelfRef.__VnbaTriggered.any()))) { VL_DBG_MSGF(" No triggers active\n"); }}#endif // VL_DEBUG
VL_ATTR_COLD void Vtop___024root___ctor_var_reset(Vtop___024root* vlSelf) { VL_DEBUG_IF(VL_DBG_MSGF("+ Vtop___024root___ctor_var_reset\n"); ); Vtop__Syms* const __restrict vlSymsp VL_ATTR_UNUSED = vlSelf->vlSymsp; auto& vlSelfRef = std::ref(*vlSelf).get(); // Body vlSelf->a = VL_RAND_RESET_I(1); vlSelf->b = VL_RAND_RESET_I(1); vlSelf->sum = VL_RAND_RESET_I(1); vlSelf->carry = VL_RAND_RESET_I(1); vlSelf->half_adder__DOT__a = VL_RAND_RESET_I(1); vlSelf->half_adder__DOT__b = VL_RAND_RESET_I(1); vlSelf->half_adder__DOT__sum = VL_RAND_RESET_I(1); vlSelf->half_adder__DOT__carry = VL_RAND_RESET_I(1);}123456789101112131415161718192021222324// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Design implementation internals// See Vtop.h for the primary calling header
#include "Vtop__pch.h"#include "Vtop__Syms.h"#include "Vtop___024root.h"
void Vtop___024root___ctor_var_reset(Vtop___024root* vlSelf);
Vtop___024root::Vtop___024root(Vtop__Syms* symsp, const char* v__name) : VerilatedModule{v__name} , vlSymsp{symsp} { // Reset structure values Vtop___024root___ctor_var_reset(this);}
void Vtop___024root::__Vconfigure(bool first) { (void)first; // Prevent unused variable warning}
Vtop___024root::~Vtop___024root() {}1234567891011121314151617181920212223242526272829// Verilated -*- C++ -*-// DESCRIPTION: Verilator output: Precompiled header//// Internal details; most user sources do not need this header,// unless using verilator public meta comments.// Suggest use Vtop.h instead.
#ifndef VERILATED_VTOP__PCH_H_#define VERILATED_VTOP__PCH_H_ // guard
// GCC and Clang only will precompile headers (PCH) for the first header.// So, make sure this is the one and only PCH.// If multiple module's includes are needed, use individual includes.#ifdef VL_PCH_INCLUDED# error "Including multiple precompiled header files"#endif#define VL_PCH_INCLUDED
#include "verilated.h"#include "verilated_dpi.h"
#include "Vtop__Syms.h"#include "Vtop.h"
// Additional include files added using '--compiler-include'
#endif // guard1sim_build/Vtop.cpp sim_build/Vtop.h sim_build/Vtop.mk sim_build/Vtop__Dpi.cpp sim_build/Vtop__Dpi.h sim_build/Vtop__Syms.cpp sim_build/Vtop__Syms.h sim_build/Vtop___024root.h sim_build/Vtop___024root__DepSet_h84412442__0.cpp sim_build/Vtop___024root__DepSet_h84412442__0__Slow.cpp sim_build/Vtop___024root__DepSet_heccd7ead__0.cpp sim_build/Vtop___024root__DepSet_heccd7ead__0__Slow.cpp sim_build/Vtop___024root__Slow.cpp sim_build/Vtop__pch.h sim_build/Vtop__ver.d sim_build/Vtop_classes.mk : /usr/local/bin/verilator_bin /usr/local/bin/verilator_bin /usr/local/share/verilator/include/verilated_std.sv /usr/local/share/verilator/include/verilated_std_waiver.vlt design_active.v 1234567891011121314151617181920212223# DESCRIPTION: Verilator output: Timestamp data for --skip-identical. Delete at will.C "-cc --exe -Mdir sim_build --top-module half_adder --timescale 1ns/1ps --vpi --public-flat-rw --prefix Vtop -o Vtop -LDFLAGS -Wl,-rpath,/mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/libs -L/mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/libs -lcocotbvpi_verilator design_active.v /mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/share/lib/verilator/verilator.cpp"S 15982304 152497 1775633558 952547019 1775633558 952547019 "/usr/local/bin/verilator_bin"S 6525 152673 1775633559 122559598 1775633559 122559598 "/usr/local/share/verilator/include/verilated_std.sv"S 2787 152655 1775633559 112558860 1775633559 112558860 "/usr/local/share/verilator/include/verilated_std_waiver.vlt"S 281 7036874417799606 1775634224 763642000 1775634224 763642000 "design_active.v"T 2984 3096224745706922 1775634226 861395500 1775634226 861395500 "sim_build/Vtop.cpp"T 3505 5066549582681425 1775634226 857854000 1775634226 857854000 "sim_build/Vtop.h"T 2326 2814749768996448 1775634226 886766700 1775634226 886766700 "sim_build/Vtop.mk"T 669 4503599629259776 1775634226 855839700 1775634226 855839700 "sim_build/Vtop__Dpi.cpp"T 520 18858823441462464 1775634226 853826700 1775634226 853826700 "sim_build/Vtop__Dpi.h"T 2212 30117822508124560 1775634226 850045500 1775634226 850045500 "sim_build/Vtop__Syms.cpp"T 1115 16325548650952681 1775634226 850556400 1775634226 850556400 "sim_build/Vtop__Syms.h"T 1189 2533274792285651 1775634226 866813600 1775634226 866813600 "sim_build/Vtop___024root.h"T 1369 3096224745707037 1775634226 875505300 1775634226 875505300 "sim_build/Vtop___024root__DepSet_h84412442__0.cpp"T 845 2533274792285659 1775634226 871423000 1775634226 871423000 "sim_build/Vtop___024root__DepSet_h84412442__0__Slow.cpp"T 6754 2814749768996437 1775634226 880370400 1775634226 880370400 "sim_build/Vtop___024root__DepSet_heccd7ead__0.cpp"T 6003 2533274792285689 1775634226 873486000 1775634226 873486000 "sim_build/Vtop___024root__DepSet_heccd7ead__0__Slow.cpp"T 620 2533274792285653 1775634226 868852200 1775634226 868852200 "sim_build/Vtop___024root__Slow.cpp"T 773 2814749768996274 1775634226 863436900 1775634226 863436900 "sim_build/Vtop__pch.h"T 682 3940649675839252 1775634226 890540100 1775634226 890540100 "sim_build/Vtop__ver.d"T 0 0 1775634226 892089400 1775634226 892089400 "sim_build/Vtop__verFiles.dat"T 1770 2814749768996438 1775634226 881448700 1775634226 881448700 "sim_build/Vtop_classes.mk"123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657# Verilated -*- Makefile -*-# DESCRIPTION: Verilator output: Make include file with class lists## This file lists generated Verilated files, for including in higher level makefiles.# See Vtop.mk for the caller.
### Switches...# C11 constructs required? 0/1 (always on now)VM_C11 = 1# Timing enabled? 0/1VM_TIMING = 0# Coverage output mode? 0/1 (from --coverage)VM_COVERAGE = 0# Parallel builds? 0/1 (from --output-split)VM_PARALLEL_BUILDS = 0# Tracing output mode? 0/1 (from --trace-fst/--trace-saif/--trace-vcd)VM_TRACE = 0# Tracing output mode in FST format? 0/1 (from --trace-fst)VM_TRACE_FST = 0# Tracing output mode in SAIF format? 0/1 (from --trace-saif)VM_TRACE_SAIF = 0# Tracing output mode in VCD format? 0/1 (from --trace-vcd)VM_TRACE_VCD = 0
### Object file lists...# Generated module classes, fast-path, compile with highest optimizationVM_CLASSES_FAST += \ Vtop \ Vtop___024root__DepSet_h84412442__0 \ Vtop___024root__DepSet_heccd7ead__0 \
# Generated module classes, non-fast-path, compile with low/medium optimizationVM_CLASSES_SLOW += \ Vtop___024root__Slow \ Vtop___024root__DepSet_h84412442__0__Slow \ Vtop___024root__DepSet_heccd7ead__0__Slow \
# Generated support classes, fast-path, compile with highest optimizationVM_SUPPORT_FAST += \ Vtop__Dpi \
# Generated support classes, non-fast-path, compile with low/medium optimizationVM_SUPPORT_SLOW += \ Vtop__Syms \
# Global classes, need linked once per executable, fast-path, compile with highest optimizationVM_GLOBAL_FAST += \ verilated \ verilated_dpi \ verilated_vpi \ verilated_threads \
# Global classes, need linked once per executable, non-fast-path, compile with low/medium optimizationVM_GLOBAL_SLOW += \
# Verilated -*- Makefile -*-7 unmodified lines8910111213141516171819202122232425262728297 unmodified lines:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2005_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/va_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2009.vpi";S_0x55f0dc01f510 .scope package, "$unit" "$unit" 2 1;.timescale -9 -12;S_0x55f0dc01f6a0 .scope module, "half_adder" "half_adder" 3 1;.timescale -9 -12;.port_info 0 /INPUT 1 "a";.port_info 1 /INPUT 1 "b";.port_info 2 /OUTPUT 1 "sum";.port_info 3 /OUTPUT 1 "carry";o0x7fa1802ff018 .functor BUFZ 1, C4<z>; HiZ driveo0x7fa1802ff048 .functor BUFZ 1, C4<z>; HiZ driveL_0x55f0dc066d00 .functor XOR 1, o0x7fa1802ff018, o0x7fa1802ff048, C4<0>, C4<0>;L_0x55f0dc066df0 .functor AND 1, o0x7fa1802ff018, o0x7fa1802ff048, C4<1>, C4<1>;v0x55f0dc031430_0 .net "a", 0 0, o0x7fa1802ff018; 0 driversv0x55f0dc066a00_0 .net "b", 0 0, o0x7fa1802ff048; 0 driversv0x55f0dc066ac0_0 .net "carry", 0 0, L_0x55f0dc066df0; 1 driversv0x55f0dc066b90_0 .net "sum", 0 0, L_0x55f0dc066d00; 1 drivers# The file index is used to find the file name in the following table.:file_names 4;"N/A";7 unmodified lines8910111213141516171819202122232425262728297 unmodified lines:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2005_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/va_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2009.vpi";S_0x56539094a510 .scope package, "$unit" "$unit" 2 1;.timescale -9 -12;S_0x56539094a6a0 .scope module, "half_adder" "half_adder" 3 1;.timescale -9 -12;.port_info 0 /INPUT 1 "a";.port_info 1 /INPUT 1 "b";.port_info 2 /OUTPUT 1 "sum";.port_info 3 /OUTPUT 1 "carry";o0x7fab61caa018 .functor BUFZ 1, C4<z>; HiZ driveo0x7fab61caa048 .functor BUFZ 1, C4<z>; HiZ driveL_0x565390991d00 .functor XOR 1, o0x7fab61caa018, o0x7fab61caa048, C4<0>, C4<0>;L_0x565390991df0 .functor AND 1, o0x7fab61caa018, o0x7fab61caa048, C4<1>, C4<1>;v0x56539095c430_0 .net "a", 0 0, o0x7fab61caa018; 0 driversv0x565390991a00_0 .net "b", 0 0, o0x7fab61caa048; 0 driversv0x565390991ac0_0 .net "carry", 0 0, L_0x565390991df0; 1 driversv0x565390991b90_0 .net "sum", 0 0, L_0x565390991d00; 1 drivers# The file index is used to find the file name in the following table.:file_names 4;"N/A";
123456789101112verilated.o: /usr/local/share/verilator/include/verilated.cpp \ /usr/local/share/verilator/include/verilated_config.h \ /usr/local/share/verilator/include/verilatedos.h \ /usr/local/share/verilator/include/verilated_imp.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilated_types.h \ /usr/local/share/verilator/include/verilated_funcs.h \ /usr/local/share/verilator/include/verilated_syms.h \ /usr/local/share/verilator/include/verilated_sym_props.h \ /usr/local/share/verilator/include/verilated_threads.h \ /usr/local/share/verilator/include/verilated_trace.h \ /usr/local/share/verilator/include/verilatedos_c.h123version https://git-lfs.github.com/spec/v1oid sha256:1d2edda4f644db03fd038b6221b9ce178237c0885957111ee515d6473fd895b7size 233592123456789101112verilated_dpi.o: /usr/local/share/verilator/include/verilated_dpi.cpp \ /usr/local/share/verilator/include/verilatedos.h \ /usr/local/share/verilator/include/verilated_dpi.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilated_config.h \ /usr/local/share/verilator/include/verilated_types.h \ /usr/local/share/verilator/include/verilated_funcs.h \ /usr/local/share/verilator/include/verilated_sym_props.h \ /usr/local/share/verilator/include/vltstd/svdpi.h \ /usr/local/share/verilator/include/verilated_imp.h \ /usr/local/share/verilator/include/verilated_syms.h \ /usr/local/share/verilator/include/vltstd/svdpi.h12345678verilated_threads.o: \ /usr/local/share/verilator/include/verilated_threads.cpp \ /usr/local/share/verilator/include/verilatedos.h \ /usr/local/share/verilator/include/verilated_threads.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilated_config.h \ /usr/local/share/verilator/include/verilated_types.h \ /usr/local/share/verilator/include/verilated_funcs.h12345678910111213verilated_vpi.o: /usr/local/share/verilator/include/verilated_vpi.cpp \ /usr/local/share/verilator/include/verilated_vpi.h \ /usr/local/share/verilator/include/verilatedos.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilated_config.h \ /usr/local/share/verilator/include/verilated_types.h \ /usr/local/share/verilator/include/verilated_funcs.h \ /usr/local/share/verilator/include/verilated_syms.h \ /usr/local/share/verilator/include/verilated_sym_props.h \ /usr/local/share/verilator/include/vltstd/sv_vpi_user.h \ /usr/local/share/verilator/include/vltstd/vpi_user.h \ /usr/local/share/verilator/include/verilated_imp.h \ /usr/local/share/verilator/include/vltstd/vpi_user.h123version https://git-lfs.github.com/spec/v1oid sha256:68715e90d84a5a87f2765d14b91e0cfb3231b20adf84d426d7e0d92aa0b03e0asize 2176161234567891011121314verilator.o: \ /mnt/c/Users/npkas/Agentic-RL/open_venv/lib/python3.12/site-packages/cocotb/share/lib/verilator/verilator.cpp \ Vtop.h /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilatedos.h \ /usr/local/share/verilator/include/verilated_config.h \ /usr/local/share/verilator/include/verilated_types.h \ /usr/local/share/verilator/include/verilated_funcs.h \ /usr/local/share/verilator/include/vltstd/svdpi.h \ /usr/local/share/verilator/include/verilated_vpi.h \ /usr/local/share/verilator/include/verilated.h \ /usr/local/share/verilator/include/verilated_syms.h \ /usr/local/share/verilator/include/verilated_sym_props.h \ /usr/local/share/verilator/include/vltstd/sv_vpi_user.h \ /usr/local/share/verilator/include/vltstd/vpi_user.h12345678910111213141516171819module bin_gry #(parameter N = 8)(input [N-1:0] binary,output reg [N-1:0] gray);always @ (*) // Use '*' for combinational logic sensitivity listbegin// The most significant bit (MSB) of the Gray code is the same as the MSB of the binary code.gray[N-1] = binary[N-1];// For all other bits, the i-th Gray code bit is the XOR of the i-th binary bit and the (i+1)-th binary bit.// gray[i] = binary[i+1] ^ binary[i]for (integer i = 0; i < N - 1; i = i + 1) begingray[i] = binary[i+1] ^ binary[i];endendendmodule12345678910111213141516module bin_gry #(parameter N = 8)(binary ,gray) ;input [N-1:0] binary ;output reg [N-1:0] gray ;always @ (binary)begingray[N-1] = binary[N-1] ;gray[N-2:0] = binary[N-1:1] & binary[N-2:0] ;endendmodule
123456711 unmodified lines19202122232425261 unmodified line28293031323334351 unmodified line37383940414243441 unmodified line46474849505152531 unmodified line55565758596061621 unmodified line64656667686970711 unmodified line73747576777879801 unmodified line82838485868788891 unmodified line91929394959697981 unmodified line1001011021031041051061071 unmodified line109110111112113114115116{"passed": true,"num_tests": 12,"num_passed": 12,"simulation_time": 12.0,"results": [{11 unmodified lines"binary": 1},"expected_output": 1,"actual_output": 1,"pass": true},{"test_id": 2,1 unmodified line"binary": 2},"expected_output": 3,"actual_output": 3,"pass": true},{"test_id": 3,1 unmodified line"binary": 3},"expected_output": 2,"actual_output": 2,"pass": true},{"test_id": 4,1 unmodified line"binary": 127},"expected_output": 64,"actual_output": 64,"pass": true},{"test_id": 5,1 unmodified line"binary": 255},"expected_output": 128,"actual_output": 128,"pass": true},{"test_id": 6,1 unmodified line"binary": 254},"expected_output": 129,"actual_output": 129,"pass": true},{"test_id": 7,1 unmodified line"binary": 5},"expected_output": 7,"actual_output": 7,"pass": true},{"test_id": 8,1 unmodified line"binary": 10},"expected_output": 15,"actual_output": 15,"pass": true},{"test_id": 9,1 unmodified line"binary": 15},"expected_output": 8,"actual_output": 8,"pass": true},{"test_id": 10,1 unmodified line"binary": 128},"expected_output": 192,"actual_output": 192,"pass": true},{"test_id": 11,1 unmodified line"binary": 127},"expected_output": 64,"actual_output": 64,"pass": true}]}123456711 unmodified lines19202122232425261 unmodified line28293031323334351 unmodified line37383940414243441 unmodified line46474849505152531 unmodified line55565758596061621 unmodified line64656667686970711 unmodified line73747576777879801 unmodified line82838485868788891 unmodified line91929394959697981 unmodified line1001011021031041051061071 unmodified line109110111112113114115116{"passed": false,"num_tests": 12,"num_passed": 1,"simulation_time": 12.0,"results": [{11 unmodified lines"binary": 1},"expected_output": 1,"actual_output": 0,"pass": false},{"test_id": 2,1 unmodified line"binary": 2},"expected_output": 3,"actual_output": 0,"pass": false},{"test_id": 3,1 unmodified line"binary": 3},"expected_output": 2,"actual_output": 1,"pass": false},{"test_id": 4,1 unmodified line"binary": 127},"expected_output": 64,"actual_output": 63,"pass": false},{"test_id": 5,1 unmodified line"binary": 255},"expected_output": 128,"actual_output": 255,"pass": false},{"test_id": 6,1 unmodified line"binary": 254},"expected_output": 129,"actual_output": 254,"pass": false},{"test_id": 7,1 unmodified line"binary": 5},"expected_output": 7,"actual_output": 0,"pass": false},{"test_id": 8,1 unmodified line"binary": 10},"expected_output": 15,"actual_output": 0,"pass": false},{"test_id": 9,1 unmodified line"binary": 15},"expected_output": 8,"actual_output": 7,"pass": false},{"test_id": 10,1 unmodified line"binary": 128},"expected_output": 192,"actual_output": 128,"pass": false},{"test_id": 11,1 unmodified line"binary": 127},"expected_output": 64,"actual_output": 63,"pass": false}]}
123456<testsuites name="results"><testsuite name="all" package="all"><property name="random_seed" value="1775630292" /><testcase name="test_bin_to_gray" classname="test_bin_to_gray" file="/mnt/c/Users/npkas/Agentic-RL/rtl_debugger/tasks/task2/test_bin_to_gray.py" lineno="20" time="0.021413326263427734" sim_time_ns="12.0" ratio_time="560.3986906272964" /></testsuite></testsuites>12345678<testsuites name="results"><testsuite name="all" package="all"><property name="random_seed" value="1775636844" /><testcase name="test_bin_to_gray" classname="test_bin_to_gray" file="/mnt/c/Users/npkas/Agentic-RL/rtl_debugger/tasks/task2/test_bin_to_gray.py" lineno="20" time="0.005563259124755859" sim_time_ns="12.0" ratio_time="2157.0089997428645"><failure error_type="AssertionError" error_msg="Some test cases failed assert False" /></testcase></testsuite></testsuites>
7 unmodified lines891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162637 unmodified lines:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2005_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/va_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2009.vpi";S_0x55b47534e490 .scope package, "$unit" "$unit" 2 1;.timescale -9 -12;S_0x55b47534e620 .scope module, "bin_gry" "bin_gry" 3 1;.timescale -9 -12;.port_info 0 /INPUT 8 "binary";.port_info 1 /OUTPUT 8 "gray";P_0x55b47534e7b0 .param/l "N" 0 3 1, +C4<00000000000000000000000000001000>;o0x7fe4c9e7a048 .functor BUFZ 8, C4<zzzzzzzz>; HiZ drivev0x55b475360430_0 .net "binary", 7 0, o0x7fe4c9e7a048; 0 driversv0x55b4753987b0_0 .var "gray", 7 0;E_0x55b475387890 .event anyedge, v0x55b475360430_0;S_0x55b475375940 .scope begin, "$ivl_for_loop0" "$ivl_for_loop0" 3 14, 3 14 0, S_0x55b47534e620;.timescale -9 -12;v0x55b47535fd50_0 .var/i "i", 31 0;.scope S_0x55b47534e620;T_0 ;%wait E_0x55b475387890;%load/vec4 v0x55b475360430_0;%parti/s 1, 7, 4;%ix/load 4, 7, 0;%flag_set/imm 4, 0;%store/vec4 v0x55b4753987b0_0, 4, 1;%fork t_1, S_0x55b475375940;%jmp t_0;.scope S_0x55b475375940;t_1 ;%pushi/vec4 0, 0, 32;%store/vec4 v0x55b47535fd50_0, 0, 32;T_0.0 ;%load/vec4 v0x55b47535fd50_0;%cmpi/s 7, 0, 32;%jmp/0xz T_0.1, 5;%load/vec4 v0x55b475360430_0;%load/vec4 v0x55b47535fd50_0;%addi 1, 0, 32;%part/s 1;%load/vec4 v0x55b475360430_0;%load/vec4 v0x55b47535fd50_0;%part/s 1;%xor;%ix/getv/s 4, v0x55b47535fd50_0;%store/vec4 v0x55b4753987b0_0, 4, 1;%load/vec4 v0x55b47535fd50_0;%addi 1, 0, 32;%store/vec4 v0x55b47535fd50_0, 0, 32;%jmp T_0.0;T_0.1 ;%end;.scope S_0x55b47534e620;t_0 %join;%jmp T_0;.thread T_0, $push;# The file index is used to find the file name in the following table.7 unmodified lines89101112131415161718192021222324252627282930313233343536373839407 unmodified lines:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2005_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/va_math.vpi";:vpi_module "/usr/lib/x86_64-linux-gnu/ivl/v2009.vpi";S_0x55f98416c570 .scope package, "$unit" "$unit" 2 1;.timescale -9 -12;S_0x55f98416c700 .scope module, "bin_gry" "bin_gry" 3 1;.timescale -9 -12;.port_info 0 /INPUT 8 "binary";.port_info 1 /OUTPUT 8 "gray";P_0x55f98416c890 .param/l "N" 0 3 1, +C4<00000000000000000000000000001000>;o0x7f3e501fc018 .functor BUFZ 8, C4<zzzzzzzz>; HiZ drivev0x55f98417dd50_0 .net "binary", 7 0, o0x7f3e501fc018; 0 driversv0x55f98417e430_0 .var "gray", 7 0;E_0x55f98416d080 .event anyedge, v0x55f98417dd50_0;.scope S_0x55f98416c700;T_0 ;%wait E_0x55f98416d080;%load/vec4 v0x55f98417dd50_0;%parti/s 1, 7, 4;%ix/load 4, 7, 0;%flag_set/imm 4, 0;%store/vec4 v0x55f98417e430_0, 4, 1;%load/vec4 v0x55f98417dd50_0;%parti/s 7, 1, 2;%load/vec4 v0x55f98417dd50_0;%parti/s 7, 0, 2;%and;%ix/load 4, 0, 0;%flag_set/imm 4, 0;%store/vec4 v0x55f98417e430_0, 4, 7;%jmp T_0;.thread T_0, $push;# The file index is used to find the file name in the following table.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162module moore_ol(inp,clk,reset,out);input inp, clk, reset;output reg out;parameter S0 = 0 , S1 = 1 , S2 = 2 , S3 = 3, S4 = 4;reg [2:0] present_state, next_state;always @ (posedge clk or posedge reset)beginif(reset)present_state <= S0;elsepresent_state <= next_state;endalways @ (present_state or inp)begincase(present_state)S0 : beginif (inp)next_state = S1;elsenext_state = S0;out = 0;endS1 : beginif (inp)next_state = S2;elsenext_state = S0;out = 0;endS2 : beginif (inp)next_state = S2; // FIX: If current state is S2 (seen '11') and input is '1', the sequence becomes '111'. The longest suffix of '111' that is also a prefix of '1101' is '11'. So, the FSM should remain in S2. It was incorrectly transitioning to S1.elsenext_state = S3;out = 0;endS3 : beginif (inp)next_state = S4;elsenext_state = S0;out = 0;endS4 : beginif (inp)next_state = S2;elsenext_state = S0;out = 1;enddefault: next_state = S0;endcaseendendmodule1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162module moore_ol(inp,clk,reset,out);input inp, clk, reset;output reg out;parameter S0 = 0, S1 = 1, S2 = 2, S3 = 3, S4 = 4;reg [2:0] present_state, next_state;always @ (posedge clk or posedge reset)beginif (reset)present_state <= S0;elsepresent_state <= next_state;endalways @ (present_state or inp)begincase(present_state)S0 : beginif (inp)next_state = S1;elsenext_state = S0;out = 0;endS1 : beginif (inp)next_state = S2;elsenext_state = S0;out = 0;endS2 : beginif (inp)next_state = S3;elsenext_state = S0;out = 0;endS3 : beginif (inp)next_state = S4;elsenext_state = S0;out = 0;endS4 : beginif (inp)next_state = S2;elsenext_state = S0;out = 1;enddefault: next_state = S0;endcaseendendmodule
.gitattributes+6
Dockerfile+22-5
README.md+35-15
client.py+1-1
inference.py+25-25
openenv.yaml+4-4
requirements.txtAdded+12
server/app.py+5-5
server/graders.py+103-19
server/rtl_debugger_environment.py+10-7
tasks/task1/design_active.v+3-5
tasks/task1/results.xml+2-2
tasks/task1/sim_build/VtopAdded+3
tasks/task1/sim_build/Vtop.cppAdded+99
tasks/task1/sim_build/Vtop.hAdded+92
tasks/task1/sim_build/Vtop.mkAdded+72
tasks/task1/sim_build/Vtop__ALL.aAdded
tasks/task1/sim_build/Vtop__ALL.cppAdded+10
tasks/task1/sim_build/Vtop__ALL.dAdded+14
tasks/task1/sim_build/Vtop__ALL.oAdded
tasks/task1/sim_build/Vtop__Dpi.cppAdded+16
tasks/task1/sim_build/Vtop__Dpi.hAdded+22
tasks/task1/sim_build/Vtop__Syms.cppAdded+50
tasks/task1/sim_build/Vtop__Syms.hAdded+47
tasks/task1/sim_build/Vtop___024root.hAdded+47
tasks/task1/sim_build/Vtop___024root__DepSet_h84412442__0.cppAdded+40
tasks/task1/sim_build/Vtop___024root__DepSet_h84412442__0__Slow.cppAdded+24
tasks/task1/sim_build/Vtop___024root__DepSet_heccd7ead__0.cppAdded+179
tasks/task1/sim_build/Vtop___024root__DepSet_heccd7ead__0__Slow.cppAdded+154
tasks/task1/sim_build/Vtop___024root__Slow.cppAdded+24
tasks/task1/sim_build/Vtop__pch.hAdded+29
tasks/task1/sim_build/Vtop__ver.dAdded+1
tasks/task1/sim_build/Vtop__verFiles.datAdded+23
tasks/task1/sim_build/Vtop_classes.mkAdded+57
tasks/task1/sim_build/sim.vvp+10-10
tasks/task1/sim_build/verilated.dAdded+12
tasks/task1/sim_build/verilated.oAdded+3
tasks/task1/sim_build/verilated_dpi.dAdded+12
tasks/task1/sim_build/verilated_dpi.oAdded
tasks/task1/sim_build/verilated_threads.dAdded+8
tasks/task1/sim_build/verilated_threads.oAdded
tasks/task1/sim_build/verilated_vpi.dAdded+13
tasks/task1/sim_build/verilated_vpi.oAdded+3
tasks/task1/sim_build/verilator.dAdded+14
tasks/task1/sim_build/verilator.oAdded
tasks/task2/design_active.v+15-18
tasks/task2/result.json+24-24
tasks/task2/results.xml+4-2
tasks/task2/sim_build/sim.vvp+19-42
tasks/task3/design_active.v+37-37