|
// Read Memory% c v3 l* ?$ e
task read_mem;& |" `4 o3 n* P/ J3 Y) o( o2 k: h
input [full_mem_bits - 1 : 0] addr;
6 c7 P* g1 a$ B1 A `, t0 L output [DQ_BITS - 1 : 0] data;1 X4 s- a" k+ U/ Z, ]* j
reg [part_mem_bits : 0] i;9 c, J( v- H' \) C- [1 F. _/ W7 b) x, u8 z
begin3 b( H3 e& Q7 ]/ b4 A) @
`ifdef FULL_MEM
; y* e! n+ e4 J data = mem_array[addr];
- s3 O: \: r. P# \. v l, y4 P`else& b e5 r- s% n& J
begin : loop
( s: _$ B, P& f& V) y7 Z. L1 I8 g for (i = 0; i < mem_used; i = i + 1) begin' U/ x" t# |1 ]/ V6 z0 W# g0 l
if (addr_array === addr) begin
3 n) S( G: G3 |* \3 w: H% t1 t disable loop;
/ ^# l5 Y* k# V end1 q. N: }9 ?' M9 w7 Z2 d* \) ^
end4 m% _( C3 A6 `9 E$ d
end
9 K) ^7 ?; L, u8 _3 `# j1 c: s if (i <= mem_used) begin
, ?* g7 C2 M! _3 v. x0 i" B data = mem_array;
# {7 ] x. A3 M end% Y& S/ {) x2 K0 v
`endif
, R( l! a5 T3 u9 _0 q# y end
6 N+ x% m; G/ _+ t endtask/ }. j% c5 C0 l
% V0 N. [* a$ S2 n h9 H
===========================================================================5 J5 n) w. y8 H* }2 ~1 f9 C6 |. z
上面這一段紅色在modelsim模擬時沒有問題!
/ z! X3 j9 ^! k$ \" R9 U7 q) Z5 ~但是在quartus編譯時被列為error!' N0 o( l& Z4 F8 z+ O
想請問一下差別在哪裡! |
|