打印

VHDL自定义type的问题

[复制链接]
1751|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
reset88|  楼主 | 2008-5-3 17:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在库文件中定义了一个类型reg_index_t:
    type reg_index_t is range 0 to 31; 然后在同一个库中定义了几个procedure,有的procedure定义了reg_index_t类型的信号,比如: 

procedure instr_decode ( 
    signal instr : in std_logic_vector( 0 to 31 );
    signal op : out std_logic_vector( 0 to 3 );
    signal ra : out reg_index_t;
    signal rb : out reg_index_t ); 

用modelsim编译这个库文件的时候出现无数个错误,都和这个reg_index_t有关。一种错误是: 
# ** Error: E:/Design/Courses/ESE545/Src/mylib/mylib.vhd(247): Cannot resolve slice name as type work.mypack.reg_index_t. 

还有一种: 
# ** Error: E:/Design/Courses/ESE545/Src/mylib/mylib.vhd(283): Aggregate expression cannot be scalar type work.mypack.reg_index_t. 

对应的都是对这个类型的signal赋值语句: 

L247: ra <= instr(20 to 24); 
L283: ra <= ( others => '0' ); 

看不出这个类型的定义有什么问题,哪位达人指点一下吧。谢谢。

相关帖子

沙发
neil3w| | 2008-5-3 20:06 | 只看该作者

类型不匹配?

类型不匹配?。。。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

2

主题

1

帖子

0

粉丝