🧠 conversion_prompt.md

C → Verilog 変換プロンプト / Prompt for C → Verilog Conversion

GitHub
Hybrid License


📖 概要 / Overview

JP:
このテンプレートは、C言語で記述された制御式やアルゴリズムVerilog HDL に変換するためのプロンプト例を提供します。
ChatGPTなどのLLMと組み合わせて利用し、HDL初学者向けの実装演習固定小数点処理の理解を促進します。

EN:
This template provides example prompts for converting control expressions or algorithms written in C into Verilog HDL.
It is intended for use with LLMs such as ChatGPT to support beginner-friendly HDL implementation exercises and understanding of fixed-point processing.


🎯 目的 / Purpose


📝 入力テンプレート(Cコード形式)

Input Template (C Code)

// 例: PI制御の1ステップ演算
// Example: One-step PI control calculation
error = ref - meas;
integral = integral + error;
output = Kp * error + Ki * integral;

💬 ChatGPT用プロンプト例

Example Prompt for ChatGPT

以下のCコードを、固定小数点を考慮したVerilog HDLに変換してください。
Please convert the following C code into Verilog HDL with fixed-point arithmetic.

条件 / Conditions:
- `ref`, `meas`, `output`, `integral`, `error` は16ビット幅
- `Kp`, `Ki` は定数(parameter)として定義
- 逐次処理用の always ブロック内で記述
- Use 16-bit width for `ref`, `meas`, `output`, `integral`, and `error`
- Define `Kp` and `Ki` as constants (parameter)
- Implement inside an always block for sequential logic

[Cコード / C Code]
---
error = ref - meas;
integral = integral + error;
output = Kp * error + Ki * integral;
---

✅ 注意点 / Notes



📄 ライセンス / License

教材・コード・図表の性質に応じた ハイブリッドライセンス を採用
Hybrid licensing based on the nature of materials, code, and diagrams.

項目 / Item ライセンス / License 説明 / Description
コード(Code) MIT License 自由に使用・改変・再配布可
Free to use, modify, and redistribute
教材テキスト(Text materials) CC BY 4.0 著者表示必須
Attribution required
図表・イラスト(Figures & diagrams) CC BY-NC 4.0 非商用利用のみ可
Non-commercial use only
外部引用(External references) 元ライセンスに従う
Follow the original license
引用元を明記
Cite the original source

🏠 SoC_DesignKit_by_ChatGPTトップへ / Back to SoC_DesignKit_by_ChatGPT