Assignment Report On Cordic Algorithm Implementation Using Verilog
Assignment Report On Cordic Algorithm Implementation Using Verilog
1 INTRODUCTION
[2]‘‘Implementation of fast angle calculation and rotation using online CORDIC,” in Proc.
ISCAS’88, pp. 2703-2706.
[3] D. S. Phatak, "Double step branching CORDIC: a new algorithm for fast sine and cosine
generation," in IEEE Transactions on Computers, vol. 47, no. 5, pp. 587-602, May 1998, doi:
10.1109/12.677251.
[4] J.E. Volder, “The CORDIC Trigonometric Computing Technique,” IRE Trans. Electronic
Computers, vol. 8, pp. 330-334, Sept. 1959.
/afs/iitd.ac.in/user/e/ee/eey237505/Synthesis_65LP/cordic_final_1/pd
Saahil Kr Nakami
Yash Juyal
Ayanabho Banerjee
Madhav
2|Page
MOS VLSI ASSIGNMENT
2 Function
Specifications
Cordic Algorithm
1. Introduction
2. Theoretical Framework
The CORDIC algorithm performs vector rotations through a series of iterative and
incremental steps. Its primary application involves trigonometric calculations, particularly
rotation and transformation operations. CORDIC operates using fixed-point arithmetic,
making it efficient for hardware implementations.
Here's a detailed breakdown of the rotation method used in the CORDIC algorithm:
a) Initial Setup:
Input Vector: Begin with an initial 2D vector (x, y) that represents the magnitude and
direction of the vector to be rotated. The diagram in the figure 1 shows three
3|Page
MOS VLSI ASSIGNMENT
points(x,y)(x1,y1) and (x2,y2) on a circular path in the x-y coordinate system and distance
of all points are same and say ‘r’ here.
Target Rotation Angle: Define the desired angle of rotation (θ) that you want to achieve.
By defining our objective, which is to rotate the point(x,y) anticlockwise towards the
point (x2,y2).
For the point (x,y) and (x2,y2) following equation can be written
b) Rotation mode:
In rotation mode, the angle accumulator is initialized with the desired rotation angle. The
rotation decision at each iteration is made to diminish the magnitude of the residual angle
in the angle accumulator. The decision at each iteration is therefore based on the sign of
the residual angle after each step. Naturally, if the input angle is already expressed in the
binary arctangent base, the angle accumulator may be eliminated. For rotation mode, the
CORDIC equations are:
xi+1=xi-yi* di *2-i
yi+1=yi-xi* di *2-i
zi+1=zi-di*tan-1(2-i)
where
4|Page
MOS VLSI ASSIGNMENT
xn=An[x0cosz0-y0sinz0]
yn=An[y0cosz0+x0sinz0]
zn=0
An=∏𝑛 √1 + 2-2i
3. Vectoring Mode
Introducing the concept of vectoring mode, this mode involves nullifying one coordinate
to obtain the angle between them at the output. Primarily used for computing absolute
values or nullifying coordinates, vectoring mode employs a distinct set of equations
compared to the rotation mode.
4. Hyperbolic Mode
CORDIC's versatility extends to hyperbolic mode, where coordinates are rotated along a
hyperbola. This mode introduces additional functions and equations, broadening the
algorithm's applicability.
5. Implementation of CORDIC
CORDIC implementation can adopt either a parallel or serial architecture. The parallel
approach supports both rotation and vector modes, proving beneficial for hardware
implementations. On the other hand, the serial architecture is simpler and often employed
in software implementations.
6. Real-world Applications
3 Implementation of CORDIC
5|Page
MOS VLSI ASSIGNMENT
There are mainly two types of architecture namely parallel and series architecture.
Implementation of both architectures are described below.
6|Page
MOS VLSI ASSIGNMENT
7|Page
MOS VLSI ASSIGNMENT
4 Design Parameters
4.3 Reset
5 Verification Strategy
5.1 Objectives
Pertaining to Verilog code:
After writing a Verilog code of the algorithm, a testbench must be created in order to check
correct functionality of the code corresponding to a set of input combinations.
8|Page
MOS VLSI ASSIGNMENT
To make sure there are no DRC violations after the entire flow.
To make sure throughout the flow there are no errors other than scan chain errors.
6 Functional Checklist
7 Testbench
Verilog code for testbench of the design:
module cordic_test();
localparam SZ = 8; // bits of accuracy
reg [2*SZ - 1:0] angle;
wire [SZ:0] Xout, Yout;
reg CLK_100MHZ;
reg reset;
// Waveform generator
localparam FALSE = 1'b0;
localparam TRUE = 1'b1;
reg signed [63:0] i;
reg start;
initial
begin
start = FALSE;
reset = FALSE;
$write("Starting sim");
CLK_100MHZ = 1'b0;
angle = 16'b0000000000000000;
9|Page
MOS VLSI ASSIGNMENT
i=130;
// Yout = 32000*sin(angle)
#10 reset = 1'b1;
#10 reset = 1'b0;
#1000;
@(posedge CLK_100MHZ);
start = TRUE;
// sin/cos output
//for (i = 0; i < 360; i = i + 1) // from 0 to 359 degrees in 1 degree increments
//for (i = 30; i < 60; i = i + 30) // increment by 30 degrees only
//begin
@(posedge CLK_100MHZ);
start = FALSE;
angle = ((1 << 16)*i)/360;
$display ("angle = %d, %h",i, angle);
//end
#500
$write("Simulation has finished");
$stop;
end
main sine_cosine (CLK_100MHZ,reset,angle, Xout, Yout);
parameter CLK100_SPEED = 10; // 100Mhz = 10nS
initial
begin
CLK_100MHZ = 1'b0;
$display ("CLK_100MHZ started");
#5;
forever
begin
#(CLK100_SPEED/2) CLK_100MHZ = 1'b1;
#(CLK100_SPEED/2) CLK_100MHZ = 1'b0;
end
10 | P a g e
MOS VLSI ASSIGNMENT
end
endmodule
8 Tests Specifications
All the test suits and functional tests done is mentioned in great depth in the previous section.
9 Design Microarchitecture
// For 8-bits the max value of cos(theta) or sin(theta) can be 255 corresponding to
value 1
// The Kn value for 0.607 is initial value of X which is 0.607*255 = 155;
assign Xinitial = 8'd155;
11 | P a g e
MOS VLSI ASSIGNMENT
12 | P a g e
MOS VLSI ASSIGNMENT
13 | P a g e
MOS VLSI ASSIGNMENT
14 | P a g e
MOS VLSI ASSIGNMENT
//------------------------------------------------------------------------------
// Output
//------------------------------------------------------------------------------
assign cos_out = X[NO_OF_STAGES-1];
assign sin_out = Y[NO_OF_STAGES-1];
endmodule
15 | P a g e
MOS VLSI ASSIGNMENT
Initiation of the design phase involves drafting and validating the design using the
Vivado tool.
After the design phase, synthesis is performed using Cadence Genus for schematic
generation of the RTL code.
Cadence Genus utilizes pre-existing standard cells to create schematic representations
of the RTL code.
The schematic diagrams portray various sub-blocks generated by Cadence Genus
during the synthesis process.
Each sub-block assumes a critical role within the overall design architecture,
contributing to cohesive system functionality.
The systematic synthesis approach adheres to established industry practices and design
principles.
This methodical process ensures a standardized and coherent synthesis, fostering
reliable design outcomes.
10 Physical Hierarchy
16 | P a g e
MOS VLSI ASSIGNMENT
Figure 10.1 shows the default Layout getting generated by the Cadence Innovus tool.
Figure 10.2 shows the console view showing there are no errors.
17 | P a g e
MOS VLSI ASSIGNMENT
Figure 10.3 illustrates the floorplan, where the boundary has been meticulously
established through a systematic trial-and-error process.
This method ensures that the floorplan is precisely configured to prevent any Design
Rule Check (DRC) violations.
The deliberate consideration and adjustment of the boundary underscore the
commitment to achieving a floorplan that adheres to rigorous design standards and
minimizes potential violations.
In Figure 10.4, the layout is presented subsequent to the addition of power rings.
The width and spacing parameters have been meticulously maintained to mitigate any
potential Design Rule Check (DRC) violations.
18 | P a g e
MOS VLSI ASSIGNMENT
In Figure 10.5, the layout is presented subsequent to the addition of power stripes.
The width and spacing parameters have been meticulously maintained to mitigate any
potential Design Rule Check (DRC) violations.
19 | P a g e
MOS VLSI ASSIGNMENT
In Figure 10.6, the layout is presented subsequent to the addition of power routings.
10.4 Placement
Figure 10.7 provides a visual representation of the strategic placement of standard cells
within the top-level design, meticulously generated by Genus. This placement contributes
to the overall architectural framework, ensuring coherence and optimal functionality.
In Figure 10.8, the console window is depicted, offering insights into scan chain errors. It
is noted that, for the current phase, these errors are deemed non-critical and can be
temporarily disregarded. This discerning observation underscores the ongoing commitment
to meticulous error management and the prioritization of design elements.
A. Placement Plan:
This process is automated by the Cadence Innovus tool.
20 | P a g e
MOS VLSI ASSIGNMENT
B. Routing Plan:
This process is automated by the Cadence Innovus tool.
21 | P a g e
MOS VLSI ASSIGNMENT
Figure 9.9 presents the layout post-clock tree synthesis, a pivotal step ensuring uniform
distribution of the clock signal across all sequential elements within the circuit.
Clock tree synthesis, as depicted in Figure 9.9, plays a critical role in maintaining
synchronization and optimal functioning of the circuit's sequential elements.
In Figure 9.10, the console view aptly indicates a smooth execution of clock tree synthesis
using Cadence Innovus, as evidenced by the absence of encountered errors. This
underscores the precision and efficacy of the synthesis process, aligning with established
design standards.
Across the entirety of the Register-Transfer Level (RTL) to Graphic Data System (GDS)
flow, meticulous attention has been devoted to preserving the dimensional integrity of all
stripes and rings.
This unwavering commitment extends to the conscientious maintenance of widths and
spacing’s, meticulously orchestrated to eliminate any Design Rule Check (DRC) violations.
The deliberate adherence to stringent design standards throughout this process not only
attests to the dedication to quality but also ensures the seamless progression of the design
from RTL to GDS.
By proactively addressing potential DRC concerns at each stage, the resulting
implementation stands as a testament to the precision and professionalism inherent in the
design methodology.
This disciplined approach not only mitigates risk but also underscores the commitment to
delivering a final product of exceptional quality and compliance.
22 | P a g e
MOS VLSI ASSIGNMENT
11 Results
11.1 Simulation Waveforms
𝝅
At radians
𝟔
𝜋
Figure 10.1: Simulation Waveforms at
6
𝝅
At radians
𝟒
𝜋
Figure 10.2: Simulation Waveforms at
4
𝝅
At radians
𝟑
𝜋
Figure 10.2: Simulation Waveforms at
3
23 | P a g e
MOS VLSI ASSIGNMENT
11.2 Area
24 | P a g e
MOS VLSI ASSIGNMENT
11.4 Timing
25 | P a g e
MOS VLSI ASSIGNMENT
26 | P a g e
MOS VLSI ASSIGNMENT
27 | P a g e