A SystemC productivity library for virtual platform development utilizing SCV and TLM2.0 https://www.minres.com/#opensource

tracer.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*******************************************************************************
  2. * Copyright 2016, 2018 MINRES Technologies GmbH
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *******************************************************************************/
  16. #ifndef _SCC_TRACER_H_
  17. #define _SCC_TRACER_H_
  18. #include "utilities.h"
  19. #ifdef WITH_SCV
  20. #include <scv.h>
  21. #endif
  22. #include <string>
  23. #include <vector>
  24. namespace sc_core {
  25. class sc_object;
  26. class sc_trace_file;
  27. }
  28. namespace scc {
  29. /**
  30. * a component traversing the SystemC object hierarchy and tracing the objects
  31. */
  32. class tracer : public sc_core::sc_module {
  33. public:
  34. /**
  35. * enum defining the transaction trace output type
  36. */
  37. enum file_type { NONE, TEXT, COMPRESSED, SQLITE/*, BINARY, LEVEL*/ };
  38. /**
  39. * the constructor
  40. *
  41. * @param name base name of the trace file(s)
  42. * @param type type of trace file for transactions
  43. * @param enable enable VCD (signal and POD) tracing
  44. */
  45. tracer(const std::string &&, file_type, bool = true);
  46. /**
  47. * the destructor
  48. */
  49. virtual ~tracer() override;
  50. protected:
  51. void end_of_elaboration() override;
  52. virtual void descend(const sc_core::sc_object *);
  53. virtual void try_trace_signal(const sc_core::sc_object *);
  54. virtual void try_trace_port(const sc_core::sc_object *);
  55. bool enabled;
  56. sc_core::sc_trace_file *trf;
  57. #ifdef WITH_SCV
  58. scv_tr_db *txdb;
  59. #endif
  60. };
  61. } /* namespace scc */
  62. #endif /* _SCC_TRACER_H_ */