|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
請(qǐng)教同樣一個(gè)程序在xilinx和LATTICE結(jié)果不一樣,郁悶ing |
| 作者:大老鼠布布 欄目:EDA技術(shù) |
MODULE counter(seg,sl,clock); OUTPUT [7:0] seg; OUTPUT [3:0] sl; input clock; reg[7:0]seg_reg; reg[7:0]seg_reg1; reg[7:0]seg_total; reg[3:0]sl_reg; reg[3:0]disp_dat; reg[3:0]disp_dat1; reg[39:0]count; reg flag; //count[37:34] //qian wei //count[33:30] //bai wei //count[29:26] //shi wei //count[25:22] //ge wei always@(posedge clock) begin count=count+1; if(count[25:22]>4'h9) //ge wei miao begin count[25:22]=0; count[29:26]=count[29:26]+1; end if(count[29:26]>4'h5) //shi wei shi miao begin count[29:26]=0; count[33:30]=count[33:30]+1; end if(count[33:30]>4'h9) //bai wei feng begin count[33:30]=0; count[37:34]=count[37:34]+1; end if(count[37:34]>4'h5) //qian wei shi feng count[37:34]=0; end always@(count[14:13]) //sua xin ping lv begin case(count[14:13]) //sua xin ping lv // ji shi qi de shu du 2'h0: disp_dat = count[37:34]; //qian wei 2'h1: begin disp_dat1 = count[33:30]; flag=1; end 2'h2: disp_dat = count[29:26]; //shi wei 2'h3: disp_dat = count[25:22]; //ge wei endcase case(count[14:13]) //sua xin ping lv 2'h0:sl_reg=4'b1110; //qian wei 2'h1:sl_reg=4'B1101; //bai wei 2'h2:sl_reg=4'B1011; //shi wei 2'h3:sl_reg=4'b0111; //ge wei endcase end always@(disp_dat) begin case(disp_dat) 4'h0:seg_reg=8'hc0; //DISPLAY 0 4'h1:seg_reg=8'hf9; //DISPLAY 1 4'h2:seg_reg=8'ha4; //DISPLAY 2 4'h3:seg_reg=8'hb0; //DISPLAY 3 4'h4:seg_reg=8'h99; //DISPLAY 4 4'h5:seg_reg=8'h92; //DISPLAY 5 4'h6:seg_reg=8'h82; //DISPLAY 6 4'h7:seg_reg=8'hf8; //DISPLAY 7 4'h8:seg_reg=8'h80; //DISPLAY 8 4'h9:seg_reg=8'h90; //DISPLAY 9 endcase end always@(disp_dat1) begin case(disp_dat1) 4'h0:seg_reg1=8'h40;//DISPLAY 0+dot 4'h1:seg_reg1=8'h79;//DISPLAY 1+dot 4'h2:seg_reg1=8'h24;//DISPLAY 2+dot 4'h3:seg_reg1=8'h20;//DISPLAY 3+dot 4'h4:seg_reg1=8'h19;//DISPLAY 4+dot 4'h5:seg_reg1=8'h12;//DISPLAY 5+dot 4'h6:seg_reg1=8'h02;//DISPLAY 6+dot 4'h7:seg_reg1=8'h78;//DISPLAY 7+dot 4'h8:seg_reg1=8'h00;//DISPLAY 8+dot 4'h9:seg_reg1=8'h10;//DISPLAY 9+dot endcase end always@(flag) begin if(flag) begin seg_total=seg_reg1; flag=0; end else begin seg_total=seg_reg; end end assign seg=seg_total; assign sl=sl_reg; endMODULE /****************************************************/ 在XILINX下會(huì)提示這樣的錯(cuò)誤 用的芯片是XC95108 Optimizing unit <counter> ... WARNING: |
| 2樓: | >>參與討論 |
| 作者: littleou 于 2005/4/20 10:13:00 發(fā)布:
lots of error always@(posedge clock) begin count=count+1; //error ,should be <= always@(count[14:13]) //sua xin ping lv //error begin case(count[14:13]) //sua xin ping lv // ji shi qi de shu du 2'h0: disp_dat = count[37:34]; //qian wei // error always@(flag) //error begin if(flag) begin seg_total=seg_reg1; //error flag=0; end else begin seg_total=seg_reg; //error end end check you coding style,lots of error |
|
| 3樓: | >>參與討論 |
| 作者: 大老鼠布布 于 2005/4/20 12:42:00 發(fā)布:
大老鼠 always@(posedge clock) begin count=count+1; //這是對(duì)的,不會(huì)有問題的。 關(guān)鍵就是flag引出的問題。我該怎么改呢?(兩個(gè)模塊傳遞標(biāo)志位出的問題。) |
|
| 4樓: | >>參與討論 |
| 作者: 吳明詩(shī) 于 2005/4/20 13:45:00 發(fā)布:
always@(count[14:13]) 綜合不了。 |
|
| 5樓: | >>參與討論 |
| 作者: a_tu01 于 2005/4/20 22:12:00 發(fā)布:
Flag在多個(gè)always塊中賦值 應(yīng)該在一個(gè)塊中 |
|
| 6樓: | >>參與討論 |
| 作者: 大老鼠布布 于 2005/4/22 8:41:00 發(fā)布:
大老鼠 在LATTICE的ISPLEVER下,不管是模塊內(nèi)引用,還是在模塊外引用都是好的。 * - 本貼最后修改時(shí)間:2005-4-22 9:09:46 修改者:大老鼠布布
|
|
| 7樓: | >>參與討論 |
| 作者: 大老鼠布布 于 2005/4/22 8:55:00 發(fā)布:
大老鼠 我用的是LATTICE的ISPLEVER,在模塊外引用FLAG也是好用的呀 但是把它改XILINX下運(yùn)行是不行的。 即使把flag改為模塊內(nèi),能夠鎖定管腳但是點(diǎn)擊Configure(IMPACT)也是不對(duì)的有錯(cuò)誤提示。 ERROR:Cpld - Cannot fit the design into any of the specified devices with the selected implementation options. Tcl _cpldfit.tcl detected a return code of '1' from program 'cpldfit -f _cpldfit.rsp counter.ngd' Done: failed with exit code: 0001. 那位大俠能夠解釋一下 |
|
| 8樓: | >>參與討論 |
| 作者: 大老鼠布布 于 2005/4/22 9:06:00 發(fā)布:
新改的程序,還是XILINX不能運(yùn)行 MODULE counter(seg,sl,clock); OUTPUT [7:0] seg; OUTPUT [3:0] sl; input clock; reg[7:0]seg_reg; reg[7:0]seg_reg1; reg[7:0]seg_total; reg[3:0]sl_reg; reg[3:0]disp_dat; reg[3:0]disp_dat1; reg[39:0]count; reg flag; //count[37:34] //qian wei //count[33:30] //bai wei //count[29:26] //shi wei //count[25:22] //ge wei always@(posedge clock) begin count=count+1; if(count[25:22]>4'h9) //ge wei begin count[25:22]=0; count[29:26]=count[29:26]+1; end if(count[29:26]>4'h5) //shi wei begin count[29:26]=0; count[33:30]=count[33:30]+1; end if(count[33:30]>4'h9) //bai wei begin count[33:30]=0; count[37:34]=count[37:34]+1; end if(count[37:34]>4'h5) //qian wei count[37:34]=0; end always@(count[14:13]) begin case(count[14:13]) // ji shi qi de shu du 2'h0: disp_dat = count[37:34]; 2'h1: begin disp_dat1 = count[33:30]; flag=1; end 2'h2: disp_dat = count[29:26]; 2'h3: disp_dat = count[25:22]; endcase case(count[14:13]) 2'h0:sl_reg=4'b1110; //qian wei 2'h1:sl_reg=4'B1101; //bai wei 2'h2:sl_reg=4'B1011; //shi wei 2'h3:sl_reg=4'b0111; //ge wei endcase if(flag) begin seg_total=seg_reg1; flag=0; end else begin seg_total=seg_reg; end end always@(disp_dat) begin case(disp_dat) 4'h0:seg_reg=8'hc0; 4'h1:seg_reg=8'hf9; 4'h2:seg_reg=8'ha4; 4'h3:seg_reg=8'hb0; 4'h4:seg_reg=8'h99; 4'h5:seg_reg=8'h92; 4'h6:seg_reg=8'h82; 4'h7:seg_reg=8'hf8; 4'h8:seg_reg=8'h80; 4'h9:seg_reg=8'h90; endcase end always@(disp_dat1) begin case(disp_dat1) 4'h0:seg_reg1=8'h40; //DISPLAY 0+dot 4'h1:seg_reg1=8'h79; //DISPLAY 1+dot 4'h2:seg_reg1=8'h24; //DISPLAY 2+dot 4'h3:seg_reg1=8'h20; //DISPLAY 3+dot 4'h4:seg_reg1=8'h19; //DISPLAY 4+dot 4'h5:seg_reg1=8'h12; //DISPLAY 5+dot 4'h6:seg_reg1=8'h02; //DISPLAY 6+dot 4'h7:seg_reg1=8'h78; //DISPLAY 7+dot 4'h8:seg_reg1=8'h00; //DISPLAY 8+dot 4'h9:seg_reg1=8'h10; //DISPLAY 9+dot 4'ha:seg_reg1=8'h08; //DISPLAY a+dot 4'hb:seg_reg1=8'h03; //DISPLAY b+dot 4'hc:seg_reg1=8'h46; //DISPLAY c+dot 4'hd:seg_reg1=8'h21; //DISPLAY d+dot 4'he:seg_reg1=8'h06; //DISPLAY e+dot | |
| 9樓: | >>參與討論 |
| 作者: w7612 于 2005/4/22 10:02:00 發(fā)布:
程序在XILINX和LATTICE結(jié)果不一樣 這與綜合器有關(guān),你可以用好的綜合器SYPLIFY綜合一下,應(yīng)該一個(gè)SIGNAL不能在多個(gè)always賦值,(在VHDL也不能對(duì)一個(gè)SIGNAL在多個(gè)PROCESS賦值),還有你在綜合時(shí),最好選一些好的綜合器 |
|
| 10樓: | >>參與討論 |
| 作者: 大老鼠布布 于 2005/4/23 13:10:00 發(fā)布:
大老鼠 呵呵,新改的程序綜合已經(jīng)通過,還有什么問題呢? ERROR:Cpld - Cannot fit the design into any of the specified devices with the selected implementation options. Tcl _cpldfit.tcl detected a return code of '1' from program 'cpldfit -f _cpldfit.rsp counter.ngd' Done: failed with exit code: 0001. 那位大俠能夠解釋一下? |
|
| 11樓: | >>參與討論 |
| 作者: 大老鼠布布 于 2005/4/25 10:02:00 發(fā)布:
頂,貼子不能沉拉!那位大蝦碰到過類似問題。 |
|
| 12樓: | >>參與討論 |
| 作者: w7612 于 2005/4/25 10:43:00 發(fā)布:
請(qǐng)教同樣一個(gè)程序在XILINX和LATTICE結(jié)果不一樣,郁悶ing Tcl _cpldfit.tcl是一種腳本語言,有點(diǎn)類似批處理,我認(rèn)為你選擇器件沒有選對(duì),你可以看一下cpldfit.rsp文件 |
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 www.udpf.com.cn 浙ICP證030469號(hào) |