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
1
vote
1 answer

Does the Condition Operator Evaluate Bitwise for indexed part selection

I wish to choose between bits of two indexed part selections using the values of each of the bits of another indexed part selection. Put in code that looks like: output[idx*WIDTH+:WIDTH] = (condition[idx*WIDTH+:WIDTH]) ?…
Devin B
  • 49
  • 5
1
vote
1 answer

I want to type conversion in Quartus2 Verilog

I want to type conversion in Quartus2 Verilog....... integer to reg ex) integer a = 10; reg[3:0] b; $cast(b,a); but $cast is not supported synthesis..
chundeuk
  • 13
  • 2
1
vote
1 answer

Signed adder implementation

Suppose that I have two logic vectors: logic [4:0] a; logic [4:0] b; that hold 2's complement values. I want to perform a subtraction and extend the result by 1 bit. For example, assume that I want to compute -12 - 13 and store the result of…
1
vote
1 answer

Override default_nettype in ModelSim

I would like to change default_nettype in my RTL design without explicitly modifying the respective compiler directive within each file. Is there a way to override it in ModelSim software?
yildizabdullah
  • 1,895
  • 5
  • 24
  • 37
1
vote
3 answers

How to filter uvm_info messages by type_id?

I need to filter all the uvm_info log messages by the type_id defined in it. For example, if I want to display only the uvm_info messages from a driver or a monitor, how can I effectively do it?
afahad
  • 21
  • 3
1
vote
1 answer

iverilog: Syntax error in assignment statement l-value

Why do I get syntax errors in my Verilog code? The code: module RegFile ( input clk, input [4:0] rs1, input [4:0] rs2, input [4:0] wr, input reg[31:0] wd, input RegWrite, output reg[31:0] rd1, output reg[31:0] rd2); …
DRoseGao
  • 27
  • 5
1
vote
2 answers

How to define parameters in a generate block and access them outside?

I want to define some local parameters whose values are decided by a parameter assigned outside this module. Here, I use a generate block. Just like the following: module doppler_fft_cluster # ( parameter CORE_TYPE = "DOPPLER_FFT_D0" ) ( clk,…
Bob Green
  • 81
  • 1
  • 7
1
vote
1 answer

assign not updating result value in testbench in EDA playground

I am using EDA Playground with Aldec Riviera simulator, and I have this module here: module alu(input logic [31:0] a, b, input logic [2:0] alucontrol, output logic [31:0] result, output logic zero); …
1
vote
1 answer

Unknown assignment to parameterized variable

Refer to the following code: parameter N=8; reg [N-1:0] variable; . . \\ stuff . . variable = N'bx; Suppose in some cases we want to set all N bits of our vector to x (unknown). How can it be done? The above code does not work, and the error is as…
Ashkan Khademian
  • 307
  • 3
  • 12
1
vote
1 answer

Problems with sequence detector in verilog (finite state machine)

I wanted to make sequence detector that will detect three consecutive ones. When the sequence is detected, digital circuit stops and waits for a reset signal to be active, so it would detect sequence again. I wrote the code but it has some problems.…
1
vote
1 answer

TestBench I2C Slave SDA won't go low

I'm trying to write an I2C Slave and test it in isolation. I have a simulation that should be pulling SDA low when write_ack is high (Also highlighted by the red dots). However, you can see that SDA remains the same. Part of me thinks it's to do…
Chris
  • 2,739
  • 4
  • 29
  • 57
1
vote
1 answer

TestBench I2C SDA won't go low

I'm writing my first ever I2C program in Verilog and I'm struggling with the TestBench. I want to test the I2C Slave in isolation, but I'm unable to set different SDA values: SDA is always 1, or X. Am I going about testing the wrong way? My…
Chris
  • 2,739
  • 4
  • 29
  • 57
1
vote
1 answer

16-bit ALU always results in 0

always @* begin if (SEL == 3'b000) ALU_OUT = A + B; if (SEL == 3'b001) ALU_OUT = A - B; if (SEL == 3'b010) ALU_OUT = ~(A & B); if (SEL == 3'b011); ALU_OUT = ~(A | B); if (SEL == 3'b100) ALU_OUT = ~A; if (SEL == 3'b101) …
YJunior
  • 35
  • 3
1
vote
1 answer

Verilog - bitstream works on hardware but simulation doesn't compile

I am using Verilog to set up FPGA so that it blinks an LED once per second. And this is one way to do it: `default_nettype none module pps(i_clk, o_led); parameter CLOCK_RATE_HZ = 12_000_000; input wire i_clk; output wire o_led; …
71GA
  • 1,132
  • 6
  • 36
  • 69
1
vote
1 answer

Error opening .vcd file. No such file or directory

My Verilog code is stored in C:\FA. There are three files: FA.v, fa.vvp, TM_FA.v I followed my book steps. iverilog -o fa.vvp vvp fa.vvp finish getwave fa.vcd & When I use getwave fa.vcd & to simulate it, and then it shows: Error opening .vcd…
Kias
  • 47
  • 5
1 2 3
99
100