TWiki
>
P1076/Ballots Web
>
Vhdl2019CollectedRequirements
>
MetavalueConditionalConversions
(revision 3) (raw view)
Edit
Attach
---+ Flag Metavalues detected by ?? %TOC% ---++ Proposal Information * Current Owner: JimLewis, ... * Contributors: JimLewis, ... * Date Proposed: 2014-October-16 * Date Last Updated: 2014-October-16 * Priority: * Complexity: * Focus: All * Related Issues: None * Competing Issues: None ---++ Issue Summary When ?? receives a metavalue (U, X, Z, W, -) it quietly returns false <verbatim>function "??" (l : STD_ULOGIC) return BOOLEAN is begin return l = '1' or l = 'H'; end function "??";</verbatim> Stack Overflow [[http://stackoverflow.com/questions/25737877/how-to-get-simulation-warning-when-comparing-std-logic-with-x][post]] identifies concerns about correctly handling metavalues. In fact, if you look at "="[unsigned, unsigned return unsigned], you will note that if one of the inputs has an 'X', an assertion warning is produced. ---++ Proposal Add an assertion to ?? so that it produces an ERROR <verbatim>function "??" (l : STD_ULOGIC) return BOOLEAN is begin assert not is_x(l) or NO_WARNING report "STD_LOGIC_1164.""??"": metavalue detected, returning FALSE" severity warning; return l = '1' or l = 'H'; end function "??"; </verbatim> Often I prefer the readability of if over assert: <verbatim>function "??" (l : STD_ULOGIC) return BOOLEAN is begin if is_x(l) and not NO_WARNING then report "STD_LOGIC_1164.""??"": metavalue detected, returning FALSE" severity warning; end if ; return l = '1' or l = 'H'; end function "??";</verbatim> Requires edit of LRM 9.2.9. Change: NOTE 2—The condition operator is defined for type STD_ULOGIC defined in package STD_LOGIC_1164 (see 16.7).<br />Conversion of a value of type STD_ULOGIC converts '1' and 'H' to TRUE and all other values to FALSE. To: NOTE 2—The condition operator is defined for type STD_ULOGIC defined in package STD_LOGIC_1164 (see 16.7).<br />Conversion of a value of type STD_ULOGIC converts '1' and 'H' to TRUE and all other values to FALSE. If metavalue is detected, an assert severity WARNING is issued. ---++ Concerns May slow down evaluation of conditional expressions ---++ Comments ---++ Supporters
Edit
|
Attach
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2020-02-17 - 15:34:56 -
TWikiGuest
P1076/Ballots
Log In
or
Register
P1076/Ballots Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
Webs
Main
P1076
Ballots
LCS2016_080
P10761
P1647
P16661
P1685
P1734
P1735
P1778
P1800
P1801
Sandbox
TWiki
VIP
VerilogAMS
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback