EDA365电子工程师网
标题:
vhdl程序有错误,恳求高手指点(程序有点长,但只有一个错)
[打印本页]
作者:
chentao88vip
时间:
2012-5-16 20:37
标题:
vhdl程序有错误,恳求高手指点(程序有点长,但只有一个错)
原程序如下:
2 \6 I6 q6 x7 g
library ieee ;
: G0 Q5 E+ [* t* k. H6 X' V: k
use ieee.std_logic_1164.all ;
' n) D2 l) k4 ~2 d3 \; N0 B
use ieee.std_logic_arith.all ;
' t8 T- G# @4 A6 r: |3 i
use work.butter_lib.all ;
& c z8 z6 x: i7 S/ G
use ieee.std_logic_unsigned.all ;
2 o: t V0 ?6 O7 F A/ M
use std.textio.all;
5 c* \/ W2 r9 I& `
. V5 u( X: r5 }# h; k$ _1 O
entity synth_test is
2 B) x: B: a* o/ V$ w3 o
end synth_test ;
- a' J8 J ?& o6 D2 L. h0 s
K3 g4 j/ k/ `
architecture rtl of synth_test is
: d, x/ A- _( U5 {! P
component synth_main
9 V' O; W8 c: x" m
port(
: W1 J/ ?9 n2 Z; T- A
data_io : in std_logic_vector(31 downto 0);
- p3 p, s) o6 `+ [( @7 Y2 E
final_op : out std_logic_vector(31 downto 0) ;
/ x8 S- J( R+ W' y$ D7 w; F
clock_main,clock,enbl,reset,init : in std_logic
- a9 y. e* M( ?( f( A( D, O
);
& _: u" i8 k; a
end component;
& J" G! m% b- J
signal data_io : std_logic_vector(31 downto 0);
4 M' v4 C7 |! Y3 o7 c- T. J
signal final_op : std_logic_vector(31 downto 0) ;
) t9 A: ]2 }' a; z
signal clock_main,clock,enbl,reset,init :std_logic;
, A/ d% E; _* X5 L! G) k; c I0 q4 U
/ N( }1 _! A' X5 a R& I2 l) ^
begin
8 C; x% ^+ d0 S
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);
) w6 B1 A8 C* \% b R! S% ^
1 X2 Y/ m& e1 F5 S3 A2 a! t0 R4 b
process
/ Q# l. k7 _* n' c) x8 G' C# T
variable i : integer := 0 ;
* W: W+ g) P+ w6 M7 u
begin
# F+ Q: o( ?7 [- L# g% O/ s
for i in 1 to 1000 loop
3 F+ r* y, C4 s, ]1 f! V9 W
clock <= '1' ;
6 j* n5 B+ ?8 C$ N
wait for 5 ns ;
/ R9 s5 p$ l* ]3 t. L
clock <= '0' ;
2 u3 G7 E' h, i) P: y
wait for 5 ns ;
0 n4 o, ]" m: ^! J5 N( o' Y5 ~' i
end loop ;
2 m# H/ C2 b# p& Y8 V
end process ;
. i) B+ h6 b4 |' u2 G) c% v
6 a* J9 e7 _7 j" {
process
7 O; U$ P& f+ `# p0 r9 f7 M3 z
variable j : integer := 0 ;
) E+ M3 l6 l1 E+ n! M5 w. Z: `. i, O y
begin
( n5 s! L# }7 n% s. x
for j in 1 to 1000 loop
L0 o# {$ P' b5 a
clock_main <= '1' ;
: G" J) f' _) b% H6 _
wait for 200 ns ;
9 P. d: @ x. y2 l/ h) x
clock_main <= '0' ;
' r+ P, {6 f' {! w. j
wait for 200 ns ;
9 A) G/ m1 |6 x$ M( v$ d
end loop ;
. x8 Y) q( G8 M9 L! l& L# Z; M) E
end process ;
$ C# T. `! l( x- X, t6 W# C: {
5 l: q5 O( u7 H3 V0 i! B
process
1 b4 F8 z/ \& s+ y' ^5 O+ Y, w
file vector_file : text open read_mode is "C:\modeltech_6.5g\examples\rom_ram.in" ;
G* e8 ?& {- i# F3 d/ Z
--file vector_file : text IS IN "C:\modeltech_6.5g\examples\rom_ram.dat" ;
( R. }, t5 i6 w
variable l , l2 : line ;
2 j8 a$ K% l* b
variable q : integer := 31 ;
. Q7 ]- }- p7 a U+ R0 f% L0 T
variable count : integer ;
1 e8 k$ ~9 t0 Z! [
--variable t_a , t_b : std_logic_vector (31 downto 0) ;
) ?, O0 h+ A$ N4 W; i
variable t_a , t_b : std_logic_vector (31 downto 0) ;
* h9 ?, Y0 p+ q/ w3 F
variable space : character ;
$ t6 \5 L# N; a% `' w, W
begin
$ R$ J$ q( e# G0 H
, g5 g y$ ]. X5 U' S; i; b7 }
while not endfile(vector_file) loop
4 ^: f: h2 D, H- i8 X* [8 S
--for count in 1 to 16 loop
# W$ M+ k6 q; _0 D* a+ |- j
q := 31 ;
( [2 C. @' ?% T3 d7 z& A5 G
readline(vector_file , l2) ;
7 i7 R9 |$ X1 b5 X
+ Y6 G8 \. h* g2 d' N0 D
for p in 0 to 31 loop -- data from RAM
5 b8 s/ j: x; v8 @& L
read(l2 , t_b(q)) ;
+ _& L2 H" V6 y2 S) q; H2 @
q := q - 1 ;
3 \8 E3 [1 K5 J. K9 c
end loop ;
3 H3 q# a$ m5 ?; t" v1 r5 }3 i
q := 31 ;
9 U! x7 C& T* q0 G3 n* Z
data_io <= t_b(31 downto 0) ;
8 |( G" [& I& P- s8 h8 x" [; {) B1 A& Z
4 m6 I9 I3 q. C) b9 N
wait for 400 ns ;
7 O4 ~" c, R6 Y5 @7 i
end loop ;
$ [; ]+ d+ S$ I; ]# K* X
wait for 8 ms ;
0 ]8 ]# @! F) `* V! T' s
--wait for 650 ns ;
% {4 ^/ P+ I% A
end process;
* s, c" M: f e t1 m
) d/ L9 b; h9 | ]
-- process to reset
- d$ h/ W$ i, ~: r9 l
process
/ P# v e+ K! {2 o' R
begin
, y5 o' k# f+ ]1 _* f2 f) m; o
reset <= '1' ;
" ]+ r' Q4 U8 \4 y6 w2 N, e
enbl <= '1' ;
: M6 i) x3 C( k
wait for 10 ns ;
0 B9 m8 ^1 z- k5 O
reset <= '0' ;
/ J/ u* B* L9 ]* r5 v" X
wait ;
) x1 N# ~8 E3 ~7 t& I! G7 e
end process ;
3 m% r3 l; G: u1 M. g
1 }. F3 L5 }- ?+ h7 A: A
process
* N' h4 U( s( L5 t% t, Y
begin
) e1 g$ g1 L' ]: I' K
init <= '1' ;
: ^* K2 e$ o0 }
wait for 15 ns ;
- @5 `' Y% m3 [6 }8 b) U
init <= '0' ;
. l) E/ O8 v# [/ Y
wait ;
- M/ ^* b e" a9 B1 U5 R" H* S
end process ;
$ d1 {! \, q' y% f
. ?" [. ^& B3 Y6 \9 \, m8 W' A
end rtl ;
* O% B Q: y* U
$ {) S$ K9 C" k; t
* E" n! Q+ g4 U1 ]; c
- L! A& _/ {$ s" @( y. I; M
用modelsim仿真提示如下错误:No feasible entries for subprogram "read".
9 C) d0 g [" q1 [9 N! h
如果我屏蔽read一行,则程序编程可以通过,我刚学这个,还望高手指点。
作者:
laurentxu
时间:
2012-12-18 22:00
read procedure 不支持你 t_b(q) 的 std_logic 类型。
. O+ j( M- F# B% c/ l: I, {+ {9 T
可以把 t_b(q) 的类型换一下试试
欢迎光临 EDA365电子工程师网 (https://bbs.elecnest.cn/)
Powered by Discuz! X3.2