Difference between revisions of "LineFile data from input files"

From Verific Design Automation FAQ
Jump to: navigation, search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Verific uses the 'LineFile' manager to preserve line/file origination information from HDL source files. This info is annotated on all objects in parse trees and netlist databases, as well as used in the message handler, so that from any object that Verific creates from a RTL design, information is available as to where it came from in the original user RTL designs.
+
Verific uses the 'LineFile' manager to preserve line/file origination information from HDL source files. This info is annotated on all objects in parse trees and netlist databases, as well as used in the message handler, so that from any object that Verific creates from an RTL design, information is available as to where it came from in the user's original RTL design.
  
We have the following compile flags (see util/LineFile.h):
+
We have the following compile flags (see util/LineFile.h and util/VerificSystem.h) :
  
 
# VERIFIC_LINEFILE_INCLUDES_COLUMNS
 
# VERIFIC_LINEFILE_INCLUDES_COLUMNS
 
#: We define a class ColLineFile to have both the starting and ending locations including column info.
 
#: We define a class ColLineFile to have both the starting and ending locations including column info.
 
#: Valid values of NUM_LINE_BITS, NUM_COL_BITS and NUM_FILE_BITS are 1 to 31 bits.
 
#: Valid values of NUM_LINE_BITS, NUM_COL_BITS and NUM_FILE_BITS are 1 to 31 bits.
#: Use as per your requirements. Making (NUM_LINE_BITS + NUM_COL_BITS) <=32 consumes less memory.
+
#: Use as per your requirements. Making (NUM_LINE_BITS + NUM_COL_BITS) <= 32 will consume less memory.
 
#: You can use 31 as NUM_FILE_BITS without any extra memory overhead.
 
#: You can use 31 as NUM_FILE_BITS without any extra memory overhead.
 
# VERIFIC_LARGE_LINEFILE
 
# VERIFIC_LARGE_LINEFILE
 
#: We still define the class ColLineFile, but it has only a single starting or ending location and does not include column info.
 
#: We still define the class ColLineFile, but it has only a single starting or ending location and does not include column info.
 
#: Valid values of NUM_LINE_BITS and NUM_FILE_BITS are 1 to 31 bits.
 
#: Valid values of NUM_LINE_BITS and NUM_FILE_BITS are 1 to 31 bits.
#: Use as per your requirements. Making (NUM_LINE_BITS + NUM_FILE_BITS) <=32 bit consumes less memory.
+
#: Use as per your requirements. Making (NUM_LINE_BITS + NUM_FILE_BITS) <= 32 will consume less memory.
# VERIFIC_LARGE_LINEFILE_FOR_64 (only for 64 bit windows since long is 4 byte there)
+
# VERIFIC_LARGE_LINEFILE_FOR_64 (only for 64-bit Windows since long is 4 bytes there)
#: Same as (2) above but without the class and only for 64 bit windows systems.
+
#: Same as (2) above but without the class and only for 64-bit Windows systems.
 +
# VERILOG_STORE_ENDING_LINEFILE_INFO
 +
#: If this compile flag is ON and  VERIFIC_LINEFILE_INCLUDES_COLUMNS is OFF, VeriModuleItem::StartingLinefile() API and VeriModuleItem::EndingLinefile() API will return the correct linefile as per their names. These two functions work for all derived classes of VeriModuleItem (VeriModule, VeriStatement, ....).
 +
#: Note that the compile flag VERILOG_USE_STARTING_LINEFILE_INFO works independently from VERILOG_STORE_ENDING_LINEFILE_INFO.  It returns linefile of starting or ending location of a construct via Linefile() API.
  
These compile flags are mutually exclusive.
+
The compile flags (1), (2), and (3) above are mutually exclusive. You should have only one of them defined according to your requirements.
You should have only one of them defined according to your requirements.
+
  
If you do not define any of the above compile flags, by default we use the following:
+
If you do not define any of the above compile flags, Verific uses the following by default:
  
* On a 64 bit (non-windows) system, line number and file-id are encoded into a 64 bit unsigned long. You need to set (NUM_LINE_BITS + NUM_FILE_BITS) <= 64
+
* On a 64-bit (non-Windows) system, line number and file-id are encoded into a 64-bit unsigned long. You need to set (NUM_LINE_BITS + NUM_FILE_BITS) <= 64
  
* On a 32 bit (and 64 bit windows) system, line number and file-id are encoded into a 32 bit unsigned long. You need to set (NUM_LINE_BITS + NUM_FILE_BITS) <= 32
+
* On a 32-bit (and 64-bit Windows) system, line number and file-id are encoded into a 32-bit unsigned long. You need to set (NUM_LINE_BITS + NUM_FILE_BITS) <= 32
  
 
If you do not need column numbers or both starting and ending locations, you can turn off column info.
 
If you do not need column numbers or both starting and ending locations, you can turn off column info.
  
If the number of files overflows NUM_FILE_BITS, we do issue "WARNING: number of file names exceeded maximum of %d" for too many files. However, producing the same warning for lines/columns will produce too many of them.
+
If the number of files overflows NUM_FILE_BITS, we issue "WARNING: number of file names exceeded maximum of %d" when there are too many files. However, producing the same warning for lines/columns would result in too many messages.

Latest revision as of 16:23, 31 August 2021

Verific uses the 'LineFile' manager to preserve line/file origination information from HDL source files. This info is annotated on all objects in parse trees and netlist databases, as well as used in the message handler, so that from any object that Verific creates from an RTL design, information is available as to where it came from in the user's original RTL design.

We have the following compile flags (see util/LineFile.h and util/VerificSystem.h) :

  1. VERIFIC_LINEFILE_INCLUDES_COLUMNS
    We define a class ColLineFile to have both the starting and ending locations including column info.
    Valid values of NUM_LINE_BITS, NUM_COL_BITS and NUM_FILE_BITS are 1 to 31 bits.
    Use as per your requirements. Making (NUM_LINE_BITS + NUM_COL_BITS) <= 32 will consume less memory.
    You can use 31 as NUM_FILE_BITS without any extra memory overhead.
  2. VERIFIC_LARGE_LINEFILE
    We still define the class ColLineFile, but it has only a single starting or ending location and does not include column info.
    Valid values of NUM_LINE_BITS and NUM_FILE_BITS are 1 to 31 bits.
    Use as per your requirements. Making (NUM_LINE_BITS + NUM_FILE_BITS) <= 32 will consume less memory.
  3. VERIFIC_LARGE_LINEFILE_FOR_64 (only for 64-bit Windows since long is 4 bytes there)
    Same as (2) above but without the class and only for 64-bit Windows systems.
  4. VERILOG_STORE_ENDING_LINEFILE_INFO
    If this compile flag is ON and VERIFIC_LINEFILE_INCLUDES_COLUMNS is OFF, VeriModuleItem::StartingLinefile() API and VeriModuleItem::EndingLinefile() API will return the correct linefile as per their names. These two functions work for all derived classes of VeriModuleItem (VeriModule, VeriStatement, ....).
    Note that the compile flag VERILOG_USE_STARTING_LINEFILE_INFO works independently from VERILOG_STORE_ENDING_LINEFILE_INFO. It returns linefile of starting or ending location of a construct via Linefile() API.

The compile flags (1), (2), and (3) above are mutually exclusive. You should have only one of them defined according to your requirements.

If you do not define any of the above compile flags, Verific uses the following by default:

  • On a 64-bit (non-Windows) system, line number and file-id are encoded into a 64-bit unsigned long. You need to set (NUM_LINE_BITS + NUM_FILE_BITS) <= 64
  • On a 32-bit (and 64-bit Windows) system, line number and file-id are encoded into a 32-bit unsigned long. You need to set (NUM_LINE_BITS + NUM_FILE_BITS) <= 32

If you do not need column numbers or both starting and ending locations, you can turn off column info.

If the number of files overflows NUM_FILE_BITS, we issue "WARNING: number of file names exceeded maximum of %d" when there are too many files. However, producing the same warning for lines/columns would result in too many messages.