Use raw string literal for database creation

This commit is contained in:
2023-08-22 10:39:35 +02:00
parent 8695efb2f9
commit 1bb3c3ea0f

View File

@@ -177,104 +177,105 @@ private:
insertDebugMessageString, insertPowerString, insertDebugMessageString, insertPowerString,
insertBufferDepthString, insertBandwidthString; insertBufferDepthString, insertBandwidthString;
std::string initialCommand = std::string initialCommand = R"(
"DROP TABLE IF EXISTS Phases; \n" DROP TABLE IF EXISTS Phases;
"DROP TABLE IF EXISTS GeneralInfo; \n" DROP TABLE IF EXISTS GeneralInfo;
"DROP TABLE IF EXISTS CommandLengths; \n" DROP TABLE IF EXISTS CommandLengths;
"DROP TABLE IF EXISTS Comments; \n" DROP TABLE IF EXISTS Comments;
"DROP TABLE IF EXISTS ranges; \n" DROP TABLE IF EXISTS ranges;
"DROP TABLE IF EXISTS Transactions; \n" DROP TABLE IF EXISTS Transactions;
"DROP TABLE IF EXISTS DebugMessages; \n" DROP TABLE IF EXISTS DebugMessages;
"DROP TABLE IF EXISTS Power; \n" DROP TABLE IF EXISTS Power;
"DROP TABLE IF EXISTS BufferDepth; \n" DROP TABLE IF EXISTS BufferDepth;
"DROP TABLE IF EXISTS Bandwidth; \n" DROP TABLE IF EXISTS Bandwidth;
" \n"
"CREATE TABLE Phases( \n" CREATE TABLE Phases(
" ID INTEGER PRIMARY KEY, \n" ID INTEGER PRIMARY KEY,
" PhaseName TEXT, \n" PhaseName TEXT,
" PhaseBegin INTEGER, \n" PhaseBegin INTEGER,
" PhaseEnd INTEGER, \n" PhaseEnd INTEGER,
" DataStrobeBegin INTEGER, \n" DataStrobeBegin INTEGER,
" DataStrobeEnd INTEGER, \n" DataStrobeEnd INTEGER,
" Rank INTEGER, \n" Rank INTEGER,
" BankGroup INTEGER, \n" BankGroup INTEGER,
" Bank INTEGER, \n" Bank INTEGER,
" Row INTEGER, \n" Row INTEGER,
" Column INTEGER, \n" Column INTEGER,
" BurstLength INTEGER, \n" BurstLength INTEGER,
" Transact INTEGER \n" Transact INTEGER
"); \n" );
" \n"
"CREATE TABLE GeneralInfo( \n" CREATE TABLE GeneralInfo(
" NumberOfRanks INTEGER, \n" NumberOfRanks INTEGER,
" NumberOfBankgroups INTEGER, \n" NumberOfBankgroups INTEGER,
" NumberOfBanks INTEGER, \n" NumberOfBanks INTEGER,
" clk INTEGER, \n" clk INTEGER,
" UnitOfTime TEXT, \n" UnitOfTime TEXT,
" MCconfig TEXT, \n" MCconfig TEXT,
" Memspec TEXT, \n" Memspec TEXT,
" Traces TEXT, \n" Traces TEXT,
" WindowSize INTEGER, \n" WindowSize INTEGER,
" RefreshMaxPostponed INTEGER, \n" RefreshMaxPostponed INTEGER,
" RefreshMaxPulledin INTEGER, \n" RefreshMaxPulledin INTEGER,
" ControllerThread INTEGER, \n" ControllerThread INTEGER,
" MaxBufferDepth INTEGER, \n" MaxBufferDepth INTEGER,
" Per2BankOffset INTEGER, \n" Per2BankOffset INTEGER,
" RowColumnCommandBus BOOL, \n" RowColumnCommandBus BOOL,
" PseudoChannelMode BOOL \n" PseudoChannelMode BOOL
"); \n" );
" \n"
"CREATE TABLE CommandLengths( \n" CREATE TABLE CommandLengths(
" Command TEXT, \n" Command TEXT,
" Length DOUBLE \n" Length DOUBLE
"); \n" );
" \n"
"CREATE TABLE Power( \n" CREATE TABLE Power(
" time DOUBLE, \n" time DOUBLE,
" AveragePower DOUBLE \n" AveragePower DOUBLE
"); \n" );
" \n"
"CREATE TABLE BufferDepth( \n" CREATE TABLE BufferDepth(
" Time DOUBLE, \n" Time DOUBLE,
" BufferNumber INTEGER, \n" BufferNumber INTEGER,
" AverageBufferDepth DOUBLE \n" AverageBufferDepth DOUBLE
"); \n" );
" \n"
"CREATE TABLE Bandwidth( \n" CREATE TABLE Bandwidth(
" Time DOUBLE, \n" Time DOUBLE,
" AverageBandwidth DOUBLE \n" AverageBandwidth DOUBLE
"); \n" );
" \n"
"CREATE TABLE Comments( \n" CREATE TABLE Comments(
" Time INTEGER, \n" Time INTEGER,
" Text TEXT \n" Text TEXT
"); \n" );
" \n"
"CREATE TABLE DebugMessages( \n" CREATE TABLE DebugMessages(
" Time INTEGER, \n" Time INTEGER,
" Message TEXT \n" Message TEXT
"); \n" );
" \n"
"-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)\n" -- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)
"CREATE VIRTUAL TABLE ranges USING rtree( \n" CREATE VIRTUAL TABLE ranges USING rtree(
" id, \n" id,
" begin, end \n" begin, end
"); \n" );
" \n"
"CREATE TABLE Transactions( \n" CREATE TABLE Transactions(
" ID INTEGER, \n" ID INTEGER,
" Range INTEGER, \n" Range INTEGER,
" Address INTEGER, \n" Address INTEGER,
" DataLength INTEGER, \n" DataLength INTEGER,
" Thread INTEGER, \n" Thread INTEGER,
" Channel INTEGER, \n" Channel INTEGER,
" TimeOfGeneration INTEGER, \n" TimeOfGeneration INTEGER,
" Command TEXT \n" Command TEXT
"); \n" );
" \n"
"CREATE INDEX ranges_index ON Transactions(Range); \n" CREATE INDEX ranges_index ON Transactions(Range);
"CREATE INDEX \"phasesTransactions\" ON \"Phases\" (\"Transact\" ASC); \n" CREATE INDEX "phasesTransactions" ON "Phases" ("Transact" ASC);
"CREATE INDEX \"messageTimes\" ON \"DebugMessages\" (\"Time\" ASC); \n"; CREATE INDEX "messageTimes" ON "DebugMessages" ("Time" ASC);
)";
}; };
} // namespace DRAMSys } // namespace DRAMSys