Browse Source

reorganized layout to only contain risc-v stuff

Eyck Jentzsch 4 months ago
parent
commit
67d9beb7bd
100 changed files with 179 additions and 6875 deletions
  1. 5
    1
      .cproject
  2. 1
    0
      .gitignore
  3. 0
    12
      .gitmodules
  4. 54
    119
      CMakeLists.txt
  5. 119
    0
      CMakeLists.txt.orig
  6. 0
    6
      build.sh
  7. 0
    20
      cmake/Common.cmake
  8. 0
    46
      cmake/Conan.cmake
  9. 0
    24
      cmake/DoxygenTarget.cmake
  10. 0
    38
      cmake/FindTcmalloc.cmake
  11. 0
    130
      cmake/GetGitRevisionDescription.cmake
  12. 0
    41
      cmake/GetGitRevisionDescription.cmake.in
  13. 0
    22
      cmake/GitFunctions.cmake
  14. 0
    44
      cmake/PackageConfigurator.cmake
  15. 0
    57
      cmake/Submodules.cmake
  16. 0
    19
      conanfile.txt
  17. 0
    1728
      cycles.txt
  18. 0
    1
      dbt-core
  19. 0
    8
      etc/CoreDSL generator.launch
  20. 0
    15
      etc/cmake DBT-RISE-RISCV Debug.launch
  21. 0
    7
      etc/cmake DBT-RISE-RISCV Release.launch
  22. 0
    47
      etc/cmake.sh
  23. 0
    42
      etc/dbt-riscv Debug hello gdb.launch
  24. 0
    42
      etc/dbt-riscv Debug hello w plugin.launch
  25. 0
    47
      etc/hello Debug.launch
  26. 0
    28
      external/CMakeLists.txt
  27. 0
    1
      external/elfio
  28. 0
    1
      external/libGIS
  29. 0
    0
      gen_input/.gitignore
  30. 0
    0
      gen_input/RISCVBase.core_desc
  31. 0
    0
      gen_input/RV32I.core_desc
  32. 0
    0
      gen_input/RV64I.core_desc
  33. 0
    0
      gen_input/RVA.core_desc
  34. 0
    0
      gen_input/RVC.core_desc
  35. 0
    0
      gen_input/RVD.core_desc
  36. 0
    0
      gen_input/RVF.core_desc
  37. 0
    0
      gen_input/RVM.core_desc
  38. 0
    0
      gen_input/minres_rv.core_desc
  39. 0
    0
      gen_input/templates/CORENAME_cyles.txt.gtl
  40. 0
    0
      gen_input/templates/incl-CORENAME.h.gtl
  41. 0
    0
      gen_input/templates/src-CORENAME.cpp.gtl
  42. 0
    0
      gen_input/templates/vm-vm_CORENAME.cpp.gtl
  43. 0
    64
      html/app.js
  44. 0
    14
      html/index.html
  45. 0
    16
      html/lib/jquery.min.js
  46. 0
    105
      html/ws.html
  47. 0
    0
      incl/iss/arch/riscv_hart_msu_vp.h
  48. 0
    0
      incl/iss/arch/rv32gc.h
  49. 0
    0
      incl/iss/arch/rv32imac.h
  50. 0
    0
      incl/iss/arch/rv64gc.h
  51. 0
    0
      incl/iss/arch/rv64i.h
  52. 0
    0
      incl/iss/debugger/riscv_target_adapter.h
  53. 0
    0
      incl/iss/plugin/cycle_estimate.h
  54. 0
    0
      incl/iss/plugin/instruction_count.h
  55. 0
    0
      incl/sysc/core_complex.h
  56. 0
    57
      platform/CMakeLists.txt
  57. 0
    158
      platform/gen_input/aon.rdl
  58. 0
    27
      platform/gen_input/clint.rdl
  59. 0
    25
      platform/gen_input/fe310.rdl
  60. 0
    121
      platform/gen_input/gpio.rdl
  61. 0
    27
      platform/gen_input/plic.rdl
  62. 0
    41
      platform/gen_input/prci.rdl
  63. 0
    96
      platform/gen_input/pwm.rdl
  64. 0
    173
      platform/gen_input/spi.rdl
  65. 0
    46
      platform/gen_input/uart.rdl
  66. 0
    63
      platform/incl/sysc/SiFive/aon.h
  67. 0
    74
      platform/incl/sysc/SiFive/clint.h
  68. 0
    106
      platform/incl/sysc/SiFive/fe310.h
  69. 0
    170
      platform/incl/sysc/SiFive/gen/aon_regs.h
  70. 0
    80
      platform/incl/sysc/SiFive/gen/clint_regs.h
  71. 0
    21
      platform/incl/sysc/SiFive/gen/e300_plat_t.h
  72. 0
    169
      platform/incl/sysc/SiFive/gen/gpio_regs.h
  73. 0
    93
      platform/incl/sysc/SiFive/gen/plic_regs.h
  74. 0
    104
      platform/incl/sysc/SiFive/gen/prci_regs.h
  75. 0
    129
      platform/incl/sysc/SiFive/gen/pwm_regs.h
  76. 0
    188
      platform/incl/sysc/SiFive/gen/spi_regs.h
  77. 0
    119
      platform/incl/sysc/SiFive/gen/uart_regs.h
  78. 0
    87
      platform/incl/sysc/SiFive/gpio.h
  79. 0
    72
      platform/incl/sysc/SiFive/plic.h
  80. 0
    64
      platform/incl/sysc/SiFive/prci.h
  81. 0
    79
      platform/incl/sysc/SiFive/pwm.h
  82. 0
    88
      platform/incl/sysc/SiFive/spi.h
  83. 0
    75
      platform/incl/sysc/SiFive/uart.h
  84. 0
    114
      platform/incl/sysc/sc_comm_singleton.h
  85. 0
    70
      platform/incl/sysc/tlm_extensions.h
  86. 0
    131
      platform/incl/sysc/top/BLDC.h
  87. 0
    68
      platform/incl/sysc/top/dcmotor.h
  88. 0
    66
      platform/incl/sysc/top/h_bridge.h
  89. 0
    68
      platform/incl/sysc/top/hifive1.h
  90. 0
    120
      platform/incl/sysc/top/mcp_adc.h
  91. 0
    62
      platform/incl/sysc/top/system.h
  92. 0
    69
      platform/incl/sysc/top/terminal.h
  93. 0
    112
      platform/src/CLIParser.cpp
  94. 0
    60
      platform/src/CLIParser.h
  95. 0
    106
      platform/src/CMakeLists.txt
  96. 0
    142
      platform/src/sc_main.cpp
  97. 0
    188
      platform/src/sysc/BLDC.cpp
  98. 0
    78
      platform/src/sysc/aon.cpp
  99. 0
    124
      platform/src/sysc/clint.cpp
  100. 0
    0
      platform/src/sysc/dcmotor.cpp

+ 5
- 1
.cproject View File

@@ -187,7 +187,11 @@
187 187
 		</configuration>
188 188
 	</storageModule>
189 189
 	<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
190
-	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
190
+	<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
191
+		<doc-comment-owner id="org.eclipse.cdt.ui.doxygen">
192
+			<path value=""/>
193
+		</doc-comment-owner>
194
+	</storageModule>
191 195
 	<storageModule moduleId="scannerConfiguration">
192 196
 		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
193 197
 		<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.119132886.1995486963;cdt.managedbuild.config.gnu.exe.debug.119132886.1995486963.;cdt.managedbuild.tool.gnu.cpp.compiler.base.64491626;cdt.managedbuild.tool.gnu.cpp.compiler.input.550087631">

+ 1
- 0
.gitignore View File

@@ -30,3 +30,4 @@ language.settings.xml
30 30
 /.gdbinit
31 31
 /*.out
32 32
 /dump.json
33
+/src-gen/

+ 0
- 12
.gitmodules View File

@@ -1,12 +0,0 @@
1
-[submodule "dbt-core"]
2
-	path = dbt-core
3
-	url = https://git.minres.com/DBT-RISE/DBT-RISE-Core.git
4
-[submodule "sc-components"]
5
-	path = sc-components
6
-	url = https://git.minres.com/SystemC/SystemC-Components.git
7
-[submodule "external/elfio"]
8
-	path = external/elfio
9
-	url = http://git.code.sf.net/p/elfio/code
10
-[submodule "external/libGIS"]
11
-	path = external/libGIS
12
-	url = https://github.com/vsergeev/libGIS.git

+ 54
- 119
CMakeLists.txt View File

@@ -1,119 +1,54 @@
1
-cmake_minimum_required(VERSION 3.3)
2
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake)
3
-
4
-set(ENABLE_SCV TRUE CACHE BOOL "Enable use of SCV")
5
-set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries")
6
-
7
-include(GitFunctions)
8
-get_branch_from_git()
9
-# if we are not on master or develop set the submodules to develop
10
-IF(NOT ${GIT_BRANCH} MATCHES "master") 
11
-	IF(NOT ${GIT_BRANCH} MATCHES "develop") 
12
-		message(STATUS "main branch is '${GIT_BRANCH}', setting submodules to 'develop'")
13
-		set(GIT_BRANCH develop)
14
-	endif()
15
-endif()
16
-
17
-### set the directory names of the submodules
18
-set(GIT_SUBMODULES elfio libGIS sc-components dbt-core)
19
-set(GIT_SUBMODULE_DIR_sc-components .)
20
-set(GIT_SUBMODULE_DIR_dbt-core .)
21
-### set each submodules's commit or tag that is to be checked out
22
-### (leave empty if you want master)
23
-#set(GIT_SUBMODULE_VERSION_sc-comp 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd)
24
-set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH})
25
-set(GIT_SUBMODULE_BRANCH_dbt-core ${GIT_BRANCH})
26
-
27
-include(GNUInstallDirs)
28
-include(Submodules)
29
-include(Conan)
30
-
31
-#enable_testing() 
32
-
33
-set(CMAKE_CXX_STANDARD 14)
34
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
35
-set(CMAKE_CXX_EXTENSIONS OFF)
36
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
37
-
38
-include(CheckCXXCompilerFlag)
39
-CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
40
-if(COMPILER_SUPPORTS_MARCH_NATIVE)
41
-if("${CMAKE_BUILD_TYPE}" STREQUAL "") 
42
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
43
-elseif(NOT(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo"))
44
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
45
-endif()
46
-endif()
47
-
48
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
49
-    set(warnings "-Wall -Wextra -Werror")
50
-    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
51
-    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
52
-    set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
53
-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
54
-    set(warnings "/W4 /WX /EHsc")
55
-endif()
56
-
57
-setup_conan()
58
-
59
-# This line finds the boost lib and headers. 
60
-set(Boost_NO_BOOST_CMAKE ON) #  Don't do a find_package in config mode before searching for a regular boost install.
61
-find_package(Boost COMPONENTS program_options system thread filesystem REQUIRED)
62
-
63
-if(DEFINED ENV{LLVM_HOME})
64
-	find_path (LLVM_DIR LLVM-Config.cmake $ENV{LLVM_HOME}/lib/cmake/llvm)
65
-endif(DEFINED ENV{LLVM_HOME})
66
-find_package(LLVM REQUIRED CONFIG)
67
-message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
68
-message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
69
-llvm_map_components_to_libnames(llvm_libs support core mcjit x86codegen x86asmparser)
70
-
71
-find_package(Threads)
72
-find_package(Tcmalloc)
73
-find_package(ZLIB)
74
-find_package(SystemC)
75
-if(SystemC_FOUND)
76
-        message(STATUS "SystemC headers at ${SystemC_INCLUDE_DIRS}")
77
-        message(STATUS "SystemC library at ${SystemC_LIBRARY_DIRS}")
78
-        if(SCV_FOUND)
79
-            message(STATUS "SCV headers at ${SCV_INCLUDE_DIRS}")
80
-            message(STATUS "SCV library at ${SCV_LIBRARY_DIRS}")
81
-        endif(SCV_FOUND)
82
-        if(CCI_FOUND)
83
-            message(STATUS "CCI headers at ${CCI_INCLUDE_DIRS}")
84
-            message(STATUS "CCI library at ${CCI_LIBRARY_DIRS}")
85
-        endif()
86
-endif(SystemC_FOUND)
87
-
88
-set(PROJECT_3PARTY_DIRS external)
89
-include(clang-format)
90
-
91
-set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Add clang-tidy automatically to builds")
92
-if (ENABLE_CLANG_TIDY)
93
-    find_program (CLANG_TIDY_EXE NAMES "clang-tidy" PATHS /usr/local/opt/llvm/bin )
94
-    if (CLANG_TIDY_EXE)
95
-        message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
96
-        set(CLANG_TIDY_CHECKS "-*,modernize-*")
97
-        set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${CLANG_TIDY_CHECKS};-header-filter='${CMAKE_SOURCE_DIR}/*';-fix"
98
-            CACHE STRING "" FORCE)
99
-    else()
100
-        message(AUTHOR_WARNING "clang-tidy not found!")
101
-        set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it
102
-    endif()
103
-endif()
104
-  
105
-# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
106
-set(VERSION_MAJOR "1")
107
-set(VERSION_MINOR "0")
108
-set(VERSION_PATCH "0")
109
-set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
110
-
111
-add_subdirectory(external)
112
-add_subdirectory(dbt-core)
113
-add_subdirectory(sc-components)
114
-add_subdirectory(softfloat)
115
-GET_DIRECTORY_PROPERTY(SOFTFLOAT_INCLUDE_DIRS DIRECTORY softfloat DEFINITION SOFTFLOAT_INCLUDE_DIRS)
116
-add_subdirectory(riscv)
117
-add_subdirectory(platform)
118
-
119
-message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
1
+cmake_minimum_required(VERSION 3.3)
2
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
3
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
4
+
5
+# CMake useful variables
6
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
7
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 
8
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
9
+
10
+add_subdirectory(softfloat)
11
+
12
+# Set the name of your project here
13
+project("riscv")
14
+
15
+include(Common)
16
+
17
+conan_basic_setup()
18
+
19
+# This sets the include directory for the reference project. This is the -I flag in gcc.
20
+include_directories(
21
+    ${PROJECT_SOURCE_DIR}/incl
22
+	${SOFTFLOAT_INCLUDE_DIRS}
23
+    ${LLVM_INCLUDE_DIRS}
24
+)
25
+add_dependent_subproject(dbt-core)
26
+add_dependent_subproject(sc-components)
27
+include_directories(
28
+    ${PROJECT_SOURCE_DIR}/incl
29
+    ${PROJECT_SOURCE_DIR}/../external/elfio
30
+    ${PROJECT_SOURCE_DIR}/../external/libGIS
31
+    ${Boost_INCLUDE_DIRS}
32
+)
33
+
34
+
35
+# Mac needed variables (adapt for your needs - http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH)
36
+set(CMAKE_MACOSX_RPATH ON)
37
+set(CMAKE_SKIP_BUILD_RPATH FALSE)
38
+set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
39
+set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
40
+set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
41
+
42
+add_subdirectory(src)
43
+
44
+#
45
+# SYSTEM PACKAGING (RPM, TGZ, ...)
46
+# _____________________________________________________________________________
47
+
48
+#include(CPackConfig)
49
+
50
+#
51
+# CMAKE PACKAGING (for other CMake projects to use this one easily)
52
+# _____________________________________________________________________________
53
+
54
+#include(PackageConfigurator)

+ 119
- 0
CMakeLists.txt.orig View File

@@ -0,0 +1,119 @@
1
+cmake_minimum_required(VERSION 3.3)
2
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake)
3
+
4
+set(ENABLE_SCV TRUE CACHE BOOL "Enable use of SCV")
5
+set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries")
6
+
7
+include(GitFunctions)
8
+get_branch_from_git()
9
+# if we are not on master or develop set the submodules to develop
10
+IF(NOT ${GIT_BRANCH} MATCHES "master") 
11
+	IF(NOT ${GIT_BRANCH} MATCHES "develop") 
12
+		message(STATUS "main branch is '${GIT_BRANCH}', setting submodules to 'develop'")
13
+		set(GIT_BRANCH develop)
14
+	endif()
15
+endif()
16
+
17
+### set the directory names of the submodules
18
+set(GIT_SUBMODULES elfio libGIS sc-components dbt-core)
19
+set(GIT_SUBMODULE_DIR_sc-components .)
20
+set(GIT_SUBMODULE_DIR_dbt-core .)
21
+### set each submodules's commit or tag that is to be checked out
22
+### (leave empty if you want master)
23
+#set(GIT_SUBMODULE_VERSION_sc-comp 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd)
24
+set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH})
25
+set(GIT_SUBMODULE_BRANCH_dbt-core ${GIT_BRANCH})
26
+
27
+include(GNUInstallDirs)
28
+include(Submodules)
29
+include(Conan)
30
+
31
+#enable_testing() 
32
+
33
+set(CMAKE_CXX_STANDARD 14)
34
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
35
+set(CMAKE_CXX_EXTENSIONS OFF)
36
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
37
+
38
+include(CheckCXXCompilerFlag)
39
+CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
40
+if(COMPILER_SUPPORTS_MARCH_NATIVE)
41
+if("${CMAKE_BUILD_TYPE}" STREQUAL "") 
42
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
43
+elseif(NOT(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo"))
44
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
45
+endif()
46
+endif()
47
+
48
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
49
+    set(warnings "-Wall -Wextra -Werror")
50
+    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0")
51
+    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
52
+    set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
53
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
54
+    set(warnings "/W4 /WX /EHsc")
55
+endif()
56
+
57
+setup_conan()
58
+
59
+# This line finds the boost lib and headers. 
60
+set(Boost_NO_BOOST_CMAKE ON) #  Don't do a find_package in config mode before searching for a regular boost install.
61
+find_package(Boost COMPONENTS program_options system thread filesystem REQUIRED)
62
+
63
+if(DEFINED ENV{LLVM_HOME})
64
+	find_path (LLVM_DIR LLVM-Config.cmake $ENV{LLVM_HOME}/lib/cmake/llvm)
65
+endif(DEFINED ENV{LLVM_HOME})
66
+find_package(LLVM REQUIRED CONFIG)
67
+message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
68
+message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
69
+llvm_map_components_to_libnames(llvm_libs support core mcjit x86codegen x86asmparser)
70
+
71
+find_package(Threads)
72
+find_package(Tcmalloc)
73
+find_package(ZLIB)
74
+find_package(SystemC)
75
+if(SystemC_FOUND)
76
+        message(STATUS "SystemC headers at ${SystemC_INCLUDE_DIRS}")
77
+        message(STATUS "SystemC library at ${SystemC_LIBRARY_DIRS}")
78
+        if(SCV_FOUND)
79
+            message(STATUS "SCV headers at ${SCV_INCLUDE_DIRS}")
80
+            message(STATUS "SCV library at ${SCV_LIBRARY_DIRS}")
81
+        endif(SCV_FOUND)
82
+        if(CCI_FOUND)
83
+            message(STATUS "CCI headers at ${CCI_INCLUDE_DIRS}")
84
+            message(STATUS "CCI library at ${CCI_LIBRARY_DIRS}")
85
+        endif()
86
+endif(SystemC_FOUND)
87
+
88
+set(PROJECT_3PARTY_DIRS external)
89
+include(clang-format)
90
+
91
+set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Add clang-tidy automatically to builds")
92
+if (ENABLE_CLANG_TIDY)
93
+    find_program (CLANG_TIDY_EXE NAMES "clang-tidy" PATHS /usr/local/opt/llvm/bin )
94
+    if (CLANG_TIDY_EXE)
95
+        message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
96
+        set(CLANG_TIDY_CHECKS "-*,modernize-*")
97
+        set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${CLANG_TIDY_CHECKS};-header-filter='${CMAKE_SOURCE_DIR}/*';-fix"
98
+            CACHE STRING "" FORCE)
99
+    else()
100
+        message(AUTHOR_WARNING "clang-tidy not found!")
101
+        set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it
102
+    endif()
103
+endif()
104
+  
105
+# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
106
+set(VERSION_MAJOR "1")
107
+set(VERSION_MINOR "0")
108
+set(VERSION_PATCH "0")
109
+set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
110
+
111
+add_subdirectory(external)
112
+add_subdirectory(dbt-core)
113
+add_subdirectory(sc-components)
114
+add_subdirectory(softfloat)
115
+GET_DIRECTORY_PROPERTY(SOFTFLOAT_INCLUDE_DIRS DIRECTORY softfloat DEFINITION SOFTFLOAT_INCLUDE_DIRS)
116
+add_subdirectory(riscv)
117
+add_subdirectory(platform)
118
+
119
+message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")

+ 0
- 6
build.sh View File

@@ -1,6 +0,0 @@
1
-mkdir -f build/Release
2
-cd build/Release
3
-cmake ../.. -DCMAKE_BUILD_TYPE=RelWithDebInfo && \
4
-	cmake --build . && \
5
-	bin/riscv --reset=0x20400000 --verbose=4 $HOME/eclipse-workspace/RiscV-dhrystone/dhrystone
6
-

+ 0
- 20
cmake/Common.cmake View File

@@ -1,20 +0,0 @@
1
-# Function to link between sub-projects
2
-function(add_dependent_subproject subproject_name)
3
-    #if (NOT TARGET ${subproject_name}) # target unknown
4
-    if(NOT PROJECT_${subproject_name}) # var unknown because we build only this subproject
5
-        find_package(${subproject_name} CONFIG REQUIRED)
6
-    else () # we know the target thus we are doing a build from the top directory
7
-        include_directories(../${subproject_name}/incl)
8
-    endif ()
9
-endfunction(add_dependent_subproject)
10
-
11
-# Make sure we tell the topdir CMakeLists that we exist (if build from topdir)
12
-get_directory_property(hasParent PARENT_DIRECTORY)
13
-if(hasParent)
14
-    set(PROJECT_${PROJECT_NAME} true PARENT_SCOPE)
15
-endif()
16
-
17
-# Function to link between sub-projects
18
-function(add_dependent_header subproject_name)
19
-    include_directories(../${subproject_name}/incl)
20
-endfunction(add_dependent_header)

+ 0
- 46
cmake/Conan.cmake View File

@@ -1,46 +0,0 @@
1
-macro(setup_conan)
2
-  find_program(conan conan)
3
-  if(NOT EXISTS ${conan})
4
-    message(FATAL_ERROR "Conan is required. Please see README.md")
5
-    return()
6
-  endif()
7
-
8
-  if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
9
-    set(os Macos)
10
-  else()
11
-    set(os ${CMAKE_HOST_SYSTEM_NAME})
12
-  endif()
13
-
14
-  if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
15
-    set(compiler gcc)
16
-  elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
17
-    set(compiler apple-clang)
18
-  else()
19
-    message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
20
-  endif()
21
-
22
-  string(SUBSTRING ${CMAKE_CXX_COMPILER_VERSION} 0 3 compiler_version)
23
-
24
-  set(conanfile ${CMAKE_SOURCE_DIR}/conanfile.txt)
25
-  set(conanfile_cmake ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
26
-  set(compiler_libcxx libstdc++11)
27
-
28
-  if("${CMAKE_BUILD_TYPE}" STREQUAL "")
29
-	set(CONAN_BUILD_TYPE Debug)
30
-  elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
31
-	set(CONAN_BUILD_TYPE Release)
32
-  else()
33
-	set(CONAN_BUILD_TYPE ${CMAKE_BUILD_TYPE})
34
-  endif()
35
-
36
-  execute_process(COMMAND ${conan} install --build=missing
37
-	  -s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${compiler_libcxx}
38
-	           ${CMAKE_SOURCE_DIR} RESULT_VARIABLE return_code)
39
-  if(NOT ${return_code} EQUAL 0)
40
-    message(FATAL_ERROR "conan install command failed.")
41
-  endif()
42
-
43
-  include(${conanfile_cmake})
44
-  #conan_basic_setup(TARGETS)
45
-  conan_basic_setup()
46
-endmacro()

+ 0
- 24
cmake/DoxygenTarget.cmake View File

@@ -1,24 +0,0 @@
1
-function(PrepareDocTarget)
2
-
3
-  # Configure the doxygen config file with current settings:
4
-  configure_file(documentation-config.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/documentation-config.doxygen @ONLY)
5
-
6
-  # Set the name of the target : "doc" if it doesn't already exist and "doc<projectname>" if it does.
7
-  # This way we make sure to have a single "doc" target. Either it is the one of the top directory or
8
-  # it is the one of the subproject that we are compiling alone.
9
-  set(DOC_TARGET_NAME "doc")
10
-  if(TARGET doc)
11
-    set(DOC_TARGET_NAME "doc${PROJECT_NAME}")
12
-  endif()
13
-
14
-  add_custom_target(${DOC_TARGET_NAME} ${TARGET_ALL}
15
-      ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/documentation-config.doxygen
16
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
17
-      COMMENT "Generating API documentation using doxygen for ${PROJECT_NAME}" VERBATIM)
18
-
19
-  set(INSTALL_DOC_DIR ${CMAKE_BINARY_DIR}/doc/${PROJECT_NAME}/html)
20
-  file(MAKE_DIRECTORY ${INSTALL_DOC_DIR}) # needed for install
21
-
22
-  install(DIRECTORY ${INSTALL_DOC_DIR} DESTINATION share/${PROJECT_NAME}-${VERSION_MAJOR} COMPONENT doc)
23
-
24
-endfunction()

+ 0
- 38
cmake/FindTcmalloc.cmake View File

@@ -1,38 +0,0 @@
1
-# - Find Tcmalloc
2
-# Find the native Tcmalloc library
3
-#
4
-#  Tcmalloc_LIBRARIES   - List of libraries when using Tcmalloc.
5
-#  Tcmalloc_FOUND       - True if Tcmalloc found.
6
-
7
-if (USE_TCMALLOC)
8
-  set(Tcmalloc_NAMES tcmalloc)
9
-else ()
10
-  set(Tcmalloc_NAMES tcmalloc_minimal tcmalloc tcmalloc_minimal4 libtcmalloc_minimal.so.4)
11
-endif ()
12
-
13
-find_library(Tcmalloc_LIBRARY NO_DEFAULT_PATH
14
-  NAMES ${Tcmalloc_NAMES}
15
-  PATHS ${HT_DEPENDENCY_LIB_DIR} /lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/local/lib /opt/local/lib
16
-)
17
-
18
-if (Tcmalloc_LIBRARY)
19
-  set(Tcmalloc_FOUND TRUE)
20
-  set( Tcmalloc_LIBRARIES ${Tcmalloc_LIBRARY} )
21
-else ()
22
-  set(Tcmalloc_FOUND FALSE)
23
-  set( Tcmalloc_LIBRARIES )
24
-endif ()
25
-
26
-if (Tcmalloc_FOUND)
27
-  message(STATUS "Found Tcmalloc: ${Tcmalloc_LIBRARY}")
28
-else ()
29
-  message(STATUS "Not Found Tcmalloc: ${Tcmalloc_LIBRARY}")
30
-  if (Tcmalloc_FIND_REQUIRED)
31
-    message(STATUS "Looked for Tcmalloc libraries named ${Tcmalloc_NAMES}.")
32
-    message(FATAL_ERROR "Could NOT find Tcmalloc library")
33
-  endif ()
34
-endif ()
35
-
36
-mark_as_advanced(
37
-  Tcmalloc_LIBRARY
38
-)

+ 0
- 130
cmake/GetGitRevisionDescription.cmake View File

@@ -1,130 +0,0 @@
1
-# - Returns a version string from Git
2
-#
3
-# These functions force a re-configure on each git commit so that you can
4
-# trust the values of the variables in your build system.
5
-#
6
-#  get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
7
-#
8
-# Returns the refspec and sha hash of the current head revision
9
-#
10
-#  git_describe(<var> [<additional arguments to git describe> ...])
11
-#
12
-# Returns the results of git describe on the source tree, and adjusting
13
-# the output so that it tests false if an error occurs.
14
-#
15
-#  git_get_exact_tag(<var> [<additional arguments to git describe> ...])
16
-#
17
-# Returns the results of git describe --exact-match on the source tree,
18
-# and adjusting the output so that it tests false if there was no exact
19
-# matching tag.
20
-#
21
-# Requires CMake 2.6 or newer (uses the 'function' command)
22
-#
23
-# Original Author:
24
-# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
25
-# http://academic.cleardefinition.com
26
-# Iowa State University HCI Graduate Program/VRAC
27
-#
28
-# Copyright Iowa State University 2009-2010.
29
-# Distributed under the Boost Software License, Version 1.0.
30
-# (See accompanying file LICENSE_1_0.txt or copy at
31
-# http://www.boost.org/LICENSE_1_0.txt)
32
-
33
-if(__get_git_revision_description)
34
-	return()
35
-endif()
36
-set(__get_git_revision_description YES)
37
-
38
-# We must run the following at "include" time, not at function call time,
39
-# to find the path to this module rather than the path to a calling list file
40
-get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
41
-
42
-function(get_git_head_revision _refspecvar _hashvar)
43
-	set(GIT_PARENT_DIR "${CMAKE_CURRENT_LIST_DIR}")
44
-	set(GIT_DIR "${GIT_PARENT_DIR}/.git")
45
-	while(NOT EXISTS "${GIT_DIR}")	# .git dir not found, search parent directories
46
-		set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
47
-		get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
48
-		if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
49
-			# We have reached the root directory, we are not in git
50
-			set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
51
-			set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
52
-			return()
53
-		endif()
54
-		set(GIT_DIR "${GIT_PARENT_DIR}/.git")
55
-	endwhile()
56
-	# check if this is a submodule
57
-	if(NOT IS_DIRECTORY ${GIT_DIR})
58
-		file(READ ${GIT_DIR} submodule)
59
-		string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
60
-		get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
61
-		get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
62
-	endif()
63
-	set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
64
-	if(NOT EXISTS "${GIT_DATA}")
65
-		file(MAKE_DIRECTORY "${GIT_DATA}")
66
-	endif()
67
-
68
-	if(NOT EXISTS "${GIT_DIR}/HEAD")
69
-		return()
70
-	endif()
71
-	set(HEAD_FILE "${GIT_DATA}/HEAD")
72
-	configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
73
-
74
-	configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
75
-		"${GIT_DATA}/grabRef.cmake"
76
-		@ONLY)
77
-	include("${GIT_DATA}/grabRef.cmake")
78
-
79
-	set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
80
-	set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
81
-endfunction()
82
-
83
-function(git_describe _var)
84
-	if(NOT GIT_FOUND)
85
-		find_package(Git QUIET)
86
-	endif()
87
-	get_git_head_revision(refspec hash)
88
-	if(NOT GIT_FOUND)
89
-		set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
90
-		return()
91
-	endif()
92
-	if(NOT hash)
93
-		set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
94
-		return()
95
-	endif()
96
-
97
-	# TODO sanitize
98
-	#if((${ARGN}" MATCHES "&&") OR
99
-	#	(ARGN MATCHES "||") OR
100
-	#	(ARGN MATCHES "\\;"))
101
-	#	message("Please report the following error to the project!")
102
-	#	message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}")
103
-	#endif()
104
-
105
-	#message(STATUS "Arguments to execute_process: ${ARGN}")
106
-
107
-	execute_process(COMMAND
108
-		"${GIT_EXECUTABLE}"
109
-		describe
110
-		${hash}
111
-		${ARGN}
112
-		WORKING_DIRECTORY
113
-		"${CMAKE_SOURCE_DIR}"
114
-		RESULT_VARIABLE
115
-		res
116
-		OUTPUT_VARIABLE
117
-		out
118
-		ERROR_QUIET
119
-		OUTPUT_STRIP_TRAILING_WHITESPACE)
120
-	if(NOT res EQUAL 0)
121
-		set(out "${out}-${res}-NOTFOUND")
122
-	endif()
123
-
124
-	set(${_var} "${out}" PARENT_SCOPE)
125
-endfunction()
126
-
127
-function(git_get_exact_tag _var)
128
-	git_describe(out --exact-match ${ARGN})
129
-	set(${_var} "${out}" PARENT_SCOPE)
130
-endfunction()

+ 0
- 41
cmake/GetGitRevisionDescription.cmake.in View File

@@ -1,41 +0,0 @@
1
-#
2
-# Internal file for GetGitRevisionDescription.cmake
3
-#
4
-# Requires CMake 2.6 or newer (uses the 'function' command)
5
-#
6
-# Original Author:
7
-# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
8
-# http://academic.cleardefinition.com
9
-# Iowa State University HCI Graduate Program/VRAC
10
-#
11
-# Copyright Iowa State University 2009-2010.
12
-# Distributed under the Boost Software License, Version 1.0.
13
-# (See accompanying file LICENSE_1_0.txt or copy at
14
-# http://www.boost.org/LICENSE_1_0.txt)
15
-
16
-set(HEAD_HASH)
17
-
18
-file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
19
-
20
-string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
21
-if(HEAD_CONTENTS MATCHES "ref")
22
-	# named branch
23
-	string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
24
-	if(EXISTS "@GIT_DIR@/${HEAD_REF}")
25
-		configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
26
-	else()
27
-		configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY)
28
-		file(READ "@GIT_DATA@/packed-refs" PACKED_REFS)
29
-		if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}")
30
-			set(HEAD_HASH "${CMAKE_MATCH_1}")
31
-		endif()
32
-	endif()
33
-else()
34
-	# detached HEAD
35
-	configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
36
-endif()
37
-
38
-if(NOT HEAD_HASH)
39
-	file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
40
-	string(STRIP "${HEAD_HASH}" HEAD_HASH)
41
-endif()

+ 0
- 22
cmake/GitFunctions.cmake View File

@@ -1,22 +0,0 @@
1
-if(__git_functions)
2
-    return()
3
-endif()
4
-set(__git_functions YES)
5
-
6
-function( get_branch_from_git )
7
-    execute_process(
8
-        COMMAND git rev-parse --abbrev-ref HEAD
9
-        WORKING_DIRECTORY   ${PROJECT_SOURCE_DIR}
10
-        RESULT_VARIABLE   git_result
11
-        OUTPUT_VARIABLE   git_branch
12
-        ERROR_VARIABLE    git_error
13
-        OUTPUT_STRIP_TRAILING_WHITESPACE
14
-        ERROR_STRIP_TRAILING_WHITESPACE
15
-    )
16
-    if( NOT git_result EQUAL 0 )
17
-        message( FATAL_ERROR "Failed to execute Git: ${git_error}" )
18
-    endif()
19
-    
20
-    set( GIT_BRANCH ${git_branch} PARENT_SCOPE )
21
-endfunction( get_branch_from_git )
22
-

+ 0
- 44
cmake/PackageConfigurator.cmake View File

@@ -1,44 +0,0 @@
1
-# Create package-config files :
2
-#  - <projectname>ConfigVersion.cmake
3
-#  - <projectname>Config.cmake
4
-# They are installed in lib/cmake/<projectname>.
5
-#
6
-# Required variables :
7
-#  - VERSION
8
-#  - PROJECT_NAME
9
-#
10
-
11
-# Include needed for 'write_basic_package_version_file'
12
-include(CMakePackageConfigHelpers)
13
-
14
-write_basic_package_version_file(
15
-  "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake"
16
-  VERSION ${VERSION}
17
-  COMPATIBILITY AnyNewerVersion
18
-)
19
-
20
-configure_file(cmake/${PROJECT_NAME}Config.cmake
21
-  "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}Config.cmake"
22
-  COPYONLY
23
-)
24
-
25
-# Destination
26
-set(config_install_dir lib/cmake/${PROJECT_NAME})
27
-
28
-# Config installation
29
-#   * <prefix>/lib/cmake/<project>/<project>Targets.cmake
30
-install(
31
-  EXPORT ${PROJECT_NAME}Targets
32
-  DESTINATION ${config_install_dir}
33
-)
34
-
35
-# Config installation
36
-#   * <prefix>/lib/cmake/<project>/<project>Config.cmake
37
-#   * <prefix>/lib/cmake/<project>/<project>ConfigVersion.cmake
38
-install(
39
-  FILES
40
-    cmake/${PROJECT_NAME}Config.cmake
41
-    "${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake"
42
-  DESTINATION ${config_install_dir}
43
-  COMPONENT devel
44
-)

+ 0
- 57
cmake/Submodules.cmake View File

@@ -1,57 +0,0 @@
1
-if(EXISTS "${PROJECT_SOURCE_DIR}/.gitmodules")
2
-message(STATUS "Updating submodules to their latest/fixed versions")
3
-message(STATUS "(this can take a while, please be patient)")
4
-
5
-### First, get all submodules in
6
-if(${GIT_SUBMODULES_CHECKOUT_QUIET})
7
-    execute_process(
8
-        COMMAND             git submodule update --init --recursive
9
-        WORKING_DIRECTORY   ${PROJECT_SOURCE_DIR}
10
-        OUTPUT_QUIET
11
-        ERROR_QUIET
12
-    )
13
-else()
14
-    execute_process(
15
-        COMMAND             git submodule update --init --recursive
16
-        WORKING_DIRECTORY   ${PROJECT_SOURCE_DIR}
17
-    )
18
-endif()
19
-
20
-### Then, checkout each submodule to the specified commit
21
-# Note: Execute separate processes here, to make sure each one is run,
22
-# should one crash (because of branch not existing, this, that ... whatever)
23
-foreach(GIT_SUBMODULE ${GIT_SUBMODULES})
24
-
25
-    if( "${GIT_SUBMODULE_VERSION_${GIT_SUBMODULE}}" STREQUAL "" )
26
-        message(STATUS "no specific version given for submodule ${GIT_SUBMODULE}, checking out master")
27
-        if( "${GIT_SUBMODULE_BRANCH_${GIT_SUBMODULE}}" STREQUAL "" )
28
-            set(GIT_SUBMODULE_VERSION_${GIT_SUBMODULE} "master")
29
-        else()
30
-            set(GIT_SUBMODULE_VERSION_${GIT_SUBMODULE} ${GIT_SUBMODULE_BRANCH_${GIT_SUBMODULE}})
31
-        endif()
32
-    endif()
33
-
34
-    if( "${GIT_SUBMODULE_DIR_${GIT_SUBMODULE}}" STREQUAL "" )
35
-        set(GIT_SUBMODULES_DIRECTORY external)
36
-    else()
37
-        set(GIT_SUBMODULES_DIRECTORY ${GIT_SUBMODULE_DIR_${GIT_SUBMODULE}})
38
-    endif()
39
-
40
-    if(${GIT_SUBMODULES_CHECKOUT_QUIET})
41
-        execute_process(
42
-            COMMAND             git checkout ${GIT_SUBMODULE_VERSION_${GIT_SUBMODULE}}
43
-            WORKING_DIRECTORY   ${PROJECT_SOURCE_DIR}/${GIT_SUBMODULES_DIRECTORY}/${GIT_SUBMODULE}
44
-            OUTPUT_QUIET
45
-            ERROR_QUIET
46
-        )
47
-    else()
48
-        message(STATUS "checking out ${GIT_SUBMODULE}'s commit/tag ${GIT_SUBMODULE_VERSION_${GIT_SUBMODULE}}")
49
-        execute_process(
50
-            COMMAND             git checkout ${GIT_SUBMODULE_VERSION_${GIT_SUBMODULE}}
51
-            WORKING_DIRECTORY   ${PROJECT_SOURCE_DIR}/${GIT_SUBMODULES_DIRECTORY}/${GIT_SUBMODULE}
52
-        )
53
-    endif()
54
-
55
-endforeach(${GIT_SUBMODULE})
56
-
57
-endif()

+ 0
- 19
conanfile.txt View File

@@ -1,19 +0,0 @@
1
-[requires]
2
-    gsl_microsoft/20180102@bincrafters/stable
3
-    spdlog/0.16.3@bincrafters/stable
4
-    fmt/5.2.1@bincrafters/stable 
5
-    Seasocks/1.3.2@minres/stable
6
-    SystemC/2.3.2@minres/stable
7
-    SystemCVerification/2.0.1@minres/stable
8
-    SystemC-CCI/1.0.0@minres/stable
9
-
10
-[generators]
11
-    cmake
12
-
13
-[options]
14
-    Seasocks:shared=True
15
-    fmt:header_only=True
16
-    SystemC:stdcxx=14
17
-    SystemC:shared=True
18
-    SystemCVerification:stdcxx=14
19
-    SystemC-CCI:stdcxx=14

+ 0
- 1728
cycles.txt
File diff suppressed because it is too large
View File


+ 0
- 1
dbt-core

@@ -1 +0,0 @@
1
-Subproject commit 2f4aab87b0f86504a26cd8a6e781fc43bfd6e00f

+ 0
- 8
etc/CoreDSL generator.launch View File

@@ -1,8 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
3
-<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item path=&quot;/dbt-riscv/riscv&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
4
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
5
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="/usr/bin/java"/>
6
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-Xmx1G -jar ${env_var:HOME}/git/JIT-ISS-CoreDsl/com.minres.coredsl.standalone/target/com.minres.coredsl.standalone-1.0.0-SNAPSHOT.jar&#10;-i=${project_loc:DBT-RISE-RISCV}/riscv/incl/iss/arch&#10;-s=${project_loc:DBT-RISE-RISCV}/riscv/src/iss&#10;-v=${project_loc:DBT-RISE-RISCV}/riscv/src/internal&#10;-t=${project_loc:DBT-RISE-RISCV}/riscv/gen_input/templates&#10;${project_loc:DBT-RISE-RISCV}/riscv/gen_input/minres_rv.core_desc"/>
7
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/DBT-RISE-RISCV}/riscv/gen_input"/>
8
-</launchConfiguration>

+ 0
- 15
etc/cmake DBT-RISE-RISCV Debug.launch View File

@@ -1,15 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
3
-<booleanAttribute key="de.toem.impulse.launchactivateLaunch" value="false"/>
4
-<booleanAttribute key="de.toem.impulse.launchactivateTermination" value="false"/>
5
-<intAttribute key="de.toem.impulse.launchdelayLaunch" value="0"/>
6
-<intAttribute key="de.toem.impulse.launchlaunch" value="2"/>
7
-<intAttribute key="de.toem.impulse.launchmode" value="3"/>
8
-<stringAttribute key="de.toem.impulse.launchport" value=""/>
9
-<booleanAttribute key="de.toem.impulse.launchrestart" value="true"/>
10
-<intAttribute key="de.toem.impulse.launchterminate" value="1"/>
11
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
12
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/DBT-RISE-RISCV/etc/cmake.sh}"/>
13
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-DCMAKE_BUILD_TYPE=Debug .."/>
14
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/DBT-RISE-RISCV}"/>
15
-</launchConfiguration>

+ 0
- 7
etc/cmake DBT-RISE-RISCV Release.launch View File

@@ -1,7 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
3
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
4
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/dbt-riscv/etc/cmake.sh}"/>
5
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-DCMAKE_BUILD_TYPE=Release .."/>
6
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/dbt-riscv}"/>
7
-</launchConfiguration>

+ 0
- 47
etc/cmake.sh View File

@@ -1,47 +0,0 @@
1
-#!/bin/sh
2
-#******************************************************************************
3
-# Copyright (C) 2018 MINRES Technologies GmbH
4
-# All rights reserved.
5
-#
6
-# Redistribution and use in source and binary forms, with or without
7
-# modification, are permitted provided that the following conditions are met:
8
-#
9
-# 1. Redistributions of source code must retain the above copyright notice,
10
-#    this list of conditions and the following disclaimer.
11
-#
12
-# 2. Redistributions in binary form must reproduce the above copyright notice,
13
-#    this list of conditions and the following disclaimer in the documentation
14
-#    and/or other materials provided with the distribution.
15
-#
16
-# 3. Neither the name of the copyright holder nor the names of its contributors
17
-#    may be used to endorse or promote products derived from this software
18
-#    without specific prior written permission.
19
-#
20
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
-# POSSIBILITY OF SUCH DAMAGE.
31
-#
32
-#******************************************************************************/
33
-##
34
-
35
-if [ -n "$1" ]; then
36
-	suffix=$1
37
-else
38
-	suffix=Debug
39
-fi
40
-cwd=`pwd`
41
-for i in $*; do	
42
-	if echo "$i" | grep 'CMAKE_BUILD_TYPE='; then
43
-		suffix=`echo $i | sed 's/-DCMAKE_BUILD_TYPE=//'`
44
-	fi
45
-done
46
-mkdir -p build/$suffix && cd build/$suffix
47
-cmake $* $cwd

+ 0
- 42
etc/dbt-riscv Debug hello gdb.launch View File

@@ -1,42 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
3
-<booleanAttribute key="de.toem.impulse.launchactivateLaunch" value="false"/>
4
-<booleanAttribute key="de.toem.impulse.launchactivateTermination" value="false"/>
5
-<intAttribute key="de.toem.impulse.launchdelayLaunch" value="0"/>
6
-<intAttribute key="de.toem.impulse.launchlaunch" value="2"/>
7
-<intAttribute key="de.toem.impulse.launchmode" value="3"/>
8
-<stringAttribute key="de.toem.impulse.launchport" value=""/>
9
-<booleanAttribute key="de.toem.impulse.launchrestart" value="true"/>
10
-<intAttribute key="de.toem.impulse.launchterminate" value="1"/>
11
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
12
-<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
13
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
14
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
15
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
16
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
17
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
18
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE_MODE" value="UseSoftTrace"/>
19
-<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
20
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
21
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
22
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
23
-<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="1"/>
24
-<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
25
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
26
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
27
-<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
28
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
29
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-v4&#10;-g10000&#10;${project_loc:hello}/hello"/>
30
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/Debug/riscv/bin/riscv-sim"/>
31
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="DBT-RISE-RISCV"/>
32
-<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
33
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.exe.debug.1751741082"/>
34
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
35
-<listEntry value="/DBT-RISE-RISCV"/>
36
-</listAttribute>
37
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
38
-<listEntry value="4"/>
39
-</listAttribute>
40
-<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
41
-<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
42
-</launchConfiguration>

+ 0
- 42
etc/dbt-riscv Debug hello w plugin.launch View File

@@ -1,42 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
3
-<booleanAttribute key="de.toem.impulse.launchactivateLaunch" value="false"/>
4
-<booleanAttribute key="de.toem.impulse.launchactivateTermination" value="false"/>
5
-<intAttribute key="de.toem.impulse.launchdelayLaunch" value="0"/>
6
-<intAttribute key="de.toem.impulse.launchlaunch" value="2"/>
7
-<intAttribute key="de.toem.impulse.launchmode" value="3"/>
8
-<stringAttribute key="de.toem.impulse.launchport" value=""/>
9
-<booleanAttribute key="de.toem.impulse.launchrestart" value="true"/>
10
-<intAttribute key="de.toem.impulse.launchterminate" value="1"/>
11
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
12
-<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
13
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
14
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
15
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
16
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
17
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
18
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE_MODE" value="UseSoftTrace"/>
19
-<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
20
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
21
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
22
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
23
-<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="1"/>
24
-<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
25
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
26
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
27
-<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
28
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
29
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-v4&#10;-p ic=${workspace_loc:DBT-RISE-RISCV}/cycles.txt&#10;${project_loc:hello}/hello"/>
30
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/Debug/riscv/bin/riscv-sim"/>
31
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="DBT-RISE-RISCV"/>
32
-<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
33
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.exe.debug.1751741082"/>
34
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
35
-<listEntry value="/DBT-RISE-RISCV"/>
36
-</listAttribute>
37
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
38
-<listEntry value="4"/>
39
-</listAttribute>
40
-<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
41
-<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
42
-</launchConfiguration>

+ 0
- 47
etc/hello Debug.launch View File

@@ -1,47 +0,0 @@
1
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
-<launchConfiguration type="org.eclipse.cdt.debug.gdbjtag.launchConfigurationType">
3
-<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.delay" value="3"/>
4
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doHalt" value="false"/>
5
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.doReset" value="false"/>
6
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
7
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
8
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.initCommands" value=""/>
9
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
10
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="Generic TCP/IP"/>
11
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDeviceId" value="org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"/>
12
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="false"/>
13
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="true"/>
14
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
15
-<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="10000"/>
16
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.runCommands" value=""/>
17
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
18
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
19
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="false"/>
20
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value=""/>
21
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
22
-<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
23
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
24
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
25
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
26
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
27
-<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
28
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="riscv64-unknown-elf-gdb"/>
29
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_ENABLED" value="false"/>
30
-<stringAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_VALUE" value=""/>
31
-<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="true"/>
32
-<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
33
-<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
34
-<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
35
-<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="hello"/>
36
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="hello"/>
37
-<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
38
-<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.cross.exe.debug.1288357282"/>
39
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
40
-<listEntry value="/hello"/>
41
-</listAttribute>
42
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
43
-<listEntry value="4"/>
44
-</listAttribute>
45
-<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
46
-<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
47
-</launchConfiguration>

+ 0
- 28
external/CMakeLists.txt View File

@@ -1,28 +0,0 @@
1
-cmake_minimum_required(VERSION 3.3)
2
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
3
-
4
-# Set the name of your project here
5
-project("external")
6
-
7
-include(Common)
8
-
9
-
10
-include_directories( ${PROJECT_SOURCE_DIR}/libGIS )
11
-
12
-FILE(GLOB ElfioHeaders elfio *.hpp)
13
-FILE(GLOB GISHeaders libGis *.h)
14
-
15
-set(LIB_HEADERS ${ElfioHeaders} ${GISHeaders})
16
-set(LIB_SOURCES
17
-    libGIS/atmel_generic.c
18
-    libGIS/ihex.c
19
-    libGIS/srecord.c
20
-)
21
-
22
-# Define two variables in order not to repeat ourselves.
23
-set(LIBRARY_NAME external)
24
-
25
-# Define the library
26
-add_library(${LIBRARY_NAME} ${LIB_SOURCES})
27
-
28
-

+ 0
- 1
external/elfio

@@ -1 +0,0 @@
1
-Subproject commit 1fdbb6423528684e7b5d6dd9095b64f5617b1434

+ 0
- 1
external/libGIS

@@ -1 +0,0 @@
1
-Subproject commit f82b9dd3018d479230ad68a02da41fa95cad9123

riscv/gen_input/.gitignore → gen_input/.gitignore View File


riscv/gen_input/RISCVBase.core_desc → gen_input/RISCVBase.core_desc View File


riscv/gen_input/RV32I.core_desc → gen_input/RV32I.core_desc View File


riscv/gen_input/RV64I.core_desc → gen_input/RV64I.core_desc View File


riscv/gen_input/RVA.core_desc → gen_input/RVA.core_desc View File


riscv/gen_input/RVC.core_desc → gen_input/RVC.core_desc View File


riscv/gen_input/RVD.core_desc → gen_input/RVD.core_desc View File


riscv/gen_input/RVF.core_desc → gen_input/RVF.core_desc View File


riscv/gen_input/RVM.core_desc → gen_input/RVM.core_desc View File


riscv/gen_input/minres_rv.core_desc → gen_input/minres_rv.core_desc View File


riscv/gen_input/templates/CORENAME_cyles.txt.gtl → gen_input/templates/CORENAME_cyles.txt.gtl View File


riscv/gen_input/templates/incl-CORENAME.h.gtl → gen_input/templates/incl-CORENAME.h.gtl View File


riscv/gen_input/templates/src-CORENAME.cpp.gtl → gen_input/templates/src-CORENAME.cpp.gtl View File


riscv/gen_input/templates/vm-vm_CORENAME.cpp.gtl → gen_input/templates/vm-vm_CORENAME.cpp.gtl View File


+ 0
- 64
html/app.js View File

@@ -1,64 +0,0 @@
1
-/*******************************************************************************
2
- * Copyright (C) 2018 MINRES Technologies GmbH
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * 1. Redistributions of source code must retain the above copyright notice,
9
- *    this list of conditions and the following disclaimer.
10
- *
11
- * 2. Redistributions in binary form must reproduce the above copyright notice,
12
- *    this list of conditions and the following disclaimer in the documentation
13
- *    and/or other materials provided with the distribution.
14
- *
15
- * 3. Neither the name of the copyright holder nor the names of its contributors
16
- *    may be used to endorse or promote products derived from this software
17
- *    without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- * POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- *******************************************************************************/
32
-var ws;
33
-
34
-$(function() {
35
-    ws = new WebSocket('ws://' + document.location.host + '/ws');
36
-    ws.onopen = function() {
37
-        console.log('onopen');
38
-    };
39
-    ws.onclose = function() {
40
-        $('#message').text('Lost connection.');
41
-        console.log('onclose');
42
-    };
43
-    ws.onmessage = function(message) {
44
-        console.log("got '" + message.data + "'");
45
-        eval(message.data);
46
-    };
47
-    ws.onerror = function(error) {
48
-        console.log('onerror ' + error);
49
-        console.log(error);
50
-    };
51
-    $('#count').click(function() {
52
-    	ws.send($('#count').val());
53
-    });
54
-    $('#close').click(function() {
55
-      ws.send('close');
56
-    });
57
-    $('#die').click(function() {
58
-      ws.send('die');
59
-    });
60
-});
61
-
62
-set = function(value) {
63
-	$('#count').val(value)
64
-}

+ 0
- 14
html/index.html View File

@@ -1,14 +0,0 @@
1
-<!DOCTYPE html>
2
-<html>
3
-  <head>
4
-    <title>Hello, world</title>
5
-    <script src='lib/jquery.min.js'></script>
6
-    <script src='app.js'></script>
7
-  </head>
8
-  <body>
9
-	<input id="count" type="button" value="..."></input>
10
-	<input id="close" type="button" value="Close"></input>
11
-	<input id="die" type="button" value="Die"></input>
12
-  </body>
13
-</html>
14
-

+ 0
- 16
html/lib/jquery.min.js
File diff suppressed because it is too large
View File


+ 0
- 105
html/ws.html View File

@@ -1,105 +0,0 @@
1
-<!doctype html>
2
-<html lang=en>
3
-	<head>
4
-		<meta charset=utf-8>
5
-		<meta name=viewport content="width=device-width, initial-scale=1">
6
-		<title>system output</title>
7
-<style>
8
-h1 { font-family: helvetica, sans-serif; margin: 0; }
9
-h1+p { margin: 0; }
10
-li { font-family: Courier; list-style-type: '>';}
11
-pre { margin-top:0; margin-bottom:0;}
12
-.term { background-color:black; color:white; font-weight:bold;padding-top:10px; padding-bottom:10px; max-height:400px; overflow: scroll;}
13
-span.timestamp { font-family: monospace; white-space: pre;width: 50px;}
14
-span.value_z { background-color: darkblue;}
15
-span.value_1 { background-color: green;}
16
-span.value_0 { background-color: yellow;}
17
-span.value_x { background-color: red;}
18
-</style>
19
-	</head>
20
-	<body>
21
-		<h1>system output</h1>
22
-		<div id="top">
23
-		</div>
24
-		<script>
25
-		String.format = function() {
26
-		    // The string containing the format items (e.g. "{0}")
27
-		    // will and always has to be the first argument.
28
-		    var theString = arguments[0];
29
-		    // start with the second argument (i = 1)
30
-		    for (var i = 1; i < arguments.length; i++) {
31
-		        // "gm" = RegEx options for Global search (more than one instance)
32
-		        // and for Multiline search
33
-		        var regEx = new RegExp("\\{" + (i - 1) + "\\}", "gm");
34
-		        theString = theString.replace(regEx, arguments[i]);
35
-		    }
36
-		    
37
-		    return theString;
38
-		}
39
-		String.prototype.paddingLeft = function (paddingValue) {
40
-			return String(paddingValue + this).slice(-paddingValue.length);
41
-		};
42
-		var log = function (n, m) {
43
-			console.log(m);
44
-	        var data = JSON.parse(m);
45
-	        if( data.hasOwnProperty("message") ) {
46
-				var ul = document.getElementById(n);
47
-			    var li = document.createElement('li');
48
-			    var p = document.createElement('pre');
49
-		        // i.innerText = new Date().toISOString()+': '+m;
50
-		        p.innerText = '['+data.time.paddingLeft('                    ')+'] '+ data.message;
51
-		        li.appendChild(p);
52
-			    ul.appendChild(li);
53
-			    var objDiv = document.getElementById(n + '_container');
54
-			    objDiv.scrollTop = objDiv.scrollHeight;
55
-			} else if(data.hasOwnProperty("data")){
56
-				var ul = document.getElementById(n);
57
-			    var li = document.createElement('li');
58
-			    var span = document.createElement('span');
59
-			    span.className="timestamp";
60
-			    span.innerText='['+data.time.paddingLeft('                    ')+']'
61
-			    li.appendChild(span);
62
-			    var s = data.data;
63
-			    for ( var i = 0; i < s.length; i++ ){
64
-				    var spani = document.createElement('span');
65
-				    if(s.charAt(i) == 'Z')
66
-				    	spani.className="value_z";
67
-				    else if(s.charAt(i) == '1')
68
-				    	spani.className="value_1";
69
-				    else if(s.charAt(i) == '0')
70
-				    	spani.className="value_0";
71
-				    else if(s.charAt(i) == 'X')
72
-				    	spani.className="value_x";
73
-				    spani.appendChild(document.createTextNode('\u00A0'));
74
-				    li.appendChild(spani);			    	
75
-			    }
76
-			    ul.appendChild(li);
77
-			    var objDiv = document.getElementById(n + '_container');
78
-			    objDiv.scrollTop = objDiv.scrollHeight;
79
-			}
80
-		}
81
-		var open_connection = function(name){
82
-			var s = new WebSocket('ws://'+window.location.host+'/ws/i_system.i_hifive1.i_'+name);
83
-			s.addEventListener('error',   function (m) { log(name, new Date().toISOString()+': ===connection error ==='); });
84
-			s.addEventListener('open',    function (m) { log(name, new Date().toISOString()+': ===connection opened==='); });
85
-			s.addEventListener('message', function (m) { log(name, m.data); });
86
-			s.addEventListener('close',   function (m) { log(name, new Date().toISOString()+': ===connection closed==='); });
87
-		}
88
-		var createElem = function(n){
89
-			var top = document.getElementById('top');
90
-			var p = document.createElement('p');
91
-			p.innerText="Component " + n;
92
-			var div = document.createElement('div');
93
-			div.className = "term";
94
-			div.id= n + '_container';
95
-			var ul = document.createElement('ul');
96
-			ul.id= n;
97
-			div.appendChild(ul);
98
-			top.appendChild(p);
99
-			top.appendChild(div);
100
-			open_connection(n);
101
-		}
102
-		createElem("terminal");
103
-		</script>
104
-	</body>
105
-</html>

riscv/incl/iss/arch/riscv_hart_msu_vp.h → incl/iss/arch/riscv_hart_msu_vp.h View File


riscv/incl/iss/arch/rv32gc.h → incl/iss/arch/rv32gc.h View File


riscv/incl/iss/arch/rv32imac.h → incl/iss/arch/rv32imac.h View File


riscv/incl/iss/arch/rv64gc.h → incl/iss/arch/rv64gc.h View File


riscv/incl/iss/arch/rv64i.h → incl/iss/arch/rv64i.h View File


riscv/incl/iss/debugger/riscv_target_adapter.h → incl/iss/debugger/riscv_target_adapter.h View File


riscv/incl/iss/plugin/cycle_estimate.h → incl/iss/plugin/cycle_estimate.h View File


riscv/incl/iss/plugin/instruction_count.h → incl/iss/plugin/instruction_count.h View File


riscv/incl/sysc/core_complex.h → incl/sysc/core_complex.h View File


+ 0
- 57
platform/CMakeLists.txt View File

@@ -1,57 +0,0 @@
1
-cmake_minimum_required(VERSION 3.3)
2
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
3
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
4
-
5
-# CMake useful variables
6
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
7
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") 
8
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
9
-
10
-# Set the name of your project here
11
-project("platform")
12
-
13
-include(Common)
14
-# check that we have averything we need
15
-if(!SystemC_FOUND)
16
-    message( FATAL_ERROR "SystemC library not found." )
17
-endif()
18
-
19
-if(!CCI_FOUND)
20
-    message( FATAL_ERROR "SystemC CCI library not found." )
21
-endif()
22
-
23
-# This sets the include directory for the reference project. This is the -I flag in gcc.
24
-
25
-add_dependent_subproject(dbt-core)
26
-add_dependent_subproject(sc-components)
27
-add_dependent_subproject(riscv)
28
-
29
-include_directories(
30
-    ${PROJECT_SOURCE_DIR}/../external/elfio
31
-    ${PROJECT_SOURCE_DIR}/../external/libGIS
32
-    ${Boost_INCLUDE_DIRS}
33
-)
34
-
35
-# Mac needed variables (adapt for your needs - http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH)
36
-set(CMAKE_MACOSX_RPATH ON)
37
-set(CMAKE_SKIP_BUILD_RPATH FALSE)
38
-set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
39
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
40
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
41
-
42
-## the following setting needs to be consistent with the library
43
-#add_definitions(-DSC_DEFAULT_WRITER_POLICY=SC_MANY_WRITERS)
44
-
45
-add_subdirectory(src)
46
-
47
-#
48
-# SYSTEM PACKAGING (RPM, TGZ, ...)
49
-# _____________________________________________________________________________
50
-
51
-#include(CPackConfig)
52
-
53
-#
54
-# CMAKE PACKAGING (for other CMake projects to use this one easily)
55
-# _____________________________________________________________________________
56
-
57
-#include(PackageConfigurator)

+ 0
- 158
platform/gen_input/aon.rdl View File

@@ -1,158 +0,0 @@
1
-regfile aon_regs {
2
-	// Watchdog Timer Registers
3
-	reg {
4
-		name = "wdogcfg";
5
-		desc = "Watchdog Timer Config Register";
6
-		field {
7
-			name="data";
8
-		} data[31:0];
9
-	} wdogcfg @0x00;
10
-	reg {
11
-		name ="wdogcount";
12
-		desc = "Watchdog Timer Count Registers";
13
-		field {
14
-			name="data";
15
-		} data[31:0];
16
-	} wdogcount @0x08; 
17
-	reg {
18
-		name ="wdogs";
19
-		desc = "";
20
-		field {
21
-			name="data";
22
-		} data[31:0];
23
-	} wdogs @0x10; 
24
-	reg {
25
-		name ="wdogfeed";
26
-		desc = "";
27
-		field {
28
-			name="data";
29
-		} data[31:0];
30
-	} wdogfeed @0x18; 
31
-	reg {
32
-		name ="wdogkey";
33
-		desc = "";
34
-		field {
35
-			name="data";
36
-		} data[31:0];
37
-	} wdogkey @0x1C; 
38
-	reg {
39
-		name ="wdogcmp";
40
-		desc = "";
41
-		field {
42
-			name="data";
43
-		} data[31:0];
44
-	} wdogcmp @0x20;
45
-	// Real-Time Clock Registers
46
-	reg {
47
-		name ="rtccfg";
48
-		desc = "";
49
-		field {
50
-			name="data";
51
-		} data[31:0];
52
-	} rtccfg @0x40;
53
-	reg {
54
-		name ="rtclo";
55
-		desc = "";
56
-		field {
57
-			name="data";
58
-		} data[31:0];
59
-	}  rtclo @0x48;
60
- 	reg {
61
-		name ="rtchi";
62
-		desc = "";
63
-		field {
64
-			name="data";
65
-		} data[31:0];
66
-	} rtchi @0x4C;
67
-	reg {
68
-		name ="rtcs";
69
-		desc = "";
70
-		field {
71
-			name="data";
72
-		} data[31:0];
73
-	}  rtcs @0x50;
74
-	reg {
75
-		name ="rtccmp";
76
-		desc = "";
77
-		field {
78
-			name="data";
79
-		} data[31:0];
80
-	} rtccmp @0x60;
81
-	// AON Clock Configuration Registers
82
-	reg {
83
-		name ="lfrosccfg";
84
-		desc = "";
85
-		field {
86
-			name="data";
87
-		} data[31:0];
88
-	} lfrosccfg @0x70;
89
-	// Backup Registers
90
-	reg {
91
-		name ="lfrosccfg";
92
-		desc = "";
93
-		field {
94
-			name="data";
95
-		} data[31:0];
96
-	} backup[32] @0x80;
97
-	// Power Management Unit
98
-	reg {
99
-		name ="pmuwakeupi";
100
-		desc = "";
101
-		field {
102
-			name="delay";
103
-		} delay[3:0];
104
-		field {
105
-			name="vddpaden";
106
-		} vddpaden[5:5];
107
-		field {
108
-			name="corerst";
109
-		} corerst[7:7];
110
-		field {
111
-			name="hfclkrst";
112
-		} hfclkrst[8:8];
113
-	} pmuwakeupi[8] @0x0100;
114
-	reg {
115
-		name ="pmusleepi";
116
-		desc = "";
117
-		field {
118
-			name="delay";
119
-		} delay[3:0];
120
-		field {
121
-			name="vddpaden";
122
-		} vddpaden[5:5];
123
-		field {
124
-			name="corerst";
125
-		} corerst[7:7];
126
-		field {
127
-			name="hfclkrst";
128
-		} hfclkrst[8:8];
129
-	} pmusleepi[8] @0x0120;
130
-	reg {
131
-		name ="pmuie";
132
-		desc = "";
133
-		field {
134
-			name="data";
135
-		} data[31:0];
136
-	} pmuie @0x0140;
137
-	reg {
138
-		name ="pmucause";
139
-		desc = "";
140
-		field {
141
-			name="data";
142
-		} data[31:0];
143
-	} pmucause @0x0144;
144
-	reg {
145
-		name ="pmusleep";
146
-		desc = "";
147
-		field {
148
-			name="data";
149
-		} data[31:0];
150
-	} pmusleep @0x0148;
151
-	reg {
152
-		name ="pmukey";
153
-		desc = "";
154
-		field {
155
-			name="data";
156
-		} data[31:0];
157
-	} pmukey @0x014C;
158
-};

+ 0
- 27
platform/gen_input/clint.rdl View File

@@ -1,27 +0,0 @@
1
-regfile clint_regs {
2
-	reg {
3
-		name = "msip";
4
-		desc = "Hart 0 software interrupt register";
5
-		field {
6
-			name="msip";
7
-		} msip[0:0];
8
-	} msip @0;
9
-	reg {
10
-		name = "mtimecmp";
11
-		desc = "Hart 0 time comparator register";
12
-		regwidth=64;
13
-		field {
14
-			name="data";
15
-			fieldwidth=64;
16
-		} data = 64'h7FFFFFFFFFFFFFFF;
17
-	} mtimecmp @0x4000;
18
-	reg {
19
-		name = "mtime";
20
-		desc = "Timer register";
21
-		regwidth=64;
22
-		field {
23
-			fieldwidth=64;
24
-			name="data";
25
-		} data[63:0];
26
-	} mtime @0xBFF8;
27
-};

+ 0
- 25
platform/gen_input/fe310.rdl View File

@@ -1,25 +0,0 @@
1
-`include "gpio.rdl"
2
-`include "uart.rdl"
3
-`include "spi.rdl"
4
-`include "pwm.rdl"
5
-`include "plic.rdl"
6
-`include "aon.rdl"
7
-`include "prci.rdl"
8
-`include "clint.rdl"
9
-
10
-addrmap e300_plat_t {
11
-	lsb0;
12
-	clint_regs clint @0x02000000;
13
-    plic_regs  plic  @0x0C000000;
14
-    aon_regs   aon   @0x10000000;
15
-    prci_regs  prci  @0x10008000;
16
-    gpio_regs  gpio0 @0x10012000;
17
-    uart_regs  uart0 @0x10013000;
18
-    spi_regs   qspi0 @0x10014000;  
19
-    pwm_regs   pwm0  @0x10015000;
20
-    uart_regs  uart1 @0x10023000;
21
-    spi_regs   qspi1 @0x10024000;  
22
-    pwm_regs   pwm1  @0x10025000;
23
-    spi_regs   qspi2 @0x10034000;  
24
-    pwm_regs   pwm2  @0x10035000;
25
-} e300_plat;

+ 0
- 121
platform/gen_input/gpio.rdl View File

@@ -1,121 +0,0 @@
1
-regfile gpio_regs {
2
-	reg {
3
-		name="value";
4
-		desc="pin value";
5
-		field {
6
-			name = "data";
7
-		} data[31:0];
8
-	} value @0x000;
9
-	reg {
10
-		name="input_en";
11
-		desc="* pin input enable";
12
-		field {
13
-			name = "data";
14
-		} data[31:0];
15
-	} input_en @0x004;
16
-	reg {
17
-		name="output_en";
18
-		desc="pin output enable";
19
-		field {
20
-			name = "data";
21
-		} data[31:0];
22
-	} output_en @0x008;
23
-	reg {
24
-		name="port";
25
-		desc="output port value";
26
-		field {
27
-			name = "data";
28
-		} data[31:0];
29
-	} port @0x00C;
30
-	reg {
31
-		name="pue";
32
-		desc="internal pull-up enable";
33
-		field {
34
-			name = "data";
35
-		} data[31:0];
36
-	} pue @0x010;
37
-	reg {
38
-		name="ds";
39
-		desc="Pin Drive Strength";
40
-		field {
41
-			name = "data";
42
-		} data[31:0];
43
-	} ds @0x014;
44
-	reg {
45
-		name="rise_ie";
46
-		desc="rise interrupt enable";
47
-		field {
48
-			name = "data";
49
-		} data[31:0];
50
-	} rise_ie @0x018;
51
-	reg {
52
-		name="rise_ip";
53
-		desc="rise interrupt pending";
54
-		field {
55
-			name = "data";
56
-		} data[31:0];
57
-	} rise_ip @0x01C;
58
-	reg {
59
-		name="fall_ie";
60
-		desc="fall interrupt enable";
61
-		field {
62
-			name = "data";
63
-		} data[31:0];
64
-	} fall_ie @0x020;
65
-	reg {
66
-		name="fall_ip";
67
-		desc="fall interrupt pending";
68
-		field {
69
-			name = "data";
70
-		} data[31:0];
71
-	} fall_ip @0x024;
72
-	reg {
73
-		name="high_ie";
74
-		desc="high interrupt enable";
75
-		field {
76
-			name = "data";
77
-		} data[31:0];
78
-	} high_ie @0x028;
79
-	reg {
80
-		name="high_ip";
81
-		desc="high interrupt pending";
82
-		field {
83
-			name = "data";
84
-		} data[31:0];
85
-	} high_ip @0x02C;
86
-	reg {
87
-		name="low_ie";
88
-		desc="low interrupt enable";
89
-		field {
90
-			name = "data";
91
-		} data[31:0];
92
-	} low_ie @0x030;
93
-	reg {
94
-		name="low_ip";
95
-		desc="low interrupt pending";
96
-		field {
97
-			name = "data";
98
-		} data[31:0];
99
-	} low_ip @0x034;
100
-	reg {
101
-		name="iof_en";
102
-		desc="HW I/O Function enable";
103
-		field {
104
-			name = "data";
105
-		} data[31:0];
106
-	} iof_en @0x038;
107
-	reg {
108
-		name="iof_sel";
109
-		desc="HW I/O Function select";
110
-		field {
111
-			name = "data";
112
-		} data[31:0];
113
-	} iof_sel @0x03C;
114
-	reg {
115
-		name="out_xor";
116
-		desc="Output XOR (invert)";
117
-		field {
118
-			name = "data";
119
-		} data[31:0];
120
-	} out_xor @0x040;
121
-};

+ 0
- 27
platform/gen_input/plic.rdl View File

@@ -1,27 +0,0 @@
1
-regfile plic_regs {
2
-	reg {
3
-		name="priority";
4
-		desc="interrupt source priority";
5
-		field {} priority[2:0];
6
-	} priority[256] @0x000;
7
-	reg {
8
-		name="pending";
9
-		desc="pending irq";
10
-		field {} pending[31:0];
11
-	} pending[8] @0x1000;
12
-	reg {
13
-		name="enabled";
14
-		desc="enabled interrupts";
15
-		field {} enabled[31:0];
16
-	} enabled[8] @0x2000;
17
-	reg {
18
-		name="threshold";
19
-		desc="interrupt priority threshold";
20
-		field {} \threshold[2:0];
21
-	} \threshold @0x200000;
22
-	reg {
23
-		name="claim/complete";
24
-		desc="interrupt handling completed";
25
-		field {} interrupt_claimed[31:0];
26
-	} claim_complete @0x200004;
27
-};

+ 0
- 41
platform/gen_input/prci.rdl View File

@@ -1,41 +0,0 @@
1
-regfile prci_regs {
2
-	reg {
3
-		name ="hfrosccfg";
4
-		desc = "";
5
-		field {} hfroscdiv[5:0];
6
-		field {} hfrosctrim[20:16];
7
-		field {} hfroscen[30:30];
8
-		field {} hfroscrdy[31:31];
9
-	} hfrosccfg @0x00;
10
-	reg {
11
-		name ="hfxosccfg";
12
-		desc = "";
13
-		field {} hfxoscrdy[31:31];
14
-		field {} hfxoscen[30:30];
15
-	} hfxosccfg @0x04;
16
-     reg {
17
-        name ="pllcfg";
18
-        desc = "";
19
-        field {} pllr[2:0];
20
-        field {} pllf[9:4];
21
-        field {} pllq[11:10];
22
-        field {} pllsel[16:16];
23
-        field {} pllrefsel[17:17];
24
-        field {} pllbypass[18:18];
25
-        field {} plllock[31:31];
26
-    } pllcfg @0x08;
27
-	reg {
28
-		name ="plloutdiv";
29
-		desc = "";
30
-		field {
31
-			name="data";
32
-		} data[31:0];
33
-	} plloutdiv  @0x0c;
34
-	reg {
35
-		name ="coreclkcfg";
36
-		desc = "";
37
-		field {
38
-			name="data";
39
-		} data[31:0];
40
-	} coreclkcfg @0x10;
41
-};

+ 0
- 96
platform/gen_input/pwm.rdl View File

@@ -1,96 +0,0 @@
1
-regfile pwm_regs {
2
-	reg {
3
-		name="pwmcfg";
4
-		desc="pin value";
5
-		field {
6
-			name = "pwmscale";
7
-		} pwmscale[3:0];
8
-		field {
9
-			name = "pwmsticky";
10
-		} pwmsticky[8:8];
11
-		field {
12
-			name = "pwmzerocmp";
13
-		} pwmsticky[9:9];
14
-		field {
15
-			name = "pwmdeglitch";
16
-		} pwmsticky[10:10];
17
-		field {
18
-			name = "pwmenalways";
19
-		} pwmenalways[12:12];
20
-		field {
21
-			name = "pwmenoneshot";
22
-		} pwmenalways[13:13];
23
-		field {
24
-			name = "pwmcmp0center";
25
-		} pwmcmp0center[16:16];
26
-		field {
27
-			name = "pwmcmp1center";
28
-		} pwmcmp1center[17:17];
29
-		field {
30
-			name = "pwmcmp2center";
31
-		} pwmcmp2center[18:18];
32
-		field {
33
-			name = "pwmcmp3center";
34
-		} pwmcmp3center[19:19];
35
-		field {
36
-			name = "pwmcmp0gang";
37
-		} pwmcmp0gang[24:24];
38
-		field {
39
-			name = "pwmcmp1gang";
40
-		} pwmcmp1gang[25:25];
41
-		field {
42
-			name = "pwmcmp2gang";
43
-		} pwmcmp2gang[26:26];
44
-		field {
45
-			name = "pwmcmp3gang";
46
-		} pwmcmp3gang[27:27];
47
-		field {
48
-			name = "pwmcmp0ip";
49
-		} pwmcmp0ip[28:28];
50
-		field {
51
-			name = "pwmcmp1ip";
52
-		} pwmcmp1ip[29:29];
53
-		field {
54
-			name = "pwmcmp2ip";
55
-		} pwmcmp2ip[30:30];
56
-		field {
57
-			name = "pwmcmp3ip";
58
-		} pwmcmp3ip[31:31];
59
-	} pwmcfg @0x000;
60
-	reg {
61
-		name="pwmcount";
62
-		field {
63
-			name = "pwmcount"; 
64
-		} pwmcount[31:0];
65
-	} pwmcount @0x008;
66
-	reg {
67
-		name="pwms";
68
-		field {
69
-			name = "pwms";
70
-		}pwms[15:0];
71
-	} pwms @0x010;
72
-	reg {
73
-		name="pwmcmp0";
74
-		field {
75
-			name = "pwmcmp0";
76
-		} pwmcmp0[15:0];
77
-	} pwmcmp0 @0x020;
78
-	reg {
79
-		name="pwmcmp1";
80
-		field {
81
-			name = "pwmcmp0";
82
-		} pwmcmp0[15:0];
83
-	} pwmcmp1 @0x024;
84
-	reg {
85
-		name="pwmcmp2";
86
-		field {
87
-			name = "pwmcmp0";
88
-		} pwmcmp0[15:0];
89
-	} pwmcmp2 @0x028;
90
-	reg {
91
-		name="pwmcmp3";
92
-		field {
93
-			name = "pwmcmp0";
94
-		} pwmcmp0[15:0];
95
-	} pwmcmp3 @0x02C;
96
-};

+ 0
- 173
platform/gen_input/spi.rdl View File

@@ -1,173 +0,0 @@
1
-regfile spi_regs {
2
-	reg {
3
-		name="sckdiv";
4
-		desc="Serial clock divisor";
5
-		field {
6
-			name ="div";
7
-		} div[12];
8
-	} sckdiv @0x000;
9
-	reg {
10
-		name="sckmode";
11
-		desc="Serial clock mode";
12
-		field {
13
-			name="pha";
14
-		} pha[1];
15
-		field {
16
-			name="pol";
17
-		} pol[1];
18
-	} sckmode @0x004;
19
-	reg {
20
-		name="csid";
21
-		desc="Chip select ID";
22
-		field {
23
-			name="csid";
24
-		} csid[32];
25
-	} csid @0x010;
26
-	reg {
27
-		name="csdef";
28
-		desc="Chip select default";
29
-		field {
30
-			name="csdef";
31
-		} csdef[32];
32
-	} csdef @0x014;
33
-	reg {
34
-		name="csmode";
35
-		desc="Chip select mode";
36
-		field {
37
-			name="mode";
38
-		} mode[2];
39
-	} csmode @0x018;
40
-	reg {
41
-		name="delay0";
42
-		desc="Delay control 0";
43
-		field {
44
-			name="cssck";
45
-		} cssck[7:0];
46
-		field {
47
-			name ="sckcs";
48
-		} sckcs[23:16];
49
-	} delay0 @0x028;
50
-	reg {
51
-		name="delay1";
52
-		desc="Delay control 1";
53
-		field {
54
-			name="intercs";			
55
-		}intercs[15:0];
56
-		field {
57
-			name="interxfr";
58
-		} interxfr[23:16];
59
-	} delay1 @0x02C;
60
-	reg {
61
-		name="fmt";
62
-		desc="Frame format";
63
-		field{
64
-			name ="proto";
65
-		}proto[2];
66
-		field {
67
-			name="endian";
68
-		} endian[1];
69
-		field {
70
-			name="dir";
71
-		} dir[1];
72
-		field {
73
-			name="len";
74
-		} len[19:16];
75
-	} fmt @0x040;
76
-	reg {
77
-		name="txdata";
78
-		desc="Tx FIFO data";
79
-		field {
80
-			name="data";
81
-		} data[8];
82
-		field {
83
-			name="full";
84
-		} full[31:31];
85
-	} txdata @0x048;
86
-	reg {
87
-		name="rxdata";
88
-		desc="Rx FIFO data";
89
-		field{
90
-			name="data";
91
-		} data[8];
92
-		field{
93
-			name="empty";
94
-		} empty[31:31];
95
-	} rxdata @0x04C;
96
-	reg {
97
-		name="txmark";
98
-		desc="Tx FIFO watermark";
99
-		field {
100
-			name="txmark";
101
-		} txmark[3];
102
-	} txmark @0x050;
103
-	reg {
104
-		name="rxmark";
105
-		desc="Rx FIFO watermark";
106
-		field {
107
-			name="rxmark";
108
-		} rxmark[3];
109
-	} rxmark @0x054;
110
-	reg {
111
-		name="fctrl";
112
-		desc="SPI flash interface control";
113
-		field {
114
-			name="en";
115
-		} en[1];
116
-	} fctrl @0x060;
117
-	reg {
118
-		name="ffmt";
119
-		desc="SPI flash instruction format";
120
-		field {
121
-			name="cmd_en";
122
-			reset=0x1;
123
-		} cmd_en[1];
124
-		field {
125
-			name="addr_len";
126
-			reset=0x3;
127
-		} addr_len[2];
128
-		field {
129
-			name="pad_cnt";
130
-			reset=0x0;
131
-		} pad_cnt[4];
132
-		field {
133
-			name="cmd_proto";
134
-			reset=0x0;
135
-		} cmd_proto[2];
136
-		field {
137
-			name="addr_proto";
138
-			reset=0x0;
139
-		} addr_proto[2];
140
-		field {
141
-			name="data_proto";
142
-			reset=0x0;
143
-		} data_proto[2];
144
-		field {
145
-			name="cmd_code";
146
-			reset=0x3;
147
-		} cmd_code[23:16];
148
-		field {
149
-			name="pad_code";
150
-			reset=0x0;
151
-		} pad_code[8];
152
-	} ffmt @0x064;
153
-	reg {
154
-		name="ie";
155
-		desc="SPI interrupt enable";
156
-		field{
157
-			name="txwm";
158
-		} txwm[1];
159
-		field{
160
-			name="rxwm";
161
-		} rxwm[1];
162
-	} ie @0x070;
163
-	reg {
164
-		name="ip";
165
-		desc="SPI interrupt pending";
166
-		field{
167
-			name="txwm";
168
-		} txwm[1];
169
-		field{
170
-			name="rxwm";
171
-		} rxwm[1];
172
-	} ip @0x074;
173
-};

+ 0
- 46
platform/gen_input/uart.rdl View File

@@ -1,46 +0,0 @@
1
-regfile uart_regs {
2
-	reg {
3
-		name="txdata";
4
-		desc="Transmit data register";
5
-		field {} data[7:0];
6
-		field {} full[31:31];
7
-	} txdata @0x00;
8
-	reg {
9
-		name="rxdata";
10
-		desc="Receive data register";
11
-		field {} data[7:0];
12
-		field {} empty[31:31];
13
-	}rxdata @0x04;
14
-	reg {
15
-		name="txctrl";
16
-		desc="Transmit control register";
17
-		field {} txen[1];
18
-		field {} nstop[1];
19
-		field {} txcnt[18:16];
20
-	}txctrl @0x08;
21
-	reg {
22
-		name="rxctrl";
23
-		desc="Receive control register";
24
-		field {} rxen[1];
25
-		field {} rxcnt[18:16];
26
-	}rxctrl @0x0C;
27
-	reg {
28
-		name="ie";
29
-		desc="UART interrupt enable";
30
-		field{} txwm[1];
31
-		field{} rxwm[1];
32
-	}ie @0x10;
33
-	reg {
34
-		name="ip";
35
-		desc="UART Interrupt pending";
36
-		field{} txwm[1];
37
-		field{} rxwm[1];
38
-	} ip @0x14;
39
-	reg {
40
-		name="div";
41
-		desc="Baud rate divisor";
42
-		field{} div[16];
43
-	} div @0x18;
44
-};
45
-
46
-      

+ 0
- 63
platform/incl/sysc/SiFive/aon.h View File

@@ -1,63 +0,0 @@
1
-/*******************************************************************************
2
- * Copyright (C) 2017, MINRES Technologies GmbH
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * 1. Redistributions of source code must retain the above copyright notice,
9
- *    this list of conditions and the following disclaimer.
10
- *
11
- * 2. Redistributions in binary form must reproduce the above copyright notice,
12
- *    this list of conditions and the following disclaimer in the documentation
13
- *    and/or other materials provided with the distribution.
14
- *
15
- * 3. Neither the name of the copyright holder nor the names of its contributors
16
- *    may be used to endorse or promote products derived from this software
17
- *    without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- * POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- *******************************************************************************/
32
-
33
-#ifndef _AON_H_
34
-#define _AON_H_
35
-
36
-#include "scc/tlm_target.h"
37
-
38
-namespace sysc {
39
-
40
-class aon_regs;
41
-
42
-class aon : public sc_core::sc_module, public scc::tlm_target<> {
43
-public:
44
-    SC_HAS_PROCESS(aon);// NOLINT
45
-    sc_core::sc_in<sc_core::sc_time> clk_i;
46
-    sc_core::sc_in<bool> erst_n_i;
47
-    sc_core::sc_out<sc_core::sc_time> lfclkc_o;
48
-    sc_core::sc_out<bool> rst_o;
49
-    aon(sc_core::sc_module_name nm);
50
-    virtual ~aon() override; // need to keep it in source file because of fwd declaration of aon_regs
51
-
52
-protected:
53
-    void start_of_simulation() override;
54
-    void clock_cb();
55
-    void reset_cb();
56
-    void reset_internal_cb();
57
-    sc_core::sc_time clk;
58
-    std::unique_ptr<aon_regs> regs;
59
-};
60
-
61
-} /* namespace sysc */
62
-
63
-#endif /* _GPIO_H_ */

+ 0
- 74
platform/incl/sysc/SiFive/clint.h View File

@@ -1,74 +0,0 @@
1
-/*******************************************************************************
2
- * Copyright (C) 2017, 2018 MINRES Technologies GmbH
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * 1. Redistributions of source code must retain the above copyright notice,
9
- *    this list of conditions and the following disclaimer.
10
- *
11
- * 2. Redistributions in binary form must reproduce the above copyright notice,
12
- *    this list of conditions and the following disclaimer in the documentation
13
- *    and/or other materials provided with the distribution.
14
- *
15
- * 3. Neither the name of the copyright holder nor the names of its contributors
16
- *    may be used to endorse or promote products derived from this software
17
- *    without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- * POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- *******************************************************************************/
32
-
33
-#ifndef _CLINT_H_
34
-#define _CLINT_H_
35
-
36
-#include "scc/tlm_target.h"
37
-
38
-namespace iss {
39
-namespace arch {
40
-template <typename BASE> class riscv_hart_msu_vp;
41
-}
42
-}
43
-
44
-namespace sysc {
45
-
46
-class clint_regs;
47
-namespace SiFive {
48
-class core_complex;
49
-}
50
-
51
-class clint : public sc_core::sc_module, public scc::tlm_target<> {
52
-public:
53
-    SC_HAS_PROCESS(clint);// NOLINT
54
-    sc_core::sc_in<sc_core::sc_time> tlclk_i;
55
-    sc_core::sc_in<sc_core::sc_time> lfclk_i;
56
-    sc_core::sc_in<bool> rst_i;
57
-    sc_core::sc_out<bool> mtime_int_o;
58
-    sc_core::sc_out<bool> msip_int_o;
59
-    clint(sc_core::sc_module_name nm);
60
-    virtual ~clint() override; // NOLINT // need to keep it in source file because of fwd declaration of clint_regs
61
-
62
-protected:
63
-    void clock_cb();
64
-    void reset_cb();
65
-    void update_mtime();
66
-    sc_core::sc_time clk, last_updt;
67
-    unsigned cnt_fraction;
68
-    std::unique_ptr<clint_regs> regs;
69
-    sc_core::sc_event mtime_evt;
70
-};
71
-
72
-} /* namespace sysc */
73
-
74
-#endif /* _CLINT_H_ */

+ 0
- 106
platform/incl/sysc/SiFive/fe310.h View File

@@ -1,106 +0,0 @@
1
-/*******************************************************************************
2
- * Copyright (C) 2017, 2018 MINRES Technologies GmbH
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * 1. Redistributions of source code must retain the above copyright notice,
9
- *    this list of conditions and the following disclaimer.
10
- *
11
- * 2. Redistributions in binary form must reproduce the above copyright notice,
12
- *    this list of conditions and the following disclaimer in the documentation
13
- *    and/or other materials provided with the distribution.
14
- *
15
- * 3. Neither the name of the copyright holder nor the names of its contributors
16
- *    may be used to endorse or promote products derived from this software
17
- *    without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- * POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- *******************************************************************************/
32
-
33
-#ifndef _PLATFORM_H_
34
-#define _PLATFORM_H_
35
-
36
-#include "aon.h"
37
-#include "clint.h"
38
-#include "gpio.h"
39
-#include "plic.h"
40
-#include "prci.h"
41
-#include "pwm.h"
42
-#include "spi.h"
43
-#include "sysc/core_complex.h"
44
-#include "uart.h"
45
-
46
-#include "cci_configuration"
47
-#include "scc/memory.h"
48
-#include "scc/router.h"
49
-#include "scc/utilities.h"
50
-#include "tlm/tlm_signal_sockets.h"
51
-#include <array>
52
-#include <memory>
53
-#include <sysc/kernel/sc_module.h>
54
-
55
-namespace sysc {
56
-
57
-class fe310 : public sc_core::sc_module {
58
-public:
59
-    SC_HAS_PROCESS(fe310);// NOLINT
60
-
61
-    sc_core::sc_vector<tlm::tlm_signal_initiator_socket<sc_dt::sc_logic>> pins_o;
62
-    sc_core::sc_vector<tlm::tlm_signal_target_socket<sc_dt::sc_logic>> pins_i;
63
-
64
-    sc_core::sc_in<bool> erst_n;
65
-
66
-    fe310(sc_core::sc_module_name nm);
67
-
68
-    cci::cci_param<bool> use_rtl;
69
-
70
-private:
71
-    std::unique_ptr<SiFive::core_complex> i_core_complex;
72
-    std::unique_ptr<scc::router<>> i_router;
73
-    std::unique_ptr<uart> i_uart0, i_uart1;
74
-    std::unique_ptr<spi> i_qspi0, i_qspi1, i_qspi2;
75
-    std::unique_ptr<pwm> i_pwm0, i_pwm1, i_pwm2;
76
-    std::unique_ptr<gpio> i_gpio0;
77
-    std::unique_ptr<plic> i_plic;
78
-    std::unique_ptr<aon> i_aon;
79
-    std::unique_ptr<prci> i_prci;
80
-    std::unique_ptr<clint> i_clint;
81
-
82
-    using mem_qspi_t = scc::memory<512_MB, 32>;
83
-    std::unique_ptr<mem_qspi_t> i_mem_qspi;
84
-    using mem_ram_t = scc::memory<128_kB, 32>;
85
-    std::unique_ptr<mem_ram_t> i_mem_ram;
86
-
87
-    sc_core::sc_signal<sc_core::sc_time, sc_core::SC_MANY_WRITERS> s_tlclk;
88
-    sc_core::sc_signal<sc_core::sc_time, sc_core::SC_MANY_WRITERS> s_lfclk;
89
-    
90
-    sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> s_rst, s_mtime_int, s_msie_int;
91
-    
92
-    sc_core::sc_vector<sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS>> s_global_int, s_local_int;
93
-    sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> s_core_int;
94
-    
95
-    sc_core::sc_vector<scc::tlm_signal_bool_opt_in> s_dummy_sck_i;
96
-    sc_core::sc_vector<scc::tlm_signal_bool_opt_out> s_dummy_sck_o;
97
-
98
-protected:
99
-    void gen_reset();
100
-
101
-#include "gen/e300_plat_t.h"
102
-};
103
-
104
-} /* namespace sysc */
105
-
106
-#endif /* _PLATFORM_H_ */

+ 0
- 170
platform/incl/sysc/SiFive/gen/aon_regs.h View File

@@ -1,170 +0,0 @@
1
-/*******************************************************************************
2
- * Copyright (C) 2017, 2018 MINRES Technologies GmbH
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * 1. Redistributions of source code must retain the above copyright notice,
9
- *    this list of conditions and the following disclaimer.
10
- *
11
- * 2. Redistributions in binary form must reproduce the above copyright notice,
12
- *    this list of conditions and the following disclaimer in the documentation
13
- *    and/or other materials provided with the distribution.
14
- *
15
- * 3. Neither the name of the copyright holder nor the names of its contributors
16
- *    may be used to endorse or promote products derived from this software
17
- *    without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- * POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- *******************************************************************************/
32
-
33
-#ifndef _AON_REGS_H_
34
-#define _AON_REGS_H_
35
-
36
-#include <scc/register.h>
37
-#include <scc/tlm_target.h>
38
-#include <scc/utilities.h>
39
-#include <util/bit_field.h>
40
-
41
-namespace sysc {
42
-
43
-class aon_regs : public sc_core::sc_module, public scc::resetable {
44
-public:
45
-    // storage declarations
46
-    uint32_t r_wdogcfg;
47
-
48
-    uint32_t r_wdogcount;
49
-
50
-    uint32_t r_wdogs;
51
-
52
-    uint32_t r_wdogfeed;
53
-
54
-    uint32_t r_wdogkey;
55
-
56
-    uint32_t r_wdogcmp;
57
-
58
-    uint32_t r_rtccfg;
59
-
60
-    uint32_t r_rtclo;
61
-
62
-    uint32_t r_rtchi;
63
-
64
-    uint32_t r_rtcs;
65
-
66
-    uint32_t r_rtccmp;
67
-
68
-    uint32_t r_lfrosccfg;
69
-
70
-    std::array<uint32_t, 32> r_backup;
71
-
72
-    BEGIN_BF_DECL(pmuwakeupi_t, uint32_t);
73
-    BF_FIELD(delay, 0, 4);
74
-    BF_FIELD(vddpaden, 5, 1);
75
-    BF_FIELD(corerst, 7, 1);
76
-    BF_FIELD(hfclkrst, 8, 1);
77
-    END_BF_DECL();
78
-    std::array<pmuwakeupi_t, 8> r_pmuwakeupi;
79
-
80
-    BEGIN_BF_DECL(pmusleepi_t, uint32_t);
81
-    BF_FIELD(delay, 0, 4);
82
-    BF_FIELD(vddpaden, 5, 1);
83
-    BF_FIELD(corerst, 7, 1);
84
-    BF_FIELD(hfclkrst, 8, 1);
85
-    END_BF_DECL();
86
-    std::array<pmusleepi_t, 8> r_pmusleepi;
87
-
88
-    uint32_t r_pmuie;
89
-
90
-    uint32_t r_pmucause;
91
-
92
-    uint32_t r_pmusleep;
93
-
94
-    uint32_t r_pmukey;
95
-
96
-    // register declarations
97
-    scc::sc_register<uint32_t> wdogcfg;
98
-    scc::sc_register<uint32_t> wdogcount;
99
-    scc::sc_register<uint32_t> wdogs;
100
-    scc::sc_register<uint32_t> wdogfeed;
101
-    scc::sc_register<uint32_t> wdogkey;
102
-    scc::sc_register<uint32_t> wdogcmp;
103
-    scc::sc_register<uint32_t> rtccfg;
104
-    scc::sc_register<uint32_t> rtclo;
105
-    scc::sc_register<uint32_t> rtchi;
106
-    scc::sc_register<uint32_t> rtcs;
107
-    scc::sc_register<uint32_t> rtccmp;
108
-    scc::sc_register<uint32_t> lfrosccfg;
109
-    scc::sc_register_indexed<uint32_t, 32> backup;
110
-    scc::sc_register_indexed<pmuwakeupi_t, 8> pmuwakeupi;
111
-    scc::sc_register_indexed<pmusleepi_t, 8> pmusleepi;
112
-    scc::sc_register<uint32_t> pmuie;
113
-    scc::sc_register<uint32_t> pmucause;
114
-    scc::sc_register<uint32_t> pmusleep;
115
-    scc::sc_register<uint32_t> pmukey;
116
-
117
-    aon_regs(sc_core::sc_module_name nm);
118
-
119
-    template <unsigned BUSWIDTH = 32> void registerResources(scc::tlm_target<BUSWIDTH> &target);
120
-};
121
-}
122
-//////////////////////////////////////////////////////////////////////////////
123
-// member functions
124
-//////////////////////////////////////////////////////////////////////////////
125
-
126
-inline sysc::aon_regs::aon_regs(sc_core::sc_module_name nm)
127
-: sc_core::sc_module(nm)
128
-, NAMED(wdogcfg, r_wdogcfg, 0, *this)
129
-, NAMED(wdogcount, r_wdogcount, 0, *this)
130
-, NAMED(wdogs, r_wdogs, 0, *this)
131
-, NAMED(wdogfeed, r_wdogfeed, 0, *this)
132
-, NAMED(wdogkey, r_wdogkey, 0, *this)
133
-, NAMED(wdogcmp, r_wdogcmp, 0, *this)
134
-, NAMED(rtccfg, r_rtccfg, 0, *this)
135
-, NAMED(rtclo, r_rtclo, 0, *this)
136
-, NAMED(rtchi, r_rtchi, 0, *this)
137
-, NAMED(rtcs, r_rtcs, 0, *this)
138
-, NAMED(rtccmp, r_rtccmp, 0, *this)
139
-, NAMED(lfrosccfg, r_lfrosccfg, 0, *this)
140
-, NAMED(backup, r_backup, 0, *this)
141
-, NAMED(pmuwakeupi, r_pmuwakeupi, 0, *this)
142
-, NAMED(pmusleepi, r_pmusleepi, 0, *this)
143
-, NAMED(pmuie, r_pmuie, 0, *this)
144
-, NAMED(pmucause, r_pmucause, 0, *this)
145
-, NAMED(pmusleep, r_pmusleep, 0, *this)
146
-, NAMED(pmukey, r_pmukey, 0, *this) {}
147
-
148
-template <unsigned BUSWIDTH> inline void sysc::aon_regs::registerResources(scc::tlm_target<BUSWIDTH> &target) {
149
-    target.addResource(wdogcfg, 0x0UL);
150
-    target.addResource(wdogcount, 0x8UL);
151
-    target.addResource(wdogs, 0x10UL);
152
-    target.addResource(wdogfeed, 0x18UL);
153
-    target.addResource(wdogkey, 0x1cUL);
154
-    target.addResource(wdogcmp, 0x20UL);
155
-    target.addResource(rtccfg, 0x40UL);
156
-    target.addResource(rtclo, 0x48UL);
157
-    target.addResource(rtchi, 0x4cUL);
158
-    target.addResource(rtcs, 0x50UL);
159
-    target.addResource(rtccmp, 0x60UL);
160
-    target.addResource(lfrosccfg, 0x70UL);
161
-    target.addResource(backup, 0x80UL);
162
-    target.addResource(pmuwakeupi, 0x100UL);
163
-    target.addResource(pmusleepi, 0x120UL);
164
-    target.addResource(pmuie, 0x140UL);
165
-    target.addResource(pmucause, 0x144UL);
166
-    target.addResource(pmusleep, 0x148UL);
167
-    target.addResource(pmukey, 0x14cUL);
168
-}
169
-
170
-#endif // _AON_REGS_H_

+ 0
- 80
platform/incl/sysc/SiFive/gen/clint_regs.h View File

@@ -1,80 +0,0 @@
1
-/*******************************************************************************
2
- * Copyright (C) 2017, 2018 MINRES Technologies GmbH
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- *
8
- * 1. Redistributions of source code must retain the above copyright notice,
9
- *    this list of conditions and the following disclaimer.
10
- *
11
- * 2. Redistributions in binary form must reproduce the above copyright notice,
12
- *    this list of conditions and the following disclaimer in the documentation
13
- *    and/or other materials provided with the distribution.
14
- *
15
- * 3. Neither the name of the copyright holder nor the names of its contributors
16
- *    may be used to endorse or promote products derived from this software
17
- *    without specific prior written permission.
18
- *
19
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
- * POSSIBILITY OF SUCH DAMAGE.
30
- *
31
- *******************************************************************************/
32
-