Showing posts with label C code. Show all posts
Showing posts with label C code. Show all posts

Thursday, November 26, 2020

Using GDB in simulation runs to debug C-code

When we run simulations with C-models (along with RTL and SV-UVM TB ) we might want to debug the C-code to identify issues.

Here is a list of commands for GDB ( for VCS )

  1. gdb <SIMV absolute path>.
  2. break <File_name>:<Line_number>
  3. run <Simulation command line arguments>

These will allow you to to run the simulation until the debug point.

  1. For executing line by line we can use <next>
  2. For step, we can use <step>
  3. To continue till next occurrence of  break point use <continue >
  4. To print any variable with (print <var>)



Constraint to have N elements distributed in M bins

Code to distribute N elements into M bins, you add unique keyword to have each bin will have unique number of elements. class test; param...