Fix regression tests, add DRAMPower.

This commit is contained in:
Lukas Steiner
2023-02-23 10:38:59 +01:00
parent e848d776cc
commit d736a2d25e
19 changed files with 68 additions and 67 deletions

View File

@@ -22,14 +22,14 @@ build:
- mkdir -p coverage
- mkdir -p build
- cd build
- cmake -DDRAMSYS_COVERAGE_CHECK=ON ../DRAMSys
- cmake -DDRAMSYS_COVERAGE_CHECK=ON -DDRAMSYS_ENABLE_EXTENSIONS=ON -DDRAMSYS_EXTENSION_TRACE_ANALYZER_ENABLE=ON -DDRAMSYS_WITH_DRAMPOWER=ON ..
- make -j 10
- find . -name "*.o" -type f -delete
artifacts:
paths:
- build/
- DRAMSys/tests/
- tests/
- coverage/
expire_in: 2 days
@@ -45,8 +45,8 @@ coverage:
- lcov --list coverage/final_dramsys.out
include:
- '/DRAMSys/tests/DDR3/ci.yml'
- '/DRAMSys/tests/DDR4/ci.yml'
- '/DRAMSys/tests/HBM2/ci.yml'
- '/DRAMSys/tests/LPDDR4/ci.yml'
- 'tests/tests_regression/DDR3/ci.yml'
- 'tests/tests_regression/DDR4/ci.yml'
- 'tests/tests_regression/HBM2/ci.yml'
- 'tests/tests_regression/LPDDR4/ci.yml'
#- '/DRAMSys/tests/dramsys-gem5/ci.yml' # Should be activated again when a new gitlab runner with right dependencies is used

View File

@@ -146,6 +146,17 @@ FetchContent_Declare(
FetchContent_MakeAvailable(systemc)
set_target_properties(systemc PROPERTIES FOLDER lib)
### DRAMPower ###
if (DRAMSYS_WITH_DRAMPOWER)
FetchContent_Declare(
DRAMPower
GIT_REPOSITORY https://github.com/tukl-msd/DRAMPower
GIT_TAG 9e64a1b)
FetchContent_MakeAvailable(DRAMPower)
set_target_properties(DRAMPower PROPERTIES FOLDER lib)
endif ()
###############################################
### Source Directory ###
###############################################
@@ -172,15 +183,6 @@ if(DRAMSYS_BUILD_TESTS)
add_subdirectory(tests)
endif()
# Add TraceAnalyzer:
#if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/traceAnalyzer)
# option(DRAMSYS_BUILD_TRACE_ANALYZER "Build DRAMSys TraceAnalyzer" OFF)
# if(DRAMSYS_BUILD_TRACE_ANALYZER)
# message("== Trace Analyzer included")
# add_subdirectory(traceAnalyzer)
# endif()
#endif()
# Add DRAMSysgem5
#if(DEFINED ENV{GEM5} AND DRAMSYS_WITH_GEM5)
# message("== gem5 coupling included")

View File

@@ -53,6 +53,11 @@ target_link_libraries(${PROJECT_NAME}
sqlite3::sqlite3
)
if (DRAMSYS_WITH_DRAMPOWER)
target_link_libraries(${PROJECT_NAME} PRIVATE DRAMPower)
target_compile_definitions(${PROJECT_NAME} PRIVATE DRAMPOWER)
endif ()
add_library(DRAMSys::libdramsys ALIAS ${PROJECT_NAME})
build_source_group()

View File

@@ -38,7 +38,7 @@
#define COMMAND_H
#ifdef DRAMPOWER
#include "../common/third_party/DRAMPower/src/MemCommand.h"
#include "MemCommand.h"
#endif
#include <string>

View File

@@ -42,8 +42,7 @@
#include "DRAMSys/common/DebugManager.h"
#ifdef DRAMPOWER
#include "../../common/third_party/DRAMPower/src/MemCommand.h"
#include "../../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h"
#include "LibDRAMPower.h"
#endif
#include <cassert>

View File

@@ -38,7 +38,7 @@
#include "DRAMSys/configuration/memspec/MemSpecDDR3.h"
#ifdef DRAMPOWER
#include "../../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h"
#include "LibDRAMPower.h"
using namespace DRAMPower;
#endif

View File

@@ -38,7 +38,7 @@
#include "DRAMSys/configuration/memspec/MemSpecDDR4.h"
#ifdef DRAMPOWER
#include "../../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h"
#include "LibDRAMPower.h"
using namespace DRAMPower;
#endif

View File

@@ -37,6 +37,7 @@
#include "DRAMSys/common/TlmRecorder.h"
#include "DRAMSys/common/utils.h"
#include "DRAMSys/common/DebugManager.h"
#include "DRAMSys/simulation/dram/DramDDR3.h"
#include "DRAMSys/simulation/dram/DramDDR4.h"
#include "DRAMSys/simulation/dram/DramWideIO.h"

View File

@@ -40,7 +40,7 @@
#include "DRAMSys/configuration/Configuration.h"
#ifdef DRAMPOWER
#include "../../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h"
#include "LibDRAMPower.h"
#endif
#include <systemc>

View File

@@ -33,18 +33,16 @@
* Lukas Steiner
*/
#include <cmath>
#include <memory>
#include "DramWideIO.h"
#include "../../configuration/Configuration.h"
#include "../../configuration/memspec/MemSpecWideIO.h"
#include "DRAMSys/configuration/memspec/MemSpecWideIO.h"
#ifdef DRAMPOWER
#include "../../common/third_party/DRAMPower/src/libdrampower/LibDRAMPower.h"
#include "LibDRAMPower.h"
using namespace DRAMPower;
#endif
#include <memory>
using namespace sc_core;
using namespace tlm;

View File

@@ -4,15 +4,14 @@ example_DDR3:
script:
- export GCOV_PREFIX=$(pwd)
- export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}')
- cd build/simulator
- ./DRAMSys ../../DRAMSys/tests/DDR3/simulations/ddr3-example.json ../../DRAMSys/tests/DDR3/
- mv DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb ddr3-dual-rank_ddr3_ch0.tdb
- cd build/bin
- ./DRAMSys ../../tests/tests_regression/DDR3/simulations/ddr3-example.json ../../tests/tests_regression/DDR3/
- ls -lah
- ls -lah ../../DRAMSys/tests/DDR3/expected/
- sqldiff ../../DRAMSys/tests/DDR3/expected/ddr3-dual-rank_ddr3_ch0.tdb ddr3-dual-rank_ddr3_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../DRAMSys/tests/DDR3/expected/ddr3-dual-rank_ddr3_ch0.tdb ddr3-dual-rank_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../DRAMSys/tests/DDR3/expected/ddr3-dual-rank_ddr3_ch0.tdb ddr3-dual-rank_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../DRAMSys/tests/DDR3/expected/ddr3-dual-rank_ddr3_ch0.tdb ddr3-dual-rank_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- sqldiff ../../DRAMSys/tests/DDR3/expected/DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../DRAMSys/tests/DDR3/expected/DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../DRAMSys/tests/DDR3/expected/DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../DRAMSys/tests/DDR3/expected/DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
# Run Code Coverage
- lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out
@@ -24,6 +23,6 @@ example_DDR3:
artifacts:
paths:
- build/simulator/ddr3-dual-rank_ddr3_ch0.tdb
- build/bin/DRAMSys_ddr3-dual-rank_ddr3_ch0.tdb
- coverage/${CI_JOB_NAME}.out
expire_in: 2 days

View File

@@ -4,15 +4,14 @@ example_DDR4:
script:
- export GCOV_PREFIX=$(pwd)
- export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}')
- cd build/simulator
- ./DRAMSys ../../DRAMSys/tests/DDR4/simulations/ddr4-example.json ../../DRAMSys/tests/DDR4/
- mv DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb ddr4-bankgrp_ddr4_ch0.tdb
- cd build/bin
- ./DRAMSys ../../tests/tests_regression/DDR4/simulations/ddr4-example.json ../../tests/tests_regression/DDR4/
- ls -lah
- ls -lah ../../DRAMSys/tests/DDR4/expected/
- sqldiff ../../DRAMSys/tests/DDR4/expected/ddr4-bankgrp_ddr4_ch0.tdb ddr4-bankgrp_ddr4_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../DRAMSys/tests/DDR4/expected/ddr4-bankgrp_ddr4_ch0.tdb ddr4-bankgrp_ddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../DRAMSys/tests/DDR4/expected/ddr4-bankgrp_ddr4_ch0.tdb ddr4-bankgrp_ddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../DRAMSys/tests/DDR4/expected/ddr4-bankgrp_ddr4_ch0.tdb ddr4-bankgrp_ddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- ls -lah ../../tests/tests_regression/DDR4/expected/
- sqldiff ../../tests/tests_regression/DDR4/expected/DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../tests/tests_regression/DDR4/expected/DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../tests/tests_regression/DDR4/expected/DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../tests/tests_regression/DDR4/expected/DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
# Run Code Coverage
- lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out
@@ -24,6 +23,6 @@ example_DDR4:
artifacts:
paths:
- build/simulator/ddr4-bankgrp_ddr4_ch0.tdb
- build/bin/DRAMSys_ddr4-bankgrp_ddr4_ch0.tdb
- coverage/${CI_JOB_NAME}.out
expire_in: 2 days

View File

@@ -3,20 +3,18 @@ example_HBM2:
script:
- export GCOV_PREFIX=$(pwd)
- export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}')
- cd build/simulator
- ./DRAMSys ../../DRAMSys/tests/HBM2/simulations/hbm2-example.json ../../DRAMSys/tests/HBM2/
- mv DRAMSys_hbm2-example_hbm2_ch0.tdb hbm2-example_hbm2_ch0.tdb
- mv DRAMSys_hbm2-example_hbm2_ch1.tdb hbm2-example_hbm2_ch1.tdb
- cd build/bin
- ./DRAMSys ../../tests/tests_regression/HBM2/simulations/hbm2-example.json ../../tests/tests_regression/HBM2/
- ls -lah
- ls -lah ../../DRAMSys/tests/HBM2/expected/
- sqldiff ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch0.tdb hbm2-example_hbm2_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch0.tdb hbm2-example_hbm2_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch0.tdb hbm2-example_hbm2_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch0.tdb hbm2-example_hbm2_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- sqldiff ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch1.tdb hbm2-example_hbm2_ch1.tdb
- perl -e 'if(`sqldiff --table Phases ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch1.tdb hbm2-example_hbm2_ch1.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch1.tdb hbm2-example_hbm2_ch1.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../DRAMSys/tests/HBM2/expected/hbm2-example_hbm2_ch1.tdb hbm2-example_hbm2_ch1.tdb` eq "") {exit(0)} else {exit(-1)}'
- ls -lah ../../tests/tests_regression/HBM2/expected/
- sqldiff ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch0.tdb DRAMSys_hbm2-example_hbm2_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch0.tdb DRAMSys_hbm2-example_hbm2_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch0.tdb DRAMSys_hbm2-example_hbm2_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch0.tdb DRAMSys_hbm2-example_hbm2_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- sqldiff ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch1.tdb DRAMSys_hbm2-example_hbm2_ch1.tdb
- perl -e 'if(`sqldiff --table Phases ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch1.tdb DRAMSys_hbm2-example_hbm2_ch1.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch1.tdb DRAMSys_hbm2-example_hbm2_ch1.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../tests/tests_regression/HBM2/expected/DRAMSys_hbm2-example_hbm2_ch1.tdb DRAMSys_hbm2-example_hbm2_ch1.tdb` eq "") {exit(0)} else {exit(-1)}'
- lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out
cache:
key: build
@@ -26,6 +24,7 @@ example_HBM2:
artifacts:
paths:
- build/simulator/hbm2-example_hbm2_ch0.tdb
- build/bin/DRAMSys_hbm2-example_hbm2_ch0.tdb
- build/bin/DRAMSys_hbm2-example_hbm2_ch1.tdb
- coverage/${CI_JOB_NAME}.out
expire_in: 2 days

View File

@@ -4,15 +4,14 @@ example_LPDDR4:
script:
- export GCOV_PREFIX=$(pwd)
- export GCOV_PREFIX_STRIP=$(pwd | awk -F"/" '{print NF-1}')
- cd build/simulator
- ./DRAMSys ../../DRAMSys/tests/LPDDR4/simulations/lpddr4-example.json ../../DRAMSys/tests/LPDDR4/
- mv DRAMSys_lpddr4-example_lpddr4_ch0.tdb lpddr4-example_lpddr4_ch0.tdb
- cd build/bin
- ./DRAMSys ../../tests/tests_regression/LPDDR4/simulations/lpddr4-example.json ../../tests/tests_regression/LPDDR4/
- ls -lah
- ls -lah ../../DRAMSys/tests/LPDDR4/expected/
- sqldiff ../../DRAMSys/tests/LPDDR4/expected/lpddr4-example_lpddr4_ch0.tdb lpddr4-example_lpddr4_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../DRAMSys/tests/LPDDR4/expected/lpddr4-example_lpddr4_ch0.tdb lpddr4-example_lpddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../DRAMSys/tests/LPDDR4/expected/lpddr4-example_lpddr4_ch0.tdb lpddr4-example_lpddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../DRAMSys/tests/LPDDR4/expected/lpddr4-example_lpddr4_ch0.tdb lpddr4-example_lpddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- ls -lah ../../tests/tests_regression/LPDDR4/expected/
- sqldiff ../../tests/tests_regression/LPDDR4/expected/DRAMSys_lpddr4-example_lpddr4_ch0.tdb DRAMSys_lpddr4-example_lpddr4_ch0.tdb
- perl -e 'if(`sqldiff --table Phases ../../tests/tests_regression/LPDDR4/expected/DRAMSys_lpddr4-example_lpddr4_ch0.tdb DRAMSys_lpddr4-example_lpddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Transactions ../../tests/tests_regression/LPDDR4/expected/DRAMSys_lpddr4-example_lpddr4_ch0.tdb DRAMSys_lpddr4-example_lpddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
- perl -e 'if(`sqldiff --table Power ../../tests/tests_regression/LPDDR4/expected/DRAMSys_lpddr4-example_lpddr4_ch0.tdb DRAMSys_lpddr4-example_lpddr4_ch0.tdb` eq "") {exit(0)} else {exit(-1)}'
# Run Code Coverage
- lcov -q -c --rc geninfo_adjust_src_path=$GCOV_PREFIX -d ${CI_PROJECT_DIR}/build/ -o ${CI_PROJECT_DIR}/coverage/${CI_JOB_NAME}.out
@@ -24,6 +23,6 @@ example_LPDDR4:
artifacts:
paths:
- build/simulator/lpddr4-example_lpddr4_ch0.tdb
- build/bin/DRAMSys_lpddr4-example_lpddr4_ch0.tdb
- coverage/${CI_JOB_NAME}.out
expire_in: 2 days