mirror of
https://github.com/Minres/RISCV-VP.git
synced 2026-01-11 17:14:06 +00:00
@@ -38,7 +38,7 @@ BreakBeforeTernaryOperators: true
|
|||||||
BreakConstructorInitializersBeforeComma: true
|
BreakConstructorInitializersBeforeComma: true
|
||||||
BreakAfterJavaFieldAnnotations: false
|
BreakAfterJavaFieldAnnotations: false
|
||||||
BreakStringLiterals: true
|
BreakStringLiterals: true
|
||||||
ColumnLimit: 120
|
ColumnLimit: 140
|
||||||
CommentPragmas: '^( IWYU pragma:| @suppress)'
|
CommentPragmas: '^( IWYU pragma:| @suppress)'
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||||
ConstructorInitializerIndentWidth: 0
|
ConstructorInitializerIndentWidth: 0
|
||||||
|
|||||||
6
.envrc
6
.envrc
@@ -5,7 +5,11 @@ if [ $distro == "CentOS" ]; then
|
|||||||
. /opt/rh/rh-python38/enable
|
. /opt/rh/rh-python38/enable
|
||||||
elif [ $distro == "Rocky" ]; then
|
elif [ $distro == "Rocky" ]; then
|
||||||
. /opt/rh/gcc-toolset-11/enable
|
. /opt/rh/gcc-toolset-11/enable
|
||||||
|
elif [ $distro == "RockyLinux" ]; then
|
||||||
|
. /opt/rh/gcc-toolset-14/enable
|
||||||
|
fi
|
||||||
|
if has module; then
|
||||||
|
module load ./Modulefile
|
||||||
fi
|
fi
|
||||||
module load ./Modulefile
|
|
||||||
layout python3
|
layout python3
|
||||||
[ -f .envrc.$USER ] && . .envrc.$USER
|
[ -f .envrc.$USER ] && . .envrc.$USER
|
||||||
|
|||||||
46
.github/workflows/cmake-single-platform.yml
vendored
Normal file
46
.github/workflows/cmake-single-platform.yml
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
name: Smoke Test
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ "main", "develop" ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ "main" ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
BUILD_TYPE: Release
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Sources
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Pull submodules
|
||||||
|
working-directory: ${{github.workspace}}
|
||||||
|
run: git submodule update --recursive --init
|
||||||
|
|
||||||
|
- name: Cache Conan
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.conan2
|
||||||
|
key: conan-${{ runner.os }}-unit-cpp${{ matrix.cpp_std }}-${{ hashFiles('conanfile.py') }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y g++ python3-pip cmake ninja-build
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: cmake --preset ${{env.BUILD_TYPE}}
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: cmake --build ${{github.workspace}}/build/${{env.BUILD_TYPE}} --config ${{env.BUILD_TYPE}}
|
||||||
|
|
||||||
|
- name: Smoke Test
|
||||||
|
working-directory: ${{github.workspace}}
|
||||||
|
run: ${{github.workspace}}/build/${{env.BUILD_TYPE}}/src/riscv-vp -f ${{github.workspace}}/fw/hello-world/prebuilt/hello.elf
|
||||||
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -23,3 +23,6 @@ CMakeSettings.json
|
|||||||
/CMakeUserPresets.json
|
/CMakeUserPresets.json
|
||||||
/.envrc.*
|
/.envrc.*
|
||||||
.clangd
|
.clangd
|
||||||
|
/install
|
||||||
|
.gdb_history
|
||||||
|
/dbt-rise-custom
|
||||||
|
|||||||
49
.launch/TGC-VP interp.launch
Normal file
49
.launch/TGC-VP interp.launch
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
|
||||||
|
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE_MODE" value="UseSoftTrace"/>
|
||||||
|
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="1"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="sc_main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="--isa ?"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/${config_name:RISCV-VP}/src/riscv-vp"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RISCV-VP"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/RISCV-VP"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"/>"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.DefaultEvent" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.HideUnresolvedSymbols" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.Location" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Kernel.SourceLineNumbers" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ModuleSymbols" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.MultipleEvents" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime" value="false"/>
|
||||||
|
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Realtime.Priority" value="1"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.Record.Verbose" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowSourceDisassembly" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.ShowStat" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.linuxtools.internal.perf.attr.SourceLineNumbers" value="true"/>
|
||||||
|
<intAttribute key="org.eclipse.linuxtools.internal.perf.attr.StatRunCount" value="1"/>
|
||||||
|
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
|
<stringAttribute key="provider" value="org.eclipse.linuxtools.perf.provider"/>
|
||||||
|
</launchConfiguration>
|
||||||
52
.launch/TGC-VP-FW-Debug dhrystone.launch
Normal file
52
.launch/TGC-VP-FW-Debug dhrystone.launch
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<launchConfiguration type="org.eclipse.cdt.launch.remoteApplicationLaunchType">
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
|
||||||
|
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="riscv64-unknown-elf-gdb"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEV" value="/dev/ttyS0"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEV_SPEED" value="115200"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.HOST" value="localhost"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.PORT" value="10000"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TCP" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_ENABLED" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REMOTE_TIMEOUT_VALUE" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE_MODE" value="UseSoftTrace"/>
|
||||||
|
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.RemoteApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
|
||||||
|
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="0"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdbserver"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="remote"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="main"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/riscvfw-src/benchmarks/dhrystone/dhrystone.elf"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="RISCV-VP"/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="true"/>
|
||||||
|
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.cdt.launch.remote.RemoteCDSFDebuggerTab.DEFAULTS_SET" value="true"/>
|
||||||
|
<booleanAttribute key="org.eclipse.debug.core.ATTR_FORCE_SYSTEM_CONSOLE_ENCODING" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.ATTR_GDBSERVER_COMMAND" value="gdbserver"/>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.ATTR_GDBSERVER_OPTIONS" value=""/>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.ATTR_GDBSERVER_PORT" value="2345"/>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.ATTR_PRERUN_CMDS" value=""/>
|
||||||
|
<booleanAttribute key="org.eclipse.debug.core.ATTR_SKIP_DOWNLOAD_TO_TARGET" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.ATTR_TARGET_PATH" value="/scratch/eyck/workarea/MINRES/RISCV-VP/fw/hello-world/hello"/>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||||
|
<listEntry value="/RISCV-VP"/>
|
||||||
|
</listAttribute>
|
||||||
|
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||||
|
<listEntry value="4"/>
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.debug.core.REMOTE_TCP" value="Local"/>
|
||||||
|
<mapAttribute key="org.eclipse.debug.core.preferred_launchers">
|
||||||
|
<mapEntry key="[debug]" value="org.eclipse.cdt.dsf.gdb.launch.remoteCLaunch"/>
|
||||||
|
</mapAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?><memoryBlockExpressionList context="reserved-for-future-use"/>"/>
|
||||||
|
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
|
||||||
|
</launchConfiguration>
|
||||||
17
.vscode/c_cpp_properties.json
vendored
17
.vscode/c_cpp_properties.json
vendored
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Linux",
|
|
||||||
"includePath": [
|
|
||||||
"${workspaceFolder}/**"
|
|
||||||
],
|
|
||||||
"defines": [],
|
|
||||||
"compilerPath": "/usr/bin/gcc",
|
|
||||||
"cStandard": "gnu17",
|
|
||||||
"cppStandard": "gnu++14",
|
|
||||||
"intelliSenseMode": "linux-gcc-x64",
|
|
||||||
"configurationProvider": "ms-vscode.cmake-tools"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"version": 4
|
|
||||||
}
|
|
||||||
10
.vscode/extensions.json
vendored
Normal file
10
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"recommendations": [
|
||||||
|
"ms-vscode.cpptools-extension-pack",
|
||||||
|
"llvm-vs-code-extensions.vscode-clangd",
|
||||||
|
"eclipse-cdt.cdt-gdb-vscode",
|
||||||
|
"eclipse-cdt.memory-inspector",
|
||||||
|
"eclipse-cdt.peripheral-inspector",
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
188
.vscode/launch.json
vendored
188
.vscode/launch.json
vendored
@@ -1,22 +1,100 @@
|
|||||||
{
|
{
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"type": "gdb",
|
"type": "gdb",
|
||||||
"request": "attach",
|
"request": "launch",
|
||||||
"name": "Attach-to-gdbserver",
|
"name": "riscv-sim hello.elf",
|
||||||
"executable": "./fw/hello-world/hello",
|
"program": "${workspaceFolder}/build/Debug/dbt-rise-riscv/riscv-sim",
|
||||||
"target": ":10000",
|
"arguments": "-f dbt-rise-riscv/contrib/fw/hello-world/hello.elf",
|
||||||
"remote": true,
|
"cwd": "${workspaceFolder}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdbtarget",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Debug hello world 32bit",
|
||||||
|
"program": "fw/hello-world/hello.elf",
|
||||||
|
"imageAndSymbols": {
|
||||||
|
"symbolFileName": "fw/hello-world/hello.elf"
|
||||||
|
},
|
||||||
|
"target": {
|
||||||
|
"server": "${workspaceFolder}/build/RelWithDebInfo/src/riscv-vp",
|
||||||
|
"serverParameters": [
|
||||||
|
"--isa",
|
||||||
|
"rv32gc_msu",
|
||||||
|
"-v",
|
||||||
|
"INFO",
|
||||||
|
"-f",
|
||||||
|
"fw/hello-world/hello.elf",
|
||||||
|
"-g",
|
||||||
|
"10000"
|
||||||
|
],
|
||||||
|
"watchServerProcess": true,
|
||||||
|
"port": "10000"
|
||||||
|
},
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"valuesFormatting": "prettyPrinters",
|
"gdb": "riscv64-unknown-elf-gdb",
|
||||||
"gdbpath": "/opt/riscv/bin/riscv32-unknown-elf-gdb",
|
"openGdbConsole": false,
|
||||||
"debugger_args": [],
|
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"hidden": true,
|
"hidden": false,
|
||||||
|
"group": "FW Debug",
|
||||||
|
"order": 2
|
||||||
|
},
|
||||||
|
"initCommands": [
|
||||||
|
"b main"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdbtarget",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "Debug hello world 32bit",
|
||||||
|
"program": "fw/hello-world/hello.elf",
|
||||||
|
"imageAndSymbols": {
|
||||||
|
"symbolFileName": "fw/hello-world/hello.elf"
|
||||||
|
},
|
||||||
|
"target": {
|
||||||
|
"server": "${workspaceFolder}/build/RelWithDebInfo/src/riscv-vp",
|
||||||
|
"serverParameters": [
|
||||||
|
"--isa",
|
||||||
|
"rv32gc_msu",
|
||||||
|
"-v",
|
||||||
|
"INFO",
|
||||||
|
"-f",
|
||||||
|
"fw/hello-world/hello.elf",
|
||||||
|
"-g",
|
||||||
|
"10000"
|
||||||
|
],
|
||||||
|
"watchServerProcess": true,
|
||||||
|
"port": "10000"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"gdb": "riscv64-unknown-elf-gdb",
|
||||||
|
"openGdbConsole": false,
|
||||||
|
"presentation": {
|
||||||
|
"hidden": false,
|
||||||
|
"group": "FW Debug",
|
||||||
|
"order": 2
|
||||||
|
},
|
||||||
|
"initCommands": [
|
||||||
|
"b main"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdbtarget",
|
||||||
|
"request": "attach",
|
||||||
|
"name": "Attach GDB to VP",
|
||||||
|
"program": "./fw/hello-world/hello.elf",
|
||||||
|
"imageAndSymbols": {
|
||||||
|
"symbolFileName": "./fw/hello-world/hello.elf"
|
||||||
|
},
|
||||||
|
"target": {
|
||||||
|
"port": "10000"
|
||||||
|
},
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"gdb": "riscv64-unknown-elf-gdb",
|
||||||
|
"openGdbConsole": false,
|
||||||
|
"presentation": {
|
||||||
|
"hidden": false,
|
||||||
"group": "FW Debug",
|
"group": "FW Debug",
|
||||||
"order": 2
|
"order": 2
|
||||||
}
|
}
|
||||||
@@ -24,30 +102,88 @@
|
|||||||
{
|
{
|
||||||
"type": "gdb",
|
"type": "gdb",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Launch-VP-with-gdbserver",
|
"name": "32bit VP with gdbserver",
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"valuesFormatting": "parseText",
|
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||||
"target": "./build/src/tgc-vp",
|
"arguments": "--isa 'rv32gc_msu' -v INFO --disass -f fw/hello-world/hello.elf -g 10000",
|
||||||
"arguments": "-f fw/hello-world/hello -g 10000",
|
"openGdbConsole": true
|
||||||
"presentation": {
|
|
||||||
"hidden": true,
|
|
||||||
"group": "FW Debug",
|
|
||||||
"order": 1
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "gdb",
|
"type": "gdb",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "VP-Debug",
|
"name": "32bit VP",
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"program": "${workspaceFolder}/out/build/Debug/src/riscv-vp",
|
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||||
"arguments": "--isa ? -f fw/hello-world/hello"
|
"arguments": "--isa 'rv32gc_msu' -v INFO -f fw/hello-world/hello.elf",
|
||||||
|
"openGdbConsole": true,
|
||||||
|
"initCommands": [
|
||||||
|
"set breakpoint pending on",
|
||||||
|
"set breakpoint auto-hw on",
|
||||||
|
"set breakpoint always-inserted on",
|
||||||
|
"set output-radix 16"
|
||||||
|
],
|
||||||
|
"verbose": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "gdb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "64bit VP with gdbserver",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||||
|
"arguments": "--isa 'rv64gc_msu' -v INFO --disass -f fw/hello-world/hello.elf -g 10000",
|
||||||
|
"openGdbConsole": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "TGC5 VP",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||||
|
"arguments": "-v DEBUG -t 3 --isa 'tgc5c_mu' -f fw/hello-world/hello.elf",
|
||||||
|
"openGdbConsole": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "TGC5 VP (asmjit)",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||||
|
"arguments": "-v DEBUG --isa 'tgc5c_mu' --backend asmjit -f fw/hello-world/hello.elf",
|
||||||
|
"openGdbConsole": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "RISCV-VP report ISA",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"program": "${workspaceFolder}/build/Debug/src/riscv-vp",
|
||||||
|
"arguments": "--isa ?",
|
||||||
|
"openGdbConsole": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "gdb",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "RISCV-SIM report ISA",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"program": "${workspaceFolder}/build/Debug/dbt-rise-riscv/riscv-sim",
|
||||||
|
"arguments": "--isa ?",
|
||||||
|
"openGdbConsole": true
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"compounds": [
|
"compounds": [
|
||||||
{
|
{
|
||||||
"name": "FW-Debug",
|
"name": "FW-Debug 32bit",
|
||||||
"configurations": ["Launch-VP-with-gdbserver", "Attach-to-gdbserver"]
|
"configurations": [
|
||||||
|
"32bit VP with gdbserver",
|
||||||
|
"Attach GDB to VP"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "FW-Debug 64bit",
|
||||||
|
"configurations": [
|
||||||
|
"64bit VP with gdbserver",
|
||||||
|
"Attach GDB to VP"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
23
.vscode/settings.json
vendored
23
.vscode/settings.json
vendored
@@ -5,13 +5,24 @@
|
|||||||
"debug.allowBreakpointsEverywhere": true,
|
"debug.allowBreakpointsEverywhere": true,
|
||||||
"editor.rulers": [
|
"editor.rulers": [
|
||||||
{
|
{
|
||||||
"column": 120,
|
"column": 140,
|
||||||
"comment": "clang-format"
|
"comment": "clang-format"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"cmake.configureArgs": [
|
"editor.formatOnSave": true,
|
||||||
"--preset",
|
"clangd.arguments": [
|
||||||
"Debug",
|
"--pretty",
|
||||||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
|
"--background-index",
|
||||||
]
|
"--compile-commands-dir=${workspaceFolder}/build"
|
||||||
|
],
|
||||||
|
"cmake.copyCompileCommands": "${workspaceFolder}/build/compile_commands.json",
|
||||||
|
"cmake.options.statusBarVisibility": "hidden",
|
||||||
|
"cmake.options.advanced": {
|
||||||
|
"configure": {
|
||||||
|
"projectStatusVisibility": "visible"
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"statusBarVisibility": "visible"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
96
.vscode/tasks.json
vendored
96
.vscode/tasks.json
vendored
@@ -2,9 +2,65 @@
|
|||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": [
|
||||||
{
|
{
|
||||||
"label": "CMake-and-make",
|
"label": "Build 32bit FW",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "source .venv/bin/activate && cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON && cmake --build build",
|
"command": "make -C fw/hello-world clean all",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"presentation": {
|
||||||
|
"echo": true,
|
||||||
|
"reveal": "always",
|
||||||
|
"focus": true,
|
||||||
|
"panel": "dedicated",
|
||||||
|
"showReuseMessage": false,
|
||||||
|
"clear": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build 64bit FW",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "make -C fw/hello-world RISCV_ARCH=rv64imc RISCV_ABI=lp64 clean all",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"presentation": {
|
||||||
|
"echo": true,
|
||||||
|
"reveal": "always",
|
||||||
|
"focus": true,
|
||||||
|
"panel": "dedicated",
|
||||||
|
"showReuseMessage": false,
|
||||||
|
"clear": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Run 32bit VP",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "build/Debug/src/riscv-vp --isa 'rv32gc|msu_vp' -f fw/hello-world/hello.elf",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"presentation": {
|
||||||
|
"echo": true,
|
||||||
|
"reveal": "always",
|
||||||
|
"focus": true,
|
||||||
|
"panel": "dedicated",
|
||||||
|
"showReuseMessage": false,
|
||||||
|
"clear": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Run 64bit VP",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "build/Debug/src/riscv-vp --isa 'rv64gc|msu_vp' -f fw/hello-world/hello.elf",
|
||||||
|
"problemMatcher": [],
|
||||||
|
"presentation": {
|
||||||
|
"echo": true,
|
||||||
|
"reveal": "always",
|
||||||
|
"focus": true,
|
||||||
|
"panel": "dedicated",
|
||||||
|
"showReuseMessage": false,
|
||||||
|
"clear": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Run 32bit VP with GDB-Server",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "build/Debug/src/riscv-vp --isa 'rv32gc|msu_vp' -f fw/hello-world/hello.elf -g 10000",
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
@@ -14,43 +70,11 @@
|
|||||||
"showReuseMessage": false,
|
"showReuseMessage": false,
|
||||||
"clear": true
|
"clear": true
|
||||||
},
|
},
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Build-FW",
|
"label": "Run 64bit VP with GDB-Server",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "cd fw/hello-world/ && make",
|
"command": "build/Debug/src/riscv-vp --isa 'rv64gc|msu_vp' -v TRACEALL -f fw/hello-world/hello.elf -g 10000 |& tee run.log",
|
||||||
"problemMatcher": [],
|
|
||||||
"presentation": {
|
|
||||||
"echo": true,
|
|
||||||
"reveal": "always",
|
|
||||||
"focus": true,
|
|
||||||
"panel": "dedicated",
|
|
||||||
"showReuseMessage": false,
|
|
||||||
"clear": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Execute-VP",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "build/src/tgc-vp -f fw/hello-world/hello -p pctrace=contrib/TGC_C_cycles.json",
|
|
||||||
"problemMatcher": [],
|
|
||||||
"presentation": {
|
|
||||||
"echo": true,
|
|
||||||
"reveal": "always",
|
|
||||||
"focus": true,
|
|
||||||
"panel": "dedicated",
|
|
||||||
"showReuseMessage": false,
|
|
||||||
"clear": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "VP-GDB-Server",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "build/src/tgc-vp -f fw/hello-world/hello -g 10000",
|
|
||||||
"problemMatcher": [],
|
"problemMatcher": [],
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ project(riscv-vp LANGUAGES C CXX VERSION 1.0.0)
|
|||||||
option(LIBS_ONLY "Just build the shared libraries needed to build the VP" OFF)
|
option(LIBS_ONLY "Just build the shared libraries needed to build the VP" OFF)
|
||||||
option(ENABLE_COVERAGE "Enable code coverage" OFF)
|
option(ENABLE_COVERAGE "Enable code coverage" OFF)
|
||||||
option(ENABLE_SANITIZER "Enable address sanitizer" OFF)
|
option(ENABLE_SANITIZER "Enable address sanitizer" OFF)
|
||||||
|
option(ENABLE_CLANGFORMAT "Enable code formatting using clang-format." OFF)
|
||||||
option(ENABLE_CLANGTIDY "Enable static analysis with clang-tidy." OFF)
|
option(ENABLE_CLANGTIDY "Enable static analysis with clang-tidy." OFF)
|
||||||
option(ENABLE_FW_BUILD "Enable build of firmware of MIRES Firmware repo." OFF)
|
option(ENABLE_FW_BUILD "Enable build of firmware of MIRES Firmware repo." OFF)
|
||||||
option(ENABLE_GPROF "Enable gprof profiling" OFF)
|
option(ENABLE_GPROF "Enable gprof profiling" OFF)
|
||||||
@@ -20,8 +21,8 @@ include(GNUInstallDirs)
|
|||||||
|
|
||||||
# add address sanitizer
|
# add address sanitizer
|
||||||
if(ENABLE_SANITIZER)
|
if(ENABLE_SANITIZER)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address,thread")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address,thread")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
|
||||||
endif()
|
endif()
|
||||||
@@ -77,9 +78,12 @@ if(NOT LIBS_ONLY)
|
|||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(ClangFormat)
|
if(ENABLE_CLANGFORMAT)
|
||||||
|
set(CLANG_FORMAT_EXCLUDE_PATTERNS "/scc/" "/build/" "/.direnv/")
|
||||||
|
find_package(ClangFormat)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(FW_BUILD)
|
if(ENABLE_FW_BUILD)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
|
set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/..)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
|
|||||||
@@ -15,11 +15,14 @@
|
|||||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
|
"CMAKE_POLICY_DEFAULT_CMP0091": "NEW",
|
||||||
"CMAKE_CXX_STANDARD": "20",
|
"CMAKE_CXX_STANDARD": "17",
|
||||||
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
|
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}",
|
||||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
|
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
|
||||||
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "scc/cmake/conan_provider.cmake",
|
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "scc/cmake/conan_provider.cmake",
|
||||||
"WITH_TCC": "OFF"
|
"CONAN_HOST_PROFILE": "auto-cmake",
|
||||||
|
"CONAN_BUILD_PROFILE": "conan_host_profile",
|
||||||
|
"CMAKE_EXECUTE_PROCESS_COMMAND_ECHO": "STDOUT",
|
||||||
|
"WITH_ASMJIT": "OFF"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
13
Linux.code-workspace
Normal file
13
Linux.code-workspace
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "build/Linux4TGC/buildroot"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "build/Linux4TGC/opensbi"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "build/Linux4TGC/linux"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -12,4 +12,4 @@ if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env
|
|||||||
puts stderr "Don't forget to execute 'scl enable devtoolset-7 llvm-toolset-7 bash'"
|
puts stderr "Don't forget to execute 'scl enable devtoolset-7 llvm-toolset-7 bash'"
|
||||||
}
|
}
|
||||||
|
|
||||||
module load tools/gcc-riscv64-unknown-elf/13 tools/cmake/3.28 tools/utilities
|
module load tools/gcc-riscv64-unknown-elf/13 tools/cmake/3.28 tools/utilities tools/vscode
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class Pkg(ConanFile):
|
|||||||
)
|
)
|
||||||
default_options = {
|
default_options = {
|
||||||
"llvm-core/*:targets": "X86",
|
"llvm-core/*:targets": "X86",
|
||||||
|
"llvm-core/*:components": "Native",
|
||||||
"boost/*:fPIC": "True",
|
"boost/*:fPIC": "True",
|
||||||
"boost/*:header_only": "False",
|
"boost/*:header_only": "False",
|
||||||
"boost/*:without_contract": "True",
|
"boost/*:without_contract": "True",
|
||||||
@@ -33,7 +34,7 @@ class Pkg(ConanFile):
|
|||||||
"boost/*:without_timer": "True",
|
"boost/*:without_timer": "True",
|
||||||
"boost/*:without_type_erasure": "True",
|
"boost/*:without_type_erasure": "True",
|
||||||
"boost/*:without_wave": "True",
|
"boost/*:without_wave": "True",
|
||||||
"systemc/*:shared": "True"
|
"systemc/*:shared": "False",
|
||||||
}
|
}
|
||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
@@ -46,7 +47,7 @@ class Pkg(ConanFile):
|
|||||||
self.requires("lz4/1.9.3")
|
self.requires("lz4/1.9.3")
|
||||||
self.requires("yaml-cpp/0.8.0")
|
self.requires("yaml-cpp/0.8.0")
|
||||||
self.requires("jsoncpp/1.9.5")
|
self.requires("jsoncpp/1.9.5")
|
||||||
self.requires("zlib/1.2.12")
|
self.requires("zlib/1.3.1")
|
||||||
self.requires("asmjit/cci.20240531")
|
self.requires("asmjit/cci.20240531")
|
||||||
if "WITH_LLVM" in os.environ:
|
if "WITH_LLVM" in os.environ:
|
||||||
self.requires("llvm-core/19.1.7")
|
self.requires("llvm-core/19.1.7")
|
||||||
|
|||||||
Submodule dbt-rise-core updated: 2627112886...97c815024f
Submodule dbt-rise-riscv updated: a13689b382...e187284501
2
fw/.gitignore
vendored
2
fw/.gitignore
vendored
@@ -1 +1 @@
|
|||||||
/fir
|
/bsp
|
||||||
|
|||||||
6
fw/hello-world/.gitignore
vendored
6
fw/hello-world/.gitignore
vendored
@@ -1,3 +1,3 @@
|
|||||||
/hello
|
/*.elf
|
||||||
/hello.dis
|
/*.dis
|
||||||
/firmware.map
|
/*.map
|
||||||
|
|||||||
@@ -2,16 +2,18 @@
|
|||||||
TARGET = hello
|
TARGET = hello
|
||||||
C_SRCS = $(wildcard *.c)
|
C_SRCS = $(wildcard *.c)
|
||||||
HEADERS = $(wildcard *.h)
|
HEADERS = $(wildcard *.h)
|
||||||
CFLAGS += -O0 -g
|
CFLAGS += -Og -g
|
||||||
|
|
||||||
BOARD=tgc_vp
|
BOARD=riscv_vp
|
||||||
LINK_TARGET=link
|
LINK_TARGET=rom
|
||||||
RISCV_ARCH:=rv32imc
|
RISCV_ARCH:=rv32imc
|
||||||
RISCV_ABI:=ilp32
|
RISCV_ABI:=ilp32
|
||||||
LDFLAGS := -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI)
|
#RISCV_ARCH:=rv64imc
|
||||||
|
#RISCV_ABI:=lp64
|
||||||
|
LDFLAGS := -g -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI)
|
||||||
|
|
||||||
compiler := $(shell which riscv32-unknown-elf-gcc)
|
compiler := $(shell which riscv64-unknown-elf-gcc)
|
||||||
TOOL_DIR=$(dir $(compiler))
|
TOOL_DIR=$(dir $(compiler))
|
||||||
|
|
||||||
BSP_BASE = ../bsp
|
BSP_BASE ?= ../bsp
|
||||||
include $(BSP_BASE)/env/common-gcc.mk
|
include $(BSP_BASE)/env/common-gcc.mk
|
||||||
|
|||||||
Binary file not shown.
@@ -33,17 +33,18 @@ pysysc.load_systemc()
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
scc.load_lib(project_dir)
|
scc.load_lib(project_dir)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.debug("Loading TGC-VP Peripherals libs")
|
logging.debug("Loading RISCV-VP Peripherals libs")
|
||||||
pysysc.add_include_path(os.path.join(project_dir, 'vpvper'))
|
pysysc.add_include_path(os.path.join(project_dir, 'vpvper'))
|
||||||
pysysc.add_library('sifive.h', 'libvpvper_sifive.so', project_dir)
|
pysysc.add_library('sifive.h', 'libvpvper_sifive.so', project_dir)
|
||||||
|
pysysc.add_library('sifive.h', 'libvpvper_minres.so', project_dir)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.debug("Loading TGC-ISS")
|
logging.debug("Loading TGC-ISS")
|
||||||
pysysc.add_include_path(os.path.join(project_dir, 'tgc-iss/dbt-rise-tgc/incl/sysc'))
|
pysysc.add_include_path(os.path.join(project_dir, 'iss/dbt-rise-riscv/incl/sysc'))
|
||||||
pysysc.add_library('core_complex.h', 'libdbt-rise-tgc_sc.so', project_dir)
|
pysysc.add_library('core_complex.h', 'libdbt-rise-riscv.so', project_dir)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Include section
|
# Include section
|
||||||
###############################################################################
|
###############################################################################
|
||||||
cppyy.include(os.path.join(project_dir, 'src/tgfs_vp/rst_gen.h'))
|
cppyy.include(os.path.join(project_dir, 'src/vp/rst_gen.h'))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# configure
|
# configure
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|||||||
2
scc
2
scc
Submodule scc updated: 3179717f71...4db09b165d
@@ -28,6 +28,7 @@ CLIParser::CLIParser(int argc, char* argv[])
|
|||||||
// --help option
|
// --help option
|
||||||
if(vm_.count("help")) {
|
if(vm_.count("help")) {
|
||||||
std::cout << "DBT-RISE-TGC based virtual platform of TGC cores" << std::endl << desc << std::endl;
|
std::cout << "DBT-RISE-TGC based virtual platform of TGC cores" << std::endl << desc << std::endl;
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
po::notify(vm_); // throws on error, so do after help in case there are any problems
|
po::notify(vm_); // throws on error, so do after help in case there are any problems
|
||||||
valid = true;
|
valid = true;
|
||||||
@@ -40,15 +41,10 @@ CLIParser::CLIParser(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
auto log_level = vm_["verbose"].as<scc::log>();
|
auto log_level = vm_["verbose"].as<scc::log>();
|
||||||
auto log_level_num = static_cast<unsigned>(log_level);
|
auto log_level_num = static_cast<unsigned>(log_level);
|
||||||
LOGGER(DEFAULT)::reporting_level() = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num);
|
auto level = logging::as_log_level(log_level_num > 6 ? 6 : log_level_num);
|
||||||
;
|
LOGGER(DEFAULT)::set_reporting_level(level);
|
||||||
LOGGER(DEFAULT)::print_time() = false;
|
LOGGER(connection)::set_reporting_level(level);
|
||||||
LOG_OUTPUT(DEFAULT)::ostream() = &std::cout;
|
LOGGER(dbt_rise_iss)::set_reporting_level(level);
|
||||||
LOGGER(connection)::reporting_level() =
|
|
||||||
logging::as_log_level(log_level_num > 4 ? log_level_num - 1 : log_level_num);
|
|
||||||
;
|
|
||||||
LOGGER(connection)::print_time() = false;
|
|
||||||
LOG_OUTPUT(connection)::ostream() = &std::cout;
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// configure logging
|
// configure logging
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -61,8 +57,8 @@ CLIParser::CLIParser(int argc, char* argv[])
|
|||||||
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
scc::stream_redirection cerr_redir(std::cerr, scc::log::ERROR);
|
||||||
sc_core::sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING);
|
sc_core::sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING);
|
||||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, sc_core::SC_DO_NOTHING);
|
sc_core::sc_report_handler::set_actions(sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, sc_core::SC_DO_NOTHING);
|
||||||
sc_core::sc_report_handler::set_actions(sc_core::SC_ERROR, sc_core::SC_LOG | sc_core::SC_CACHE_REPORT |
|
sc_core::sc_report_handler::set_actions(sc_core::SC_ERROR,
|
||||||
sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
sc_core::SC_LOG | sc_core::SC_CACHE_REPORT | sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLIParser::build() {
|
void CLIParser::build() {
|
||||||
@@ -86,13 +82,13 @@ void CLIParser::build() {
|
|||||||
"enable gdb server and specify port to use")
|
"enable gdb server and specify port to use")
|
||||||
("backend", po::value<std::string>()->default_value("interp"),
|
("backend", po::value<std::string>()->default_value("interp"),
|
||||||
"the ISS backend to use, options are: interp, tcc")
|
"the ISS backend to use, options are: interp, tcc")
|
||||||
("isa", po::value<std::string>()->default_value("rv32imac"),
|
("isa", po::value<std::string>()->default_value("rv32imac_m"),
|
||||||
"core or isa name to use for simulation, use '?' to get list")
|
"core or isa name to use for simulation, use '?' to get list")
|
||||||
("dump-ir",
|
("dump-ir",
|
||||||
"dump the intermediate representation")
|
"dump the intermediate representation")
|
||||||
("dump-structure", po::value<std::string>(),
|
("dump-structure", po::value<std::string>(),
|
||||||
"dump model structure to ELK file")
|
"dump model structure to ELK file")
|
||||||
("quantum", po::value<unsigned>(),
|
("quantum", po::value<unsigned>()->default_value(100),
|
||||||
"SystemC quantum time in ns")
|
"SystemC quantum time in ns")
|
||||||
("reset,r", po::value<std::string>(),
|
("reset,r", po::value<std::string>(),
|
||||||
"reset address")
|
"reset address")
|
||||||
@@ -104,9 +100,11 @@ void CLIParser::build() {
|
|||||||
"set th ename of the trace file")
|
"set th ename of the trace file")
|
||||||
("max_time,m", po::value<std::string>(),
|
("max_time,m", po::value<std::string>(),
|
||||||
"maximum time to run")
|
"maximum time to run")
|
||||||
|
("parameter,p", po::value<std::vector<std::string>>(),
|
||||||
|
"parameter to set, value has the form of <parm name>=<parm value>")
|
||||||
("config-file,c", po::value<std::string>()->default_value(""),
|
("config-file,c", po::value<std::string>()->default_value(""),
|
||||||
"read configuration from file")
|
"read configuration from file")
|
||||||
("plugin,p", po::value<std::vector<std::string>>(),
|
("plugin", po::value<std::vector<std::string>>(),
|
||||||
"plugin(s) to activate")
|
"plugin(s) to activate")
|
||||||
("dump-config,dc", po::value<std::string>()->default_value(""),
|
("dump-config,dc", po::value<std::string>()->default_value(""),
|
||||||
"dump configuration to file file");
|
"dump configuration to file file");
|
||||||
|
|||||||
9
src/mcount.c
Normal file
9
src/mcount.c
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
/* The canonical name for the function is `_mcount' in both C and asm,
|
||||||
|
but some old asm code might assume it's `mcount'. */
|
||||||
|
void _mcount (void);
|
||||||
|
weak_alias (_mcount, mcount);
|
||||||
|
|
||||||
|
void _mcount (void)
|
||||||
|
{
|
||||||
|
mcount_internal ((u_long) __builtin_return_address (1), (u_long) __builtin_return_address(0));
|
||||||
|
}
|
||||||
@@ -20,9 +20,10 @@
|
|||||||
|
|
||||||
#include "vp/tb.h"
|
#include "vp/tb.h"
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
#include <csetjmp>
|
||||||
|
#include <csignal>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
|
||||||
#ifdef ERROR
|
#ifdef ERROR
|
||||||
#undef ERROR
|
#undef ERROR
|
||||||
#endif
|
#endif
|
||||||
@@ -31,14 +32,20 @@ const std::string core_path{"tb.top.core_complex"};
|
|||||||
|
|
||||||
using namespace sysc;
|
using namespace sysc;
|
||||||
using namespace sc_core;
|
using namespace sc_core;
|
||||||
namespace po = boost::program_options;
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const size_t ERRORR_IN_COMMAND_LINE = 1;
|
const size_t ERRORR_IN_COMMAND_LINE = 1;
|
||||||
const size_t SUCCESS = 0;
|
const size_t SUCCESS = 0;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
jmp_buf abrt;
|
||||||
|
void ABRThandler(int sig) { longjmp(abrt, sig); }
|
||||||
|
|
||||||
int sc_main(int argc, char* argv[]) {
|
int sc_main(int argc, char* argv[]) {
|
||||||
|
signal(SIGINT, ABRThandler);
|
||||||
|
signal(SIGABRT, ABRThandler);
|
||||||
|
signal(SIGSEGV, ABRThandler);
|
||||||
|
signal(SIGTERM, ABRThandler);
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// SystemC >=2.2 got picky about multiple drivers so disable check
|
// SystemC >=2.2 got picky about multiple drivers so disable check
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -66,33 +73,37 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
scc::configurer cfg(parser.get<std::string>("config-file"));
|
scc::configurer cfg(parser.get<std::string>("config-file"));
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
// process CLI paramter settings
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
if(parser.is_set("parameter"))
|
||||||
|
for(auto& p : parser.get<std::vector<std::string>>("parameter")) {
|
||||||
|
auto token = util::split(p, '=');
|
||||||
|
if(token.size() == 2)
|
||||||
|
cfg.set_value_from_str(token[0], token[1]);
|
||||||
|
else
|
||||||
|
SCCERR() << "Invalid parameter specification '" << p << "', should be '<param name>=<param_value>'";
|
||||||
|
}
|
||||||
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// set up tracing & transaction recording
|
// set up tracing & transaction recording
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::unique_ptr<scc::configurable_tracer> tracer;
|
std::unique_ptr<scc::configurable_tracer> tracer;
|
||||||
if(auto trace_level = parser.get<unsigned>("trace-level")) {
|
if(auto trace_level = parser.get<unsigned>("trace-level")) {
|
||||||
auto file_name = parser.get<std::string>("trace-file");
|
auto file_name = parser.get<std::string>("trace-file");
|
||||||
auto enable_sig_trace = (trace_level & 0x1) != 0; // bit0 enables sig trace
|
|
||||||
auto tx_trace_type =
|
|
||||||
static_cast<scc::tracer::file_type>(trace_level >> 1); // bit3-bit1 define the kind of transaction trace
|
|
||||||
auto trace_default_on = parser.is_set("trace-default-on");
|
auto trace_default_on = parser.is_set("trace-default-on");
|
||||||
if(parser.is_set("trace-default-off"))
|
auto enable_tx_trace = static_cast<bool>(trace_level & 0x2);
|
||||||
cfg.set_value("scc_tracer.default_trace_enable", false);
|
cfg.set_value("scc_tracer.default_trace_enable", !parser.is_set("trace-default-off"));
|
||||||
cfg.set_value("scc_tracer.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
|
cfg.set_value("scc_tracer.tx_trace_type", static_cast<unsigned>(scc::tracer::file_type::FTR));
|
||||||
cfg.set_value("scc_tracer.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::FST));
|
cfg.set_value("scc_tracer.sig_trace_type", static_cast<unsigned>(scc::tracer::file_type::FST));
|
||||||
tracer = scc::make_unique<scc::configurable_tracer>(file_name, tx_trace_type, enable_sig_trace);
|
tracer = scc::make_unique<scc::configurable_tracer>(file_name, enable_tx_trace, static_cast<bool>(trace_level & 0x1));
|
||||||
|
if(enable_tx_trace)
|
||||||
|
cfg.set_value(core_path + ".enable_instr_trace", true);
|
||||||
}
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// instantiate top level
|
// instantiate top level
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
auto i_system = scc::make_unique<vp::tb>("tb");
|
auto i_system = scc::make_unique<vp::tb>("tb");
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// add non-implemented 'enableTracing' properties
|
// dump configuration if requested and/or structure
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
if(tracer)
|
|
||||||
tracer->add_control();
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// dump configuration if requested
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
if(parser.get<std::string>("dump-config").size() > 0) {
|
if(parser.get<std::string>("dump-config").size() > 0) {
|
||||||
std::ofstream of{parser.get<std::string>("dump-config")};
|
std::ofstream of{parser.get<std::string>("dump-config")};
|
||||||
@@ -102,8 +113,7 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
cfg.configure();
|
cfg.configure();
|
||||||
std::unique_ptr<scc::hierarchy_dumper> dumper;
|
std::unique_ptr<scc::hierarchy_dumper> dumper;
|
||||||
if(parser.is_set("dump-structure"))
|
if(parser.is_set("dump-structure"))
|
||||||
dumper.reset(
|
dumper.reset(new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
||||||
new scc::hierarchy_dumper(parser.get<std::string>("dump-structure"), scc::hierarchy_dumper::D3JSON));
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// overwrite config with command line settings
|
// overwrite config with command line settings
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
@@ -121,13 +131,11 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
tlm::tlm_global_quantum::instance().set(sc_core::sc_time(parser.get<unsigned>("quantum"), sc_core::SC_NS));
|
tlm::tlm_global_quantum::instance().set(sc_core::sc_time(parser.get<unsigned>("quantum"), sc_core::SC_NS));
|
||||||
if(parser.is_set("reset")) {
|
if(parser.is_set("reset")) {
|
||||||
auto str = parser.get<std::string>("reset");
|
auto str = parser.get<std::string>("reset");
|
||||||
uint64_t start_address =
|
uint64_t start_address = str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
|
||||||
str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
|
|
||||||
cfg.set_value(core_path + ".reset_address", start_address);
|
cfg.set_value(core_path + ".reset_address", start_address);
|
||||||
}
|
}
|
||||||
if(parser.is_set("disass")) {
|
if(parser.is_set("disass")) {
|
||||||
cfg.set_value(core_path + ".enable_disass", true);
|
cfg.set_value(core_path + ".enable_disass", true);
|
||||||
LOGGER(disass)::reporting_level() = logging::INFO;
|
|
||||||
auto file_name = parser.get<std::string>("disass");
|
auto file_name = parser.get<std::string>("disass");
|
||||||
if(file_name.length() > 0) {
|
if(file_name.length() > 0) {
|
||||||
LOG_OUTPUT(disass)::stream() = fopen(file_name.c_str(), "w");
|
LOG_OUTPUT(disass)::stream() = fopen(file_name.c_str(), "w");
|
||||||
@@ -138,15 +146,19 @@ int sc_main(int argc, char* argv[]) {
|
|||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// run simulation
|
// run simulation
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
try {
|
if(auto res = setjmp(abrt)) {
|
||||||
if(parser.is_set("max_time")) {
|
SCCERR() << "Simulation aborted with signal " << res << "!";
|
||||||
sc_core::sc_start(scc::parse_from_string(parser.get<std::string>("max_time")));
|
} else {
|
||||||
} else
|
try {
|
||||||
sc_core::sc_start();
|
if(parser.is_set("max_time")) {
|
||||||
if(!sc_core::sc_end_of_simulation_invoked())
|
sc_core::sc_start(scc::parse_from_string(parser.get<std::string>("max_time")));
|
||||||
sc_core::sc_stop();
|
} else
|
||||||
} catch(sc_core::sc_report& rep) {
|
sc_core::sc_start();
|
||||||
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
if(sc_core::sc_start_of_simulation_invoked() && !sc_core::sc_end_of_simulation_invoked())
|
||||||
|
sc_core::sc_stop();
|
||||||
|
} catch(sc_core::sc_report& rep) {
|
||||||
|
sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
|
||||||
#include <minres/timer.h>
|
#include <minres/timer.h>
|
||||||
#include <minres/uart.h>
|
#include <minres/uart.h>
|
||||||
#include <scc/utilities.h>
|
#include <scc/utilities.h>
|
||||||
@@ -17,18 +16,18 @@ using namespace vpvper::minres;
|
|||||||
|
|
||||||
system::system(sc_core::sc_module_name nm)
|
system::system(sc_core::sc_module_name nm)
|
||||||
: sc_core::sc_module(nm)
|
: sc_core::sc_module(nm)
|
||||||
, NAMED(ahb_router, 3, 2)
|
, NAMED(ahb_router, 5, 2)
|
||||||
, NAMED(apbBridge, PipelinedMemoryBusToApbBridge_map.size(), 1) {
|
, NAMED(apbBridge, PipelinedMemoryBusToApbBridge_map.size(), 1) {
|
||||||
|
mtime_clk = (1.0 / 32768) * 1_sec;
|
||||||
|
|
||||||
core_complex.ibus(ahb_router.target[0]);
|
core_complex.ibus(ahb_router.target[0]);
|
||||||
core_complex.dbus(ahb_router.target[1]);
|
core_complex.dbus(ahb_router.target[1]);
|
||||||
|
|
||||||
ahb_router.initiator.at(0)(qspi.xip_sck);
|
ahb_router.bind_target(mem_ram.target, 1, 0x00000000, 128_kB);
|
||||||
ahb_router.set_target_range(0, 0xE0000000, 16_MB);
|
ahb_router.bind_target(apbBridge.target[0], 2, 0x10000000, 128_MB);
|
||||||
ahb_router.initiator.at(1)(mem_ram.target);
|
ahb_router.bind_target(eth0.socket, 3, 0x18000000, 4_KiB);
|
||||||
ahb_router.set_target_range(1, 0xC0000000, 128_kB);
|
ahb_router.bind_target(eth1.socket, 4, 0x18001000, 4_KiB);
|
||||||
ahb_router.initiator.at(2)(apbBridge.target[0]);
|
ahb_router.bind_target(qspi.xip_sck, 0, 0x20000000, 16_MB);
|
||||||
ahb_router.set_target_range(2, 0xF0000000, 256_MB);
|
|
||||||
|
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
for(const auto& e : PipelinedMemoryBusToApbBridge_map) {
|
for(const auto& e : PipelinedMemoryBusToApbBridge_map) {
|
||||||
apbBridge.initiator.at(i)(e.target);
|
apbBridge.initiator.at(i)(e.target);
|
||||||
@@ -44,6 +43,8 @@ system::system(sc_core::sc_module_name nm)
|
|||||||
qspi.clk_i(clk_i);
|
qspi.clk_i(clk_i);
|
||||||
core_complex.clk_i(clk_i);
|
core_complex.clk_i(clk_i);
|
||||||
// mem_ram.clk_i(clk_i);
|
// mem_ram.clk_i(clk_i);
|
||||||
|
eth0.clk_i(clk_i);
|
||||||
|
eth1.clk_i(clk_i);
|
||||||
|
|
||||||
gpio0.rst_i(rst_s);
|
gpio0.rst_i(rst_s);
|
||||||
uart0.rst_i(rst_s);
|
uart0.rst_i(rst_s);
|
||||||
@@ -52,10 +53,14 @@ system::system(sc_core::sc_module_name nm)
|
|||||||
irq_ctrl.rst_i(rst_s);
|
irq_ctrl.rst_i(rst_s);
|
||||||
qspi.rst_i(rst_s);
|
qspi.rst_i(rst_s);
|
||||||
core_complex.rst_i(rst_s);
|
core_complex.rst_i(rst_s);
|
||||||
|
eth0.rst_i(rst_s);
|
||||||
|
eth1.rst_i(rst_s);
|
||||||
|
|
||||||
aclint.mtime_int_o(mtime_int_s);
|
aclint.mtime_clk_i(mtime_clk);
|
||||||
aclint.msip_int_o(msip_int_s);
|
aclint.mtime_o(mtime_s);
|
||||||
irq_ctrl.irq_o(core_int_s);
|
aclint.mtime_int_o[0](clint_int_s[sysc::riscv::TIMER_IRQ]);
|
||||||
|
aclint.msip_int_o[0](clint_int_s[sysc::riscv::SW_IRQ]);
|
||||||
|
irq_ctrl.irq_o(clint_int_s[sysc::riscv::EXT_IRQ]);
|
||||||
irq_ctrl.pending_irq_i(irq_int_s);
|
irq_ctrl.pending_irq_i(irq_int_s);
|
||||||
|
|
||||||
uart0.irq_o(irq_int_s[0]);
|
uart0.irq_o(irq_int_s[0]);
|
||||||
@@ -63,10 +68,8 @@ system::system(sc_core::sc_module_name nm)
|
|||||||
timer0.interrupt_o[1](irq_int_s[2]);
|
timer0.interrupt_o[1](irq_int_s[2]);
|
||||||
qspi.irq_o(irq_int_s[3]);
|
qspi.irq_o(irq_int_s[3]);
|
||||||
|
|
||||||
core_complex.timer_irq_i(mtime_int_s);
|
core_complex.mtime_i(mtime_s);
|
||||||
core_complex.ext_irq_i(core_int_s);
|
core_complex.clint_irq_i(clint_int_s);
|
||||||
core_complex.local_irq_i(local_int_s);
|
|
||||||
core_complex.sw_irq_i(msip_int_s);
|
|
||||||
|
|
||||||
gpio0.pins_i(pins_i);
|
gpio0.pins_i(pins_i);
|
||||||
gpio0.pins_o(pins_o);
|
gpio0.pins_o(pins_o);
|
||||||
|
|||||||
@@ -7,8 +7,10 @@
|
|||||||
#ifndef SRC_VP_SYSTEM_H_
|
#ifndef SRC_VP_SYSTEM_H_
|
||||||
#define SRC_VP_SYSTEM_H_
|
#define SRC_VP_SYSTEM_H_
|
||||||
|
|
||||||
|
#include "tlm/scc/quantum_keeper.h"
|
||||||
#include <cci_configuration>
|
#include <cci_configuration>
|
||||||
#include <minres/aclint.h>
|
#include <minres/aclint.h>
|
||||||
|
#include <minres/ethmac.h>
|
||||||
#include <minres/gpio.h>
|
#include <minres/gpio.h>
|
||||||
#include <minres/irq.h>
|
#include <minres/irq.h>
|
||||||
#include <minres/qspi.h>
|
#include <minres/qspi.h>
|
||||||
@@ -18,6 +20,7 @@
|
|||||||
#include <scc/router.h>
|
#include <scc/router.h>
|
||||||
#include <scc/utilities.h>
|
#include <scc/utilities.h>
|
||||||
#include <sysc/communication/sc_clock.h>
|
#include <sysc/communication/sc_clock.h>
|
||||||
|
#include <sysc/communication/sc_signal.h>
|
||||||
#include <sysc/communication/sc_signal_ports.h>
|
#include <sysc/communication/sc_signal_ports.h>
|
||||||
#include <sysc/core_complex.h>
|
#include <sysc/core_complex.h>
|
||||||
#include <sysc/kernel/sc_module.h>
|
#include <sysc/kernel/sc_module.h>
|
||||||
@@ -47,6 +50,7 @@ public:
|
|||||||
system(sc_core::sc_module_name nm);
|
system(sc_core::sc_module_name nm);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
#include "../vp/gen/PipelinedMemoryBusToApbBridge.h" // IWYU pragma: keep
|
||||||
sysc::riscv::core_complex<> core_complex{"core_complex"};
|
sysc::riscv::core_complex<> core_complex{"core_complex"};
|
||||||
scc::router<> ahb_router, apbBridge;
|
scc::router<> ahb_router, apbBridge;
|
||||||
vpvper::minres::gpio_tl gpio0{"gpio0"};
|
vpvper::minres::gpio_tl gpio0{"gpio0"};
|
||||||
@@ -55,19 +59,19 @@ private:
|
|||||||
vpvper::minres::aclint_tl aclint{"aclint"};
|
vpvper::minres::aclint_tl aclint{"aclint"};
|
||||||
vpvper::minres::irq_tl irq_ctrl{"irq_ctrl"};
|
vpvper::minres::irq_tl irq_ctrl{"irq_ctrl"};
|
||||||
vpvper::minres::qspi_tl qspi{"qspi"};
|
vpvper::minres::qspi_tl qspi{"qspi"};
|
||||||
|
vpvper::minres::ethmac eth0{"eth0"};
|
||||||
|
vpvper::minres::ethmac eth1{"eth1"};
|
||||||
|
|
||||||
scc::memory<128_kB, scc::LT> mem_ram{"mem_ram"};
|
scc::memory<128_kB, scc::LT> mem_ram{"mem_ram"};
|
||||||
scc::memory<8_kB, scc::LT> boot_rom{"boot_rom"};
|
scc::memory<8_kB, scc::LT> boot_rom{"boot_rom"};
|
||||||
|
|
||||||
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"},
|
sc_core::sc_signal<sc_core::sc_time> mtime_clk{"mtime_clk"};
|
||||||
msip_int_s{"msip_int_s"};
|
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> rst_s{"rst_s"};
|
||||||
|
|
||||||
sc_core::sc_vector<sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS>> irq_int_s{"irq_int_s", 32},
|
|
||||||
local_int_s{"local_int_s", 16};
|
|
||||||
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> core_int_s{"core_int_s"};
|
|
||||||
|
|
||||||
|
sc_core::sc_vector<sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS>> irq_int_s{"irq_int_s", 32};
|
||||||
|
sc_core::sc_vector<sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS>> clint_int_s{"clint_int_s", 32};
|
||||||
|
sc_core::sc_signal<uint64_t> mtime_s{"mtime_s"};
|
||||||
void gen_reset();
|
void gen_reset();
|
||||||
#include "../vp/gen/PipelinedMemoryBusToApbBridge.h"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace vp
|
} // namespace vp
|
||||||
|
|||||||
2
vpvper
2
vpvper
Submodule vpvper updated: 77b5ffa40d...e5db89959d
Reference in New Issue
Block a user