nvdla / vp

Virtual Platform for NVDLA
Other
136 stars 81 forks source link

Debugging virtual platform with gdb ( related with #11 ) #55

Open Abraham-Xu opened 4 years ago

Abraham-Xu commented 4 years ago

Quoted from #11 Hi boiihong,

You want to see how NVDLA cmodel work step by step with source code? Currently DLA cmod code does not include debug version, so if you want to see the source code in gdb, you need to do some hack in Makefile https://github.com/nvdla/hw/blob/nvdlav1/cmod/Makefile CPPFLAGS ?= $(INC_FLAGS) -MMD -MP -g -fPIC -Wall -Werror -DSC_INCLUDE_DYNAMIC_PROCESSES -Wp,-w -std=c++11

After the hack, you need to re-compile the HW and VP code. Now you can set the breakpoint inside the DLA cmod code, such as b NvdlaAxiAdaptor.cpp:60

When SW test begin, gdb will stop with breakpoint. image

Now, you can check the DLA behavior by next command

Best Regards, Haiqing

My Question: Hi, Haiqing, When I try this method, the problem I encountered is that the program can only stop before entering vp but not in vp. Is there any solution to stop at the breakpoints in cmod when vp runing? This problem puzzled me for a long time. Thank you very much!

linbaiwpi commented 2 years ago

Hi @Abraham-Xu

Can you explain your problem in detail? Maybe with some figures

BR, Lin