Last-Modified: Wed, 31 Dec 2025 02:10:57 GMT
Expires: Sat, 29 Dec 2035 02:10:57 GMT

<!DOCTYPE html>
<html lang='en'>
<head>
<title>MIDI « ClassDriver « Device « Demos - avr/qmk/lufa - [no description]</title>
<meta name='generator' content='cgit v1.2.3'/>
<meta name='robots' content='index, nofollow'/>
<link rel='stylesheet' type='text/css' href='/cgit.css'/>
<link rel='shortcut icon' href='/favicon.ico'/>
<link rel='alternate' title='Atom feed' href='http://git.panaceas.org/cgit.cgi/avr/qmk/lufa/atom/Demos/Device/ClassDriver/MIDI?h=master' type='application/atom+xml'/>
<link rel='vcs-git' href='git://git.panaceas.org/avr/qmk/lufa' title='avr/qmk/lufa Git repository'/>
<link rel='vcs-git' href='ssh://git@git.panaceas.org/git/avr/qmk/lufa' title='avr/qmk/lufa Git repository'/>
</head>
<body>
<div id='cgit'><table id='header'>
<tr>
<td class='logo' rowspan='2'><a href='/cgit.cgi/'><img src='/cgit.png' alt='cgit logo'/></a></td>
<td class='main'><a href='/cgit.cgi/'>index</a> : <a title='avr/qmk/lufa' href='/cgit.cgi/avr/qmk/lufa/'>avr/qmk/lufa</a></td><td class='form'><form method='get'>
<input type='hidden' name='id' value='36dec204f1ad1e6206ff0dd15db73b6598ea2068'/><select name='h' onchange='this.form.submit();'>
<option value='master' selected='selected'>master</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>[no description]</td><td class='sub right'></td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/avr/qmk/lufa/about/'>about</a><a href='/cgit.cgi/avr/qmk/lufa/'>summary</a><a href='/cgit.cgi/avr/qmk/lufa/refs/?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>refs</a><a href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI'>log</a><a class='active' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>tree</a><a href='/cgit.cgi/avr/qmk/lufa/commit/Demos/Device/ClassDriver/MIDI?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>commit</a><a href='/cgit.cgi/avr/qmk/lufa/diff/Demos/Device/ClassDriver/MIDI?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>diff</a><a href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI'>stats</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI'>
<input type='hidden' name='id' value='36dec204f1ad1e6206ff0dd15db73b6598ea2068'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/avr/qmk/lufa/tree/?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>root</a>/<a href='/cgit.cgi/avr/qmk/lufa/tree/Demos?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>Demos</a>/<a href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>Device</a>/<a href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>ClassDriver</a>/<a href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>MIDI</a></div><div class='content'><table summary='tree listing' class='list'>
<tr class='nohover'><th class='left'>Mode</th><th class='left'>Name</th><th class='right'>Size</th><th/></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob c' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/Descriptors.c?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>Descriptors.c</a></td><td class='ls-size'>11328</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/Descriptors.c?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/Descriptors.c'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/Descriptors.c?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob h' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/Descriptors.h?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>Descriptors.h</a></td><td class='ls-size'>3331</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/Descriptors.h?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/Descriptors.h'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/Descriptors.h?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob conf' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/Doxygen.conf?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>Doxygen.conf</a></td><td class='ls-size'>67521</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/Doxygen.conf?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/Doxygen.conf'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/Doxygen.conf?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob c' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/MIDI.c?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>MIDI.c</a></td><td class='ls-size'>5922</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/MIDI.c?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/MIDI.c'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/MIDI.c?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob h' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/MIDI.h?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>MIDI.h</a></td><td class='ls-size'>2727</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/MIDI.h?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/MIDI.h'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/MIDI.h?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob txt' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/MIDI.txt?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>MIDI.txt</a></td><td class='ls-size'>2198</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/MIDI.txt?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/MIDI.txt'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/MIDI.txt?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
<tr><td class='ls-mode'>-rw-r--r--</td><td><a class='ls-blob' href='/cgit.cgi/avr/qmk/lufa/tree/Demos/Device/ClassDriver/MIDI/makefile?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>makefile</a></td><td class='ls-size'>22976</td><td><a class='button' href='/cgit.cgi/avr/qmk/lufa/log/Demos/Device/ClassDriver/MIDI/makefile?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>log</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/stats/Demos/Device/ClassDriver/MIDI/makefile'>stats</a><a class='button' href='/cgit.cgi/avr/qmk/lufa/plain/Demos/Device/ClassDriver/MIDI/makefile?id=36dec204f1ad1e6206ff0dd15db73b6598ea2068'>plain</a></td></tr>
</table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.25.1</a>) at 2025-12-31 02:10:57 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
>154</a>
<a id='n155' href='#n155'>155</a>
<a id='n156' href='#n156'>156</a>
<a id='n157' href='#n157'>157</a>
<a id='n158' href='#n158'>158</a>
<a id='n159' href='#n159'>159</a>
<a id='n160' href='#n160'>160</a>
<a id='n161' href='#n161'>161</a>
<a id='n162' href='#n162'>162</a>
<a id='n163' href='#n163'>163</a>
<a id='n164' href='#n164'>164</a>
<a id='n165' href='#n165'>165</a>
<a id='n166' href='#n166'>166</a>
<a id='n167' href='#n167'>167</a>
<a id='n168' href='#n168'>168</a>
<a id='n169' href='#n169'>169</a>
<a id='n170' href='#n170'>170</a>
<a id='n171' href='#n171'>171</a>
<a id='n172' href='#n172'>172</a>
<a id='n173' href='#n173'>173</a>
<a id='n174' href='#n174'>174</a>
<a id='n175' href='#n175'>175</a>
<a id='n176' href='#n176'>176</a>
<a id='n177' href='#n177'>177</a>
<a id='n178' href='#n178'>178</a>
<a id='n179' href='#n179'>179</a>
<a id='n180' href='#n180'>180</a>
<a id='n181' href='#n181'>181</a>
<a id='n182' href='#n182'>182</a>
<a id='n183' href='#n183'>183</a>
<a id='n184' href='#n184'>184</a>
<a id='n185' href='#n185'>185</a>
<a id='n186' href='#n186'>186</a>
<a id='n187' href='#n187'>187</a>
<a id='n188' href='#n188'>188</a>
<a id='n189' href='#n189'>189</a>
<a id='n190' href='#n190'>190</a>
<a id='n191' href='#n191'>191</a>
<a id='n192' href='#n192'>192</a>
<a id='n193' href='#n193'>193</a>
<a id='n194' href='#n194'>194</a>
<a id='n195' href='#n195'>195</a>
<a id='n196' href='#n196'>196</a>
<a id='n197' href='#n197'>197</a>
<a id='n198' href='#n198'>198</a>
<a id='n199' href='#n199'>199</a>
<a id='n200' href='#n200'>200</a>
<a id='n201' href='#n201'>201</a>
<a id='n202' href='#n202'>202</a>
<a id='n203' href='#n203'>203</a>
<a id='n204' href='#n204'>204</a>
<a id='n205' href='#n205'>205</a>
<a id='n206' href='#n206'>206</a>
<a id='n207' href='#n207'>207</a>
<a id='n208' href='#n208'>208</a>
<a id='n209' href='#n209'>209</a>
<a id='n210' href='#n210'>210</a>
<a id='n211' href='#n211'>211</a>
<a id='n212' href='#n212'>212</a>
<a id='n213' href='#n213'>213</a>
<a id='n214' href='#n214'>214</a>
<a id='n215' href='#n215'>215</a>
<a id='n216' href='#n216'>216</a>
<a id='n217' href='#n217'>217</a>
<a id='n218' href='#n218'>218</a>
<a id='n219' href='#n219'>219</a>
<a id='n220' href='#n220'>220</a>
<a id='n221' href='#n221'>221</a>
<a id='n222' href='#n222'>222</a>
<a id='n223' href='#n223'>223</a>
<a id='n224' href='#n224'>224</a>
<a id='n225' href='#n225'>225</a>
<a id='n226' href='#n226'>226</a>
<a id='n227' href='#n227'>227</a>
<a id='n228' href='#n228'>228</a>
<a id='n229' href='#n229'>229</a>
<a id='n230' href='#n230'>230</a>
<a id='n231' href='#n231'>231</a>
<a id='n232' href='#n232'>232</a>
<a id='n233' href='#n233'>233</a>
<a id='n234' href='#n234'>234</a>
<a id='n235' href='#n235'>235</a>
<a id='n236' href='#n236'>236</a>
<a id='n237' href='#n237'>237</a>
<a id='n238' href='#n238'>238</a>
<a id='n239' href='#n239'>239</a>
<a id='n240' href='#n240'>240</a>
<a id='n241' href='#n241'>241</a>
<a id='n242' href='#n242'>242</a>
<a id='n243' href='#n243'>243</a>
<a id='n244' href='#n244'>244</a>
<a id='n245' href='#n245'>245</a>
<a id='n246' href='#n246'>246</a>
<a id='n247' href='#n247'>247</a>
<a id='n248' href='#n248'>248</a>
<a id='n249' href='#n249'>249</a>
<a id='n250' href='#n250'>250</a>
<a id='n251' href='#n251'>251</a>
<a id='n252' href='#n252'>252</a>
<a id='n253' href='#n253'>253</a>
<a id='n254' href='#n254'>254</a>
<a id='n255' href='#n255'>255</a>
<a id='n256' href='#n256'>256</a>
<a id='n257' href='#n257'>257</a>
<a id='n258' href='#n258'>258</a>
<a id='n259' href='#n259'>259</a>
<a id='n260' href='#n260'>260</a>
<a id='n261' href='#n261'>261</a>
<a id='n262' href='#n262'>262</a>
<a id='n263' href='#n263'>263</a>
<a id='n264' href='#n264'>264</a>
<a id='n265' href='#n265'>265</a>
<a id='n266' href='#n266'>266</a>
<a id='n267' href='#n267'>267</a>
<a id='n268' href='#n268'>268</a>
<a id='n269' href='#n269'>269</a>
<a id='n270' href='#n270'>270</a>
<a id='n271' href='#n271'>271</a>
<a id='n272' href='#n272'>272</a>
<a id='n273' href='#n273'>273</a>
<a id='n274' href='#n274'>274</a>
<a id='n275' href='#n275'>275</a>
<a id='n276' href='#n276'>276</a>
<a id='n277' href='#n277'>277</a>
<a id='n278' href='#n278'>278</a>
<a id='n279' href='#n279'>279</a>
<a id='n280' href='#n280'>280</a>
<a id='n281' href='#n281'>281</a>
<a id='n282' href='#n282'>282</a>
<a id='n283' href='#n283'>283</a>
<a id='n284' href='#n284'>284</a>
<a id='n285' href='#n285'>285</a>
<a id='n286' href='#n286'>286</a>
<a id='n287' href='#n287'>287</a>
<a id='n288' href='#n288'>288</a>
<a id='n289' href='#n289'>289</a>
<a id='n290' href='#n290'>290</a>
<a id='n291' href='#n291'>291</a>
<a id='n292' href='#n292'>292</a>
<a id='n293' href='#n293'>293</a>
<a id='n294' href='#n294'>294</a>
<a id='n295' href='#n295'>295</a>
<a id='n296' href='#n296'>296</a>
<a id='n297' href='#n297'>297</a>
<a id='n298' href='#n298'>298</a>
<a id='n299' href='#n299'>299</a>
<a id='n300' href='#n300'>300</a>
<a id='n301' href='#n301'>301</a>
<a id='n302' href='#n302'>302</a>
<a id='n303' href='#n303'>303</a>
<a id='n304' href='#n304'>304</a>
<a id='n305' href='#n305'>305</a>
<a id='n306' href='#n306'>306</a>
<a id='n307' href='#n307'>307</a>
<a id='n308' href='#n308'>308</a>
<a id='n309' href='#n309'>309</a>
<a id='n310' href='#n310'>310</a>
<a id='n311' href='#n311'>311</a>
<a id='n312' href='#n312'>312</a>
<a id='n313' href='#n313'>313</a>
<a id='n314' href='#n314'>314</a>
<a id='n315' href='#n315'>315</a>
<a id='n316' href='#n316'>316</a>
<a id='n317' href='#n317'>317</a>
<a id='n318' href='#n318'>318</a>
<a id='n319' href='#n319'>319</a>
<a id='n320' href='#n320'>320</a>
<a id='n321' href='#n321'>321</a>
<a id='n322' href='#n322'>322</a>
<a id='n323' href='#n323'>323</a>
<a id='n324' href='#n324'>324</a>
<a id='n325' href='#n325'>325</a>
<a id='n326' href='#n326'>326</a>
<a id='n327' href='#n327'>327</a>
<a id='n328' href='#n328'>328</a>
<a id='n329' href='#n329'>329</a>
<a id='n330' href='#n330'>330</a>
<a id='n331' href='#n331'>331</a>
<a id='n332' href='#n332'>332</a>
<a id='n333' href='#n333'>333</a>
<a id='n334' href='#n334'>334</a>
<a id='n335' href='#n335'>335</a>
<a id='n336' href='#n336'>336</a>
<a id='n337' href='#n337'>337</a>
<a id='n338' href='#n338'>338</a>
<a id='n339' href='#n339'>339</a>
<a id='n340' href='#n340'>340</a>
<a id='n341' href='#n341'>341</a>
<a id='n342' href='#n342'>342</a>
<a id='n343' href='#n343'>343</a>
<a id='n344' href='#n344'>344</a>
<a id='n345' href='#n345'>345</a>
<a id='n346' href='#n346'>346</a>
<a id='n347' href='#n347'>347</a>
<a id='n348' href='#n348'>348</a>
<a id='n349' href='#n349'>349</a>
<a id='n350' href='#n350'>350</a>
<a id='n351' href='#n351'>351</a>
<a id='n352' href='#n352'>352</a>
<a id='n353' href='#n353'>353</a>
<a id='n354' href='#n354'>354</a>
<a id='n355' href='#n355'>355</a>
<a id='n356' href='#n356'>356</a>
<a id='n357' href='#n357'>357</a>
<a id='n358' href='#n358'>358</a>
<a id='n359' href='#n359'>359</a>
<a id='n360' href='#n360'>360</a>
<a id='n361' href='#n361'>361</a>
<a id='n362' href='#n362'>362</a>
<a id='n363' href='#n363'>363</a>
<a id='n364' href='#n364'>364</a>
<a id='n365' href='#n365'>365</a>
<a id='n366' href='#n366'>366</a>
<a id='n367' href='#n367'>367</a>
<a id='n368' href='#n368'>368</a>
<a id='n369' href='#n369'>369</a>
<a id='n370' href='#n370'>370</a>
<a id='n371' href='#n371'>371</a>
<a id='n372' href='#n372'>372</a>
<a id='n373' href='#n373'>373</a>
<a id='n374' href='#n374'>374</a>
<a id='n375' href='#n375'>375</a>
<a id='n376' href='#n376'>376</a>
<a id='n377' href='#n377'>377</a>
<a id='n378' href='#n378'>378</a>
<a id='n379' href='#n379'>379</a>
<a id='n380' href='#n380'>380</a>
<a id='n381' href='#n381'>381</a>
<a id='n382' href='#n382'>382</a>
<a id='n383' href='#n383'>383</a>
<a id='n384' href='#n384'>384</a>
<a id='n385' href='#n385'>385</a>
<a id='n386' href='#n386'>386</a>
<a id='n387' href='#n387'>387</a>
<a id='n388' href='#n388'>388</a>
<a id='n389' href='#n389'>389</a>
<a id='n390' href='#n390'>390</a>
<a id='n391' href='#n391'>391</a>
<a id='n392' href='#n392'>392</a>
<a id='n393' href='#n393'>393</a>
<a id='n394' href='#n394'>394</a>
<a id='n395' href='#n395'>395</a>
<a id='n396' href='#n396'>396</a>
<a id='n397' href='#n397'>397</a>
<a id='n398' href='#n398'>398</a>
<a id='n399' href='#n399'>399</a>
<a id='n400' href='#n400'>400</a>
<a id='n401' href='#n401'>401</a>
<a id='n402' href='#n402'>402</a>
<a id='n403' href='#n403'>403</a>
<a id='n404' href='#n404'>404</a>
<a id='n405' href='#n405'>405</a>
<a id='n406' href='#n406'>406</a>
<a id='n407' href='#n407'>407</a>
<a id='n408' href='#n408'>408</a>
<a id='n409' href='#n409'>409</a>
<a id='n410' href='#n410'>410</a>
<a id='n411' href='#n411'>411</a>
<a id='n412' href='#n412'>412</a>
<a id='n413' href='#n413'>413</a>
<a id='n414' href='#n414'>414</a>
<a id='n415' href='#n415'>415</a>
<a id='n416' href='#n416'>416</a>
<a id='n417' href='#n417'>417</a>
<a id='n418' href='#n418'>418</a>
<a id='n419' href='#n419'>419</a>
<a id='n420' href='#n420'>420</a>
<a id='n421' href='#n421'>421</a>
<a id='n422' href='#n422'>422</a>
<a id='n423' href='#n423'>423</a>
<a id='n424' href='#n424'>424</a>
<a id='n425' href='#n425'>425</a>
<a id='n426' href='#n426'>426</a>
<a id='n427' href='#n427'>427</a>
<a id='n428' href='#n428'>428</a>
<a id='n429' href='#n429'>429</a>
<a id='n430' href='#n430'>430</a>
<a id='n431' href='#n431'>431</a>
<a id='n432' href='#n432'>432</a>
<a id='n433' href='#n433'>433</a>
<a id='n434' href='#n434'>434</a>
<a id='n435' href='#n435'>435</a>
<a id='n436' href='#n436'>436</a>
<a id='n437' href='#n437'>437</a>
<a id='n438' href='#n438'>438</a>
<a id='n439' href='#n439'>439</a>
<a id='n440' href='#n440'>440</a>
<a id='n441' href='#n441'>441</a>
<a id='n442' href='#n442'>442</a>
<a id='n443' href='#n443'>443</a>
<a id='n444' href='#n444'>444</a>
<a id='n445' href='#n445'>445</a>
<a id='n446' href='#n446'>446</a>
<a id='n447' href='#n447'>447</a>
<a id='n448' href='#n448'>448</a>
<a id='n449' href='#n449'>449</a>
<a id='n450' href='#n450'>450</a>
<a id='n451' href='#n451'>451</a>
<a id='n452' href='#n452'>452</a>
<a id='n453' href='#n453'>453</a>
<a id='n454' href='#n454'>454</a>
<a id='n455' href='#n455'>455</a>
<a id='n456' href='#n456'>456</a>
<a id='n457' href='#n457'>457</a>
<a id='n458' href='#n458'>458</a>
<a id='n459' href='#n459'>459</a>
<a id='n460' href='#n460'>460</a>
<a id='n461' href='#n461'>461</a>
<a id='n462' href='#n462'>462</a>
<a id='n463' href='#n463'>463</a>
<a id='n464' href='#n464'>464</a>
<a id='n465' href='#n465'>465</a>
<a id='n466' href='#n466'>466</a>
<a id='n467' href='#n467'>467</a>
<a id='n468' href='#n468'>468</a>
<a id='n469' href='#n469'>469</a>
<a id='n470' href='#n470'>470</a>
<a id='n471' href='#n471'>471</a>
<a id='n472' href='#n472'>472</a>
<a id='n473' href='#n473'>473</a>
<a id='n474' href='#n474'>474</a>
<a id='n475' href='#n475'>475</a>
<a id='n476' href='#n476'>476</a>
<a id='n477' href='#n477'>477</a>
<a id='n478' href='#n478'>478</a>
<a id='n479' href='#n479'>479</a>
<a id='n480' href='#n480'>480</a>
<a id='n481' href='#n481'>481</a>
<a id='n482' href='#n482'>482</a>
<a id='n483' href='#n483'>483</a>
<a id='n484' href='#n484'>484</a>
<a id='n485' href='#n485'>485</a>
<a id='n486' href='#n486'>486</a>
<a id='n487' href='#n487'>487</a>
<a id='n488' href='#n488'>488</a>
<a id='n489' href='#n489'>489</a>
<a id='n490' href='#n490'>490</a>
<a id='n491' href='#n491'>491</a>
<a id='n492' href='#n492'>492</a>
<a id='n493' href='#n493'>493</a>
<a id='n494' href='#n494'>494</a>
<a id='n495' href='#n495'>495</a>
<a id='n496' href='#n496'>496</a>
<a id='n497' href='#n497'>497</a>
<a id='n498' href='#n498'>498</a>
<a id='n499' href='#n499'>499</a>
<a id='n500' href='#n500'>500</a>
<a id='n501' href='#n501'>501</a>
<a id='n502' href='#n502'>502</a>
<a id='n503' href='#n503'>503</a>
<a id='n504' href='#n504'>504</a>
<a id='n505' href='#n505'>505</a>
<a id='n506' href='#n506'>506</a>
<a id='n507' href='#n507'>507</a>
<a id='n508' href='#n508'>508</a>
<a id='n509' href='#n509'>509</a>
<a id='n510' href='#n510'>510</a>
<a id='n511' href='#n511'>511</a>
<a id='n512' href='#n512'>512</a>
<a id='n513' href='#n513'>513</a>
<a id='n514' href='#n514'>514</a>
<a id='n515' href='#n515'>515</a>
<a id='n516' href='#n516'>516</a>
<a id='n517' href='#n517'>517</a>
<a id='n518' href='#n518'>518</a>
<a id='n519' href='#n519'>519</a>
<a id='n520' href='#n520'>520</a>
<a id='n521' href='#n521'>521</a>
<a id='n522' href='#n522'>522</a>
<a id='n523' href='#n523'>523</a>
<a id='n524' href='#n524'>524</a>
<a id='n525' href='#n525'>525</a>
<a id='n526' href='#n526'>526</a>
<a id='n527' href='#n527'>527</a>
<a id='n528' href='#n528'>528</a>
<a id='n529' href='#n529'>529</a>
<a id='n530' href='#n530'>530</a>
<a id='n531' href='#n531'>531</a>
<a id='n532' href='#n532'>532</a>
<a id='n533' href='#n533'>533</a>
<a id='n534' href='#n534'>534</a>
<a id='n535' href='#n535'>535</a>
<a id='n536' href='#n536'>536</a>
<a id='n537' href='#n537'>537</a>
<a id='n538' href='#n538'>538</a>
<a id='n539' href='#n539'>539</a>
<a id='n540' href='#n540'>540</a>
<a id='n541' href='#n541'>541</a>
<a id='n542' href='#n542'>542</a>
<a id='n543' href='#n543'>543</a>
<a id='n544' href='#n544'>544</a>
<a id='n545' href='#n545'>545</a>
<a id='n546' href='#n546'>546</a>
<a id='n547' href='#n547'>547</a>
<a id='n548' href='#n548'>548</a>
<a id='n549' href='#n549'>549</a>
<a id='n550' href='#n550'>550</a>
<a id='n551' href='#n551'>551</a>
<a id='n552' href='#n552'>552</a>
<a id='n553' href='#n553'>553</a>
<a id='n554' href='#n554'>554</a>
<a id='n555' href='#n555'>555</a>
<a id='n556' href='#n556'>556</a>
<a id='n557' href='#n557'>557</a>
<a id='n558' href='#n558'>558</a>
<a id='n559' href='#n559'>559</a>
<a id='n560' href='#n560'>560</a>
<a id='n561' href='#n561'>561</a>
<a id='n562' href='#n562'>562</a>
<a id='n563' href='#n563'>563</a>
<a id='n564' href='#n564'>564</a>
<a id='n565' href='#n565'>565</a>
<a id='n566' href='#n566'>566</a>
<a id='n567' href='#n567'>567</a>
<a id='n568' href='#n568'>568</a>
<a id='n569' href='#n569'>569</a>
<a id='n570' href='#n570'>570</a>
<a id='n571' href='#n571'>571</a>
<a id='n572' href='#n572'>572</a>
<a id='n573' href='#n573'>573</a>
<a id='n574' href='#n574'>574</a>
<a id='n575' href='#n575'>575</a>
<a id='n576' href='#n576'>576</a>
<a id='n577' href='#n577'>577</a>
<a id='n578' href='#n578'>578</a>
<a id='n579' href='#n579'>579</a>
<a id='n580' href='#n580'>580</a>
<a id='n581' href='#n581'>581</a>
<a id='n582' href='#n582'>582</a>
<a id='n583' href='#n583'>583</a>
<a id='n584' href='#n584'>584</a>
<a id='n585' href='#n585'>585</a>
<a id='n586' href='#n586'>586</a>
<a id='n587' href='#n587'>587</a>
<a id='n588' href='#n588'>588</a>
<a id='n589' href='#n589'>589</a>
<a id='n590' href='#n590'>590</a>
<a id='n591' href='#n591'>591</a>
<a id='n592' href='#n592'>592</a>
<a id='n593' href='#n593'>593</a>
<a id='n594' href='#n594'>594</a>
<a id='n595' href='#n595'>595</a>
<a id='n596' href='#n596'>596</a>
<a id='n597' href='#n597'>597</a>
<a id='n598' href='#n598'>598</a>
<a id='n599' href='#n599'>599</a>
<a id='n600' href='#n600'>600</a>
<a id='n601' href='#n601'>601</a>
<a id='n602' href='#n602'>602</a>
<a id='n603' href='#n603'>603</a>
<a id='n604' href='#n604'>604</a>
<a id='n605' href='#n605'>605</a>
<a id='n606' href='#n606'>606</a>
<a id='n607' href='#n607'>607</a>
<a id='n608' href='#n608'>608</a>
<a id='n609' href='#n609'>609</a>
<a id='n610' href='#n610'>610</a>
<a id='n611' href='#n611'>611</a>
<a id='n612' href='#n612'>612</a>
<a id='n613' href='#n613'>613</a>
<a id='n614' href='#n614'>614</a>
<a id='n615' href='#n615'>615</a>
<a id='n616' href='#n616'>616</a>
<a id='n617' href='#n617'>617</a>
<a id='n618' href='#n618'>618</a>
<a id='n619' href='#n619'>619</a>
<a id='n620' href='#n620'>620</a>
<a id='n621' href='#n621'>621</a>
<a id='n622' href='#n622'>622</a>
<a id='n623' href='#n623'>623</a>
<a id='n624' href='#n624'>624</a>
<a id='n625' href='#n625'>625</a>
<a id='n626' href='#n626'>626</a>
<a id='n627' href='#n627'>627</a>
<a id='n628' href='#n628'>628</a>
<a id='n629' href='#n629'>629</a>
<a id='n630' href='#n630'>630</a>
<a id='n631' href='#n631'>631</a>
<a id='n632' href='#n632'>632</a>
<a id='n633' href='#n633'>633</a>
<a id='n634' href='#n634'>634</a>
<a id='n635' href='#n635'>635</a>
<a id='n636' href='#n636'>636</a>
<a id='n637' href='#n637'>637</a>
<a id='n638' href='#n638'>638</a>
<a id='n639' href='#n639'>639</a>
<a id='n640' href='#n640'>640</a>
<a id='n641' href='#n641'>641</a>
<a id='n642' href='#n642'>642</a>
<a id='n643' href='#n643'>643</a>
<a id='n644' href='#n644'>644</a>
<a id='n645' href='#n645'>645</a>
<a id='n646' href='#n646'>646</a>
<a id='n647' href='#n647'>647</a>
<a id='n648' href='#n648'>648</a>
<a id='n649' href='#n649'>649</a>
<a id='n650' href='#n650'>650</a>
<a id='n651' href='#n651'>651</a>
<a id='n652' href='#n652'>652</a>
<a id='n653' href='#n653'>653</a>
<a id='n654' href='#n654'>654</a>
<a id='n655' href='#n655'>655</a>
<a id='n656' href='#n656'>656</a>
<a id='n657' href='#n657'>657</a>
<a id='n658' href='#n658'>658</a>
<a id='n659' href='#n659'>659</a>
<a id='n660' href='#n660'>660</a>
<a id='n661' href='#n661'>661</a>
<a id='n662' href='#n662'>662</a>
<a id='n663' href='#n663'>663</a>
<a id='n664' href='#n664'>664</a>
<a id='n665' href='#n665'>665</a>
<a id='n666' href='#n666'>666</a>
<a id='n667' href='#n667'>667</a>
<a id='n668' href='#n668'>668</a>
<a id='n669' href='#n669'>669</a>
<a id='n670' href='#n670'>670</a>
<a id='n671' href='#n671'>671</a>
<a id='n672' href='#n672'>672</a>
<a id='n673' href='#n673'>673</a>
<a id='n674' href='#n674'>674</a>
<a id='n675' href='#n675'>675</a>
<a id='n676' href='#n676'>676</a>
<a id='n677' href='#n677'>677</a>
<a id='n678' href='#n678'>678</a>
<a id='n679' href='#n679'>679</a>
<a id='n680' href='#n680'>680</a>
<a id='n681' href='#n681'>681</a>
<a id='n682' href='#n682'>682</a>
<a id='n683' href='#n683'>683</a>
<a id='n684' href='#n684'>684</a>
<a id='n685' href='#n685'>685</a>
<a id='n686' href='#n686'>686</a>
<a id='n687' href='#n687'>687</a>
<a id='n688' href='#n688'>688</a>
<a id='n689' href='#n689'>689</a>
<a id='n690' href='#n690'>690</a>
<a id='n691' href='#n691'>691</a>
<a id='n692' href='#n692'>692</a>
<a id='n693' href='#n693'>693</a>
<a id='n694' href='#n694'>694</a>
<a id='n695' href='#n695'>695</a>
<a id='n696' href='#n696'>696</a>
<a id='n697' href='#n697'>697</a>
<a id='n698' href='#n698'>698</a>
<a id='n699' href='#n699'>699</a>
<a id='n700' href='#n700'>700</a>
<a id='n701' href='#n701'>701</a>
<a id='n702' href='#n702'>702</a>
<a id='n703' href='#n703'>703</a>
<a id='n704' href='#n704'>704</a>
<a id='n705' href='#n705'>705</a>
<a id='n706' href='#n706'>706</a>
<a id='n707' href='#n707'>707</a>
<a id='n708' href='#n708'>708</a>
<a id='n709' href='#n709'>709</a>
<a id='n710' href='#n710'>710</a>
<a id='n711' href='#n711'>711</a>
<a id='n712' href='#n712'>712</a>
<a id='n713' href='#n713'>713</a>
<a id='n714' href='#n714'>714</a>
<a id='n715' href='#n715'>715</a>
<a id='n716' href='#n716'>716</a>
<a id='n717' href='#n717'>717</a>
<a id='n718' href='#n718'>718</a>
<a id='n719' href='#n719'>719</a>
<a id='n720' href='#n720'>720</a>
<a id='n721' href='#n721'>721</a>
<a id='n722' href='#n722'>722</a>
<a id='n723' href='#n723'>723</a>
<a id='n724' href='#n724'>724</a>
<a id='n725' href='#n725'>725</a>
<a id='n726' href='#n726'>726</a>
<a id='n727' href='#n727'>727</a>
<a id='n728' href='#n728'>728</a>
<a id='n729' href='#n729'>729</a>
<a id='n730' href='#n730'>730</a>
<a id='n731' href='#n731'>731</a>
<a id='n732' href='#n732'>732</a>
<a id='n733' href='#n733'>733</a>
<a id='n734' href='#n734'>734</a>
<a id='n735' href='#n735'>735</a>
<a id='n736' href='#n736'>736</a>
<a id='n737' href='#n737'>737</a>
<a id='n738' href='#n738'>738</a>
<a id='n739' href='#n739'>739</a>
<a id='n740' href='#n740'>740</a>
<a id='n741' href='#n741'>741</a>
<a id='n742' href='#n742'>742</a>
<a id='n743' href='#n743'>743</a>
<a id='n744' href='#n744'>744</a>
<a id='n745' href='#n745'>745</a>
<a id='n746' href='#n746'>746</a>
<a id='n747' href='#n747'>747</a>
<a id='n748' href='#n748'>748</a>
<a id='n749' href='#n749'>749</a>
<a id='n750' href='#n750'>750</a>
<a id='n751' href='#n751'>751</a>
<a id='n752' href='#n752'>752</a>
<a id='n753' href='#n753'>753</a>
<a id='n754' href='#n754'>754</a>
<a id='n755' href='#n755'>755</a>
<a id='n756' href='#n756'>756</a>
<a id='n757' href='#n757'>757</a>
<a id='n758' href='#n758'>758</a>
<a id='n759' href='#n759'>759</a>
<a id='n760' href='#n760'>760</a>
<a id='n761' href='#n761'>761</a>
<a id='n762' href='#n762'>762</a>
<a id='n763' href='#n763'>763</a>
<a id='n764' href='#n764'>764</a>
<a id='n765' href='#n765'>765</a>
<a id='n766' href='#n766'>766</a>
<a id='n767' href='#n767'>767</a>
<a id='n768' href='#n768'>768</a>
<a id='n769' href='#n769'>769</a>
<a id='n770' href='#n770'>770</a>
<a id='n771' href='#n771'>771</a>
<a id='n772' href='#n772'>772</a>
<a id='n773' href='#n773'>773</a>
<a id='n774' href='#n774'>774</a>
<a id='n775' href='#n775'>775</a>
<a id='n776' href='#n776'>776</a>
<a id='n777' href='#n777'>777</a>
<a id='n778' href='#n778'>778</a>
<a id='n779' href='#n779'>779</a>
<a id='n780' href='#n780'>780</a>
<a id='n781' href='#n781'>781</a>
<a id='n782' href='#n782'>782</a>
<a id='n783' href='#n783'>783</a>
<a id='n784' href='#n784'>784</a>
<a id='n785' href='#n785'>785</a>
<a id='n786' href='#n786'>786</a>
<a id='n787' href='#n787'>787</a>
<a id='n788' href='#n788'>788</a>
<a id='n789' href='#n789'>789</a>
<a id='n790' href='#n790'>790</a>
<a id='n791' href='#n791'>791</a>
<a id='n792' href='#n792'>792</a>
<a id='n793' href='#n793'>793</a>
<a id='n794' href='#n794'>794</a>
<a id='n795' href='#n795'>795</a>
<a id='n796' href='#n796'>796</a>
<a id='n797' href='#n797'>797</a>
<a id='n798' href='#n798'>798</a>
<a id='n799' href='#n799'>799</a>
<a id='n800' href='#n800'>800</a>
<a id='n801' href='#n801'>801</a>
<a id='n802' href='#n802'>802</a>
<a id='n803' href='#n803'>803</a>
<a id='n804' href='#n804'>804</a>
<a id='n805' href='#n805'>805</a>
<a id='n806' href='#n806'>806</a>
<a id='n807' href='#n807'>807</a>
<a id='n808' href='#n808'>808</a>
<a id='n809' href='#n809'>809</a>
<a id='n810' href='#n810'>810</a>
<a id='n811' href='#n811'>811</a>
<a id='n812' href='#n812'>812</a>
<a id='n813' href='#n813'>813</a>
<a id='n814' href='#n814'>814</a>
<a id='n815' href='#n815'>815</a>
<a id='n816' href='#n816'>816</a>
<a id='n817' href='#n817'>817</a>
<a id='n818' href='#n818'>818</a>
<a id='n819' href='#n819'>819</a>
<a id='n820' href='#n820'>820</a>
<a id='n821' href='#n821'>821</a>
<a id='n822' href='#n822'>822</a>
<a id='n823' href='#n823'>823</a>
<a id='n824' href='#n824'>824</a>
<a id='n825' href='#n825'>825</a>
<a id='n826' href='#n826'>826</a>
<a id='n827' href='#n827'>827</a>
<a id='n828' href='#n828'>828</a>
<a id='n829' href='#n829'>829</a>
<a id='n830' href='#n830'>830</a>
<a id='n831' href='#n831'>831</a>
<a id='n832' href='#n832'>832</a>
<a id='n833' href='#n833'>833</a>
<a id='n834' href='#n834'>834</a>
<a id='n835' href='#n835'>835</a>
<a id='n836' href='#n836'>836</a>
<a id='n837' href='#n837'>837</a>
<a id='n838' href='#n838'>838</a>
<a id='n839' href='#n839'>839</a>
<a id='n840' href='#n840'>840</a>
<a id='n841' href='#n841'>841</a>
<a id='n842' href='#n842'>842</a>
<a id='n843' href='#n843'>843</a>
<a id='n844' href='#n844'>844</a>
<a id='n845' href='#n845'>845</a>
<a id='n846' href='#n846'>846</a>
<a id='n847' href='#n847'>847</a>
<a id='n848' href='#n848'>848</a>
<a id='n849' href='#n849'>849</a>
<a id='n850' href='#n850'>850</a>
<a id='n851' href='#n851'>851</a>
<a id='n852' href='#n852'>852</a>
<a id='n853' href='#n853'>853</a>
<a id='n854' href='#n854'>854</a>
<a id='n855' href='#n855'>855</a>
<a id='n856' href='#n856'>856</a>
<a id='n857' href='#n857'>857</a>
<a id='n858' href='#n858'>858</a>
<a id='n859' href='#n859'>859</a>
<a id='n860' href='#n860'>860</a>
<a id='n861' href='#n861'>861</a>
<a id='n862' href='#n862'>862</a>
<a id='n863' href='#n863'>863</a>
<a id='n864' href='#n864'>864</a>
<a id='n865' href='#n865'>865</a>
<a id='n866' href='#n866'>866</a>
<a id='n867' href='#n867'>867</a>
<a id='n868' href='#n868'>868</a>
<a id='n869' href='#n869'>869</a>
<a id='n870' href='#n870'>870</a>
<a id='n871' href='#n871'>871</a>
<a id='n872' href='#n872'>872</a>
<a id='n873' href='#n873'>873</a>
<a id='n874' href='#n874'>874</a>
<a id='n875' href='#n875'>875</a>
<a id='n876' href='#n876'>876</a>
<a id='n877' href='#n877'>877</a>
<a id='n878' href='#n878'>878</a>
<a id='n879' href='#n879'>879</a>
<a id='n880' href='#n880'>880</a>
<a id='n881' href='#n881'>881</a>
<a id='n882' href='#n882'>882</a>
<a id='n883' href='#n883'>883</a>
<a id='n884' href='#n884'>884</a>
<a id='n885' href='#n885'>885</a>
<a id='n886' href='#n886'>886</a>
<a id='n887' href='#n887'>887</a>
<a id='n888' href='#n888'>888</a>
<a id='n889' href='#n889'>889</a>
<a id='n890' href='#n890'>890</a>
<a id='n891' href='#n891'>891</a>
<a id='n892' href='#n892'>892</a>
<a id='n893' href='#n893'>893</a>
<a id='n894' href='#n894'>894</a>
<a id='n895' href='#n895'>895</a>
<a id='n896' href='#n896'>896</a>
</pre></td>
<td class='lines'><pre><code><style>pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */</style><div class="highlight"><pre><span></span><span class="k">\section</span><span class="nb">{</span>Yosys by example -- Advanced Synthesis<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>
<span class="k">\sectionpage</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}{</span>Overview<span class="nb">}</span>
This section contains 4 subsections:
<span class="k">\begin</span><span class="nb">{</span>itemize<span class="nb">}</span>
<span class="k">\item</span> Using selections
<span class="k">\item</span> Advanced uses of techmap
<span class="k">\item</span> Coarse-grain synthesis
<span class="k">\item</span> Automatic design changes
<span class="k">\end</span><span class="nb">{</span>itemize<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="c">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>

<span class="k">\subsection</span><span class="nb">{</span>Using selections<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>
<span class="k">\subsectionpage</span>
<span class="k">\subsectionpagesuffix</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\subsubsection</span><span class="nb">{</span>Simple selections<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[fragile]<span class="nb">{</span><span class="k">\subsubsecname</span><span class="nb">}</span>
Most Yosys commands make use of the ``selection framework&#39;&#39; of Yosys. It can be used
to apply commands only to part of the design. For example:

<span class="k">\medskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
delete                # will delete the whole design, but

delete foobar         # will only delete the module foobar.
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>

<span class="k">\bigskip</span>
The <span class="nb">{</span><span class="k">\tt</span> select<span class="nb">}</span> command can be used to create a selection for subsequent
commands. For example:

<span class="k">\medskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
select foobar         # select the module foobar
delete                # delete selected objects
select -clear         # reset selection (select whole design)
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\subsubsection</span><span class="nb">{</span>Selection by object name<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[fragile]<span class="nb">{</span><span class="k">\subsubsecname</span><span class="nb">}</span>
The easiest way to select objects is by object name. This is usually only done
in synthesis scripts that are hand-tailored for a specific design.

<span class="k">\bigskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
select foobar         # select module foobar
select foo*           # select all modules whose names start with foo
select foo*/bar*      # select all objects matching bar* from modules matching foo*
select */clk          # select objects named clk from all modules
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\subsubsection</span><span class="nb">{</span>Module and design context<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[fragile]<span class="nb">{</span><span class="k">\subsubsecname</span><span class="nb">}</span>
Commands can be executed in <span class="nb">{</span><span class="k">\it</span> module<span class="k">\/</span><span class="nb">}</span> or <span class="nb">{</span><span class="k">\it</span> design<span class="k">\/</span><span class="nb">}</span> context. Until now all
commands have been executed in design context. The <span class="nb">{</span><span class="k">\tt</span> cd<span class="nb">}</span> command can be used
to switch to module context.

<span class="k">\bigskip</span>
In module context all commands only effect the active module. Objects in the module
are selected without the <span class="nb">{</span><span class="k">\tt</span> &lt;module<span class="k">\_</span>name&gt;/<span class="nb">}</span> prefix. For example:

<span class="k">\bigskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
cd foo                # switch to module foo
delete bar            # delete object foo/bar

cd mycpu              # switch to module mycpu
dump reg<span class="nb">_</span>*            # print details on all objects whose names start with reg<span class="nb">_</span>

cd ..                 # switch back to design
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>

<span class="k">\bigskip</span>
Note: Most synthesis scripts never switch to module context. But it is a very powerful
tool for interactive design investigation.
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\subsubsection</span><span class="nb">{</span>Selecting by object property or type<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[fragile]<span class="nb">{</span><span class="k">\subsubsecname</span><span class="nb">}</span>
Special patterns can be used to select by object property or type. For example:

<span class="k">\bigskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
select w:reg<span class="nb">_</span>*        # select all wires whose names start with reg<span class="nb">_</span>
select a:foobar       # select all objects with the attribute foobar set
select a:foobar=42    # select all objects with the attribute foobar set to 42
select A:blabla       # select all modules with the attribute blabla set
select foo/t:<span class="s">$</span><span class="nb">add     # select all </span><span class="s">$</span>add cells from the module foo
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>

<span class="k">\bigskip</span>
A complete list of this pattern expressions can be found in the command
reference to the <span class="nb">{</span><span class="k">\tt</span> select<span class="nb">}</span> command.
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\subsubsection</span><span class="nb">{</span>Combining selection<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[fragile]<span class="nb">{</span><span class="k">\subsubsecname</span><span class="nb">}</span>
When more than one selection expression is used in one statement, then they are
pushed on a stack. The final elements on the stack are combined into a union:

<span class="k">\medskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
select t:<span class="s">$</span><span class="nb">dff r:WIDTH&gt;</span><span class="m">1</span><span class="nb">     # all cells of type </span><span class="s">$</span>dff and/or with a parameter WIDTH &gt; 1
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>

<span class="k">\bigskip</span>
Special <span class="k">\%</span>-commands can be used to combine the elements on the stack:

<span class="k">\medskip</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[xleftmargin=0.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
select t:<span class="s">$</span><span class="nb">dff r:WIDTH&gt;</span><span class="m">1</span><span class="nb"> </span><span class="c">%i  # all cells of type $dff *AND* with a parameter WIDTH &gt; 1</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{block}{Examples for {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">}</span><span class="o">-</span><span class="nb">codes </span><span class="o">(</span><span class="nb">see {</span><span class="nv">\tt</span><span class="nb"> help select} for full list</span><span class="o">)</span><span class="nb">}</span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">u} </span><span class="nv">\dotfill</span><span class="nb"> union of top two elements on stack </span><span class="o">--</span><span class="nb"> pop </span><span class="m">2</span><span class="nb">, push </span><span class="m">1</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">d} </span><span class="nv">\dotfill</span><span class="nb"> difference of top two elements on stack </span><span class="o">--</span><span class="nb"> pop </span><span class="m">2</span><span class="nb">, push </span><span class="m">1</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">i} </span><span class="nv">\dotfill</span><span class="nb"> intersection of top two elements on stack </span><span class="o">--</span><span class="nb"> pop </span><span class="m">2</span><span class="nb">, push </span><span class="m">1</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">n} </span><span class="nv">\dotfill</span><span class="nb"> inverse of top element on stack </span><span class="o">--</span><span class="nb"> pop </span><span class="m">1</span><span class="nb">, push </span><span class="m">1</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{block}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Expanding selections}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nb">Selections of cells and wires can be expanded along connections using {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">}</span><span class="o">-</span><span class="nb">codes</span>
<span class="nb">for selecting input cones </span><span class="o">(</span><span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">ci}</span><span class="o">)</span><span class="nb">, output cones </span><span class="o">(</span><span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">co}</span><span class="o">)</span><span class="nb">, or both </span><span class="o">(</span><span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">x}</span><span class="o">)</span><span class="nb">.</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb"># select all wires that are inputs to </span><span class="s">$</span>add cells
select t:<span class="s">$</span><span class="nb">add </span><span class="c">%ci w:* %i</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">Additional constraints such as port names can be specified.</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb"># select all wires that connect a &quot;Q&quot; output with a &quot;D&quot; input</span>
<span class="nb">select c:</span><span class="o">*</span><span class="nb"> </span><span class="c">%co:+[Q] w:* %i c:* %ci:+[D] w:* %i %i</span>

<span class="nb"># select the multiplexer tree that drives the signal &#39;state&#39;</span>
<span class="nb">select state </span><span class="c">%ci*:+$mux,$pmux[A,B,Y]</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">See {</span><span class="nv">\tt</span><span class="nb"> help select} for full documentation of this expressions.</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Incremental selection}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nb">Sometimes a selection can most easily be described by a series of add</span><span class="o">/</span><span class="nb">delete operations.</span>
<span class="nb">The commands {</span><span class="nv">\tt</span><span class="nb"> select </span><span class="o">-</span><span class="nb">add} and {</span><span class="nv">\tt</span><span class="nb"> select </span><span class="o">-</span><span class="nb">del} respectively add or remove objects</span>
<span class="nb">from the current selection instead of overwriting it.</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">select </span><span class="o">-</span><span class="nb">none            # start with an empty selection</span>
<span class="nb">select </span><span class="o">-</span><span class="nb">add reg_</span><span class="o">*</span><span class="nb">       # select a bunch of objects</span>
<span class="nb">select </span><span class="o">-</span><span class="nb">del reg_</span><span class="m">42</span><span class="nb">      # but not this one</span>
<span class="nb">select </span><span class="o">-</span><span class="nb">add state </span><span class="c">%ci   # and add mor stuff</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">Within a select expression the token {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\%</span><span class="nb">} can be used to push the previous selection</span>
<span class="nb">on the stack.</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">select t:</span><span class="s">$</span>add t:<span class="s">$</span><span class="nb">sub    # select all </span><span class="s">$</span>add and <span class="s">$</span><span class="nb">sub cells</span>
<span class="nb">select </span><span class="c">% %ci % %d       # select only the input wires to those cells</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Creating selection variables}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nb">Selections can be stored under a name with the {</span><span class="nv">\tt</span><span class="nb"> select </span><span class="o">-</span><span class="nb">set &lt;name&gt;}</span>
<span class="nb">command. The stored selections can be used in later select expressions</span>
<span class="nb">using the syntax {</span><span class="nv">\tt</span><span class="nb"> @&lt;name&gt;}.</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">select </span><span class="o">-</span><span class="nb">set cone_a state_a </span><span class="c">%ci*:-$dff  # set @cone_a to the input cone of state_a</span>
<span class="nb">select </span><span class="o">-</span><span class="nb">set cone_b state_b </span><span class="c">%ci*:-$dff  # set @cone_b to the input cone of state_b</span>
<span class="nb">select @cone_a @cone_b </span><span class="c">%i              # select the objects that are in both cones</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">Remember that select expressions can also be used directly as arguments to most</span>
<span class="nb">commands. Some commands also except a single select argument to some options.</span>
<span class="nb">In those cases selection variables must be used to capture more complex selections.</span>

<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">dump @cone_a @cone_b</span>

<span class="nb">select </span><span class="o">-</span><span class="nb">set cone_ab @cone_a @cone_b </span><span class="c">%i</span>
<span class="nb">show </span><span class="o">-</span><span class="nb">color red @cone_ab </span><span class="o">-</span><span class="nb">color magenta @cone_a </span><span class="o">-</span><span class="nb">color blue @cone_b</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example}</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">6</span><span class="nb">pt}{</span><span class="m">7</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">select.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">7</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys, frame</span><span class="o">=</span><span class="nb">single</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">select.ys}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\hfil\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="nv">\linewidth</span><span class="nb">,trim</span><span class="o">=</span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm </span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">select.pdf}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="c">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>

<span class="nv">\subsection</span><span class="nb">{Advanced uses of techmap}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span>
<span class="nv">\subsectionpage</span><span class="nb"></span>
<span class="nv">\subsectionpagesuffix</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Introduction to techmap}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"></span>
<span class="nb">The {</span><span class="nv">\tt</span><span class="nb"> techmap} command replaces cells in the design with implementations given</span>
<span class="nb">as Verilog code </span><span class="o">(</span><span class="nb">called ``map files&#39;&#39;</span><span class="o">)</span><span class="nb">. It can replace Yosys&#39; internal cell</span>
<span class="nb">types </span><span class="o">(</span><span class="nb">such as {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\$</span><span class="nb">or}</span><span class="o">)</span><span class="nb"> as well as user</span><span class="o">-</span><span class="nb">defined cell types.</span>
<span class="nv">\medskip\item</span><span class="nb"></span>
<span class="nb">Verilog parameters are used extensively to customize the internal cell types.</span>
<span class="nv">\medskip\item</span><span class="nb"></span>
<span class="nb">Additional special parameters are used by techmap to communicate meta</span><span class="o">-</span><span class="nb">data to the</span>
<span class="nb">map files.</span>
<span class="nv">\medskip\item</span><span class="nb"></span>
<span class="nb">Special wires are used to instruct techmap how to handle a module in the map file.</span>
<span class="nv">\medskip\item</span><span class="nb"></span>
<span class="nb">Generate blocks and recursion are powerful tools for writing map files.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example </span><span class="m">1</span><span class="o">/</span><span class="m">2</span><span class="nb">}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nb">To map the Verilog OR</span><span class="o">-</span><span class="nb">reduction operator to </span><span class="m">3</span><span class="o">-</span><span class="nb">input OR gates:</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">0</span><span class="nb">.</span><span class="m">35</span><span class="nv">\linewidth</span><span class="nb">}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, lastline</span><span class="o">=</span><span class="m">24</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">red_or</span><span class="m">3</span><span class="nb">x</span><span class="m">1</span><span class="nb">_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">0</span><span class="nb">.</span><span class="m">65</span><span class="nv">\linewidth</span><span class="nb">}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">25</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">red_or</span><span class="m">3</span><span class="nb">x</span><span class="m">1</span><span class="nb">_map.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example </span><span class="m">2</span><span class="o">/</span><span class="m">2</span><span class="nb">}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\hfil\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">10</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm </span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">red_or</span><span class="m">3</span><span class="nb">x</span><span class="m">1</span><span class="nb">.pdf}</span>
<span class="nv">\vss</span><span class="nb"></span>
<span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys, firstline</span><span class="o">=</span><span class="m">4</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">4</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">red_or</span><span class="m">3</span><span class="nb">x</span><span class="m">1</span><span class="nb">_test.ys}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">red_or</span><span class="m">3</span><span class="nb">x</span><span class="m">1</span><span class="nb">_test.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Conditional techmap}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> In some cases only cells with certain properties should be substituted.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> The special wire {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">FAIL</span><span class="nv">\_</span><span class="nb">} can be used to disable a module</span>
<span class="nb">in the map file for a certain set of parameters.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> The wire {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">FAIL</span><span class="nv">\_</span><span class="nb">} must be set to a constant value. If it</span>
<span class="nb">is non</span><span class="o">-</span><span class="nb">zero then the module is disabled for this set of parameters.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Example use</span><span class="o">-</span><span class="nb">cases:</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> coarse</span><span class="o">-</span><span class="nb">grain cell types that only operate on certain bit widths</span>
<span class="nv">\item</span><span class="nb"> memory resources for different memory geometries </span><span class="o">(</span><span class="nb">width, depth, ports, etc.</span><span class="o">)</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span>
<span class="nv">\hfill\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">6</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm </span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">sym_mul.pdf}</span>
<span class="nv">\vss</span><span class="nb"></span>
<span class="nb">}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">sym_mul_map.v}</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">sym_mul_test.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">ys, lastline</span><span class="o">=</span><span class="m">4</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">sym_mul_test.ys}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Scripting in map modules}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> The special wires {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">DO</span><span class="nv">\_</span><span class="o">*</span><span class="nb">} can be used to run Yosys scripts</span>
<span class="nb">in the context of the replacement module.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> The wire that comes first in alphabetical oder is interpreted as string </span><span class="o">(</span><span class="nb">must</span>
<span class="nb">be connected to constants</span><span class="o">)</span><span class="nb"> that is executed as script. Then the wire is removed. Repeat.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> You can even call techmap recursively</span><span class="o">!</span><span class="nb"></span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Example use</span><span class="o">-</span><span class="nb">cases:</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> Using always blocks in map module: call {</span><span class="nv">\tt</span><span class="nb"> proc}</span>
<span class="nv">\item</span><span class="nb"> Perform expensive optimizations </span><span class="o">(</span><span class="nb">such as {</span><span class="nv">\tt</span><span class="nb"> freduce}</span><span class="o">)</span><span class="nb"> on cells where</span>
<span class="nb">this is known to work well.</span>
<span class="nv">\item</span><span class="nb"> Interacting with custom commands.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>

<span class="nv">\scriptsize</span><span class="nb"></span>
<span class="nb">PROTIP: Commands such as {</span><span class="nv">\tt</span><span class="nb"> shell}, {</span><span class="nv">\tt</span><span class="nb"> show </span><span class="o">-</span><span class="nb">pause}, and {</span><span class="nv">\tt</span><span class="nb"> dump} can be use</span>
<span class="nb">in the {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">DO</span><span class="nv">\_</span><span class="o">*</span><span class="nb">} scripts for debugging map modules.</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\vskip</span><span class="m">4</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\hskip</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">10</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm </span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mymul.pdf}</span>
<span class="nv">\vss</span><span class="nb"></span>
<span class="nb">}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mymul_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mymul_test.v}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">ys, lastline</span><span class="o">=</span><span class="m">5</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mymul_test.ys}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">ys, firstline</span><span class="o">=</span><span class="m">7</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">12</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mymul_test.ys}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Handling constant inputs}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> The special parameters {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">CONSTMSK</span><span class="nv">\_\it</span><span class="nb"> &lt;port</span><span class="o">-</span><span class="nb">name&gt;</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">} and</span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">CONSTVAL</span><span class="nv">\_\it</span><span class="nb"> &lt;port</span><span class="o">-</span><span class="nb">name&gt;</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">} can be used to handle constant</span>
<span class="nb">input values to cells.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> The former contains </span><span class="m">1</span><span class="o">-</span><span class="nb">bits for all constant input bits on the port.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> The latter contains the constant bits or undef </span><span class="o">(</span><span class="nb">x</span><span class="o">)</span><span class="nb"> for non</span><span class="o">-</span><span class="nb">constant bits.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Example use</span><span class="o">-</span><span class="nb">cases:</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> Converting arithmetic </span><span class="o">(</span><span class="nb">for example multiply to shift</span><span class="o">)</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Identify constant addresses or enable bits in memory interfaces.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\vskip</span><span class="m">5</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\hskip</span><span class="m">6</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm </span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mulshift.pdf}</span>
<span class="nv">\vss</span><span class="nb"></span>
<span class="nb">}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">4</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mulshift_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mulshift_test.v}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">ys, lastline</span><span class="o">=</span><span class="m">5</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">mulshift_test.ys}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Handling shorted inputs}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> The special parameters {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">BITS</span><span class="nv">\_</span><span class="nb">CONNMAP</span><span class="nv">\_</span><span class="nb">} and</span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">CONNMAP</span><span class="nv">\_\it</span><span class="nb"> &lt;port</span><span class="o">-</span><span class="nb">name&gt;</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">} can be used to handle shorted inputs.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Each bit of the port correlates to an {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">BITS</span><span class="nv">\_</span><span class="nb">CONNMAP</span><span class="nv">\_</span><span class="nb">} bits wide</span>
<span class="nb">number in {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">CONNMAP</span><span class="nv">\_\it</span><span class="nb"> &lt;port</span><span class="o">-</span><span class="nb">name&gt;</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">}.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Each unique signal bit is assigned its own number. Identical fields in the {</span><span class="nv">\tt</span><span class="nb"></span>
<span class="nv">\_</span><span class="nb">TECHMAP</span><span class="nv">\_</span><span class="nb">CONNMAP</span><span class="nv">\_\it</span><span class="nb"> &lt;port</span><span class="o">-</span><span class="nb">name&gt;</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\_</span><span class="nb">} parameters mean shorted signal bits.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> The numbers </span><span class="m">0</span><span class="o">-</span><span class="m">3</span><span class="nb"> are reserved for {</span><span class="nv">\tt</span><span class="nb"> </span><span class="m">0</span><span class="nb">}, {</span><span class="nv">\tt</span><span class="nb"> </span><span class="m">1</span><span class="nb">}, {</span><span class="nv">\tt</span><span class="nb"> x}, and {</span><span class="nv">\tt</span><span class="nb"> z} respectively.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Example use</span><span class="o">-</span><span class="nb">cases:</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> Detecting shared clock or control signals in memory interfaces.</span>
<span class="nv">\item</span><span class="nb"> In some cases this can be used for for optimization.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\vskip</span><span class="m">4</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span>
<span class="nv">\hskip</span><span class="m">6</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm </span><span class="m">0</span><span class="nb"> </span><span class="m">0</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">addshift.pdf}</span>
<span class="nv">\vss</span><span class="nb"></span>
<span class="nb">}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">4</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">addshift_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">6</span><span class="nb">cm</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">addshift_test.v}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">ys, lastline</span><span class="o">=</span><span class="m">5</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">addshift_test.ys}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Notes on using techmap}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> Don&#39;t use positional cell parameters in map modules.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Don&#39;t try to implement basic logic optimization with techmap. </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">{</span><span class="nv">\small</span><span class="nb"> </span><span class="o">(</span><span class="nb">So the OR</span><span class="o">-</span><span class="nb">reduce using OR</span><span class="m">3</span><span class="nb">X</span><span class="m">1</span><span class="nb"> cells map was actually a bad example.</span><span class="o">)</span><span class="nb">}</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> You can use the {</span><span class="nv">\tt</span><span class="nb"> </span><span class="nv">\$\_\,\_</span><span class="nb">}</span><span class="o">-</span><span class="nb">prefix for internal cell types to avoid</span>
<span class="nb">collisions with the user</span><span class="o">-</span><span class="nb">namespace. But always use two underscores or the</span>
<span class="nb">internal consistency checker will trigger on this cells.</span>
<span class="nv">\medskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Techmap has two major use cases:</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> Creating good logic</span><span class="o">-</span><span class="nb">level representation of arithmetic functions. </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">This also means using dedicated hardware resources such as half</span><span class="o">-</span><span class="nb"> and full</span><span class="o">-</span><span class="nb">adder</span>
<span class="nb">cells in ASICS or dedicated carry logic in FPGAs.</span>
<span class="nv">\smallskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> Mapping of coarse</span><span class="o">-</span><span class="nb">grain resources such as block memory or DSP cells.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="c">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>

<span class="nv">\subsection</span><span class="nb">{Coarse</span><span class="o">-</span><span class="nb">grain synthesis}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span>
<span class="nv">\subsectionpage</span><span class="nb"></span>
<span class="nv">\subsectionpagesuffix</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Intro to coarse</span><span class="o">-</span><span class="nb">grain synthesis}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nb">In coarse</span><span class="o">-</span><span class="nb">grain synthesis the target architecture has cells of the same</span>
<span class="nb">complexity or larger complexity than the internal RTL representation.</span>

<span class="nb">For example:</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb"></span>
<span class="nb">	wire </span><span class="o">[</span><span class="m">15</span><span class="nb">:</span><span class="m">0</span><span class="o">]</span><span class="nb"> a, b;</span>
<span class="nb">	wire </span><span class="o">[</span><span class="m">31</span><span class="nb">:</span><span class="m">0</span><span class="o">]</span><span class="nb"> c, y;</span>
<span class="nb">	assign y </span><span class="o">=</span><span class="nb"> a </span><span class="o">*</span><span class="nb"> b </span><span class="o">+</span><span class="nb"> c;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>

<span class="nb">This circuit contains two cells in the RTL representation: one multiplier and</span>
<span class="nb">one adder. In some architectures this circuit can be implemented using</span>
<span class="nb">a single circuit element, for example an FPGA DSP core. Coarse grain synthesis</span>
<span class="nb">is this mapping of groups of circuit elements to larger components.</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">Fine</span><span class="o">-</span><span class="nb">grain synthesis would be matching the circuit elements to smaller</span>
<span class="nb">components, such as LUTs, gates, or half</span><span class="o">-</span><span class="nb"> and full</span><span class="o">-</span><span class="nb">adders.</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{The extract pass}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> Like the {</span><span class="nv">\tt</span><span class="nb"> techmap} pass, the {</span><span class="nv">\tt</span><span class="nb"> extract} pass is called with</span>
<span class="nb">a map file. It compares the circuits inside the modules of the map file</span>
<span class="nb">with the design and looks for sub</span><span class="o">-</span><span class="nb">circuits in the design that match any</span>
<span class="nb">of the modules in the map file.</span>
<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> If a match is found, the {</span><span class="nv">\tt</span><span class="nb"> extract} pass will replace the matching</span>
<span class="nb">subcircuit with an instance of the module from the map file.</span>
<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nv">\item</span><span class="nb"> In a way the {</span><span class="nv">\tt</span><span class="nb"> extract} pass is the inverse of the techmap pass.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example </span><span class="m">1</span><span class="o">/</span><span class="m">2</span><span class="nb">}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\vskip</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{tikzpicture}</span>
<span class="nb">    </span><span class="nv">\node</span><span class="nb"> at </span><span class="o">(</span><span class="m">0</span><span class="nb">,</span><span class="m">0</span><span class="o">)</span><span class="nb"> {</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">00</span><span class="nb">a.pdf}};</span>
<span class="nb">    </span><span class="nv">\node</span><span class="nb"> at </span><span class="o">(</span><span class="m">3</span><span class="nb">,</span><span class="o">-</span><span class="m">3</span><span class="o">)</span><span class="nb"> {</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">8</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">00</span><span class="nb">b.pdf}};</span>
<span class="nb">    </span><span class="nv">\draw</span><span class="o">[</span><span class="nb">yshift</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm,thick,</span><span class="o">-</span><span class="nb">latex</span><span class="o">]</span><span class="nb"> </span><span class="o">(</span><span class="m">1</span><span class="nb">,</span><span class="o">-</span><span class="m">1</span><span class="o">)</span><span class="nb"> </span><span class="o">--</span><span class="nb"> </span><span class="o">(</span><span class="m">2</span><span class="nb">,</span><span class="o">-</span><span class="m">2</span><span class="o">)</span><span class="nb">;</span>
<span class="nv">\end</span><span class="nb">{tikzpicture}</span>
<span class="nv">\vss</span><span class="nb">}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">1</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_xmap.v}</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, frame</span><span class="o">=</span><span class="nb">single, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">read_verilog macc_simple_test.v</span>
<span class="nb">hierarchy </span><span class="o">-</span><span class="nb">check </span><span class="o">-</span><span class="nb">top test</span>

<span class="nb">extract </span><span class="o">-</span><span class="nb">map macc_simple_xmap.v;;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> Example </span><span class="m">2</span><span class="o">/</span><span class="m">2</span><span class="nb">}</span>
<span class="nv">\hfil\begin</span><span class="nb">{tabular}{cc}</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\hbox</span><span class="nb"> to </span><span class="m">5</span><span class="nb">cm {</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">01</span><span class="nb">.v}}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\hbox</span><span class="nb"> to </span><span class="m">5</span><span class="nb">cm {</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">02</span><span class="nb">.v}}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> &amp; </span><span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">01</span><span class="nb">a.pdf}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">02</span><span class="nb">a.pdf}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> &amp; </span><span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">01</span><span class="nb">b.pdf}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_simple_test_</span><span class="m">02</span><span class="nb">b.pdf}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{tabular}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{The wrap</span><span class="o">-</span><span class="nb">extract</span><span class="o">-</span><span class="nb">unwrap method}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nv">\scriptsize</span><span class="nb"></span>
<span class="nb">Often a coarse</span><span class="o">-</span><span class="nb">grain element has a constant bit</span><span class="o">-</span><span class="nb">width, but can be used to</span>
<span class="nb">implement operations with a smaller bit</span><span class="o">-</span><span class="nb">width. For example, a </span><span class="m">18</span><span class="nb">x</span><span class="m">25</span><span class="o">-</span><span class="nb">bit multiplier</span>
<span class="nb">can also be used to implement </span><span class="m">16</span><span class="nb">x</span><span class="m">20</span><span class="o">-</span><span class="nb">bit multiplication.</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">A way of mapping such elements in coarse grain synthesis is the wrap</span><span class="o">-</span><span class="nb">extract</span><span class="o">-</span><span class="nb">unwrap method:</span>

<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> {</span><span class="nv">\bf</span><span class="nb"> wrap} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">Identify candidate</span><span class="o">-</span><span class="nb">cells in the circuit and wrap them in a cell with a constant</span>
<span class="nb">wider bit</span><span class="o">-</span><span class="nb">width using {</span><span class="nv">\tt</span><span class="nb"> techmap}. The wrappers use the same parameters as the original cell, so</span>
<span class="nb">the information about the original width of the ports is preserved. </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">Then use the {</span><span class="nv">\tt</span><span class="nb"> connwrappers} command to connect up the bit</span><span class="o">-</span><span class="nb">extended in</span><span class="o">-</span><span class="nb"> and</span>
<span class="nb">outputs of the wrapper cells.</span>
<span class="nv">\item</span><span class="nb"> {</span><span class="nv">\bf</span><span class="nb"> extract} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">Now all operations are encoded using the same bit</span><span class="o">-</span><span class="nb">width as the coarse grain element. The {</span><span class="nv">\tt</span><span class="nb"></span>
<span class="nb">extract} command can be used to replace circuits with cells of the target architecture.</span>
<span class="nv">\item</span><span class="nb"> {</span><span class="nv">\bf</span><span class="nb"> unwrap} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">The remaining wrapper cell can be unwrapped using {</span><span class="nv">\tt</span><span class="nb"> techmap}.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>

<span class="nv">\bigskip</span><span class="nb"></span>
<span class="nb">The following sides detail an example that shows how to map MACC operations of</span>
<span class="nb">arbitrary size to MACC cells with a </span><span class="m">18</span><span class="nb">x</span><span class="m">25</span><span class="o">-</span><span class="nb">bit multiplier and a </span><span class="m">48</span><span class="o">-</span><span class="nb">bit adder </span><span class="o">(</span><span class="nb">such as</span>
<span class="nb">the Xilinx DSP</span><span class="m">48</span><span class="nb"> cells</span><span class="o">)</span><span class="nb">.</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Example: DSP</span><span class="m">48</span><span class="nv">\_</span><span class="nb">MACC}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">1</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Preconditioning: {</span><span class="nv">\tt</span><span class="nb"> macc</span><span class="nv">\_</span><span class="nb">xilinx</span><span class="nv">\_</span><span class="nb">swap</span><span class="nv">\_</span><span class="nb">map.v} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">Make sure {</span><span class="nv">\tt</span><span class="nb"> A} is the smaller port on all multipliers</span>

<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, lastline</span><span class="o">=</span><span class="m">15</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_swap_map.v}</span>
<span class="nv">\column</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">16</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_swap_map.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">2</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Wrapping multipliers: {</span><span class="nv">\tt</span><span class="nb"> macc</span><span class="nv">\_</span><span class="nb">xilinx</span><span class="nv">\_</span><span class="nb">wrap</span><span class="nv">\_</span><span class="nb">map.v}</span>

<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, lastline</span><span class="o">=</span><span class="m">23</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_wrap_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">24</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">46</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_wrap_map.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">3</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Wrapping adders: {</span><span class="nv">\tt</span><span class="nb"> macc</span><span class="nv">\_</span><span class="nb">xilinx</span><span class="nv">\_</span><span class="nb">wrap</span><span class="nv">\_</span><span class="nb">map.v}</span>

<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">48</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">67</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_wrap_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">68</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">89</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_wrap_map.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">4</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Extract: {</span><span class="nv">\tt</span><span class="nb"> macc</span><span class="nv">\_</span><span class="nb">xilinx</span><span class="nv">\_</span><span class="nb">xmap.v}</span>

<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">xleftmargin</span><span class="o">=</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">1</span><span class="nb">,  lastline</span><span class="o">=</span><span class="m">17</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_xmap.v}</span>

<span class="nb">.. simply use the same wrapping commands on this module as on the design to create a template for the {</span><span class="nv">\tt</span><span class="nb"> extract} command.</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">5</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Unwrapping multipliers: {</span><span class="nv">\tt</span><span class="nb"> macc</span><span class="nv">\_</span><span class="nb">xilinx</span><span class="nv">\_</span><span class="nb">unwrap</span><span class="nv">\_</span><span class="nb">map.v}</span>

<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">1</span><span class="nb">,  lastline</span><span class="o">=</span><span class="m">17</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_unwrap_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">18</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">30</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_unwrap_map.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">6</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Unwrapping adders: {</span><span class="nv">\tt</span><span class="nb"> macc</span><span class="nv">\_</span><span class="nb">xilinx</span><span class="nv">\_</span><span class="nb">unwrap</span><span class="nv">\_</span><span class="nb">map.v}</span>

<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">32</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">48</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_unwrap_map.v}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">7</span><span class="nb">pt}{</span><span class="m">8</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog, firstline</span><span class="o">=</span><span class="m">49</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">61</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_unwrap_map.v}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">7</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nv">\hfil\begin</span><span class="nb">{tabular}{cc}</span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">1</span><span class="nb">} &amp; {</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">2</span><span class="nb">} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\hbox</span><span class="nb"> to </span><span class="m">5</span><span class="nb">cm {</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, firstline</span><span class="o">=</span><span class="m">1</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">6</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test.v}}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\hbox</span><span class="nb"> to </span><span class="m">5</span><span class="nb">cm {</span><span class="nv">\lstinputlisting</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, firstline</span><span class="o">=</span><span class="m">8</span><span class="nb">, lastline</span><span class="o">=</span><span class="m">13</span><span class="nb">, language</span><span class="o">=</span><span class="nb">verilog</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test.v}}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> &amp; </span><span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{tabular}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">                            read_verilog macc_xilinx_test.v</span>
<span class="nb">                            hierarchy </span><span class="o">-</span><span class="nb">check</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span>
<span class="nv">\hfil\begin</span><span class="nb">{tabular}{cc}</span>
<span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> &amp; </span><span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">1</span><span class="nb">a.pdf}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">a.pdf}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{tabular}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">8</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nv">\hfil\begin</span><span class="nb">{tabular}{cc}</span>
<span class="nb">{</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">1</span><span class="nb">} &amp; {</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">2</span><span class="nb">} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">1</span><span class="nb">a.pdf}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">a.pdf}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> &amp; </span><span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{tabular}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">                         techmap </span><span class="o">-</span><span class="nb">map macc_xilinx_swap_map.v ;;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\hfil\begin</span><span class="nb">{tabular}{cc}</span>
<span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> &amp; </span><span class="s">$</span><span class="k">\downarrow</span><span class="s">$</span><span class="nb"> </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">1</span><span class="nb">b.pdf}} &amp;</span>
<span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">b.pdf}} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{tabular}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">9</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Wrapping in {</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">1</span><span class="nb">}:</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span><span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">4</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">1</span><span class="nb">b.pdf}}</span><span class="nv">\vss</span><span class="nb">}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">techmap </span><span class="o">-</span><span class="nb">map macc_xilinx_wrap_map.v</span>

<span class="nb">connwrappers </span><span class="o">-</span><span class="nb">unsigned </span><span class="s">$</span><span class="nb">__</span>mul<span class="nb">_</span>wrapper <span class="k">\</span>
                            Y Y<span class="nb">_</span>WIDTH <span class="k">\</span>
             -unsigned <span class="s">$</span><span class="nb">__add_wrapper </span><span class="err">\</span><span class="nb"></span>
<span class="nb">                            Y Y_WIDTH ;;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>

<span class="nv">\vskip</span><span class="m">1</span><span class="nb">cm</span>
<span class="nv">\hfil\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="nv">\linewidth</span><span class="nb">,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">1</span><span class="nb">c.pdf}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">10</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Wrapping in {</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">2</span><span class="nb">}:</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span><span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">4</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">b.pdf}}</span><span class="nv">\vss</span><span class="nb">}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">techmap </span><span class="o">-</span><span class="nb">map macc_xilinx_wrap_map.v</span>

<span class="nb">connwrappers </span><span class="o">-</span><span class="nb">unsigned </span><span class="s">$</span><span class="nb">__</span>mul<span class="nb">_</span>wrapper <span class="k">\</span>
                            Y Y<span class="nb">_</span>WIDTH <span class="k">\</span>
             -unsigned <span class="s">$</span><span class="nb">__add_wrapper </span><span class="err">\</span><span class="nb"></span>
<span class="nb">                            Y Y_WIDTH ;;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>

<span class="nv">\vskip</span><span class="m">1</span><span class="nb">cm</span>
<span class="nv">\hfil\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="nv">\linewidth</span><span class="nb">,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">c.pdf}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">11</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Extract in {</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">1</span><span class="nb">}:</span>
<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">4</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">design </span><span class="o">-</span><span class="nb">push</span>
<span class="nb">read_verilog macc_xilinx_xmap.v</span>
<span class="nb">techmap </span><span class="o">-</span><span class="nb">map macc_xilinx_swap_map.v</span>
<span class="nb">techmap </span><span class="o">-</span><span class="nb">map macc_xilinx_wrap_map.v;;</span>
<span class="nb">design </span><span class="o">-</span><span class="nb">save __macc_xilinx_xmap</span>
<span class="nb">design </span><span class="o">-</span><span class="nb">pop</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\vss</span><span class="nb">}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">5</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm}</span>
<span class="nv">\vskip</span><span class="o">-</span><span class="m">1</span><span class="nb">cm</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">extract </span><span class="o">-</span><span class="nb">constports </span><span class="o">-</span><span class="nb">ignore_parameters </span><span class="err">\</span><span class="nb"></span>
<span class="nb">        </span><span class="o">-</span><span class="nb">map </span><span class="c">%__macc_xilinx_xmap       \</span>
<span class="nb">        </span><span class="o">-</span><span class="nb">swap </span><span class="s">$</span><span class="nb">__</span>add<span class="nb">_</span>wrapper A,B ;;
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>
<span class="k">\vbox</span> to 0cm<span class="nb">{</span><span class="k">\fbox</span><span class="nb">{</span><span class="k">\includegraphics</span><span class="na">[width=4.5cm,trim=1.5cm 1.5cm 1.5cm 1.5cm]</span><span class="nb">{</span>PRESENTATION<span class="nb">_</span>ExAdv/macc<span class="nb">_</span>xilinx<span class="nb">_</span>test1c.pdf<span class="nb">}}</span><span class="k">\vss</span><span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>columns<span class="nb">}</span>

<span class="k">\vskip</span>2cm
<span class="k">\hfil\includegraphics</span><span class="na">[width=11cm,trim=1.5cm 1.5cm 1.5cm 1.5cm]</span><span class="nb">{</span>PRESENTATION<span class="nb">_</span>ExAdv/macc<span class="nb">_</span>xilinx<span class="nb">_</span>test1d.pdf<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[t, fragile]<span class="nb">{</span><span class="k">\subsubsecname</span><span class="nb">{}</span> -- 12/13<span class="nb">}</span>
Extract in <span class="nb">{</span><span class="k">\tt</span> test2<span class="nb">}</span>:
<span class="k">\begin</span><span class="nb">{</span>columns<span class="nb">}</span>
<span class="k">\column</span><span class="na">[t]</span><span class="nb">{</span>4.5cm<span class="nb">}</span>
<span class="k">\vbox</span> to 0cm<span class="nb">{</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[linewidth=5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
design -push
read<span class="nb">_</span>verilog macc<span class="nb">_</span>xilinx<span class="nb">_</span>xmap.v
techmap -map macc<span class="nb">_</span>xilinx<span class="nb">_</span>swap<span class="nb">_</span>map.v
techmap -map macc<span class="nb">_</span>xilinx<span class="nb">_</span>wrap<span class="nb">_</span>map.v;;
design -save <span class="nb">__</span>macc<span class="nb">_</span>xilinx<span class="nb">_</span>xmap
design -pop
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>
<span class="k">\vss</span><span class="nb">}</span>
<span class="k">\column</span><span class="na">[t]</span><span class="nb">{</span>5.5cm<span class="nb">}</span>
<span class="k">\vskip</span>-1cm
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[linewidth=5.5cm, basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=ys]
extract -constports -ignore<span class="nb">_</span>parameters <span class="k">\</span>
        -map <span class="c">%__macc_xilinx_xmap       \</span>
        -swap <span class="s">$</span><span class="nb">__add_wrapper A,B ;;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span><span class="nv">\fbox</span><span class="nb">{</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">4</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">c.pdf}}</span><span class="nv">\vss</span><span class="nb">}</span>
<span class="nv">\end</span><span class="nb">{columns}</span>

<span class="nv">\vskip</span><span class="m">2</span><span class="nb">cm</span>
<span class="nv">\hfil\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">11</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">d.pdf}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">{} </span><span class="o">--</span><span class="nb"> </span><span class="m">13</span><span class="o">/</span><span class="m">13</span><span class="nb">}</span>
<span class="nb">Unwrap in {</span><span class="nv">\tt</span><span class="nb"> test</span><span class="m">2</span><span class="nb">}:</span>

<span class="nv">\hfil\begin</span><span class="nb">{tikzpicture}</span>
<span class="nv">\node</span><span class="nb"> at </span><span class="o">(</span><span class="m">0</span><span class="nb">,</span><span class="m">0</span><span class="o">)</span><span class="nb"> {</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">11</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">d.pdf}};</span>
<span class="nv">\node</span><span class="nb"> at </span><span class="o">(</span><span class="m">0</span><span class="nb">,</span><span class="o">-</span><span class="m">4</span><span class="o">)</span><span class="nb"> {</span><span class="nv">\includegraphics</span><span class="o">[</span><span class="nb">width</span><span class="o">=</span><span class="m">8</span><span class="nb">cm,trim</span><span class="o">=</span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm </span><span class="m">1</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm</span><span class="o">]</span><span class="nb">{PRESENTATION_ExAdv</span><span class="o">/</span><span class="nb">macc_xilinx_test</span><span class="m">2</span><span class="nb">e.pdf}};</span>
<span class="nv">\node</span><span class="nb"> at </span><span class="o">(</span><span class="m">1</span><span class="nb">,</span><span class="o">-</span><span class="m">1</span><span class="nb">.</span><span class="m">7</span><span class="o">)</span><span class="nb"> {</span><span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">linewidth</span><span class="o">=</span><span class="m">5</span><span class="nb">.</span><span class="m">5</span><span class="nb">cm, frame</span><span class="o">=</span><span class="nb">single, basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">ys</span><span class="o">]</span><span class="nb"></span>
<span class="nb">techmap </span><span class="o">-</span><span class="nb">map macc_xilinx_unwrap_map.v ;;</span>
<span class="nv">\end</span><span class="nb">{lstlisting}};</span>
<span class="nv">\draw</span><span class="o">[-</span><span class="nb">latex</span><span class="o">]</span><span class="nb"> </span><span class="o">(</span><span class="m">4</span><span class="nb">,</span><span class="o">-</span><span class="m">0</span><span class="nb">.</span><span class="m">7</span><span class="o">)</span><span class="nb"> .. controls </span><span class="o">(</span><span class="m">5</span><span class="nb">,</span><span class="o">-</span><span class="m">1</span><span class="nb">.</span><span class="m">7</span><span class="o">)</span><span class="nb"> .. </span><span class="o">(</span><span class="m">4</span><span class="nb">,</span><span class="o">-</span><span class="m">2</span><span class="nb">.</span><span class="m">7</span><span class="o">)</span><span class="nb">;</span>
<span class="nv">\end</span><span class="nb">{tikzpicture}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>


<span class="c">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>

<span class="nv">\subsection</span><span class="nb">{Automatic design changes}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span>
<span class="nv">\subsectionpage</span><span class="nb"></span>
<span class="nv">\subsectionpagesuffix</span><span class="nb"></span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Changing the design from Yosys}</span>

<span class="nv">\begin</span><span class="nb">{frame}{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nb">Yosys commands can be used to change the design in memory. Examples of this are:</span>

<span class="nv">\begin</span><span class="nb">{itemize}</span>
<span class="nv">\item</span><span class="nb"> {</span><span class="nv">\bf</span><span class="nb"> Changes in design hierarchy} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">Commands such as {</span><span class="nv">\tt</span><span class="nb"> flatten} and {</span><span class="nv">\tt</span><span class="nb"> submod} can be used to change the design hierarchy, i.e.</span>
<span class="nb">flatten the hierarchy or moving parts of a module to a submodule. This has applications in synthesis</span>
<span class="nb">scripts as well as in reverse engineering and analysis.</span>

<span class="nv">\item</span><span class="nb"> {</span><span class="nv">\bf</span><span class="nb"> Behavioral changes} </span><span class="nv">\\</span><span class="nb"></span>
<span class="nb">Commands such as {</span><span class="nv">\tt</span><span class="nb"> techmap} can be used to make behavioral changes to the design, for example</span>
<span class="nb">changing asynchronous resets to synchronous resets. This has applications in design space exploration</span>
<span class="o">(</span><span class="nb">evaluation of various architectures for one circuit</span><span class="o">)</span><span class="nb">.</span>
<span class="nv">\end</span><span class="nb">{itemize}</span>
<span class="nv">\end</span><span class="nb">{frame}</span>

<span class="nv">\subsubsection</span><span class="nb">{Example: Async reset to sync reset}</span>

<span class="nv">\begin</span><span class="nb">{frame}</span><span class="o">[</span><span class="nb">t, fragile</span><span class="o">]</span><span class="nb">{</span><span class="nv">\subsubsecname</span><span class="nb">}</span>
<span class="nb">The following techmap map file replaces all positive</span><span class="o">-</span><span class="nb">edge async reset flip</span><span class="o">-</span><span class="nb">flops with</span>
<span class="nb">positive</span><span class="o">-</span><span class="nb">edge sync reset flip</span><span class="o">-</span><span class="nb">flops. The code is taken from the example Yosys script</span>
<span class="nb">for ASIC synthesis of the Amber ARMv</span><span class="m">2</span><span class="nb"> CPU.</span>

<span class="nv">\begin</span><span class="nb">{columns}</span>
<span class="nv">\column</span><span class="o">[</span><span class="nb">t</span><span class="o">]</span><span class="nb">{</span><span class="m">6</span><span class="nb">cm}</span>
<span class="nv">\vbox</span><span class="nb"> to </span><span class="m">0</span><span class="nb">cm{</span>
<span class="nv">\begin</span><span class="nb">{lstlisting}</span><span class="o">[</span><span class="nb">basicstyle</span><span class="o">=</span><span class="nv">\ttfamily\fontsize</span><span class="nb">{</span><span class="m">8</span><span class="nb">pt}{</span><span class="m">10</span><span class="nb">pt}</span><span class="nv">\selectfont</span><span class="nb">, language</span><span class="o">=</span><span class="nb">Verilog</span><span class="o">]</span><span class="nb"></span>
<span class="o">(*</span><span class="nb"> techmap_celltype </span><span class="o">=</span><span class="nb"> &quot;</span><span class="s">$</span>adff&quot; *)
module adff2dff (CLK, ARST, D, Q);

    parameter WIDTH = 1;
    parameter CLK<span class="nb">_</span>POLARITY = 1;
    parameter ARST<span class="nb">_</span>POLARITY = 1;
    parameter ARST<span class="nb">_</span>VALUE = 0;

    input CLK, ARST;
    input [WIDTH-1:0] D;
    output reg [WIDTH-1:0] Q;

    wire [1023:0] <span class="nb">_</span>TECHMAP<span class="nb">_</span>DO<span class="nb">_</span> = &quot;proc&quot;;

    wire <span class="nb">_</span>TECHMAP<span class="nb">_</span>FAIL<span class="nb">_</span> = !CLK<span class="nb">_</span>POLARITY || !ARST<span class="nb">_</span>POLARITY;
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>
<span class="k">\vss</span><span class="nb">}</span>
<span class="k">\column</span><span class="na">[t]</span><span class="nb">{</span>4cm<span class="nb">}</span>
<span class="k">\begin</span><span class="nb">{</span>lstlisting<span class="nb">}</span>[basicstyle=<span class="k">\ttfamily\fontsize</span><span class="nb">{</span>8pt<span class="nb">}{</span>10pt<span class="nb">}</span><span class="k">\selectfont</span>, language=Verilog]
// ..continued..


    always @(posedge CLK)
        if (ARST)
            Q &lt;= ARST<span class="nb">_</span>VALUE;
        else
             &lt;= D;

endmodule
<span class="k">\end</span><span class="nb">{</span>lstlisting<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>columns<span class="nb">}</span>

<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>

<span class="c">%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</span>

<span class="k">\subsection</span><span class="nb">{</span>Summary<span class="nb">}</span>

<span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}{</span><span class="k">\subsecname</span><span class="nb">}</span>
<span class="k">\begin</span><span class="nb">{</span>itemize<span class="nb">}</span>
<span class="k">\item</span> A lot can be achieved in Yosys just with the standard set of commands.
<span class="k">\item</span> The commands <span class="nb">{</span><span class="k">\tt</span> techmap<span class="nb">}</span> and <span class="nb">{</span><span class="k">\tt</span> extract<span class="nb">}</span> can be used to prototype many complex synthesis tasks.
<span class="k">\end</span><span class="nb">{</span>itemize<span class="nb">}</span>

<span class="k">\bigskip</span>
<span class="k">\bigskip</span>
<span class="k">\begin</span><span class="nb">{</span>center<span class="nb">}</span>
Questions?
<span class="k">\end</span><span class="nb">{</span>center<span class="nb">}</span>

<span class="k">\bigskip</span>
<span class="k">\bigskip</span>
<span class="k">\begin</span><span class="nb">{</span>center<span class="nb">}</span>
<span class="k">\url</span><span class="nb">{</span>http://www.clifford.at/yosys/<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>center<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>
</pre></div>
</code></pre></td></tr></table>
</div> <!-- class=content -->
<div class='footer'>generated by <a href='https://git.zx2c4.com/cgit/about/'>cgit v1.2.3</a> (<a href='https://git-scm.com/'>git 2.25.1</a>) at 2025-12-31 02:10:57 +0000</div>
</div> <!-- id=cgit -->
</body>
</html>
