1 / 21

Verilog & VHDL

Verilog & VHDL.

duaa
Télécharger la présentation

Verilog & VHDL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Verilog & VHDL

  2. “Verilog and VHDL are hardware description languages (HDL). A HDL is a language used to describe a digital system: for example, a network switch, a microprocessor or a memory or a simple flip-flop. This just means that, by using a HDL, one can describe any (digital) hardware at any level.” Hardware Descpition Language

  3. Life Before HDLs Life before HDLs was a life full of schematics. Every design, regardless of complexity, was designed through schematics. They were difficult to verify and error-prone, resulting in long, tedious development cycles of design, verification... design, verification... design, verification...

  4. Verilog was invented by Phil Morby and Prabhu Goel in 1983/1984 at Automated Integrated Design Systems (later renamed to Gateway Design Automation) in 1985 as a hardware modeling language. Verilog was started as a proprietary hardware modeling language that Gateway Design Automation Inc. It is said that Verilog took properties and design features from HDL (aka HiLo) and C. Verilog is designed to be close to C language for easier understanding from the engineers. Between 1984 and 1990 Verilog was not standardized. Even with all the revisions that came out. History of Verilog

  5. The first Verilog simulator was used in 1985. The first version of Verilog was Verilog-XL, this used the XL-algorithm. In 1990, Verilog language switched owners from Gateway Design Automation to Cadence Design System. At the same time a company called Synopsys marketed a top-down method that when combined with Verilog made them a powerful combination. In 1990, the industry for verilog moved to VHDL because of the pressure from standardization. In 1994, OVI LMR (Language manual reference) changed to IEEE 1364 1995 Verilog became the IEEE standard. In 2001, the newest version of Verilog came out. It is known as IEEE 1364-2001 History of Verilog

  6. The Verilog Langauge • Control Statements • If-else • While • For Loop • Repeat • Case • Verilog is modeled after the C language • case(address) • 0 :$display (“case #1”); • 1 :$display (“case #2”); • 2 :$display (“case #3”); • default : $display (“other”); • endcase for (i = 0; i < 16; i = i +1) begin $display(“Value of i is ‰d", i); End

  7. Verilog Drivers • A driver is a data type which can drive a load. Basically, in a physical circuit, a driver would be anything that electrons can move through/into. • Verilog has two data types: • Registers (signed, unsigned, float….) reg [7:0]address_buss; // 8-bit little endian register reg [0:7]address_buss; // 8-bit big endian register • Wire wire and_gate_output; // creates a wire

  8. Verilog Example module counter(clock,reset,enable,count) input clock, reset, enable; output [3:0] count; reg [3:0] count; always@ (posedge clock or posedge reset) if (reset) begin count <= 0; end else begin while (enable) begin count <=count + 1; end end endmodule CLK RST Count COUNTER Enable

  9. Counter Test Bench ‘include “counter.v” module counter_tb(); reg clock, reset, enable; wire [3:0] counter_out; initial begin $display (“time\t clock reset enable counter”); $monitor (“%g\t %b %b %b %b”, $time, clock, reset, enable, counter_out); clock = 1; reset = 0; enable=0; #5 reset =1; #10 reset=0; #10 enable=1; #100 enable=0; #5 $finish; End always begin $5 clock = ~clock end

  10. Test Bench Output

  11. VHDL

  12. VHDL stands for VHSIC (Very High Speed Integrated Circuits) Hardware Description Language. In the mid-1980’s the U.S. Department of Defense and the IEEE sponsored the development of this hardware description language with the goal to develop very high-speed integrated circuit. VHDL

  13. VHDL – Abstraction

  14. One can introduce new types by using the type declaration, which names the type and specifies its value range. The syntax is: type identifier is type_definition; Here are a few examples of type definitions, Integer types type small_int is range 0 to 1024; type my_word_length is range 31 down to 0; subtype data_word is my_word_length range 7 down to 0; Unique to VHDL

  15. Along with integers here is more types you can define in VHDL: Floating points type cmos_level is range 0.0 to 3.3; Enumerated type PC_OPER is (load, store, add, sub, div, mult, shiftl, shiftr); Physical types type conductance is range 0 to 2E-9 units mho; mmho = 1E-3 mho; umho = 1E-6 mho; nmho = 1E-9 mho; pmho = 1E-12 mho; end units conductance; More VHDL Types

  16. library ieee; use ieee.std_logic_1164.all; entity DFF_CLEAR is port (CLK, CLEAR, D : in std_logic; Q : out std_logic); end DFF_CLEAR; architecture BEHAV_DFF of DFF_CLEAR is begin DFF_PROCESS: process (CLK, CLEAR)‏ begin if (CLEAR = ‘1’) then Q <= ‘0’; elseif (CLK’event and CLK = ‘1’) then Q <= D; end if; end process; end BEHAV_DFF; D Flip Flop in VHDL

  17. Verilog: 14 Lines VHDL: 16 Lines Compare D Flip Flop

  18. library ieee; use ieee.std_logic_1164.all; entity FULL_ADDER is port (A, B, Cin : in std_logic; Sum, Cout : out std_logic); end FULL_ADDER; architecture BEHAV_FA of FULL_ADDER is signal int1, int2, int3: std_logic; begin P1: process (A, B)‏ begin int1<= A xor B; int2<= A and B; end process; P2: process (int1, int2, Cin)‏ begin Sum <= int1 xor Cin; int3 <= int1 and Cin; Cout <= int2 or int3; end process; end BEHAV_FA; Full Adder

  19. Verilog: 10 lines VHDL: 20 lines Comparing Full Adder

  20. Just by the examples shown, we can see that in our cases, there are less instructions for Verilog then there is for VHDL. Conclusion

  21. References • http://www.seas.upenn.edu • http://www.asic-world.com/verilog/history.html • http://asic-world.com/verilog/intro1.html

More Related