Dataset Viewer
Auto-converted to Parquet Duplicate
messages
listlengths
3
3
provenance
dict
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:f3d5e73bfab456b308dbc8bb", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:8af478b5f460f8f60d5a45c1", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:4b802cc107bad68992acaabd", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:3de07ca6c9970400e80fb788", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": false, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:6e9d8c7741f29a7ddfa185ba", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:70ebe83949e5735223bd6539", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:f4c05f5f6660aff24825b606", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:5bb0de19e531462f1ec2afbd", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:b9ae8c2162bfbafb7ebb99c4", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:53fc3f8a9c912317108a2f1c", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:e2f2d321dc7cbf26b43b4f2c", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:9d5b22c160c521c2d09b5007", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:8f4e0ee46ac0e08e61f2d350", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:c3f91d17def99f15d0b5e575", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:1c949250e56113a2e8e86146", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:21ed39f38c10a7bf9eff26a7", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": true, "verilog_split": "train" }
[ { "role": "system", "content": "You are an expert hardware modeling assistant. Your task is to write Python code that serves as a cycle-accurate reference model for a Verilog hardware module. Your Python code's outputs must match the expected outputs of the Verilog circuit exactly.\n\nThe user will provide ...
{ "id": "codev_r1:e406271087a464028fe2a5c5", "source": "codev_r1", "answer_origin": "v32_reuse", "harness": "iverilog_golden_300cyc", "harness_verdict": "pass", "comb": false, "verilog_split": "train" }
End of preview. Expand in Data Studio

RTL Verilog β†’ Python reference-model SFT

Task: given a hardware problem description and an interface skeleton, write a cycle-accurate Python model class TopModule with eval(inputs: dict) -> dict (one call = one rising edge of every clock; clock inputs are not passed; reset is an ordinary input; outputs are read after the edge). This is the Python agent of ChipMATE-style Verilog/Python cross-verification.

Training and evaluation code, recipe and documentation: github.com/yil384/rtl-qwen-sft, docs/PYTHON_SFT.md (configs configs/qwen38-27b-python.example.yaml, configs/b200-multinode-qwen38-27b-python.example.yaml).

Layout

File Rows Use
data/python.train.jsonl 96,525 SFT train
data/python.validation.jsonl 1,078 frozen; eval_loss only
data/python.test.jsonl 1,037 frozen; never trained on
bench/python_bench.validation.jsonl 1,151 problems benchmark python-heldout-val (checkpoint selection)
bench/python_bench.test.jsonl 1,095 problems benchmark python-heldout (report)
release_manifest.json rows, sha256, sources and answer origins per file

SFT rows: {"messages": [system, user, assistant], "provenance": {...}}. The user turn is the spec, then Complete this skeleton:, a Python skeleton and Answer:. The assistant turn is <think>...</think> followed by <answer> with one fenced python block. Benchmark rows: {"problem_id", "messages": [system, user], "golden", "reference_python", "provenance"}. golden is the reference Verilog's trace: ports, stored stimulus and expected outputs per cycle. reference_python is the verified pipeline answer, used only for the harness self-check, or null.

How the answers were made and checked

Every problem's reference Verilog (from yil384/rtl-verilog-sft v062 code view) is simulated with yosys + Icarus Verilog for 300 cycles of fixed random stimulus. The seed is 0. Each input is all-zeros 10% of the time, all-ones 10%, uniform otherwise. Reset is asserted for the first 3 cycles and then with probability 0.03. Outputs are sampled after each rising edge, and X/Z bits are don't-care. Problems with less than 50% known output bits are not used. An answer is kept only if every output matches on every cycle.

provenance.answer_origin train rows how
ir_transpile_normalized+posthoc_rationale 65,477 PyVerilog AST transpiler output, normalized to the skeleton convention (clock not read, settle loop unrolled), re-verified
llm_verilog_hint+posthoc_rationale 20,744 Qwen3-Coder-30B-A3B-Instruct, shown the reference Verilog; first verified sample
llm_verilog_hint_repair+posthoc_rationale 1,313 one repair round with the harness feedback (first mismatching cycle, expected/got bits, off-by-k-cycles diagnosis)
v32_reuse / v12_reuse 4,698 / 4,293 existing V32 / v12 skeleton-format answers for the same prompt that pass our trace, kept with their original rationale

Sources (license of each row follows its upstream Verilog source; see the Verilog dataset card): CodeV-R1 40,702, VeriCoder 32,465, VeriMM 11,391, VeriThoughts 6,467, VeriReason-Luna 5,500. Combinational 56,422, sequential 40,103.

Splits and leakage

  • Train, validation and test come from the Verilog v062 code.train, code.validation and code.test splits. 11,304 train rows are CodeV-R1 problems outside the Verilog 100k. They were compared with the held-out problems by id, spec text and reference-Verilog hash.
  • Removed from train: 5 rows whose spec equals a held-out spec, and 13 rows over 16,384 tokens (Qwen3.8 tokenizer, qwen3_5 template with thinking). Long rows are dropped, never truncated.
  • Removed from the held-out side: rows whose answer code is identical to a train answer (validation 158, test 115). Trivial circuits translate to identical Python for different problems. The same problems are also removed from the benchmark files, as are 5 benchmark problems without an SFT row whose reference answer equals a train answer (validation 4, test 1). So no held-out problem has its verified answer verbatim in training. One test row over 16,384 tokens was also dropped.
  • The benchmark files keep every remaining problem with a usable trace, whether or not a verified answer exists: 1,102 of 1,151 and 1,052 of 1,095 have reference_python.
  • Built for the held-out splits with the same pipeline. Only one GPU was free for that run, so the fallback generator ran with FP8 weights there. Every answer still had to pass the trace.
  • The training repository's prepare accepts the three SFT files with 0 rejected rows. Its checks cover duplicate ids, duplicate dialogues, and cross-split id/group/prompt/response matches.

Limitations

  • Post-hoc reasoning. Except for the two *_reuse origins, the <think> text was written by Qwen3-Coder-30B-A3B-Instruct after the code had passed verification, as in ChipMATE sec. 2.3. It explains a known-correct answer and is not how the answer was derived. Rationales that mention Verilog, the converter or a given solution, or that criticize the code, were filtered.
  • Verified β‰  correct. A pass means agreement with one reference Verilog on one finite 300-cycle trace. That is differential testing, not formal equivalence. Behavior outside the stimulus is unchecked, and the reference itself can be wrong.
  • IR-derived answers are mechanical in style: two-phase current/next-state temporaries and extra width masks.
  • Not 100k: about 13k train-pool problems got no verified answer from the available generator.
  • No model trained on this set has been evaluated yet.

History

python_sft.train.jsonl at the repository root is the earlier 96,543-row train file in ShareGPT conversations format. It is superseded by data/python.train.jsonl (same answers, messages format, the removals above). legacy/ holds the original 47,205-row v12 skeleton file, unverified, as is.

Downloads last month
66