Real World FPGA design with Verilog - PowerPoint PPT Presentation

About This Presentation
Title:

Real World FPGA design with Verilog

Description:

Real World FPGA design with Verilog Milo Milovanovi miloshm_at_yahoo.com Jovan Popovi josars_at_galeb.etf.bg.ac.yu Veljko Milutinovi vm_at_etf.bg.ac.yu – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 76
Provided by: MilosMil
Category:
Tags: fpga | design | real | verilog | world

less

Transcript and Presenter's Notes

Title: Real World FPGA design with Verilog


1
Real World FPGA design with Verilog
  • Miloš Milovanovic
  • miloshm_at_yahoo.com
  • Jovan Popovic
  • josars_at_galeb.etf.bg.ac.yu
  • Veljko Milutinovic
  • vm_at_etf.bg.ac.yu

2
Literature
  • - Real World FPGA Design with Verilog
  • by Ken Coffman, Prentice Hall PTR
  • - On-line Verilog HDL Quick Reference Guide
  • by Stuart Sutherland
  • titan.etf.bg.ac.yu/gvozden/VLSI/

Miloš Milovanovic
/75
3
  • Field Programmable Gate Array design
  • Verilog designed as a simulation
  • and test language
  • Real World - !!!_at_

Miloš Milovanovic
/75
4
A day in the life of an FPGA Silicon Designer
Miloš Milovanovic
/75
5
Design must be
  • Understandable to other designers
  • Logically correct
  • Perform under worst-case conditions
  • of temperature and process variation

Miloš Milovanovic
/75
6
Design must be
  • Reliable
  • Testable and can be proven
  • to meet the specification
  • Do not exceed the power consumption goals
  • (a battery-operated circuit)

Miloš Milovanovic
/75
7
Understandable Design
Miloš Milovanovic
/75
8
FPGA Architecture
Miloš Milovanovic
/75
9
Xilinx 4K Family CLB Architecture
Miloš Milovanovic
/75
10
Trivial Overheat Detector Example
josars_at_galeb.etf.bg.ac.yu
Big Brother vm_at_etf.bg.ac.yu
Miloš Milovanovic
/75
11
Solution
Miloš Milovanovic
/75
12
Miloš Milovanovic
/75
13
Miloš Milovanovic
/75
14
Simulation
Miloš Milovanovic
/75
15
Assignments
  • Concurrent
  • Initial ABCE1
  • A lt B C
  • D lt A E
  • After assignment
  • A2, D2
  • Sequential
  • Initial ABCE1
  • A B C
  • D A E
  • After assignment
  • A2, D3

Miloš Milovanovic
/75
16
Module the building block
  • module module_name (port_name, port_name, ... )
  • module_items
  • endmodule
  • module module_name (.port_name (signal_name ),
    .port_name (signal_name ), ... )
  • module_items
  • endmodule

Miloš Milovanovic
/75
17
Module Port Declarations
  • port_direction port_size port_name, port_name,
    ...
  • port_direction input, output, inout
  • port_size is a range from msb lsb
  • Example1 Example2
  • parameter word 32 input 1512 addr
  • input word-10 addr

Miloš Milovanovic
/75
18
Data Type Declarations 1
  • register_type size variable_name ,
    variable_name , ...
  • register_type size memory_name array_size
  • register_type
  • reg - unsigned variable of any bit size
  • integer - signed 32-bit variable
  • time - unsigned 64-bit variable
  • real or realtime - double-precision
  • floating point variable

Miloš Milovanovic
/75
19
Data Type Declarations 2
  • net_type size (delay) net_name , net_name ,
    ...
  • net_type
  • wire or tri - Simple Interconnecting Wire
  • wor or trior - Wired outputs OR together
  • wand or triand - Wired outputs AND together

Miloš Milovanovic
/75
20
Data Type Declarations 3
  • delay or (delay) - Single delay
  • for all output transitions
  • (delay, delay) - Separate delays
  • for (rising, falling) transitions

Miloš Milovanovic
/75
21
Data Type Declarations 4
  • wire a, b, c
  • tri 70 data_bus
  • reg 18 result // an 8-bit
  • // unsigned variable
  • reg 70 RAM 01023
  • 8-bits wide, with 1K of addresses
  • wire (2.4,1.8) carrya net with rise, fall
    delays

Miloš Milovanovic
/75
22
Assign statement
  • Continuous (combinational) logic
  • - net_type size net_nameassign (delay)
    net_name expression
  • - net_type size net_name expression
  • assign out in1 in2
  • assign bidir OE ? out 1bz

Miloš Milovanovic
/75
23
Procedural Blocks
  • type_of_block _at_(sensitivity_list)
    statement_group group_name local_variable_declara
    tions
  • timing_control procedural_statements
    end_of_statement_group

Miloš Milovanovic
/75
24
Type of block
  • initial process statements one time
  • always process statements repeatedly

Miloš Milovanovic
/75
25
Sensitivity list
  • OPTIONAL
  • Signals
  • Posedge rising-edge triggered
  • Negedge falling-edge triggered
  • example
  • always _at_ (posedge clk or posedge rst)
  • begin end

Miloš Milovanovic
/75
26
Statement group
  • begin end the sequential block
  • fork join
  • statements are evaluated concurrently

Miloš Milovanovic
/75
27
Example
  • initial
  • fork
  • 10 bus 16'h0000
  • 20 bus 16'hC5A5
  • 30 bus 16'hFFAA
  • join

Miloš Milovanovic
/75
28
Example
  • always
  • begin
  • 10 bus 16'h0000
  • 20 bus 16'hC5A5
  • 30 bus 16'hFFAA
  • end

Miloš Milovanovic
/75
29
Example
1
Miloš Milovanovic
/75
30
Verilog Hierarchy
  • module_name instance_name(port_list)

Miloš Milovanovic
/75
31
Named Positional Assignment
Miloš Milovanovic
/75
32
Built-in Logic Primitives
  • and, or, nand, nor, xor, nxor
  • bufif0, bufif1, notif0, notif1

Miloš Milovanovic
/75
33
Miloš Milovanovic
/75
34
Latches and Flipflops
  • Clocked D flipflop

Miloš Milovanovic
/75
35
Basic Latch
Miloš Milovanovic
/75
36
Miloš Milovanovic
/75
37
test_out2 lt 0
Miloš Milovanovic
/75
38
Blocking and Nonblocking Assignments
Miloš Milovanovic
/75
39
Blocking assignmentsare order sensitive
Miloš Milovanovic
/75
40
Nonblocking Assignment
Miloš Milovanovic
/75
41
Miscellaneous Verilog Syntax Items
  • Numbers
  • default 32 bits wide
  • sizebase value
  • underscore is legal
  • X is undefined
  • Z is the high impedance

Miloš Milovanovic
/75
42
Number examples
Miloš Milovanovic
/75
43
Forms of Negation
  • ! logical negation
  • - bitwise negation

Miloš Milovanovic
/75
44
Miloš Milovanovic
/75
45
Forms of AND
  • is a bitwise AND
  • is a logical AND (true/false)

Miloš Milovanovic
/75
46
Forms of OR
  • is a bitwise OR
  • is a logical OR (true/false)

Miloš Milovanovic
/75
47
AND/OR examlpe
Miloš Milovanovic
/75
48
Miloš Milovanovic
/75
49
Equality Operators
  • is logical equality
  • have an unknown (x) result
  • if any of the compared bits are x or z
  • is case equality
  • looks for exact match of bits
  • including xs and zs and return only true or
    false

Miloš Milovanovic
/75
50
Not equal operators
  • ! ?opposite to
  • ! ? opposite to

Miloš Milovanovic
/75
51
Miloš Milovanovic
/75
52
Miloš Milovanovic
/75
53
Miloš Milovanovic
/75
54
Also supported
  • greater than (gt)
  • less than (lt)
  • greater than or equal (gt)
  • less than or equal (lt)

Miloš Milovanovic
/75
55
Shift operators
  • gtgt n right shift (divide by 2n)
  • ltlt n left shift (multiple by 2n)
  • Operating on a value which contains an x or z
  • gives an x result in all bit positions.

Miloš Milovanovic
/75
56
Shift operations example
Miloš Milovanovic
/75
57
Miloš Milovanovic
/75
58
Miloš Milovanovic
/75
59
Conditional Operator
  • out lt expression ?
  • true_assignment false_assignment
  • Special case expression x or z
  • calculates every single bit

Miloš Milovanovic
/75
60
Miloš Milovanovic
/75
61
Math Operators
  • addition (), subtraction (-), multiplication
    (), division (/), modulus ()
  • synthesis tool probably limits multiplication
  • and division to constant powers of two
  • verilog assumes all reg and wire variables
  • are unsigned

Miloš Milovanovic
/75
62
Parameters
  • used in modules where they are
  • defined
  • can be changed by higher-level modules
  • cannot be changed at run time

Miloš Milovanovic
/75
63
Miloš Milovanovic
/75
64
Miloš Milovanovic
/75
65
Miloš Milovanovic
/75
66
Concatenations
Miloš Milovanovic
/75
67
Programming Statements
  • if, case
  • casez, casex
  • forever, repeat(number), while, for
  • initial begin
  • clk 0
  • 1000 forever 25 clk clk
  • end

Miloš Milovanovic
/75
68
Testing
Compiler directives
  • define, ifdef, else, endif, undef
  • include
  • timescale unit/precision
  • example timescale 1ns/0.5ns

Miloš Milovanovic
/75
69
System Tasks
  • starts with
  • finish terminate
  • stop (time out)

Miloš Milovanovic
/75
70
System Tasks
  • display(format, vars) - printf
  • write(format, vars) - display \n
  • timeformat
  • time

Miloš Milovanovic
/75
71
System Tasks
  • monitor (signal list and formatting)
  • monitoron
  • monitoroff

Miloš Milovanovic
/75
72
System Tasks
  • dumpfile(filename)
  • dumpvars
  • dumpall
  • dumpvars()
  • dumplimit(size)

Miloš Milovanovic
/75
73
System Tasks
  • readmemh(filename, memory_name)
  • readmemb(filename, memory_name)

Miloš Milovanovic
/75
74
Watch for those alligators!
Miloš Milovanovic
/75
75
Real World FPGA design with Verilog
  • Miloš Milovanovic
  • miloshm_at_yahoo.com
  • Jovan Popovic
  • josars_at_galeb.etf.bg.ac.yu
  • Veljko Milutinovic
  • vm_at_etf.bg.ac.yu
Write a Comment
User Comments (0)
About PowerShow.com