diff --git a/include/avp64/core.h b/include/avp64/core.h index 0540c86..28be8f4 100644 --- a/include/avp64/core.h +++ b/include/avp64/core.h @@ -80,6 +80,7 @@ class core : public vcml::processor, private ocx::env std::vector> m_syscall_subscriber; std::unordered_set m_update_mem; std::list>> m_syscalls; + bool m_bb_trace; void timer_irq_trigger(int timer_id); static void segfault_handler(int sig, siginfo_t* si, void* unused); @@ -104,7 +105,6 @@ class core : public vcml::processor, private ocx::env public: using vcml::component::transport; // needed to not hide vcml transport // function by ocx transport - vcml::property bb_trace; vcml::gpio_initiator_array timer_irq_out; std::vector> timer_events; diff --git a/include/avp64/cpu.h b/include/avp64/cpu.h index 7fc9530..359ac7c 100644 --- a/include/avp64/cpu.h +++ b/include/avp64/cpu.h @@ -42,7 +42,6 @@ class cpu : public vcml::component vcml::property symbols; vcml::property async; vcml::property async_rate; - vcml::property bb_trace; vcml::property gic_cpuif; vcml::property gic_distif; diff --git a/src/avp64/core.cpp b/src/avp64/core.cpp index 3c32bbb..62df809 100644 --- a/src/avp64/core.cpp +++ b/src/avp64/core.cpp @@ -288,6 +288,11 @@ void core::interrupt(size_t irq, bool set) { } void core::simulate(size_t cycles) { + if (m_bb_trace != is_tracing_basic_blocks()) { + m_bb_trace = is_tracing_basic_blocks(); + m_core->trace_basic_blocks(m_bb_trace); + } + // insn_count() is only reset at the beginning of step(), but not at // the end, so the number of cycles can only be summed up in the // following quantum @@ -455,13 +460,12 @@ core::core(const sc_core::sc_module_name& nm, vcml::u64 procid, m_syscall_subscriber(), m_update_mem(), m_syscalls(), - bb_trace("bb_trace", false), + m_bb_trace(false), timer_irq_out("TIMER_IRQ_OUT"), timer_events(4) { symbols.inherit_default(); async.inherit_default(); async_rate.inherit_default(); - bb_trace.inherit_default(); m_ocx_handle = dlopen("libocx-qemu-arm.so", RTLD_LAZY); if (!m_ocx_handle) @@ -475,7 +479,6 @@ core::core(const sc_core::sc_module_name& nm, vcml::u64 procid, m_core = m_create_instance_func(20201012ull, *this, "Cortex-A72"); if (!m_core) VCML_ERROR("Could not create ocx::core instance"); - m_core->trace_basic_blocks(bb_trace); set_little_endian(); diff --git a/src/avp64/cpu.cpp b/src/avp64/cpu.cpp index 9239c34..ae688ce 100644 --- a/src/avp64/cpu.cpp +++ b/src/avp64/cpu.cpp @@ -19,7 +19,6 @@ cpu::cpu(const sc_core::sc_module_name& nm): symbols("symbols", ""), async("async", false), async_rate("async_rate", 10), - bb_trace("bb_trace", false), gic_cpuif("addr_gic_cpuif", { GIC_CPUIF_LO, GIC_CPUIF_HI }), gic_distif("addr_gic_distif", { GIC_DISTIF_LO, GIC_DISTIF_HI }), gic_vifctrl("addr_gic_vifctrl", { GIC_VIFCTRL_LO, GIC_VIFCTRL_HI }),