aheimberger Posted November 30, 2014 Report Share Posted November 30, 2014 Hey Guys, I don't know if you know about GDB Pretty-Printer. GDB Pretty-Print let you print your debug output in a legible way. I tried to write the Pretty-Printers analyzing the SystemC 2.3 implementation and I was learning how the information is stored within the SystemC implementation. You will find the Pretty-Printer under following link. https://github.com/AHeimberger/SystemC-2.3-Pretty-Printer On Github you will find instructions about installing the Pretty-Printer and a verification python file. Hope this Pretty-Printer helps you and does not cause to many problems. I were also able to use them within Eclipse. Cheers Andy Roman Popov and maehne 2 Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted November 30, 2015 Report Share Posted November 30, 2015 Hey Guys, I don't know if you know about GDB Pretty-Printer. GDB Pretty-Print let you print your debug output in a legible way. I tried to write the Pretty-Printers analyzing the SystemC 2.3 implementation and I was learning how the information is stored within the SystemC implementation. You will find the Pretty-Printer under following link. https://github.com/AHeimberger/SystemC-2.3-Pretty-Printer On Github you will find instructions about installing the Pretty-Printer and a verification python file. Hope this Pretty-Printer helps you and does not cause to many problems. I were also able to use them within Eclipse. Cheers Andy Thank you! I think we need something like that to be bundled with reference SystemC implementation. Quote Link to comment Share on other sites More sharing options...
fletombe Posted September 26, 2018 Report Share Posted September 26, 2018 Hi Andy, Thanks for your contribution. That's very good to have! Do you have something similar for sc_in/sc_out/sc_inout types? E.g., in the following code: SC_MODULE(dummy) { sc_in_clk clock; sc_in<bool> i; sc_out<sc_int<2> > o; SC_CTOR(dummy): clock("clk"),i("i"),o("o") { ... } ... }; int sc_main (int argc, char **argv) { dummy d("d"); sc_signal<bool> clk; sc_signal<bool> i; sc_signal<sc_int<2> > o; d.clock(clk); d.i(i); d.o(o); ... return 0; } If I put a breakpoint with gdb on the return statement, and try to print sc_signal/sc_in/sc_out elements, I get not pretty-printed elements. Worse, I get the following error when printing signal "o" and output port "d.o": Quote Python Exception <class 'gdb.error'> There is no member or method named m_len.: Do you know what can happen here? Thanks, Florian Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted September 27, 2018 Report Share Posted September 27, 2018 On 9/26/2018 at 8:22 AM, fletombe said: Worse, I get the following error when printing signal "o" and output port "d.o": Do you know what can happen here? Thanks, Florian I'm not using this particular pretty-printer, since we have a better one internally. But simply by looking at source code, it seems like it does not supports signals/ports: https://github.com/AHeimberger/SystemC-2.3-Pretty-Printer/blob/master/systemc23/systemc23printers.py Quote Link to comment Share on other sites More sharing options...
fletombe Posted October 1, 2018 Report Share Posted October 1, 2018 On 9/27/2018 at 7:28 PM, Roman Popov said: I'm not using this particular pretty-printer, since we have a better one internally. But simply by looking at source code, it seems like it does not supports signals/ports: https://github.com/AHeimberger/SystemC-2.3-Pretty-Printer/blob/master/systemc23/systemc23printers.py Thanks, I had noticed that. But then, why would I reach a pretty-printer if those types are not supported? By curiosity, may I know how you manage signals/ports? Thanks, Florian Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted October 1, 2018 Report Share Posted October 1, 2018 6 hours ago, fletombe said: Thanks, I had noticed that. But then, why would I reach a pretty-printer if those types are not supported? Hard to say without debugging. In source code I see they are registered using "RegexpCollectionPrettyPrinter", probably sc_dt::sc_int<(.*)> matches sc_signal<sc_int<2>> ? By curiosity, may I know how you manage signals/ports? Signal has m_cur_val and m_new_val fields, storing current and next signal value. So they are pretty-printed as "m_cur_val -> m_new_val". Ports are just decorated pointers, signal port has m_interface field holding a pointer to signal, so pretty-printer dereferences it, casts to dynamic type and prints it the same way as signal. Actually you can do much more with GDB Python API. I have even written SystemC to Verilog converter using GDB (Generates complete netlist, but without process bodies). Commercial SystemC interactive simulators/debuggers are also based on GDB AFAIK. fletombe 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.