mohitmishra786/low-level-dev-skills

verilog-basics-for-lowlevel

Verilog basics skill for firmware and kernel engineers.

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill verilog-basics-for-lowlevel

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

Verilog Basics for Low-Level Engineers

Purpose

Give firmware and kernel engineers enough Verilog/SystemVerilog literacy to read RTL: modules, clocks/resets, combinational vs sequential logic, bus interfaces, and why hardware behavior explains driver bugs — not a replacement for HDL design courses.

When to Use

  • Reference manual unclear — RTL clarifies register behavior
  • Understanding CDC (clock domain crossing) bugs
  • Correlating DMA/AXI transactions with driver ordering
  • Reviewing SoC block diagram with hardware team

Workflow

1. Module structure

verilog
module uart_tx (
    input  wire       clk,
    input  wire       rst_n,   /* active-low async reset */
    input  wire       start,
    input  wire [7:0] data,
    output reg        busy
);
    /* sequential logic */
    always @(posedge clk or negedge rst_n) begin
        if (!rst_n)
            busy <= 1'b0;
        else if (start)
            busy <= 1'b1;
        /* ... */
    end
endmodule

wire = combinational/network; reg in always block = flip-flop unless combinational always @(*).

2. Synthesizable subset (what firmware folks need)

ConstructMeaning
posedge clkRegistered update
assign x = a & bCombinational
case / if in always @(*)Mux logic
Parameters #(.WIDTH(32))Configurable width

Avoid #delay in synthesizable RTL — simulation only.

3. Reset discipline

  • Async assert, sync deassert common (rst_sync_n)
  • Firmware must wait post-reset setup times — see RM reset chapter
  • Multiple reset domains → peripheral may need explicit soft reset bit

4. Bus protocols (reading SoC diagrams)

BusTypical use
APBSlow peripherals, simple reg interface
AHBHigher throughput on-chip
AXIDMA, modern SoCs — bursts, channels

Linux regmap MMIO maps to APB/AXI slave decode in RTL address map.

5. Clock domains

Signals crossing clk_a → clk_b need synchronizers (2+ FFs). Metastability causes intermittent firmware bugs — not fixed in software alone.

6. Simulation vs silicon

bash
# Typical open-source sim (conceptual)
iverilog -o sim.vvp design.v tb.v
vvp sim.vvp

QEMU/peripheral models may not match RTL edge cases.

7. Agent usage

/verilog-basics-for-lowlevel Explain this APB register block and when STATUS bit updates relative to WRITE

Common Problems

SymptomCauseFix
Bit toggles oncePulse in RTLPoll latch / clear-on-read in driver
Random corruptionCDCHardware synchronizer; don't hack delays
Read stale dataBus bridge bufferFollow RM ordering / barrier
IRQ stuckLevel vs pulse in RTLMatch handler ACK sequence
Verilog vs VHDLMixed SoC docsFocus on interface signals table

Related Skills

  • skills/baremetal/mmio-and-bit-manipulation — register access from C
  • skills/baremetal/peripherals-from-datasheet — RM ↔ RTL
  • skills/baremetal/datasheet-and-refmanual-reading — doc navigation
  • skills/kernel-dev/device-tree — hardware integration in Linux
  • skills/qemu/protocol-analysis — validate bus timing

タスクに関連する項目

同じリポジトリから

関連する Skills

すべての Skills
mohitmishra786
コミュニティ

core-dumps

Core dump analysis skill for production crash triage. Use when loading core files in GDB or LLDB, enabling core dump generation on Linux/macOS, mapping symbols with debuginfo or debuginfod, or extracting backtraces from crashes without re-running the program. Activates on queries about core files, ulimit, coredumpctl, debuginfod, crash triage, or analyzing segfaults from production binaries.

導入数
2
GitHub Stars
267
更新日
6月27日
mohitmishra786
コミュニティ

custom-allocators

Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning jemalloc/mimalloc, writing Rust GlobalAlloc, or benchmarking allocator performance. Activates on queries about jemalloc, mimalloc, tcmalloc, arena allocator, GlobalAlloc, or fragmentation.

導入数
2
GitHub Stars
267
更新日
6月27日
mohitmishra786
コミュニティ

ebpf

eBPF skill for Linux observability and networking. Use when writing eBPF programs with libbpf or bpftrace, attaching kprobes/tracepoints/XDP hooks, debugging verifier errors, working with eBPF maps, or achieving CO-RE portability across kernel versions. Activates on queries about eBPF, bpftool, bpftrace, XDP programs, libbpf, verifier errors, eBPF maps, or kernel tracing with BPF.

導入数
2
GitHub Stars
267
更新日
6月27日
mohitmishra786
コミュニティ

flamegraphs

Flamegraph generation and interpretation skill. Use when converting perf, Valgrind Callgrind, or other profiler output into SVG flamegraphs using Brendan Gregg's FlameGraph tools, or when reading flamegraphs to identify performance bottlenecks. Activates on queries about flamegraphs, stackcollapse, flamegraph.svg, identifying hot frames, wide vs tall frames, or performance visualisation.

導入数
2
GitHub Stars
267
更新日
6月27日