Move initial SQL table into source file.
This commit is contained in:
@@ -1,111 +0,0 @@
|
||||
DROP TABLE IF EXISTS Phases;
|
||||
DROP TABLE IF EXISTS GeneralInfo;
|
||||
DROP TABLE IF EXISTS CommandLengths;
|
||||
DROP TABLE IF EXISTS Comments;
|
||||
DROP TABLE IF EXISTS ranges;
|
||||
DROP TABLE IF EXISTS Transactions;
|
||||
DROP TABLE IF EXISTS DebugMessages;
|
||||
DROP TABLE IF EXISTS Power;
|
||||
DROP TABLE IF EXISTS BufferDepth;
|
||||
DROP TABLE IF EXISTS Bandwidth;
|
||||
|
||||
CREATE TABLE Phases(
|
||||
ID INTEGER PRIMARY KEY,
|
||||
PhaseName TEXT,
|
||||
PhaseBegin INTEGER,
|
||||
PhaseEnd INTEGER,
|
||||
Transact INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE GeneralInfo(
|
||||
NumberOfTransactions INTEGER,
|
||||
TraceEnd INTEGER,
|
||||
NumberOfRanks INTEGER,
|
||||
NumberOfBankgroups INTEGER,
|
||||
NumberOfBanks INTEGER,
|
||||
clk INTEGER,
|
||||
UnitOfTime TEXT,
|
||||
MCconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
WindowSize INTEGER,
|
||||
FlexibleRefresh INTEGER,
|
||||
MaxRefBurst INTEGER,
|
||||
ControllerThread INTEGER,
|
||||
MaxBufferDepth INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE CommandLengths(
|
||||
NOP INTEGER,
|
||||
RD INTEGER,
|
||||
WR INTEGER,
|
||||
RDA INTEGER,
|
||||
WRA INTEGER,
|
||||
ACT INTEGER,
|
||||
PRE INTEGER,
|
||||
REFB INTEGER,
|
||||
PRESB INTEGER,
|
||||
REFSB INTEGER,
|
||||
PREA INTEGER,
|
||||
REFA INTEGER,
|
||||
PDEA INTEGER,
|
||||
PDXA INTEGER,
|
||||
PDEP INTEGER,
|
||||
PDXP INTEGER,
|
||||
SREFEN INTEGER,
|
||||
SREFEX INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE Power(
|
||||
time DOUBLE,
|
||||
AveragePower DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE BufferDepth(
|
||||
Time DOUBLE,
|
||||
BufferNumber INTEGER,
|
||||
AverageBufferDepth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Bandwidth(
|
||||
Time DOUBLE,
|
||||
AverageBandwidth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Comments(
|
||||
Time INTEGER,
|
||||
Text TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE DebugMessages(
|
||||
Time INTEGER,
|
||||
Message TEXT
|
||||
);
|
||||
|
||||
-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)
|
||||
CREATE VIRTUAL TABLE ranges USING rtree(
|
||||
id,
|
||||
begin, end
|
||||
);
|
||||
|
||||
CREATE TABLE Transactions(
|
||||
ID INTEGER,
|
||||
Range INTEGER,
|
||||
Address INTEGER,
|
||||
Burstlength INTEGER,
|
||||
TThread INTEGER,
|
||||
TChannel INTEGER,
|
||||
TRank INTEGER,
|
||||
TBankgroup INTEGER,
|
||||
TBank INTEGER,
|
||||
TRow INTEGER,
|
||||
TColumn INTEGER,
|
||||
DataStrobeBegin INTEGER,
|
||||
DataStrobeEnd INTEGER,
|
||||
TimeOfGeneration INTEGER,
|
||||
Command TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX ranges_index ON Transactions(Range);
|
||||
CREATE INDEX "phasesTransactions" ON "Phases" ("Transact" ASC);
|
||||
CREATE INDEX "messageTimes" ON "DebugMessages" ("Time" ASC);
|
||||
@@ -46,8 +46,8 @@
|
||||
|
||||
using namespace tlm;
|
||||
|
||||
TlmRecorder::TlmRecorder(std::string name, std::string uri, std::string dbname) :
|
||||
name(name), sqlScriptURI(uri), dbName(dbname),
|
||||
TlmRecorder::TlmRecorder(std::string name, std::string dbname) :
|
||||
dbName(dbname), name(name),
|
||||
totalNumTransactions(1), simulationTimeCoveredByRecording(SC_ZERO_TIME)
|
||||
{
|
||||
recordedData.reserve(transactionCommitRate);
|
||||
@@ -60,7 +60,7 @@ TlmRecorder::TlmRecorder(std::string name, std::string uri, std::string dbname)
|
||||
sqlite3_exec(db, "PRAGMA main.synchronous=OFF", NULL, NULL, &sErrMsg);
|
||||
sqlite3_exec(db, "PRAGMA journal_mode = OFF", NULL, NULL, &sErrMsg);
|
||||
|
||||
createTables(TlmRecorder::sqlScriptURI);
|
||||
executeInitialSqlCommand();
|
||||
prepareSqlStatements();
|
||||
|
||||
PRINTDEBUGMESSAGE(name, "Starting new database transaction");
|
||||
@@ -256,23 +256,6 @@ void TlmRecorder::openDB(std::string name)
|
||||
}
|
||||
}
|
||||
|
||||
void TlmRecorder::createTables(std::string pathToURI)
|
||||
{
|
||||
std::string initial;
|
||||
ifstream in(pathToURI.c_str(), ios::in | ios::binary);
|
||||
|
||||
if (!in)
|
||||
SC_REPORT_FATAL("Error loading file", ("Could not load textfile from " + pathToURI).c_str());
|
||||
|
||||
in.seekg(0, ios::end);
|
||||
initial.resize(in.tellg());
|
||||
in.seekg(0, ios::beg);
|
||||
in.read(&initial[0], initial.size());
|
||||
in.close();
|
||||
|
||||
executeSqlCommand(initial);
|
||||
}
|
||||
|
||||
void TlmRecorder::setUpTransactionTerminatingPhases()
|
||||
{
|
||||
transactionTerminatingPhases.push_back(END_RESP);
|
||||
@@ -480,12 +463,12 @@ void TlmRecorder::executeSqlStatement(sqlite3_stmt *statement)
|
||||
sqlite3_reset(statement);
|
||||
}
|
||||
|
||||
void TlmRecorder::executeSqlCommand(std::string command)
|
||||
void TlmRecorder::executeInitialSqlCommand()
|
||||
{
|
||||
PRINTDEBUGMESSAGE(name, "Creating database by running provided sql script");
|
||||
|
||||
char *errMsg = 0;
|
||||
int rc = sqlite3_exec(db, command.c_str(), NULL, 0, &errMsg);
|
||||
int rc = sqlite3_exec(db, initialCommand.c_str(), NULL, 0, &errMsg);
|
||||
if (rc != SQLITE_OK) {
|
||||
SC_REPORT_FATAL("SQLITE Error", errMsg);
|
||||
sqlite3_free(errMsg);
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
std::string sqlScriptURI;
|
||||
std::string dbName;
|
||||
|
||||
TlmRecorder(std::string name, std::string uri, std::string dbname);
|
||||
TlmRecorder(std::string name, std::string dbname);
|
||||
~TlmRecorder();
|
||||
|
||||
void recordMCconfig(std::string mcconfig)
|
||||
@@ -98,7 +98,8 @@ private:
|
||||
sc_time timeOfGeneration;
|
||||
TimeInterval timeOnDataStrobe;
|
||||
|
||||
struct Phase {
|
||||
struct Phase
|
||||
{
|
||||
Phase(std::string name, sc_time begin): name(name), interval(begin, SC_ZERO_TIME) {}
|
||||
std::string name;
|
||||
TimeInterval interval;
|
||||
@@ -114,11 +115,10 @@ private:
|
||||
std::string mcconfig, memspec, traces;
|
||||
|
||||
void prepareSqlStatements();
|
||||
void executeSqlCommand(std::string command);
|
||||
void executeInitialSqlCommand();
|
||||
void executeSqlStatement(sqlite3_stmt *statement);
|
||||
|
||||
void openDB(std::string name);
|
||||
void createTables(std::string pathToURI);
|
||||
void setUpTransactionTerminatingPhases();
|
||||
|
||||
void introduceTransactionSystem(tlm::tlm_generic_payload &trans);
|
||||
@@ -151,6 +151,119 @@ private:
|
||||
updatePhaseString, insertGeneralInfoString, insertCommandLengthsString,
|
||||
insertDebugMessageString, updateDataStrobeString, insertPowerString,
|
||||
insertBufferDepthString, insertBandwidthString;
|
||||
|
||||
std::string initialCommand =
|
||||
"DROP TABLE IF EXISTS Phases; \n"
|
||||
"DROP TABLE IF EXISTS GeneralInfo; \n"
|
||||
"DROP TABLE IF EXISTS CommandLengths; \n"
|
||||
"DROP TABLE IF EXISTS Comments; \n"
|
||||
"DROP TABLE IF EXISTS ranges; \n"
|
||||
"DROP TABLE IF EXISTS Transactions; \n"
|
||||
"DROP TABLE IF EXISTS DebugMessages; \n"
|
||||
"DROP TABLE IF EXISTS Power; \n"
|
||||
"DROP TABLE IF EXISTS BufferDepth; \n"
|
||||
"DROP TABLE IF EXISTS Bandwidth; \n"
|
||||
" \n"
|
||||
"CREATE TABLE Phases( \n"
|
||||
" ID INTEGER PRIMARY KEY, \n"
|
||||
" PhaseName TEXT, \n"
|
||||
" PhaseBegin INTEGER, \n"
|
||||
" PhaseEnd INTEGER, \n"
|
||||
" Transact INTEGER \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE GeneralInfo( \n"
|
||||
" NumberOfTransactions INTEGER, \n"
|
||||
" TraceEnd INTEGER, \n"
|
||||
" NumberOfRanks INTEGER, \n"
|
||||
" NumberOfBankgroups INTEGER, \n"
|
||||
" NumberOfBanks INTEGER, \n"
|
||||
" clk INTEGER, \n"
|
||||
" UnitOfTime TEXT, \n"
|
||||
" MCconfig TEXT, \n"
|
||||
" Memspec TEXT, \n"
|
||||
" Traces TEXT, \n"
|
||||
" WindowSize INTEGER, \n"
|
||||
" FlexibleRefresh INTEGER, \n"
|
||||
" MaxRefBurst INTEGER, \n"
|
||||
" ControllerThread INTEGER, \n"
|
||||
" MaxBufferDepth INTEGER \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE CommandLengths( \n"
|
||||
" NOP INTEGER, \n"
|
||||
" RD INTEGER, \n"
|
||||
" WR INTEGER, \n"
|
||||
" RDA INTEGER, \n"
|
||||
" WRA INTEGER, \n"
|
||||
" ACT INTEGER, \n"
|
||||
" PRE INTEGER, \n"
|
||||
" REFB INTEGER, \n"
|
||||
" PRESB INTEGER, \n"
|
||||
" REFSB INTEGER, \n"
|
||||
" PREA INTEGER, \n"
|
||||
" REFA INTEGER, \n"
|
||||
" PDEA INTEGER, \n"
|
||||
" PDXA INTEGER, \n"
|
||||
" PDEP INTEGER, \n"
|
||||
" PDXP INTEGER, \n"
|
||||
" SREFEN INTEGER, \n"
|
||||
" SREFEX INTEGER \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE Power( \n"
|
||||
" time DOUBLE, \n"
|
||||
" AveragePower DOUBLE \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE BufferDepth( \n"
|
||||
" Time DOUBLE, \n"
|
||||
" BufferNumber INTEGER, \n"
|
||||
" AverageBufferDepth DOUBLE \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE Bandwidth( \n"
|
||||
" Time DOUBLE, \n"
|
||||
" AverageBandwidth DOUBLE \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE Comments( \n"
|
||||
" Time INTEGER, \n"
|
||||
" Text TEXT \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE DebugMessages( \n"
|
||||
" Time INTEGER, \n"
|
||||
" Message TEXT \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)\n"
|
||||
"CREATE VIRTUAL TABLE ranges USING rtree( \n"
|
||||
" id, \n"
|
||||
" begin, end \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE TABLE Transactions( \n"
|
||||
" ID INTEGER, \n"
|
||||
" Range INTEGER, \n"
|
||||
" Address INTEGER, \n"
|
||||
" Burstlength INTEGER, \n"
|
||||
" TThread INTEGER, \n"
|
||||
" TChannel INTEGER, \n"
|
||||
" TRank INTEGER, \n"
|
||||
" TBankgroup INTEGER, \n"
|
||||
" TBank INTEGER, \n"
|
||||
" TRow INTEGER, \n"
|
||||
" TColumn INTEGER, \n"
|
||||
" DataStrobeBegin INTEGER, \n"
|
||||
" DataStrobeEnd INTEGER, \n"
|
||||
" TimeOfGeneration INTEGER, \n"
|
||||
" Command TEXT \n"
|
||||
"); \n"
|
||||
" \n"
|
||||
"CREATE INDEX ranges_index ON Transactions(Range); \n"
|
||||
"CREATE INDEX \"phasesTransactions\" ON \"Phases\" (\"Transact\" ASC); \n"
|
||||
"CREATE INDEX \"messageTimes\" ON \"DebugMessages\" (\"Time\" ASC); \n";
|
||||
};
|
||||
|
||||
#endif // TLMRECORDER_H
|
||||
|
||||
@@ -88,21 +88,17 @@ DRAMSysRecordable::~DRAMSysRecordable()
|
||||
delete rec;
|
||||
}
|
||||
|
||||
void DRAMSysRecordable::setupTlmRecorders(const std::string &traceName,
|
||||
const std::string &pathToResources)
|
||||
void DRAMSysRecordable::setupTlmRecorders(const std::string &traceName)
|
||||
{
|
||||
// Create TLM Recorders, one per channel.
|
||||
for (size_t i = 0; i < Configuration::getInstance().memSpec->numberOfChannels; i++)
|
||||
{
|
||||
std::string sqlScriptURI = pathToResources
|
||||
+ std::string("scripts/createTraceDB.sql");
|
||||
|
||||
std::string dbName = traceName + std::string("_ch") + std::to_string(i) + ".tdb";
|
||||
|
||||
std::string recorderName = "tlmRecorder" + std::to_string(i);
|
||||
|
||||
TlmRecorder *tlmRecorder =
|
||||
new TlmRecorder(recorderName, sqlScriptURI.c_str(), dbName.c_str());
|
||||
new TlmRecorder(recorderName, dbName.c_str());
|
||||
tlmRecorder->recordMCconfig(Configuration::getInstance().mcconfigUri);
|
||||
tlmRecorder->recordMemspec(Configuration::getInstance().memspecUri);
|
||||
|
||||
@@ -125,7 +121,7 @@ void DRAMSysRecordable::instantiateModules(const std::string &traceName,
|
||||
|
||||
// Create and properly initialize TLM recorders.
|
||||
// They need to be ready before creating some modules.
|
||||
setupTlmRecorders(traceName, pathToResources);
|
||||
setupTlmRecorders(traceName);
|
||||
|
||||
// Create new ECC Controller
|
||||
if (config.eccMode == Configuration::ECCMode::Hamming)
|
||||
|
||||
@@ -53,8 +53,7 @@ private:
|
||||
// They generate the output databases.
|
||||
std::vector<TlmRecorder *> tlmRecorders;
|
||||
|
||||
void setupTlmRecorders(const std::string &traceName,
|
||||
const std::string &pathToResources);
|
||||
void setupTlmRecorders(const std::string &traceName);
|
||||
|
||||
void instantiateModules(const std::string &traceName,
|
||||
const std::string &pathToResources,
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
DROP TABLE IF EXISTS Phases;
|
||||
DROP TABLE IF EXISTS GeneralInfo;
|
||||
DROP TABLE IF EXISTS CommandLengths;
|
||||
DROP TABLE IF EXISTS Comments;
|
||||
DROP TABLE IF EXISTS ranges;
|
||||
DROP TABLE IF EXISTS Transactions;
|
||||
DROP TABLE IF EXISTS DebugMessages;
|
||||
DROP TABLE IF EXISTS Power;
|
||||
DROP TABLE IF EXISTS BufferDepth;
|
||||
DROP TABLE IF EXISTS Bandwidth;
|
||||
|
||||
CREATE TABLE Phases(
|
||||
ID INTEGER PRIMARY KEY,
|
||||
PhaseName TEXT,
|
||||
PhaseBegin INTEGER,
|
||||
PhaseEnd INTEGER,
|
||||
Transact INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE GeneralInfo(
|
||||
NumberOfTransactions INTEGER,
|
||||
TraceEnd INTEGER,
|
||||
NumberOfRanks INTEGER,
|
||||
NumberOfBankgroups INTEGER,
|
||||
NumberOfBanks INTEGER,
|
||||
clk INTEGER,
|
||||
UnitOfTime TEXT,
|
||||
MCconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
WindowSize INTEGER,
|
||||
FlexibleRefresh INTEGER,
|
||||
MaxRefBurst INTEGER,
|
||||
ControllerThread INTEGER,
|
||||
MaxBufferDepth INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE CommandLengths(
|
||||
NOP INTEGER,
|
||||
RD INTEGER,
|
||||
WR INTEGER,
|
||||
RDA INTEGER,
|
||||
WRA INTEGER,
|
||||
ACT INTEGER,
|
||||
PRE INTEGER,
|
||||
REFB INTEGER,
|
||||
PRESB INTEGER,
|
||||
REFSB INTEGER,
|
||||
PREA INTEGER,
|
||||
REFA INTEGER,
|
||||
PDEA INTEGER,
|
||||
PDXA INTEGER,
|
||||
PDEP INTEGER,
|
||||
PDXP INTEGER,
|
||||
SREFEN INTEGER,
|
||||
SREFEX INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE Power(
|
||||
time DOUBLE,
|
||||
AveragePower DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE BufferDepth(
|
||||
Time DOUBLE,
|
||||
BufferNumber INTEGER,
|
||||
AverageBufferDepth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Bandwidth(
|
||||
Time DOUBLE,
|
||||
AverageBandwidth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Comments(
|
||||
Time INTEGER,
|
||||
Text TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE DebugMessages(
|
||||
Time INTEGER,
|
||||
Message TEXT
|
||||
);
|
||||
|
||||
-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)
|
||||
CREATE VIRTUAL TABLE ranges USING rtree(
|
||||
id,
|
||||
begin, end
|
||||
);
|
||||
|
||||
CREATE TABLE Transactions(
|
||||
ID INTEGER,
|
||||
Range INTEGER,
|
||||
Address INTEGER,
|
||||
Burstlength INTEGER,
|
||||
TThread INTEGER,
|
||||
TChannel INTEGER,
|
||||
TRank INTEGER,
|
||||
TBankgroup INTEGER,
|
||||
TBank INTEGER,
|
||||
TRow INTEGER,
|
||||
TColumn INTEGER,
|
||||
DataStrobeBegin INTEGER,
|
||||
DataStrobeEnd INTEGER,
|
||||
TimeOfGeneration INTEGER,
|
||||
Command TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX ranges_index ON Transactions(Range);
|
||||
CREATE INDEX "phasesTransactions" ON "Phases" ("Transact" ASC);
|
||||
CREATE INDEX "messageTimes" ON "DebugMessages" ("Time" ASC);
|
||||
@@ -1,111 +0,0 @@
|
||||
DROP TABLE IF EXISTS Phases;
|
||||
DROP TABLE IF EXISTS GeneralInfo;
|
||||
DROP TABLE IF EXISTS CommandLengths;
|
||||
DROP TABLE IF EXISTS Comments;
|
||||
DROP TABLE IF EXISTS ranges;
|
||||
DROP TABLE IF EXISTS Transactions;
|
||||
DROP TABLE IF EXISTS DebugMessages;
|
||||
DROP TABLE IF EXISTS Power;
|
||||
DROP TABLE IF EXISTS BufferDepth;
|
||||
DROP TABLE IF EXISTS Bandwidth;
|
||||
|
||||
CREATE TABLE Phases(
|
||||
ID INTEGER PRIMARY KEY,
|
||||
PhaseName TEXT,
|
||||
PhaseBegin INTEGER,
|
||||
PhaseEnd INTEGER,
|
||||
Transact INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE GeneralInfo(
|
||||
NumberOfTransactions INTEGER,
|
||||
TraceEnd INTEGER,
|
||||
NumberOfRanks INTEGER,
|
||||
NumberOfBankgroups INTEGER,
|
||||
NumberOfBanks INTEGER,
|
||||
clk INTEGER,
|
||||
UnitOfTime TEXT,
|
||||
MCconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
WindowSize INTEGER,
|
||||
FlexibleRefresh INTEGER,
|
||||
MaxRefBurst INTEGER,
|
||||
ControllerThread INTEGER,
|
||||
MaxBufferDepth INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE CommandLengths(
|
||||
NOP INTEGER,
|
||||
RD INTEGER,
|
||||
WR INTEGER,
|
||||
RDA INTEGER,
|
||||
WRA INTEGER,
|
||||
ACT INTEGER,
|
||||
PRE INTEGER,
|
||||
REFB INTEGER,
|
||||
PRESB INTEGER,
|
||||
REFSB INTEGER,
|
||||
PREA INTEGER,
|
||||
REFA INTEGER,
|
||||
PDEA INTEGER,
|
||||
PDXA INTEGER,
|
||||
PDEP INTEGER,
|
||||
PDXP INTEGER,
|
||||
SREFEN INTEGER,
|
||||
SREFEX INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE Power(
|
||||
time DOUBLE,
|
||||
AveragePower DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE BufferDepth(
|
||||
Time DOUBLE,
|
||||
BufferNumber INTEGER,
|
||||
AverageBufferDepth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Bandwidth(
|
||||
Time DOUBLE,
|
||||
AverageBandwidth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Comments(
|
||||
Time INTEGER,
|
||||
Text TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE DebugMessages(
|
||||
Time INTEGER,
|
||||
Message TEXT
|
||||
);
|
||||
|
||||
-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)
|
||||
CREATE VIRTUAL TABLE ranges USING rtree(
|
||||
id,
|
||||
begin, end
|
||||
);
|
||||
|
||||
CREATE TABLE Transactions(
|
||||
ID INTEGER,
|
||||
Range INTEGER,
|
||||
Address INTEGER,
|
||||
Burstlength INTEGER,
|
||||
TThread INTEGER,
|
||||
TChannel INTEGER,
|
||||
TRank INTEGER,
|
||||
TBankgroup INTEGER,
|
||||
TBank INTEGER,
|
||||
TRow INTEGER,
|
||||
TColumn INTEGER,
|
||||
DataStrobeBegin INTEGER,
|
||||
DataStrobeEnd INTEGER,
|
||||
TimeOfGeneration INTEGER,
|
||||
Command TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX ranges_index ON Transactions(Range);
|
||||
CREATE INDEX "phasesTransactions" ON "Phases" ("Transact" ASC);
|
||||
CREATE INDEX "messageTimes" ON "DebugMessages" ("Time" ASC);
|
||||
@@ -1,111 +0,0 @@
|
||||
DROP TABLE IF EXISTS Phases;
|
||||
DROP TABLE IF EXISTS GeneralInfo;
|
||||
DROP TABLE IF EXISTS CommandLengths;
|
||||
DROP TABLE IF EXISTS Comments;
|
||||
DROP TABLE IF EXISTS ranges;
|
||||
DROP TABLE IF EXISTS Transactions;
|
||||
DROP TABLE IF EXISTS DebugMessages;
|
||||
DROP TABLE IF EXISTS Power;
|
||||
DROP TABLE IF EXISTS BufferDepth;
|
||||
DROP TABLE IF EXISTS Bandwidth;
|
||||
|
||||
CREATE TABLE Phases(
|
||||
ID INTEGER PRIMARY KEY,
|
||||
PhaseName TEXT,
|
||||
PhaseBegin INTEGER,
|
||||
PhaseEnd INTEGER,
|
||||
Transact INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE GeneralInfo(
|
||||
NumberOfTransactions INTEGER,
|
||||
TraceEnd INTEGER,
|
||||
NumberOfRanks INTEGER,
|
||||
NumberOfBankgroups INTEGER,
|
||||
NumberOfBanks INTEGER,
|
||||
clk INTEGER,
|
||||
UnitOfTime TEXT,
|
||||
MCconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
WindowSize INTEGER,
|
||||
FlexibleRefresh INTEGER,
|
||||
MaxRefBurst INTEGER,
|
||||
ControllerThread INTEGER,
|
||||
MaxBufferDepth INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE CommandLengths(
|
||||
NOP INTEGER,
|
||||
RD INTEGER,
|
||||
WR INTEGER,
|
||||
RDA INTEGER,
|
||||
WRA INTEGER,
|
||||
ACT INTEGER,
|
||||
PRE INTEGER,
|
||||
REFB INTEGER,
|
||||
PRESB INTEGER,
|
||||
REFSB INTEGER,
|
||||
PREA INTEGER,
|
||||
REFA INTEGER,
|
||||
PDEA INTEGER,
|
||||
PDXA INTEGER,
|
||||
PDEP INTEGER,
|
||||
PDXP INTEGER,
|
||||
SREFEN INTEGER,
|
||||
SREFEX INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE Power(
|
||||
time DOUBLE,
|
||||
AveragePower DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE BufferDepth(
|
||||
Time DOUBLE,
|
||||
BufferNumber INTEGER,
|
||||
AverageBufferDepth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Bandwidth(
|
||||
Time DOUBLE,
|
||||
AverageBandwidth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Comments(
|
||||
Time INTEGER,
|
||||
Text TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE DebugMessages(
|
||||
Time INTEGER,
|
||||
Message TEXT
|
||||
);
|
||||
|
||||
-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)
|
||||
CREATE VIRTUAL TABLE ranges USING rtree(
|
||||
id,
|
||||
begin, end
|
||||
);
|
||||
|
||||
CREATE TABLE Transactions(
|
||||
ID INTEGER,
|
||||
Range INTEGER,
|
||||
Address INTEGER,
|
||||
Burstlength INTEGER,
|
||||
TThread INTEGER,
|
||||
TChannel INTEGER,
|
||||
TRank INTEGER,
|
||||
TBankgroup INTEGER,
|
||||
TBank INTEGER,
|
||||
TRow INTEGER,
|
||||
TColumn INTEGER,
|
||||
DataStrobeBegin INTEGER,
|
||||
DataStrobeEnd INTEGER,
|
||||
TimeOfGeneration INTEGER,
|
||||
Command TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX ranges_index ON Transactions(Range);
|
||||
CREATE INDEX "phasesTransactions" ON "Phases" ("Transact" ASC);
|
||||
CREATE INDEX "messageTimes" ON "DebugMessages" ("Time" ASC);
|
||||
@@ -1,111 +0,0 @@
|
||||
DROP TABLE IF EXISTS Phases;
|
||||
DROP TABLE IF EXISTS GeneralInfo;
|
||||
DROP TABLE IF EXISTS CommandLengths;
|
||||
DROP TABLE IF EXISTS Comments;
|
||||
DROP TABLE IF EXISTS ranges;
|
||||
DROP TABLE IF EXISTS Transactions;
|
||||
DROP TABLE IF EXISTS DebugMessages;
|
||||
DROP TABLE IF EXISTS Power;
|
||||
DROP TABLE IF EXISTS BufferDepth;
|
||||
DROP TABLE IF EXISTS Bandwidth;
|
||||
|
||||
CREATE TABLE Phases(
|
||||
ID INTEGER PRIMARY KEY,
|
||||
PhaseName TEXT,
|
||||
PhaseBegin INTEGER,
|
||||
PhaseEnd INTEGER,
|
||||
Transact INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE GeneralInfo(
|
||||
NumberOfTransactions INTEGER,
|
||||
TraceEnd INTEGER,
|
||||
NumberOfRanks INTEGER,
|
||||
NumberOfBankgroups INTEGER,
|
||||
NumberOfBanks INTEGER,
|
||||
clk INTEGER,
|
||||
UnitOfTime TEXT,
|
||||
MCconfig TEXT,
|
||||
Memspec TEXT,
|
||||
Traces TEXT,
|
||||
WindowSize INTEGER,
|
||||
FlexibleRefresh INTEGER,
|
||||
MaxRefBurst INTEGER,
|
||||
ControllerThread INTEGER,
|
||||
MaxBufferDepth INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE CommandLengths(
|
||||
NOP INTEGER,
|
||||
RD INTEGER,
|
||||
WR INTEGER,
|
||||
RDA INTEGER,
|
||||
WRA INTEGER,
|
||||
ACT INTEGER,
|
||||
PRE INTEGER,
|
||||
REFB INTEGER,
|
||||
PRESB INTEGER,
|
||||
REFSB INTEGER,
|
||||
PREA INTEGER,
|
||||
REFA INTEGER,
|
||||
PDEA INTEGER,
|
||||
PDXA INTEGER,
|
||||
PDEP INTEGER,
|
||||
PDXP INTEGER,
|
||||
SREFEN INTEGER,
|
||||
SREFEX INTEGER
|
||||
);
|
||||
|
||||
CREATE TABLE Power(
|
||||
time DOUBLE,
|
||||
AveragePower DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE BufferDepth(
|
||||
Time DOUBLE,
|
||||
BufferNumber INTEGER,
|
||||
AverageBufferDepth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Bandwidth(
|
||||
Time DOUBLE,
|
||||
AverageBandwidth DOUBLE
|
||||
);
|
||||
|
||||
CREATE TABLE Comments(
|
||||
Time INTEGER,
|
||||
Text TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE DebugMessages(
|
||||
Time INTEGER,
|
||||
Message TEXT
|
||||
);
|
||||
|
||||
-- use SQLITE R* TREE Module to make queries on timespans effecient (see http://www.sqlite.org/rtree.html)
|
||||
CREATE VIRTUAL TABLE ranges USING rtree(
|
||||
id,
|
||||
begin, end
|
||||
);
|
||||
|
||||
CREATE TABLE Transactions(
|
||||
ID INTEGER,
|
||||
Range INTEGER,
|
||||
Address INTEGER,
|
||||
Burstlength INTEGER,
|
||||
TThread INTEGER,
|
||||
TChannel INTEGER,
|
||||
TRank INTEGER,
|
||||
TBankgroup INTEGER,
|
||||
TBank INTEGER,
|
||||
TRow INTEGER,
|
||||
TColumn INTEGER,
|
||||
DataStrobeBegin INTEGER,
|
||||
DataStrobeEnd INTEGER,
|
||||
TimeOfGeneration INTEGER,
|
||||
Command TEXT
|
||||
);
|
||||
|
||||
CREATE INDEX ranges_index ON Transactions(Range);
|
||||
CREATE INDEX "phasesTransactions" ON "Phases" ("Transact" ASC);
|
||||
CREATE INDEX "messageTimes" ON "DebugMessages" ("Time" ASC);
|
||||
Reference in New Issue
Block a user