FPGA軟件設(shè)計實例_第1頁
FPGA軟件設(shè)計實例_第2頁
FPGA軟件設(shè)計實例_第3頁
FPGA軟件設(shè)計實例_第4頁
FPGA軟件設(shè)計實例_第5頁
已閱讀5頁,還剩16頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、5_2_3軟件設(shè)計實例1.啟動 niosllsbt在 quartus iii程下,點擊菜單11 software buildtools for ecl ipse 命令啟動 nios ii sbt,如圖 5. 4 所示。a j a -4 a -0(*laxvh sndator lbrary cornerouunct) desgn space eajforetmequest tmrq m#pxradjotjoipmsrnerdesign mon ramerweo vs subscrpoon edconnetht64 b tr quartu* edc wew project asnymens prx

2、sarcoj k 3 «sear<rityp« xd hetaageouy sctvredocumentadonscnafrobepr®.舟©gr*msupponwhat hewgdtonx.opoor*.tdsovti.ln-5y»t«m menory content 5or ixqc z 內(nèi) xnttrfice edoor !n-5v«tm satcw and »ot*« morjtagchdefeuwer srstewonsoiepug4 marapmos h sozw 3 tooil tor

3、耳 trainingkerne sewp.uwuldekm.i? w©03syfn ass moa h szr bum t«te for bdpk0% 00:00:00選擇工作目錄ft4 carptooonylwts 4 卜cctem ca*< .'>« 4f <h» jcllm« f«.u»4»n©«.u<. o/acu f»4 jmb m« poimr«4c«< ofml«r««; t

4、*a.co>4r ftamct ««av b«tr«4«nartc“ "“opxf «vnan.type id hess&qe0% 00:00:00w 7 1r© q出現(xiàn) nios ii - ecl ipse 窗口file edit navigate search rur project niot u wrdow helpblgniw ulqc *ic. i oe oixlirw h0 4em« selectedan outline is rot available.grvwwgel an

5、overview oflh feaourstatontgo through tuftxiauth* sim0*swh&rsnew fndoutweuwor1(bmdi go io vie wo2. 建立新的軟件工程(1) 選擇niosllsbt軟件中的菜單fi ie->ii appl icationand bspfrom template 命令,如圖 5. 5 所示。nav»a*tesearch rurprojectnewop«n hit.close close almove.pj rename.ahshifts orkwcvusmuwcvus5hsmus92

6、convert line delimiter* toprim-sw4chc"up込 import. exports.proper t»e4=$>w at.saw ajirewrt0 fcekctedmkw ! appfic«t)on and bsp from template g ii appikmjon 也s ii bo«rd support pxge3 1! libry project-nkxu vrtndow helpctri-rnd««cnpf>orretcufcepath刃4/25kn ouine is rot

7、avotloblealt*er<ecsbpiwsns£ outline ua' welcome zzovtrvitw cd an or rtadurestatcxtak through tuaonalssamcteswnorswew frul out zlwohibencii go io me wocxoeocn1 prohmi $ t讓$ qcontowproptrwtd c 曰oimrmlocation597.3mb 垃圾給電、la加連 出現(xiàn)的對話框(如圖5. 6所示:在出現(xiàn)的對話框中確定以下選項sope information fi le name欄中選擇對應(yīng)的系

8、統(tǒng)硬件文件(.sopcinfo),以便將生成硬件信息與軟件應(yīng)用相關(guān)聯(lián),這里尤其要注意選對路徑,要選擇當(dāng)前項目工程的.sopcinfo文件。project name欄中填入新建項目的項目名。確定選中use default ioeation復(fù)選框。本例中在projec t temp i ate欄中選擇hello world模板。at 3seerdt rua pircject niosa 卷16 project £*plorer w。日丫el * v i> mios d application and bsp from templatenios n software examples

9、create a new application and bo ard support package baed on a software ejmple templatebisnknnlc/c *色伶wdoome云、丫3啊 hardware anformabonsopc information file name:cpu name:da*hefa,designtest_ciockclock.5oportfo5appkwo projectproject name: 比sofhwe. use de/«ult kx*t>onpre祕! bcatmfvd!wurt.d*si9cjeu

10、.docksorwtfevlk_«ofrw>rti probucm £nios n software for informth refer to the <installationa </nios2-smexmhcjxt tempuwttmput y.mptoh dfcripifoiihdlo wcdd prsts heto from niot u to stdout.this exaniple runs wveh or without the microc/os-ii rtos and requires * stdout device in your h

11、ardware.for <fouilt. csck anith to cr«m the “"ct and rt4«f to th rvsdnw.txt filv in project dwvetory.the bsp fo< this template is bed oti the after a halbunk pro" board obgnostic% court binaryr<m<2 functkxmlity rom2gccrom2 pthcrwww he bo freestandingy 常)t available.ov

12、ersew ango through tutorsmnoteswharsmew f<kjout*rtaiisnewwortibench goto me wemeoennext»| rnhh cancel8:58 2o15/v13點擊next按鈕,界面如圖57所示。3 nio511 ulipsewe edit n®v»g«tf search r*n project n»o« ii winios software exampicsselect « bord support packe lor your applicatio

13、n0 c/mit* mrw bsp propel bated on th# app(<«akxi preset lompht*“me <lk_4oftw*fe.bh>j ux defauh locatorselect an omboq bsp project froen your workspaceproject location: (>.葉. dftnt wcioc k«>*twsr c ikwoftw arvlxp7q " d4 20豚nia* ii software ,ol inforwttu refer to the c ki

14、nitallaticn </nios2- »wcmm:?n(nk>su|qc rt°°overview g«tan om«vi«worvia featuredlulonal?go throuqh xjionahtry ouir»e sani|m”v/m s h«wv/o<woncli go to the wo保持默認(rèn)選項,最后點finish按鈕。得下圖。> nd u (ckpwfile edit nawgate 3 心 員 5 project nio« 11 wixiow hdp

15、o'u * g 2 ujtuplocee6 ©i s ug w«konwe 他 nim ii|qc/c " 、ouild pini«h<d thelutonanji r;« aanipiasv m a a atake(<lk_toftiuire clean coaplete& cac.totware 匸 dk.tc*tw«r«.b<p ciocm或 probwe ® 3ci= gwriiocot 3陽 comeu cl««n-only build of conf

16、iguration n£os ix for project clk_&oftm«rw newfind z wht ts n«wivocmmflchgo to the w<注意:build finished* clean-only build of configuration nios ii for project clk_software * make cleanclk_software clean complete* build finished *(3)點擊finish后,新建的工程就會添加到工作區(qū)中,同時niosllsbt會創(chuàng)建一個系統(tǒng)庫項目*

17、 _bsp (如本例c i ock_bsp).圖5. 8所示為創(chuàng)建工程后的nios ii sbt工作界面。點開工程,選中并雙擊hel lo_wor id. cfiw edit source refactor navigate sard* run project nioc 0 vmndow hdpc3 “ d dk.toftwm,> 甬 l<k»ud«thdlo.wocld<丄 makefilei i re«dme.ttt dk.w#tw«r».b4p '( hrllo world*this ex«ple pr

18、ints 'hello froo kios ii* to the stdout 5treav. it njns on the nios ix standard'r 'fullfedtiz-ed*, 'fast*, and *low_cost* exjople designs. it runs with or without the microc/os-ii itos and requires a stdout device in your syiten* & hardware.thtfootprint of thi* hosted pplicatioa

19、is -69 mtxto by defaultusing tm st*nd»rd r«fer<n« designfcr reduced footprint version of thl»nd an «xpl>n«tion of homto reduce the eeory footprint for given application, se« the *s»all_bello_world* templateminclud* <stdio.h>printfcmello froo nios x

20、x!n*>hobumf £ tmu c contow 憶 =optrtitfcot builddk.w<twtftj clean-only build of configuration niot ix for project clk_<oftw*r< ke clenclk_softm«re clean cgpletes««npiest<y out the samc*eswharsmew fr>dout*ih3!«sn®w9a* a* eoverviewan xrtw & nreakmes&#

21、163; outline: k 籌u fctdkxh mtino : intgo through tutorialswortctwwcji go to vie wocxtwxli:護(hù)mwriublesmart imevl1! 1finished菜單file 1 edit source refactor navigate search run1newopen filealt+shift+n closectrl+wclose allctrl + shift+wsavectrl+ssave as.save allctrl+shift+srevertmove rename.refreshf5conve

22、rt line delimiters toprint.ctrl + pswitch workspacerestartimport.export.propertiesalt+enter1 helloworld.c clksoftwareexitedit(editsource refactor navigatesearch run preundoctrl+zredoctrl+ycutctrl +xcopyctrl+cpastectrl+vdeletedeleteselect allctrl + aexpand selection tofind/replace.ctrl+ffind wordfind

23、 nextctrl + kfind previousctrl+shift+kinc remental find nextctrl + jinc remental find previousctrl+shift+jadd bookmark.add task.nsmart insert modectrl + shift+insertshow tooltip descriptionf2word completionctrl+alt+/quick fixctrl + 1cont ent assistalt+/parameter hintsalt+?set encodingsourcesource re

24、factor navigate searchrun project ntoggle commentadd block commentremove block commentctrl +/ctrl+shift+/ctrl4-shift+oishift rightioshift leftshift+tabcorrect indentationctrl+iformatctrl+shift+fadd includectrl+shift+nsort linesctrl+alt+simplement method.generate getters and setters.surround withalt+

25、shift+z run| run | project nios ii window 旦elp遢run 恕 debugctrl+fllfllrun historyrun asrun configurations.debug historydebug asdebug con figurations.q external toolsproject| project nios ii windowhelpopen projectclose project血 build allbuild projectbuild working setclean-build automaticallyctrl + bpr

26、opertieswi ndowswindow 旦elpnew windownew editoropen perspectiveshow viewcustomize perspective. save perspective as. reset perspective. close perspective close all perspectivesnavigationprefere nces在工程名上點右鍵,在菜單中選ne啊彈出下圖j nio»dopen in new windowropettiwimport. export.buim hcj«tclear projectr

27、efreihose projectckxe unrelated projecucopybuild conkgur«tion<m從.targets nd«xnew go ir4odeleteremove from contestsourcemov#.-in remo<e sytfetm view convert to.run asdebug as kofie a» ream comp«r«restore from los history-nio«nrun c/c. cod< update linked retource

28、tctrucctrl*deletectrk ah 5耳強 dowf2fsc3filehe from tcmpbcefoldernd ii appsceborniot ii appkmto and bsp from templaten»oi ii board 3pp5 packagenios u utxarycbssheader hiesource hiesource folderc hojvc. projectother.ctrun>nfi<ur>tion nios xx for project cl<»o<twre alt enterslgn

29、ios n |ta<x ” welcome :fix<jthcmsnples try out the saiwharsmew fnd outsats mu itdkxh mainq : inigo through tufionalsworkbewch go io me woncb&xft選c旁的source f i le可創(chuàng)建c程序'選h旁的source file可創(chuàng)建頭文件。如:創(chuàng)建一個testl.c的程序的窗口3. 編譯工程用鼠標(biāo)右鍵點擊工程名clock,在彈出的菜單中選擇build project見圖5.11),re edit scopen in new wi

30、ndow4 p w 3cthkctruvx:.$ indremove from corcextctrl ah shifts dowr>也w> 8tri gf2血maelrea“ dk.sol 匕3 nio51i-ne%wo "g mid» ii* to the stdoutit mn$ on fullfeeted*, 'fast*, ar*d 'lowccst* exwple without the microc/os-lx ttos and requires a stdout lardnare.his hosted applicatlcft i

31、s 69 kbytes by default nee designgt owilifw :za tf 籌u %td»ah maino intrcrtlon of thisead 8 explanation of hewprint for given pplicaticn, see thet«.propen*$build projectpresetrefreshclose projectclot# unrelaud rrojecttbuild comgwtiommake targetsindtishow in remote systerm view convert to-ru

32、n asdebug asprofile asteamcompare vahrestore from loci rfstory- nmurun c/c. code afm*ys*s updm* l>k*d rt$ourct$propertiesuration nios xx for project clk_softw»r« ah*enter-v®詔"osamples try outfit s3gelanovwewortvewharshow frkjoutmidtanewutcxteb go through tutonalbworkbanch go i

33、o vi« worttxocti或選擇project菜單中的build al i選項。3 n31! - cl<sot*d-e/he<o_wodd< - e&pie、file edit source refxtor navigate search run |nio$ 0 vmndow help© <3 z hetto.woriiope*» projectclos* projectblgniw ulqc *xellthis the h 心y devic hie d"wl4m build albuild projectbuild

34、 wodang setcl“_build aonwtionypropettietctri<8for a reduced footprint version of this tmplate. «nd an explaft«tlon of hew to r*dx the mory footprint for a given application, iw the mjwgwochratlfklude <stdio.h>i«t min<)return 0; tl_ prohw5 w txk? (3 console cot buiki cocmmc

35、 (elk softmare)properties clean-only build of configuration hios ii for project clk_softm«rem»ke clean(clksoftmare clean complete 3山 fth& dk_iotw«r»d 每 w«teication is “9 kbytes* by defaultwharsnew fndoutwturrx out the s>m(<«su stdkxh maino : irrtto stdout .em.

36、 it runs on fast*, z ,low_<oit' «x41e roc/0$-ii rto$ retires & stdoutxnrwwgel an overview or r>go through tuftxtauworkbmcll co io tie wo在編譯開始后,nios ii sbt會首先編譯系統(tǒng)庫工程以及其他相關(guān)的工程,然后再編譯主工程,并把源代碼編譯到<proj ect name>. e i f文件中。編譯完后會在tasks瀏覽器中顯示1=1告和錯誤信息。512為編譯過程的界面。fiw edit source sfx

37、tor“.di rur> prcr nios u wndow htips ia nios n|ta<x ”iq project explorer £39 穌i °目俺 wafcome :?-3mello morld* example.0i includes 質(zhì) hdlo.woddx 宙 testlx12 cre«u this app厶 makefileq re»dm«.txt “ dk_qtwbre4p . :>ckthis ex«iple prints 'hello free ii* to th* stdo

38、ut streav. it rxjns on f ittw n $m,f«f, and -low.cosf expu deslcns. it runs wltn m without the mlcroc/os-xx rtq5 and stdoutu itdkxh mainq : intint *ain< >return 0; mifklwde <stdlo.h>for a reduced ffl to reduce the m hello 吟device in your i the ?c>ly foetd using the stand4g 令團(tuán)0a6bi"5cot build console (cksoftware)w、夏 < r<w .r.kbit 應(yīng)avrv*«twv >y *««匸” -oaltinstmktxoh.eruution omj-sdrtlt.thauow 00 < -mell mo-hw-div "列1 imo-hw-bulx obj/iul/src/altenviron,o hal/»rc/®

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論