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
3
votes
3 answers

Rewrite long xor statement

Look at the following statement. c_r gets assigned an xor versioned of all c[k]. always_ff @ (posedge clk_i) begin for(k = 0; k < 16; k++) c_r[k*8 +: 8] <= c[k][0] ^ c[k][1] ^ c[k][2] ^ c[k][3] ^ c[k][4] ^ c[k][5] ^ c[k][6] ^ c[k][7] ^ c[k][8]…
Razer
  • 7,843
  • 16
  • 55
  • 103
3
votes
1 answer

how do i initialize a std_logic_vector in VHDL?

i have a std_logic_vector(4096 downto 0) Signal and i want to initialize it like below: architecture Behavioral of test is type ram_type is array(4095 downto 0) of std_logic_vector(15 downto 0); signal ram : ram_type; ram(0) :=…
user3927214
  • 67
  • 2
  • 3
  • 9
3
votes
1 answer

Modport trouble using complex struct

From my previous question (Groups inside structs), after creating typedef structs, I tried to form an interface from 5 different channel signal declarations (the structs). The struct's form is: typedef struct { struct { logic [1:0] …
user2692669
  • 461
  • 8
  • 23
3
votes
1 answer

Behavioral algorithms (GCD) in Verilog - possible?

I want to write a module for GCD computing, using extended Euclidean algorithm. But the main problem is that I completely don't know how to do that without getting to the lowest (RTL) level. What I mean is to have FSM with three states: IDLE…
Kacper Banasik
  • 191
  • 3
  • 13
3
votes
1 answer

Evaluation Event Scheduling - Verilog Stratified Event Queue

I am trying to implement a simple event based Verilog simulator in Python, but I actually struggle to find some details in the specification (section 11 of IEEE 1364-2005). Let's say I just perfomed an update event on clk which now obtained the new…
Alex
  • 409
  • 4
  • 12
3
votes
2 answers

Verilog possible latch

I am a VHDL coder, and haven't coded much with Verilog. I am going through someone else's code, and I came across this: always@(posedge asix_clk_bufg or negedge pll_asix_locked) begin if (~pll_asix_locked) asix_rst <= 0; else if…
Rudy01
  • 1,027
  • 5
  • 18
  • 32
3
votes
2 answers

Count number of ones in array

I am trying to count the number of ones in a 4-bit binary number in Verilog, but my output is unexpected. I've tried several approaches; this is the one I think should work, but it doesn't. module ones(one,in); input [3:0]in; output…
Omar Sherif
  • 55
  • 1
  • 3
3
votes
1 answer

It would be nice to have Vec[Mem] in Chisel

It would be nice to Vec[Mem] for say set-associative caches. Unfortunately Chisel doesn't support Vec[Mem] construct: val tag_ram2 = Vec.fill(num_ways) {Mem(new TagType(), num_sets , seqRead = true )} Indeed: inferred type arguments…
3
votes
1 answer

Compiler bug, or misunderstanding of SystemVerilog? Undeclared port type works in simulation

I have a module with a number of input logic and output logic ports, and one port that should be input foo::bar, where foo is a package, and bar is an enum. But, I left off the input, so it's just plain foo::bar. And yet, it still works in…
dan
  • 4,262
  • 7
  • 25
  • 40
3
votes
5 answers

Can SystemVerilog represent a flip-flop with asynchronous set and reset without adding unsynthesizable code?

I'm coming from a Verilog-95 background, and I'm trying to figure out what Verilog-95 hoops I don't have to jump through anymore. The obvious way to write a flip flop with async set and reset in Verilog-95 is: always @(posedge clk or negedge resetb…
dan
  • 4,262
  • 7
  • 25
  • 40
3
votes
2 answers

"unexpected others" in vhdl

so I have a question to a vhdl error IT says: unexpected OTHER. led <= "0000001" when count = "0000" else "1001111" when count = "0001" else "0010010" when count = "0010" else "0110000" when count = "0011" else …
3
votes
5 answers

Simple Verilog example for a LED Switch?

I'm trying to build a StateMachine for a 1-hot-encoded simple LED switch button. Especially I'm trying to understand blocking and nonblocking assignments with my example. Would you thing the following could be done better, or is completely wrong in…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
3
votes
1 answer

How to write an array to text file ?VHDL code

I want to write an image array to text file when i try the result is one column which contain all values.
yassin
  • 121
  • 8
3
votes
2 answers

My code does not move onto the next state even when the conditions are true

I have to display a message as well as a timer on the 7 segment LED. So I managed this by using a multiplexer and displayed the message "Hi" in one state and then after some time when the counter reaches 7500 it should stop displaying "Hi" and start…
ipunished
  • 684
  • 2
  • 6
  • 22
3
votes
1 answer

how to find if two verilog modules are connected using VPI PLI - Verilog VCS

module A ( output A_OPORT_1 ); endmodule module B ( input B_IPORT_1 ); endmodule module TestBench; wire A_to_B; A A_inst ( .A_OPORT_1 (A_to_B) ); B B_inst ( .B_IPORT_1 (A_to_B) …
Kingkong Jnr
  • 1,128
  • 4
  • 18
  • 29