在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 1897|回复: 2

问个VHDL的语法问题

[复制链接]
发表于 2008-1-15 23:02:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
-- function Delta is actually an arithmatic shift right
        -- This strange construction is needed for compatibility with Xilinx WebPack
        function Delta(Arg : signed; Cnt : natural) return signed is
                variable tmp : signed(Arg'range);
                constant lo : integer := Arg'high -cnt +1;
        begin
                for n in Arg'high downto lo loop
                        tmp(n) := Arg(Arg'high);
                end loop;
                for n in Arg'high -cnt downto 0 loop
                        tmp(n) := Arg(n +cnt);
                end loop;
                return tmp;
        end function Delta;

想问问这个Arg'high是什么意思!我是新手,请多帮助!
发表于 2008-1-18 04:08:12 | 显示全部楼层
VHDL Predefined Attributes  The syntax of an attribute is some named entity followed
by an apostrophe and one of the following attribute names.
A parameter list is used with some attributes.
Generally: T represents any type, A represents any array
or constrained array type, S represents any signal and
E represents a named entity.

T'BASE       is the base type of the type T
T'LEFT       is the leftmost value of type T. (Largest if downto)
T'RIGHT      is the rightmost value of type T. (Smallest if downto)
T'HIGH       is the highest value of type T.
T'LOW        is the lowest value of type T.
T'ASCENDING  is boolean true if range of T defined with to .
T'IMAGE(X)   is a string representation of X that is of type T.
T'VALUE(X)   is a value of type T converted from the string X.
T'POS(X)     is the integer position of X in the discrete type T.
T'VAL(X)     is the value of discrete type T at integer position X.
T'SUCC(X)    is the value of discrete type T that is the successor of X.
T'PRED(X)    is the value of discrete type T that is the predecessor of X.
T'LEFTOF(X)  is the value of discrete type T that is left of X.
T'RIGHTOF(X) is the value of discrete type T that is right of X.
A'LEFT       is the leftmost subscript of array A or constrained array type.
A'LEFT(N)    is the leftmost subscript of dimension N of array A.
A'RIGHT      is the rightmost subscript of array A or constrained array type.
A'RIGHT(N)   is the rightmost subscript of dimension N of array A.
A'HIGH       is the highest subscript of array A or constrained array type.
A'HIGH(N)    is the highest subscript of dimension N of array A.
A'LOW        is the lowest subscript of array A or constrained array type.
A'LOW(N)     is the lowest subscript of dimension N of array A.
A'RANGE      is the range  A'LEFT to A'RIGHT  or  A'LEFT downto A'RIGHT .
A'RANGE(N)   is the range of dimension N of A.
A'REVERSE_RANGE  is the range of A with to and downto reversed.
A'REVERSE_RANGE(N)  is the REVERSE_RANGE of dimension N of array A.
A'LENGTH     is the integer value of the number of elements in array A.
A'LENGTH(N)  is the number of elements of dimension N of array A.
A'ASCENDING  is boolean true if range of A defined with to .
A'ASCENDING(N)  is boolean true if dimension N of array A defined with to .
S'DELAYED(t) is the signal value of S at time now - t .
S'STABLE     is true if no event is occurring on signal S.
S'STABLE(t)  is true if no even has occurred on signal S for t units of time.
S'QUIET      is true if signal S is quiet. (no event this simulation cycle)
S'QUIET(t)   is true if signal S has been quiet for t units of time.
S'TRANSACTION  is a bit signal, the inverse of previous value each cycle S is active.
S'EVENT      is true if signal S has had an event this simulation cycle.
S'ACTIVE     is true if signal S is active during current simulation cycle.
S'LAST_EVENT is the time since the last event on signal S.
S'LAST_ACTIVE  is the time since signal S was last active.
S'LAST_VALUE is the previous value of signal S.
S'DRIVING    is false only if the current driver of S is a null transaction.
S'DRIVING_VALUE  is the current driving value of signal S.
E'SIMPLE_NAME  is a string containing the name of entity E.
E'INSTANCE_NAME  is a string containing the design hierarchy including E.
E'PATH_NAME  is a string containing the design hierarchy of E to design root.
发表于 2008-1-18 04:15:43 | 显示全部楼层
不好意思,刚才格式没弄好……

VHDL Predefined Attributes

The syntax of an attribute is some named entity followed
by an apostrophe and one of the following attribute names.
A parameter list is used with some attributes.
Generally: T represents any type, A represents any array
or constrained array type, S represents any signal and
E represents a named entity.


T'BASE       is the base type of the type T
T'LEFT       is the leftmost value of type T. (Largest if downto)
T'RIGHT      is the rightmost value of type T. (Smallest if downto)
T'HIGH       is the highest value of type T.
T'LOW        is the lowest value of type T.
T'ASCENDING  is boolean true if range of T defined with to .
T'IMAGE(X)   is a string representation of X that is of type T.
T'VALUE(X)   is a value of type T converted from the string X.
T'POS(X)     is the integer position of X in the discrete type T.
T'VAL(X)     is the value of discrete type T at integer position X.
T'SUCC(X)    is the value of discrete type T that is the successor of X.
T'PRED(X)    is the value of discrete type T that is the predecessor of X.
T'LEFTOF(X)  is the value of discrete type T that is left of X.
T'RIGHTOF(X) is the value of discrete type T that is right of X.
A'LEFT       is the leftmost subscript of array A or constrained array type.
A'LEFT(N)    is the leftmost subscript of dimension N of array A.
A'RIGHT      is the rightmost subscript of array A or constrained array type.
A'RIGHT(N)   is the rightmost subscript of dimension N of array A.
A'HIGH       is the highest subscript of array A or constrained array type.
A'HIGH(N)    is the highest subscript of dimension N of array A.
A'LOW        is the lowest subscript of array A or constrained array type.
A'LOW(N)     is the lowest subscript of dimension N of array A.
A'RANGE      is the range  A'LEFT to A'RIGHT  or  A'LEFT downto A'RIGHT .
A'RANGE(N)   is the range of dimension N of A.
A'REVERSE_RANGE  is the range of A with to and downto reversed.
A'REVERSE_RANGE(N)  is the REVERSE_RANGE of dimension N of array A.
A'LENGTH     is the integer value of the number of elements in array A.
A'LENGTH(N)  is the number of elements of dimension N of array A.
A'ASCENDING  is boolean true if range of A defined with to .
A'ASCENDING(N)  is boolean true if dimension N of array A defined with to .
S'DELAYED(t) is the signal value of S at time now - t .
S'STABLE     is true if no event is occurring on signal S.
S'STABLE(t)  is true if no even has occurred on signal S for t units of time.
S'QUIET      is true if signal S is quiet. (no event this simulation cycle)
S'QUIET(t)   is true if signal S has been quiet for t units of time.
S'TRANSACTION  is a bit signal, the inverse of previous value each cycle S is active.
S'EVENT      is true if signal S has had an event this simulation cycle.
S'ACTIVE     is true if signal S is active during current simulation cycle.
S'LAST_EVENT is the time since the last event on signal S.
S'LAST_ACTIVE  is the time since signal S was last active.
S'LAST_VALUE is the previous value of signal S.
S'DRIVING    is false only if the current driver of S is a null transaction.
S'DRIVING_VALUE  is the current driving value of signal S.
E'SIMPLE_NAME  is a string containing the name of entity E.
E'INSTANCE_NAME  is a string containing the design hierarchy including E.
E'PATH_NAME  is a string containing the design hierarchy of E to design root.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-28 01:45 , Processed in 0.019484 second(s), 8 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表