PKU-IDEA / OpenPARF

🕹 OpenPARF: An Open-Source Placement and Routing Framework for Large-Scale Heterogeneous FPGAs with Deep Learning Toolkit
BSD 3-Clause "New" or "Revised" License
107 stars 13 forks source link

Question about the routing process #2

Closed Icamd closed 1 year ago

Icamd commented 1 year ago

Thank you for your beautiful code! I already build the complete anaconda environment according to the readme you provided. However I want to debug with the OpenPARF routing process. Could you please tell me how to debug the C++ files after the code is successfully compiled? Thank you!

magic3007 commented 1 year ago

Thank you for your valuable questions and suggestions. Regarding the debugging issue with OpenPARF, we have three approaches during the development process:

  1. For Python-related issues, we use pdb.

  2. For C++ related issues, we can use gdb. As an example, to run ISPD2016's FPGA01, first use the DEBUG mode during cmake compilation:

    cmake ../OpenPARF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=$CONDA_PREFIX -DPYTHON_EXECUTABLE=$(which python) -DPython3_EXECUTABLE=$(which python) -DCMAKE_INSTALL_PREFIX=<installation directory>

    Then use gdb during execution:

    gdb --args python openparf.py --config unittest/regression/ispd2016/FPGA01.json
  3. Debugging can also be done using printf().

We hope these methods will help you in debugging OpenPARF. Please let us know if you have any further questions or need additional assistance.