標題: Altera Cyclone II (EP2C35F672C6)燒錄 [打印本頁] 作者: difgor0426 時間: 2008-3-6 11:03 AM 標題: Altera Cyclone II (EP2C35F672C6)燒錄 剛拿到這塊kit,寫了一個測試sw跟led $ i* `' C o! P* e7 Z' e! j1 F& l! ?//==================================================//! M+ ^4 }: @. i0 Q$ ?9 Q
`timescale 1 ns/1 ns2 Z6 n5 t0 L. Y* l2 c. Y* V+ \
* q/ f" j! w7 w; ~
module test_001(( t' S8 c/ r& e9 f$ d$ ^2 C
D, ! d& Q! K7 \3 ]7 J v Q, 9 i0 I- `8 J. G- ~$ u4 ?; Q+ e clk, 8 Z- }2 u; n9 e# F, M$ E- x) J( Z reset, + [0 s3 _" C' d! M. u QB - e' I6 [; Y1 \+ [8 L9 F) _# z ); ! ]9 h9 b' c5 ~ Linput reset, clk; 2 B) U5 F. l J/ iinput [3:0] D;0 ~; n) ~0 C( n+ ]4 o4 s: z
output [7:0] Q;/ k* _. X* }" b, k% {0 b
output [7:0] QB;4 m/ @% Z" J* D2 n$ F, X7 T
wire [7:0] Q;. U' I1 R1 h/ ^9 o8 x
wire [7:0] QB;& Q( m, P; _; V( h1 D* Q, N
reg [7:0] X; ( F( [4 f& D1 ?' a4 Yreg [7:0] a;- k5 C7 ]' G6 I- y6 j
& I S& m* i7 F4 s2 D6 L. B" O7 g! _9 r5 g
& ~# q( p# c" r N8 m! ? * e$ [ ]9 `6 Y$ x7 A C" ?/ u, C+ calways@(D) 4 z' H2 j8 C2 u begin 9 x- [$ M6 a9 \( q& } case(D)- B3 @4 P' T% I0 x' K! h
4'b0000 : X = 8'b0000_0000;8 A! M8 j& s+ b" l. {0 I. r5 p! p, S
4'b0001 : X = 8'b0000_0011;' D5 Q2 s+ t6 U9 T- W5 l7 ]
4'b0010 : X = 8'b0000_1100; + Z/ u" i+ X8 _6 X9 T. L 4'b0100 : X = 8'b0011_0000; 5 @8 W& d: ^, h 4'b1000 : X = 8'b1100_0000; 3 L/ v* U, Y7 n default : X = 8'b1100_0011; ' c( L6 v3 l! _9 B* X4 D( ^ endcase q2 g+ b; O5 }3 W
end . z5 D8 {! i! F . j) i+ {: O9 g7 Q, `* E
assign Q = a; . h; c- g5 i& Q8 l* v3 h; Nassign QB = ~a; ) D, A: c K: V6 L9 {- g - z4 o# v9 e' m0 O5 u' s
always@(posedge clk or negedge reset)5 Y" c; T$ ?; {3 z
begin 9 Y7 T% J) f$ L" D3 i if(!reset)0 q( x& O X, @8 c G2 b. J& q
a = #1 1'b0; . a1 S0 g7 V! b9 F4 [2 B else 6 T9 {/ R6 g0 A- \, z! a5 k* W; W a = #1 X; N. C5 c/ f. g" l# P) S# s end 7 I% X; B2 \' U 0 s9 _. g s: F) f- U
endmodule ( n* J# C) Z H//===========================================================// 7 J9 U/ p6 v& @0 q: x0 \" E: ~" U然後以下是Quartus產生的qsf檔。 % s" g; ]& I9 @+ Y//===========================================================// , o: M2 Y5 M# m- ^# Copyright (C) 1991-2006 Altera Corporation: Q( R( F3 s% ?% E4 R# c& D
# Your use of Altera Corporation's design tools, logic functions & w9 W1 C' n$ c D# and other software and tools, and its AMPP partner logic 0 s6 m! m2 x2 Z( Z
# functions, and any output files any of the foregoing + I8 r% K6 l( T7 V* g% k- E( C# q
# (including device programming or simulation files), and any D- A: M3 m& A8 W2 O" O
# associated documentation or information are expressly subject ' z1 X( _/ Z7 j" w" K7 N' V# to the terms and conditions of the Altera Program License 7 M, u! \7 D* K; _! r+ w* z# Subscription Agreement, Altera MegaCore Function License 3 _+ f; Z6 Z% |2 G7 ~
# Agreement, or other applicable license agreement, including, ! q/ k6 F' `5 a# without limitation, that your use is for the sole purpose of . ]- A9 ~' e' Q2 S/ C# programming logic devices manufactured by Altera and sold by + s( T+ T7 | F/ s$ t# Altera or its authorized distributors. Please refer to the * R% p) F1 T& i5 n0 v$ H# applicable agreement for further details. 2 a4 B/ w5 ~: t. L9 h7 S g. u! C/ L* Y3 ~
5 @/ N0 w2 E4 U7 N# The default values for assignments are stored in the file 0 t" S; P6 h1 {# test_001_assignment_defaults.qdf( ]5 i; C% K8 m5 X7 X& t6 h
# If this file doesn't exist, and for assignments not listed, see file" `: B9 C! z. k3 H/ T( ?9 R
# assignment_defaults.qdf 4 J& ^. M7 F: ]4 u$ v3 V 5 L6 m9 F9 z" M5 N# Altera recommends that you do not modify this file. This % v! I b2 v9 o' C N* G- V# file is updated automatically by the Quartus II software / {! W2 y! i0 b, Y5 D# and any changes you make may be lost or overwritten. ; [- ^5 C* v4 M: n$ c$ l4 U# B" p! e8 J! g4 t' x7 Z5 `
9 @% ~& Z, ]; C {
set_global_assignment -name FAMILY "Cyclone II" 3 ?% N4 a9 }- y( M! ^- Z. `8 Rset_global_assignment -name DEVICE EP2C35F672C6 2 J! ]: Z. n2 \' H+ R+ iset_global_assignment -name TOP_LEVEL_ENTITY test_001 # D* }/ v! |5 i5 ?1 ?5 i5 k4 A3 {set_global_assignment -name ORIGINAL_QUARTUS_VERSION 6.0) e# S& p7 C T& Z( h
set_global_assignment -name PROJECT_CREATION_TIME_DATE "09:57:03 MARCH 06, 2008" 9 e: K6 r7 K2 D! x5 [set_global_assignment -name LAST_QUARTUS_VERSION 6.01 k3 b% i% v$ i6 p, j& B
set_global_assignment -name USER_LIBRARIES "D:\\Altera II\\970305\\test\\1/"+ g3 q+ o- Y- ]. X8 b0 l2 n
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 6728 }% `- r2 _2 N% Z8 x# @
set_global_assignment -name VERILOG_FILE old_test_001.v . z' y3 d0 s2 D f$ e9 aset_location_assignment PIN_Y11 -to D[0]) I9 i! o3 i! F
set_location_assignment PIN_AA10 -to D[1]( g9 |4 S0 U6 N
set_location_assignment PIN_AB10 -to D[2] 8 f0 y; G Y' Fset_location_assignment PIN_AE6 -to D[3]* l2 a* K/ X- d& ~- n
set_location_assignment PIN_AC10 -to Q[0] $ Y) |0 w- C0 b, c' y5 gset_location_assignment PIN_W11 -to Q[1] ) \' H- ~; n' Q2 Z& q( y9 Jset_location_assignment PIN_W12 -to Q[2]2 t ?5 `% \& I( e
set_location_assignment PIN_AE8 -to Q[3]2 s- |0 e; r% j) ]4 \
set_location_assignment PIN_AF8 -to Q[4] |1 @3 r/ |5 ^" gset_location_assignment PIN_AE7 -to Q[5] % ?# @3 b! T7 n8 E, E; ? K/ Z. Uset_location_assignment PIN_AF7 -to Q[6]" H, H1 n( [ A; j; f
set_location_assignment PIN_AA11 -to Q[7] 0 d+ w- j& h a- d* Vset_global_assignment -name SIGNALTAP_FILE stp1.stp3 R5 J: n) l0 J. r0 S1 g
set_global_assignment -name ENABLE_SIGNALTAP ON / V' `. B' y( Y, [6 \ [: t/ Zset_global_assignment -name USE_SIGNALTAP_FILE stp1.stp7 u) v9 S9 c) u$ D# j ~! V: _" Z
set_location_assignment PIN_M21 -to reset0 v, R9 W, m5 G: N; ]6 ] n
set_location_assignment PIN_P25 -to clk& t3 S/ n% y# ], {4 i% I' K1 l
set_global_assignment -name EDA_DESIGN_ENTRY_SYNTHESIS_TOOL "Design Compiler" $ G( c+ n4 w, b- F B7 gset_global_assignment -name EDA_INPUT_VCC_NAME VDD -section_id eda_design_synthesis ! Y& E& j& m6 J) eset_global_assignment -name EDA_LMF_FILE altsyn.lmf -section_id eda_design_synthesis 2 e9 F* H3 b' g& L: W0 o( c2 Xset_global_assignment -name EDA_INPUT_DATA_FORMAT "VERILOG HDL" -section_id eda_design_synthesis - p& F9 ~+ X6 b( v# f7 _//=================================================================================================//: L( D% t- e9 ~( p N2 n& c 我的問題是,不知道為何怎麼樣都燒不進kit裡, ( D- L3 ~" Z1 A& _+ A. u已經排除並非JTAG跟KIT的問題! 1 R% }* }5 @$ V2 b請各位先進一起來分析一下!作者: ikki 時間: 2008-3-6 11:10 AM
把programmer的錯誤訊息post出來看看, 光看qsf, 無法知道program的問題....作者: difgor0426 時間: 2008-3-6 11:13 AM
0 I q Y& ^1 H. e6 V只有WARNING , z ^% [2 \1 k8 l沒有ERROR3 h5 z. D- C# l. W) V
這就是我感到奇怪的地方作者: ikki 時間: 2008-3-6 12:02 PM
所以是有成功??4 |( @2 L7 q h, `0 o
不然把program的畫面抓下來看看..作者: difgor0426 時間: 2008-3-6 01:31 PM
[attach]3111[/attach]& j* Y$ T3 A8 [/ t3 ], [1 [2 ?
. h* e: D0 F0 k+ L/ U" `' P這是program的畫面 5 ]. m6 l1 a; m/ p 5 h3 C4 s8 S6 _2 S6 B) m& t[attach]3112[/attach]% s, ] K! u0 @& ~4 d* c1 l+ r
' d& N& t/ M4 X. Z 這是assignment pin的畫面, Y7 {5 `1 l; j' h
8 A' o2 h3 A V
[attach]3113[/attach] ! z, c0 t+ A2 J; Y6 \5 k) d4 V: E+ Z9 _0 _/ w2 i 這是燒錄下載到kit的畫面8 A, j& \* @, i8 \
\1 s: ]0 N. P. s' m1 Y
####################################################" C: d) h7 k* } 到這都很順利,0 {3 j8 l0 }0 L6 V! \1 o; b
但是~kit就是不動作!!作者: ikki 時間: 2008-3-6 02:05 PM
檢查看看clock pin 是不是assign錯?" e4 H% m9 G) V8 c) B
導致電路不動...作者: difgor0426 時間: 2008-3-6 02:11 PM 確定沒有!我對著這塊kit的手冊在assign的作者: michael6172 時間: 2008-3-6 04:12 PM
你那是要做 signaltap 的lab 吧 4 q) o, {9 E$ n. s# S5 u. U4 h 1 F' y. m0 \/ v7 J3 y4 h' f6 a看看文件中的設定有沒有遺漏的部份作者: difgor0426 時間: 2008-3-6 04:54 PM 在我關閉project的時候,會出現以下3個畫面,是否我的signal沒設定好才會使KIT無法動作!, ?4 e& F& g2 R* c2 k; f2 K
2 C) ]# `/ X( i) @* C6 j% }3 F* Q2 f[attach]3123[/attach] ) E* _& z }4 }" y - w/ X" u0 J0 K* I# i 5 G; z$ O. F. t[attach]3124[/attach] * L' J, {) Z3 r ) x& ]4 L. S: ]# E) R" t+ ]& x4 T 9 }9 t* N$ p8 v3 W/ `1 c[attach]3125[/attach]作者: sieg70 時間: 2008-3-7 09:41 AM
雖然我夠菜了, 但似乎幫的上一點, 所以我就講一點, 還不懂的feature不要亂開啟 3 [( s, d3 h5 v上面signaltap2跟in-system memory content editor不要亂開, * E# b9 ]' E! P9 ]$ `- Y特別是signaltap2開了又沒作正確設定, 就會出現最後面關project時的三個畫面0 Z* ^) \2 i0 I' c8 {
發展板的manual要K完, 有沒特別的jumper要設mode? 6 a$ i6 X& Q% J# O# n6 t8 n另外, 下載後, 發展板上config_DONE的燈有沒有亮? 有亮的話就是有正確下載,# d+ z, v. h9 ]. R4 o; Y% u
那就是你的設計的問題, . W {0 A( V& J. P9 b6 s1 a! c這電路你期待會在板子上看到什麼動作? 是否你忘了要用手去扳動對應的D的switch提供輸入? 合成過的電路有沒利用RTL view看看電路是否是你要的?作者: difgor0426 時間: 2008-3-7 11:52 AM
0 y& E' a, b( O6 b' c1 u+ ?
感謝各位的意見~/ D0 O) i( w) _5 y3 s# @
同樣的描述~ ( d' y1 _8 `& D: r1 L/ X我放到altera另外一塊kit→EP2C20F484C8(茂倫)2 P% z* J: O2 E" y9 X }3 G8 x
所得出的結果就是我要的~7 f# u! m* T3 L1 H
差別只在PIN的ASSIGN 9 _2 z$ v3 h0 ^' `5 h! |4 R這樣子可能會認為KIT有問題~ m* L% W1 {) H+ f$ Z* }所以~7 ?( _% J/ t0 z* i! ~' b w z
我又重新寫了一個% S2 b& W5 R+ o& ~0 R7 S8 a
放到altera EP2C35F672C6這塊KIT~ & Y8 k# n4 R! z1 z0 ` ; n2 ^, A1 l$ e
居然可以動作了~9 A2 D2 z$ p$ H! }- F6 p: v
以下就是這段硬體的VERILOG HDL 8 L' `. |& p& v% S' M v`timescale 1 ns/1 ns3 G9 B; F7 k6 q0 i
module chip_top (/ n% _: g$ l' N1 F5 t; Q I7 z
clk,( t6 ^( [% K- J5 J" x. \
rst_b,* ]- C; g" [$ _ F9 D
cnt,9 I, }1 j- i2 ]3 s' }
seg, . g# \* @; b: d5 X a, 3 |) w$ O8 M2 H sel,. P- A6 ~8 @( t* c! t
seg_u9, ( X f1 V A" Z* ~7 N
rst,$ U1 @- d. }; y3 c& z% P
clock, 5 y ?" x8 q* X/ W );5 E! r/ p% K0 e9 C' Q& J, ]