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

FindSLSSystemC.cmake 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. SET(_COMMON_HINTS
  2. $ENV{SNPS_VP_HOME}/common/include
  3. $ENV{SNPS_VP_HOME}/common/libso-$ENV{COWARE_CXX_COMPILER}
  4. )
  5. SET(_SYSTEMC_HINTS
  6. ${_COMMON_HINTS}
  7. )
  8. SET(_TLM_HINTS
  9. $ENV{SNPS_VP_HOME}/common/include/tlm
  10. ${_COMMON_HINTS}
  11. )
  12. SET(_SCV_HINTS
  13. ${_COMMON_HINTS}
  14. )
  15. SET(_CCI_HINTS
  16. ${_COMMON_HINTS}
  17. )
  18. SET(_COMMON_PATHS
  19. /usr/include/systemc
  20. /usr/lib
  21. /usr/lib-linux
  22. /usr/lib-linux64
  23. /usr/lib-macos
  24. /usr/local/include/sysc
  25. /usr/local/lib
  26. /usr/local/lib-linux
  27. /usr/local/lib-linux64
  28. /usr/local/lib-macos
  29. )
  30. FIND_FILE(_SYSTEMC_HEADER_FILE
  31. NAMES systemc
  32. HINTS ${_SYSTEMC_HINTS}
  33. PATHS ${_COMMON_PATHS}
  34. )
  35. FIND_FILE(_SCV_HEADER_FILE
  36. NAMES scv.h
  37. HINTS ${_SCV_HINTS}
  38. PATHS ${_COMMON_PATHS}
  39. )
  40. FIND_FILE(_CCI_HEADER_FILE
  41. NAMES cci_configuration
  42. HINTS ${_CCI_HINTS}
  43. PATHS ${_COMMON_PATHS}
  44. )
  45. if(NOT _SYSTEMC_HEADER_FILE STREQUAL _SYSTEMC_HEADER_FILE-NOTFOUND)
  46. set(SystemC_FOUND TRUE)
  47. endif()
  48. if(ENABLE_SCV)
  49. if(NOT _SCV_HEADER_FILE STREQUAL _SCV_HEADER_FILE-NOTFOUND)
  50. set(SCV_FOUND TRUE)
  51. endif()
  52. endif()
  53. if(NOT _CCI_HEADER_FILE STREQUAL _CCI_HEADER_FILE-NOTFOUND)
  54. set(CCI_FOUND TRUE)
  55. endif()
  56. FIND_PATH(SystemC_INCLUDE_DIRS
  57. NAMES systemc
  58. HINTS ${_SYSTEMC_HINTS}
  59. PATHS ${_COMMON_PATHS}
  60. )
  61. FIND_PATH(TLM_INCLUDE_DIRS
  62. NAMES tlm
  63. HINTS ${_TLM_HINTS}
  64. PATHS ${_COMMON_PATHS}
  65. )
  66. FIND_PATH(SystemC_LIBRARY_DIRS
  67. NAMES libSnpsVP.so
  68. HINTS ${_SYSTEMC_HINTS}
  69. PATHS ${_COMMON_PATHS}
  70. )
  71. FIND_PATH(SCV_INCLUDE_DIRS
  72. NAMES scv.h
  73. HINTS ${_SCV_HINTS}
  74. PATHS ${_COMMON_PATHS}
  75. )
  76. FIND_PATH(SCV_LIBRARY_DIRS
  77. NAMES libSnpsVP.so
  78. HINTS ${_SCV_HINTS}
  79. PATHS ${_COMMON_PATHS}
  80. )
  81. FIND_PATH(CCI_INCLUDE_DIRS
  82. NAMES cci_configuration
  83. HINTS ${_CCI_HINTS}
  84. PATHS ${_COMMON_PATHS}
  85. )
  86. FIND_PATH(CCI_LIBRARY_DIRS
  87. NAMES libcciapi.a libcciapi.so
  88. HINTS ${_CCI_HINTS}
  89. PATHS ${_COMMON_PATHS}
  90. )
  91. if(SystemC_FOUND)
  92. #see https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-do-i-use-a-different-compiler
  93. #set(CMAKE_CXX_COMPILER $ENV{SNPS_VP_HOME}/common/bin/g++)
  94. set(SystemC_INCLUDE_DIRS ${TLM_INCLUDE_DIRS} ${SystemC_INCLUDE_DIRS})
  95. set(SystemC_LIBRARIES SnpsVPExt SnpsVP tbb omniORB4 omniDynamic4 omnithread dwarf elf)
  96. #-L${SNPS_VP_HOME}/IP_common/common_debug/lib/linux.gcc-4.8.3-64
  97. #-lipdebug
  98. #-L${SNPS_VP_HOME}/IP/SBLGCCI_BL/Internal/lib/linux.gcc-4.8.3-64
  99. #-lsblgcci
  100. if(SCV_FOUND)
  101. set(SCV_LIBRARIES ${SystemC_LIBRARIES})
  102. endif(SCV_FOUND)
  103. if(CCI_FOUND)
  104. set(CCI_LIBRARIES cciapi)
  105. endif()
  106. endif(SystemC_FOUND)