Debian Codegraph @

texmf-dist/doc/latex/register-transfer-level/examples/DSP_Architecture/CORDIC_Pipeline.tex

raw
1 \documentclass[border=10pt]{standalone}
2 \usepackage[european]{circuitikz}
3 \usetikzlibrary{circuits.logic.US}
4 \usepackage{../../register-transfer-level}
5 \usetikzlibrary{shapes.geometric, arrows.meta, positioning, calc, shadows, decorations.markings}
6
7 \begin{document}
8
9 \begin{circuitikz}[>=Stealth, thick, line width=1.25]
10
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 % outside pipeline - left
13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
14
15
16 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17 % pipeline
18 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19 \node[rtl_reg_clk, label={[anchor=south east, font=\sffamily\Large, inner sep=3pt]south east:EN}, rtl_width=1.5cm, rtl_height=21cm] at (-7.25, -7) (inReg1) {\sffamily\Large Reg};
20 \draw[] ($(inReg1.south east)+(0.2, +0.35)$) circle (0.2);
21
22 \node[xor gate US, draw, fill=white, logic gate inputs=nn, scale=2] at (-2.5, 1.75) (xor1) {};
23 \node[rtl_op, rtl_size=1.4cm] at (0.0, 1.75) {\Huge $\mathsf{+}$};
24
25 \node[xor gate US, draw, fill=white, logic gate inputs=nn, scale=2] at (-2.5, -2.25) (xor2) {};
26 \node[rtl_op, rtl_size=1.4cm] at (0.0, -2.25) {\Huge $\mathsf{+}$};
27
28
29 \createMux[rtl_height=1.2cm]{muxX}(5,1){0, 1}
30
31 \createMux[rtl_height=1.2cm]{muxY}(5,-3){0, 1}
32
33 \createMux[rtl_height=1.2cm]{muxZ}(5,-7){0, 1}
34
35 \node[rtl_const] at (-1, -6.25) () {\Huge 0};
36
37 \node[rtl_reg_clk, rtl_width=1.5cm, rtl_height=21cm, is_cutset=red] at (9, -7) (pipReg1) {\sffamily\Large Reg};
38
39
40 \node[rtl_shifter] at (13, 1) (shiftX) {\Huge $\mathsf{\gg \, i}$};
41
42 \node[rtl_shifter] at (13, -3) (shiftY) {\Huge $\mathsf{\gg \, i}$};
43
44 \node[xor gate US, draw, fill=white, logic gate inputs=nn, scale=2] at (17.5, 1) (xor3) {};
45 \node[rtl_op, rtl_size=1.4cm] at (20, 1) {\Huge $\mathsf{+}$};
46
47 \node[xor gate US, draw, fill=white, logic gate inputs=nn, scale=2] at (17.5, -3) (xor4) {};
48 \node[rtl_op, rtl_size=1.4cm] at (20, -3) {\Huge $\mathsf{+}$};
49
50 \node[rtl_reg_clk, rtl_width=1.5cm, rtl_height=21cm, is_cutset=brown] at (23, -7) (pipReg4) {\sffamily\Large Reg};
51
52 \node[rtl_op, rtl_size=1.4cm] at (27, 1) (addX) {\Huge $+$};
53
54 \node[rtl_op, rtl_size=1.4cm] at (26, -3) (addY) {\Huge $+$};
55
56 \node[rtl_op, rtl_size=1.4cm] at (27, -7) (addZ) {\Huge $+$};
57
58 \node[rtl_op, rtl_size=1.4cm] at (27, -11) (multSign) {\Huge $*$};
59
60 \node[rtl_module] at (27, -15) (ATANLUT) {\Huge ATAN \\ \Huge LUT};
61
62 \node[rtl_reg_clk, rtl_width=1.5cm, rtl_height=21cm, is_cutset=blue] at (30, -7) (pipReg5) {\sffamily\Large Reg};
63
64 \node[rtl_module] at (34, -7) () {\Huge Quadrant \\ \Huge Mapping};
65
66 \node[rtl_reg_clk, rtl_width=1.5cm, rtl_height=21cm , label={[anchor=south east, font=\sffamily\Large, inner sep=3pt]south east:EN}] at (38, -7) (pipReg6) {\sffamily\Large Reg};
67 \draw[] ($(pipReg6.south east)+(0.2, +0.35)$) circle (0.2);
68
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
70 % outside pipeline - below
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
72 \node[rtl_module, rtl_width=3cm, rtl_height=3cm] at (12,-20) {\Huge Controller};
73
74 \node[rtl_module] at (3,-20) {\Huge $\mathsf{> 0}$};
75
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77 % data flow arrows
78 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
79
80 \draw[->, rtl_bus={\LARGE N}, line width=3] (-9.5, 1.75) node[left]{\Huge $\mathsf{X_{in}}$} -- (-8, 1.75);
81 \draw[->, rtl_bus={\LARGE N}, line width=3] (-9.5, -2.25) node[left]{\Huge $\mathsf{Y_{in}}$} -- (-8, -2.25);
82
83 \draw[->, rtl_bus, line width=3] (-6.5, 1.75) -- +(1, 0.0) -- +(1, 0.25) -- (xor1.input 1);
84 \node[circ, fill=red, scale=2, color=brown] at (-4.75, 2.0) (getSignAbs1) {};
85 \draw[->, rtl_bus={\LARGE N}, line width=3, color=brown] (getSignAbs1) -- +(0, -2.25) -- +(4.75,-2.25)node[midway, above, yshift=0.0cm]{\Huge $\mathsf{X_{in}[N]}$} -- +(4.75, -0.95); %extract Sign for two's complement
86 \node[circ, fill=black, scale=2, color=brown] at (-4.75, 1.525) (getSignAbs1XOR) {};
87 \draw[->, line width=3, color=brown] (getSignAbs1XOR) -- (xor1.input 2);
88 \draw[->, line width=3] (xor1.output) -- +(0.7,0);
89
90 \draw[->, rtl_bus, line width=3] (-6.5, -2.25) -- +(1, 0.0) -- +(1, 0.25) -- (xor2.input 1);
91 \node[circ, fill=black, scale=2, color=brown] at (-4.75, -2.0) (getSignAbs2) {};
92 \draw[->, rtl_bus={\LARGE N}, line width=3, color=brown] (getSignAbs2) -- +(0, -2.25) -- +(4.75,-2.25)node[midway, above, yshift=-0cm]{\Huge $\mathsf{Y_{in}[N]}$} -- +(4.75, -0.95); %extract Sign for two's complement
93 \node[circ, fill=black, scale=2, color=brown] at (-4.75, -2.475) (getSignAbs2XOR) {};
94 \draw[->, line width=3, color=brown] (getSignAbs2XOR) -- (xor2.input 2);
95 \draw[->, line width=3] (xor2.output) -- +(0.7,0);
96
97 \draw[->, rtl_bus, line width=3] (0.7, 1.75) -- (muxX-in-1);
98 \draw[->, rtl_bus, line width=3] (0.7, -2.25) -- (muxY-in-1);
99 \draw[->, rtl_bus, line width=3] (-0.25, -6.25) -- (muxZ-in-1) node[midway, below, yshift=-0.2cm]{\sffamily\LARGE N};
100 \draw[->, rtl_bus, line width=3] (muxX-out) -- (8.25, 1);
101 \draw[->, rtl_bus, line width=3] (muxY-out) -- (8.25, -3);
102 \draw[->, rtl_bus, line width=3] (muxZ-out) -- (8.25, -7);
103
104
105 \draw[->, rtl_bus, line width=3] (9.75, 1) -- (12.2, 1) node[above, midway, yshift=0.2cm]{\sffamily\Huge X};
106 \draw[->, rtl_bus, line width=3] (9.75, -3) -- (12.2, -3) node[above, midway, yshift=0.2cm]{\sffamily\Huge Y};
107 \node[circ, fill=black, scale=2, color=brown] at (10.75, -3) (getSing) {};
108 \draw[->, rtl_bus, line width=3] (9.75, -7) -- (22.25, -7) node[above, midway, yshift=0.2cm]{\sffamily\Huge Z};
109 \draw[->, line width=3, color=brown] (getSing) -- +(0, -2.5) -- +(4.5, -2.5) node[midway, sloped, xshift=0cm] {\LARGE /} node[midway, below, xshift=-0.1cm, yshift=-0.2cm] {\sffamily\LARGE N} node[above, midway, yshift=0.2cm]{\sffamily\Huge Y[N]} -- +(4.5, 3.8) -- (xor3.input 2);
110 \node[circ, fill=black, scale=2, color=brown] at (10.75, -5.5) (getSing2) {};
111 \draw[->, line width=3, color=brown] (getSing2) -- +(0, -5.5) -- +(11.5, -5.5);
112
113 \draw[->, rtl_bus, line width=3] (9.75, -15) -- (22.25, -15) node[above, midway, yshift=0.2cm]{\sffamily\Huge i};
114
115 \draw[->, rtl_bus, line width=3] (13.85, 1) -- +(1, 0.0) -- +(1, 0.25) -- (xor3.input 1);
116 \draw[->, line width=3] (xor3.output) -- +(0.7,0);
117 \draw[->, rtl_bus, line width=3] (20.7, 1) -- (22.25, 1);
118 \node[circ, fill=black, scale=2, color=brown] at (15.25, -0.5) (getSignAbs3XOR) {};
119 \draw[->, line width=3, color=brown] (getSignAbs3XOR) -- +(4.75, 0) -- +(4.75, 0.8);
120
121 \draw[->, rtl_bus, line width=3] (13.85, -3) -- +(1, 0.0) -- +(1, 0.25) -- (xor4.input 1);
122 \node[circ, fill=black, scale=2, color=brown] at (15.25, -3.225) (xor4SIGN) {};
123 \draw[->, line width=3, color=brown] (xor4SIGN) -- (xor4.input 2);
124 \draw[->, line width=3] (xor4.output) -- +(0.7,0);
125 \draw[->, rtl_bus, line width=3] (20.7, -3) -- (22.25, -3);
126 \node[circ, fill=black, scale=2, color=brown] at (15.25, -4.5) (getSignAbs4XOR) {};
127 \draw[->, line width=3, color=brown] (getSignAbs4XOR) -- +(4.75, 0) -- +(4.75, 0.8);
128
129 \draw[->, rtl_bus, line width=3] (23.75, 1) -- (26.3, 1);
130 \draw[->, rtl_bus, line width=3] (27.7, 1) -- (29.25, 1);
131 \draw[->, rtl_bus, line width=3] (23.75, -3) -- (25.3, -3);
132 \draw[->, rtl_bus, line width=3] (26.7, -3) -- (29.25, -3);
133 \draw[->, rtl_bus, line width=3] (23.75, -7) -- (26.3, -7);
134 \draw[->, rtl_bus, line width=3] (27.7, -7) -- (29.25, -7);
135 \draw[->, rtl_bus, line width=3] (27, -10.3) -- (27, -7.7);
136 \draw[->, rtl_bus, line width=3] (27, -14.1) -- (27, -11.7) node[midway, left, xshift=-0.1cm]{\Huge $\mathsf{\alpha_i}$} node[midway, right, xshift=0.1cm]{\sffamily\LARGE N};
137 \draw[->, rtl_bus, line width=3, color=brown] (23.75, -11) -- +(2.55, 0);
138 \draw[->, rtl_bus, line width=3] (23.75, -15) -- +(2, 0);
139
140 \node[circ, fill=black, scale=2] at (24.5, 1) (getXISigned) {};
141 \draw[->, line width=3] (getXISigned) -- +(-0, -1.5) -- +(1.5, -1.5) -- +(1.5, -3.3);
142
143 \node[circ, fill=black, scale=2] at (24, -3) (getYISigned) {};
144 \draw[->, line width=3] (getYISigned) -- +(0, 1.5) -- +(3, 1.5) -- +(3, 3.3) node[right, yshift=-0.2cm]{\Huge \textbf{-}};
145
146 \draw[->, line width=3] (30.75, -7) -- (32.25, -7);
147 \node[circ, fill=black, scale=2] at (31.5, -7) (zRegVal) {};
148
149 \draw[->, rtl_bus, line width=3] (35.8, -7) -- (37.25, -7) node[above, midway]{} node[midway, below, yshift=-0.2cm]{\sffamily\LARGE N};
150 \draw[->, rtl_bus, line width=3] (38.75, -7) -- (41.5, -7) node[midway, right, xshift=1.5cm] {\Huge $\mathsf{\phi}$} node[midway, below, yshift=-0.2cm]{\sffamily\LARGE N};
151
152
153
154 \draw[<-] (39.15, -17.15) -- (40, -17.15) -- +(0, -1.85) -- +(-26.1, -1.85) node[right, above, xshift=2.5cm]{\sffamily\LARGE LATCH OUTPUT};
155 \draw[->, dashed] (15.4, -21) -- (13.9, -21) node[above, midway]{\sffamily\LARGE CLK};
156 \draw[->, rtl_bus, line width=3] (10.1, -20) node[above, xshift=-1.75cm]{\sffamily\LARGE ITERATION} -- (3.75, -20) node[midway, below, yshift=-0.2cm]{\sffamily\LARGE L};
157
158 %pipeline latch of input vals
159 \draw[->] (3, -19.125) -- +(0, 18) -- +(2, 18) -- (muxX.south);
160 \node[circ] at (3, -5.125) (muxYSELSig) {};
161 \draw[->] (muxYSELSig) -- +(2, 0) -- (muxY.south);
162 \node[circ] at (3, -9.125) (muxZSELSig) {};
163 \draw[->] (muxZSELSig) -- +(2, 0) -- (muxZ.south);
164 \node[circ] at (3, -13.125) (busySig) {};
165 \draw[->] (busySig) -- +(2,0) node[right]{\sffamily\Huge BUSY};
166 \draw[->] (0, -24) node[left]{\sffamily\Huge START}-- +(12, 0) -- +(12, 2.5);
167 \node[circ] at (3, -17.15) (latchInput) {};
168 \draw[->] (latchInput) -- +(-9.1,0);
169
170
171 \draw[->, line width=3] (30.75,1) -- +(0.5, 0) -- +(0.5, 4) -- +(-27.5, 4)node[midway, sloped, xshift=0cm] {\LARGE /} -- +(-27.5, -0.7) -- (muxX-in-2);
172 \draw[->, line width=3] (30.75, -3) -- +(1.5, 0) -- +(1.5, 8.5) -- +(-28.5, 8.5) node[midway, sloped, xshift=0cm] {\LARGE /} -- +(-28.5, -0.7) -- (muxY-in-2);
173 \draw[->, line width=3] (zRegVal) -- (31.5, -5) -- (33.25, -5) -- +(0, 11) -- +(-32, 11)node[midway, sloped, xshift=0cm] {\LARGE /} -- +(-32, -2.7) -- (muxZ-in-2);
174
175 %for quadrant remapping:
176 \node[circ, fill=black, scale=2] at (-5.5, 2) (qadI) {};
177 \draw[->, line width=3] (qadI) -- +(0, 4.5) -- +(39.5, 4.5)node[midway, sloped, xshift=3cm] {\LARGE /} -- +(39.5, -8.125);
178 \node[circ, fill=black, scale=2] at (-6, -2.25) (qadQ) {};
179 \draw[->, line width=3] (qadQ) -- +(0, 9.25) -- +(40.5, 9.25) node[midway, sloped, xshift=3cm] {\LARGE /} -- +(40.5, -3.875);
180
181 \node[circ, fill=black, scale=2] at (5, -20) (getI) {};
182 \draw[->, line width=3] (getI) -- +(0, 5) -- (8.25, -15);
183 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
184 % clk arrows pipeline regs
185 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
186 \draw[->, dashed] (-9.25, -17.15) -- (-8, -17.15) node[above, midway]{\sffamily\LARGE CLK};
187 \draw[->, dashed] (7, -17.15) -- (8.25, -17.15) node[above, midway]{\sffamily\LARGE CLK};
188 \draw[->, dashed] (21, -17.15) -- (22.25, -17.15) node[above, midway]{\sffamily\LARGE CLK};
189 \draw[->, dashed] (28, -17.15) -- (29.25, -17.15) node[above, midway]{\sffamily\LARGE CLK};
190 \draw[->, dashed] (36, -17.15) -- (37.25, -17.15) node[above, midway]{\sffamily\LARGE CLK};
191
192 \end{circuitikz}
193
194 \end{document}