Icarus_Verilog

This repo contains code snippets written in verilog as part of course Computer Architecture of my university curriculum

View on GitHub

Verilog Snippets and Notes

A host for some Verilog-snippets written during Lab Sessions of Computer Architecture Course at BITS Pilani.

Consider giving it a ☆ if the repo helps you in any way

Running a file

iverilog -o filename.vvp filename.v
vvp filename.vvp
initial
    begin
        $dumpfile("filename.vcd");
        $dumpvars;
    end
gtkwave filename.vcd
`include "modulename.v"

Most Common Mistakes in Verilog

  1. All keywords should be in lower case.
  2. Upper case and lower case are distinct in verilog, it is case sensitive
  3. Make sure that the wires are properly declared before usage.
  4. Unwanted spaces will put you in trouble ex. endmodule doesn’t have any space in between.
  5. Module declaration is a statement terminate it with a semicolon.
  6. Module name can’t start with a number and can’t have a special charcters in it.
  7. The output ‘x’ indicates that the signal is still unkown and being evaluated.
  8. In combinational circuits ‘z’ in the output means the signals are not connected properly.

Labs Breakdown

Lab# Labsheet notes topic
1 link link Intro to verilog
2 link link Combinational Circuit Modeling
3 link link Sequential Circuit Modeling
4 link link ALU Design
5 link link Register File Implementation
6 link link Single Cycle Datapath Design
7 link link Multi-Cycle controller Design
8 link link Pipeline Design

References

  1. Verilog HDL by Samir Palnitkar

Disclaimer

Commit History Visualizer

GIF

video