Local Video System: Overview EECS150 Fall 2008 - Lab Lecture #7 Ke Xu 11/6/2015 EECS150 Lab Lecture #8

Download Report

Transcript Local Video System: Overview EECS150 Fall 2008 - Lab Lecture #7 Ke Xu 11/6/2015 EECS150 Lab Lecture #8

Local Video System: Overview
EECS150 Fall 2008 - Lab Lecture #7
Ke Xu
11/6/2015
EECS150 Lab Lecture #8
1
Welcome to Checkpoint 1

First real design checkpoint


Video in SDRAM




11/6/2015
No datasheets!
Motivation
Storage
FIFO Controllers
SDRAM Arbiter
EECS150 Lab Lecture #8
2
The Big Idea(1)
11/6/2015
EECS150 Lab Lecture #8
3
The Big Idea(2)

Combining checkpoint 1 (SDRAM) + two
video modules




11/6/2015
We’ll give you the video decoder + video encoder
Video Decoder writes a frame into SDRAM
Video Encoder reads the frame from SDRAM
Arbiter sits between SDRAM Controller and
Decoder/Encoder to make sure the SDRAM
Controller sees only one request at a time
EECS150 Lab Lecture #8
4
Video Encoder


Previous semesters had to implement
this as a checkpoint.
This semester, the Video Encoder
module will be black-boxed.


11/6/2015
Saves the class from having an excessive
number of checkpoints.
Will be replaced by the last checkpoint,
which is video compression (DCT +
Huffman).
EECS150 Lab Lecture #8
5
Short Video Summary




11/6/2015
ITU-R BT.601
ITU-R BT.656
Luma/Chroma Y CR Y CB Pixel Pairs
Vertical/Horizontal Active/Blanking
EECS150 Lab Lecture #8
6
Video References




11/6/2015
Past Lab Lecture on video encoder
posted online.
Sample design document (Chen’s)
already posted on the website.
Check documentation (ADV7194 Video
Encoder, ADV7185 Video Decoder) on
website.
Past checkpoint pdf spec also posted
online.
EECS150 Lab Lecture #8
7
Checkpoint 2

Part I: Encode/Decode FIFO Controllers



Part II: Arbiter




11/6/2015
Address Counters determine read/write addresses
FSM determines when to request read/write
Need to handle simultaneous requests.
Handles writes from decode processor
Handles reads from encode processor
Ensures that one request is given to SDRAM
Controller at a time
EECS150 Lab Lecture #8
8
FIFO Controllers (1)

Decoder FIFO Controller


Store active video data from decoder into FIFO
Write to SDRAM when FIFO has enough data




11/6/2015
Assert a write request when FIFO has at least 8 words
Ensures that FIFO does not underflow
Controls the write address counter
Similar to encoder FIFO controller
EECS150 Lab Lecture #8
9
Dual Clocked FIFO



11/6/2015
The FIFO on the decoder side uses two
independent clocks: one for reading,
one for writing.
The camera runs on its own 27MHz
clock.
You can use ModelSim to figure out
how to interpret each of the control
signals.
EECS150 Lab Lecture #8
10
FIFO Controllers (2)

Encoder FIFO Controller


Reads active video data from SDRAM
Reads from SDRAM when FIFO has enough
space




11/6/2015
Assert a read request when FIFO is less than ¾
full
Must ensure that FIFO never overflows
Controls the read address counter
Sends data from FIFO to VideoEncoder
EECS150 Lab Lecture #8
11
More on FIFOs

Why a FIFO?

Data Rate Matching



Buffering



11/6/2015
SDRAM handles data at 32 bits per cycle
Encoder handles data at 32 bits per 4 cycles
Encoder needs a continuous stream of data
SDRAM might be busy
The FIFO “Predicts” what data the video
encoder will want and supplies it upon request
EECS150 Lab Lecture #8
12
Announcements

Checkpoint 1




Please make sure to finish your checkpoints
on time.


11/6/2015
Checkpoint 1 due next week in your respective lab
sections.
Demonstrate working implementation of your
checkpoint.
Knowledge of SDRAM Controller timing is essential
for checkpoint 2
Once you finish one checkpoint, your attention will
then immediately focus on the next checkpoint.
Lateness means you will only fall further behind.
EECS150 Lab Lecture #8
13
SDRAM Arbiter (1)






11/6/2015
Essentially, you’re replacing Checkpoint0bb
with your own useful implementation.
Controls interface with SDRAM Controller
Sets priority between Decoder and Encoder
SDRAM Controller thinks there is only 1 port
SDRAM Arbiter allows multiple access ports
Funnels control signals selectively to each
port
EECS150 Lab Lecture #8
14
SDRAM Arbiter (2)

11/6/2015
You will need to add more states to this
EECS150 Lab Lecture #8
15
Arbiter Handshaking Protocol




Once the SDRAM Controller has finished initializing, the arbiter
will start polling the decoder and encoder for requests
(simultaneously).
If both modules are ready, the arbiter should give priority to the
encoder.
If neither module is ready, the arbiter should poll again.
If either module is ready, the arbiter must appropriately assert
read/write requests to the SDRAM controller, and control signals
to the FIFO controllers


11/6/2015
YOU MUST REVIEW THE TIMING FOR HANDLING
REQUESTS IN YOUR SDRAM CONTROLLER.
THE CONTROL SIGNALS MUST BE TIMED PERFECTLY OR
YOUR PROJECT WILL NOT WORK
EECS150 Lab Lecture #8
16
How is the video data stored?
11/6/2015
EECS150 Lab Lecture #8
17
Modifications Needed for CP0

Recall from Checkpoint 0:


In this checkpoint:




11/6/2015
RAM Address = {Row, Bank, Column}
RowAddress = {4’h0, PixelRow, Field}
BankAddress = 2'h0
ColumnAddress = {BurstColumn, 3'h0}
You will modify your address counter to
accommodate exactly the right amount
of active video data.
EECS150 Lab Lecture #8
18
Video Again

ITU 601 Standard

The video camera follows the ITU 601
standard, which has 507 active lines.

Odd Field (262 Lines)


Even Field (263 Lines)


11/6/2015
6 Vertical Blanking, 254 Active, 2 Vertical Blanking
7 Vertical Blanking, 253 Active, 3 Vertical Blanking
The provided video decoder sends video
data order {Cb, Y, Cr, Y}.
EECS150 Lab Lecture #8
19
Tips, Hints, & Common Pitfalls

11/6/2015
Timing for writing is tricky. Recall from
Checkpoint 1 that the black box puts
data on the DQ line based only on
WriteRequest timing. You’ll have to
take care of this timing yourself now.
EECS150 Lab Lecture #8
20
Tips, Hints, & Common Pitfalls

Make your arbiter design very clean



11/6/2015
The lab specification states that most
modules can be implemented in ¾ states.
You’ll need to extend your arbiter to
accommodate four ports for Checkpoint 4.
Your encode and decode processors
should be almost identical. They are
basically the same module.
EECS150 Lab Lecture #8
21
Tips, Hints, & Common Pitfalls

Long synthesis


Due to increased complexity of this checkpoint,
putting your design on the board can take up to
10 minutes.
Avoid the vicious cycle of:





11/6/2015
Changing one line
Generating the programming file
Fail
Repeat
If you catch yourself doing this, make ModelSim
testbenches. Yes, you can simulate the blackbox
FIFOs.
EECS150 Lab Lecture #8
22
Questions?
11/6/2015
EECS150 Lab Lecture #8
23