Title: Verilog
1Verilog VHDL
2Hardware Descpition Language
- 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.
3Life 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...
4History of Verilog
- 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.
5History of Verilog
- 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
6The Verilog Langauge
- Verilog is modeled after the C language
- Control Statements
- If-else
- While
- For Loop
- Repeat
- Case
case(address) 0 display (case 1) 1
display (case 2) 2 display (case
3) default display (other) endcase
for (i 0 i lt 16 i i 1) begin
display(Value of i is d", i ) End
7Verilog 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 70address_buss // 8-bit little endian
register
reg 07address_buss // 8-bit big endian
register
wire and_gate_output // creates a wire
8Verilog Example
module counter(clock,reset,enable,count) input
clock, reset, enable output 30 count reg
30 count always _at_ (posedge clock or posedge
reset) if (reset) begin count lt 0 end else
begin while (enable) begin count lt count
1 end end endmodule
CLK
RST
Count
COUNTER
Enable
9Counter Test Bench
include counter.v module counter_tb() reg
clock, reset, enable wire 30 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 enable0 5
reset 1 10 reset0 10 enable1
100 enable0 5 finish End always begin
5 clock clock end
10Test Bench Output
11 VHDL
12VHDL
- VHDL stands for VHSIC (Very High Speed Integrated
Circuits) Hardware Description Language. - In the mid-1980s 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.
13VHDL Abstraction
14Unique to VHDL
- 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 -
15More VHDL Types
- 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
16D Flip Flop in VHDL
- 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 lt 0
- elseif (CLKevent and CLK 1) then
- Q lt D
- end if
- end process
- end BEHAV_DFF
17Compare D Flip Flop
- Verilog 14 Lines
- VHDL 16 Lines
18Full Adder
- 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
- int1lt A xor B
- int2lt A and B
- end process
- P2 process (int1, int2, Cin)?
- begin
- Sum lt int1 xor Cin
- int3 lt int1 and Cin
- Cout lt int2 or int3
19Comparing Full Adder
- Verilog 10 lines
- VHDL 20 lines
20Conclusion
- Just by the examples shown, we can see that in
our cases, there are less instructions for
Verilog then there is for VHDL.
21References
- http//www.seas.upenn.edu
- http//www.asic-world.com/verilog/history.html
- http//asic-world.com/verilog/intro1.html