diff --git a/bin/pulp-pc-info b/bin/pulp-pc-info index b86a4b8..62bff02 100755 --- a/bin/pulp-pc-info +++ b/bin/pulp-pc-info @@ -3,6 +3,7 @@ import argparse import os from subprocess import Popen, PIPE +import sys parser = argparse.ArgumentParser(description='Generate PC debug info') @@ -125,6 +126,11 @@ for f in functions: # And finally generate the output files +if args.allFile is None and args.pcFile is None and args.debugFile is None and args.inlineFile is None: + for f in functions: + f.dumpAll(sys.stdout) + + # PC oriented file if args.allFile != None: with open(args.allFile, 'w') as file: diff --git a/engine/python/gv/gvsoc.py b/engine/python/gv/gvsoc.py index 329df93..04f9004 100644 --- a/engine/python/gv/gvsoc.py +++ b/engine/python/gv/gvsoc.py @@ -120,6 +120,7 @@ def gen_config(args, config): for binary in debug_binaries: full_config.set('**/debug_binaries', binary + '.debugInfo') + full_config.set('**/binaries', binary) gvsoc_config_path = os.path.join(config.get_str('gapy/work_dir'), 'gvsoc_config.json') diff --git a/engine/src/trace/trace.cpp b/engine/src/trace/trace.cpp index 47a794e..26605db 100644 --- a/engine/src/trace/trace.cpp +++ b/engine/src/trace/trace.cpp @@ -83,6 +83,8 @@ void vp::component_trace::new_trace_event_string(std::string name, trace *trace) trace->name = name; trace->path = top.get_path() + "/" + name; + trace->width = 0; + trace->is_real = false; trace->is_string = true; trace->pending_timestamp = -1; trace->bytes = 0; @@ -409,7 +411,7 @@ void vp::trace_engine::flush_event_traces(int64_t timestamp) } else if (current->is_string) { - //this->vcd_user->event_update_logical(int id, uint8_t *value, uint8_t *flags); + this->vcd_user->event_update_string(timestamp, current->id, (char *)current->buffer); } else if (current->width > 8) { @@ -433,7 +435,9 @@ void vp::trace_engine::flush_event_traces(int64_t timestamp) } else { - this->vcd_user->event_update_logical(timestamp, current->id, *current->buffer); + uint64_t value = (uint64_t)*(current->buffer); + + this->vcd_user->event_update_logical(timestamp, current->id, value); } } else diff --git a/engine/vp/trace_domain_impl.cpp b/engine/vp/trace_domain_impl.cpp index 182e9a4..76f4757 100644 --- a/engine/vp/trace_domain_impl.cpp +++ b/engine/vp/trace_domain_impl.cpp @@ -178,7 +178,7 @@ void trace_domain::check_trace_active(vp::trace *trace, int event) { for (auto &x : events_path_regex) { - if (x.second->is_path || regexec(x.second->regex, full_path.c_str(), 0, NULL, 0) == 0) + if ((x.second->is_path && x.second->path == full_path) || regexec(x.second->regex, full_path.c_str(), 0, NULL, 0) == 0) { std::string file_path = x.second->file_path; vp::Event_trace *event_trace; @@ -462,6 +462,7 @@ void trace_domain::conf_trace(int event, std::string path_str, bool enabled) const char *file_path = "all.vcd"; const char *path = path_str.c_str(); char *delim = (char *)::index(path, '@'); + if (delim) { *delim = 0; diff --git a/models/cpu/iss/vp/include/iss_wrapper.hpp b/models/cpu/iss/vp/include/iss_wrapper.hpp index ac739ef..f7e234e 100644 --- a/models/cpu/iss/vp/include/iss_wrapper.hpp +++ b/models/cpu/iss/vp/include/iss_wrapper.hpp @@ -151,6 +151,7 @@ class iss_wrapper : public vp::component, vp::Gdbserver_core vp::trace inline_trace_event; vp::trace line_trace_event; vp::trace file_trace_event; + vp::trace binaries_trace_event; vp::trace pcer_trace_event[32]; vp::trace insn_trace_event; diff --git a/models/cpu/iss/vp/src/iss_wrapper.cpp b/models/cpu/iss/vp/src/iss_wrapper.cpp index 4559223..42c7cb7 100644 --- a/models/cpu/iss/vp/src/iss_wrapper.cpp +++ b/models/cpu/iss/vp/src/iss_wrapper.cpp @@ -1300,6 +1300,7 @@ int iss_wrapper::build() traces.new_trace_event_string("func", &func_trace_event); traces.new_trace_event_string("inline_func", &inline_trace_event); traces.new_trace_event_string("file", &file_trace_event); + traces.new_trace_event_string("binaries", &binaries_trace_event); traces.new_trace_event("line", &line_trace_event, 32); traces.new_trace_event_real("ipc_stat", &ipc_stat_event); @@ -1423,6 +1424,11 @@ void iss_wrapper::start() iss_register_debug_info(this, x->get_str().c_str()); } + for (auto x:this->get_js_config()->get("**/binaries")->get_elems()) + { + this->binaries_trace_event.event_string("static enable " + x->get_str()); + } + trace.msg("ISS start (fetch: %d, is_active: %d, boot_addr: 0x%lx)\n", fetch_enable_reg.get(), is_active_reg.get(), get_config_int("boot_addr"));