17 Commits

5 changed files with 274 additions and 143 deletions

116
Jenkinsfile vendored
View File

@ -2,7 +2,7 @@ void checkout_project() {
checkout([ checkout([
$class: 'GitSCM', $class: 'GitSCM',
branches: [ branches: [
[name: '*/main'] [name: '*/develop']
], ],
extensions: [ extensions: [
[$class: 'CleanBeforeCheckout'], [$class: 'CleanBeforeCheckout'],
@ -15,6 +15,24 @@ void checkout_project() {
]) ])
} }
void checkout_iss_project(String repoUrl, String branch = 'develop') {
checkout([
$class: 'GitSCM',
branches: [
[name: "*/${branch}"]
],
extensions: [
[$class: 'CleanBeforeCheckout'],
[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false, shallow: true]
],
submoduleCfg: [],
userRemoteConfigs: [
[credentialsId: 'gitea-jenkins', url: repoUrl]
]
])
}
void checkout_develop() { void checkout_develop() {
dir("bare-metal-bsp") { dir("bare-metal-bsp") {
withCredentials([usernamePassword(credentialsId: 'gitea-jenkins', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) { withCredentials([usernamePassword(credentialsId: 'gitea-jenkins', usernameVariable: 'GIT_USERNAME', passwordVariable: 'GIT_PASSWORD')]) {
@ -29,6 +47,17 @@ void make_hello(board) {
sh("make -C hello-world/ clean") sh("make -C hello-world/ clean")
} }
void cmake_hello(board,build_type,core_type) {
sh("pwd")
// sh("cd hello-world/")
//sh("pwd")
def flavor ="${board}_${build_type}_${core_type}"
if (core_type=="32")
flavor ="${board}_${build_type}"
sh("cmake -B ${flavor} --preset=${flavor}")
sh("cmake --build ${flavor}")
}
pipeline { pipeline {
agent { docker { agent { docker {
image 'ubuntu-riscv' image 'ubuntu-riscv'
@ -48,12 +77,13 @@ pipeline {
stage('make rtl') {steps { make_hello("rtl")}} stage('make rtl') {steps { make_hello("rtl")}}
stage('make ehrenberg') {steps { make_hello("ehrenberg")}} stage('make ehrenberg') {steps { make_hello("ehrenberg")}}
stage('make tgc_vp') {steps { make_hello("tgc_vp")}}*/ stage('make tgc_vp') {steps { make_hello("tgc_vp")}}*/
stage('make hello-world') { stage('make hello-world') {
matrix { matrix {
axes { axes {
axis{ axis{
name 'BOARD' name 'BOARD'
values 'iss', 'hifive1', 'TGCP', 'ehrenberg', 'rtl', 'tgc_vp' values 'iss', 'moonlight', 'tgc_vp'
} }
} }
stages { stages {
@ -72,10 +102,92 @@ pipeline {
} }
} }
} }
stage('CMAKE flow for hello-world') {
matrix {
axes {
axis{
name 'BOARD'
values 'ISS', 'Moonlight', 'TGC_VP'
}
axis{
name 'BUILD_TYPE'
values 'Debug', 'Release'
}
axis{
name 'CORE_TYPE'
values '32', '64'
}
}
stages {
stage('Force sequential') {
options {
lock("One Board at a time")
}
stages {
stage("CMAKE") {
steps {
dir("hello-world"){
cmake_hello("${BOARD}","${BUILD_TYPE}","${CORE_TYPE}")
}
}
}
}
}
}
}
}
stage("Checkout TGC-ISS, TGC-Compliance and TGC-GEN"){
steps {
sh 'rm -rf * .??* '
checkout_iss_project("https://git.minres.com/TGFS/TGC-ISS.git", "develop")
dir("TGC-COMPLIANCE"){
checkout_iss_project("https://git.minres.com/TGFS/TGC-COMPLIANCE.git", "master")
}
dir("TGC-GEN"){
checkout_iss_project("https://git.minres.com/TGFS/TGC-GEN.git", "develop")
}
}
}
stage("Generate cores and build TGC-ISS"){
steps {
sh 'pwd'
sh 'conan profile detect --force'
sh 'rm -rf build'
/*
sh '''
for core in RV32GC; do
for backend in interp; do
TGC-GEN/scripts/generate_iss.sh -o dbt-rise-tgc/ -c $core -b ${backend} TGC-GEN/CoreDSL/${core}.core_desc
done
done
for core in RV64GC; do
for backend in interp; do
TGC-GEN/scripts/generate_iss.sh -o dbt-rise-tgc/ -c $core -b ${backend} TGC-GEN/CoreDSL/${core}.core_desc
done
done
'''
sh 'conan profile detect --force'
sh 'rm -rf build'
sh 'cmake -S . -B build --preset Release -DWITH_ASMJIT=ON -DWITH_TCC=ON -DWITH_LLVM=OFF'
sh 'cmake --build build -j'
sh 'build/dbt-rise-tgc/tgc-sim --isa ?'
*/
}
}
stage("start to check") {
steps {
sh 'pwd'
}
}
} }
/*
post { post {
failure { failure {
sh("make -C hello-world/ clean") sh("make -C hello-world/ clean")
} }
} }
*/
} }

View File

@ -10,100 +10,109 @@
}, },
"configurePresets": [ "configurePresets": [
{ {
"name": "ISS_Debug", "name": "32imc",
"hidden": true,
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake" "CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
} }
},
{
"name": "64imc",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
},
{
"name": "iss",
"hidden": true,
"cacheVariables": {
"BOARD": "iss"
}
},
{
"name": "moonlight",
"hidden": true,
"cacheVariables": {
"BOARD": "moonlight"
}
},
{
"name": "tgc_vp",
"hidden": true,
"cacheVariables": {
"BOARD": "tgc_vp"
}
},
{
"name": "rtl",
"hidden": true,
"cacheVariables": {
"BOARD": "rtl"
}
},
{
"name": "debug",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "release",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ISS_Debug",
"inherits": ["iss", "debug", "32imc"]
}, },
{ {
"name": "Moonlight_Debug", "name": "Moonlight_Debug",
"cacheVariables": { "inherits": ["moonlight", "debug", "32imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "TGC_Debug", "name": "TGC_VP_Debug",
"cacheVariables": { "inherits": ["tgc_vp", "debug", "32imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "ISS_Debug_64", "name": "ISS_Debug_64",
"cacheVariables": { "inherits": ["iss", "debug", "64imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "Moonlight_Debug_64", "name": "Moonlight_Debug_64",
"cacheVariables": { "inherits": ["moonlight", "debug", "64imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "TGC_Debug_64", "name": "TGC_VP_Debug_64",
"cacheVariables": { "inherits": ["tgc_vp", "debug", "64imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "ISS_Release", "name": "ISS_Release",
"cacheVariables": { "inherits": ["iss", "release", "32imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "Moonlight_Release", "name": "Moonlight_Release",
"cacheVariables": { "inherits": ["moonlight", "release", "32imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "TGC_Release", "name": "TGC_VP_Release",
"cacheVariables": { "inherits": ["tgc_vp", "release", "32imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "ISS_Release_64", "name": "ISS_Release_64",
"cacheVariables": { "inherits": ["iss", "release", "64imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "Moonlight_Release_64", "name": "Moonlight_Release_64",
"cacheVariables": { "inherits": ["moonlight", "release", "64imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "TGC_Release_64", "name": "TGC_VP_Release_64",
"cacheVariables": { "inherits": ["tgc_vp", "release", "64imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
} }
] ]
} }

View File

@ -10,100 +10,109 @@
}, },
"configurePresets": [ "configurePresets": [
{ {
"name": "ISS_Debug", "name": "32imc",
"hidden": true,
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake" "CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
} }
},
{
"name": "64imc",
"hidden": true,
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
},
{
"name": "iss",
"hidden": true,
"cacheVariables": {
"BOARD": "iss"
}
},
{
"name": "moonlight",
"hidden": true,
"cacheVariables": {
"BOARD": "moonlight"
}
},
{
"name": "tgc_vp",
"hidden": true,
"cacheVariables": {
"BOARD": "tgc_vp"
}
},
{
"name": "rtl",
"hidden": true,
"cacheVariables": {
"BOARD": "rtl"
}
},
{
"name": "debug",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "release",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ISS_Debug",
"inherits": ["iss", "debug", "32imc"]
}, },
{ {
"name": "Moonlight_Debug", "name": "Moonlight_Debug",
"cacheVariables": { "inherits": ["moonlight", "debug", "32imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "TGC_Debug", "name": "TGC_VP_Debug",
"cacheVariables": { "inherits": ["tgc_vp", "debug", "32imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "ISS_Debug_64", "name": "ISS_Debug_64",
"cacheVariables": { "inherits": ["iss", "debug", "64imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "Moonlight_Debug_64", "name": "Moonlight_Debug_64",
"cacheVariables": { "inherits": ["moonlight", "debug", "64imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "TGC_Debug_64", "name": "TGC_VP_Debug_64",
"cacheVariables": { "inherits": ["tgc_vp", "debug", "64imc"]
"CMAKE_BUILD_TYPE": "Debug",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "ISS_Release", "name": "ISS_Release",
"cacheVariables": { "inherits": ["iss", "release", "32imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "Moonlight_Release", "name": "Moonlight_Release",
"cacheVariables": { "inherits": ["moonlight", "release", "32imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "TGC_Release", "name": "TGC_VP_Release",
"cacheVariables": { "inherits": ["tgc_vp", "release", "32imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv32imc.cmake"
}
}, },
{ {
"name": "ISS_Release_64", "name": "ISS_Release_64",
"cacheVariables": { "inherits": ["iss", "release", "64imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "iss",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "Moonlight_Release_64", "name": "Moonlight_Release_64",
"cacheVariables": { "inherits": ["moonlight", "release", "64imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "moonlight",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
}, },
{ {
"name": "TGC_Release_64", "name": "TGC_VP_Release_64",
"cacheVariables": { "inherits": ["tgc_vp", "release", "64imc"]
"CMAKE_BUILD_TYPE": "Release",
"BOARD": "tgc_vp",
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
}
} }
] ]
} }

View File

@ -20,7 +20,7 @@
"name": "64imc", "name": "64imc",
"hidden": true, "hidden": true,
"cacheVariables": { "cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64imc.cmake" "CMAKE_TOOLCHAIN_FILE": "../../bare-metal-bsp/cmake/rv64gc.cmake"
} }
}, },
{ {
@ -38,7 +38,7 @@
} }
}, },
{ {
"name": "tgc-vp", "name": "tgc_vp",
"hidden": true, "hidden": true,
"cacheVariables": { "cacheVariables": {
"BOARD": "tgc_vp" "BOARD": "tgc_vp"
@ -67,51 +67,52 @@
}, },
{ {
"name": "ISS_Debug", "name": "ISS_Debug",
"inherits": ["iss", "debug", "rv32imc"] "inherits": ["iss", "debug", "32imc"]
}, },
{ {
"name": "Moonlight_Debug", "name": "Moonlight_Debug",
"inherits": ["moonlight", "debug", "rv32imc"] "inherits": ["moonlight", "debug", "32imc"]
}, },
{ {
"name": "TGC_VP_Debug", "name": "TGC_VP_Debug",
"inherits": ["tgc_vp", "debug", "rv32imc"] "inherits": ["tgc_vp", "debug", "32imc"]
}, },
{ {
"name": "ISS_Debug_64", "name": "ISS_Debug_64",
"inherits": ["iss", "debug", "rv64imc"] "inherits": ["iss", "debug", "64imc"]
}, },
{ {
"name": "Moonlight_Debug_64", "name": "Moonlight_Debug_64",
"inherits": ["moonlight", "debug", "rv64imc"] "inherits": ["moonlight", "debug", "64imc"]
}, },
{ {
"name": "TGC_VP_Debug_64", "name": "TGC_VP_Debug_64",
"inherits": ["tgc_vp", "debug", "rv64imc"] "inherits": ["tgc_vp", "debug", "64imc"]
}, },
{ {
"name": "ISS_Release", "name": "ISS_Release",
"inherits": ["iss", "release", "rv32imc"] "inherits": ["iss", "release", "32imc"]
}, },
{ {
"name": "Moonlight_Release", "name": "Moonlight_Release",
"inherits": ["moonlight", "release", "rv32imc"] "inherits": ["moonlight", "release", "32imc"]
}, },
{ {
"name": "TGC_VP_Release", "name": "TGC_VP_Release",
"inherits": ["tgc_vp", "release", "rv32imc"] "inherits": ["tgc_vp", "release", "32imc"]
}, },
{ {
"name": "ISS_Release_64", "name": "ISS_Release_64",
"inherits": ["iss", "release", "rv64imc"] "inherits": ["iss", "release", "64imc"]
}, },
{ {
"name": "Moonlight_Release_64", "name": "Moonlight_Release_64",
"inherits": ["moonlight", "release", "rv64imc"] "inherits": ["moonlight", "release", "64imc"]
}, },
{ {
"name": "TGC_VP_Release_64", "name": "TGC_VP_Release_64",
"inherits": ["tgc_vp", "release", "rv64imc"] "inherits": ["tgc_vp", "release", "64imc"]
} }
] ]
} }