EDA365电子工程师网
标题:
vhdl程序有错误,恳求高手指点(程序有点长,但只有一个错)
[打印本页]
作者:
chentao88vip
时间:
2012-5-16 20:37
标题:
vhdl程序有错误,恳求高手指点(程序有点长,但只有一个错)
原程序如下:
6 E5 x1 Y, E# H: J) H( O- |! g1 x
library ieee ;
4 R# f5 e3 F8 n7 J; t( i. K3 o3 ]
use ieee.std_logic_1164.all ;
+ j% u0 ~/ {) b
use ieee.std_logic_arith.all ;
+ ` b' \4 G7 a' s4 f
use work.butter_lib.all ;
: z' X% U9 F |0 }- s
use ieee.std_logic_unsigned.all ;
7 J0 i; h4 @0 `0 Q- H+ k
use std.textio.all;
' X; a0 k$ ]0 V+ P$ ^1 |3 U
, R/ \* Z/ p) _1 h! s. M1 B. k
entity synth_test is
4 n' u0 U+ j3 L8 p4 q) e: l
end synth_test ;
4 E) R& ]2 D2 o9 t. q: K
, q. ]! M# o- B& |) A
architecture rtl of synth_test is
7 l. ~1 B# R* {0 j
component synth_main
; N( o% z+ P+ Q7 X d7 _
port(
% ?: n% ~0 \7 {8 A& o5 t+ @5 X
data_io : in std_logic_vector(31 downto 0);
& }5 h) f! q% g8 p3 J, `% ~0 j
final_op : out std_logic_vector(31 downto 0) ;
3 q5 ?! m$ |- W2 l6 D9 \4 X
clock_main,clock,enbl,reset,init : in std_logic
0 Z3 }: l5 o! s! G& L. f5 s7 f. a$ m
);
" y- n P; ]/ X' g+ L! c
end component;
' ~: t7 S0 Z- o0 E( {2 k
signal data_io : std_logic_vector(31 downto 0);
{9 Z W+ P9 O# [6 D$ N* t
signal final_op : std_logic_vector(31 downto 0) ;
: M+ y# f" |( m0 y' B" w. D: e
signal clock_main,clock,enbl,reset,init :std_logic;
9 n0 {( w( d1 K
4 i' p {7 @1 h0 F+ y' m+ p
begin
# m! Y+ `3 q t* l2 A/ @) i
dut:synth_main port map(data_io=>data_io,final_op=>final_op,clock_main=>clock_main,clock=>clock,enbl=>enbl,reset=>reset,init=>init);
9 T) Z# s' f9 z) ^
0 O. ^2 v, F2 m9 p1 n1 L$ v
process
+ f5 @" V& k3 _' }
variable i : integer := 0 ;
' N4 g$ O" R1 _& {0 Z2 N) s
begin
. u, c/ J4 m& Z0 r) p) ?1 [2 d3 K
for i in 1 to 1000 loop
# F- e' H, \" f i) E4 O
clock <= '1' ;
# I9 Z, o& j6 m- h3 ~
wait for 5 ns ;
# W" M& A7 Y8 k4 ?
clock <= '0' ;
& B3 k4 t4 v. ^% ?1 \
wait for 5 ns ;
* `" B- b9 @0 ~
end loop ;
0 E9 U7 a( J4 X* A
end process ;
2 @! }' L/ h5 {6 D- q
. K. K7 c& P# A
process
! Q4 H' I- @1 P' n
variable j : integer := 0 ;
% J' f: `( j1 r) g, v) v
begin
4 K2 _2 q# K# X2 p1 h& z6 Y+ V
for j in 1 to 1000 loop
4 z% d4 E% W ~) D; L
clock_main <= '1' ;
# X+ c9 J! l0 p0 h
wait for 200 ns ;
" K$ F$ ~3 B' R4 j) ]6 f
clock_main <= '0' ;
! s9 ~5 ?3 d# p9 K
wait for 200 ns ;
* E2 Z; e( r, E" p) [
end loop ;
/ O, H& U2 `+ C* j3 S9 H
end process ;
: g8 i3 z4 S/ c9 A; n4 Q' B
5 G8 [( X1 G4 L- l
process
7 D6 o" O2 t4 g* {0 e
file vector_file : text open read_mode is "C:\modeltech_6.5g\examples\rom_ram.in" ;
8 O6 ]2 ^0 Y3 R! H' `: g
--file vector_file : text IS IN "C:\modeltech_6.5g\examples\rom_ram.dat" ;
6 ^' \8 K: d9 i) O- z5 [$ `1 _/ t
variable l , l2 : line ;
. |7 i) d( e a/ |
variable q : integer := 31 ;
6 D+ ]: a: `3 J& n$ j
variable count : integer ;
1 w' ^% r8 g, R2 J% \# o
--variable t_a , t_b : std_logic_vector (31 downto 0) ;
( v# m8 D/ P; g8 E
variable t_a , t_b : std_logic_vector (31 downto 0) ;
# A4 Q/ N; ^9 n: b6 c4 K( R
variable space : character ;
1 j0 H' T4 p0 {5 y, h; h
begin
' _7 _5 L6 i! I
- s+ G! O6 U! i X
while not endfile(vector_file) loop
T; y& z( M, ~, S, @! s# T% e
--for count in 1 to 16 loop
. s: A1 `0 V1 Z, G! @% w
q := 31 ;
: h8 {1 k% }6 C9 S) e2 r+ ]
readline(vector_file , l2) ;
* w% F: E5 L5 l7 X2 n, e$ Z$ i
7 H0 O8 x# N7 b# _+ I
for p in 0 to 31 loop -- data from RAM
. v1 J4 @3 ]8 G Z$ y! v
read(l2 , t_b(q)) ;
- W( M. [7 |5 H0 {) }
q := q - 1 ;
) z( z7 f. ]) m) e
end loop ;
8 }* `; K3 e6 n: u
q := 31 ;
" A& W; q0 I: ]& L" u4 \
data_io <= t_b(31 downto 0) ;
. L, r& C( t+ C2 c% j7 e1 R
$ v6 I3 |5 g s/ Q" P, V: g
wait for 400 ns ;
3 K* Q( Z! s- q V
end loop ;
. K1 K7 R( z4 G" M9 r6 M; i$ S
wait for 8 ms ;
! l( w& ]. L7 O8 L
--wait for 650 ns ;
- `+ X$ T# k" G" M( ^3 e
end process;
( P- ] e4 ^$ d* t
( r; O/ Z K/ D! C/ m
-- process to reset
3 l% s- D5 t8 H' e5 ]
process
. x) @* F% ?" t/ s; v. l" S: z# R) d
begin
% ]0 B- U1 o* z
reset <= '1' ;
# `7 U3 }. a7 @! F) [5 z
enbl <= '1' ;
2 e0 q( q# Q, O; G; D
wait for 10 ns ;
9 g4 O h3 G. Z! |
reset <= '0' ;
! |$ y; C5 S- E4 D, t! i! `
wait ;
! S9 ~6 h% \5 l& q
end process ;
% q. V* }2 v! t# X/ ?
/ u( f9 i6 i6 y- J0 r' a; |6 A8 F
process
- y$ i* |/ R* |& ?/ W2 D
begin
/ b% E/ i1 y: m! @" ?. ?. J
init <= '1' ;
( _9 @+ S6 v8 e7 o7 s
wait for 15 ns ;
# i: h- c# `0 D
init <= '0' ;
4 X4 X3 V4 w% S. |" ^( a
wait ;
$ E* {4 Z9 E# U9 N
end process ;
2 p1 Q5 e0 w" w+ N: B6 r. j
. m9 ~- A$ y& B: V, J7 y0 W3 B
end rtl ;
! X% N7 x: k; P0 X( u* \" s8 a, S1 |
) a! L! [' \0 ^ T/ y1 R0 Y, c
3 v* p I" _0 T( a+ i! O
% p# S4 Z7 [5 K4 l3 a( G3 f
用modelsim仿真提示如下错误:No feasible entries for subprogram "read".
; Y% U; w" {2 q A0 s
如果我屏蔽read一行,则程序编程可以通过,我刚学这个,还望高手指点。
作者:
laurentxu
时间:
2012-12-18 22:00
read procedure 不支持你 t_b(q) 的 std_logic 类型。
; F. X6 ]$ K: B. ?( s; z% w8 L& @
可以把 t_b(q) 的类型换一下试试
欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/)
Powered by Discuz! X3.2