Questions tagged [verilog]

For use with the Verilog hardware-description language. Also tag with the IDE or fpga used, if applicable.

From Wikipedia:

Verilog, standardized as IEEE 1364, is a hardware description language (HDL) used to model electronic systems. It is most commonly used in the design and verification of digital circuits at the register-transfer level of abstraction.

Logic synthesis

Automated tools are able to translate Verilog code meeting certain restrictions into a gate-level description of the circuit that can then be implemented in an FPGA or IC. The task is in some ways similar to the task of a compiler for conventional programming languages, but such tools for Verilog are known as "synthesis tools". Language constructs and coding styles that can be processed by synthesis tools are known as "synthesizable". Constructs that are not synthesizable may be used for testbenches, reference models, or debug instrumentation.

When asking a question, please specify whether you are looking for a synthesizable solution.

Sometimes referred to as Verilog HDL, not to be confused with VHDL.

Standardization

Verilog was initially a proprietary system developed by Gateway Design Automation (later acquired by Cadence Design Systems). Verilog became an open standard under the auspices of Open Verilog International (OVI). OVI became part of Accellera, a non-profit organization that develops standards for modeling and verifying system-level designs. Accellera contributes standards to the IEEE once they are mature, and Verilog became standardized as IEEE 1364. The last version was IEEE 1364-2005 (not available as a free download). IEEE 1364 Verilog has been superseded by IEEE 1800 SystemVerilog.

Tags specific to Verilog

6035 questions
5
votes
1 answer

Understanding the difference between overflow and carry flags

I am designing a 16 bit ALU in verilog based on an existing RISC ISA. The ISA says that the carry flag is set when the operation is unsigned, and overflow is set when the operation is signed. The interesting thing is that the ISA implements ADD and…
richbai90
  • 4,994
  • 4
  • 50
  • 85
5
votes
3 answers

Simple Verilog VPI module to open audio files

I would like to write a VPI/PLI interface which will open audio files (i.e. wav, aiff, etc) and present the data to Verilog simulator. I am using Icarus at the moment and wish to use libsndfile to handle input file formats and data type…
errordeveloper
  • 6,716
  • 6
  • 41
  • 54
5
votes
1 answer

In verilog, Is there any difference between import package at compilation unit scope and module header?

In verilog, Is there any difference between import package at compilation unit scope(1) and module header(2)? 1) at compilation unit scope import mypkg::*; module my_module( port_declaration ... 2) at module header module my_module import…
Yunsung Mo
  • 89
  • 1
  • 6
5
votes
1 answer

Verilog naming convention of \add_34/U1_1_6

Can somebody explain what this naming convention means in the Verilog line below? I don't know what this \add_34/.... part means? ADDHXL \add_34/U1_1_6 (.A(n1022),.B(\add_34/carry[6] ),.CO(\add_34/carry[7] ),.S(N11)); If I have a wire named…
VSB
  • 9,825
  • 16
  • 72
  • 145
5
votes
3 answers

How to restart a Verilog simulation in Modelsim

I'm trying to debug a Verilog module. I find it tedious to have to stop a simulation, modify code, and then go through the process of starting the simulation again. Is there an easier way?
node ninja
  • 31,796
  • 59
  • 166
  • 254
5
votes
1 answer

Cannot match operand(s) in the condition to the corresponding edges in the enclosing event control of the always construct

This code fails to compile and gives the error as in the title at the "if(overflow)" line. always @(posedge clk or negedge overflow) begin if(overflow) count_posedge = count_posedge + 1; else count_posedge = 0; end I've…
namcao00
  • 272
  • 1
  • 6
  • 10
5
votes
1 answer

Why use functions in verilog when there is module

Part 1: I was always told to use functions in Verilog to avoid code duplication. But can't I do that with a module? If my understanding is correct, all functions can be re-written as modules in Verilog except that modules cannot be instantiated from…
user3219492
  • 774
  • 1
  • 10
  • 18
5
votes
2 answers

Verilog (assign in always)

I came to know that we can use assign statements in procedural blocks(like in always), what will be the difference in using "assign" inside always block and outside it(in concern with synthesized circuit). I mean when it is absolutely necessary to…
RIshabh yadav
  • 51
  • 1
  • 1
  • 2
5
votes
2 answers

how to initialize ram of multiple instance with different contents in quartus

I designed a RAM module, and I need multiple instances of this module each with a different memory initialization file. The Quartus manual says that Quartus supports the $readmemh() function to initialize RAM. So I added two parameters to this…
paigu
  • 51
  • 4
5
votes
1 answer

Do I need an else statement in a sequential always block?

Now I'm tying to implement the clock gating as the below. but I can't understand why and how do I handle the De signal? module ClockGating( input wire rst_n, input wire clk, input wire De, input wire…
grander3
  • 161
  • 4
  • 13
5
votes
1 answer

Simplest way to generate Verilog code from Chisel code

What is the simplest way to generate Verilog code from existing Chisel code? Would i have to create my own build file? For example from a standalone scala file (AND.scala) like the following one.. import Chisel._ class AND extends Module { val…
mtosch
  • 351
  • 4
  • 18
5
votes
3 answers

Verilog to GDSII compiler (open-source)

May be this question a bit not for StackOverflow, but both compilers and Verilog (which can be considered as programming language) are related to this project. Where can I find a open-source (or downloadable and free-to-noncommercial-use) compiler…
osgx
  • 90,338
  • 53
  • 357
  • 513
5
votes
1 answer

Cocotb VHDL need for FLI

I am currently setting up a Cocotb based verification environment. I just discovered that the example provided with Cocotb don't work in my case if using VHDL, because my simulator has no FLI (foreign language interface). I get the following…
user1654361
  • 359
  • 3
  • 11
5
votes
2 answers

Generic in verilog from a vhdl programmer

What's the equivalent of the generic in verilog? For example entity my_entity generic(a : integer); port(x : in std_logic; y out std_logic); end entity my_entity; What's the equivalent for generic? Also what's the equivalent for the if generate and…
user8469759
  • 2,522
  • 6
  • 26
  • 50
5
votes
1 answer

Verilog signed multiplication: Multiplying numbers of different sizes?

For some reason I have been unable to find any definitive resources or stackoverflow questions answering this: Does verilog take care of input and output dimensions when multiplying signed numbers? To be specific, what happens if I multiply a…
sirblobfish
  • 53
  • 1
  • 1
  • 3