25 #include "boost/filesystem.hpp"
53 if (outputDir_[outputDir_.length()-1]!=
'/')
64 edm::LogInfo(
"L1GtConfigProducers") <<
"\n\nL1 GT VHDL directory: "
83 std::vector<ConditionMap> conditionMap = l1GtMenu->gtConditionMap();
87 int printVerbosity = 0;
88 l1GtMenu->print(
std::cout, printVerbosity);
93 std::map<std::string,std::string> headerParameters;
94 std::vector<std::string> channelVector;
96 headerParameters[
"vhdl_path"]=
"/vhdllibrarypath";
97 headerParameters[
"designer_date"]=
"20.05.1986";
98 headerParameters[
"designer_name"]=
"Philipp Wagner";
99 headerParameters[
"version"]=
"2.0";
100 headerParameters[
"designer_comments"]=
"produced in CMSSW";
101 headerParameters[
"gtl_setup_name"]=
"L1Menu2007NovGR";
103 channelVector.push_back(
"-- ca1: ieg");
104 channelVector.push_back(
"-- ca2: eg");
105 channelVector.push_back(
"-- ca3: jet");
106 channelVector.push_back(
"-- ca4: fwdjet");
107 channelVector.push_back(
"-- ca5: tau");
108 channelVector.push_back(
"-- ca6: esums");
109 channelVector.push_back(
"-- ca7: jet_cnts");
110 channelVector.push_back(
"-- ca8: free");
111 channelVector.push_back(
"-- ca9: free");
112 channelVector.push_back(
"-- ca10: free");
115 if (boost::filesystem::is_directory(
outputDir_))
117 std::cout<<std::endl<<
"Ok - Output directory exists!"<<std::endl;
130 if (vhdlWriter.
makeFirmware(conditionMap, algorithmMap))
133 <<
"*********************** I'm ready ;-) **************************"
134 <<std::endl <<std::endl
135 <<
"You can find the firmware in dircetory: " <<
outputDir_
136 <<std::endl <<std::endl
137 <<
"******************************************************************"
142 std::string vmeFile =
"vme.xml";
T getParameter(std::string const &) const
L1GtVhdlWriter(const edm::ParameterSet &)
constructor
std::string outputDir_
output directory
std::string vhdlDir_
templates directory
void writeVME(const std::vector< ConditionMap > &conditionMap, std::map< std::string, int > cond2intMap, L1GtVhdlTemplateFile header, const int spacesPerLevel=2)
bool makeFirmware(const std::vector< ConditionMap > &conditionMap, const AlgorithmMap &algorithmMap)
produces the firmware code
virtual void analyze(const edm::Event &, const edm::EventSetup &)
virtual ~L1GtVhdlWriter()
destructor
L1GtVhdlTemplateFile retrunCommonHeader()
returns the common header
std::map< std::string, int > getCond2IntMap()
void buildCommonHeader(std::map< std::string, std::string > &headerParameters, const std::vector< std::string > &connectedChannels)
builds the common header for all files