Verilog HDL Notes-Basic Introduction

Shih Jiun Lin Lv4

Verilog HDL Notes-Basic Introduction

4 Basic Models of Verilog

RTL V.S. Behavioral

  • RTL: it specifies how data flows between registers and logic gates. Allowing you to optimize the circuit by controlling the number and type of registers and logic gates. (MORE SUITABLE FOR SYNTHESIS)
  • Behavioral: it describes the behavior of the circuit at a higher level of abstraction, without specifying the details of the hardware implementation. Allowing you to model complex or abstract features of the circuit, without worrying about the hardware implementation. (MORE SUITABLE FOR SIMULATION)

image

Data Types

{36F7B552-E1D6-41F2-846C-08637D0E8C41}

Basic Operations

{E12F0678-988D-4CA3-B9BD-727AA2C5307B}

Basic Blocks

for loop v.s. generate for loop

  • For loop: a regular for loop in Verilog is a procedural statement used to iterate over a block of code during simulation. It is typically used inside procedural blocks such as always, initial, or within tasks and functions.
  • Generate for loop: The generate block combined with a for loop allows you to instantiate multiple hardware components (e.g., modules, registers, gates) based on a loop index.

task and function

{71D7B394-46F5-434A-80F6-0970131C576F}

Ways of Assignments

Blocking assignment v.s. Non-blocking assignment

  • Blocking Assignment: A blocking assignment in Verilog uses the " = " operator. It executes sequentially, just like traditional programming languages such as C or Python.
  • A non-blocking assignment in Verilog uses the " <= " operator. It executes parallelly, and the actual assignment is deferred until the end of the simulation time step.
{A7B14010-4373-4579-B263-B7C412D919B5}

Port-Net Mapping

Port-Associated Mapping v.s. Ordered Mapping

  • Port-Associated: M1 U1(.A(Node2), .CLK(Wire1), .B(Net3))
  • Ordered Mapping: M1 U1(Wire1, Node2, Net3)
{6050B0C1-3517-4346-8680-AC0B9C3047C1}
  • Title: Verilog HDL Notes-Basic Introduction
  • Author: Shih Jiun Lin
  • Created at : 2024-10-12 07:20:00
  • Updated at : 2024-10-12 20:04:34
  • Link: https://shih-jiun-lin.github.io/2024/10/12/Verilog HDL Notes-Basic Introduction/
  • License: This work is licensed under CC BY-NC-SA 4.0.