Questions tagged [hdl]

HDL is a Hardware Description Language, a language used to design chips. The two major ones are Verilog and VHDL.

Taken from G.J. Lipovsky, "Hardware Description Languages: Voices from the Tower of Babel", Computer, Vol. 10, No. 6, June 1977, pp. 14-17. Paper available here.

A hardware description language can be used to describe the logic gates, the sequential machines, and the functional modules, along with their interconnection and their control, in a digital system. In a general sense, Boolean equations, logic diagrams, programrning languages, and Petri nets are hardware description languages: they can be used to describe some aspect of hardware and they have definable syntax and semantics. Specifically, what is more commonly referred to as a hardware description language is a variation of a programming language tuned to the overall needs of describing hardware.

Adapted from Hardware Description Language tutorial with very few modifications:

Hardware description language (HDL) is a specialized computer language used to program electronic and digital logic circuits. The structure, operation and design of the circuits are programmable using HDL. HDL includes a textual description consisting of operators, expressions, statements, inputs and outputs. Instead of generating a computer executable file, the HDL compilers provide a gate map. The gate map obtained is then downloaded to the programming device to check the operations of the desired circuit. The language helps to describe any digital circuit in the form of structural, behavioral and gate level and it is found to be an excellent programming language for FPGAs, CPLDs and ASICs.

The three common HDLs are Verilog, VHDL, and SystemC. Of these, SystemC is the newest. The HDLs will allow fast design and better verification. In most of the industries, Verilog and VHDL are common. Verilog, one of the main Hardware Description Language standardized as IEEE 1364 is used for designing all types of circuits. It consists of modules and the language allows Behavioral, Dataflow and Structural Description. VHDL (Very High Speed Integrated Circuit Hardware Description Language) is standardized by IEEE 1164. The design is composed of entities consisting of multiple architectures. SystemC is a language that consist a set of C++ classes and macros. It allows electronic system level and transaction modeling.

Need for HDLs

The Moore’s Law in the year 1970 has brought a drastic change in the field of IC technology. This change has made the developers to bring out complex digital and electronic circuits. But the problem was the absence of a better programming language allowing hardware and software codesign. Complex digital circuit designs require more time for development, synthesis, simulation and debugging. The arrival of HDLs has helped to solve this problem by allowing each module to be worked by a separate team.

All the goals like power, throughput, latency (delay), test coverage, functionality and area consumption required for a design can be known by using HDL. As a result, the designer can make the necessary engineering tradeoffs and can develop the design in a better and efficient way. Simple syntax, expressions, statements, concurrent and sequential programming is also necessary while describing the electronics circuits. All these features can be obtained by using a hardware description language. Now while comparing HDL and C languages, the major difference is that HDL provides the timing information of a design.

Benefits of HDL

The major benefit of the language is fast design and better verification. The Top-down design and hierarchical design method allows the design time; design cost and design errors to be reduced. Another major advantage is related to complex designs, which can be managed and verified easily. HDL provides the timing information and allows the design to be described in gate level and register transfer level. Reusability of resources is one of the other advantage.

See also:

906 questions
73
votes
6 answers

What are the best practices for Hardware Description Languages (Verilog, VHDL etc.)

What best practices should be observed when implementing HDL code? What are the commonalities and differences when compared to more common software development fields?
JeffV
  • 52,985
  • 32
  • 103
  • 124
52
votes
3 answers

What is the difference between reg and wire in a verilog module?

When are we supposed to use reg and when are we supposed to use wire in a verilog module? I have also noticed sometimes that a output is declared again as a reg. E.g reg Q in a D flip flop. I have read this somewhere - "The target output of…
RaviTej310
  • 1,635
  • 6
  • 25
  • 51
44
votes
4 answers

What is the difference between == and === in Verilog?

What is the difference between: if (dataoutput[7:0] == 8'bx) begin and if (dataoutput[7:0] === 8'bx) begin After executing dataoutput = 52'bx, the second gives 1, but the first gives 0. Why? (0 or 1 is the comparison result.)
user478571
19
votes
5 answers

How do I set output flags for ALU in "Nand to Tetris" course?

Although I tagged this homework, it is actually for a course which I am doing on my own for free. Anyway, the course is called "From Nand to Tetris" and I'm hoping someone here has seen or taken the course so I can get some help. I am at the stage…
MahlerFive
  • 5,159
  • 5
  • 30
  • 40
14
votes
3 answers

Conditional instantiation of verilog module

Is it possible to instantiate a module conditionally in verliog ? example : if (en==1) then module1 instantiation else module2 instantiation
vlsi2013
  • 169
  • 1
  • 2
  • 5
12
votes
2 answers

Incrementing Multiple Genvars in Verilog Generate Statement

I'm trying to create a multi-stage comparator in verilog and I can't figure out how to increment multiple genvars in a single generate loop. I'm trying the following: genvar i,j; //Level 1 generate j=0; for (i=0;i<128;i=i+1) begin: level1Comp …
Adam
  • 463
  • 2
  • 6
  • 14
11
votes
2 answers

How to use const in verilog

Instead of using module ... ( .. ) ; #15 endmodule I want use module ... ( ... ) ; // GateDelay is a const, like in c language const int GateDelay = 15 ; # GateDelay endmodule Or same thing module ... ( ... ) ; // assume…
user478571
11
votes
2 answers

What's wrong with my DMux 4 way?

It's seemingly close to working, it just is messing up at line 7 apparently? /** * 4-way demultiplexor. * {a,b,c,d} = {in,0,0,0} if sel==00 * {0,in,0,0} if sel==01 * {0,0,in,0} if sel==10 * {0,0,0,in} if…
Doug Smith
  • 29,668
  • 57
  • 204
  • 388
9
votes
1 answer

Dealing with arrays in HDL

How does one use arrays (representing busses) in HDL? For example, I have the following code: /** * 16-bit bitwise And: * for i = 0..15: out[i] = (a[i] and b[i]) */ CHIP And16 { IN a[16], b[16]; OUT out[16]; PARTS: // Put your…
Fine Man
  • 455
  • 4
  • 17
8
votes
0 answers

How to inject Verilog code in Chisel generated Module?

To test my Chisel designs I'm using Icarus with cocotb. But Icarus doesn't generate VCD traces if it's not asked explicitly in verilog module code like this : `ifdef COCOTB_SIM initial begin $dumpfile ("my_module_name.vcd"); $dumpvars (0,…
FabienM
  • 3,421
  • 23
  • 45
8
votes
3 answers

Declaring an array within an entity in VHDL

I'm trying to make a buffer to hold 16, 16-bit wide instructions for a small CPU design. I need a way to load instructions into the buffer from my testbench. So I wanted to use an array of std_logic_vectors to accomplish this. However, I am getting…
audiFanatic
  • 2,296
  • 8
  • 40
  • 56
8
votes
2 answers

Writing a Register File in VHDL

I am trying to write a register file in VHDL. The file contains 16 64-bit registers. Each cycle, two registers are read and one register is written (given that writing is enabled). There should be a data bypass (forwarding) so that the value just…
audiFanatic
  • 2,296
  • 8
  • 40
  • 56
7
votes
2 answers

Simulating a CPU design written in Chisel

I've written a single-cycled CPU in Chisel3 which implements most of the RV32I instructions (except CSR, Fence, ECALL/BREAK, LB/SB, which may be included later). The instructions are currently hard coded in the instruction memory, but I will change…
dannebra
  • 73
  • 4
7
votes
3 answers

Purpose to providing more than one architecture?

I'm in the process of learning VHDL and I'm trying just learning from examples, syntax guides, and experiments. One thing I don't quite understand is why you'd ever want to provide more than one architecture. For instance, this example MUX…
Earlz
  • 62,085
  • 98
  • 303
  • 499
7
votes
1 answer

Open Source OCR system for FPGA

Do you know of any open source (open core) implementations of an OCR for FPGA either in C or in HDL? Where can I find them? Thanks
The Byzantine
  • 619
  • 1
  • 6
  • 21
1
2 3
60 61