text
stringlengths 0
252
|
---|
vector<string> split_line; |
if (debugSymbol.is_open()){ |
while (getline(debugSymbol, line)) { |
if((!string_finder(line, "}")) && (string_finder(line, ");")) && (!line.empty())){ |
FuncNameType = find_module_func(line); |
set_static_data_func (m_name, FuncNameType); |
} |
else if ((string_finder(line, ";")) && (!string_finder(line, TYPEDEF)) && (!string_finder(line, "}"))){ |
VarNameType = find_module_var (line); |
set_static_data_var (m_name, VarNameType); |
} |
else if (string_finder(line, "}")) |
break; |
} |
} |
else |
cout << "\033[1;31mUnable to open Debug Symbol file\033[0m\n"; |
} |
//---------------------------------------------------------- |
NT ScMain:: find_module_func (string line){ |
NT NameType; |
vector<string> split_line = split(line, ' '); |
remove_element_vector(split_line, ""); |
if ((split_line.size()>1) && (!string_finder(line, "~"))){ //------------------- ignore constractor and destrocture function |
int index = find_in_vector(split_line, "("); |
if (index>=0){ |
size_t pos = split_line[index].find("("); |
NameType.first = split_line[index].substr(0,pos); |
NameType.second = split_line[index-1]; |
} |
} |
return NameType; |
} |
//---------------------------------------------------------- |
NT ScMain:: find_module_var (string line){ |
NT NameType; |
vector<string> split_line = split(line, ' '); |
remove_element_vector(split_line, ""); |
int index_var = find_in_vector(split_line, ";"); |
if (index_var >=0) |
NameType.first = replace_first_occurrence(split_line[index_var],";",""); |
else |
NameType.first = replace_first_occurrence(split_line[1],";",""); |
NameType.second = split_line[0]; |
filter_element(NameType.first, {"*","&","["}); |
return NameType; |
} |
#include "systemc.h" |
#include "tlm.h" |
#include <string> |
using namespace std; |
using namespace tlm; |
struct tr { |
string message; |
}; |
#include "uvmc.h" |
using namespace uvmc; |
UVMC_UTILS_1(tr, message) |
SC_MODULE(refmod) { |
sc_port<tlm_get_peek_if<tr> > in; |
sc_port<tlm_put_if<tr> > out; |
void p() { |
tr tr; |
while(1){ |
tr = in->get(); |
cout <<"refmod: " <<tr.message <<"\n"; |
out->put(tr); |
} |
} |
SC_CTOR(refmod): in("in"), out("out") { SC_THREAD(p); } |
}; |
SC_MODULE(refmod_low){ |
sc_port<tlm_get_peek_if<tr> > in; |
sc_port<tlm_put_if<tr> > out; |
void p() { |
tr tr; |
while(1){ |
tr = in->get(); |
cout <<"refmod_low: " <<tr.message <<"\n"; |
Subsets and Splits