Pipelining Verilog
Pipelining Verilog
Week 8 Module 47
Dataflow Modeling
GCD algorithm
Dataflow Example
input [3:0] a,b;
input [7:0] c;
wire [7:0] d;
--a, b and c arrive at the same time
assign d = a*b + c;
a
b
c
Purely
Combinational
a
d
CLK
Equivalent to
d = a[i]*b[i] + c[i];
Implications
a
Hardware Inference
ab
Why?
Register for ab
Register for d
ab is a nonblocking assignment
Hardware Inferred
ab
ctmp
More Analysis
Faster clock
Pipelining
TA
TA+TB
Pipelined
Version
max(TA,TB)
Better delay
Popular in DSP
Defn :
width
a[i] * b[i]
i 0
Regular Implementation
B
TA+TB
a[0]
a[1]
C
a[2]
a[3]
Pipelined Implementation
always @(posedge clk)
begin
ab <= a * b;
ctmp <= ab + ctmp;
end
c <= ctmp;
Implied Hardware
A
AB
C
CTMP
B
Circular Buffer
Holding Samples
Equivalent C code :
c = c + a[i]*b[i];
Thank You
Pipeliing (Verilog)
26