How jessesme/granite-llm-test works
tinyllm is a register-based SystemVerilog implementation of Granite 4.0-H-350M decoder layers, with model weights baked into the design. Its documented end-to-end path starts with token embeddings, processes a hybrid stack of Mamba2 and attention decoder layers, then applies the tied embedding/LM head to produce logits. A single-layer wrapper combines normalization, a Mamba2 mixer, residual addition and MLP; the documented hybrid check runs one RTL layer and the remaining layers in software. The supplied tree omits RTL files, so paths below use the exact unit directories present in the tree; edges follow README-described behavior.
Main entry points: granite_layer 32-layer decoder · mamba2_unit Mamba2 layer · embedding_lookup_unit Token embedding · output_projection_unit LM projection
Components 16
Input and output
- Token embedding
src/embedding_lookup_unit - LM projection
src/output_projection_unit
Mamba processing
- Mamba2 layer
src/mamba2_unit - Causal Conv1D
src/conv1d_unit - State-space scan
src/SSM_unit
Attention processing
- Attention layer
src/attention_unit - Softmax
src/softmax_unit
Layer support
- 32-layer decoder
src/granite_layer - Matrix operations
src/matrix_unit - RMS normalization
src/RMSNorm_unit - Residual addition
src/residual_adder_unit - MLP
src/mlp_unit - SiLU activation
src/SiLU_unit - Sigmoid activation
src/sigmoid_unit
Other components
- Token input
- Token logits
Connections 16
- Token input → Token embedding: provides token
README.md - Token embedding → 32-layer decoder: feeds embeddings
README.md - 32-layer decoder → Mamba2 layer: uses 28 layers
README.md - 32-layer decoder → Attention layer: uses 4 layers
README.md - Mamba2 layer → Causal Conv1D: includes convolution
README.md - Mamba2 layer → State-space scan: includes scan
README.md - 32-layer decoder → RMS normalization: normalizes
README.md - 32-layer decoder → Residual addition: adds residuals
README.md - 32-layer decoder → MLP: applies MLP
README.md - 32-layer decoder → Matrix operations: uses projections
- MLP → SiLU activation: uses activation
- Attention layer → Softmax: normalizes scores
- 32-layer decoder → LM projection: projects hidden state
README.md - Token embedding → LM projection: shares tied weights
README.md - LM projection → Token logits: produces logits
README.md - Mamba2 layer → Sigmoid activation: activation support