diag_sand_signals.h (2874B)
1 /* 2 * ! \file diag_sand_signals.h Purpose: shell command for signal ecosystem 3 */ 4 /* 5 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 6 * 7 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 8 */ 9 #ifndef DIAG_DNX_DSIG_H_INCLUDED 10 #define DIAG_DNX_DSIG_H_INCLUDED 11 12 #include <shared/bsl.h> 13 #include <appl/diag/sand/diag_sand_framework.h> 14 15 extern sh_sand_cmd_t sh_sand_signal_cmds[]; 16 extern sh_sand_man_t sh_sand_signal_man; 17 18 extern const char cmd_sand_signal_usage[]; 19 extern const char cmd_sand_signal_desc[]; 20 21 /* Serves Legacy invocation */ 22 cmd_result_t cmd_sand_signal( 23 int unit, 24 args_t * args); 25 26 /* 27 * takes a hex string and converts it to a hex number 28 * returns val - pointer to uint32 array 29 */ 30 shr_error_e hex2int( 31 char *hex, 32 uint32 *val, 33 uint8 verbosity); 34 35 /** 36 * \brief 37 * Finds a signal according to the specified parameters. The resulting parsed signal tree resides as 38 * the last entry in *sig_list. 39 * By default, the signals are looked up using the following flags: 40 * SIGNALS_MATCH_EXPAND 41 * SIGNALS_MATCH_EXACT 42 * SIGNALS_MATCH_RETRY 43 * If more flags are required, they can be passed as the parameter extra_flags. 44 * If a NULL pointer is passed as *sig_list, (i.e outside this function, sig_list is declared, but 45 * nulled, for example: 'rhlist_t *sig_list = NULL; sand_signal_find(..., &sig_list);'), a new list 46 * will be created. Note that the argument itself must not be NULL. 47 * Note: The list must be freed, even if the signal was not found! 48 */ 49 shr_error_e sand_signal_find( 50 int unit, 51 int core, 52 int extra_flags, 53 char *block, 54 char *from, 55 char *to, 56 char *name, 57 rhlist_t ** sig_list); 58 59 /** 60 * \brief - Check if the value of the signal is equal an expected one 61 * 62 * \param [in] unit - Unit ID 63 * \param [in] in_port - Input Port 64 * \param [in] out_port - Output Port 65 * \param [in] block - Block name 66 * \param [in] from - Stage/Memory signal originated from or passed through 67 * \param [in] to - Stage/Memory signal destined to 68 * \param [in] name - Signals name (with exact path in case 'strict' option is set) 69 * \param [in] sig_exp_value - Expected value of the signal 70 * \param [in] fail_on_mismatch - If set, if signal is not matched, test would fail 71 * \param [in] strict - If set, the path of the signal need to be given exact matched 72 * 73 * \return 74 * \retval int - Negative in case of an error, zero in case all ok. 75 */ 76 int compare_signal_value( 77 int unit, 78 int in_port, 79 int out_port, 80 char *block, 81 char *from, 82 char *to, 83 char *name, 84 char *sig_exp_value, 85 int fail_on_mismatch, 86 int strict); 87 88 #endif /* DIAG_SAND_ACCESS_H_INCLUDED */