|
LCS-2016-015b |
|
1 {21-Feb-2017} 2 {22-Feb-2017} 3 {14-Mar-2017} |
|
14-Mar-2017 |
|
Voting |
|
Patrick Lehmann |
|
Main.PatrickLehmann |
|
- - - - |
|
Get source code positions of named entities. |
package pkg is function foo return boolean is end package; package body pkg is function foo return boolean is begin report "foo: " & INTEGER'image(foo'LINE_NUMBER); end function; end package body;This returns "foo: 6". But not
report
or and an expression can be used: INTEGER'image(foo'LINE_NUMBER + 2)
.
Version 2: FILE_NAME
to FILE_PATH
(full name)
FILE_NAME
for the simple file name
E'FILE_NAME | Kind: | Value |
Prefix: | Any prefix E that denotes a named entity. | |
Result type: | STRING. | |
Result: | The name of the design file without the file path in which E was fully defined. | |
E'FILE_PATH | Kind: | Value |
Prefix: | Any prefix E that denotes a named entity. | |
Result type: | STRING. | |
Result: | The fully resolved absolute path without the file name of the design file in which E was fully defined. | |
E'FILE_LINE | Kind: | Value |
Prefix: | Any prefix E that denotes a named entity. | |
Result type: | POSITIVE. | |
Result: | The line number in the design file where the first lexical element of E appeared and E was fully defined. |
E'LINE_NUMBER
for an architecture declaration? Is it the end?
-- Jim Lewis - 2017-03-11
JL: What is E'LINE_NUMBER
for an architecture declaration? architecture
appears. I fixed the text in version 2.
-- Patrick Lehmann - 2017-03-14
@TODO: at meeting 16-Mar: Does lots of cool things. Got any compelling use models?
-- Jim Lewis - 2017-03-16
LCS 015 / 015a can only be used for sequential code. This LCS allows a user to get line and file information of all declared VHDL entities for reporting purposes.
-- Patrick Lehmann - 2017-03-20
For the use case of locating a log entry made by a report statement this becomes less convenient for the user when compared to having a function. Each report statement would need a unique label. For me the whole point is to get a location of a log entry without manually inserting such IDs.
Regardless if attributes or functions are used I wouldn't create many such report statements before I create a convenience function that inserts that automatically. In VUnit we solve that by preprocessing the VHDL code but the call path LCS is what I really need so that I can get the caller location.
Attributes can also provide the location of any entity but I think we need to identify the value adding use cases for that. Without a strong use case I don't think this will be worth the effort.
-- Lars Asplund - 2017-03-23