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

tracer.h 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. /*
  17. * tracer.h
  18. *
  19. * Created on: Nov 9, 2016
  20. * Author: developer
  21. */
  22. #ifndef _SCC_TRACER_H_
  23. #define _SCC_TRACER_H_
  24. #include "utilities.h"
  25. #ifdef WITH_SCV
  26. #include <scv.h>
  27. #endif
  28. #include <string>
  29. #include <vector>
  30. namespace sc_core {
  31. class sc_object;
  32. class sc_trace_file;
  33. }
  34. namespace scc {
  35. class tracer : public sc_core::sc_module {
  36. public:
  37. /**
  38. *
  39. */
  40. enum file_type { NONE, TEXT, COMPRESSED, SQLITE/*, BINARY, LEVEL*/ };
  41. /**
  42. *
  43. * @param name basename of the trace file(s)
  44. * @param type type of trace file for transactions
  45. * @param enable enable VCD (signal based) tracing
  46. */
  47. tracer(const std::string &&, file_type, bool = true);
  48. /**
  49. *
  50. */
  51. virtual ~tracer() override;
  52. protected:
  53. void end_of_elaboration() override;
  54. virtual void descend(const sc_core::sc_object *);
  55. virtual void try_trace_signal(const sc_core::sc_object *);
  56. virtual void try_trace_port(const sc_core::sc_object *);
  57. bool enabled;
  58. sc_core::sc_trace_file *trf;
  59. #ifdef WITH_SCV
  60. scv_tr_db *txdb;
  61. #endif
  62. };
  63. } /* namespace scc */
  64. #endif /* _SCC_TRACER_H_ */