Questions tagged [verilog]

Verilog is a hardware description language (HDL) used to model electronic systems. It is most commonly used in the design, verification, and implementation of digital logic chips. Please also tag with [fpga], [asic] or [verification] as applicable. Answers to many Verilog questions are target specific.

Filter by
Sorted by
Tagged with
106 votes
11 answers
115k views

VHDL vs. Verilog [closed]

VHDL and Verilog are some of the HDLs used today. What are the advantages and disadvantages of using Verilog or VHDL over the other?
49 votes
9 answers
12k views

Can an FPGA design be mostly (or completely) asynchronous?

We had a very short FPGA/Verilog course at university (5 years ago), and we always used clocks everywhere. I am now starting out with FPGAs again as a hobby, and I can't help but wonder about those ...
Roman Starkov's user avatar
46 votes
2 answers
14k views

How is ASIC design different from FPGA HDL synthesis?

I've had some experience with FPGA/HDL tool suites such as Xilinx ISE, Lattice Diamond, etc. The general workflow is writing Verilog/VHDL, simulation, testing and then programming the FPGA. I've ...
Robin Rodricks's user avatar
41 votes
7 answers
4k views

Readable and educational implementations of a CPU in a HDL

Can you recommend a readable and educational implementation of a CPU in VHDL or Verilog? Preferably something well documented. P.S. I know I can look at opencores, ...
31 votes
10 answers
70k views

Free IDE for VHDL and Verilog [closed]

I am interested in learning VHDL and Verilog. I was wondering if there is any free IDE for those?
itsaboutcode's user avatar
30 votes
5 answers
56k views

Why are inferred latches bad?

My compiler complains about inferred latches in my combinatorial loops (always @(*), in Verilog). I was also told that inferred latches should preferably be avoided....
Randomblue's user avatar
26 votes
3 answers
152k views

Difference between blocking and nonblocking assignment Verilog

I was reading this page http://www.asic-world.com/verilog/verilog_one_day3.html when I came across the following: We normally have to reset flip-flops, thus every time the clock makes the ...
Void Star's user avatar
  • 1,461
24 votes
7 answers
7k views

How do I learn HDL

I have a course in Digital Design in this semester and just love it. Now I know that most of the work in embedded system and digital design is done on computer simulators first and then implemented ...
Rick_2047's user avatar
  • 3,907
21 votes
2 answers
87k views

What is the "+:" operator called in Verilog?

I am going through a Verilog test case, and I found this statement: assign XYZ = PQR_AR[44*8 +: 64]; What is the "+:" operator known as? I tried to find ...
shailendra's user avatar
16 votes
7 answers
36k views

What's the motivation in using Verilog or VHDL over C?

I come from a programming background and have not messed around too much with hardware or firmware (at most a bit of electronics and Arduino). What is the motivation in using hardware description ...
Reflection's user avatar
16 votes
8 answers
17k views

What is the difference between testing and verification?

Every textbook I've seen makes a big deal of the fact that testing and verification are two different concepts. Yet none of them provides a clear (or clear enough to me, at last) distinction. To ...
VHDL Addict's user avatar
16 votes
2 answers
2k views

Why is this Verilog RAM modification better in terms of resource usage?

I'm using the open-source toolchain Yosys > NextPnr > IcePack for synthesising code for the Lattice HX8K FPGA. Here's a common version of a 1Kb RAM (that I'm ...
Hugo Sereno Ferreira's user avatar
15 votes
1 answer
30k views

Verilog: XOR all signals of vector together

Say I'm given a vector wire large_bus[63:0] of width 64. How can I XOR the individual signals together without writing them all out: ...
Randomblue's user avatar
14 votes
2 answers
68k views

Difference between >> and >>> in verilog?

What is the difference between >> and >>> in verilog/system verilog? I know that ...
daut's user avatar
  • 151
14 votes
1 answer
31k views

Concatenate signal n times in Verilog

Given a signal wire [7:0] dummy, how can I concatenate it n times? That is, is there a notation for the following: ...
Randomblue's user avatar
14 votes
3 answers
3k views

Is there a "Design Patterns" for synthesizable RTL?

For software, the book Design Patterns is a set of patterns for doing common things in software and it gives software practitioners common terminology to describe some of the components they need to ...
Ross Rogers's user avatar
14 votes
4 answers
8k views

SystemC vs other HDLs [closed]

I am currently involved in a university project to implementing a processor of an existing instruction set. The idea is that by the end of the project I should be able to synthesise this design and ...
Andrés AG's user avatar
13 votes
3 answers
2k views

In FPGAs, is it safe to execute non-blocking assignments like `b <= a; a <= 0;` in the same clock cycle?

I have a piece of code in Verilog which needs to assign the value of shift register to an output register when the shifting has finished, and I want to reset the value of the shift register in the ...
Martel's user avatar
  • 1,227
13 votes
5 answers
8k views

What would make me choose Verilog or VHDL over schematic design on CPLDs or FPGAs?

I have absolutely no background in programmable logic, I use mostly microcontrollers in my projects but recently I needed to work with video and the microcontroller is just too slow for what I needed ...
Bruno Ferreira's user avatar
13 votes
1 answer
5k views

what is the meaning of the pipe symbol "|" in front of a variable

I am analysing some verilog code and found something like wire z = |a & b; while simultation the code behaves just like ...
Ulli's user avatar
  • 141
12 votes
3 answers
15k views

Generic free Verilog synthesis tools?

Are there any free or open source synthesis tools available that can convert Verilog RTL into a generic gate netlist? (composed of generic NAND, NOR, XOR, D-flops/registers, etc. Optimization not ...
hotpaw2's user avatar
  • 4,761
12 votes
1 answer
1k views

FPGA starts working after irrelevant changes, why?

I have written a UART module in Verilog. By using that module I get data from PC via UART and then send that data back again via this UART module. I uploaded it to FPGA for testing. It works flawless ...
Rehin's user avatar
  • 168
12 votes
4 answers
31k views

Using both edges of a clock

I am programming an Altera Cyclone IV using Verilog and Quartus II. In my design, I would like to use both edges of a clock so that I can do clock division by an odd factor with a 50% duty cycle. Here ...
Randomblue's user avatar
12 votes
3 answers
15k views

How can I generate a schematic block diagram image file from verilog?

I want to create a schematic of a specific verilog module hierarchy showing which blocks are connected to which other blocks. Much like Novas'/Springsoft's Debussy/Verdi nschema tool, or any of a ...
Ross Rogers's user avatar
11 votes
3 answers
30k views

How to truncate an expression bit width in Verilog?

Consider an expression like: assign x = func(A) ^ func(B); where the output of the func is 32 bits wide, and x is a wire of 16 bits. I want to assign only the ...
user23106's user avatar
  • 113
11 votes
9 answers
19k views

Newbie projects on an FPGA?

I'm two weeks away from completing my first college digital logic design course, and apparently there isn't going to be a final project--just a tedious final exam. So as any curious student would do,...
11 votes
5 answers
6k views

Why FPGA's have latches when they are almost never used?

This question is a follow up question of the existing question: "When is using latches better than flip flops in an fpga that supports-both". If use of latches in FPGA's is limited to rarest or rare ...
nurabha's user avatar
  • 887
11 votes
3 answers
8k views

Is there a way of conditionally triggering a compile-time error in verilog?

I have a parameterised module in verilog, where the parameters are a clock rate and refresh rate, which is used to calculate how many cycles of inactivity are inserted between instances of a repeating ...
Jules's user avatar
  • 2,026
11 votes
3 answers
11k views

Free VerilogA simulators [closed]

There are plenty of free SPICE and Verilog simulators out there such as LTSPICE or TINA or even WinSPICE. There are also several Verilog simulators as well. However, I am looking for free VerilogA ...
10 votes
2 answers
863 views

Lint tool is throwing an error about bit width when adding two 10-bit unsigned numbers and assigning to a 11-bit net

My code: module adder(a,b,result); input wire [9:0] a,b; output wire [10:0] result; assign result = a + b; endmodule My company recently changed policy to ...
nebuchadnezzar_II's user avatar
10 votes
3 answers
32k views

What is clock skew, and why can it be negative?

My HDL compiler (Quartus II) generates timing reports. In it, the nodes have "clock skew" column. The only definition of clock skew I found is in the TimeQuest documentation (see page 7-24): To ...
Randomblue's user avatar
10 votes
3 answers
65k views

How to assign value to bidirectional port in verilog?

I'm trying to use a bidirectional port in Verilog so I can send and receive data through it. My problem is that when I try to assign a value to the port inside a task, I keep getting an error. What is ...
HzJavier's user avatar
  • 135
10 votes
2 answers
52k views

How to compare two numbers (nets, variables, constants) in Verilog

I am new to Verilog, and would like to learn how to compare two numbers. For example, let's compare a parameter or reg (say a) with the number 2 (2'b10). How this will be written in Verilog?
Sherby's user avatar
  • 2,326
10 votes
4 answers
24k views

Difference between RTL and Behavioral verilog

Can someone tell me what is the difference between RTL and behavioral Verilog code? Is there any clear cut demarcation between designs at these two levels?
Akash Singh's user avatar
9 votes
3 answers
41k views

How are Verilog "always" statements implemented in hardware?

The Verilog always statement, namely always @(/* condition */) /* block of code */ executes the ...
Randomblue's user avatar
9 votes
2 answers
3k views

"Logic Design" vs. "Digital Circuit Design"

I'm aware that different companies have different definitions for job titles, but in general, is "logic design" the same thing as "digital circuit design"?
Shawn J. Goff's user avatar
9 votes
3 answers
24k views

Procedural blocks in verilog

We have two types of procedural blocks in verilog: initial and always block. The statements inside these blocks are executed ...
sarthak's user avatar
  • 3,696
9 votes
1 answer
26k views

Birectional I/O pin in verilog

I'm wanting eventually to interface some memory to my fpga. This will require pins on the fpga that can both read data and write output to the ram. I'm far away from doing any of that yet, but as a ...
John Burton's user avatar
  • 2,106
8 votes
3 answers
8k views

Why delays cannot be synthesized in Verilog?

I have always read that delays declared in RTL code can never be synthesized. They are meant only for simulation purpose and modern synthesis tools will just ignore delays declarations in the code. ...
Anand's user avatar
  • 227
8 votes
5 answers
2k views

How to think while working with VHDL or Verilog

All of my experience belong to general purpose programming languages e.g; c/c++ etc where each instructions are executed one after the other but it seems in VHDL/Verilog, all the instructions are ...
itsaboutcode's user avatar
8 votes
3 answers
29k views

What is the I2C ACK, and how do I detect it?

I am writing an FPGA driver in Verilog for a temperature sensor (datasheet available here). The communication protocol is SMBus, a close cousin of I2C. Now reading the datasheet, I understand that the ...
Randomblue's user avatar
8 votes
1 answer
57k views

Generate a 100 Hz Clock from a 50 MHz Clock in Verilog

I have a DE0 board with a 50 Mhz clock that am I trying to to bring down to 100 Hz in Verilog. Could anyone help me with the code to do this?
biw's user avatar
  • 183
8 votes
2 answers
2k views

Why does this Verilog hog down 30 macrocells and hundreds of product terms?

I have a project that's consuming 34 of a Xilinx Coolrunner II's macrocells. I noticed I had an error and tracked it down to this: ...
Tony Ennis's user avatar
8 votes
3 answers
9k views

Are there any free simulators for SystemVerilog? [closed]

Are there any free simulators available for a hardware design coded in SystemVerilog? In particular, I need SystemVerilog's dynamic arrays.
KevinSim's user avatar
  • 353
8 votes
1 answer
10k views

Relation between delta cycle and event scheduling in verilog simulation?

I understand that in Verilog/SystemVerilog standards there are different regions for event scheduling, thus mimicking the behavior of concurrent hardware. But how does this relate to the delta cycles ...
Disenchanted Toad's user avatar
8 votes
2 answers
9k views

What is the difference between reg and wire after synthesizing?

Assuming i have these two codes: module wire_example( a, b, y); input a, b; output y; wire a, b, y; assign y = a & b; endmodule and the second one ...
0x90's user avatar
  • 725
8 votes
4 answers
503 views

Detect registers which are not reset

When writing Verilog, I use a variety of "linters" that will give errors and warnings. These are my simulator (ModelSim), my compiler (Quartus II), along with a linter (Verilator). Together, I have ...
Randomblue's user avatar
8 votes
1 answer
5k views

Is the initial block in Verilog sythesizable?

I have come across a lot of posts which say that the initial block is not synthesizable in Verilog HDL. According to this appendix on synthesizable and non-...
Sandeep I's user avatar
  • 101
7 votes
2 answers
14k views

Implement serial port on fpga (verilog)

I don't know if this belongs here or stackoverflow. I assume here as although verilog looks like software it's actually describing hardware connections? I have a Spartan-3AN evaluation board and I'm ...
John Burton's user avatar
  • 2,106
7 votes
3 answers
64k views

Asynchronous reset in verilog

I am new to verilog and having a bit of trouble getting along with it. I read about asynchronous and synchronous reset and i think i got hold of it but while implementing the same with verilog i am ...
Abhishek Tyagi's user avatar

1
2 3 4 5
38