2014-11-24 02:06:10 +00:00
// -*- mode: C++; c-file-style: "cc-mode" -*-
//=============================================================================
//
2021-03-20 21:46:00 +00:00
// Code available from: https://verilator.org
2014-11-24 02:06:10 +00:00
//
2024-01-01 08:19:59 +00:00
// Copyright 2001-2024 by Wilson Snyder. This program is free software; you
2020-03-21 15:24:24 +00:00
// can redistribute it and/or modify it under the terms of either the GNU
// Lesser General Public License Version 3 or the Perl Artistic License
// Version 2.0.
// SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
2014-11-24 02:06:10 +00:00
//
//=============================================================================
///
/// \file
2021-03-20 21:46:00 +00:00
/// \brief Verilated coverage item keys internal header
///
/// This file is not part of the Verilated public-facing API.
/// It is only for internal use by the Verilated library coverage routines.
2014-11-24 02:06:10 +00:00
///
//=============================================================================
2021-03-04 02:57:07 +00:00
# ifndef VERILATOR_VERILATED_COV_KEY_H_
# define VERILATOR_VERILATED_COV_KEY_H_
2014-11-24 02:06:10 +00:00
# include "verilatedos.h"
# include <string>
//=============================================================================
// Data used to edit below file, using vlcovgen
# define VLCOVGEN_ITEM(string_parsed_by_vlcovgen)
2020-04-14 02:51:35 +00:00
// clang-format off
2020-12-23 21:54:05 +00:00
VLCOVGEN_ITEM ( " 'name':'column', 'short':'n', 'group':1, 'default':0, 'descr':'Column number for the item. Used to disambiguate multiple coverage points on the same line number' " )
VLCOVGEN_ITEM ( " 'name':'filename', 'short':'f', 'group':1, 'default':None, 'descr':'Filename of the item' " )
VLCOVGEN_ITEM ( " 'name':'linescov', 'short':'S', 'group':1, 'default':'', 'descr':'List of comma-separated lines covered' " )
VLCOVGEN_ITEM ( " 'name':'per_instance','short':'P', 'group':1, 'default':0, 'descr':'True if every hierarchy is independently counted; otherwise all hierarchies will be combined into a single count' " )
VLCOVGEN_ITEM ( " 'name':'thresh', 'short':'s', 'group':1, 'default':None, 'descr':'Number of hits to consider covered (aka at_least)' " )
VLCOVGEN_ITEM ( " 'name':'type', 'short':'t', 'group':1, 'default':'', 'descr':'Type of coverage (block, line, fsm, etc)' " )
2014-11-24 02:06:10 +00:00
// Bin attributes
2020-12-23 21:54:05 +00:00
VLCOVGEN_ITEM ( " 'name':'comment', 'short':'o', 'group':0, 'default':'', 'descr':'Textual description for the item' " )
VLCOVGEN_ITEM ( " 'name':'hier', 'short':'h', 'group':0, 'default':'', 'descr':'Hierarchy path name for the item' " )
VLCOVGEN_ITEM ( " 'name':'lineno', 'short':'l', 'group':0, 'default':0, 'descr':'Line number for the item' " )
VLCOVGEN_ITEM ( " 'name':'weight', 'short':'w', 'group':0, 'default':None, 'descr':'For totaling items, weight of this item' " )
2020-04-14 02:51:35 +00:00
// clang-format on
2014-11-24 02:06:10 +00:00
// VLCOVGEN_CIK_AUTO_EDIT_BEGIN
# define VL_CIK_COLUMN "n"
# define VL_CIK_COMMENT "o"
# define VL_CIK_FILENAME "f"
# define VL_CIK_HIER "h"
# define VL_CIK_LINENO "l"
2020-06-03 01:42:24 +00:00
# define VL_CIK_LINESCOV "S"
2014-11-24 02:06:10 +00:00
# define VL_CIK_PER_INSTANCE "P"
# define VL_CIK_THRESH "s"
# define VL_CIK_TYPE "t"
# define VL_CIK_WEIGHT "w"
// VLCOVGEN_CIK_AUTO_EDIT_END
2017-10-27 00:05:42 +00:00
//=============================================================================
// VerilatedCovKey
2021-03-20 21:46:00 +00:00
// Namespace-style static class for \internal use.
2017-10-27 00:05:42 +00:00
2020-11-19 02:32:16 +00:00
class VerilatedCovKey final {
2014-11-24 02:06:10 +00:00
public :
2021-03-20 21:46:00 +00:00
// Return the short key code for a given a long coverage key
2017-10-27 00:05:42 +00:00
static std : : string shortKey ( const std : : string & key ) VL_PURE {
2018-07-19 01:25:21 +00:00
// VLCOVGEN_SHORT_AUTO_EDIT_BEGIN
if ( key = = " column " ) return VL_CIK_COLUMN ;
if ( key = = " comment " ) return VL_CIK_COMMENT ;
if ( key = = " filename " ) return VL_CIK_FILENAME ;
if ( key = = " hier " ) return VL_CIK_HIER ;
if ( key = = " lineno " ) return VL_CIK_LINENO ;
2020-05-31 19:52:17 +00:00
if ( key = = " linescov " ) return VL_CIK_LINESCOV ;
2018-07-19 01:25:21 +00:00
if ( key = = " per_instance " ) return VL_CIK_PER_INSTANCE ;
if ( key = = " thresh " ) return VL_CIK_THRESH ;
if ( key = = " type " ) return VL_CIK_TYPE ;
if ( key = = " weight " ) return VL_CIK_WEIGHT ;
// VLCOVGEN_SHORT_AUTO_EDIT_END
return key ;
2014-11-24 02:06:10 +00:00
}
} ;
2018-11-29 00:59:10 +00:00
# endif // guard