OpenASIP  2.0
Namespaces | Macros | Variables
HDBManager.cc File Reference
#include <string>
#include <sstream>
#include <list>
#include <map>
#include <boost/format.hpp>
#include "HDBManager.hh"
#include "FUEntry.hh"
#include "FUArchitecture.hh"
#include "FUImplementation.hh"
#include "FUPortImplementation.hh"
#include "FUExternalPort.hh"
#include "RFExternalPort.hh"
#include "RFArchitecture.hh"
#include "RFEntry.hh"
#include "RFImplementation.hh"
#include "RFPortImplementation.hh"
#include "BlockImplementationFile.hh"
#include "CostFunctionPlugin.hh"
#include "FunctionUnit.hh"
#include "FUPort.hh"
#include "HWOperation.hh"
#include "ExecutionPipeline.hh"
#include "PipelineElement.hh"
#include "SQLite.hh"
#include "RelationalDBQueryResult.hh"
#include "DataObject.hh"
#include "Application.hh"
#include "MapTools.hh"
#include "AssocTools.hh"
#include "SetTools.hh"
#include "FUValidator.hh"
#include "MachineValidatorResults.hh"
#include "Conversion.hh"
Include dependency graph for HDBManager.cc:

Go to the source code of this file.

Namespaces

 HDB
 

Macros

#define ALLOW_OPCODE_EDITING
 

Variables

const bool READ_ACTION = true
 
const bool WRITE_ACTION = false
 
const string IN_DIRECTION = "IN"
 
const string OUT_DIRECTION = "OUT"
 
const string BIDIR_DIRECTION = "BIDIR"
 
const string VHDL_FORMAT = "VHDL"
 
const string VERILOG_FORMAT = "Verilog"
 
const string VHDL_SIM_FORMAT = "VHDL simulation"
 
const string VERILOG_SIM_FORMAT = "Verilog simulation"
 
const int DEFAULT_PORT_WIDTH = 32
 
const std::string COST_PLUGIN_TYPE_FU = "fu"
 Possible cost function plugin types. More...
 
const std::string COST_PLUGIN_TYPE_RF = "rf"
 
const std::string COST_PLUGIN_TYPE_DECOMP = "decomp"
 
const std::string COST_PLUGIN_TYPE_ICDEC = "icdec"
 
const string CQ_FU
 
const string CQ_FU_ARCHITECTURE
 
const string CQ_PIPELINE_RESOURCE
 
const string CQ_OPERATION_PIPELINE
 
const string CQ_PIPELINE_RESOURCE_USAGE
 
const string CQ_IO_USAGE
 
const string CQ_OPERATION
 
const string CQ_FU_DATA_PORT
 
const string CQ_IO_BINDING
 
const string CQ_FU_IMPLEMENTATION
 
const string CQ_OPCODE_MAP
 
const string CQ_FU_PORT_MAP
 
const string CQ_FU_EXTERNAL_PORT
 
const string CQ_RF_EXTERNAL_PORT
 
const string CQ_FU_IMPLEMENTATION_PARAMETER
 
const string CQ_RF_IMPLEMENTATION_PARAMETER
 
const string CQ_FU_EXT_PORT_PARAMETER_DEPENDENCY
 
const string CQ_RF_EXT_PORT_PARAMETER_DEPENDENCY
 
const string CQ_RF
 
const string CQ_RF_ARCHITECTURE
 
const string CQ_RF_IMPLEMENTATION
 
const string CQ_RF_DATA_PORT
 
const string CQ_BLOCK_SOURCE_FILE
 
const string CQ_RF_SOURCE_FILE
 
const string CQ_FU_SOURCE_FILE
 
const string CQ_FORMAT
 
const string CQ_BUS
 
const string CQ_SOCKET
 
const string CQ_COST_FUNCTION_PLUGIN
 
const string CQ_COST_ESTIMATION_DATA
 type: {'fu'|'rf'|'decomp'|'icdec'} More...
 
const string CQ_FU_PORT_MAP_ARCH_INDEX
 
const string CQ_FU_IMPL_ENTRY_INDEX
 
const string CQ_RF_IMPL_ENTRY_INDEX
 
const string CQ_OPERATION_IMPLEMENTATION_RESOURCE_SOURCE_FILE
 
const string CQ_OPERATION_IMPLEMENTATION_SOURCE_FILE
 
const string CQ_OPERATION_IMPLEMENTATION_RESOURCE
 
const string CQ_OPERATION_IMPLEMENTATION
 
const string CQ_OPERATION_IMPLEMENTATION_RESOURCES
 
const string CQ_OPERATION_IMPLEMENTATION_VARIABLE
 

Detailed Description

Implementation of HDBManager class.

Author
Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
Esa Määttä 2007 (esa.maatta-no.spam-tut.fi)
Vinogradov Viacheslav(added Verilog generating) 2012
Note
rating: red

Definition in file HDBManager.cc.

Macro Definition Documentation

◆ ALLOW_OPCODE_EDITING

#define ALLOW_OPCODE_EDITING

Definition at line 80 of file HDBManager.cc.

Variable Documentation

◆ BIDIR_DIRECTION

const string BIDIR_DIRECTION = "BIDIR"

◆ COST_PLUGIN_TYPE_DECOMP

const std::string COST_PLUGIN_TYPE_DECOMP = "decomp"

◆ COST_PLUGIN_TYPE_FU

const std::string COST_PLUGIN_TYPE_FU = "fu"

◆ COST_PLUGIN_TYPE_ICDEC

const std::string COST_PLUGIN_TYPE_ICDEC = "icdec"

◆ COST_PLUGIN_TYPE_RF

const std::string COST_PLUGIN_TYPE_RF = "rf"

◆ CQ_BLOCK_SOURCE_FILE

const string CQ_BLOCK_SOURCE_FILE
Initial value:
=
"CREATE TABLE block_source_file("
" id INTEGER PRIMARY KEY,"
" file TEXT NOT NULL,"
" format REFERENCES format(id));"

Definition at line 281 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_BUS

const string CQ_BUS
Initial value:
=
"CREATE TABLE bus ("
" id INTEGER PRIMARY KEY);"

Definition at line 304 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_COST_ESTIMATION_DATA

const string CQ_COST_ESTIMATION_DATA
Initial value:
=
"CREATE TABLE cost_estimation_data("
" id INTEGER PRIMARY KEY, "
" plugin_reference REFERENCES cost_function_plugin(id), "
" rf_reference REFERENCES rf(id), "
" fu_reference REFERENCES fu(id), "
" bus_reference REFERENCES bus(id), "
" socket_reference REFERENCES socket(id), "
" name TEXT, "
" value TEXT);"

type: {'fu'|'rf'|'decomp'|'icdec'}

Definition at line 320 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_COST_FUNCTION_PLUGIN

const string CQ_COST_FUNCTION_PLUGIN
Initial value:
=
"CREATE TABLE cost_function_plugin("
" id INTEGER PRIMARY KEY, "
" description TEXT, "
" name TEXT, "
" plugin_file_path TEXT NOT NULL, "
" type STRING NOT NULL);"

Definition at line 312 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FORMAT

const string CQ_FORMAT
Initial value:
=
"CREATE TABLE format("
" id INTEGER PRIMARY KEY,"
" format TEXT NOT NULL);"

Definition at line 299 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU

const string CQ_FU
Initial value:
=
"CREATE TABLE fu ("
" id INTEGER PRIMARY KEY,"
" architecture REFERENCES fu_architecture(id),"
" cost_function REFERENCES cost_function_plugin(id));"

Definition at line 102 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_ARCHITECTURE

const string CQ_FU_ARCHITECTURE
Initial value:
=
"CREATE TABLE fu_architecture("
" id INTEGER PRIMARY KEY);"

Definition at line 108 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_DATA_PORT

const string CQ_FU_DATA_PORT
Initial value:
=
"CREATE TABLE fu_data_port("
" id INTEGER PRIMARY KEY,"
" triggers BOOLEAN NOT NULL,"
" sets_opcode BOOLEAN NOT NULL,"
" guard_support BOOLEAN NOT NULL,"
" width INTEGER,"
" fu_arch REFERENCES fu_architecture(id));"

Definition at line 143 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_EXT_PORT_PARAMETER_DEPENDENCY

const string CQ_FU_EXT_PORT_PARAMETER_DEPENDENCY
Initial value:
=
"CREATE TABLE fu_ext_port_parameter_dependency("
" id INTEGER PRIMARY KEY,"
" port REFERENCES fu_external_port(id) NOT NULL,"
" parameter REFERENCES fu_implementation_parameter(id) NOT NULL);"

Definition at line 224 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_EXTERNAL_PORT

const string CQ_FU_EXTERNAL_PORT
Initial value:
=
"CREATE TABLE fu_external_port("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" direction TEXT NOT NULL,"
" width_formula TEXT NOT NULL,"
" description TEXT,"
" fu_impl REFERENCES fu_implementation(id) NOT NULL, "
" UNIQUE (name, fu_impl));"

Definition at line 188 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_IMPL_ENTRY_INDEX

const string CQ_FU_IMPL_ENTRY_INDEX
Initial value:
=
"CREATE INDEX fu_impl_entry_index ON fu_implementation(fu)"

Definition at line 334 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_IMPLEMENTATION

const string CQ_FU_IMPLEMENTATION
Initial value:
=
"CREATE TABLE fu_implementation("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" opcode_port TEXT,"
" clk_port TEXT NOT NULL,"
" rst_port TEXT NOT NULL,"
" glock_port TEXT NOT NULL,"
" glock_req_port TEXT,"
" fu REFERENCES fu(id) UNIQUE NOT NULL);"

Definition at line 159 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_IMPLEMENTATION_PARAMETER

const string CQ_FU_IMPLEMENTATION_PARAMETER
Initial value:
=
"CREATE TABLE fu_implementation_parameter("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" type TEXT,"
" value TEXT,"
" fu_impl REFERENCES fu_implementation(id) NOT NULL);"

Definition at line 208 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_PORT_MAP

const string CQ_FU_PORT_MAP
Initial value:
=
"CREATE TABLE fu_port_map("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" width_formula TEXT NOT NULL,"
" load_port TEXT,"
" guard_port TEXT,"
" fu_impl REFERENCES fu_implementation(id) NOT NULL,"
" arch_port REFERENCES fu_data_port(id) NOT NULL,"
" UNIQUE (name, fu_impl));"

Definition at line 177 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_PORT_MAP_ARCH_INDEX

const string CQ_FU_PORT_MAP_ARCH_INDEX
Initial value:
=
"CREATE INDEX fu_port_map_arch_index ON fu_port_map(arch_port)"

Definition at line 331 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_FU_SOURCE_FILE

const string CQ_FU_SOURCE_FILE
Initial value:
=
"CREATE TABLE fu_source_file("
" id INTEGER PRIMARY KEY,"
" fu_impl REFERENCES fu_implementation(id),"
" file REFERENCES block_source_file(id));"

Definition at line 293 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_IO_BINDING

const string CQ_IO_BINDING
Initial value:
=
"CREATE TABLE io_binding("
" id INTEGER PRIMARY KEY,"
" io_number INTEGER NOT NULL,"
" port REFERENCES fu_data_port(id) NOT NULL,"
" operation REFERENCES operation(id) NOT NULL);"

Definition at line 152 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_IO_USAGE

const string CQ_IO_USAGE
Initial value:
=
"CREATE TABLE io_usage("
" id INTEGER PRIMARY KEY,"
" cycle INTEGER NOT NULL,"
" io_number INTEGER NOT NULL,"
" action BOOLEAN NOT NULL,"
" pipeline REFERENCES operation_pipeline(id) NOT NULL);"

Definition at line 130 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_OPCODE_MAP

const string CQ_OPCODE_MAP
Initial value:
=
"CREATE TABLE opcode_map("
" id INTEGER PRIMARY KEY,"
" opcode INTEGER NOT NULL,"
" operation REFERENCES operation(id) NOT NULL,"
" fu_impl REFERENCES fu_implementation(id) NOT NULL);"

Definition at line 170 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_OPERATION

const string CQ_OPERATION
Initial value:
=
"CREATE TABLE operation("
" id INTEGER PRIMARY KEY,"
" name TEXT UNIQUE NOT NULL);"

Definition at line 138 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_OPERATION_IMPLEMENTATION

const string CQ_OPERATION_IMPLEMENTATION
Initial value:
=
"CREATE TABLE operation_implementation("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL"
");"

Definition at line 360 of file HDBManager.cc.

Referenced by HDB::HDBManager::HDBManager().

◆ CQ_OPERATION_IMPLEMENTATION_RESOURCE

const string CQ_OPERATION_IMPLEMENTATION_RESOURCE
Initial value:
=
"CREATE TABLE operation_implementation_resource("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL"
");"

Definition at line 354 of file HDBManager.cc.

Referenced by HDB::HDBManager::HDBManager().

◆ CQ_OPERATION_IMPLEMENTATION_RESOURCE_SOURCE_FILE

const string CQ_OPERATION_IMPLEMENTATION_RESOURCE_SOURCE_FILE
Initial value:
=
"CREATE TABLE operation_implementation_resource_source_file("
" id INTEGER PRIMARY KEY,"
" resource REFERENCES operation_implementation_resource(id),"
" file REFERENCES block_source_file(id)"
");"

Definition at line 340 of file HDBManager.cc.

Referenced by HDB::HDBManager::HDBManager().

◆ CQ_OPERATION_IMPLEMENTATION_RESOURCES

const string CQ_OPERATION_IMPLEMENTATION_RESOURCES
Initial value:
=
"CREATE TABLE operation_implementation_resources("
" id INTEGER PRIMARY KEY,"
" operation REFERENCES operation_implementation(id),"
" resource REFERENCES operation_implementation_resource(id),"
" count INTEGER NOT NULL"
");"

Definition at line 366 of file HDBManager.cc.

Referenced by HDB::HDBManager::HDBManager().

◆ CQ_OPERATION_IMPLEMENTATION_SOURCE_FILE

const string CQ_OPERATION_IMPLEMENTATION_SOURCE_FILE
Initial value:
=
"CREATE TABLE operation_implementation_source_file("
" id INTEGER PRIMARY KEY,"
" operation REFERENCES operation_implementation(id),"
" file REFERENCES block_source_file(id)"
");"

Definition at line 347 of file HDBManager.cc.

Referenced by HDB::HDBManager::HDBManager().

◆ CQ_OPERATION_IMPLEMENTATION_VARIABLE

const string CQ_OPERATION_IMPLEMENTATION_VARIABLE
Initial value:
=
"CREATE TABLE operation_implementation_variable("
" id INTEGER PRIMARY KEY,"
" operation REFERENCES operation_implementation(id),"
" name TEXT NOT NULL,"
" width TEXT NOT NULL,"
" type TEXT NOT NULL,"
" language TEXT NOT NULL"
");"

Definition at line 374 of file HDBManager.cc.

Referenced by HDB::HDBManager::HDBManager().

◆ CQ_OPERATION_PIPELINE

const string CQ_OPERATION_PIPELINE
Initial value:
=
"CREATE TABLE operation_pipeline("
" id INTEGER PRIMARY KEY,"
" fu_arch REFERENCES fu_architecture(id) NOT NULL,"
" operation REFERENCES operation(id) NOT NULL);"

Definition at line 117 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_PIPELINE_RESOURCE

const string CQ_PIPELINE_RESOURCE
Initial value:
=
"CREATE TABLE pipeline_resource("
" id INTEGER PRIMARY KEY,"
" fu_arch REFERENCES fu_architecture(id) NOT NULL);"

Definition at line 112 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_PIPELINE_RESOURCE_USAGE

const string CQ_PIPELINE_RESOURCE_USAGE
Initial value:
=
"CREATE TABLE pipeline_resource_usage("
" id INTEGER PRIMARY KEY,"
" cycle INTEGER NOT NULL,"
" resource REFERENCES pipeline_resource(id) NOT NULL,"
" pipeline REFERENCES operation_pipeline(id) NOT NULL);"

Definition at line 123 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_RF

const string CQ_RF
Initial value:
=
"CREATE TABLE rf("
" id INTEGER PRIMARY KEY,"
" architecture REFERENCES rf_architecture(id),"
" cost_function REFERENCES cost_function_plugin(id));"

Definition at line 236 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_RF_ARCHITECTURE

const string CQ_RF_ARCHITECTURE
Initial value:
=
"CREATE TABLE rf_architecture("
" id INTEGER PRIMARY KEY,"
" size INTEGER,"
" width INTEGER,"
" read_ports INTEGER NOT NULL,"
" write_ports INTEGER NOT NULL,"
" bidir_ports INTEGER NOT NULL,"
" latency INTEGER NOT NULL,"
" max_reads INTEGER NOT NULL,"
" max_writes INTEGER NOT NULL,"
" guard_support BOOLEAN NOT NULL,"
" guard_latency INTEGER NOT NULL,"
" zero_register BOOLEAN DEFAULT FALSE);"

Definition at line 242 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_RF_DATA_PORT

const string CQ_RF_DATA_PORT
Initial value:
=
"CREATE TABLE rf_data_port("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" direction TEXT NOT NULL,"
" load_port TEXT NOT NULL,"
" opcode_port TEXT NOT NULL,"
" opcode_port_width_formula TEXT NOT NULL,"
" rf_impl REFERENCES rf_implementation(id),"
" UNIQUE (name, rf_impl));"

Definition at line 270 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_RF_EXT_PORT_PARAMETER_DEPENDENCY

const string CQ_RF_EXT_PORT_PARAMETER_DEPENDENCY
Initial value:
=
"CREATE TABLE rf_ext_port_parameter_dependency("
" id INTEGER PRIMARY KEY,"
" port REFERENCES rf_external_port(id) NOT NULL,"
" parameter REFERENCES rf_implementation_parameter(id) NOT NULL);"

Definition at line 230 of file HDBManager.cc.

Referenced by HDB::HDBManager::addRFImplementation(), and HDB::HDBManager::createNew().

◆ CQ_RF_EXTERNAL_PORT

const string CQ_RF_EXTERNAL_PORT
Initial value:
=
"CREATE TABLE rf_external_port("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" direction TEXT NOT NULL,"
" width_formula TEXT NOT NULL,"
" description TEXT,"
" rf_impl REFERENCES rf_implementation(id) NOT NULL, "
" UNIQUE (name, rf_impl));"

Definition at line 198 of file HDBManager.cc.

Referenced by HDB::HDBManager::addRFImplementation(), and HDB::HDBManager::createNew().

◆ CQ_RF_IMPL_ENTRY_INDEX

const string CQ_RF_IMPL_ENTRY_INDEX
Initial value:
=
"CREATE INDEX rf_impl_entry_index ON rf_implementation(rf)"

Definition at line 337 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_RF_IMPLEMENTATION

const string CQ_RF_IMPLEMENTATION
Initial value:
=
"CREATE TABLE rf_implementation("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" size_param TEXT,"
" width_param TEXT,"
" clk_port TEXT NOT NULL,"
" rst_port TEXT NOT NULL,"
" glock_port TEXT NOT NULL,"
" guard_port TEXT,"
" rf REFERENCES rf(id) NOT NULL,"
" sac_param INTEGER DEFAULT 0);"

Definition at line 257 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_RF_IMPLEMENTATION_PARAMETER

const string CQ_RF_IMPLEMENTATION_PARAMETER
Initial value:
=
"CREATE TABLE rf_implementation_parameter("
" id INTEGER PRIMARY KEY,"
" name TEXT NOT NULL,"
" type TEXT,"
" value TEXT,"
" rf_impl REFERENCES rf_implementation(id) NOT NULL);"

Definition at line 216 of file HDBManager.cc.

Referenced by HDB::HDBManager::addRFImplementation(), and HDB::HDBManager::createNew().

◆ CQ_RF_SOURCE_FILE

const string CQ_RF_SOURCE_FILE
Initial value:
=
"CREATE TABLE rf_source_file("
" id INTEGER PRIMARY KEY,"
" rf_impl REFERENCES rf_implementation(id),"
" file REFERENCES block_source_file(id));"

Definition at line 287 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ CQ_SOCKET

const string CQ_SOCKET
Initial value:
=
"CREATE TABLE socket ("
" id INTEGER PRIMARY KEY);"

Definition at line 308 of file HDBManager.cc.

Referenced by HDB::HDBManager::createNew().

◆ DEFAULT_PORT_WIDTH

const int DEFAULT_PORT_WIDTH = 32

Definition at line 93 of file HDBManager.cc.

Referenced by HDB::HDBManager::addPortsAndBindingsToFUArchitecture().

◆ IN_DIRECTION

const string IN_DIRECTION = "IN"

◆ OUT_DIRECTION

const string OUT_DIRECTION = "OUT"

◆ READ_ACTION

const bool READ_ACTION = true

◆ VERILOG_FORMAT

const string VERILOG_FORMAT = "Verilog"

◆ VERILOG_SIM_FORMAT

const string VERILOG_SIM_FORMAT = "Verilog simulation"

◆ VHDL_FORMAT

const string VHDL_FORMAT = "VHDL"

◆ VHDL_SIM_FORMAT

const string VHDL_SIM_FORMAT = "VHDL simulation"

◆ WRITE_ACTION

const bool WRITE_ACTION = false