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

Need help to auto indent in verilog or systemverilog code in VIM

initial begin if () begin a=b; c=d; end else begin c=d; c=a; end end I have already tried, gg=G or selecting code and = is not working. Could you please help me here. code is unreadable.
Akheel
  • 23
  • 4
1
vote
1 answer

Operation priorities in `assign` operation?

Usually, assign statements are simple and straightforward. But suppose there is a complex one that has parenthesis and concatenation and a bunch of different operators; What is the exact order of evaluation priorities of the operators that come on…
M.H. Tajaddini
  • 776
  • 4
  • 20
1
vote
1 answer

IO buffer design using tristate

Program for IO Buffer. All ports are single bit as shown in the below block diagram. When op_en is high, data_out will be driving io_port. When op_en islow, io_port is tri-stated. Data_in will always be connected to io_port. I tried below…
P.goutham
  • 51
  • 6
1
vote
1 answer

Using a recursive assignment inside for loop in Verilog

I am trying to implement a fitness evaluation function in Verilog called Rosenbrock function (https://en.wikipedia.org/wiki/Rosenbrock_function). The issue I am facing is that if I use the following code it gives me a undefined state since there are…
1
vote
2 answers

How to overcome function overloading in System Verilog

program automatic test; class A; task get(); $display("A"); endtask endclass class B extends A; task get(int a,int b); $display("%d %d",a,b); endtask endclass initial begin B…
1
vote
2 answers

Adding delay to each logic gate

I'm learning and building some Verilog codes, but now what matters to me is understanding the delays in logic gates. I'm trying to code this simple combinational circuit with 5ns delay in each logic gate, but I don't exactly know if that's…
Inovaula
  • 49
  • 9
1
vote
1 answer

convert verilog to aiger with Yosys

I have several verilog files which I want to convert to aiger format using Yosys, I use the following commmad in yosys: read_verilog gclk_reg.v nld_and.v my_ff_W_8_.v gated_netlist.v synth_xilinx -flatten -top gclk_reg aigmap write_aiger -ascii…
张小禹
  • 11
  • 1
1
vote
1 answer

Why is the SR latch output always X?

I am implementing SR latch without clock signal using Verilog. I am trying with the code given below, but I am getting the value of Qb as X. Please help me. // design.v file module sr_latch(q,qb,s,r);// module declaration input s,r; output…
1
vote
1 answer

test bench is no working. z and x states in modelsim

i realized a bubble sort code on verilog. there are no any synthesis erorrs, but test bench is not working in modelsim. it shows x and z states module sort #( parameter NUM_VALS = 5, parameter SIZE = 16 )( input wire clk, input …
dduy_le
  • 37
  • 1
1
vote
1 answer

Initialize and increment a genvar variable inside nested for loop of system verilog

I'm trying to write a synthesizable code in .sv to meet my requirements, but got stuck at the very end without a solution; I've an incoming wire which is 99 bit wide and 10 (MAX) deep I need to feed this to a module and get its output which is 99…
1
vote
1 answer

Verilog Testbench Won't Compile - Multiple Definitions

I am building NANDLAND's UART transmitter and receiver (https://www.nandland.com/vhdl/modules/module-uart-serial-port-rs232.html) and got to the point of implementing the testbench. When I compile the testbench I get the error: Error (10228):…
Fraser
  • 151
  • 1
  • 1
  • 9
1
vote
1 answer

syntax error in accessing 2d register array in verilog code to synthesize in leonardo tool

I made a simple cache with verilog code in ISE tool, and used a 2d array of registers as my cache memory, simulating testbench on it in Modelsim done well and no syntax errors and no mistake in desires output signals, but in Leonardo tool when I…
1
vote
1 answer

Using variable value as net name

I have following lines of Verilog code: mySwitch simblock_out_a_inst0 (.aa(simblock_if_h[0].simblock_out_a),.bb(BLOCK_out_a_inst0),.CloseIfHi(simblock_if_h[0].enable)); mySwitch simblock_out_b_inst0…
1
vote
1 answer

What is the reset type of the reset signal of an always_latch .?

I don't have much knowledge on system verilog and I have the following question. As I know, if an edge of a reset signal has been triggered in the sensitivity list of an always block then the reset type of that reset signal is 'asynchronous' I need…
yasara malshan
  • 370
  • 3
  • 11
1
vote
1 answer

JK Flip Flop verilog code error on design

I'm trying to build an JK FF with Async low active clear and preset. However verilog is giving me " design.sv:24: syntax error I give up." It looks like I have an error somewhere but I can't find it. I would appreciate every help This is my design…
RottenMush
  • 23
  • 3