<commit_before>#ifndef __NEMO_HEADER__
#define __NEMO_HEADER__
/*
 * TTB Backend
 *
 * This is a backend for Icarus verilog which generates a dot file with a
 * dependancy graph showing which signals are dependant on which signals
 *
 * Currently the dot file format is not supported. Instead, I output our own
 * format.
 */

#include <set>
#include <vector>
#include <ivl_target.h>
#include "nemo_dot_file.h"

#define DEBUG_PRINTS 			 false
#define INCLUDE_LOCAL_SIGNALS 	 false
#define ENUMERATE_ENTIRE_CIRCUIT false
#define SEARCH_DEPTH 			 5
// #define CRITICAL_SIG_REGEX "[\\(\\ (to_)]sr\\[0\\]|supv"
#define CRITICAL_SIG_REGEX "sr"

using namespace std;

void find_all_signal_dependencies(vector<ivl_signal_t>& critical_sigs, Dot_File& df);
void find_signal_dependencies(ivl_signal_t critical_sig, Dot_File& df, set<ivl_signal_t>& expanded_signals);
void find_critical_sigs(ivl_scope_t* root_scopes, unsigned num_root_scopes, vector<ivl_signal_t>& critical_sigs);
void find_critical_scope_sigs(ivl_scope_t scope, unsigned* num_sigs_found, vector<ivl_signal_t>& critical_sigs);

bool is_sig_expanded(set<ivl_signal_t>& explored_signals, ivl_signal_t sig);
bool is_critical_sig(ivl_signal_t sig);
bool is_ivl_generated_signal(ivl_signal_t sig);
ivl_net_const_t is_const_local_sig(ivl_signal_t sig);

void print_signal_queues(set<ivl_signal_t>& critical_sigs, set<ivl_signal_t>& explored_signals);
void print_signal_attrs(ivl_signal_t sig);
void print_full_signal_name(ivl_signal_t sig);
void print_signal_info(ivl_signal_t sig);

void connect_signals(
	ivl_signal_t       aff_sig, 
	ivl_signal_t       sig, 
	set<ivl_signal_t>& sigs_to_expand,
	set<ivl_signal_t>& explored_sigs, 
	Dot_File&          df, 
	bool               expand_search);

void expand_std_cell_sigs(
	ivl_signal_t       aff_sig, 
	Dot_File&          df, 
	set<ivl_signal_t>& sigs_to_expand,<commit_msg>updated search regex<commit_after>#ifndef __NEMO_HEADER__
#define __NEMO_HEADER__
/*
 * TTB Backend
 *
 * This is a backend for Icarus verilog which generates a dot file with a
 * dependancy graph showing which signals are dependant on which signals
 *
 * Currently the dot file format is not supported. Instead, I output our own
 * format.
 */

#include <set>
#include <vector>
#include <ivl_target.h>
#include "nemo_dot_file.h"

#define DEBUG_PRINTS 			 false
#define INCLUDE_LOCAL_SIGNALS 	 false
#define ENUMERATE_ENTIRE_CIRCUIT false
#define SEARCH_DEPTH 			 3
// #define CRITICAL_SIG_REGEX "[\\(\\ (to_)]sr\\[0\\]|supv"
#define CRITICAL_SIG_REGEX "sr[0]"

using namespace std;

void find_all_signal_dependencies(vector<ivl_signal_t>& critical_sigs, Dot_File& df);
void find_signal_dependencies(ivl_signal_t critical_sig, Dot_File& df, set<ivl_signal_t>& expanded_signals);
void find_critical_sigs(ivl_scope_t* root_scopes, unsigned num_root_scopes, vector<ivl_signal_t>& critical_sigs);
void find_critical_scope_sigs(ivl_scope_t scope, unsigned* num_sigs_found, vector<ivl_signal_t>& critical_sigs);

bool is_sig_expanded(set<ivl_signal_t>& explored_signals, ivl_signal_t sig);
bool is_critical_sig(ivl_signal_t sig);
bool is_ivl_generated_signal(ivl_signal_t sig);
ivl_net_const_t is_const_local_sig(ivl_signal_t sig);

void print_signal_queues(set<ivl_signal_t>& critical_sigs, set<ivl_signal_t>& explored_signals);
void print_signal_attrs(ivl_signal_t sig);
void print_full_signal_name(ivl_signal_t sig);
void print_signal_info(ivl_signal_t sig);

void connect_signals(
	ivl_signal_t       aff_sig, 
	ivl_signal_t       sig, 
	set<ivl_signal_t>& sigs_to_expand,
	set<ivl_signal_t>& explored_sigs, 
	Dot_File&          df, 
	bool               expand_search);

void expand_std_cell_sigs(
	ivl_signal_t       aff_sig, 
	Dot_File&          df, 
	set<ivl_signal_t>& sigs_to_expand,
{'fraction_non_alphanumeric': 0.08293460925039872, 'fraction_numerical': 0.0013290802764486975, 'mean_word_length': 6.0336448598130845, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7271550', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1410, 'n_words': 299}