羲和 HeliosLM HDL E4B

發佈者 Published by: Bitstar Inc.

羲和 HDL E4B 是以 Google Gemma 4 E4B-it 為基礎、針對 Verilog / SystemVerilog 硬體設計調整的模型。用途是寫 RTL、修改既有 RTL、依錯誤訊息或測試結果修 bug,撰寫 UPF 低功耗描述,以及撰寫 UVM / SystemVerilog 測試平台。

HeliosLM HDL E4B is a model for Verilog / SystemVerilog hardware design, based on Google Gemma 4 E4B-it. It is meant for writing RTL, editing existing RTL, fixing bugs from compiler messages or failing test logs, writing UPF power intent, and writing UVM / SystemVerilog testbenches.

  • 參數量 Parameters: about 8B (Gemma 4 E4B architecture, text only)
  • 授權 License: Apache-2.0, same as Google Gemma 4
  • 單張 16 GB 以上 GPU 可跑 bf16;8 GB 顯卡請用 GGUF 版 helioslm-hdl-e4b-GGUF。 bf16 runs on one 16 GB+ GPU; for 8 GB cards use the GGUF build linked above.

怎麼做的 How it was made

  1. 在 Gemma 4 E4B 上,用公開、可合成的 Verilog / SystemVerilog 專案做持續訓練與強化學習(以模擬測試結果當獎勵)。

  2. 把上一步與 Gemma 4 E4B 的差異,以 0.5 倍加回 Gemma 4 E4B-it(chat vector),保留原本的對話與指令能力。

  3. 再用 LoRA 做一輪小規模微調,資料是「修改既有 RTL」與「依錯誤訊息修 bug」的練習題,以及 Verilog 題目與解答。最後把 LoRA 合併進權重。

  4. 再用一輪 LoRA 加入 UPF(IEEE 1801)低功耗描述的練習題,同時重放前一輪的 RTL 資料以保留原本能力,也合併進權重。

  5. 第三輪 LoRA 加入 UVM 測試平台、VIP、依規格寫 RTL 與測試平台的練習題,每一筆都經過我們自己的模擬器實際編譯執行並通過才收;同樣重放前面的 RTL 與 UPF 資料,再合併進權重。

  6. 第四輪 LoRA 加入撰寫 SVA 斷言、coverage 收斂、regression 與失敗分析、以及在不改變行為下縮小面積與功耗的 RTL 改寫練習題;每一筆都經過我們自己的模擬、coverage 與合成/功耗工具檢查才收,並重放前面的資料。

  7. Continued training and reinforcement learning (simulation pass/fail as reward) on Gemma 4 E4B with public, synthesizable Verilog / SystemVerilog projects.

  8. The difference from Gemma 4 E4B was added back to Gemma 4 E4B-it at 0.5x (chat vector), keeping its instruction-following ability.

  9. A small LoRA fine-tune on RTL-editing and bug-fixing exercises plus Verilog instruction data, merged into the weights.

  10. A second LoRA round adding UPF (IEEE 1801) power-intent exercises, with replay of the earlier RTL data, also merged.

  11. A third LoRA round adding UVM testbench, VIP, and spec-to-RTL / spec-to-testbench exercises, each one compiled and run on our own simulator and kept only if it passed, with replay of the earlier RTL and UPF data, also merged.

  12. A fourth LoRA round adding exercises for writing SVA assertions, coverage closure, regression runs with failure triage, and behaviour-preserving RTL rewrites for smaller area and power, each checked with our own simulation, coverage and synthesis/power tools, with replay of the earlier data.

訓練資料 Training data (all public):

  • OpenTitan (Apache-2.0), Ibex and CV32E40P (Solderpad) RTL. 編輯/修 bug 練習題是從這些程式自動產生的。Editing and bug-fix exercises were generated automatically from this code.
  • 公開 GitHub Verilog / SystemVerilog 專案(The Stack 中寬鬆授權的部分,以及公開的 Verilog GitHub 資料集),只收通過 Verilator lint 與 Yosys 合成的專案。Public GitHub HDL projects (the permissively licensed part of The Stack and a public Verilog GitHub corpus), kept only when they pass Verilator lint and Yosys synthesis.
  • 我們自己以 Apache-2.0 公開的 IP / VIP 程式與其測試平台。Our own IP / VIP code and testbenches published under Apache-2.0.
  • UPF 練習題:我們自己寫的產生器,加上 GitHub 上寬鬆授權的 UPF 檔案,全部經過語法與語意檢查。UPF exercises from our own generator plus permissively licensed UPF files from GitHub, all syntax- and rule-checked.
  • 其他寬鬆授權的開源處理器與 SoC 設計(例如 XiangShan,Mulan PSL v2)自動產生的修 bug/補完練習題。Bug-fix and completion exercises generated from other permissively licensed open CPU / SoC designs (for example XiangShan, Mulan PSL v2).
  • 開放權重模型寫出的測試平台,只收在我們模擬器上通過的。Testbenches written by open-weight models, kept only when they passed on our simulator.
  • CodeV-R1-dataset (CC-BY-SA-4.0) Verilog instruction data.

評測用的題目(VerilogEval、RTLLM、CVDP、我們保留的 OpenTitan 測試題與保留的 IP 題目)已從訓練資料中排除。 Benchmark problems (VerilogEval, RTLLM, CVDP, our held-out OpenTitan tasks and held-out IP tasks) were removed from the training data.

使用方式 Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
name = "chienhsinlin/helioslm-hdl-e4b"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "Write a synthesizable Verilog module for a 4-bit up/down counter with synchronous reset."}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=2048, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))

vLLM: vllm serve chienhsinlin/helioslm-hdl-e4b --max-model-len 16384

建議 Tips:

  • 修 bug 時,把整個模組原始碼和錯誤訊息/測試 log 一起貼上,並要求輸出完整模組。Paste the whole module plus the error message or failing log, and ask for the complete fixed module.
  • 產生的 RTL 一定要用自己的模擬與合成流程驗證。Always check generated RTL with your own simulation and synthesis flow.

限制 Limitations

  • 這是 HDL 專用模型,不適合一般聊天或事實問答。It is specialized for HDL and is not meant for general chat or factual Q&A.
  • UVM 測試平台通常要搭配模擬器錯誤訊息修幾輪才會通過;從規格一次寫出完整 IP 或完整測試平台,能力仍有限;UPF 的 level shifter 指令偶爾會寫錯。UVM testbenches usually need a few repair rounds with simulator messages; writing a whole IP or a whole testbench from a spec in one pass is still weak; UPF level-shifter commands are sometimes wrong.
  • 輸出可能有語法或功能錯誤,請勿未經驗證直接用於量產設計。Outputs can contain syntax or functional errors; do not use them in production silicon without verification.
Downloads last month
326
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for chienhsinlin/helioslm-hdl-e4b

Finetuned
(507)
this model
Quantizations
1 model