Chip123 科技應用創新平台
標題:
Flash memory 的讀寫
[打印本頁]
作者:
difgor0426
時間:
2008-3-13 02:38 PM
標題:
Flash memory 的讀寫
module Altera_UP_Avalon_Flash(
/ L f6 @9 L+ T6 i
// Inputs
- I( I5 f9 R: L0 e% r
clk,
_' ~6 `3 N( r" c. \, t. e# b& B
reset_n,
* E) e( E: t* \4 F, m4 k; ~
) W: k4 q9 m5 P1 y/ [% C0 C
avalon_address,
; E5 O+ N0 b) G6 N) c
avalon_chipselect_n,
# e# R/ W" G: {/ \+ |9 e7 {# ?
avalon_read_n,
% K+ m4 \8 J' s
avalon_write_n,
4 ?1 L) {; U% X9 G W1 D
avalon_writedata,
1 c9 a. u \6 t2 }
/ q9 u9 z' D& S. ^: w- k
// Bidirectionals
( H/ v4 T8 R Y5 S# p/ E
FL_DQ,
' F8 r3 B$ s1 r, [7 I( k
! m& ]/ j7 A& V. K
// Outputs
' t* h4 ^) k5 ^1 G: H
FL_CE_N,
/ Z6 v2 c: J6 e$ N
FL_WE_N,
% g& Q9 N" \! ~* r0 s, z5 S% o6 d' y
FL_OE_N,
- q: y6 |( y8 L8 p6 b" L
FL_ADDR,
x4 }! l, r$ Z0 x6 A- u8 U [
FL_RST_N,
, H! n+ \' s( U
8 K. m' m; H# H- W5 n* u2 j7 P+ h6 F
avalon_readdata
6 F g- ?# n* k, U# P# e
);
9 d7 a- z' }4 U: Z# y; q0 E6 [4 t
/ f: ~2 Q9 k% B0 {8 S+ m, j
input clk, reset_n;
: T' \* S" e5 |: m
input [23:0] avalon_address;
; z" w, r" |# i- `
input avalon_chipselect_n, avalon_read_n, avalon_write_n;
, d6 z% E6 j( {' n, K- z3 c
input [7:0] avalon_writedata;
) I6 g% l9 V! \/ V5 M: Q; O
" |7 ~3 @. S2 F1 t8 C$ \! }0 _
inout [7:0] FL_DQ;
0 u ^# }' p u* U3 U# V( \0 D
% N1 } d" }0 p1 A- j" J
output [7:0] avalon_readdata;
' X) {8 w. F5 G6 R( @+ q% ^
8 I0 `% w6 I; H1 r. k0 } _# R
output [23:0] FL_ADDR;
* Q8 w# K! ]8 r C' @" ?/ d% D
output FL_WE_N, FL_CE_N, FL_OE_N, FL_RST_N;
( g9 D, K, d. T; }; I! q# D3 f: z- t
# g8 f& @' W0 j: a( D
assign FL_RST_N = reset_n;
0 M: ~0 t6 ]: I7 I$ Z
assign FL_CE_N = avalon_chipselect_n;
$ n& T+ I! _. D& c
assign FL_WE_N = avalon_write_n;
: a# I B" |4 M# C
assign FL_OE_N = avalon_read_n;
# j+ @& R! s+ Q P! Z
assign FL_ADDR = avalon_address;
# q0 Q2 n0 m4 K/ d }6 G
% p- r2 X+ o- k2 J: @
assign FL_DQ = (~avalon_write_n) ? avalon_writedata : 8'hzz;
7 ?$ h/ o) H3 d6 d0 @, f) ?
assign avalon_readdata = FL_DQ;
# g' n3 v( Z. J6 Z% s) u
1 d0 b3 E7 ]4 X2 i, q
endmodule
: H( u/ \$ E0 |) S7 d5 m
, |9 N w2 j0 D9 H
//======================================================================================
% E+ m; M* r4 t2 c3 c
現在我有了flash memory的讀寫控制,在quartus編譯也沒錯誤!
# j- s) ~3 o. O/ I+ `7 m
*.sof檔下載到kit上是否正常~我還不知!
* t+ i/ d( g0 o7 x, u2 i
因為~到這~我已經不知道要怎麼樣去測試這段flash memory的讀寫
, R. T+ M& [! X" W; E, Y' O
要利用這段控制flash的描述啊!
( X/ i9 G6 r# }6 }
懇請先進傳授一下!
7 Y8 v; Z6 C: x8 x: y
另外附上 assignment跟RTL的圖檔、還有SOF檔及POF檔!
5 v" r2 f3 r" Z7 f! l6 K
[attach]3184[/attach]
2 M3 Q T+ p$ J% I0 x
[attach]3185[/attach]
作者:
tommywgt
時間:
2008-3-14 02:15 PM
接顆cpu去測如何? NIOS-II也好啊
作者:
kevin
時間:
2008-3-17 06:42 PM
要先寫一個Flash memory 的簡單controller去做read/write.
+ ]. X( \* |6 a4 [: x7 k1 X
先讀flash memory的data sheet,根據其read/write timing,寫一個state machine
: K, |; E2 s2 H) J) v4 C) {" z
去控制flash memory 讀寫.
歡迎光臨 Chip123 科技應用創新平台 (http://chip123.com/)
Powered by Discuz! X3.2