From 7bd24c5e17175044edef7e26297705a927677767 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 21 Nov 2020 22:44:01 +0300 Subject: [PATCH 001/181] Added basic dbcscanner core code. --- DbcScanner.vcxproj | 168 +++++++++++++++++ DbcScanner.vcxproj.filters | 42 +++++ src/dbclineparser.cpp | 365 +++++++++++++++++++++++++++++++++++++ src/dbclineparser.h | 77 ++++++++ src/dbcscanner.cpp | 210 +++++++++++++++++++++ src/dbcscanner.h | 35 ++++ src/types/attributes.h | 24 +++ src/types/comment.h | 29 +++ src/types/message.h | 97 ++++++++++ 9 files changed, 1047 insertions(+) create mode 100644 DbcScanner.vcxproj create mode 100644 DbcScanner.vcxproj.filters create mode 100644 src/dbclineparser.cpp create mode 100644 src/dbclineparser.h create mode 100644 src/dbcscanner.cpp create mode 100644 src/dbcscanner.h create mode 100644 src/types/attributes.h create mode 100644 src/types/comment.h create mode 100644 src/types/message.h diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj new file mode 100644 index 0000000..58ab02d --- /dev/null +++ b/DbcScanner.vcxproj @@ -0,0 +1,168 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {7fbe11bf-78a5-4c47-b5d0-323c00075e19} + DbcScanner + 10.0 + + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + true + Unicode + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + true + + + + + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + pch.h + + + + + true + true + true + + + + + Level3 + true + _DEBUG;_LIB;%(PreprocessorDefinitions) + true + NotUsing + pch.h + + + + + true + + + + + Level3 + true + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + true + Use + pch.h + + + + + true + true + true + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters new file mode 100644 index 0000000..fcd836c --- /dev/null +++ b/DbcScanner.vcxproj.filters @@ -0,0 +1,42 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/src/dbclineparser.cpp b/src/dbclineparser.cpp new file mode 100644 index 0000000..c8d7d99 --- /dev/null +++ b/src/dbclineparser.cpp @@ -0,0 +1,365 @@ +#include "dbclineparser.h" +#include + +// Message line definitions +static const std::string regMessage = "[^A-Za-z0-9_.-]"; +static const std::string MessageLineStart = "BO_ "; + +// Signal line definitions +static const std::string kRegSigReceivers = "[^A-Za-z0-9_.+-]+"; +static const std::string kRegSigSplit0 = "[^\\w]+"; +static const std::string kRegSigSplit1 = "(\\s+:\\s+)"; +static const std::string kregSigSplit2 = "(\")"; + +// This reg splits line to parts delimited by (") +static const std::string kRegCommMain = "\""; +static const std::string kRegCommMeta = "[ ]+"; + +// This reg splits line to parts (for attributes) +static const std::string kRegAttrMain = "[^A-Za-z0-9_\.]+"; + + +static uint64_t __maxvalues[] = +{ + UCHAR_MAX, + USHRT_MAX, + UINT_MAX, + ULLONG_MAX +}; + +static int __typeslen[] = { 8, 16, 32, 64 }; + +std::vector resplit(const std::string& s, const std::string& rgx_str) +{ + std::vector elems; + std::regex rgx(rgx_str); + std::sregex_token_iterator iter(s.begin(), s.end(), rgx, -1); + std::sregex_token_iterator end; + + while (iter != end) + { + //std::cout << "S43:" << *iter << std::endl; + elems.push_back(*iter); + ++iter; + } + + return elems; +} + +std::string& ltrim(std::string& str, const std::string& chars = "\t\n\v\f\r ") +{ + str.erase(0, str.find_first_not_of(chars)); + return str; +} + +std::string& rtrim(std::string& str, const std::string& chars = "\t\n\v\f\r ") +{ + str.erase(str.find_last_not_of(chars) + 1); + return str; +} + +std::string& trim(std::string& str, const std::string& chars = "\t\n\v\f\r ") +{ + return ltrim(rtrim(str, chars), chars); +} + +static uint32_t clear_msgid(uint32_t messageid) +{ + return messageid & 0x1FFFFFFFU; +} + +DbcLineParser::DbcLineParser() +{ +} + +bool DbcLineParser::IsMessageLine(const std::string& line) +{ + if (line.find(MessageLineStart) == 0) + return true; + + return false; +} + +bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string& line) +{ + // Parse DBC message line + auto items = resplit(line, regMessage); + + if (items.size() < 5) + return false; + + msg->Transmitter = (items.size() >= 6) ? (items[5]) : (""); + + msg->Name = items[2]; + + msg->MsgID = static_cast(atoi(items[1].c_str())); + + msg->DLC = atoi(items[4].c_str()); + + if ((msg->MsgID & 0x60000000) != 0 || msg->DLC == 0 || msg->DLC > 8) + { + return false; + } + + msg->IsExt = ((uint8_t)(msg->MsgID >> 29) & 0x04) == 0x04 ? 1 : 0; + + msg->MsgID = clear_msgid(msg->MsgID); + + return true; +} + +bool DbcLineParser::IsSignalLine(const std::string& line) +{ + const std::regex sigMatch("\\s+SG_"); + bool ret = std::regex_search(line, sigMatch); + return ret; +} + +bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& line) +{ + // split line in two parts + auto halfs = resplit(line, kRegSigSplit1); + + if (halfs.size() < 2) + return false; + + // split tail + auto tailpart = resplit(halfs[1], kregSigSplit2); + + // split middle part on dedicated values + auto valpart = resplit(trim(tailpart[0]), kRegSigReceivers); + + halfs = resplit(halfs[0], kRegSigSplit0); + + if (halfs.size() > 1) + { + sig->Name = halfs[halfs.size() - 1]; + } + else + { + // TODO: handle wrong split + return false; + } + + if (valpart.size() < 7) + { + return false; + } + else + { + sig->StartBit = atoi(valpart[0].c_str()); + sig->LengthBit = atoi(valpart[1].c_str()); + + // factor = double; + // offset = double; + //The factorand offset define the linear conversion rule to convert the signals raw + //value into the signal's physical value and vice versa: + // physical_value = raw_value * factor + offset + // raw_value = (physical_value � offset) / factor + sig->Factor = atof(valpart[3].c_str()); + sig->Offset = atof(valpart[4].c_str()); + + sig->RawOffset = static_cast(sig->Offset / sig->Factor); + + sig->MinValue = atof(valpart[5].c_str()); + sig->MaxValue = atof(valpart[6].c_str()); + + + //The signal_size specifies the size of the signal in bits + // byte_order = '0' | '1'; (*0 = little endian, 1 = big endian*) + sig->Order = (valpart[2].find('1') == -1) ? BitLayout::kMotorolla : BitLayout::kIntel; + + //The byte_format is 0 if the signal's byte order is Intel (little endian) or 1 if the byte + //order is Motorola(big endian). + // value_type = '+' | '-'; (*+= unsigned, -=signed*) + sig->Signed = (valpart[2].find('-') == -1) ? 0 : 1; + + sig->Type = GetSigType(sig); + } + + if (tailpart.size() == 3) + { + // part 1 went on valpart + // part 2 is the measure unit + sig->Unit = tailpart[1]; + // part 3 is the list of RX modules + auto recs = resplit(trim(tailpart[2]), kRegSigReceivers); + + for (size_t i = 0; i < recs.size(); i++) + { + sig->RecS.push_back(recs[i]); + } + } + else + { + return false; + } + + return true; +} + +// TODO: refactor algorythm detection type of signal +SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) +{ + SigType ret = SigType::u64; + + auto len = sig->LengthBit; + + uint8_t is_unsigned = 0; + + int64_t roffset = (int64_t)(sig->Offset / sig->Factor); + + if (!sig->Signed) + { + uint64_t maxval = 0; + + if (sig->LengthBit <= 32) + { + if (roffset >= 0) + { + // this only unsinged case + maxval = (uint64_t)(std::pow(2, sig->LengthBit) - 1 + roffset); + is_unsigned = 1; + } + else + { + uint64_t maxpos = (uint64_t)(std::pow(2, sig->LengthBit + 1) - 1); + uint64_t maxneg = (uint64_t)(std::abs(roffset * 2)); + maxval = std::max(maxpos, maxneg); + } + + for (uint8_t i = 0; i < 4; i++) + { + if (maxval <= __maxvalues[i]) + { + ret = (SigType)(i + (is_unsigned * 4)); + break; + } + } + } + else + { + is_unsigned = 1; + } + } + else + { + for (uint8_t i = 0; i < 4; i++) + { + if (len <= __typeslen[i]) + { + ret = (SigType)(i + (is_unsigned * 4)); + break; + } + } + } + + return ret; +} + +bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line) +{ + bool ret = false; + + if (line.size() > 0) + { + if (line.find("CM_") == 0) + { + commentline.clear(); + commentline = line; + } + else if (commentline.size() > 0) + { + // next part of comment line, add to previously saved + commentline += '\n' + line; + } + + // check if the current line last + if (commentline.size() > 0 && line.back() == ';') + { + // set invalid target type as default return value + cm->ca_target = CommentTarget::Undefined; + + // comment line must have 3 part: meta, text, semicolon + auto items = resplit(commentline, kRegCommMain); + + if (items.size() == 3) + { + // part 1 (meta) contains service fields + auto meta = resplit(items[0], kRegCommMeta); + + if (meta.size() >= 3) + { + // 1 CM_ marker + // 2 target (message or signal) + // 3 msg id + uint32_t id = ((uint32_t)(atoi(meta[2].c_str()))); + + // clear message id from high 3 bits + cm->MsgId = clear_msgid(id); + + if (meta[1] == "SG_" && meta.size() == 4) + { + // signal comment + cm->ca_target = CommentTarget::Signal; + cm->SigName = meta[3]; + } + else if (meta[1] == "BO_") + { + // message comment + cm->ca_target = CommentTarget::Message; + } + + // copy comment text + cm->Text = items[1]; + } + + ret = true; + } + + commentline.clear(); + } + } + + return ret; +} + +bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::string& line) +{ + bool ret = false; + + if (line.size() > 0) + { + if (line.find("BA_ ") == 0) + { + attribline.clear(); + attribline = line; + } + else if (attribline.size() > 0) + { + attribline += line; + } + + // check if the current line is last + if (attribline.size() > 0 && line.back() == ';') + { + attr->Type = AttributeType::Undefined; + // raw line is ready + auto items = resplit(attribline, kRegAttrMain); + + if (items.size() > 4 && items[1] == "GenMsgCycleTime" + && items[2] == "BO_") + { + attr->Type = AttributeType::CycleTime; + attr->MsgId = clear_msgid(atoi(items[3].c_str())); + // read value of ms of cycle time for the current message + attr->Value = atoi(items[4].c_str()); + ret = true; + } + + attribline.clear(); + } + } + + return ret; +} diff --git a/src/dbclineparser.h b/src/dbclineparser.h new file mode 100644 index 0000000..c9a1572 --- /dev/null +++ b/src/dbclineparser.h @@ -0,0 +1,77 @@ +#pragma once + +#include +#include "types/message.h" + +//Information from official vector DBC format spec: +// +//The keywords used in DBC files o identify the type of an object are given in the +//following table : +//Keyword Object Type +// BU_ Network Node +// BO_ Message +// SG_ Signal +// EV_ Environment Variable +// +//The signal_size specifies the size of the signal in bits +//byte_order = '0' | '1'; (*0 = little endian, 1 = big endian*) +// +//The byte_format is 0 if the signal's byte order is Intel (little endian) or 1 if the byte +//order is Motorola(big endian). +//value_type = '+' | '-'; (*+= unsigned, -=signed*) +// +// +//The value_type defines the signal as being of type unsigned(-) or signed(-). +//factor = double; +//offset = double; +//The factorand offset define the linear conversion rule to convert the signals raw +//value into the signal's physical value and vice versa: +//physical_value = raw_value * factor + offset +//raw_value = (physical_value � offset) / factor +//As can be seen in the conversion rule formulas the factor must not be 0. +//minimum = double; +//maximum = double; + +//The comment section contains the object comments.For each object having a +//comment, an entry with the object's type identification is defined in this section. +//comments = { comment }; +//comment = 'CM_' (char_string | +// 'BU_' node_name char_string | +// 'BO_' message_id char_string | +// 'SG_' message_id signal_name char_string | +// 'EV_' env_var_name char_string) +// ';'; + +class DbcLineParser { + public: + DbcLineParser(); + + // checks if the line is message description + bool IsMessageLine(const std::string& line); + // parses message line + bool ParseMessageLine(MessageDescriptor_t* msg, const std::string& line = ""); + + // checks if the line is signal description + bool IsSignalLine(const std::string& line); + // parses signal line + bool ParseSignalLine(SignalDescriptor_t* sig, const std::string& line); + + // tries to parse attribute line (or a few lines) and + // loads result in attr struct, return @true if parsed ok + bool ParseAttributeLine(AttributeDescriptor_t* attr, const std::string& line); + + // tries to parse comment information in line (or a few lines) + // and loads result to cm struct, return @true if parsed ok + bool ParseCommentLine(Comment_t* cm, const std::string& line); + + private: + // defines the type for the message struct member + SigType GetSigType(SignalDescriptor_t* sig); + + // string to collect comment dbc line + std::string commentline; + + // string to collect attribute dbc line + std::string attribline; +}; + diff --git a/src/dbcscanner.cpp b/src/dbcscanner.cpp new file mode 100644 index 0000000..135552d --- /dev/null +++ b/src/dbcscanner.cpp @@ -0,0 +1,210 @@ +#include "dbcscanner.h" +#include +#include + +#define MAX_LINE 256 + +char line[MAX_LINE] = { 0 }; + +MessageDescriptor_t* find_message(vector msgs, uint32_t ID) +{ + MessageDescriptor_t* ret = nullptr; + + if (msgs.size() == 0) + return ret; + + for (size_t i = 0; i < msgs.size(); i++) + { + ret = msgs[i]; + + if (ret->MsgID == ID) + // Frame found + break; + } + + return ret; +} + +DbcScanner::DbcScanner() +{ +} + +DbcScanner::~DbcScanner() +{ +} + +int32_t DbcScanner::TrimDbcText(istream& readstrm) +{ + msgs.clear(); + + // Search each message and signals in dbc source data, + // and fill @msgs collection + ParseMessageInfo(readstrm); + + // all the messages and signals were read from source + // scan it one more time to define all attributes and + // more additional information + readstrm.clear(); + readstrm.seekg(0); + + // Search all attributes and additional information + // and update specific fields in messages + ParseOtherInfo(readstrm); + + return 0; +} + + +void DbcScanner::ParseMessageInfo(istream& readstrm) +{ + std::string sline; + + MessageDescriptor_t* pMsg = nullptr; + + while (readstrm.eof() == false) + { + readstrm.getline(line, MAX_LINE); + + sline = line; + + // New message line has been found + if (lparser.IsMessageLine(sline)) + { + // check if the pMsg takes previous message + AddMessage(pMsg); + + // create instance for the detected message + pMsg = new MessageDescriptor_t; + + if (!lparser.ParseMessageLine(pMsg, sline)) + { + // the message has invalid format so drop it and wait next one + delete pMsg; + pMsg = nullptr; + } + } + + if (pMsg != nullptr && lparser.IsSignalLine(sline)) + { + SignalDescriptor_t sig; + + // parse signal line + if (lparser.ParseSignalLine(&sig, sline)) + { + // put successfully parsed signal to the message signals + pMsg->Signals.push_back(sig); + } + } + } + + // check if the pMsg takes previous message + AddMessage(pMsg); +} + + +void DbcScanner::ParseOtherInfo(istream& readstrm) +{ + std::string sline; + + Comment_t cmmnt; + + AttributeDescriptor_t attr; + + while (!readstrm.eof()) + { + readstrm.getline(line, MAX_LINE); + + sline = line; + + if (lparser.ParseCommentLine(&cmmnt, sline)) + { + uint32_t found_msg_id = cmmnt.MsgId; + + // update message comment field + auto msg = find_message(msgs, cmmnt.MsgId); + + if (msg != nullptr) + { + // comment line was found + if (cmmnt.ca_target == CommentTarget::Message) + { + // put comment to message descriptor + msg->CommentText = cmmnt.Text; + } + else if (cmmnt.ca_target == CommentTarget::Signal) + { + for (size_t i = 0; i < msg->Signals.size(); i++) + { + if (cmmnt.SigName == msg->Signals[i].Name) + { + // signal has been found, update commnet text + msg->Signals[i].CommentText = cmmnt.Text; + } + } + } + } + } + + if (lparser.ParseAttributeLine(&attr, sline)) + { + auto msg = find_message(msgs, attr.MsgId); + + if (msg != nullptr) + { + // message was found, set attribute value + if (attr.Type == AttributeType::CycleTime) + { + msg->Cycle = attr.Value; + } + } + } + } +} + + +void DbcScanner::AddMessage(MessageDescriptor_t* message) +{ + if (message != nullptr) + { + if (message->Signals.size() > 0) + { + // sort signals by start bit + std::sort(message->Signals.begin(), message->Signals.end(), + [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool + { + return a.StartBit < b.StartBit; + }); + + for (size_t i = 0; i < message->Signals.size(); i++) + { + for (size_t j = 0; j < message->Signals[i].RecS.size(); j++) + { + string val = message->Signals[i].RecS[j]; + + if (std::find(message->RecS.begin(), message->RecS.end(), val) == message->RecS.end()) + { + // add another one RX node + message->RecS.push_back(val); + } + } + } + } + + // save pointer on message + msgs.push_back(message); + } +} + + +void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) +{ + message->CommentText = ""; + message->Cycle = 0; + message->DLC = 0; + message->IsExt = false; + message->MsgID = 0; + message->Name = ""; + message->RecS.clear(); + message->Signals.clear(); + message->Transmitter = ""; +} diff --git a/src/dbcscanner.h b/src/dbcscanner.h new file mode 100644 index 0000000..f8cad50 --- /dev/null +++ b/src/dbcscanner.h @@ -0,0 +1,35 @@ +#pragma once + +#include +#include +#include +#include "types/message.h" +#include "dbclineparser.h" + +using namespace std; + +class DbcScanner { + public: + DbcScanner(); + ~DbcScanner(); + + std::vector msgs; + + // Trim makes dbc source data analyze and returns count of + // found CAN messages. + int32_t TrimDbcText(istream& instrm); + + private: + + void ParseMessageInfo(istream& instrm); + void ParseOtherInfo(istream& instrm); + + void AddMessage(MessageDescriptor_t* message); + + void SetDefualtMessage(MessageDescriptor_t* message); + + private: + + DbcLineParser lparser; + +}; diff --git a/src/types/attributes.h b/src/types/attributes.h new file mode 100644 index 0000000..796ee43 --- /dev/null +++ b/src/types/attributes.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include + +enum class AttributeType +{ + CycleTime, + Undefined +}; + +typedef struct +{ + // message id of the attribute + uint32_t MsgId; + + // value of the comment from line + AttributeType Type; + + // attribute value + int32_t Value; + +} AttributeDescriptor_t; diff --git a/src/types/comment.h b/src/types/comment.h new file mode 100644 index 0000000..34527b3 --- /dev/null +++ b/src/types/comment.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include + +enum class CommentTarget +{ + Message, + Signal, + Undefined +}; + +typedef struct +{ + + // CAN ID to which comment is belongs (in case of message targeting) + uint32_t MsgId; + + // name of signal of the CAN Frame to whick comment is belong (in case + // of signal targeting + std::string SigName; + + // type of the comment in attribute line (message or signal) + CommentTarget ca_target; + + // value of the comment from line + std::string Text; + +} Comment_t; diff --git a/src/types/message.h b/src/types/message.h new file mode 100644 index 0000000..d6a2828 --- /dev/null +++ b/src/types/message.h @@ -0,0 +1,97 @@ +#pragma once + +#include +#include +#include +#include +#include "attributes.h" +#include "comment.h" + +enum class BitLayout +{ + kIntel = 0, + kMotorolla +}; + +enum class SigType +{ + i8 = 0, + i16, + i32, + i64, + u8, + u16, + u32, + u64 +}; + + +typedef struct +{ + // Signal name + std::string Name; + + // Unit + std::string Unit; + + uint32_t StartBit; + + uint8_t LengthBit; + + double Factor; + + double Offset; + + int32_t RawOffset; + + BitLayout Order; + + bool Signed; + + SigType Type; + + std::vector SigToByte; + + double MinValue; + + double MaxValue; + + std::vector RecS; + + std::string CommentText; + + std::string ValueText; + +} SignalDescriptor_t; + +typedef struct +{ + + // Pointer on message name + std::string Name; + + // Value of message length in bytes + uint8_t DLC; + + // Message CAN identifier + uint32_t MsgID; + + // Extended frame type mark, if 0 then standart frame + uint8_t IsExt; + + // Frame cycle time im ms + uint32_t Cycle; + + // Name of transmitter ECU + std::string Transmitter; + + // List of ECUs to receive frame + std::vector RecS; + + // List of Message signals + std::vector Signals; + + // Message comment + std::string CommentText; + +} MessageDescriptor_t; From ab769a9824b7caaadf41cf076f41a0977a5a043d Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 22 Nov 2020 22:30:17 +0300 Subject: [PATCH 002/181] Added value table parsing. --- src/dbclineparser.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++ src/dbclineparser.h | 7 ++++++ src/dbcscanner.cpp | 37 +++++++++++++++++++++++++---- 3 files changed, 95 insertions(+), 4 deletions(-) diff --git a/src/dbclineparser.cpp b/src/dbclineparser.cpp index c8d7d99..6ea20f6 100644 --- a/src/dbclineparser.cpp +++ b/src/dbclineparser.cpp @@ -18,6 +18,7 @@ static const std::string kRegCommMeta = "[ ]+"; // This reg splits line to parts (for attributes) static const std::string kRegAttrMain = "[^A-Za-z0-9_\.]+"; +static const std::string kRegValTable = "\""; static uint64_t __maxvalues[] = { @@ -363,3 +364,57 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s return ret; } + +bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) +{ + bool ret = false; + + if (line.size() > 0) + { + if (line.find("VAL_ ") == 0) + { + valueline.clear(); + valueline = line; + } + else if (valueline.size() > 0) + { + valueline += line; + } + + // check if the current line is last + if (valueline.size() > 0 && line.back() == ';') + { + // split all line by quote char + auto items = resplit(valueline, kRegValTable); + + if (items.size() >= 2) + { + // split first part by spaces, the last item will have first value key + auto meta = resplit(items[0], kRegCommMeta); + + if (meta.size() == 4) + { + // ok, set items[0] -> meta[3] (set value key as first @items element) + items[0] = meta[3]; + + comm->MsgId = (clear_msgid(atoi(meta[1].c_str()))); + + comm->SigName = meta[2]; + // Load value table params to container + comm->Text = ""; + + for (size_t valpair = 0; valpair < (items.size() / 2); valpair++) + { + comm->Text += items[valpair * 2 + 0] + " : "; + comm->Text += items[valpair * 2 + 1] + "\n"; + } + + // value table params were parse successfully + ret = true; + } + } + } + } + + return ret; +} diff --git a/src/dbclineparser.h b/src/dbclineparser.h index c9a1572..83d70dc 100644 --- a/src/dbclineparser.h +++ b/src/dbclineparser.h @@ -64,6 +64,10 @@ class DbcLineParser { // and loads result to cm struct, return @true if parsed ok bool ParseCommentLine(Comment_t* cm, const std::string& line); + // tries to parse value table string in line + // and load result to attr ValueStr, return true if parsed ok + bool ParseValTableLine(Comment_t* cm, const std::string& line); + private: // defines the type for the message struct member SigType GetSigType(SignalDescriptor_t* sig); @@ -73,5 +77,8 @@ class DbcLineParser { // string to collect attribute dbc line std::string attribline; + + // strign to collect value line + std::string valueline; }; diff --git a/src/dbcscanner.cpp b/src/dbcscanner.cpp index 135552d..c40c6fd 100644 --- a/src/dbcscanner.cpp +++ b/src/dbcscanner.cpp @@ -145,6 +145,35 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) } } + if (lparser.ParseValTableLine(&cmmnt, sline)) + { + uint32_t found_msg_id = cmmnt.MsgId; + + // update message comment field + auto msg = find_message(msgs, cmmnt.MsgId); + + if (msg != nullptr) + { + // comment line was found + if (cmmnt.ca_target == CommentTarget::Message) + { + // put comment to message descriptor + msg->CommentText = cmmnt.Text; + } + else if (cmmnt.ca_target == CommentTarget::Signal) + { + for (size_t i = 0; i < msg->Signals.size(); i++) + { + if (cmmnt.SigName == msg->Signals[i].Name) + { + // signal has been found, update commnet text + msg->Signals[i].ValueText = cmmnt.Text; + } + } + } + } + } + if (lparser.ParseAttributeLine(&attr, sline)) { auto msg = find_message(msgs, attr.MsgId); @@ -170,10 +199,10 @@ void DbcScanner::AddMessage(MessageDescriptor_t* message) { // sort signals by start bit std::sort(message->Signals.begin(), message->Signals.end(), - [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool - { - return a.StartBit < b.StartBit; - }); + [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool + { + return a.StartBit < b.StartBit; + }); for (size_t i = 0; i < message->Signals.size(); i++) { From 6350af48373f31af38ca37115fe6314668430372 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Nov 2020 10:11:47 +0300 Subject: [PATCH 003/181] Code dir migration. --- src/{ => parser}/dbclineparser.cpp | 0 src/{ => parser}/dbclineparser.h | 2 +- src/{ => parser}/dbcscanner.cpp | 0 src/{ => parser}/dbcscanner.h | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) rename src/{ => parser}/dbclineparser.cpp (100%) rename src/{ => parser}/dbclineparser.h (98%) rename src/{ => parser}/dbcscanner.cpp (100%) rename src/{ => parser}/dbcscanner.h (95%) diff --git a/src/dbclineparser.cpp b/src/parser/dbclineparser.cpp similarity index 100% rename from src/dbclineparser.cpp rename to src/parser/dbclineparser.cpp diff --git a/src/dbclineparser.h b/src/parser/dbclineparser.h similarity index 98% rename from src/dbclineparser.h rename to src/parser/dbclineparser.h index 83d70dc..d0400b0 100644 --- a/src/dbclineparser.h +++ b/src/parser/dbclineparser.h @@ -1,7 +1,7 @@ #pragma once #include -#include "types/message.h" +#include "../types/message.h" //Information from official vector DBC format spec: // diff --git a/src/dbcscanner.cpp b/src/parser/dbcscanner.cpp similarity index 100% rename from src/dbcscanner.cpp rename to src/parser/dbcscanner.cpp diff --git a/src/dbcscanner.h b/src/parser/dbcscanner.h similarity index 95% rename from src/dbcscanner.h rename to src/parser/dbcscanner.h index f8cad50..6276282 100644 --- a/src/dbcscanner.h +++ b/src/parser/dbcscanner.h @@ -3,7 +3,7 @@ #include #include #include -#include "types/message.h" +#include "../types/message.h" #include "dbclineparser.h" using namespace std; From 45a85ac7c40e93a9f9dd6d46b6b34dfbdd2f2d7a Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Nov 2020 10:12:28 +0300 Subject: [PATCH 004/181] Added sig-expression and sig-printer base code. --- DbcScanner.vcxproj | 11 ++++++---- DbcScanner.vcxproj.filters | 21 +++++++++++++------ src/codegen/c-sigprinter.cpp | 40 ++++++++++++++++++++++++++++++++++++ src/codegen/c-sigprinter.h | 20 ++++++++++++++++++ src/types/c-expr.h | 20 ++++++++++++++++++ 5 files changed, 102 insertions(+), 10 deletions(-) create mode 100644 src/codegen/c-sigprinter.cpp create mode 100644 src/codegen/c-sigprinter.h create mode 100644 src/types/c-expr.h diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj index 58ab02d..9313915 100644 --- a/DbcScanner.vcxproj +++ b/DbcScanner.vcxproj @@ -152,15 +152,18 @@ - - + + + + - - + + + diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters index fcd836c..fa471b9 100644 --- a/DbcScanner.vcxproj.filters +++ b/DbcScanner.vcxproj.filters @@ -18,24 +18,33 @@ Header Files - + Header Files - + Header Files - + Header Files - + + Header Files + + + Header Files + + Header Files - + + Source Files + + Source Files - + Source Files diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp new file mode 100644 index 0000000..24736ce --- /dev/null +++ b/src/codegen/c-sigprinter.cpp @@ -0,0 +1,40 @@ +#include "c-sigprinter.h" + + +CSigPrinter::CSigPrinter() +{ +} + +CSigPrinter::~CSigPrinter() +{ +} + +void CSigPrinter::AddMessage(const std::vector message) +{ + sigs_expr.clear(); + + for (size_t i = 0; i < message.size(); i++) + { + AddMessage(*(message[i])); + } +} + +void CSigPrinter::AddMessage(const MessageDescriptor_t& message) +{ + CiExpr_t* nexpr = new CiExpr_t; + + nexpr->msg = message; + + // do for this new expr to_byte and to_field expression building, + // add them to dedicated members, set signal stdint type + // and push it to vector + + sigs_expr.push_back(nexpr); +} + +std::string CSigPrinter::GetSignalType(const SignalDescriptor_t& signal) +{ + std::string ret = ""; + + return ret; +} diff --git a/src/codegen/c-sigprinter.h b/src/codegen/c-sigprinter.h new file mode 100644 index 0000000..bdec899 --- /dev/null +++ b/src/codegen/c-sigprinter.h @@ -0,0 +1,20 @@ +#pragma once + +#include "../types/c-expr.h" + +class CSigPrinter +{ +public: + CSigPrinter(); + ~CSigPrinter(); + + void AddMessage(const MessageDescriptor_t& message); + void AddMessage(const std::vector message); + +public: + std::vector sigs_expr; + +private: + std::string GetSignalType(const SignalDescriptor_t& signal); + +}; diff --git a/src/types/c-expr.h b/src/types/c-expr.h new file mode 100644 index 0000000..98dfebf --- /dev/null +++ b/src/types/c-expr.h @@ -0,0 +1,20 @@ +#pragma once + +#include +#include "message.h" +#include +#include + +typedef struct { + + MessageDescriptor_t msg; + + // this field contains all expressions for converting + // data bytes to actual signals + std::vector to_signals; + + // this field contains all expressions for converting + // frame fields to data bytes + std::vector to_bytes; + +} CiExpr_t; \ No newline at end of file From 4915ed195f67c2b17469b64e44fb02b289e0760e Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Nov 2020 11:58:18 +0300 Subject: [PATCH 005/181] Added core signals/message expression printer code. --- src/codegen/c-sigprinter.cpp | 173 +++++++++++++++++++++++++++++++++++ src/codegen/c-sigprinter.h | 6 ++ 2 files changed, 179 insertions(+) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 24736ce..330a8a9 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -1,12 +1,25 @@ #include "c-sigprinter.h" +// work buffer for all snprintf operations +static const size_t WBUFF_LEN = 2048; +static char workbuff[WBUFF_LEN] = { 0 }; + +// additional templates for expression generation +static std::string msk[] = { "0", "0x01U", "0x03U", "0x07U", "0x0FU", "0x1FU", "0x3FU", "0x7FU", "0xFFU" }; + +static inline int32_t ShiftByte(const SignalDescriptor_t* sig, int32_t bn) +{ + return (sig->Order == BitLayout::kIntel) ? (bn - 1) : (bn + 1); +} CSigPrinter::CSigPrinter() { + sigs_expr.clear(); } CSigPrinter::~CSigPrinter() { + sigs_expr.clear(); } void CSigPrinter::AddMessage(const std::vector message) @@ -29,12 +42,172 @@ void CSigPrinter::AddMessage(const MessageDescriptor_t& message) // add them to dedicated members, set signal stdint type // and push it to vector + BuildCConvertExprs(nexpr); + sigs_expr.push_back(nexpr); } +// This function determines what type will have struct +// field for the @signal. It saves the name std::string CSigPrinter::GetSignalType(const SignalDescriptor_t& signal) { std::string ret = ""; return ret; } + +int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msg) +{ + int32_t ret = 0; + std::string tmpstr; + + msg->to_bytes.clear(); + msg->to_signals.clear(); + msg->to_bytes.resize(msg->msg.DLC); + + // for each signal specific to_signal expression must be defined, + // and during all signals processing, for each byte to_byte expression + // must be collected + + for (size_t i = 0; i < msg->msg.Signals.size(); i++) + { + // there are two main goal of this code: + // 1 - to generate bytes to signal C-expression, (_d - name of array). + // For each signal there is only one byte reference. It's generated + // once each function call for each signal + // + // 2 - to generate signals to each byte expression, (_m - name of struct with + // signals). For each byte a 8 signals can be referenced. It's generated + // consequently signal after signal (by adding chunks of expressions to @to_bytes + // collection) + // + // signal expression is saved to vector @to_signals, which id must be + // fully correlated to id of target signal. the final size of + // @to_signals vector must be equal to size of Signals vector + // + // bytes expression is saved to vector @to_bytes, where id is the + // byte number in frame payload (i.e. to_bytes.size() == frame.DLC) + msg->to_signals.push_back(PrintSignalExpr(&msg->msg.Signals[i], msg->to_bytes)); + } + + return ret; +} + +std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, + std::vector& to_bytes) +{ + // value for collecting expression (to_signal) + std::string tosigexpr; + + uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? + (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); + + if (startb > 63) + startb = 63; + + int32_t bn = startb / 8; + + // set valid to_byte prefix + int32_t bbc = (startb % 8) + 1; + int32_t slen = sig->LengthBit; + + if (bbc > slen) + { + snprintf(workbuff, WBUFF_LEN, "((_d[%d] >> %d) & (%s))", bn, bbc - slen, msk[slen].c_str()); + tosigexpr += workbuff; + + snprintf(workbuff, WBUFF_LEN, "((_m->{%s} & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), + bbc - slen); + AppendToByteLine(to_bytes[bn], workbuff); + } + else if (bbc == slen) + { + // no rolling bits + snprintf(workbuff, WBUFF_LEN, "(_d[%d] & (%s))", bn, msk[slen].c_str()); + tosigexpr += workbuff; + + snprintf(workbuff, WBUFF_LEN, "(_m->%s & (%s))", sig->Name.c_str(), msk[slen].c_str()); + AppendToByteLine(to_bytes[bn], workbuff); + } + else + { + std::string t64 = ""; + slen -= bbc; + + if (slen > 31) + { + t64 = "(uint64_t)"; + } + + snprintf(workbuff, WBUFF_LEN, "(%s_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[bbc].c_str(), slen); + tosigexpr += workbuff; + + snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, + msk[bbc].c_str()); + AppendToByteLine(to_bytes[bn], workbuff); + + while ((slen - 8) >= 0) + { + t64.clear(); + + slen -= 8; + + bn = ShiftByte(sig, bn); + + tosigexpr += " | "; + + if (slen == 0) + { + // last byte is aligned + snprintf(workbuff, WBUFF_LEN, "(_d[%d] & (%s))", bn, msk[8].c_str()); + tosigexpr += workbuff; + + snprintf(workbuff, WBUFF_LEN, "(_m->%s & (%s))", sig->Name.c_str(), msk[8].c_str()); + AppendToByteLine(to_bytes[bn], workbuff); + + } + else + { + if (slen > 31) + { + t64 = "(uint64_t)"; + } + + snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[8].c_str(), slen); + tosigexpr += workbuff; + + + snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, msk[8].c_str()); + AppendToByteLine(to_bytes[bn], workbuff); + } + } + + if (slen > 0) + { + bn = ShiftByte(sig, bn); + + snprintf(workbuff, WBUFF_LEN, " | ((_d[%d] >> %d) & (%s))", bn, 8 - slen, msk[slen].c_str()); + tosigexpr += workbuff; + + snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), + 8 - slen); + AppendToByteLine(to_bytes[bn], workbuff); + } + } + + return tosigexpr; +} + +void CSigPrinter::AppendToByteLine(std::string& expr, std::string str) +{ + if (expr.size() > 0) + { + // Not first appendingF + expr += " | " + str; + } + else + { + // First appending + expr = str; + } +} \ No newline at end of file diff --git a/src/codegen/c-sigprinter.h b/src/codegen/c-sigprinter.h index bdec899..4e3e652 100644 --- a/src/codegen/c-sigprinter.h +++ b/src/codegen/c-sigprinter.h @@ -17,4 +17,10 @@ class CSigPrinter private: std::string GetSignalType(const SignalDescriptor_t& signal); + int32_t BuildCConvertExprs(CiExpr_t* msg); + + std::string PrintSignalExpr(SignalDescriptor_t* sig, std::vector& to_bytes); + + void AppendToByteLine(std::string& expr, std::string str); + }; From 44e2db26f78396231001961d003a712db3a82b09 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Nov 2020 14:45:56 +0300 Subject: [PATCH 006/181] Added offset calculation in to_signal expression. --- src/codegen/c-sigprinter.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 330a8a9..8c7c4ec 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -1,3 +1,4 @@ +#include #include "c-sigprinter.h" // work buffer for all snprintf operations @@ -176,7 +177,6 @@ std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[8].c_str(), slen); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, msk[8].c_str()); AppendToByteLine(to_bytes[bn], workbuff); } @@ -195,6 +195,17 @@ std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, } } + if (sig->Offset < 0) + { + snprintf(workbuff, WBUFF_LEN, "(%s) - %d", tosigexpr.c_str(), abs(sig->RawOffset)); + tosigexpr = workbuff; + } + else if (sig->Offset > 0) + { + snprintf(workbuff, WBUFF_LEN, "(%s) + %d", tosigexpr.c_str(), abs(sig->RawOffset)); + tosigexpr = workbuff; + } + return tosigexpr; } @@ -210,4 +221,4 @@ void CSigPrinter::AppendToByteLine(std::string& expr, std::string str) // First appending expr = str; } -} \ No newline at end of file +} From 26cf3f3212a19e813437e0df7119c8bf4a56bd0c Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Nov 2020 22:12:57 +0300 Subject: [PATCH 007/181] SigPrinter minor refactoring. Income Msgs as const. --- src/codegen/c-sigprinter.cpp | 20 ++++++++++---------- src/codegen/c-sigprinter.h | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 8c7c4ec..8957864 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -23,17 +23,17 @@ CSigPrinter::~CSigPrinter() sigs_expr.clear(); } -void CSigPrinter::AddMessage(const std::vector message) +void CSigPrinter::LoadMessages(const std::vector message) { sigs_expr.clear(); for (size_t i = 0; i < message.size(); i++) { - AddMessage(*(message[i])); + LoadMessage(*(message[i])); } } -void CSigPrinter::AddMessage(const MessageDescriptor_t& message) +void CSigPrinter::LoadMessage(const MessageDescriptor_t& message) { CiExpr_t* nexpr = new CiExpr_t; @@ -94,14 +94,14 @@ int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msg) return ret; } -std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, - std::vector& to_bytes) +std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, + std::vector& to_bytes) { // value for collecting expression (to_signal) std::string tosigexpr; uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? - (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); + (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); if (startb > 63) startb = 63; @@ -118,7 +118,7 @@ std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->{%s} & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), - bbc - slen); + bbc - slen); AppendToByteLine(to_bytes[bn], workbuff); } else if (bbc == slen) @@ -144,7 +144,7 @@ std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, - msk[bbc].c_str()); + msk[bbc].c_str()); AppendToByteLine(to_bytes[bn], workbuff); while ((slen - 8) >= 0) @@ -190,7 +190,7 @@ std::string CSigPrinter::PrintSignalExpr(SignalDescriptor_t* sig, tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), - 8 - slen); + 8 - slen); AppendToByteLine(to_bytes[bn], workbuff); } } @@ -221,4 +221,4 @@ void CSigPrinter::AppendToByteLine(std::string& expr, std::string str) // First appending expr = str; } -} +} \ No newline at end of file diff --git a/src/codegen/c-sigprinter.h b/src/codegen/c-sigprinter.h index 4e3e652..7274fa3 100644 --- a/src/codegen/c-sigprinter.h +++ b/src/codegen/c-sigprinter.h @@ -8,8 +8,8 @@ class CSigPrinter CSigPrinter(); ~CSigPrinter(); - void AddMessage(const MessageDescriptor_t& message); - void AddMessage(const std::vector message); + void LoadMessage(const MessageDescriptor_t& message); + void LoadMessages(const std::vector message); public: std::vector sigs_expr; @@ -19,7 +19,7 @@ class CSigPrinter int32_t BuildCConvertExprs(CiExpr_t* msg); - std::string PrintSignalExpr(SignalDescriptor_t* sig, std::vector& to_bytes); + std::string PrintSignalExpr(const SignalDescriptor_t* sig, std::vector& to_bytes); void AppendToByteLine(std::string& expr, std::string str); From 7b1350081e939fe1d7d8927a27bfa7a533011cf6 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Nov 2020 22:17:48 +0300 Subject: [PATCH 008/181] Added minimal struct of main code generator. --- DbcScanner.vcxproj | 8 ++++ DbcScanner.vcxproj.filters | 15 +++++++ src/codegen/c-main-generator.cpp | 75 ++++++++++++++++++++++++++++++++ src/codegen/c-main-generator.h | 26 +++++++++++ src/codegen/filewriter.cpp | 30 +++++++++++++ src/codegen/filewriter.h | 34 +++++++++++++++ src/types/outfile.h | 14 ++++++ 7 files changed, 202 insertions(+) create mode 100644 src/codegen/c-main-generator.cpp create mode 100644 src/codegen/c-main-generator.h create mode 100644 src/codegen/filewriter.cpp create mode 100644 src/codegen/filewriter.h create mode 100644 src/types/outfile.h diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj index 9313915..dbdea32 100644 --- a/DbcScanner.vcxproj +++ b/DbcScanner.vcxproj @@ -125,6 +125,7 @@ true NotUsing pch.h + stdcpp17 @@ -152,19 +153,26 @@ + + + + + + + diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters index fa471b9..9140e49 100644 --- a/DbcScanner.vcxproj.filters +++ b/DbcScanner.vcxproj.filters @@ -36,6 +36,15 @@ Header Files + + Header Files + + + Header Files + + + Header Files + @@ -47,5 +56,11 @@ Source Files + + Source Files + + + + \ No newline at end of file diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp new file mode 100644 index 0000000..0685a1d --- /dev/null +++ b/src/codegen/c-main-generator.cpp @@ -0,0 +1,75 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "c-main-generator.h" + +static const size_t kMaxDirNum = 1000; + +static const size_t kWBUFF_len = 2048; +static char wbuff[kWBUFF_len] = { 0 }; + +CiMainGenerator::CiMainGenerator() +{ + sigprt = new CSigPrinter; +} + +void CiMainGenerator::Generate(std::vector& msgs, std::string drvname, std::string dirpath) +{ + // Load income messages to sig printer + sigprt->LoadMessages(msgs); + + std::sort(sigprt->sigs_expr.begin(), sigprt->sigs_expr.end(), + [](const CiExpr_t* a, const CiExpr_t* b) -> bool + { + return a->msg.MsgID < b->msg.MsgID; + }); + + SetFinalPath(dirpath); + // 1 step is to define final directory for source code bunch + + // 2 step is to print main head file + + // 3 step is to print main source file + + // 4 step is to pring fmon head file + + // 5 step is to print fmon source file + +} + +bool CiMainGenerator::SetFinalPath(std::string dirpath) +{ + // find free directory + struct stat info; + + for (int32_t dirnum = 0; dirnum < 1000; dirnum++) + { + snprintf(wbuff, kWBUFF_len, "%03d", dirnum); + work_dir_path = dirpath + "/" + wbuff; + + if (stat(work_dir_path.c_str(), &info) != 0) + { + if (std::filesystem::create_directory(work_dir_path)) + return true; + else + return false; + } + else if (info.st_mode & S_IFDIR) + { + // directory exists, try next num + continue; + } + else + { + if (std::filesystem::create_directory(work_dir_path) != 0) + return false; + } + } + + return true; +} diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h new file mode 100644 index 0000000..402412f --- /dev/null +++ b/src/codegen/c-main-generator.h @@ -0,0 +1,26 @@ +#pragma once + +#include +#include "c-sigprinter.h" +#include "../types/message.h" + +class CiMainGenerator +{ +public: + CiMainGenerator(); + + void Generate(std::vector& msgs, std::string drvname, std::string dirpath); + +private: + + bool SetFinalPath(std::string dirpath); + +private: + + std::string work_dir_path; + + std::string workstr; + + CSigPrinter* sigprt; + +}; diff --git a/src/codegen/filewriter.cpp b/src/codegen/filewriter.cpp new file mode 100644 index 0000000..9113dd2 --- /dev/null +++ b/src/codegen/filewriter.cpp @@ -0,0 +1,30 @@ +#include "filewriter.h" + +void FileWriter::Flush() +{ + strm.clear(); +} + +void FileWriter::AppendText(const char* text, size_t len) +{ + strm.write(text, len); +} + +void FileWriter::AppendLine(const char* text, size_t len) +{ + AppendText(text, len); + AppendText("\n", 1); +} + + +void FileWriter::AppendText(const std::string& str) +{ + strm.str(str); +} + +void FileWriter::AppendLine(const std::string& str) +{ + AppendText(str); + AppendText("\n", 1); +} + diff --git a/src/codegen/filewriter.h b/src/codegen/filewriter.h new file mode 100644 index 0000000..bae6391 --- /dev/null +++ b/src/codegen/filewriter.h @@ -0,0 +1,34 @@ +#pragma once + +#include + +#include +#include + +class FileWriter +{ +public: + + FileWriter(); + ~FileWriter(); + + void Flush(); + void AppendText(const char* text, size_t len); + void AppendLine(const char* text, size_t len); + + void AppendText(const std::string& str); + void AppendLine(const std::string& str); + +private: + + std::stringstream strm; + +}; + +FileWriter::FileWriter() +{ +} + +FileWriter::~FileWriter() +{ +} \ No newline at end of file diff --git a/src/types/outfile.h b/src/types/outfile.h new file mode 100644 index 0000000..068d2bc --- /dev/null +++ b/src/types/outfile.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + +typedef struct +{ + std::string dir; + + std::string fpath; + + std::string fname; + +} OutFileDescriptor_t; From 14f7017aae61b43ab874deb15c53dc920b73a968 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 7 Dec 2020 12:57:33 +0300 Subject: [PATCH 009/181] Added part of main .h file writer. Added filewriter. --- src/codegen/c-main-generator.cpp | 214 +++++++++++++++++++++++++++++-- src/codegen/c-main-generator.h | 43 +++++-- src/codegen/filewriter.cpp | 45 +++++-- src/codegen/filewriter.h | 32 ++--- 4 files changed, 284 insertions(+), 50 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 0685a1d..da5c28a 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -5,41 +5,223 @@ #include #include #include +#include #include "c-main-generator.h" static const size_t kMaxDirNum = 1000; static const size_t kWBUFF_len = 2048; -static char wbuff[kWBUFF_len] = { 0 }; +static char wbuff[kWBUFF_len] = {0}; + +static std::string __typeprint[] = +{ + "int8_t", + "int16_t", + "int32_t", + "int64_t", + "uint8_t", + "uint16_t", + "uint32_t", + "uint64_t" +}; + +std::string str_toupper(std::string s) +{ + std::transform(s.begin(), s.end(), s.begin(), + [](unsigned char c) + { + return std::toupper(c); + }); + return s; +} CiMainGenerator::CiMainGenerator() { sigprt = new CSigPrinter; + fwriter = new FileWriter; } -void CiMainGenerator::Generate(std::vector& msgs, std::string drvname, std::string dirpath) +void CiMainGenerator::Generate(std::vector& msgs, + std::string drvname, + std::string dirpath) { - // Load income messages to sig printer + // Load income messages to sig printer sigprt->LoadMessages(msgs); std::sort(sigprt->sigs_expr.begin(), sigprt->sigs_expr.end(), - [](const CiExpr_t* a, const CiExpr_t* b) -> bool - { - return a->msg.MsgID < b->msg.MsgID; - }); + [](const CiExpr_t* a, const CiExpr_t* b) -> bool + { + return a->msg.MsgID < b->msg.MsgID; + }); + + auto dirok = SetFinalPath(dirpath); + + if (!dirok) + { + // TODO: handle error if directory cannot be used + } + + SetCommonValues(drvname); + + // work_dir_path has the base dir path to gen files + mhead.dir = work_dir_path; + mhead.fname = drvname + ".h"; + mhead.fpath = mhead.dir + "/" + mhead.fname; - SetFinalPath(dirpath); // 1 step is to define final directory for source code bunch + fwriter->AppendLine("#pragma once", 3); + fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); + fwriter->AppendLine("#include "); + + for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + { + // write message typedef s and additional expressions + MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + + snprintf(wbuff, kWBUFF_len, "// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID); + fwriter->AppendLine(wbuff); + snprintf(wbuff, kWBUFF_len, "#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt); + fwriter->AppendLine(wbuff); + snprintf(wbuff, kWBUFF_len, "#define %s_DLC (%uU)", m.Name.c_str(), m.DLC); + fwriter->AppendLine(wbuff); + snprintf(wbuff, kWBUFF_len, "#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID); + fwriter->AppendLine(wbuff); + + if (m.Cycle > 0) + { + snprintf(wbuff, kWBUFF_len, "#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle); + fwriter->AppendLine(wbuff); + } + + if (m.CommentText.size() > 0) + { + fwriter->AppendLine("// -- " + m.CommentText); + } + + size_t max_sig_name_len = 27; + + for (size_t signum = 0; signum < m.Signals.size(); signum++) + { + SignalDescriptor_t& s = m.Signals[signum]; + + // TODO: print signal to_S and from_S definitions if necessary + //string ret = cprint.PrintSignalPackExpression(sig, msg.MessageName); + + //if (ret != null) + //{ + // fwriter->AppendLine(ret); + //} + if (s.Name.size() > max_sig_name_len) + max_sig_name_len = s.Name.size(); + } + + snprintf(wbuff, kWBUFF_len, "typedef struct"); + fwriter->AppendLine(wbuff); + + fwriter->AppendLine("{\n"); + + // Write section for bitfielded part + snprintf(wbuff, kWBUFF_len, "#ifdef %s", usebits_str.c_str()); + fwriter->AppendLine(wbuff, 2); + + for (size_t signum = 0; signum < m.Signals.size(); signum++) + { + SignalDescriptor_t& sig = m.Signals[signum]; + // Write bit-fielded part + WriteSigStructField(sig, true, max_sig_name_len); + } + + // Write clean part + fwriter->AppendLine("#else", 2); + + for (size_t signum = 0; signum < m.Signals.size(); signum++) + { + SignalDescriptor_t& sig = m.Signals[signum]; + // Write clean signals + WriteSigStructField(sig, false, max_sig_name_len); + } + + snprintf(wbuff, kWBUFF_len, "#endif // %s", usebits_str.c_str()); + fwriter->AppendLine(wbuff, 2); + //if (CodeSett.Code.UseMonitors == 1) + // fwriter->AppendLine(" FrameMonitor_t mon1;"); + + snprintf(wbuff, kWBUFF_len, "} %s_t;", m.Name.c_str()); + fwriter->AppendLine(wbuff, 2); + //fwriter->AppendLine("} " + msg.MessageName + "_t;"); + //fwriter->AppendLine(); + } + + fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); + fwriter->Flush(mhead.fpath); // 2 step is to print main head file - + // 3 step is to print main source file // 4 step is to pring fmon head file // 5 step is to print fmon source file +} + +void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) +{ + if (sig.CommentText.size() > 0) + { + fwriter->AppendLine(" // " + std::regex_replace(sig.CommentText, std::regex("\n"), "\n // ")); + } + + if (sig.ValueText.size() > 0) + { + fwriter->AppendLine(" // " + std::regex_replace(sig.ValueText, std::regex("\n"), "\n // ")); + } + + std::string dtype = ""; + + dtype += " " + __typeprint[(int)sig.Type] + " " + sig.Name; + + if (bits && (sig.LengthBit < 8)) + { + snprintf(wbuff, kWBUFF_len, " : %d", sig.LengthBit); + dtype += wbuff; + } + + dtype += ";"; + + std::string pad = " "; + + dtype += pad.insert(0, padwidth + 16 - dtype.size(), ' '); + fwriter->AppendText(dtype); + + pad = " // "; + pad += (sig.Signed) ? " [-]" : " "; + + fwriter->AppendText(pad); + + snprintf(wbuff, kWBUFF_len, " Bits=%2d", sig.LengthBit); + fwriter->AppendText(wbuff); + + if (sig.Unit.size() > 0) + { + snprintf(wbuff, kWBUFF_len, " Unit:'%-13s'", sig.Unit.c_str()); + fwriter->AppendText(wbuff); + } + + if (sig.Offset != 0) + { + snprintf(wbuff, kWBUFF_len, " Offset= %-18f", sig.Offset); + fwriter->AppendText(wbuff); + } + + if (sig.Factor != 1) + { + snprintf(wbuff, kWBUFF_len, " Factor= %-15d", sig.LengthBit); + fwriter->AppendText(wbuff); + } + + fwriter->AppendLine("", 2); } bool CiMainGenerator::SetFinalPath(std::string dirpath) @@ -73,3 +255,17 @@ bool CiMainGenerator::SetFinalPath(std::string dirpath) return true; } + +void CiMainGenerator::SetCommonValues(const std::string& drvname) +{ + DRVNAME = str_toupper(drvname); + + snprintf(wbuff, kWBUFF_len, "%s_USE_BITS_SIGNAL", DRVNAME.c_str()); + usebits_str = wbuff; + + snprintf(wbuff, kWBUFF_len, "%s_USE_DIAG_MONITORS", DRVNAME.c_str()); + usediag_str = wbuff; + + snprintf(wbuff, kWBUFF_len, "%s_USE_CANSTRUCT", DRVNAME.c_str()); + canframe_str = wbuff; +} diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 402412f..bbe2c61 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -2,25 +2,42 @@ #include #include "c-sigprinter.h" +#include "filewriter.h" #include "../types/message.h" +#include "../types/outfile.h" -class CiMainGenerator -{ -public: - CiMainGenerator(); +class CiMainGenerator { + public: + CiMainGenerator(); - void Generate(std::vector& msgs, std::string drvname, std::string dirpath); + void Generate(std::vector& msgs, std::string drvname, std::string dirpath); -private: - - bool SetFinalPath(std::string dirpath); + private: + bool SetFinalPath(std::string dirpath); -private: + void SetCommonValues(const std::string& drvname); - std::string work_dir_path; - - std::string workstr; + void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); - CSigPrinter* sigprt; + private: + std::string work_dir_path; + std::string workstr; + + std::string DRVNAME; + + std::string usebits_str; + std::string usediag_str; + std::string canframe_str; + + std::vector tmpvect; + + CSigPrinter* sigprt; + + FileWriter* fwriter; + + OutFileDescriptor_t mhead; + OutFileDescriptor_t mcode; + OutFileDescriptor_t fhead; + OutFileDescriptor_t fcode; }; diff --git a/src/codegen/filewriter.cpp b/src/codegen/filewriter.cpp index 9113dd2..d9859aa 100644 --- a/src/codegen/filewriter.cpp +++ b/src/codegen/filewriter.cpp @@ -1,30 +1,57 @@ +#include +#include #include "filewriter.h" + +FileWriter::FileWriter() +{ +} + +FileWriter::~FileWriter() +{ +} + void FileWriter::Flush() { - strm.clear(); + strm.clear(); } -void FileWriter::AppendText(const char* text, size_t len) +void FileWriter::Flush(const std::string& fpath) { - strm.write(text, len); + std::ofstream wfile; + + wfile.open(fpath, std::ios::out); + + wfile << strm.rdbuf(); + + wfile.close(); + + Flush(); } -void FileWriter::AppendLine(const char* text, size_t len) +void FileWriter::AppendText(const char* text) { - AppendText(text, len); - AppendText("\n", 1); + std::string str = text; + AppendText(str); +} + +void FileWriter::AppendLine(const char* text, int32_t post_empty_lines) +{ + AppendText(text); + + for (int32_t i = 0; i < post_empty_lines; i++) + AppendText("\n"); } void FileWriter::AppendText(const std::string& str) { - strm.str(str); + strm << str; } void FileWriter::AppendLine(const std::string& str) { - AppendText(str); - AppendText("\n", 1); + AppendText(str); + AppendText("\n"); } diff --git a/src/codegen/filewriter.h b/src/codegen/filewriter.h index bae6391..080a537 100644 --- a/src/codegen/filewriter.h +++ b/src/codegen/filewriter.h @@ -5,30 +5,24 @@ #include #include -class FileWriter -{ -public: +class FileWriter { + public: - FileWriter(); - ~FileWriter(); + FileWriter(); + ~FileWriter(); - void Flush(); - void AppendText(const char* text, size_t len); - void AppendLine(const char* text, size_t len); + void Flush(); + void Flush(const std::string& filename); - void AppendText(const std::string& str); - void AppendLine(const std::string& str); + void AppendText(const char* text); + void AppendLine(const char* text, int32_t post_empty_lines = 1); -private: + void AppendText(const std::string& str); + void AppendLine(const std::string& str); - std::stringstream strm; -}; + private: -FileWriter::FileWriter() -{ -} + std::stringstream strm; -FileWriter::~FileWriter() -{ -} \ No newline at end of file +}; From 2a2ff62231a3c4a9fa752b915c0b010f6ca9a3b4 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 7 Dec 2020 12:58:05 +0300 Subject: [PATCH 010/181] Added c++17 in project option. --- DbcScanner.vcxproj | 10 +++++----- DbcScanner.vcxproj.filters | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj index dbdea32..eaca8f1 100644 --- a/DbcScanner.vcxproj +++ b/DbcScanner.vcxproj @@ -106,8 +106,9 @@ true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true - Use + NotUsing pch.h + stdcpp17 @@ -141,8 +142,9 @@ true NDEBUG;_LIB;%(PreprocessorDefinitions) true - Use + NotUsing pch.h + stdcpp17 @@ -167,12 +169,10 @@ + - - - diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters index 9140e49..e9bad6a 100644 --- a/DbcScanner.vcxproj.filters +++ b/DbcScanner.vcxproj.filters @@ -59,8 +59,8 @@ Source Files - - - + + Source Files + \ No newline at end of file From c620841bb6820638ef8c00390a59049968e521b5 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 11 Dec 2020 23:54:15 +0300 Subject: [PATCH 011/181] Added mon1 field if defined setting. --- src/codegen/c-main-generator.cpp | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index da5c28a..e494211 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -12,6 +12,7 @@ static const size_t kMaxDirNum = 1000; static const size_t kWBUFF_len = 2048; + static char wbuff[kWBUFF_len] = {0}; static std::string __typeprint[] = @@ -70,9 +71,25 @@ void CiMainGenerator::Generate(std::vector& msgs, mhead.fpath = mhead.dir + "/" + mhead.fname; // 1 step is to define final directory for source code bunch - fwriter->AppendLine("#pragma once", 3); + fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); - fwriter->AppendLine("#include "); + fwriter->AppendLine("#include ", 2); + + snprintf(wbuff, kWBUFF_len, "#ifdef %s", usediag_str.c_str()); + fwriter->AppendLine(wbuff); + + fwriter->AppendText( + "// This file must define:\n" + "// base monitor struct\n" + "// function signature for CRC calculation\n" + "// function signature for getting system tick value (100 us step)\n" + "#include \"canmonitorutil.h\"\n" + "\n" + + ); + + snprintf(wbuff, kWBUFF_len, "#endif // %s", usediag_str.c_str()); + fwriter->AppendLine(wbuff, 3); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { @@ -116,6 +133,9 @@ void CiMainGenerator::Generate(std::vector& msgs, max_sig_name_len = s.Name.size(); } + // empty line before struct definition + fwriter->AppendLine("\n"); + snprintf(wbuff, kWBUFF_len, "typedef struct"); fwriter->AppendLine(wbuff); @@ -145,13 +165,17 @@ void CiMainGenerator::Generate(std::vector& msgs, snprintf(wbuff, kWBUFF_len, "#endif // %s", usebits_str.c_str()); fwriter->AppendLine(wbuff, 2); - //if (CodeSett.Code.UseMonitors == 1) - // fwriter->AppendLine(" FrameMonitor_t mon1;"); + // start mon1 section + snprintf(wbuff, kWBUFF_len, "#ifdef %s", usebits_str.c_str()); + fwriter->AppendLine(wbuff, 2); + + fwriter->AppendLine(" FrameMonitor_t mon1;", 2); + + snprintf(wbuff, kWBUFF_len, "#endif // %s", usebits_str.c_str()); + fwriter->AppendLine(wbuff, 2); snprintf(wbuff, kWBUFF_len, "} %s_t;", m.Name.c_str()); fwriter->AppendLine(wbuff, 2); - //fwriter->AppendLine("} " + msg.MessageName + "_t;"); - //fwriter->AppendLine(); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); From 98c8eda0d5b503035dc2db40093ee1fd407ef427 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 12 Dec 2020 00:30:42 +0300 Subject: [PATCH 012/181] Added Functions prototypes printing. --- src/codegen/c-main-generator.cpp | 33 ++++++++++++++++++++++++++++++-- src/codegen/c-main-generator.h | 2 +- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index e494211..3f92f5f 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -66,11 +66,12 @@ void CiMainGenerator::Generate(std::vector& msgs, SetCommonValues(drvname); // work_dir_path has the base dir path to gen files + // 1 step is to define final directory for source code bunch mhead.dir = work_dir_path; mhead.fname = drvname + ".h"; mhead.fpath = mhead.dir + "/" + mhead.fname; - // 1 step is to define final directory for source code bunch + // 2 step is to print main head file fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); @@ -178,9 +179,37 @@ void CiMainGenerator::Generate(std::vector& msgs, fwriter->AppendLine(wbuff, 2); } + fwriter->AppendLine("// Function signatures", 2); + + for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + { + // write message typedef s and additional expressions + MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + + snprintf(wbuff, kWBUFF_len, "uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", + m.Name.c_str(), drvname.c_str(), m.Name.c_str()); + + fwriter->AppendLine(wbuff); + + snprintf(wbuff, kWBUFF_len, "#ifdef %s", usestruct_str.c_str()); + fwriter->AppendLine(wbuff); + snprintf(wbuff, kWBUFF_len, "uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", + m.Name.c_str(), drvname.c_str(), m.Name.c_str()); + fwriter->AppendLine(wbuff); + + fwriter->AppendLine("#else"); + + snprintf(wbuff, kWBUFF_len, + "uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + m.Name.c_str(), drvname.c_str(), m.Name.c_str()); + fwriter->AppendLine(wbuff); + + snprintf(wbuff, kWBUFF_len, "#endif // %s", usestruct_str.c_str()); + fwriter->AppendLine(wbuff, 2); + } + fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); fwriter->Flush(mhead.fpath); - // 2 step is to print main head file // 3 step is to print main source file diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index bbe2c61..118edc5 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -28,7 +28,7 @@ class CiMainGenerator { std::string usebits_str; std::string usediag_str; - std::string canframe_str; + std::string usestruct_str; std::vector tmpvect; From 74b4b2d7c7caa54c953944e43be9c0fc0ba48ec4 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 12 Dec 2020 00:40:04 +0300 Subject: [PATCH 013/181] Added printF optimization. --- src/codegen/c-main-generator.cpp | 88 +++++++++++++++----------------- 1 file changed, 40 insertions(+), 48 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 3f92f5f..107fd01 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -13,7 +14,7 @@ static const size_t kMaxDirNum = 1000; static const size_t kWBUFF_len = 2048; -static char wbuff[kWBUFF_len] = {0}; +static char wbuff[kWBUFF_len] = { 0 }; static std::string __typeprint[] = { @@ -27,6 +28,15 @@ static std::string __typeprint[] = "uint64_t" }; +char* PrintF(const char* format, ...) +{ + va_list args; + va_start(args, format); + vsnprintf(wbuff, kWBUFF_len, format, args); + va_end(args); + return wbuff; +} + std::string str_toupper(std::string s) { std::transform(s.begin(), s.end(), s.begin(), @@ -89,27 +99,21 @@ void CiMainGenerator::Generate(std::vector& msgs, ); - snprintf(wbuff, kWBUFF_len, "#endif // %s", usediag_str.c_str()); - fwriter->AppendLine(wbuff, 3); + fwriter->AppendLine(PrintF("#endif // %s", usediag_str.c_str()), 3); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - snprintf(wbuff, kWBUFF_len, "// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID); - fwriter->AppendLine(wbuff); - snprintf(wbuff, kWBUFF_len, "#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt); - fwriter->AppendLine(wbuff); - snprintf(wbuff, kWBUFF_len, "#define %s_DLC (%uU)", m.Name.c_str(), m.DLC); - fwriter->AppendLine(wbuff); - snprintf(wbuff, kWBUFF_len, "#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID); - fwriter->AppendLine(wbuff); + fwriter->AppendLine(PrintF("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID)); + fwriter->AppendLine(PrintF("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt)); + fwriter->AppendLine(PrintF("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC)); + fwriter->AppendLine(PrintF("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID)); if (m.Cycle > 0) { - snprintf(wbuff, kWBUFF_len, "#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle); - fwriter->AppendLine(wbuff); + fwriter->AppendLine(PrintF("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle)); } if (m.CommentText.size() > 0) @@ -137,14 +141,12 @@ void CiMainGenerator::Generate(std::vector& msgs, // empty line before struct definition fwriter->AppendLine("\n"); - snprintf(wbuff, kWBUFF_len, "typedef struct"); - fwriter->AppendLine(wbuff); + fwriter->AppendLine(PrintF("typedef struct")); fwriter->AppendLine("{\n"); // Write section for bitfielded part - snprintf(wbuff, kWBUFF_len, "#ifdef %s", usebits_str.c_str()); - fwriter->AppendLine(wbuff, 2); + fwriter->AppendLine(PrintF("#ifdef %s", usebits_str.c_str()), 2); for (size_t signum = 0; signum < m.Signals.size(); signum++) { @@ -163,20 +165,13 @@ void CiMainGenerator::Generate(std::vector& msgs, WriteSigStructField(sig, false, max_sig_name_len); } - snprintf(wbuff, kWBUFF_len, "#endif // %s", usebits_str.c_str()); - fwriter->AppendLine(wbuff, 2); + fwriter->AppendLine(PrintF("#endif // %s", usebits_str.c_str()), 2); // start mon1 section - snprintf(wbuff, kWBUFF_len, "#ifdef %s", usebits_str.c_str()); - fwriter->AppendLine(wbuff, 2); - + fwriter->AppendLine(PrintF("#ifdef %s", usebits_str.c_str()), 2); fwriter->AppendLine(" FrameMonitor_t mon1;", 2); - - snprintf(wbuff, kWBUFF_len, "#endif // %s", usebits_str.c_str()); - fwriter->AppendLine(wbuff, 2); - - snprintf(wbuff, kWBUFF_len, "} %s_t;", m.Name.c_str()); - fwriter->AppendLine(wbuff, 2); + fwriter->AppendLine(PrintF("#endif // %s", usebits_str.c_str()), 2); + fwriter->AppendLine(PrintF("} %s_t;", m.Name.c_str()), 2); } fwriter->AppendLine("// Function signatures", 2); @@ -185,27 +180,24 @@ void CiMainGenerator::Generate(std::vector& msgs, { // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - - snprintf(wbuff, kWBUFF_len, "uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), drvname.c_str(), m.Name.c_str()); - - fwriter->AppendLine(wbuff); - - snprintf(wbuff, kWBUFF_len, "#ifdef %s", usestruct_str.c_str()); - fwriter->AppendLine(wbuff); - snprintf(wbuff, kWBUFF_len, "uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), drvname.c_str(), m.Name.c_str()); - fwriter->AppendLine(wbuff); - + + fwriter->AppendLine( + PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", + m.Name.c_str(), drvname.c_str(), m.Name.c_str())); + + fwriter->AppendLine(PrintF("#ifdef %s", usestruct_str.c_str())); + + fwriter->AppendLine( + PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", + m.Name.c_str(), drvname.c_str(), m.Name.c_str())); + fwriter->AppendLine("#else"); + + fwriter->AppendLine( + PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + m.Name.c_str(), drvname.c_str(), m.Name.c_str())); - snprintf(wbuff, kWBUFF_len, - "uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), drvname.c_str(), m.Name.c_str()); - fwriter->AppendLine(wbuff); - - snprintf(wbuff, kWBUFF_len, "#endif // %s", usestruct_str.c_str()); - fwriter->AppendLine(wbuff, 2); + fwriter->AppendLine(PrintF("#endif // %s", usestruct_str.c_str()), 2); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); @@ -320,5 +312,5 @@ void CiMainGenerator::SetCommonValues(const std::string& drvname) usediag_str = wbuff; snprintf(wbuff, kWBUFF_len, "%s_USE_CANSTRUCT", DRVNAME.c_str()); - canframe_str = wbuff; + usestruct_str = wbuff; } From fc9663ac3afd5f56565ce6a5ee6c25c1bcfffb6b Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 13 Dec 2020 01:08:31 +0300 Subject: [PATCH 014/181] Added separated common attributes creator. --- DbcScanner.vcxproj | 2 + DbcScanner.vcxproj.filters | 6 ++ src/codegen/c-main-generator.cpp | 90 +++---------------------- src/codegen/c-main-generator.h | 11 +--- src/codegen/fs-creator.cpp | 110 +++++++++++++++++++++++++++++++ src/codegen/fs-creator.h | 40 +++++++++++ 6 files changed, 169 insertions(+), 90 deletions(-) create mode 100644 src/codegen/fs-creator.cpp create mode 100644 src/codegen/fs-creator.h diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj index eaca8f1..2375be9 100644 --- a/DbcScanner.vcxproj +++ b/DbcScanner.vcxproj @@ -158,6 +158,7 @@ + @@ -170,6 +171,7 @@ + diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters index e9bad6a..1b292c0 100644 --- a/DbcScanner.vcxproj.filters +++ b/DbcScanner.vcxproj.filters @@ -45,6 +45,9 @@ Header Files + + Header Files + @@ -62,5 +65,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 107fd01..aa05714 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -37,25 +37,13 @@ char* PrintF(const char* format, ...) return wbuff; } -std::string str_toupper(std::string s) -{ - std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::toupper(c); - }); - return s; -} - CiMainGenerator::CiMainGenerator() { sigprt = new CSigPrinter; fwriter = new FileWriter; } -void CiMainGenerator::Generate(std::vector& msgs, - std::string drvname, - std::string dirpath) +void CiMainGenerator::Generate(std::vector& msgs, const FsDescriptor_t& fsd) { // Load income messages to sig printer sigprt->LoadMessages(msgs); @@ -66,21 +54,6 @@ void CiMainGenerator::Generate(std::vector& msgs, return a->msg.MsgID < b->msg.MsgID; }); - auto dirok = SetFinalPath(dirpath); - - if (!dirok) - { - // TODO: handle error if directory cannot be used - } - - SetCommonValues(drvname); - - // work_dir_path has the base dir path to gen files - // 1 step is to define final directory for source code bunch - mhead.dir = work_dir_path; - mhead.fname = drvname + ".h"; - mhead.fpath = mhead.dir + "/" + mhead.fname; - // 2 step is to print main head file fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); @@ -180,28 +153,28 @@ void CiMainGenerator::Generate(std::vector& msgs, { // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - + fwriter->AppendLine( PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), drvname.c_str(), m.Name.c_str())); + m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); fwriter->AppendLine(PrintF("#ifdef %s", usestruct_str.c_str())); - + fwriter->AppendLine( PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), drvname.c_str(), m.Name.c_str())); - + m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); + fwriter->AppendLine("#else"); - + fwriter->AppendLine( PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), drvname.c_str(), m.Name.c_str())); + m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); fwriter->AppendLine(PrintF("#endif // %s", usestruct_str.c_str()), 2); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); - fwriter->Flush(mhead.fpath); + fwriter->Flush(fsd.core_h.fpath); // 3 step is to print main source file @@ -269,48 +242,3 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendLine("", 2); } -bool CiMainGenerator::SetFinalPath(std::string dirpath) -{ - // find free directory - struct stat info; - - for (int32_t dirnum = 0; dirnum < 1000; dirnum++) - { - snprintf(wbuff, kWBUFF_len, "%03d", dirnum); - work_dir_path = dirpath + "/" + wbuff; - - if (stat(work_dir_path.c_str(), &info) != 0) - { - if (std::filesystem::create_directory(work_dir_path)) - return true; - else - return false; - } - else if (info.st_mode & S_IFDIR) - { - // directory exists, try next num - continue; - } - else - { - if (std::filesystem::create_directory(work_dir_path) != 0) - return false; - } - } - - return true; -} - -void CiMainGenerator::SetCommonValues(const std::string& drvname) -{ - DRVNAME = str_toupper(drvname); - - snprintf(wbuff, kWBUFF_len, "%s_USE_BITS_SIGNAL", DRVNAME.c_str()); - usebits_str = wbuff; - - snprintf(wbuff, kWBUFF_len, "%s_USE_DIAG_MONITORS", DRVNAME.c_str()); - usediag_str = wbuff; - - snprintf(wbuff, kWBUFF_len, "%s_USE_CANSTRUCT", DRVNAME.c_str()); - usestruct_str = wbuff; -} diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 118edc5..e238f1f 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -5,17 +5,15 @@ #include "filewriter.h" #include "../types/message.h" #include "../types/outfile.h" +#include "fs-creator.h" class CiMainGenerator { public: CiMainGenerator(); - void Generate(std::vector& msgs, std::string drvname, std::string dirpath); + void Generate(std::vector& msgs, const FsDescriptor_t& fsd); private: - bool SetFinalPath(std::string dirpath); - - void SetCommonValues(const std::string& drvname); void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); @@ -35,9 +33,4 @@ class CiMainGenerator { CSigPrinter* sigprt; FileWriter* fwriter; - - OutFileDescriptor_t mhead; - OutFileDescriptor_t mcode; - OutFileDescriptor_t fhead; - OutFileDescriptor_t fcode; }; diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp new file mode 100644 index 0000000..216f6ea --- /dev/null +++ b/src/codegen/fs-creator.cpp @@ -0,0 +1,110 @@ +#include "fs-creator.h" +#include +#include +#include +#include +#include + +static const int32_t kTmpLen = 1024; + +static char _tmpb[kTmpLen]; + + +std::string str_toupper(std::string s) +{ + std::transform(s.begin(), s.end(), s.begin(), + [](unsigned char c) + { + return std::toupper(c); + }); + return s; +} + + +std::string str_tolower(std::string s) +{ + std::transform(s.begin(), s.end(), s.begin(), + [](unsigned char c) + { + return std::tolower(c); + }); + return s; +} + +FsCreator::FsCreator() +{ +} + +bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool rw) +{ + bool ret = false; + + // find free directory + struct stat info; + + std::string work_dir_path; + + for (int32_t dirnum = 0; dirnum < 1000; dirnum++) + { + snprintf(_tmpb, kTmpLen, "%03d", dirnum); + work_dir_path = basepath + "/" + _tmpb; + + if (stat(work_dir_path.c_str(), &info) != 0) + { + if (std::filesystem::create_directory(work_dir_path)) + { + ret = true; + break; + } + } + else if (info.st_mode & S_IFDIR) + { + // directory exists, try next num + continue; + } + else + { + if (std::filesystem::create_directory(work_dir_path) != 0) + { + ret = false; + break; + } + } + } + + if (ret) + { + // directory valid and exists, set all the values + FS.drvname = drvname; + FS.DRVNAME = str_toupper(drvname); + + std::string ldrvname = str_tolower(drvname); + + FS.core_h.dir = work_dir_path; + FS.core_h.fname = ldrvname + ".h"; + FS.core_h.fpath = work_dir_path + "/" + FS.core_h.fname; + + FS.core_c.dir = work_dir_path; + FS.core_c.fname = ldrvname + ".c"; + FS.core_c.fpath = work_dir_path + "/" + FS.core_c.fname; + + FS.util_h.dir = work_dir_path; + FS.util_h.fname = ldrvname + "_binutil" + ".h"; + FS.util_h.fpath = work_dir_path + "/" + FS.util_h.fname; + + FS.util_c.dir = work_dir_path; + FS.util_c.fname = ldrvname + "_binutil" + ".c"; + FS.util_c.fpath = work_dir_path + "/" + FS.util_c.fname; + + snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.DRVNAME.c_str()); + FS.usebits_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.DRVNAME.c_str()); + FS.usemon_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.DRVNAME.c_str()); + FS.usesruct_def = _tmpb; + } + + return ret; +} diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h new file mode 100644 index 0000000..d10e5e3 --- /dev/null +++ b/src/codegen/fs-creator.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include +#include "../types/outfile.h" + +typedef struct +{ + // low case driver name + std::string drvname; + // up case driver name + std::string DRVNAME; + + OutFileDescriptor_t core_h; + OutFileDescriptor_t core_c; + + OutFileDescriptor_t util_h; + OutFileDescriptor_t util_c; + + std::string usebits_def; + std::string usesruct_def; + std::string usemon_def; + +} FsDescriptor_t; + +// This class is used to build all neccessary string -ed +// value that will be required during code generation +// (paths, file names, drvnames, common defines etc) +// if preparation ends with true, the collection of +// values can be used. +class FsCreator { + public: + FsCreator(); + + bool PrepareDirectory(std::string drvname, std::string basepath, bool rw); + + FsDescriptor_t FS; + +}; + From b0856e0431146b749fab2eff6ca347c7e5980fe0 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 16:46:14 +0300 Subject: [PATCH 015/181] Using fsd filelds for #ifdef selection. --- src/codegen/c-main-generator.cpp | 17 ++++++++--------- src/codegen/c-main-generator.h | 10 ---------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index aa05714..60714ea 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -59,7 +59,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); - snprintf(wbuff, kWBUFF_len, "#ifdef %s", usediag_str.c_str()); + snprintf(wbuff, kWBUFF_len, "#ifdef %s", fsd.usemon_def.c_str()); fwriter->AppendLine(wbuff); fwriter->AppendText( @@ -69,10 +69,9 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs "// function signature for getting system tick value (100 us step)\n" "#include \"canmonitorutil.h\"\n" "\n" - ); - fwriter->AppendLine(PrintF("#endif // %s", usediag_str.c_str()), 3); + fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 3); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { @@ -119,7 +118,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("{\n"); // Write section for bitfielded part - fwriter->AppendLine(PrintF("#ifdef %s", usebits_str.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usebits_def.c_str()), 2); for (size_t signum = 0; signum < m.Signals.size(); signum++) { @@ -138,12 +137,12 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs WriteSigStructField(sig, false, max_sig_name_len); } - fwriter->AppendLine(PrintF("#endif // %s", usebits_str.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fsd.usebits_def.c_str()), 2); // start mon1 section - fwriter->AppendLine(PrintF("#ifdef %s", usebits_str.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usebits_def.c_str()), 2); fwriter->AppendLine(" FrameMonitor_t mon1;", 2); - fwriter->AppendLine(PrintF("#endif // %s", usebits_str.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fsd.usebits_def.c_str()), 2); fwriter->AppendLine(PrintF("} %s_t;", m.Name.c_str()), 2); } @@ -158,7 +157,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); - fwriter->AppendLine(PrintF("#ifdef %s", usestruct_str.c_str())); + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); fwriter->AppendLine( PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", @@ -170,7 +169,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", usestruct_str.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index e238f1f..ef2f7e1 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -18,16 +18,6 @@ class CiMainGenerator { void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); private: - std::string work_dir_path; - - std::string workstr; - - std::string DRVNAME; - - std::string usebits_str; - std::string usediag_str; - std::string usestruct_str; - std::vector tmpvect; CSigPrinter* sigprt; From ff267a4b6167f6dc248c2a930c7a13f18f0948af Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 16:58:20 +0300 Subject: [PATCH 016/181] PrintF refactored completely. --- src/codegen/c-main-generator.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 60714ea..0fe34f1 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -59,8 +59,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); - snprintf(wbuff, kWBUFF_len, "#ifdef %s", fsd.usemon_def.c_str()); - fwriter->AppendLine(wbuff); + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str())); fwriter->AppendText( "// This file must define:\n" @@ -200,8 +199,7 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi if (bits && (sig.LengthBit < 8)) { - snprintf(wbuff, kWBUFF_len, " : %d", sig.LengthBit); - dtype += wbuff; + dtype += PrintF(" : %d", sig.LengthBit); } dtype += ";"; @@ -217,25 +215,21 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendText(pad); - snprintf(wbuff, kWBUFF_len, " Bits=%2d", sig.LengthBit); - fwriter->AppendText(wbuff); + fwriter->AppendText(PrintF(" Bits=%2d", sig.LengthBit)); if (sig.Unit.size() > 0) { - snprintf(wbuff, kWBUFF_len, " Unit:'%-13s'", sig.Unit.c_str()); - fwriter->AppendText(wbuff); + fwriter->AppendText(PrintF(" Unit:'%-13s'", sig.Unit.c_str())); } if (sig.Offset != 0) { - snprintf(wbuff, kWBUFF_len, " Offset= %-18f", sig.Offset); - fwriter->AppendText(wbuff); + fwriter->AppendText(PrintF(" Offset= %-18f", sig.Offset)); } if (sig.Factor != 1) { - snprintf(wbuff, kWBUFF_len, " Factor= %-15d", sig.LengthBit); - fwriter->AppendText(wbuff); + fwriter->AppendText(PrintF(" Factor= %-15d", sig.LengthBit)); } fwriter->AppendLine("", 2); From c7ae93ea852f39104d806e3be9681b704a41e297 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 20:08:30 +0300 Subject: [PATCH 017/181] Fixed unpack sig format bug. --- src/codegen/c-sigprinter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 8957864..3492d74 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -140,7 +140,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, t64 = "(uint64_t)"; } - snprintf(workbuff, WBUFF_LEN, "(%s_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[bbc].c_str(), slen); + snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[bbc].c_str(), slen); tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, From 30edc79c7fb764d633ecffcf193ba95f600b8ef0 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 20:08:53 +0300 Subject: [PATCH 018/181] Renamed variable for clarificatin. --- src/codegen/c-sigprinter.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 3492d74..1331c70 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -57,25 +57,25 @@ std::string CSigPrinter::GetSignalType(const SignalDescriptor_t& signal) return ret; } -int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msg) +int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msgprinter) { int32_t ret = 0; std::string tmpstr; - msg->to_bytes.clear(); - msg->to_signals.clear(); - msg->to_bytes.resize(msg->msg.DLC); + msgprinter->to_bytes.clear(); + msgprinter->to_signals.clear(); + msgprinter->to_bytes.resize(msgprinter->msg.DLC); // for each signal specific to_signal expression must be defined, // and during all signals processing, for each byte to_byte expression // must be collected - for (size_t i = 0; i < msg->msg.Signals.size(); i++) + for (size_t i = 0; i < msgprinter->msg.Signals.size(); i++) { // there are two main goal of this code: // 1 - to generate bytes to signal C-expression, (_d - name of array). - // For each signal there is only one byte reference. It's generated - // once each function call for each signal + // For each signal one or more bytes can be referenced. It's generated + // once on each function call for each signal // // 2 - to generate signals to each byte expression, (_m - name of struct with // signals). For each byte a 8 signals can be referenced. It's generated @@ -88,7 +88,8 @@ int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msg) // // bytes expression is saved to vector @to_bytes, where id is the // byte number in frame payload (i.e. to_bytes.size() == frame.DLC) - msg->to_signals.push_back(PrintSignalExpr(&msg->msg.Signals[i], msg->to_bytes)); + msgprinter->to_signals.push_back(PrintSignalExpr(&msgprinter->msg.Signals[i], + msgprinter->to_bytes)); } return ret; From 246a2b9119abf970527a837db0f4d4bb3d4b9d43 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 20:09:16 +0300 Subject: [PATCH 019/181] Style format. --- src/codegen/c-sigprinter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 1331c70..b9c5066 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -96,13 +96,13 @@ int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msgprinter) } std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, - std::vector& to_bytes) + std::vector& to_bytes) { // value for collecting expression (to_signal) std::string tosigexpr; uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? - (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); + (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); if (startb > 63) startb = 63; @@ -119,7 +119,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->{%s} & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), - bbc - slen); + bbc - slen); AppendToByteLine(to_bytes[bn], workbuff); } else if (bbc == slen) @@ -145,7 +145,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, - msk[bbc].c_str()); + msk[bbc].c_str()); AppendToByteLine(to_bytes[bn], workbuff); while ((slen - 8) >= 0) @@ -191,7 +191,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), - 8 - slen); + 8 - slen); AppendToByteLine(to_bytes[bn], workbuff); } } From bf0ed04585d4dfe1f93be6e7c608f0762aea740e Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 20:10:42 +0300 Subject: [PATCH 020/181] Fs creator keeps lowcase drvname in separated field. --- src/codegen/c-main-generator.cpp | 8 +++++--- src/codegen/fs-creator.cpp | 12 ++++++------ src/codegen/fs-creator.h | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 0fe34f1..fb01be9 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -154,24 +154,26 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine( PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); fwriter->AppendLine( PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine("#else"); fwriter->AppendLine( PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), fsd.drvname.c_str(), m.Name.c_str())); + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); + + // save fwrite cached text to file fwriter->Flush(fsd.core_h.fpath); // 3 step is to print main source file diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 216f6ea..3f0cac9 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -75,25 +75,25 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool if (ret) { // directory valid and exists, set all the values - FS.drvname = drvname; + FS.DrvName_orig = drvname; FS.DRVNAME = str_toupper(drvname); + FS.drvname = str_tolower(drvname); - std::string ldrvname = str_tolower(drvname); FS.core_h.dir = work_dir_path; - FS.core_h.fname = ldrvname + ".h"; + FS.core_h.fname = FS.drvname + ".h"; FS.core_h.fpath = work_dir_path + "/" + FS.core_h.fname; FS.core_c.dir = work_dir_path; - FS.core_c.fname = ldrvname + ".c"; + FS.core_c.fname = FS.drvname + ".c"; FS.core_c.fpath = work_dir_path + "/" + FS.core_c.fname; FS.util_h.dir = work_dir_path; - FS.util_h.fname = ldrvname + "_binutil" + ".h"; + FS.util_h.fname = FS.drvname + "_binutil" + ".h"; FS.util_h.fpath = work_dir_path + "/" + FS.util_h.fname; FS.util_c.dir = work_dir_path; - FS.util_c.fname = ldrvname + "_binutil" + ".c"; + FS.util_c.fname = FS.drvname + "_binutil" + ".c"; FS.util_c.fpath = work_dir_path + "/" + FS.util_c.fname; snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.DRVNAME.c_str()); diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index d10e5e3..d4d824d 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -6,6 +6,8 @@ typedef struct { + // original driver name view + std::string DrvName_orig; // low case driver name std::string drvname; // up case driver name @@ -26,7 +28,7 @@ typedef struct // This class is used to build all neccessary string -ed // value that will be required during code generation // (paths, file names, drvnames, common defines etc) -// if preparation ends with true, the collection of +// if preparation ends with true, the collection of // values can be used. class FsCreator { public: From 155755087e8e276639e30c9a4836ea9a3202cfde Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 11 Jan 2021 20:37:43 +0300 Subject: [PATCH 021/181] Basic struct and unpack func in -c main source code. --- src/codegen/c-main-generator.cpp | 89 ++++++++++++++++++++++++++++++++ src/codegen/c-main-generator.h | 4 ++ 2 files changed, 93 insertions(+) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index fb01be9..dea7a8d 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -48,6 +48,10 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs // Load income messages to sig printer sigprt->LoadMessages(msgs); + // save pointer to output file descriptor struct to + // enable using this information inside class member functions + fdesc = &fsd; + std::sort(sigprt->sigs_expr.begin(), sigprt->sigs_expr.end(), [](const CiExpr_t* a, const CiExpr_t* b) -> bool { @@ -177,7 +181,59 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->Flush(fsd.core_h.fpath); // 3 step is to print main source file + // include main header file + fwriter->AppendLine(PrintF("#include ""%s""", fsd.core_h.fname.c_str()), 3); + + // put diagmonitor ifdef selection for including @drv-fmon header + // with FMon_* signatures to call from unpack function + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str())); + + fwriter->AppendText( + "// This file must define:\n" + "// base monitor struct\n" + "// function signature for CRC calculation\n" + "// function signature for getting system tick value (100 us step)\n"); + + fwriter->AppendLine(PrintF("#include ""%s-fmon.h""", fsd.drvname.c_str()), 2); + + fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 3); + // for each message 3 functions must be defined - 1 unpack function, + // 2: pack with raw signature + // 3: pack with canstruct + for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + { + // write message typedef s and additional expressions + MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + + // first function + fwriter->AppendLine( + PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + + WriteUnpackBody(sigprt->sigs_expr[num]); + + fwriter->AppendLine("}", 2); + + + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); + + // second function + fwriter->AppendLine( + PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + + fwriter->AppendLine("#else"); + + // third function + fwriter->AppendLine( + PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + + fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); + } + + fwriter->Flush(fsd.core_c.fpath); // 4 step is to pring fmon head file // 5 step is to print fmon source file @@ -237,3 +293,36 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendLine("", 2); } +void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) +{ + for (size_t num = 0; num < sgs->to_signals.size(); num++) + { + auto expr = sgs->to_signals[num]; + + fwriter->AppendLine(PrintF(" _m->%s = %s;", sgs->msg.Signals[num].Name.c_str(), expr.c_str())); + } + + fwriter->AppendLine(""); + + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); + + fwriter->AppendLine(" // check DLC correctness"); + fwriter->AppendLine(PrintF(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); + + + // TODO: put CRC and ROLLING COUNTER tests here + // 1 + // 2 + + + fwriter->AppendLine(" _m->mon1.last_cycle = GetSysTick();"); + fwriter->AppendLine(" _m->mon1.frame_cnt++;", 2); + + auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->drvname; + + fwriter->AppendLine(PrintF(" %s(&_m->mon1);", Fmon_func.c_str())); + + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 2); + + fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); +} diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index ef2f7e1..51a13cc 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -17,10 +17,14 @@ class CiMainGenerator { void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); + void WriteUnpackBody(const CiExpr_t* sgs); + private: std::vector tmpvect; CSigPrinter* sigprt; FileWriter* fwriter; + + const FsDescriptor_t* fdesc; }; From 981b25ac8c2452349da7c188458f46b4c4058ac8 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jan 2021 11:49:30 +0300 Subject: [PATCH 022/181] Added 2-Pack functions bodies. --- src/codegen/c-main-generator.cpp | 67 ++++++++++++++++++++++++++++---- src/codegen/c-main-generator.h | 2 + 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index dea7a8d..c1f6918 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -215,21 +215,24 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("}", 2); - - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); + // next one is the pack function for using with CANFrame struct + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str()), 2); // second function - fwriter->AppendLine( - PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe)", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); - fwriter->AppendLine("#else"); + WritePackStructBody(sigprt->sigs_expr[num]); + + fwriter->AppendLine("#else", 2); // third function fwriter->AppendLine( - PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + WritePackArrayBody(sigprt->sigs_expr[num]); + fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); } @@ -326,3 +329,53 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); } + +void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) +{ + fwriter->AppendLine("{"); + + // pring array content clearin loop + fwriter->AppendLine( + PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); cframe->Data[i++] = 0);", + sgs->msg.Name.c_str()), 2); + + for (size_t i = 0; i < sgs->to_bytes.size(); i++) + { + if (sgs->to_bytes[i].size() < 2) + continue; + + fwriter->AppendLine(PrintF(" cframe->Data[%d] |= %s;", i, sgs->to_bytes[i].c_str())); + } + + fwriter->AppendLine(""); + + fwriter->AppendLine(PrintF(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(PrintF(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); + fwriter->AppendLine(PrintF(" cframe->IDE = %_IDE;", sgs->msg.Name.c_str(), 2)); + fwriter->AppendLine(PrintF(" return %_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine("}", 2); +} + +void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) +{ + fwriter->AppendLine("{"); + + // pring array content clearin loop + fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); _d[i++] = 0);", + sgs->msg.Name.c_str()), 2); + + for (size_t i = 0; i < sgs->to_bytes.size(); i++) + { + if (sgs->to_bytes[i].size() < 2) + continue; + + fwriter->AppendLine(PrintF(" _d[%d] |= %s;", i, sgs->to_bytes[i].c_str())); + } + + fwriter->AppendLine(""); + + fwriter->AppendText(PrintF(" *_len = %s_DLC;", sgs->msg.Name.c_str())); + fwriter->AppendLine(PrintF(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); + fwriter->AppendLine(PrintF(" return %_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine("}", 2); +} diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 51a13cc..8755269 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -18,6 +18,8 @@ class CiMainGenerator { void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); void WriteUnpackBody(const CiExpr_t* sgs); + void WritePackStructBody(const CiExpr_t* sgs); + void WritePackArrayBody(const CiExpr_t* sgs); private: std::vector tmpvect; From bdd40613fbe5690e09c0fede10680edf20afab13 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jan 2021 17:26:33 +0300 Subject: [PATCH 023/181] Signal type detection refactored. --- src/codegen/c-sigprinter.cpp | 43 ++++++++++---- src/parser/dbclineparser.cpp | 110 +++++++++++++++++++++++++++++------ src/parser/dbclineparser.h | 2 +- src/types/message.h | 6 +- 4 files changed, 132 insertions(+), 29 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index b9c5066..1a367c9 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -88,8 +88,7 @@ int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msgprinter) // // bytes expression is saved to vector @to_bytes, where id is the // byte number in frame payload (i.e. to_bytes.size() == frame.DLC) - msgprinter->to_signals.push_back(PrintSignalExpr(&msgprinter->msg.Signals[i], - msgprinter->to_bytes)); + msgprinter->to_signals.push_back(PrintSignalExpr(&msgprinter->msg.Signals[i], msgprinter->to_bytes)); } return ret; @@ -196,15 +195,39 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, } } - if (sig->Offset < 0) + if (!sig->IsDoubleSig) { - snprintf(workbuff, WBUFF_LEN, "(%s) - %d", tosigexpr.c_str(), abs(sig->RawOffset)); - tosigexpr = workbuff; - } - else if (sig->Offset > 0) - { - snprintf(workbuff, WBUFF_LEN, "(%s) + %d", tosigexpr.c_str(), abs(sig->RawOffset)); - tosigexpr = workbuff; + int32_t i_fact = (int32_t)sig->Factor; + int32_t i_offset = (int32_t)sig->Offset; + + // For signals which have both: factor and offset integer type + // the physical value can be calculated inside unpack expression + if (sig->Offset < 0) + { + if (i_fact != 1) + { + snprintf(workbuff, WBUFF_LEN, "((%s) * %d) - %d", tosigexpr.c_str(), i_fact, abs(i_offset)); + } + else + { + snprintf(workbuff, WBUFF_LEN, "(%s) - %d", tosigexpr.c_str(), abs(i_offset)); + } + + tosigexpr = workbuff; + } + else if (sig->Offset > 0) + { + if (i_fact != 1) + { + snprintf(workbuff, WBUFF_LEN, "((%s) * %d) + %d", tosigexpr.c_str(), i_fact, abs(i_offset)); + } + else + { + snprintf(workbuff, WBUFF_LEN, "(%s) + %d", tosigexpr.c_str(), abs(i_offset)); + } + + tosigexpr = workbuff; + } } return tosigexpr; diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 6ea20f6..aa04680 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -20,7 +20,7 @@ static const std::string kRegAttrMain = "[^A-Za-z0-9_\.]+"; static const std::string kRegValTable = "\""; -static uint64_t __maxvalues[] = +static uint64_t __maxunsigvalues[] = { UCHAR_MAX, USHRT_MAX, @@ -28,6 +28,14 @@ static uint64_t __maxvalues[] = ULLONG_MAX }; +static uint64_t __maxsignedvals[] = +{ + CHAR_MAX, + SHRT_MAX, + INT_MAX, + LLONG_MAX +}; + static int __typeslen[] = { 8, 16, 32, 64 }; std::vector resplit(const std::string& s, const std::string& rgx_str) @@ -151,16 +159,25 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& sig->StartBit = atoi(valpart[0].c_str()); sig->LengthBit = atoi(valpart[1].c_str()); + // get info about factor or offset double nature + sig->IsDoubleSig = false; + + // for enabling double conversation the factor or offset + // substring must have dot ('.') character + if (valpart[3].find_first_of('.') != std::string::npos || + valpart[4].find_first_of('.') != std::string::npos) + sig->IsDoubleSig = true; + // factor = double; // offset = double; //The factorand offset define the linear conversion rule to convert the signals raw //value into the signal's physical value and vice versa: // physical_value = raw_value * factor + offset - // raw_value = (physical_value � offset) / factor + // raw_value = (physical_value - offset) / factor sig->Factor = atof(valpart[3].c_str()); sig->Offset = atof(valpart[4].c_str()); - sig->RawOffset = static_cast(sig->Offset / sig->Factor); + sig->RawOffset = sig->Offset / sig->Factor; sig->MinValue = atof(valpart[5].c_str()); sig->MaxValue = atof(valpart[6].c_str()); @@ -210,28 +227,40 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) int64_t roffset = (int64_t)(sig->Offset / sig->Factor); - if (!sig->Signed) + uint64_t max_v = 0; + + if (!sig->IsDoubleSig) { - uint64_t maxval = 0; + int64_t i_offset = (int64_t)sig->Offset; + int64_t i_factor = (int64_t)sig->Factor; - if (sig->LengthBit <= 32) + // for this case physical value needs to be allowed to + // fit inside field type + if (sig->Signed) { - if (roffset >= 0) + // physical_value = raw_value * factor + offset + // 1 get the max value for the positive part + max_v = (uint64_t)(std::pow(2, sig->LengthBit - 1)); + // 2 scale to max value + max_v *= i_factor; + + // 3 add offset + // factor affects on difference between min and max values + // abs(max_neg)-(max_pos) = sig->Factor; + // so if offset == Factor + if (sig->Offset > (int32_t)(sig->Factor - 1)) { - // this only unsinged case - maxval = (uint64_t)(std::pow(2, sig->LengthBit) - 1 + roffset); - is_unsigned = 1; + // positive value less then + max_v = (max_v + i_offset - ((int64_t)sig->Factor)); } else { - uint64_t maxpos = (uint64_t)(std::pow(2, sig->LengthBit + 1) - 1); - uint64_t maxneg = (uint64_t)(std::abs(roffset * 2)); - maxval = std::max(maxpos, maxneg); + max_v = (max_v - i_offset) - 1; } for (uint8_t i = 0; i < 4; i++) { - if (maxval <= __maxvalues[i]) + if (max_v <= (__maxsignedvals[i])) { ret = (SigType)(i + (is_unsigned * 4)); break; @@ -241,13 +270,61 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) else { is_unsigned = 1; + + max_v = (uint64_t)(std::pow(2, sig->LengthBit)); + + max_v *= (int32_t)sig->Factor; + + if (sig->Offset >= 0) + { + // when offset positive the max physical value is got just + // adding roffset value + max_v += roffset; + } + else + { + is_unsigned = 0; + // this code must determmine which part of range is larger - positive or negative + // the largest part will define which sig type will be used for signal + // roffset here - negative value + + // max positive value fot the LenBits if it would have signed type + uint64_t maxpos = (uint64_t)(std::pow(2, sig->LengthBit) - 1); + // max negative value + uint64_t maxneg = (uint64_t)(std::abs(roffset)); + + max_v = std::max(maxpos, maxneg); + // mul 2 for using unsinged compare levels (int8_t (127) like uint8_t (255)) + max_v *= 2; + } + + for (uint8_t i = 0; i < 4; i++) + { + if (max_v <= (__maxunsigvalues[i])) + { + ret = (SigType)(i + (is_unsigned * 4)); + break; + } + } } } + else { + // this type definition is simple (without + // additional type-expanded operations inside + // main driver, so to determine type simple + // operations is needed + max_v = (uint64_t)(std::pow(2, sig->LengthBit) - 1); + + if (sig->Signed) + { + is_unsigned = 0; + } + for (uint8_t i = 0; i < 4; i++) { - if (len <= __typeslen[i]) + if (max_v <= __maxunsigvalues[i]) { ret = (SigType)(i + (is_unsigned * 4)); break; @@ -348,8 +425,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s // raw line is ready auto items = resplit(attribline, kRegAttrMain); - if (items.size() > 4 && items[1] == "GenMsgCycleTime" - && items[2] == "BO_") + if (items.size() > 4 && items[1] == "GenMsgCycleTime" && items[2] == "BO_") { attr->Type = AttributeType::CycleTime; attr->MsgId = clear_msgid(atoi(items[3].c_str())); diff --git a/src/parser/dbclineparser.h b/src/parser/dbclineparser.h index d0400b0..5d76237 100644 --- a/src/parser/dbclineparser.h +++ b/src/parser/dbclineparser.h @@ -27,7 +27,7 @@ //The factorand offset define the linear conversion rule to convert the signals raw //value into the signal's physical value and vice versa: //physical_value = raw_value * factor + offset -//raw_value = (physical_value � offset) / factor +//raw_value = (physical_value - offset) / factor //As can be seen in the conversion rule formulas the factor must not be 0. //minimum = double; //maximum = double; diff --git a/src/types/message.h b/src/types/message.h index d6a2828..56251ca 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -38,11 +38,15 @@ typedef struct uint8_t LengthBit; + // this flag shows when factor (or offset) is double + // it is used when *_from_S and _to_S macros is generated + bool IsDoubleSig; + double Factor; double Offset; - int32_t RawOffset; + double RawOffset; BitLayout Order; From 4c18e408a3eee02ac20b7589f33542cc95f8e964 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jan 2021 21:50:36 +0300 Subject: [PATCH 024/181] Fixed minor issues. --- src/codegen/c-main-generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index c1f6918..ce2d39d 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -351,8 +351,8 @@ void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) fwriter->AppendLine(PrintF(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); - fwriter->AppendLine(PrintF(" cframe->IDE = %_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(PrintF(" return %_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(PrintF(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str(), 2)); + fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine("}", 2); } @@ -376,6 +376,6 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) fwriter->AppendText(PrintF(" *_len = %s_DLC;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(PrintF(" return %_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine("}", 2); } From b8ad3cb33871bdcfbc7cfbf28101895c33dbc958 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jan 2021 21:51:24 +0300 Subject: [PATCH 025/181] Helpers added. --- DbcScanner.vcxproj | 3 +++ DbcScanner.vcxproj.filters | 6 +++++ src/codegen/c-main-generator.cpp | 15 ++---------- src/helpers/formatter.cpp | 40 ++++++++++++++++++++++++++++++++ src/helpers/formatter.h | 10 ++++++++ 5 files changed, 61 insertions(+), 13 deletions(-) create mode 100644 src/helpers/formatter.cpp create mode 100644 src/helpers/formatter.h diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj index 2375be9..2c06276 100644 --- a/DbcScanner.vcxproj +++ b/DbcScanner.vcxproj @@ -78,6 +78,7 @@ true + $(ProjectDir)/src;$(IncludePath) false @@ -159,6 +160,7 @@ + @@ -172,6 +174,7 @@ + diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters index 1b292c0..19722a5 100644 --- a/DbcScanner.vcxproj.filters +++ b/DbcScanner.vcxproj.filters @@ -48,6 +48,9 @@ Header Files + + Header Files + @@ -68,5 +71,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index ce2d39d..18f2792 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -7,6 +7,7 @@ #include #include #include +#include "helpers/formatter.h" #include "c-main-generator.h" @@ -16,18 +17,6 @@ static const size_t kWBUFF_len = 2048; static char wbuff[kWBUFF_len] = { 0 }; -static std::string __typeprint[] = -{ - "int8_t", - "int16_t", - "int32_t", - "int64_t", - "uint8_t", - "uint16_t", - "uint32_t", - "uint64_t" -}; - char* PrintF(const char* format, ...) { va_list args; @@ -256,7 +245,7 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi std::string dtype = ""; - dtype += " " + __typeprint[(int)sig.Type] + " " + sig.Name; + dtype += " " + PrintType((int)sig.Type) + " " + sig.Name; if (bits && (sig.LengthBit < 8)) { diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp new file mode 100644 index 0000000..bc0dc53 --- /dev/null +++ b/src/helpers/formatter.cpp @@ -0,0 +1,40 @@ +#include "formatter.h" +#include +#include + +static const size_t kMaxWorkArrLength = 4096; + +static char work_buff[kMaxWorkArrLength] = { 0 }; + +static const std::string __typeprint[8] = +{ + "int8_t", + "int16_t", + "int32_t", + "int64_t", + "uint8_t", + "uint16_t", + "uint32_t", + "uint64_t" +}; + +const char* StrPrint(const char* format, ...) +{ + va_list args; + va_start(args, format); + + vsnprintf(work_buff, kMaxWorkArrLength, format, args); + + va_end(args); + return work_buff; +} + +std::string PrintType(uint8_t id) +{ + if (id < 8) + { + return __typeprint[id]; + } + + return ""; +} diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h new file mode 100644 index 0000000..9e6430b --- /dev/null +++ b/src/helpers/formatter.h @@ -0,0 +1,10 @@ +#pragma once + +#include +#include +#include +#include + +const char* StrPrint(const char* format, ...); + +std::string PrintType(uint8_t tid); From 3d57bbe344cf709bdc74a2ba7f6ee6381fe41bb9 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jan 2021 21:51:59 +0300 Subject: [PATCH 026/181] Do not make signal conversation inside unpack function. --- src/codegen/c-sigprinter.cpp | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 1a367c9..833244f 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -195,41 +195,6 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, } } - if (!sig->IsDoubleSig) - { - int32_t i_fact = (int32_t)sig->Factor; - int32_t i_offset = (int32_t)sig->Offset; - - // For signals which have both: factor and offset integer type - // the physical value can be calculated inside unpack expression - if (sig->Offset < 0) - { - if (i_fact != 1) - { - snprintf(workbuff, WBUFF_LEN, "((%s) * %d) - %d", tosigexpr.c_str(), i_fact, abs(i_offset)); - } - else - { - snprintf(workbuff, WBUFF_LEN, "(%s) - %d", tosigexpr.c_str(), abs(i_offset)); - } - - tosigexpr = workbuff; - } - else if (sig->Offset > 0) - { - if (i_fact != 1) - { - snprintf(workbuff, WBUFF_LEN, "((%s) * %d) + %d", tosigexpr.c_str(), i_fact, abs(i_offset)); - } - else - { - snprintf(workbuff, WBUFF_LEN, "(%s) + %d", tosigexpr.c_str(), abs(i_offset)); - } - - tosigexpr = workbuff; - } - } - return tosigexpr; } From 11426ccccfdcdd392cf2e7543d389338957b9385 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jan 2021 21:53:17 +0300 Subject: [PATCH 027/181] Added print toS and fromS macros. --- src/codegen/c-main-generator.cpp | 9 ++-- src/codegen/c-sigprinter.cpp | 70 +++++++++++++++++++++++++++++++- src/codegen/c-sigprinter.h | 29 ++++++------- 3 files changed, 87 insertions(+), 21 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 18f2792..137c084 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -92,12 +92,11 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs SignalDescriptor_t& s = m.Signals[signum]; // TODO: print signal to_S and from_S definitions if necessary - //string ret = cprint.PrintSignalPackExpression(sig, msg.MessageName); + if (s.IsDoubleSig == true || ((s.Factor != 1) || (s.Offset != 0))) + { + fwriter->AppendLine(sigprt->PrintPhysicalToRaw(&s, fsd.DRVNAME)); + } - //if (ret != null) - //{ - // fwriter->AppendLine(ret); - //} if (s.Name.size() > max_sig_name_len) max_sig_name_len = s.Name.size(); } diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 833244f..8c837f7 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -1,5 +1,6 @@ #include #include "c-sigprinter.h" +#include "helpers/formatter.h" // work buffer for all snprintf operations static const size_t WBUFF_LEN = 2048; @@ -48,6 +49,72 @@ void CSigPrinter::LoadMessage(const MessageDescriptor_t& message) sigs_expr.push_back(nexpr); } +std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const std::string& drvname) +{ + std::string retstr = ""; + + retstr = StrPrint("// signal: @%s\n", sig->Name.c_str()); + + if (sig->IsDoubleSig) + retstr += StrPrint("#define %s_%s_CovFactor (%f)\n", drvname.c_str(), sig->Name.c_str(), sig->Factor); + else + retstr += StrPrint("#define %s_%s_CovFactor (%d)\n", drvname.c_str(), sig->Name.c_str(), (int32_t)sig->Factor); + + retstr += StrPrint("#define %s_%s_toS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), + PrintType((uint8_t)sig->Type).c_str()); + + if (sig->IsDoubleSig) + { + retstr += StrPrint("(((x) - (%f)) / (%f)) )\n", sig->Offset, sig->Factor); + } + else + { + if (sig->Offset == 0) + { + // only factor + retstr += StrPrint("((x) / (%d)) )\n", (int32_t)sig->Factor); + } + else if (sig->Factor == 1) + { + // only offset + retstr += StrPrint("((x) - (%d)) )\n", (int32_t)sig->Offset); + } + else + { + // full expression + retstr += StrPrint("(((x) - (%d)) / (%d)) )\n", (int32_t)sig->Offset, (int32_t)sig->Factor); + } + } + + retstr += StrPrint("#define %s_%s_fromS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), + PrintType((uint8_t)sig->Type).c_str()); + + if (sig->IsDoubleSig) + { + retstr += StrPrint("(((x) * (%f)) + (%f)) )\n", sig->Factor, sig->Offset); + } + else + { + if (sig->Offset == 0) + { + // only factor + retstr += StrPrint("((x) * (%d)) )\n", (int32_t)sig->Factor); + } + else if (sig->Factor == 1) + { + // only offset + retstr += StrPrint("((x) + (%d)) )\n", (int32_t)sig->Offset); + } + else + { + // full expression + retstr += StrPrint("(((x) * (%d)) + (%d)) )\n", (int32_t)sig->Factor, (int32_t)sig->Offset); + } + } + + return retstr; +} + // This function determines what type will have struct // field for the @signal. It saves the name std::string CSigPrinter::GetSignalType(const SignalDescriptor_t& signal) @@ -94,8 +161,7 @@ int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msgprinter) return ret; } -std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, - std::vector& to_bytes) +std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vector& to_bytes) { // value for collecting expression (to_signal) std::string tosigexpr; diff --git a/src/codegen/c-sigprinter.h b/src/codegen/c-sigprinter.h index 7274fa3..d003dc5 100644 --- a/src/codegen/c-sigprinter.h +++ b/src/codegen/c-sigprinter.h @@ -2,25 +2,26 @@ #include "../types/c-expr.h" -class CSigPrinter -{ -public: - CSigPrinter(); - ~CSigPrinter(); +class CSigPrinter { + public: + CSigPrinter(); + ~CSigPrinter(); - void LoadMessage(const MessageDescriptor_t& message); - void LoadMessages(const std::vector message); + void LoadMessage(const MessageDescriptor_t& message); + void LoadMessages(const std::vector message); -public: - std::vector sigs_expr; + std::string PrintPhysicalToRaw(const SignalDescriptor_t* msg, const std::string& drvname); -private: - std::string GetSignalType(const SignalDescriptor_t& signal); + public: + std::vector sigs_expr; - int32_t BuildCConvertExprs(CiExpr_t* msg); + private: + std::string GetSignalType(const SignalDescriptor_t& signal); - std::string PrintSignalExpr(const SignalDescriptor_t* sig, std::vector& to_bytes); + int32_t BuildCConvertExprs(CiExpr_t* msg); - void AppendToByteLine(std::string& expr, std::string str); + std::string PrintSignalExpr(const SignalDescriptor_t* sig, std::vector& to_bytes); + + void AppendToByteLine(std::string& expr, std::string str); }; From d4e160358e660bdaef5f38f9be7639b84bd2be5a Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 11:30:17 +0300 Subject: [PATCH 028/181] Added more signal type class (3 classes for now). --- src/parser/dbclineparser.cpp | 9 +++++++++ src/types/message.h | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index aa04680..d03e93f 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -161,12 +161,15 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // get info about factor or offset double nature sig->IsDoubleSig = false; + sig->IsSimpleSig = false; // for enabling double conversation the factor or offset // substring must have dot ('.') character if (valpart[3].find_first_of('.') != std::string::npos || valpart[4].find_first_of('.') != std::string::npos) + { sig->IsDoubleSig = true; + } // factor = double; // offset = double; @@ -193,6 +196,12 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& sig->Signed = (valpart[2].find('-') == -1) ? 0 : 1; sig->Type = GetSigType(sig); + + // mark all simple signals to make using them easier + if (!sig->IsDoubleSig && (sig->Factor == 1) && (sig->Offset == 0)) + { + sig->IsSimpleSig = true; + } } if (tailpart.size() == 3) diff --git a/src/types/message.h b/src/types/message.h index 56251ca..d920261 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -38,10 +38,21 @@ typedef struct uint8_t LengthBit; + // By next two fields any signal can be strictly related to one of + // 3 signal type: + // 1 double based scaled value (IsDoubleSig == true) + // 2 integer based scaled value (IsDoubleSig == false && IsSimpleSig == false) + // 3 simple (IsDoubleSig == false && IsSimpleSig == true) + // this flag shows when factor (or offset) is double // it is used when *_from_S and _to_S macros is generated bool IsDoubleSig; + // this flag shows if the signal has factor = 1 and offset = 0 + // to reject any sigfloat or "toS"/"fromS" operations + // this only when : IsDoubleSig == true || ((s.Factor != 1) || (s.Offset != 0) + bool IsSimpleSig; + double Factor; double Offset; From e95d50a2234498f3991730ab162d5754f7fc0363 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 11:31:15 +0300 Subject: [PATCH 029/181] Fixed "fromS" macro - type cast must be skipped. --- src/codegen/c-sigprinter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 8c837f7..aaa8cee 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -86,8 +86,7 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const } } - retstr += StrPrint("#define %s_%s_fromS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), - PrintType((uint8_t)sig->Type).c_str()); + retstr += StrPrint("#define %s_%s_fromS(x) ( ", drvname.c_str(), sig->Name.c_str()); if (sig->IsDoubleSig) { From 2cd8af4b76dd8f849c34b96a8cba4eab08fe4cfd Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 11:32:02 +0300 Subject: [PATCH 030/181] Added "*_phys" sigs and auto toS/fromS conversion. --- src/codegen/c-main-generator.cpp | 101 +++++++++++++++++++++++++++++-- src/codegen/fs-creator.cpp | 3 + src/codegen/fs-creator.h | 1 + 3 files changed, 100 insertions(+), 5 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 137c084..857e579 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -91,8 +91,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs { SignalDescriptor_t& s = m.Signals[signum]; - // TODO: print signal to_S and from_S definitions if necessary - if (s.IsDoubleSig == true || ((s.Factor != 1) || (s.Offset != 0))) + if (!s.IsSimpleSig) { fwriter->AppendLine(sigprt->PrintPhysicalToRaw(&s, fsd.DRVNAME)); } @@ -282,6 +281,21 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi } fwriter->AppendLine("", 2); + + if (sig.IsDoubleSig) + { + // this code only required be d-signals (floating point values based) + // it placed additional signals to struct for conversion + // to/from physical values. For non-simple and non-double signal + // there is no necessity to create addition fields + // @sigfloat_t must be typedefed by user (e.g. double / float) + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); + + fwriter->AppendLine(PrintF(" sigfloat_t %s_phys;", sig.Name.c_str())); + + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + + } } void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) @@ -291,6 +305,28 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) auto expr = sgs->to_signals[num]; fwriter->AppendLine(PrintF(" _m->%s = %s;", sgs->msg.Signals[num].Name.c_str(), expr.c_str())); + + // print sigfloat conversion + if (sgs->msg.Signals[num].IsDoubleSig) + { + fwriter->AppendLine(PrintF("\n#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(PrintF(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", + sgs->msg.Signals[num].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[num].Name.c_str(), sgs->msg.Signals[num].Name.c_str())); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + } + + else if (!sgs->msg.Signals[num].IsSimpleSig) + { + // print unpack conversion for non-simple and non-double signals + // for this case conversion fromS is performed to signal itself + // without (sigfloat_t) type casting + fwriter->AppendLine(PrintF("\n#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(PrintF(" _m->%s = (%s_%s_fromS(_m->%s));", + sgs->msg.Signals[num].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[num].Name.c_str(), sgs->msg.Signals[num].Name.c_str())); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + } } fwriter->AppendLine(""); @@ -323,9 +359,36 @@ void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) fwriter->AppendLine("{"); // pring array content clearin loop - fwriter->AppendLine( - PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); cframe->Data[i++] = 0);", - sgs->msg.Name.c_str()), 2); + fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); cframe->Data[i++] = 0);", + sgs->msg.Name.c_str()), 2); + + // first step is to put code for sigfloat conversion, before + // sigint packing to bytes. + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str()), 2); + + for (size_t n = 0; n < sgs->to_signals.size(); n++) + { + if (sgs->msg.Signals[n].IsSimpleSig == false) + { + if (sgs->msg.Signals[n].IsDoubleSig) + { + // print toS from *_phys to original named sigint (integer duplicate of signal) + fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s_phys);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + } + else + { + // print toS from original named signal to itself (because this signal + // has enough space for scaling by factor and proper sign + fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + } + } + } + + fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usesigfloat_def.c_str()), 2); for (size_t i = 0; i < sgs->to_bytes.size(); i++) { @@ -352,6 +415,34 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); _d[i++] = 0);", sgs->msg.Name.c_str()), 2); + // first step is to put code for sigfloat conversion, before + // sigint packing to bytes. + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str()), 2); + + for (size_t n = 0; n < sgs->to_signals.size(); n++) + { + if (sgs->msg.Signals[n].IsSimpleSig == false) + { + if (sgs->msg.Signals[n].IsDoubleSig) + { + // print toS from *_phys to original named sigint (integer duplicate of signal) + fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s_phys);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + } + else + { + // print toS from original named signal to itself (because this signal + // has enough space for scaling by factor and proper sign + fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + } + } + } + + fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + for (size_t i = 0; i < sgs->to_bytes.size(); i++) { if (sgs->to_bytes[i].size() < 2) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 3f0cac9..cf73ceb 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -102,6 +102,9 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.DRVNAME.c_str()); FS.usemon_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.DRVNAME.c_str()); + FS.usesigfloat_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.DRVNAME.c_str()); FS.usesruct_def = _tmpb; } diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index d4d824d..15f936d 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -22,6 +22,7 @@ typedef struct std::string usebits_def; std::string usesruct_def; std::string usemon_def; + std::string usesigfloat_def; } FsDescriptor_t; From 22ea2f10c8fb54aef0f20a9a55481066f04274a2 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 13:17:35 +0300 Subject: [PATCH 031/181] Fixed bug in sign of sigfloat type signal. --- src/parser/dbclineparser.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index d03e93f..023adeb 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -166,7 +166,7 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // for enabling double conversation the factor or offset // substring must have dot ('.') character if (valpart[3].find_first_of('.') != std::string::npos || - valpart[4].find_first_of('.') != std::string::npos) + valpart[4].find_first_of('.') != std::string::npos) { sig->IsDoubleSig = true; } @@ -317,7 +317,6 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) } } } - else { // this type definition is simple (without @@ -325,10 +324,10 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) // main driver, so to determine type simple // operations is needed max_v = (uint64_t)(std::pow(2, sig->LengthBit) - 1); - - if (sig->Signed) + + if (!sig->Signed) { - is_unsigned = 0; + is_unsigned = 1; } for (uint8_t i = 0; i < 4; i++) From bd87a48c33f60e379ee60f6139a9caba76407ed5 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 13:17:53 +0300 Subject: [PATCH 032/181] Fixed generator formatting bugs. --- src/codegen/c-main-generator.cpp | 28 ++++++++++++++-------------- src/codegen/c-sigprinter.cpp | 5 ++--- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 857e579..89c4797 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -52,6 +52,9 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); + fwriter->AppendLine("// include current dbc-driver compilation config"); + fwriter->AppendLine(PrintF("#include \"%s-config.h\"", fsd.drvname.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str())); fwriter->AppendText( @@ -130,9 +133,9 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine(PrintF("#endif // %s", fsd.usebits_def.c_str()), 2); // start mon1 section - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usebits_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str()), 2); fwriter->AppendLine(" FrameMonitor_t mon1;", 2); - fwriter->AppendLine(PrintF("#endif // %s", fsd.usebits_def.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 2); fwriter->AppendLine(PrintF("} %s_t;", m.Name.c_str()), 2); } @@ -149,15 +152,13 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); - fwriter->AppendLine( - PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine("#else"); - fwriter->AppendLine( - PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); } @@ -169,7 +170,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs // 3 step is to print main source file // include main header file - fwriter->AppendLine(PrintF("#include ""%s""", fsd.core_h.fname.c_str()), 3); + fwriter->AppendLine(PrintF("#include \"%s\"", fsd.core_h.fname.c_str()), 3); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function @@ -181,7 +182,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs "// function signature for CRC calculation\n" "// function signature for getting system tick value (100 us step)\n"); - fwriter->AppendLine(PrintF("#include ""%s-fmon.h""", fsd.drvname.c_str()), 2); + fwriter->AppendLine(PrintF("#include \"%s-fmon.h\"", fsd.drvname.c_str()), 2); fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 3); @@ -206,7 +207,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str()), 2); // second function - fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(const %s_t* _m, __CoderDbcCanFrame_t__* cframe)", + fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); WritePackStructBody(sigprt->sigs_expr[num]); @@ -214,9 +215,8 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("#else", 2); // third function - fwriter->AppendLine( - PrintF("uint32_t Pack_%s_%s(const %s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); WritePackArrayBody(sigprt->sigs_expr[num]); diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index aaa8cee..40d9d1a 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -182,8 +182,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec snprintf(workbuff, WBUFF_LEN, "((_d[%d] >> %d) & (%s))", bn, bbc - slen, msk[slen].c_str()); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->{%s} & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), - bbc - slen); + snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), bbc - slen); AppendToByteLine(to_bytes[bn], workbuff); } else if (bbc == slen) @@ -275,4 +274,4 @@ void CSigPrinter::AppendToByteLine(std::string& expr, std::string str) // First appending expr = str; } -} \ No newline at end of file +} From 950ed796cd13c803481baea28bfbd8ed89fee87b Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 20:53:37 +0300 Subject: [PATCH 033/181] Fixed warning on unused param (dlc) in Unpack function. --- src/codegen/c-main-generator.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 89c4797..405441a 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -195,9 +195,13 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; // first function - fwriter->AppendLine( - PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + + // put dirt trick to avoid warning about unusing parameter + // (dlc) when monitora are disabled. trick is better than + // selection different signatures because of external API consistency + fwriter->AppendLine(" dlc_ = dlc_;"); WriteUnpackBody(sigprt->sigs_expr[num]); From ba889648fc02f850495959dcf01b9c8ce64ee793 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Jan 2021 20:55:01 +0300 Subject: [PATCH 034/181] Fixed comment style. CYC value bug. --- src/codegen/c-main-generator.cpp | 35 +++++++++++++++++++++++--------- src/parser/dbcscanner.cpp | 10 +++++---- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 405441a..c09a315 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -146,9 +146,8 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - fwriter->AppendLine( - PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", + m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); @@ -269,19 +268,35 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendText(PrintF(" Bits=%2d", sig.LengthBit)); - if (sig.Unit.size() > 0) + if (sig.IsDoubleSig) { - fwriter->AppendText(PrintF(" Unit:'%-13s'", sig.Unit.c_str())); - } + if (sig.Offset != 0) + { + fwriter->AppendText(PrintF(" Offset= %-18f", sig.Offset)); + } - if (sig.Offset != 0) + if (sig.Factor != 1) + { + fwriter->AppendText(PrintF(" Factor= %-15f", sig.Factor)); + } + } + else if (sig.IsSimpleSig == false) { - fwriter->AppendText(PrintF(" Offset= %-18f", sig.Offset)); + // 2 type of signal + if (sig.Offset != 0) + { + fwriter->AppendText(PrintF(" Offset= %-18d", sig.Offset)); + } + + if (sig.Factor != 1) + { + fwriter->AppendText(PrintF(" Factor= %-15d", sig.Factor)); + } } - if (sig.Factor != 1) + if (sig.Unit.size() > 0) { - fwriter->AppendText(PrintF(" Factor= %-15d", sig.LengthBit)); + fwriter->AppendText(PrintF(" Unit:'%s'", sig.Unit.c_str())); } fwriter->AppendLine("", 2); diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index c40c6fd..2057953 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -76,6 +76,8 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) // create instance for the detected message pMsg = new MessageDescriptor_t; + SetDefualtMessage(pMsg); + if (!lparser.ParseMessageLine(pMsg, sline)) { // the message has invalid format so drop it and wait next one @@ -199,10 +201,10 @@ void DbcScanner::AddMessage(MessageDescriptor_t* message) { // sort signals by start bit std::sort(message->Signals.begin(), message->Signals.end(), - [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool - { - return a.StartBit < b.StartBit; - }); + [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool + { + return a.StartBit < b.StartBit; + }); for (size_t i = 0; i < message->Signals.size(); i++) { From d6b8c463815193e76467c93efda9cb89135e7d72 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 31 Jan 2021 17:35:25 +0300 Subject: [PATCH 035/181] Small refactoring. --- src/parser/dbcscanner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 2057953..cff5676 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -36,7 +36,9 @@ DbcScanner::~DbcScanner() int32_t DbcScanner::TrimDbcText(istream& readstrm) { msgs.clear(); - + + readstrm.clear(); + readstrm.seekg(0); // Search each message and signals in dbc source data, // and fill @msgs collection ParseMessageInfo(readstrm); From 25ba5569bfecf329ecc80136599a32e11d6c543a Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 31 Jan 2021 17:46:19 +0300 Subject: [PATCH 036/181] Source files filling moved to dedicated functions. --- src/codegen/c-main-generator.cpp | 72 ++++++++++++++++++-------------- src/codegen/c-main-generator.h | 3 ++ 2 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index c09a315..dcfcc98 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -48,14 +48,26 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs }); // 2 step is to print main head file + Gen_MainHeader(); + + // 3 step is to print main source file + Gen_MainSource(); + + // 4 step is to pring fmon head file + + // 5 step is to print fmon source file +} + +void CiMainGenerator::Gen_MainHeader() +{ fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); fwriter->AppendLine("// include current dbc-driver compilation config"); - fwriter->AppendLine(PrintF("#include \"%s-config.h\"", fsd.drvname.c_str()), 2); + fwriter->AppendLine(PrintF("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str())); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); fwriter->AppendText( "// This file must define:\n" @@ -66,7 +78,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs "\n" ); - fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 3); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 3); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { @@ -96,22 +108,21 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs if (!s.IsSimpleSig) { - fwriter->AppendLine(sigprt->PrintPhysicalToRaw(&s, fsd.DRVNAME)); + fwriter->AppendText(sigprt->PrintPhysicalToRaw(&s, fdesc->DRVNAME)); } if (s.Name.size() > max_sig_name_len) max_sig_name_len = s.Name.size(); } - // empty line before struct definition - fwriter->AppendLine("\n"); + fwriter->AppendText("\n"); fwriter->AppendLine(PrintF("typedef struct")); - fwriter->AppendLine("{\n"); + fwriter->AppendLine("{"); // Write section for bitfielded part - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usebits_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usebits_def.c_str()), 2); for (size_t signum = 0; signum < m.Signals.size(); signum++) { @@ -130,12 +141,12 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs WriteSigStructField(sig, false, max_sig_name_len); } - fwriter->AppendLine(PrintF("#endif // %s", fsd.usebits_def.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usebits_def.c_str()), 2); // start mon1 section - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str()), 2); fwriter->AppendLine(" FrameMonitor_t mon1;", 2); - fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 2); fwriter->AppendLine(PrintF("} %s_t;", m.Name.c_str()), 2); } @@ -147,33 +158,35 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; fwriter->AppendLine(PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str())); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesruct_def.c_str())); fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine("#else"); fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesruct_def.c_str()), 2); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); // save fwrite cached text to file - fwriter->Flush(fsd.core_h.fpath); + fwriter->Flush(fdesc->core_h.fpath); +} - // 3 step is to print main source file +void CiMainGenerator::Gen_MainSource() +{ // include main header file - fwriter->AppendLine(PrintF("#include \"%s\"", fsd.core_h.fname.c_str()), 3); + fwriter->AppendLine(PrintF("#include \"%s\"", fdesc->core_h.fname.c_str()), 3); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usemon_def.c_str())); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); fwriter->AppendText( "// This file must define:\n" @@ -181,9 +194,9 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs "// function signature for CRC calculation\n" "// function signature for getting system tick value (100 us step)\n"); - fwriter->AppendLine(PrintF("#include \"%s-fmon.h\"", fsd.drvname.c_str()), 2); + fwriter->AppendLine(PrintF("#include \"%s-fmon.h\"", fdesc->drvname.c_str()), 2); - fwriter->AppendLine(PrintF("#endif // %s", fsd.usemon_def.c_str()), 3); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 3); // for each message 3 functions must be defined - 1 unpack function, // 2: pack with raw signature @@ -195,7 +208,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs // first function fwriter->AppendLine(PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); // put dirt trick to avoid warning about unusing parameter // (dlc) when monitora are disabled. trick is better than @@ -207,11 +220,11 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fwriter->AppendLine("}", 2); // next one is the pack function for using with CANFrame struct - fwriter->AppendLine(PrintF("#ifdef %s", fsd.usesruct_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesruct_def.c_str()), 2); // second function fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); WritePackStructBody(sigprt->sigs_expr[num]); @@ -219,17 +232,14 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs // third function fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", - m.Name.c_str(), fsd.DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); WritePackArrayBody(sigprt->sigs_expr[num]); - fwriter->AppendLine(PrintF("#endif // %s", fsd.usesruct_def.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesruct_def.c_str()), 2); } - fwriter->Flush(fsd.core_c.fpath); - // 4 step is to pring fmon head file - - // 5 step is to print fmon source file + fwriter->Flush(fdesc->core_c.fpath); } void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 8755269..a1c4ee3 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -15,6 +15,9 @@ class CiMainGenerator { private: + void Gen_MainHeader(); + void Gen_MainSource(); + void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); void WriteUnpackBody(const CiExpr_t* sgs); From e634227dfe97a8e471425092bdf72848bb837bc5 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 31 Jan 2021 18:37:08 +0300 Subject: [PATCH 037/181] Added fmon-header file generation. --- src/codegen/c-main-generator.cpp | 33 ++++++++++++++++++++++++++++++++ src/codegen/c-main-generator.h | 1 + src/codegen/fs-creator.cpp | 28 +++++++++++++++++---------- src/codegen/fs-creator.h | 3 +++ 4 files changed, 55 insertions(+), 10 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index dcfcc98..8e0cae8 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -54,6 +54,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs Gen_MainSource(); // 4 step is to pring fmon head file + Gen_FMonHeader(); // 5 step is to print fmon source file } @@ -242,6 +243,38 @@ void CiMainGenerator::Gen_MainSource() fwriter->Flush(fdesc->core_c.fpath); } +void CiMainGenerator::Gen_FMonHeader() +{ + fwriter->AppendLine("#pragma once", 2); + + fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); + + fwriter->AppendLine(PrintF("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); + + // put diagmonitor ifdef selection for including @drv-fmon header + // with FMon_* signatures to call from unpack function + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine("#include \"canmonitorutil.h\""); + fwriter->AppendLine("/*\n\ +This file contains the prototypes of all the functions that will be called\n\ +from each Unpack_*name* function to detect DBC related errors\n\ +It is the user responsibility to defined these functions in the\n\ +separated .c file. If it won't be done the linkage error will happen\n*/", 2); + + for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + { + auto msg = &(sigprt->sigs_expr[num]->msg); + fwriter->AppendLine(PrintF("void FMon_%s_%s(FrameMonitor_t* _mon);", + msg->Name.c_str(), fdesc->drvname.c_str())); + } + + fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usemon_def.c_str()), 2); + + fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); + + fwriter->Flush(fdesc->fmon_h.fpath); +} + void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) { if (sig.CommentText.size() > 0) diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index a1c4ee3..1c153ed 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -17,6 +17,7 @@ class CiMainGenerator { void Gen_MainHeader(); void Gen_MainSource(); + void Gen_FMonHeader(); void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index cf73ceb..211326e 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -13,10 +13,10 @@ static char _tmpb[kTmpLen]; std::string str_toupper(std::string s) { std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::toupper(c); - }); + [](unsigned char c) + { + return std::toupper(c); + }); return s; } @@ -24,10 +24,10 @@ std::string str_toupper(std::string s) std::string str_tolower(std::string s) { std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::tolower(c); - }); + [](unsigned char c) + { + return std::tolower(c); + }); return s; } @@ -89,13 +89,21 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.core_c.fpath = work_dir_path + "/" + FS.core_c.fname; FS.util_h.dir = work_dir_path; - FS.util_h.fname = FS.drvname + "_binutil" + ".h"; + FS.util_h.fname = FS.drvname + "-binutil" + ".h"; FS.util_h.fpath = work_dir_path + "/" + FS.util_h.fname; FS.util_c.dir = work_dir_path; - FS.util_c.fname = FS.drvname + "_binutil" + ".c"; + FS.util_c.fname = FS.drvname + "-binutil" + ".c"; FS.util_c.fpath = work_dir_path + "/" + FS.util_c.fname; + FS.fmon_h.dir = work_dir_path; + FS.fmon_h.fname = FS.drvname + "-fmon.h"; + FS.fmon_h.fpath = work_dir_path + "/" + FS.fmon_h.fname; + + FS.fmon_c.dir = work_dir_path; + FS.fmon_c.fname = FS.drvname + "-fmon.c"; + FS.fmon_c.fpath = work_dir_path + "/" + FS.fmon_h.fname; + snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.DRVNAME.c_str()); FS.usebits_def = _tmpb; diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 15f936d..610c229 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -19,6 +19,9 @@ typedef struct OutFileDescriptor_t util_h; OutFileDescriptor_t util_c; + OutFileDescriptor_t fmon_h; + OutFileDescriptor_t fmon_c; + std::string usebits_def; std::string usesruct_def; std::string usemon_def; From a719f7297f0d867915bb14ed2fe9f785c4c25762 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 31 Jan 2021 18:58:44 +0300 Subject: [PATCH 038/181] Added fmon-source file generation. --- src/codegen/c-main-generator.cpp | 25 +++++++++++++++++++++++++ src/codegen/c-main-generator.h | 1 + src/codegen/fs-creator.cpp | 18 +++++++++--------- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 8e0cae8..7de8856 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -57,6 +57,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs Gen_FMonHeader(); // 5 step is to print fmon source file + Gen_FMonSource(); } void CiMainGenerator::Gen_MainHeader() @@ -275,6 +276,30 @@ separated .c file. If it won't be done the linkage error will happen\n*/", 2); fwriter->Flush(fdesc->fmon_h.fpath); } +void CiMainGenerator::Gen_FMonSource() +{ + fwriter->AppendLine(PrintF("#include \"%s\"", fdesc->fmon_h.fname.c_str()), 2); + // put diagmonitor ifdef selection for including @drv-fmon header +// with FMon_* signatures to call from unpack function + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str()), 2); + + fwriter->AppendLine("/*\n\ +Put the monitor function content here, keep in mind -\n\ +next generation will completely clear all manually added code (!)\n\ +*/\n"); + + for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + { + auto msg = &(sigprt->sigs_expr[num]->msg); + fwriter->AppendLine(PrintF("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n\}\n", + msg->Name.c_str(), fdesc->drvname.c_str())); + } + + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str())); + + fwriter->Flush(fdesc->fmon_c.fpath); +} + void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) { if (sig.CommentText.size() > 0) diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 1c153ed..8ef05be 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -18,6 +18,7 @@ class CiMainGenerator { void Gen_MainHeader(); void Gen_MainSource(); void Gen_FMonHeader(); + void Gen_FMonSource(); void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 211326e..08d0152 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -13,10 +13,10 @@ static char _tmpb[kTmpLen]; std::string str_toupper(std::string s) { std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::toupper(c); - }); + [](unsigned char c) + { + return std::toupper(c); + }); return s; } @@ -24,10 +24,10 @@ std::string str_toupper(std::string s) std::string str_tolower(std::string s) { std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::tolower(c); - }); + [](unsigned char c) + { + return std::tolower(c); + }); return s; } @@ -102,7 +102,7 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.fmon_c.dir = work_dir_path; FS.fmon_c.fname = FS.drvname + "-fmon.c"; - FS.fmon_c.fpath = work_dir_path + "/" + FS.fmon_h.fname; + FS.fmon_c.fpath = work_dir_path + "/" + FS.fmon_c.fname; snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.DRVNAME.c_str()); FS.usebits_def = _tmpb; From 69e9687292e8e15b6dd52142aa06eccae5584e20 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 31 Jan 2021 23:47:51 +0300 Subject: [PATCH 039/181] Added changed for Linux building. --- src/codegen/fs-creator.cpp | 1 + src/parser/dbclineparser.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 08d0152..2088878 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -4,6 +4,7 @@ #include #include #include +#include static const int32_t kTmpLen = 1024; diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 023adeb..894ff42 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -1,5 +1,7 @@ #include "dbclineparser.h" #include +#include +#include // Message line definitions static const std::string regMessage = "[^A-Za-z0-9_.-]"; @@ -166,7 +168,7 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // for enabling double conversation the factor or offset // substring must have dot ('.') character if (valpart[3].find_first_of('.') != std::string::npos || - valpart[4].find_first_of('.') != std::string::npos) + valpart[4].find_first_of('.') != std::string::npos) { sig->IsDoubleSig = true; } @@ -324,7 +326,7 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) // main driver, so to determine type simple // operations is needed max_v = (uint64_t)(std::pow(2, sig->LengthBit) - 1); - + if (!sig->Signed) { is_unsigned = 1; From 362a4d1a16d9cd515e1b70cdffcd8bf58b7abe64 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 3 Feb 2021 16:57:30 +0300 Subject: [PATCH 040/181] Removed empty phys macro in pack functions. --- src/codegen/c-main-generator.cpp | 45 +++++++++++++++++--------------- src/parser/dbcscanner.cpp | 4 +++ src/types/message.h | 3 +++ 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 7de8856..10c17cb 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -502,33 +502,36 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); _d[i++] = 0);", sgs->msg.Name.c_str()), 2); - // first step is to put code for sigfloat conversion, before - // sigint packing to bytes. - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str()), 2); - - for (size_t n = 0; n < sgs->to_signals.size(); n++) + if (sgs->msg.hasPhys) { - if (sgs->msg.Signals[n].IsSimpleSig == false) + // first step is to put code for sigfloat conversion, before + // sigint packing to bytes. + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str()), 2); + + for (size_t n = 0; n < sgs->to_signals.size(); n++) { - if (sgs->msg.Signals[n].IsDoubleSig) + if (sgs->msg.Signals[n].IsSimpleSig == false) { - // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s_phys);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); - } - else - { - // print toS from original named signal to itself (because this signal - // has enough space for scaling by factor and proper sign - fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + if (sgs->msg.Signals[n].IsDoubleSig) + { + // print toS from *_phys to original named sigint (integer duplicate of signal) + fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s_phys);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + } + else + { + // print toS from original named signal to itself (because this signal + // has enough space for scaling by factor and proper sign + fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + } } } - } - fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + } for (size_t i = 0; i < sgs->to_bytes.size(); i++) { diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index cff5676..b994801 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -97,6 +97,9 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) { // put successfully parsed signal to the message signals pMsg->Signals.push_back(sig); + + if (sig.IsDoubleSig) + pMsg->hasPhys = true; } } } @@ -240,4 +243,5 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->RecS.clear(); message->Signals.clear(); message->Transmitter = ""; + message->hasPhys = false; } diff --git a/src/types/message.h b/src/types/message.h index d920261..8acb8da 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -106,6 +106,9 @@ typedef struct // List of Message signals std::vector Signals; + // flag about having sigfloat fields + bool hasPhys; + // Message comment std::string CommentText; From d7fdcafbd321f5fe38fce92796352b36acff6652 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 3 Feb 2021 16:59:49 +0300 Subject: [PATCH 041/181] Added auto rolling handling code. --- src/codegen/c-main-generator.cpp | 44 +++++++++++++++++++++++++++----- src/codegen/fs-creator.cpp | 4 +++ src/codegen/fs-creator.h | 1 + src/parser/dbcscanner.cpp | 8 ++++++ src/types/message.h | 3 +++ 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 10c17cb..1afcd05 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -126,6 +126,16 @@ void CiMainGenerator::Gen_MainHeader() // Write section for bitfielded part fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usebits_def.c_str()), 2); + SignalDescriptor_t rollsig; + + if (m.RollSig != nullptr) + { + // rolling counter is detected + rollsig = (*m.RollSig); + rollsig.CommentText = ""; + rollsig.Name += "_expt"; + } + for (size_t signum = 0; signum < m.Signals.size(); signum++) { SignalDescriptor_t& sig = m.Signals[signum]; @@ -133,6 +143,13 @@ void CiMainGenerator::Gen_MainHeader() WriteSigStructField(sig, true, max_sig_name_len); } + if (m.RollSig != nullptr) + { + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str()), 2); + WriteSigStructField(rollsig, true, max_sig_name_len); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->useroll_def.c_str()), 2); + } + // Write clean part fwriter->AppendLine("#else", 2); @@ -143,6 +160,13 @@ void CiMainGenerator::Gen_MainHeader() WriteSigStructField(sig, false, max_sig_name_len); } + if (m.RollSig != nullptr) + { + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str()), 2); + WriteSigStructField(rollsig, false, max_sig_name_len); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->useroll_def.c_str()), 2); + } + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usebits_def.c_str()), 2); // start mon1 section @@ -422,16 +446,22 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(" // check DLC correctness"); fwriter->AppendLine(PrintF(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); - - - // TODO: put CRC and ROLLING COUNTER tests here - // 1 - // 2 - - fwriter->AppendLine(" _m->mon1.last_cycle = GetSysTick();"); fwriter->AppendLine(" _m->mon1.frame_cnt++;", 2); + if (sgs->msg.RollSig != nullptr) + { + // Put rolling monitor here + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(PrintF(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", + sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); + fwriter->AppendLine(PrintF(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1), 2); + // Put rolling monitor here + fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); + } + + auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->drvname; fwriter->AppendLine(PrintF(" %s(&_m->mon1);", Fmon_func.c_str())); diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 2088878..842e7c2 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -116,6 +116,10 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.DRVNAME.c_str()); FS.usesruct_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.DRVNAME.c_str()); + FS.useroll_def = _tmpb; + } return ret; diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 610c229..0034ee6 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -26,6 +26,7 @@ typedef struct std::string usesruct_def; std::string usemon_def; std::string usesigfloat_def; + std::string useroll_def; } FsDescriptor_t; diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index b994801..53ed525 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -146,6 +146,13 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { // signal has been found, update commnet text msg->Signals[i].CommentText = cmmnt.Text; + + // 1 test if signal is rolling + if (cmmnt.Text.find("") != std::string::npos) + { + // set the RollSig to generate necessary code + msg->RollSig = &msg->Signals[i]; + } } } } @@ -244,4 +251,5 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->Signals.clear(); message->Transmitter = ""; message->hasPhys = false; + message->RollSig = nullptr; } diff --git a/src/types/message.h b/src/types/message.h index 8acb8da..832998b 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -109,6 +109,9 @@ typedef struct // flag about having sigfloat fields bool hasPhys; + // pointer to rolling counter signal + SignalDescriptor_t* RollSig; + // Message comment std::string CommentText; From a7d6cf053f2516c2a2a63bd806a063c8ab8cda36 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 3 Feb 2021 17:01:54 +0300 Subject: [PATCH 042/181] Common refactoring and bug fix (field width). --- src/codegen/c-main-generator.cpp | 91 +++++++++++--------------------- src/codegen/c-main-generator.h | 1 + src/parser/dbclineparser.cpp | 2 +- src/parser/dbcscanner.cpp | 2 +- 4 files changed, 35 insertions(+), 61 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 1afcd05..f8db617 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -239,7 +239,7 @@ void CiMainGenerator::Gen_MainSource() // put dirt trick to avoid warning about unusing parameter // (dlc) when monitora are disabled. trick is better than // selection different signatures because of external API consistency - fwriter->AppendLine(" dlc_ = dlc_;"); + fwriter->AppendLine(" (void)dlc_;"); WriteUnpackBody(sigprt->sigs_expr[num]); @@ -415,15 +415,17 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) { auto expr = sgs->to_signals[num]; - fwriter->AppendLine(PrintF(" _m->%s = %s;", sgs->msg.Signals[num].Name.c_str(), expr.c_str())); + // for code shortening + const char* sname = sgs->msg.Signals[num].Name.c_str(); + + fwriter->AppendLine(PrintF(" _m->%s = %s;", sname, expr.c_str())); // print sigfloat conversion if (sgs->msg.Signals[num].IsDoubleSig) { fwriter->AppendLine(PrintF("\n#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", - sgs->msg.Signals[num].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[num].Name.c_str(), sgs->msg.Signals[num].Name.c_str())); + fwriter->AppendLine(PrintF(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, + sname)); fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } @@ -433,9 +435,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // for this case conversion fromS is performed to signal itself // without (sigfloat_t) type casting fwriter->AppendLine(PrintF("\n#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s = (%s_%s_fromS(_m->%s));", - sgs->msg.Signals[num].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[num].Name.c_str(), sgs->msg.Signals[num].Name.c_str())); + fwriter->AppendLine(PrintF(" _m->%s = (%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, sname)); fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } } @@ -474,49 +474,8 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) { fwriter->AppendLine("{"); - - // pring array content clearin loop - fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); cframe->Data[i++] = 0);", - sgs->msg.Name.c_str()), 2); - - // first step is to put code for sigfloat conversion, before - // sigint packing to bytes. - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str()), 2); - - for (size_t n = 0; n < sgs->to_signals.size(); n++) - { - if (sgs->msg.Signals[n].IsSimpleSig == false) - { - if (sgs->msg.Signals[n].IsDoubleSig) - { - // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s_phys);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); - } - else - { - // print toS from original named signal to itself (because this signal - // has enough space for scaling by factor and proper sign - fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); - } - } - } - - fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usesigfloat_def.c_str()), 2); - - for (size_t i = 0; i < sgs->to_bytes.size(); i++) - { - if (sgs->to_bytes[i].size() < 2) - continue; - - fwriter->AppendLine(PrintF(" cframe->Data[%d] |= %s;", i, sgs->to_bytes[i].c_str())); - } - + PrintPackCommonText("cframe->Data", sgs); fwriter->AppendLine(""); - fwriter->AppendLine(PrintF(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str(), 2)); @@ -527,10 +486,30 @@ void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) { fwriter->AppendLine("{"); + PrintPackCommonText("_d", sgs); + fwriter->AppendLine(""); + fwriter->AppendLine(PrintF(" *_len = %s_DLC;", sgs->msg.Name.c_str())); + fwriter->AppendLine(PrintF(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); + fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine("}", 2); +} + +void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs) +{ + // this function will print part of pack function + // which is differs only by arra var name // pring array content clearin loop - fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); _d[i++] = 0);", - sgs->msg.Name.c_str()), 2); + fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", + sgs->msg.Name.c_str(), arrtxt.c_str()), 2); + + if (sgs->msg.RollSig != nullptr) + { + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str())); + fwriter->AppendLine(PrintF(" _m->%s = (_m->%s + 1) & (0x%02XU)", sgs->msg.RollSig->Name.c_str(), + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); + fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); + } if (sgs->msg.hasPhys) { @@ -568,13 +547,7 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) if (sgs->to_bytes[i].size() < 2) continue; - fwriter->AppendLine(PrintF(" _d[%d] |= %s;", i, sgs->to_bytes[i].c_str())); + fwriter->AppendLine(PrintF(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str())); } - fwriter->AppendLine(""); - - fwriter->AppendText(PrintF(" *_len = %s_DLC;", sgs->msg.Name.c_str())); - fwriter->AppendLine(PrintF(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); - fwriter->AppendLine("}", 2); } diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 8ef05be..fd186d8 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -25,6 +25,7 @@ class CiMainGenerator { void WriteUnpackBody(const CiExpr_t* sgs); void WritePackStructBody(const CiExpr_t* sgs); void WritePackArrayBody(const CiExpr_t* sgs); + void PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs); private: std::vector tmpvect; diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 894ff42..c3ac8cf 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -282,7 +282,7 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) { is_unsigned = 1; - max_v = (uint64_t)(std::pow(2, sig->LengthBit)); + max_v = (uint64_t)(std::pow(2, sig->LengthBit)) - 1; max_v *= (int32_t)sig->Factor; diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 53ed525..ac8a378 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -36,7 +36,7 @@ DbcScanner::~DbcScanner() int32_t DbcScanner::TrimDbcText(istream& readstrm) { msgs.clear(); - + readstrm.clear(); readstrm.seekg(0); // Search each message and signals in dbc source data, From e56d43c7430be29c828c423b54336cc858bc91ca Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 3 Feb 2021 18:41:18 +0300 Subject: [PATCH 043/181] Added Checksum signal detection. --- src/codegen/fs-creator.cpp | 2 ++ src/codegen/fs-creator.h | 1 + src/parser/dbcscanner.cpp | 36 ++++++++++++++++++++++++++++++++++++ src/types/message.h | 9 +++++++++ 4 files changed, 48 insertions(+) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 842e7c2..6bab6a7 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -120,6 +120,8 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.DRVNAME.c_str()); FS.useroll_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.DRVNAME.c_str()); + FS.usecsm_def = _tmpb; } return ret; diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 0034ee6..68a1ffe 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -27,6 +27,7 @@ typedef struct std::string usemon_def; std::string usesigfloat_def; std::string useroll_def; + std::string usecsm_def; } FsDescriptor_t; diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index ac8a378..b74b641 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -144,6 +144,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { if (cmmnt.SigName == msg->Signals[i].Name) { + SignalDescriptor_t& sig = msg->Signals[i]; // signal has been found, update commnet text msg->Signals[i].CommentText = cmmnt.Text; @@ -153,6 +154,38 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) // set the RollSig to generate necessary code msg->RollSig = &msg->Signals[i]; } + + extern std::vector resplit(const std::string & s, const std::string & rgx_str); + + size_t openpos = cmmnt.Text.find('<'); + + if (openpos != std::string::npos) + { + size_t closepos = cmmnt.Text.find('>', openpos); + + if ((closepos != std::string::npos) && (closepos > (openpos + 1))) + { + auto substr = cmmnt.Text.substr(openpos + 1, closepos - 1); + + auto meta = resplit(substr, "(\:)"); + + if (meta.size() == 3 && meta[0] == "Checksum") + { + // the signal can be CSM, but additional settings must be + // checked: size, boundary, signal type + bool boundary_ok = (sig.Order == BitLayout::kIntel) ? + ((sig.StartBit / 8) == ((sig.StartBit + sig.LengthBit - 1) / 8)) : + ((sig.StartBit / 8) == ((sig.StartBit - sig.LengthBit + 1) / 8)); + + if (sig.IsSimpleSig && boundary_ok && sig.Signed == false) + { + msg->CsmSig = &sig; + msg->CsmMethod = meta[1]; + msg->CsmOp = atoi(meta[2].c_str()); + } + } + } + } } } } @@ -252,4 +285,7 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->Transmitter = ""; message->hasPhys = false; message->RollSig = nullptr; + message->CsmSig = nullptr; + message->CsmMethod = ""; + message->CsmOp = 0; } diff --git a/src/types/message.h b/src/types/message.h index 832998b..6ede7a2 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -112,6 +112,15 @@ typedef struct // pointer to rolling counter signal SignalDescriptor_t* RollSig; + // pointer to checksum signal + SignalDescriptor_t* CsmSig; + + // keeps the method or crc algorythm (will be passed to CRC calc function) + std::string CsmMethod; + + // option value (will be passed to CRC calc function) + uint32_t CsmOp; + // Message comment std::string CommentText; From 6798987a6054bec586c327cef470ac9927a0d2fb Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 3 Feb 2021 18:53:47 +0300 Subject: [PATCH 044/181] Added CSM check in unpack function. --- src/codegen/c-main-generator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index f8db617..92cc8b3 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -461,6 +461,15 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } + if (sgs->msg.CsmSig != nullptr) + { + // Put checksum check function call here + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str()), 2); + fwriter->AppendLine(PrintF(" _m->mon1.csm_error = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", + sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), + sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); + } auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->drvname; From 0947ebf6eb5a77d7f0869307c984cb7a9b7653e3 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 6 Feb 2021 14:50:38 +0300 Subject: [PATCH 045/181] Added CSM calc and pack in both Pack functions. --- src/codegen/c-main-generator.cpp | 50 +++++++++++++++++++++++--------- src/codegen/c-sigprinter.cpp | 17 +++++++++++ src/parser/dbcscanner.cpp | 1 + src/types/message.h | 6 ++++ 4 files changed, 60 insertions(+), 14 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 92cc8b3..d7d77ac 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -423,7 +423,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // print sigfloat conversion if (sgs->msg.Signals[num].IsDoubleSig) { - fwriter->AppendLine(PrintF("\n#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); fwriter->AppendLine(PrintF(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, sname)); fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); @@ -434,17 +434,18 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // print unpack conversion for non-simple and non-double signals // for this case conversion fromS is performed to signal itself // without (sigfloat_t) type casting - fwriter->AppendLine(PrintF("\n#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); fwriter->AppendLine(PrintF(" _m->%s = (%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, sname)); fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } + else if (num + 1 == sgs->to_signals.size()) + { + // last signal without phys part, put \n manually + fwriter->AppendLine(""); + } } - fwriter->AppendLine(""); - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); - - fwriter->AppendLine(" // check DLC correctness"); fwriter->AppendLine(PrintF(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); fwriter->AppendLine(" _m->mon1.last_cycle = GetSysTick();"); fwriter->AppendLine(" _m->mon1.frame_cnt++;", 2); @@ -452,11 +453,11 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) if (sgs->msg.RollSig != nullptr) { // Put rolling monitor here - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str())); fwriter->AppendLine(PrintF(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); fwriter->AppendLine(PrintF(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1), 2); + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); // Put rolling monitor here fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } @@ -464,10 +465,10 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) if (sgs->msg.CsmSig != nullptr) { // Put checksum check function call here - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str())); fwriter->AppendLine(PrintF(" _m->mon1.csm_error = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), - sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str()), 2); + sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); } @@ -484,7 +485,6 @@ void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) { fwriter->AppendLine("{"); PrintPackCommonText("cframe->Data", sgs); - fwriter->AppendLine(""); fwriter->AppendLine(PrintF(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str(), 2)); @@ -496,7 +496,6 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) { fwriter->AppendLine("{"); PrintPackCommonText("_d", sgs); - fwriter->AppendLine(""); fwriter->AppendLine(PrintF(" *_len = %s_DLC;", sgs->msg.Name.c_str())); fwriter->AppendLine(PrintF(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); @@ -520,11 +519,19 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } + if (sgs->msg.CsmSig != nullptr) + { + // code for clearing checksum + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str())); + fwriter->AppendLine(PrintF(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str())); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); + } + if (sgs->msg.hasPhys) { // first step is to put code for sigfloat conversion, before // sigint packing to bytes. - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); for (size_t n = 0; n < sgs->to_signals.size(); n++) { @@ -548,7 +555,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp } } - fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } for (size_t i = 0; i < sgs->to_bytes.size(); i++) @@ -559,4 +566,19 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp fwriter->AppendLine(PrintF(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str())); } + fwriter->AppendLine(""); + + if (sgs->msg.CsmSig != nullptr) + { + // code for getting checksum value and putting it in array + fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str())); + + fwriter->AppendLine(PrintF(" _m->%s = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d));", + sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), + sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); + + fwriter->AppendLine(PrintF(" %s[%d] = %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); + + fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); + } } diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 40d9d1a..60da799 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -157,6 +157,23 @@ int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msgprinter) msgprinter->to_signals.push_back(PrintSignalExpr(&msgprinter->msg.Signals[i], msgprinter->to_bytes)); } + if (msgprinter->msg.CsmSig != nullptr) + { + std::vector v(8); + + PrintSignalExpr(msgprinter->msg.CsmSig, v); + + for (uint8_t i = 0; i < v.size() && i < 8; i++) + { + if (v[i].size() > 0) + { + msgprinter->msg.CsmToByteExpr = v[i]; + msgprinter->msg.CsmByteNum = i; + break; + } + } + } + return ret; } diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index b74b641..9354f1a 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -288,4 +288,5 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->CsmSig = nullptr; message->CsmMethod = ""; message->CsmOp = 0; + message->CsmToByteExpr = ""; } diff --git a/src/types/message.h b/src/types/message.h index 6ede7a2..732e0c0 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -121,6 +121,12 @@ typedef struct // option value (will be passed to CRC calc function) uint32_t CsmOp; + // expression to load CSM signal to byte + std::string CsmToByteExpr; + + // byte number in payload which keeps CS value + uint8_t CsmByteNum; + // Message comment std::string CommentText; From 79fc48e7334ad79c0ba8173ddaec4109a36e1b69 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 7 Feb 2021 16:41:05 +0300 Subject: [PATCH 046/181] Fixed comment printing. --- src/codegen/c-main-generator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index d7d77ac..bacd557 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -377,12 +377,12 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi // 2 type of signal if (sig.Offset != 0) { - fwriter->AppendText(PrintF(" Offset= %-18d", sig.Offset)); + fwriter->AppendText(PrintF(" Offset= %-18d", (int)sig.Offset)); } if (sig.Factor != 1) { - fwriter->AppendText(PrintF(" Factor= %-15d", sig.Factor)); + fwriter->AppendText(PrintF(" Factor= %-15d", (int)sig.Factor)); } } From 9cd30495ff1e19666e3a43b1aac42a5bf0965c8b Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 7 Feb 2021 17:48:36 +0300 Subject: [PATCH 047/181] Fixed some issues. --- src/parser/dbcscanner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 9354f1a..89c2cbd 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -2,7 +2,7 @@ #include #include -#define MAX_LINE 256 +#define MAX_LINE 4096 char line[MAX_LINE] = { 0 }; @@ -98,7 +98,7 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) // put successfully parsed signal to the message signals pMsg->Signals.push_back(sig); - if (sig.IsDoubleSig) + if (sig.IsDoubleSig || sig.IsSimpleSig != true) pMsg->hasPhys = true; } } From 9e400dbfa15194d17ba77decb2849c7854cfd7ee Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 7 Feb 2021 17:49:35 +0300 Subject: [PATCH 048/181] On ubuntu getline puts (or shows) '\r' at the end of line. --- src/parser/dbcscanner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 89c2cbd..90a751a 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -123,6 +123,11 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) sline = line; + if (sline.size() > 0 && sline.back() < ' ') + { + sline.erase(sline.size() - 1, 1); + } + if (lparser.ParseCommentLine(&cmmnt, sline)) { uint32_t found_msg_id = cmmnt.MsgId; From bc72a4f09daa3b2ec9f010a613d64c5b94adfe94 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 10 Feb 2021 10:18:36 +0300 Subject: [PATCH 049/181] Formatter function for printf. --- src/codegen/c-main-generator.cpp | 239 +++++++++++++++---------------- 1 file changed, 113 insertions(+), 126 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index bacd557..7df98d5 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -13,19 +13,6 @@ static const size_t kMaxDirNum = 1000; -static const size_t kWBUFF_len = 2048; - -static char wbuff[kWBUFF_len] = { 0 }; - -char* PrintF(const char* format, ...) -{ - va_list args; - va_start(args, format); - vsnprintf(wbuff, kWBUFF_len, format, args); - va_end(args); - return wbuff; -} - CiMainGenerator::CiMainGenerator() { sigprt = new CSigPrinter; @@ -67,9 +54,9 @@ void CiMainGenerator::Gen_MainHeader() fwriter->AppendLine("#include ", 2); fwriter->AppendLine("// include current dbc-driver compilation config"); - fwriter->AppendLine(PrintF("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); fwriter->AppendText( "// This file must define:\n" @@ -80,21 +67,21 @@ void CiMainGenerator::Gen_MainHeader() "\n" ); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 3); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 3); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - fwriter->AppendLine(PrintF("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID)); - fwriter->AppendLine(PrintF("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt)); - fwriter->AppendLine(PrintF("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC)); - fwriter->AppendLine(PrintF("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID)); + fwriter->AppendLine(StrPrint("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID)); + fwriter->AppendLine(StrPrint("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt)); + fwriter->AppendLine(StrPrint("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC)); + fwriter->AppendLine(StrPrint("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID)); if (m.Cycle > 0) { - fwriter->AppendLine(PrintF("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle)); + fwriter->AppendLine(StrPrint("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle)); } if (m.CommentText.size() > 0) @@ -119,12 +106,12 @@ void CiMainGenerator::Gen_MainHeader() fwriter->AppendText("\n"); - fwriter->AppendLine(PrintF("typedef struct")); + fwriter->AppendLine(StrPrint("typedef struct")); fwriter->AppendLine("{"); // Write section for bitfielded part - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usebits_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usebits_def.c_str()), 2); SignalDescriptor_t rollsig; @@ -145,9 +132,9 @@ void CiMainGenerator::Gen_MainHeader() if (m.RollSig != nullptr) { - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str()), 2); WriteSigStructField(rollsig, true, max_sig_name_len); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); } // Write clean part @@ -162,18 +149,18 @@ void CiMainGenerator::Gen_MainHeader() if (m.RollSig != nullptr) { - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str()), 2); WriteSigStructField(rollsig, false, max_sig_name_len); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); } - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usebits_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usebits_def.c_str()), 2); // start mon1 section - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); fwriter->AppendLine(" FrameMonitor_t mon1;", 2); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine(PrintF("} %s_t;", m.Name.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine(StrPrint("} %s_t;", m.Name.c_str()), 2); } fwriter->AppendLine("// Function signatures", 2); @@ -183,20 +170,20 @@ void CiMainGenerator::Gen_MainHeader() // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - fwriter->AppendLine(PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(StrPrint("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesruct_def.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesruct_def.c_str())); - fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine("#else"); - fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesruct_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesruct_def.c_str()), 2); } fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); @@ -208,11 +195,11 @@ void CiMainGenerator::Gen_MainHeader() void CiMainGenerator::Gen_MainSource() { // include main header file - fwriter->AppendLine(PrintF("#include \"%s\"", fdesc->core_h.fname.c_str()), 3); + fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->core_h.fname.c_str()), 3); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); fwriter->AppendText( "// This file must define:\n" @@ -220,9 +207,9 @@ void CiMainGenerator::Gen_MainSource() "// function signature for CRC calculation\n" "// function signature for getting system tick value (100 us step)\n"); - fwriter->AppendLine(PrintF("#include \"%s-fmon.h\"", fdesc->drvname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include \"%s-fmon.h\"", fdesc->drvname.c_str()), 2); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 3); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 3); // for each message 3 functions must be defined - 1 unpack function, // 2: pack with raw signature @@ -233,8 +220,8 @@ void CiMainGenerator::Gen_MainSource() MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; // first function - fwriter->AppendLine(PrintF("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(StrPrint("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); // put dirt trick to avoid warning about unusing parameter // (dlc) when monitora are disabled. trick is better than @@ -246,23 +233,23 @@ void CiMainGenerator::Gen_MainSource() fwriter->AppendLine("}", 2); // next one is the pack function for using with CANFrame struct - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesruct_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesruct_def.c_str()), 2); // second function - fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); WritePackStructBody(sigprt->sigs_expr[num]); fwriter->AppendLine("#else", 2); // third function - fwriter->AppendLine(PrintF("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); WritePackArrayBody(sigprt->sigs_expr[num]); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesruct_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesruct_def.c_str()), 2); } fwriter->Flush(fdesc->core_c.fpath); @@ -274,11 +261,11 @@ void CiMainGenerator::Gen_FMonHeader() fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); - fwriter->AppendLine(PrintF("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); fwriter->AppendLine("#include \"canmonitorutil.h\""); fwriter->AppendLine("/*\n\ This file contains the prototypes of all the functions that will be called\n\ @@ -289,11 +276,11 @@ separated .c file. If it won't be done the linkage error will happen\n*/", 2); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(PrintF("void FMon_%s_%s(FrameMonitor_t* _mon);", - msg->Name.c_str(), fdesc->drvname.c_str())); + fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon);", + msg->Name.c_str(), fdesc->drvname.c_str())); } - fwriter->AppendLine(PrintF("\n#endif // %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine(StrPrint("\n#endif // %s", fdesc->usemon_def.c_str()), 2); fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); @@ -302,10 +289,10 @@ separated .c file. If it won't be done the linkage error will happen\n*/", 2); void CiMainGenerator::Gen_FMonSource() { - fwriter->AppendLine(PrintF("#include \"%s\"", fdesc->fmon_h.fname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->fmon_h.fname.c_str()), 2); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); fwriter->AppendLine("/*\n\ Put the monitor function content here, keep in mind -\n\ @@ -315,11 +302,11 @@ next generation will completely clear all manually added code (!)\n\ for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(PrintF("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n\}\n", - msg->Name.c_str(), fdesc->drvname.c_str())); + fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n\}\n", + msg->Name.c_str(), fdesc->drvname.c_str())); } - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str())); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str())); fwriter->Flush(fdesc->fmon_c.fpath); } @@ -342,7 +329,7 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi if (bits && (sig.LengthBit < 8)) { - dtype += PrintF(" : %d", sig.LengthBit); + dtype += StrPrint(" : %d", sig.LengthBit); } dtype += ";"; @@ -358,18 +345,18 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendText(pad); - fwriter->AppendText(PrintF(" Bits=%2d", sig.LengthBit)); + fwriter->AppendText(StrPrint(" Bits=%2d", sig.LengthBit)); if (sig.IsDoubleSig) { if (sig.Offset != 0) { - fwriter->AppendText(PrintF(" Offset= %-18f", sig.Offset)); + fwriter->AppendText(StrPrint(" Offset= %-18f", sig.Offset)); } if (sig.Factor != 1) { - fwriter->AppendText(PrintF(" Factor= %-15f", sig.Factor)); + fwriter->AppendText(StrPrint(" Factor= %-15f", sig.Factor)); } } else if (sig.IsSimpleSig == false) @@ -377,18 +364,18 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi // 2 type of signal if (sig.Offset != 0) { - fwriter->AppendText(PrintF(" Offset= %-18d", (int)sig.Offset)); + fwriter->AppendText(StrPrint(" Offset= %-18d", (int)sig.Offset)); } if (sig.Factor != 1) { - fwriter->AppendText(PrintF(" Factor= %-15d", (int)sig.Factor)); + fwriter->AppendText(StrPrint(" Factor= %-15d", (int)sig.Factor)); } } if (sig.Unit.size() > 0) { - fwriter->AppendText(PrintF(" Unit:'%s'", sig.Unit.c_str())); + fwriter->AppendText(StrPrint(" Unit:'%s'", sig.Unit.c_str())); } fwriter->AppendLine("", 2); @@ -400,11 +387,11 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi // to/from physical values. For non-simple and non-double signal // there is no necessity to create addition fields // @sigfloat_t must be typedefed by user (e.g. double / float) - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(PrintF(" sigfloat_t %s_phys;", sig.Name.c_str())); + fwriter->AppendLine(StrPrint(" sigfloat_t %s_phys;", sig.Name.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } } @@ -418,15 +405,15 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // for code shortening const char* sname = sgs->msg.Signals[num].Name.c_str(); - fwriter->AppendLine(PrintF(" _m->%s = %s;", sname, expr.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s = %s;", sname, expr.c_str())); // print sigfloat conversion if (sgs->msg.Signals[num].IsDoubleSig) { - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, - sname)); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, + sname)); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } else if (!sgs->msg.Signals[num].IsSimpleSig) @@ -434,9 +421,9 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // print unpack conversion for non-simple and non-double signals // for this case conversion fromS is performed to signal itself // without (sigfloat_t) type casting - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s = (%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, sname)); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s = (%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, sname)); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } else if (num + 1 == sgs->to_signals.size()) { @@ -445,50 +432,50 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) } } - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usemon_def.c_str())); - fwriter->AppendLine(PrintF(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); fwriter->AppendLine(" _m->mon1.last_cycle = GetSysTick();"); fwriter->AppendLine(" _m->mon1.frame_cnt++;", 2); if (sgs->msg.RollSig != nullptr) { // Put rolling monitor here - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str())); - fwriter->AppendLine(PrintF(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", - sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); - fwriter->AppendLine(PrintF(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", + sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); // Put rolling monitor here - fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } if (sgs->msg.CsmSig != nullptr) { // Put checksum check function call here - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(PrintF(" _m->mon1.csm_error = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", - sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), - sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->mon1.csm_error = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", + sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), + sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); } auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->drvname; - fwriter->AppendLine(PrintF(" %s(&_m->mon1);", Fmon_func.c_str())); + fwriter->AppendLine(StrPrint(" %s(&_m->mon1);", Fmon_func.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usemon_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); } void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) { fwriter->AppendLine("{"); PrintPackCommonText("cframe->Data", sgs); - fwriter->AppendLine(PrintF(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); - fwriter->AppendLine(PrintF(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); - fwriter->AppendLine(PrintF(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str(), 2)); + fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine("}", 2); } @@ -496,9 +483,9 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) { fwriter->AppendLine("{"); PrintPackCommonText("_d", sgs); - fwriter->AppendLine(PrintF(" *_len = %s_DLC;", sgs->msg.Name.c_str())); - fwriter->AppendLine(PrintF(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(PrintF(" return %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" *_len = %s_DLC;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); + fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); fwriter->AppendLine("}", 2); } @@ -508,30 +495,30 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp // which is differs only by arra var name // pring array content clearin loop - fwriter->AppendLine(PrintF(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", - sgs->msg.Name.c_str(), arrtxt.c_str()), 2); + fwriter->AppendLine(StrPrint(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", + sgs->msg.Name.c_str(), arrtxt.c_str()), 2); if (sgs->msg.RollSig != nullptr) { - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->useroll_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s = (_m->%s + 1) & (0x%02XU)", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); - fwriter->AppendLine(PrintF("#ifdef // %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s = (_m->%s + 1) & (0x%02XU)", sgs->msg.RollSig->Name.c_str(), + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); + fwriter->AppendLine(StrPrint("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } if (sgs->msg.CsmSig != nullptr) { // code for clearing checksum - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str())); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); } if (sgs->msg.hasPhys) { // first step is to put code for sigfloat conversion, before // sigint packing to bytes. - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); for (size_t n = 0; n < sgs->to_signals.size(); n++) { @@ -540,22 +527,22 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->msg.Signals[n].IsDoubleSig) { // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s_phys);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s_phys);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); } else { // print toS from original named signal to itself (because this signal // has enough space for scaling by factor and proper sign - fwriter->AppendLine(PrintF(" _m->%s = %s_%s_fromS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); } } } - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } for (size_t i = 0; i < sgs->to_bytes.size(); i++) @@ -563,7 +550,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->to_bytes[i].size() < 2) continue; - fwriter->AppendLine(PrintF(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str())); + fwriter->AppendLine(StrPrint(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str())); } fwriter->AppendLine(""); @@ -571,14 +558,14 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->msg.CsmSig != nullptr) { // code for getting checksum value and putting it in array - fwriter->AppendLine(PrintF("#ifdef %s", fdesc->usecsm_def.c_str())); + fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(PrintF(" _m->%s = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d));", - sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), - sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); + fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d));", + sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), + sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); - fwriter->AppendLine(PrintF(" %s[%d] = %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); + fwriter->AppendLine(StrPrint(" %s[%d] = %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); - fwriter->AppendLine(PrintF("#endif // %s", fdesc->usecsm_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); } } From ad787bc79ca98ee313a2381cfcfb1dc717e7228e Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 10 Feb 2021 12:14:09 +0300 Subject: [PATCH 050/181] Added first variant of util generator. --- src/codegen/c-util-generator.cpp | 74 ++++++++++++++++++++++++++++++++ src/codegen/c-util-generator.h | 34 +++++++++++++++ src/types/message.h | 11 +++++ 3 files changed, 119 insertions(+) create mode 100644 src/codegen/c-util-generator.cpp create mode 100644 src/codegen/c-util-generator.h diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp new file mode 100644 index 0000000..6fda5ed --- /dev/null +++ b/src/codegen/c-util-generator.cpp @@ -0,0 +1,74 @@ +#include "c-util-generator.h" +#include + +CiUtilGenerator::CiUtilGenerator() +{ + Clear(); +} + +void CiUtilGenerator::Clear() +{ + // clear all groups of messages + tx.clear(); + rx.clear(); + both.clear(); +} + + +void CiUtilGenerator::Generate(std::vector& msgs, const FsDescriptor_t& fsd, + const MsgsClassification& groups) +{ + Clear(); + + // 1 step is to prepare vectors of message's groups + for (auto m : msgs) + { + auto v = std::find_if(groups.Both.begin(), groups.Both.end(), [&](const uint32_t& msgid) + { + return msgid == m->MsgID; + }); + + if (v != std::end(groups.Both)) + { + // message is in Both group, so put it to rx and tx containers + tx.push_back(m); + rx.push_back(m); + continue; + } + + v = std::find_if(groups.Rx.begin(), groups.Rx.end(), [&](const uint32_t& msgid) + { + return msgid == m->MsgID; + }); + + if (v != std::end(groups.Rx)) + { + rx.push_back(m); + continue; + } + + v = std::find_if(groups.Tx.begin(), groups.Tx.end(), [&](const uint32_t& msgid) + { + return msgid == m->MsgID; + }); + + if (v != std::end(groups.Tx)) + { + tx.push_back(m); + continue; + } + } + + std::sort(rx.begin(), rx.end(), [&](const MessageDescriptor_t* a, const MessageDescriptor_t* b) + { + return a->MsgID < b->MsgID; + }); + std::sort(tx.begin(), tx.end(), [&](const MessageDescriptor_t* a, const MessageDescriptor_t* b) + { + return a->MsgID < b->MsgID; + }); + + fdesc = &fsd; + +} + diff --git a/src/codegen/c-util-generator.h b/src/codegen/c-util-generator.h new file mode 100644 index 0000000..0929ab6 --- /dev/null +++ b/src/codegen/c-util-generator.h @@ -0,0 +1,34 @@ +#pragma once + +#include "types/message.h" +#include "fs-creator.h" + +class CiUtilGenerator { + public: + CiUtilGenerator(); + + void Clear(); + + // msgs - the whole list of messages in CAN matrix + // fsd - file and names descriptor + // groups - collection of msg IDs assigned to available groups (rx, tx, both) + + // the output of this function source files which contain: + // - global TX and RX typedefs message struct + // - function to Unpack incoming frame to dedicated RX message struct field + // - optional (through define in global "dbccodeconf.h") variable allocation in source files + // + void Generate(std::vector& msgs, const FsDescriptor_t& fsd, const MsgsClassification& groups); + + private: + void PrintHeader(); + void PrintSource(); + + private: + + std::vector tx; + std::vector rx; + std::vector both; + + const FsDescriptor_t* fdesc; +}; diff --git a/src/types/message.h b/src/types/message.h index 732e0c0..e3ead02 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -131,3 +131,14 @@ typedef struct std::string CommentText; } MessageDescriptor_t; + +typedef struct +{ + std::vector Rx; + + std::vector Tx; + + std::vector Both; + +} MsgsClassification; + From 00748b35f8d7c1a5656c5670e79d3bd55510f8b3 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 10 Feb 2021 19:48:11 +0300 Subject: [PATCH 051/181] Added util header print. Some additional improvements. --- DbcScanner.vcxproj | 2 + DbcScanner.vcxproj.filters | 6 ++ src/codegen/c-util-generator.cpp | 100 ++++++++++++++++++++++++++++++- src/codegen/c-util-generator.h | 10 +++- src/codegen/fs-creator.cpp | 30 +--------- src/helpers/formatter.cpp | 25 +++++++- src/helpers/formatter.h | 4 ++ 7 files changed, 144 insertions(+), 33 deletions(-) diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj index 2c06276..dbc0d2e 100644 --- a/DbcScanner.vcxproj +++ b/DbcScanner.vcxproj @@ -158,6 +158,7 @@ + @@ -172,6 +173,7 @@ + diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters index 19722a5..a81149e 100644 --- a/DbcScanner.vcxproj.filters +++ b/DbcScanner.vcxproj.filters @@ -51,6 +51,9 @@ Header Files + + Header Files + @@ -74,5 +77,8 @@ Source Files + + Source Files + \ No newline at end of file diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 6fda5ed..8b3d19a 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -1,9 +1,19 @@ #include "c-util-generator.h" +#include "helpers/formatter.h" #include +static const std::string openguard = "#ifdef __cplusplus\n\ +extern \"C\" {\n\ +#endif"; + +static const std::string closeguard = "#ifdef __cplusplus\n\ +}\n\ +#endif"; + CiUtilGenerator::CiUtilGenerator() { Clear(); + tof = new FileWriter; } void CiUtilGenerator::Clear() @@ -16,10 +26,13 @@ void CiUtilGenerator::Clear() void CiUtilGenerator::Generate(std::vector& msgs, const FsDescriptor_t& fsd, - const MsgsClassification& groups) + const MsgsClassification& groups, const std::string& drvname) { Clear(); + code_drvname = drvname; + file_drvname = str_tolower(drvname); + // 1 step is to prepare vectors of message's groups for (auto m : msgs) { @@ -63,6 +76,7 @@ void CiUtilGenerator::Generate(std::vector& msgs, const Fs { return a->MsgID < b->MsgID; }); + std::sort(tx.begin(), tx.end(), [&](const MessageDescriptor_t* a, const MessageDescriptor_t* b) { return a->MsgID < b->MsgID; @@ -70,5 +84,89 @@ void CiUtilGenerator::Generate(std::vector& msgs, const Fs fdesc = &fsd; + PrintHeader(); + + PrintSource(); + } +void CiUtilGenerator::PrintHeader() +{ + tof->Flush(); + + tof->AppendLine("#pragma once", 2); + + tof->AppendLine(openguard.c_str(), 2); + + // include common dbc code config header + tof->AppendLine("#include \"dbccodeconf.h\"", 2); + // include c-main driver header + tof->AppendLine(StrPrint("#include \"%s.h\"", file_drvname.c_str()), 2); + + if (rx.size() == 0) + { + tof->AppendLine("// There is no any RX mapped massage.", 2); + } + else + { + // print the typedef + tof->AppendLine("typedef struct\n{"); + + for (auto m : rx) + { + tof->AppendLine(StrPrint(" %s_t %s;", m->Name.c_str(), m->Name.c_str())); + } + + tof->AppendLine(StrPrint("} %s_rx_t;", fdesc->drvname.c_str()), 2); + } + + if (tx.size() == 0) + { + tof->AppendLine("// There is no any TX mapped massage.", 2); + } + else + { + // print the typedef + tof->AppendLine("typedef struct\n{"); + + for (auto m : tx) + { + tof->AppendLine(StrPrint(" %s_t %s;", m->Name.c_str(), m->Name.c_str())); + } + + tof->AppendLine(StrPrint("} %s_tx_t;", fdesc->drvname.c_str()), 2); + } + + if (rx.size() > 0) + { + // receive function necessary only when more than 0 rx messages were mapped + tof->AppendLine(StrPrint("uint32_t %s_Receive(%s_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc);", + fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + } + + // print extern for super structs + if (rx.size() > 0 || tx.size() > 0) + { + tof->AppendLine(StrPrint("#ifdef __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + + if (rx.size() > 0) + { + tof->AppendLine(StrPrint("extern %s_rx_t %s_rx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + } + + if (tx.size() > 0) + { + tof->AppendLine(StrPrint("extern %s_tx_t %s_tx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + } + + tof->AppendLine(StrPrint("#endif // __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + } + + tof->AppendLine(closeguard.c_str()); + + tof->Flush(fdesc->util_h.fpath); +} + +void CiUtilGenerator::PrintSource() +{ +} diff --git a/src/codegen/c-util-generator.h b/src/codegen/c-util-generator.h index 0929ab6..bf9079d 100644 --- a/src/codegen/c-util-generator.h +++ b/src/codegen/c-util-generator.h @@ -2,6 +2,7 @@ #include "types/message.h" #include "fs-creator.h" +#include "filewriter.h" class CiUtilGenerator { public: @@ -18,7 +19,8 @@ class CiUtilGenerator { // - function to Unpack incoming frame to dedicated RX message struct field // - optional (through define in global "dbccodeconf.h") variable allocation in source files // - void Generate(std::vector& msgs, const FsDescriptor_t& fsd, const MsgsClassification& groups); + void Generate(std::vector& msgs, const FsDescriptor_t& fsd, + const MsgsClassification& groups, const std::string& drvname); private: void PrintHeader(); @@ -30,5 +32,11 @@ class CiUtilGenerator { std::vector rx; std::vector both; + // to file writer + FileWriter* tof; + + std::string code_drvname; + std::string file_drvname; + const FsDescriptor_t* fdesc; }; diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 6bab6a7..4b4ffff 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -1,37 +1,12 @@ -#include "fs-creator.h" #include -#include -#include -#include #include -#include +#include "fs-creator.h" +#include "helpers/formatter.h" static const int32_t kTmpLen = 1024; static char _tmpb[kTmpLen]; - -std::string str_toupper(std::string s) -{ - std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::toupper(c); - }); - return s; -} - - -std::string str_tolower(std::string s) -{ - std::transform(s.begin(), s.end(), s.begin(), - [](unsigned char c) - { - return std::tolower(c); - }); - return s; -} - FsCreator::FsCreator() { } @@ -80,7 +55,6 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.DRVNAME = str_toupper(drvname); FS.drvname = str_tolower(drvname); - FS.core_h.dir = work_dir_path; FS.core_h.fname = FS.drvname + ".h"; FS.core_h.fpath = work_dir_path + "/" + FS.core_h.fname; diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index bc0dc53..770acf8 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -1,6 +1,5 @@ #include "formatter.h" -#include -#include +#include static const size_t kMaxWorkArrLength = 4096; @@ -24,7 +23,7 @@ const char* StrPrint(const char* format, ...) va_start(args, format); vsnprintf(work_buff, kMaxWorkArrLength, format, args); - + va_end(args); return work_buff; } @@ -38,3 +37,23 @@ std::string PrintType(uint8_t id) return ""; } + +std::string str_toupper(std::string s) +{ + std::transform(s.begin(), s.end(), s.begin(), + [](unsigned char c) + { + return std::toupper(c); + }); + return s; +} + +std::string str_tolower(std::string s) +{ + std::transform(s.begin(), s.end(), s.begin(), + [](unsigned char c) + { + return std::tolower(c); + }); + return s; +} diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index 9e6430b..d5be580 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -8,3 +8,7 @@ const char* StrPrint(const char* format, ...); std::string PrintType(uint8_t tid); + +std::string str_toupper(std::string s); + +std::string str_tolower(std::string s); From 147994ab107874598eda6b5b9db3e2f94fe5fa48 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 10 Feb 2021 19:50:20 +0300 Subject: [PATCH 052/181] Removed unused code. --- src/codegen/c-sigprinter.cpp | 17 ++++------------- src/codegen/c-sigprinter.h | 2 -- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 60da799..fc6f5e4 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -61,7 +61,7 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const retstr += StrPrint("#define %s_%s_CovFactor (%d)\n", drvname.c_str(), sig->Name.c_str(), (int32_t)sig->Factor); retstr += StrPrint("#define %s_%s_toS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), - PrintType((uint8_t)sig->Type).c_str()); + PrintType((uint8_t)sig->Type).c_str()); if (sig->IsDoubleSig) { @@ -114,15 +114,6 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const return retstr; } -// This function determines what type will have struct -// field for the @signal. It saves the name -std::string CSigPrinter::GetSignalType(const SignalDescriptor_t& signal) -{ - std::string ret = ""; - - return ret; -} - int32_t CSigPrinter::BuildCConvertExprs(CiExpr_t* msgprinter) { int32_t ret = 0; @@ -183,7 +174,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec std::string tosigexpr; uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? - (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); + (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); if (startb > 63) startb = 63; @@ -225,7 +216,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, - msk[bbc].c_str()); + msk[bbc].c_str()); AppendToByteLine(to_bytes[bn], workbuff); while ((slen - 8) >= 0) @@ -271,7 +262,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec tosigexpr += workbuff; snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), - 8 - slen); + 8 - slen); AppendToByteLine(to_bytes[bn], workbuff); } } diff --git a/src/codegen/c-sigprinter.h b/src/codegen/c-sigprinter.h index d003dc5..7f19b8b 100644 --- a/src/codegen/c-sigprinter.h +++ b/src/codegen/c-sigprinter.h @@ -16,8 +16,6 @@ class CSigPrinter { std::vector sigs_expr; private: - std::string GetSignalType(const SignalDescriptor_t& signal); - int32_t BuildCConvertExprs(CiExpr_t* msg); std::string PrintSignalExpr(const SignalDescriptor_t* sig, std::vector& to_bytes); From c0bc4b1d9d2af99df4a33b67185a6dc4092a71ac Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 10 Feb 2021 20:01:58 +0300 Subject: [PATCH 053/181] Fixed minor issues (warnings). --- src/codegen/c-main-generator.cpp | 48 +++++++++++++++----------------- src/codegen/fs-creator.cpp | 2 +- src/parser/dbclineparser.cpp | 12 +++----- src/parser/dbcscanner.cpp | 12 +++----- 4 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 7df98d5..d272063 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -11,8 +11,6 @@ #include "c-main-generator.h" -static const size_t kMaxDirNum = 1000; - CiMainGenerator::CiMainGenerator() { sigprt = new CSigPrinter; @@ -29,7 +27,7 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs fdesc = &fsd; std::sort(sigprt->sigs_expr.begin(), sigprt->sigs_expr.end(), - [](const CiExpr_t* a, const CiExpr_t* b) -> bool + [](const CiExpr_t* a, const CiExpr_t* b) -> bool { return a->msg.MsgID < b->msg.MsgID; }); @@ -171,17 +169,17 @@ void CiMainGenerator::Gen_MainHeader() MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; fwriter->AppendLine(StrPrint("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesruct_def.c_str())); fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine("#else"); fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesruct_def.c_str()), 2); } @@ -221,7 +219,7 @@ void CiMainGenerator::Gen_MainSource() // first function fwriter->AppendLine(StrPrint("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); // put dirt trick to avoid warning about unusing parameter // (dlc) when monitora are disabled. trick is better than @@ -237,7 +235,7 @@ void CiMainGenerator::Gen_MainSource() // second function fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); WritePackStructBody(sigprt->sigs_expr[num]); @@ -245,7 +243,7 @@ void CiMainGenerator::Gen_MainSource() // third function fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); WritePackArrayBody(sigprt->sigs_expr[num]); @@ -277,7 +275,7 @@ separated .c file. If it won't be done the linkage error will happen\n*/", 2); { auto msg = &(sigprt->sigs_expr[num]->msg); fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon);", - msg->Name.c_str(), fdesc->drvname.c_str())); + msg->Name.c_str(), fdesc->drvname.c_str())); } fwriter->AppendLine(StrPrint("\n#endif // %s", fdesc->usemon_def.c_str()), 2); @@ -302,8 +300,8 @@ next generation will completely clear all manually added code (!)\n\ for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n\}\n", - msg->Name.c_str(), fdesc->drvname.c_str())); + fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n}\n", + msg->Name.c_str(), fdesc->drvname.c_str())); } fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str())); @@ -412,7 +410,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) { fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); fwriter->AppendLine(StrPrint(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, - sname)); + sname)); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } @@ -442,9 +440,9 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // Put rolling monitor here fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); fwriter->AppendLine(StrPrint(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", - sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); + sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); fwriter->AppendLine(StrPrint(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); // Put rolling monitor here fwriter->AppendLine(StrPrint("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } @@ -454,8 +452,8 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // Put checksum check function call here fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); fwriter->AppendLine(StrPrint(" _m->mon1.csm_error = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", - sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), - sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); + sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), + sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); } @@ -496,13 +494,13 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp // pring array content clearin loop fwriter->AppendLine(StrPrint(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", - sgs->msg.Name.c_str(), arrtxt.c_str()), 2); + sgs->msg.Name.c_str(), arrtxt.c_str()), 2); if (sgs->msg.RollSig != nullptr) { fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); fwriter->AppendLine(StrPrint(" _m->%s = (_m->%s + 1) & (0x%02XU)", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); fwriter->AppendLine(StrPrint("#ifdef // %s", fdesc->useroll_def.c_str()), 2); } @@ -528,16 +526,16 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp { // print toS from *_phys to original named sigint (integer duplicate of signal) fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s_phys);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); } else { // print toS from original named signal to itself (because this signal // has enough space for scaling by factor and proper sign fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); } } } @@ -561,8 +559,8 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d));", - sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), - sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); + sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), + sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); fwriter->AppendLine(StrPrint(" %s[%d] = %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 4b4ffff..ffab06e 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -11,7 +11,7 @@ FsCreator::FsCreator() { } -bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool rw) +bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool) { bool ret = false; diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index c3ac8cf..e4d5d40 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -18,7 +18,7 @@ static const std::string kRegCommMain = "\""; static const std::string kRegCommMeta = "[ ]+"; // This reg splits line to parts (for attributes) -static const std::string kRegAttrMain = "[^A-Za-z0-9_\.]+"; +static const std::string kRegAttrMain = "[^A-Za-z0-9_\\.]+"; static const std::string kRegValTable = "\""; @@ -38,8 +38,6 @@ static uint64_t __maxsignedvals[] = LLONG_MAX }; -static int __typeslen[] = { 8, 16, 32, 64 }; - std::vector resplit(const std::string& s, const std::string& rgx_str) { std::vector elems; @@ -168,7 +166,7 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // for enabling double conversation the factor or offset // substring must have dot ('.') character if (valpart[3].find_first_of('.') != std::string::npos || - valpart[4].find_first_of('.') != std::string::npos) + valpart[4].find_first_of('.') != std::string::npos) { sig->IsDoubleSig = true; } @@ -190,12 +188,12 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& //The signal_size specifies the size of the signal in bits // byte_order = '0' | '1'; (*0 = little endian, 1 = big endian*) - sig->Order = (valpart[2].find('1') == -1) ? BitLayout::kMotorolla : BitLayout::kIntel; + sig->Order = (valpart[2].find('1') == std::string::npos) ? BitLayout::kMotorolla : BitLayout::kIntel; //The byte_format is 0 if the signal's byte order is Intel (little endian) or 1 if the byte //order is Motorola(big endian). // value_type = '+' | '-'; (*+= unsigned, -=signed*) - sig->Signed = (valpart[2].find('-') == -1) ? 0 : 1; + sig->Signed = (valpart[2].find('-') == std::string::npos) ? 0 : 1; sig->Type = GetSigType(sig); @@ -232,8 +230,6 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) { SigType ret = SigType::u64; - auto len = sig->LengthBit; - uint8_t is_unsigned = 0; int64_t roffset = (int64_t)(sig->Offset / sig->Factor); diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 90a751a..f676b36 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -130,8 +130,6 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) if (lparser.ParseCommentLine(&cmmnt, sline)) { - uint32_t found_msg_id = cmmnt.MsgId; - // update message comment field auto msg = find_message(msgs, cmmnt.MsgId); @@ -172,15 +170,15 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { auto substr = cmmnt.Text.substr(openpos + 1, closepos - 1); - auto meta = resplit(substr, "(\:)"); + auto meta = resplit(substr, "(\\:)"); if (meta.size() == 3 && meta[0] == "Checksum") { // the signal can be CSM, but additional settings must be // checked: size, boundary, signal type bool boundary_ok = (sig.Order == BitLayout::kIntel) ? - ((sig.StartBit / 8) == ((sig.StartBit + sig.LengthBit - 1) / 8)) : - ((sig.StartBit / 8) == ((sig.StartBit - sig.LengthBit + 1) / 8)); + ((sig.StartBit / 8) == ((sig.StartBit + sig.LengthBit - 1) / 8)) : + ((sig.StartBit / 8) == ((sig.StartBit - sig.LengthBit + 1) / 8)); if (sig.IsSimpleSig && boundary_ok && sig.Signed == false) { @@ -199,8 +197,6 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) if (lparser.ParseValTableLine(&cmmnt, sline)) { - uint32_t found_msg_id = cmmnt.MsgId; - // update message comment field auto msg = find_message(msgs, cmmnt.MsgId); @@ -251,7 +247,7 @@ void DbcScanner::AddMessage(MessageDescriptor_t* message) { // sort signals by start bit std::sort(message->Signals.begin(), message->Signals.end(), - [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool + [](const SignalDescriptor_t& a, const SignalDescriptor_t& b) -> bool { return a.StartBit < b.StartBit; }); From 4fd51160d2efee074d933c04ec66411cc2e280b3 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 13 Feb 2021 23:48:24 +0300 Subject: [PATCH 054/181] Added util source print. --- src/codegen/c-util-generator.cpp | 105 ++++++++++++++++++++++++++++++- src/codegen/c-util-generator.h | 6 ++ src/codegen/conditional-tree.cpp | 88 ++++++++++++++++++++++++++ src/codegen/conditional-tree.h | 44 +++++++++++++ 4 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 src/codegen/conditional-tree.cpp create mode 100644 src/codegen/conditional-tree.h diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 8b3d19a..1947bda 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -14,6 +14,7 @@ CiUtilGenerator::CiUtilGenerator() { Clear(); tof = new FileWriter; + condtree = new ConditionalTree; } void CiUtilGenerator::Clear() @@ -84,10 +85,11 @@ void CiUtilGenerator::Generate(std::vector& msgs, const Fs fdesc = &fsd; + // print header for util code PrintHeader(); + // print main source for util code PrintSource(); - } void CiUtilGenerator::PrintHeader() @@ -169,4 +171,105 @@ void CiUtilGenerator::PrintHeader() void CiUtilGenerator::PrintSource() { + tof->AppendLine(StrPrint("#include \"%s\"", fdesc->util_h.fname.c_str()), 2); + + // optional RX and TX struct allocations + if (rx.size() > 0 || tx.size() > 0) + { + tof->AppendLine(StrPrint("#ifdef __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + + if (rx.size() > 0) + { + tof->AppendLine(StrPrint("%s_rx_t %s_rx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + } + + if (tx.size() > 0) + { + tof->AppendLine(StrPrint("%s_tx_t %s_tx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + } + + tof->AppendLine(StrPrint("#endif // __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + } + + if (rx.size() > 0) + { + // tree will be created inside (in dynamic memory) so this + // scope is responsible for deletion these resources + // tree is the struct tree-view which is used to execute + // binary search on FrameID for selecting unpacking function + auto tree = FillTreeLevel(rx, 0, rx.size()); + + tof->AppendLine(StrPrint("uint32_t %s_Receive(%s_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)", + fdesc->drvname.c_str(), fdesc->drvname.c_str())); + + tof->AppendLine("{"); + tof->AppendLine(" uint32_t recid = 0;"); + + // put tree-view struct on code (in treestr variable) + std::string treestr; + condtree->Clear(); + tof->AppendLine(condtree->WriteCode(tree, treestr, 1)); + + tof->AppendLine(" return recid;"); + tof->AppendLine("}", 2); + + // clear tree after using + condtree->DeleteTree(tree); + } + + tof->Flush(fdesc->util_c.fpath); +} + +ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vector& list, + int32_t l, + int32_t h, + bool started) +{ + int32_t span = h - l; + int32_t lowhalf = span / 2; + int32_t highhalf = span - lowhalf; + + treestarted = started; + + if (h < 1) + { + return nullptr; + } + + ConditionalTree_t* ret = new ConditionalTree_t; + + if (!treestarted && h == 1) + { + ret->Type = ConditionalType::Cond; + auto msg = list[l]; + ret->ConditionExpresion = StrPrint("_id == 0x%XU", msg->MsgID); + ret->High = new ConditionalTree_t; + ret->Type = ConditionalType::Express; + ret->UtilCodeBody = StrPrint("recid = Unpack_%s_%s(&(_m->%s), _d, dlc_);", + msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); + return ret; + } + + if (span > 1) + { + ret->Type = ConditionalType::Cond; + + if (lowhalf > 1) + ret->ConditionExpresion = StrPrint("(_id >= 0x%XU) && (_id < 0x%XU)", list[l]->MsgID, list[(l + lowhalf)]->MsgID); + else + ret->ConditionExpresion = StrPrint("_id == 0x%XU", list[l]->MsgID); + + ret->High = FillTreeLevel(list, l, l + lowhalf, true); + ret->Low = FillTreeLevel(list, l + lowhalf, h, true); + } + else + { + ret->Type = ConditionalType::Express; + auto msg = list[l]; + ret->ConditionExpresion = StrPrint("_id == 0x%XU", msg->MsgID); + ret->UtilCodeBody = StrPrint("recid = Unpack_%s_%s(&(_m->%s), _d, dlc_);", + msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); + } + + return ret; } diff --git a/src/codegen/c-util-generator.h b/src/codegen/c-util-generator.h index bf9079d..b57eca4 100644 --- a/src/codegen/c-util-generator.h +++ b/src/codegen/c-util-generator.h @@ -3,6 +3,7 @@ #include "types/message.h" #include "fs-creator.h" #include "filewriter.h" +#include "conditional-tree.h" class CiUtilGenerator { public: @@ -25,6 +26,8 @@ class CiUtilGenerator { private: void PrintHeader(); void PrintSource(); + ConditionalTree_t* FillTreeLevel(std::vector& msgs, + int32_t l, int32_t h, bool started = false); private: @@ -39,4 +42,7 @@ class CiUtilGenerator { std::string file_drvname; const FsDescriptor_t* fdesc; + ConditionalTree* condtree; + + bool treestarted; }; diff --git a/src/codegen/conditional-tree.cpp b/src/codegen/conditional-tree.cpp new file mode 100644 index 0000000..621aa60 --- /dev/null +++ b/src/codegen/conditional-tree.cpp @@ -0,0 +1,88 @@ +#include "conditional-tree.h" +#include "helpers/formatter.h" + +ConditionalTree::ConditionalTree() +{ +} + +// this method performs printing tree-viewed frames collection +// to proper source code +std::string ConditionalTree::WriteCode(const ConditionalTree_t* tree, std::string& outstr, uint8_t intend) +{ + if (tree != nullptr) + { + std::string temp; + + if (tree->Type == ConditionalType::Cond) + { + temp = StrPrint("if (%s) {", tree->ConditionExpresion.c_str()); + PrintCode(temp, intend); + + WriteCode(tree->High, outstr, intend + 1); + + if (tree->Low != nullptr) + { + if (tree->Low->Type == ConditionalType::Express) + { + temp = StrPrint("} else if (%s) {", tree->Low->ConditionExpresion.c_str()); + PrintCode(temp, intend); + } + else + { + temp = "} else {"; + PrintCode(temp, intend); + } + + WriteCode(tree->Low, outstr, intend + 1); + } + else + { + temp = "} else {"; + PrintCode(temp, intend); + } + + if (tree->Low != nullptr) + { + temp = "}"; + PrintCode(temp, intend); + } + } + else + { + temp = StrPrint("%s", tree->UtilCodeBody.c_str()); + PrintCode(temp, intend); + } + } + + return codestr; +} + +void ConditionalTree::PrintCode(std::string& str, uint8_t indent) +{ + while (indent--) + { + codestr += " "; + } + + codestr += str; + codestr += "\n"; +} + + +void ConditionalTree::DeleteTree(ConditionalTree_t* tree) +{ + if (tree != nullptr) + { + if (tree->Low != nullptr) + { + DeleteTree(tree->Low); + } + + if (tree->High != nullptr) + { + DeleteTree(tree->High); + } + + delete tree; + } +} diff --git a/src/codegen/conditional-tree.h b/src/codegen/conditional-tree.h new file mode 100644 index 0000000..056f9bd --- /dev/null +++ b/src/codegen/conditional-tree.h @@ -0,0 +1,44 @@ +#pragma once + +#include + +enum class ConditionalType { Cond, Express, Single }; + +struct ConditionalTree_t +{ + ConditionalTree_t* High; + + ConditionalTree_t* Low; + + ConditionalType Type; + + std::string ConditionExpresion; + + std::string UtilCodeBody; + + ConditionalTree_t() { + High = nullptr; + Low = nullptr; + Type = ConditionalType::Single; + } +}; + +class ConditionalTree { + public: + ConditionalTree(); + + void Clear() { + codestr.clear(); + } + + std::string WriteCode(const ConditionalTree_t* tree, std::string& outstr, uint8_t intend); + + // deletes all memory allocated to tree members + void DeleteTree(ConditionalTree_t* tree); + + private: + + void PrintCode(std::string& str, uint8_t indent); + + std::string codestr; +}; From b3af67692da39be0390a63bbcd384dd6bced2612 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 14 Feb 2021 00:18:39 +0300 Subject: [PATCH 055/181] Added cmake building. --- .gitignore | 4 +- bin/CMakeCache.txt | 329 +++++++++ bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake | 89 +++ .../3.19.4/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 16560 bytes bin/CMakeFiles/3.19.4/CMakeSystem.cmake | 15 + .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 680 ++++++++++++++++++ bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out | Bin 0 -> 16720 bytes .../CMakeDirectoryInformation.cmake | 16 + bin/CMakeFiles/Makefile.cmake | 96 +++ bin/CMakeFiles/Makefile2 | 125 ++++ bin/CMakeFiles/TargetDirectories.txt | 3 + bin/CMakeFiles/cmake.check_cache | 1 + .../dbcscanner-lib.dir/CXX.includecache | 216 ++++++ .../dbcscanner-lib.dir/DependInfo.cmake | 36 + bin/CMakeFiles/dbcscanner-lib.dir/build.make | 237 ++++++ .../dbcscanner-lib.dir/cmake_clean.cmake | 18 + .../dbcscanner-lib.dir/depend.internal | 62 ++ bin/CMakeFiles/dbcscanner-lib.dir/depend.make | 62 ++ bin/CMakeFiles/dbcscanner-lib.dir/flags.make | 10 + bin/CMakeFiles/dbcscanner-lib.dir/link.txt | 1 + .../dbcscanner-lib.dir/progress.make | 11 + bin/CMakeFiles/progress.marks | 1 + bin/Makefile | 437 +++++++++++ bin/cmake_install.cmake | 54 ++ src/CMakeLists.txt | 25 + 25 files changed, 2527 insertions(+), 1 deletion(-) create mode 100644 bin/CMakeCache.txt create mode 100644 bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake create mode 100755 bin/CMakeFiles/3.19.4/CMakeDetermineCompilerABI_CXX.bin create mode 100644 bin/CMakeFiles/3.19.4/CMakeSystem.cmake create mode 100644 bin/CMakeFiles/3.19.4/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100755 bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out create mode 100644 bin/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 bin/CMakeFiles/Makefile.cmake create mode 100644 bin/CMakeFiles/Makefile2 create mode 100644 bin/CMakeFiles/TargetDirectories.txt create mode 100644 bin/CMakeFiles/cmake.check_cache create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/build.make create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/depend.internal create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/depend.make create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/flags.make create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/link.txt create mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/progress.make create mode 100644 bin/CMakeFiles/progress.marks create mode 100644 bin/Makefile create mode 100644 bin/cmake_install.cmake create mode 100644 src/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 4ce6fdd..c2cb081 100644 --- a/.gitignore +++ b/.gitignore @@ -23,9 +23,11 @@ x86/ [Aa][Rr][Mm]/ [Aa][Rr][Mm]64/ bld/ -[Bb]in/ [Oo]bj/ [Ll]og/ +*.o +*.so +*.out # Visual Studio 2015/2017 cache/options directory .vs/ diff --git a/bin/CMakeCache.txt b/bin/CMakeCache.txt new file mode 100644 index 0000000..29f1f2f --- /dev/null +++ b/bin/CMakeCache.txt @@ -0,0 +1,329 @@ +# This is the CMakeCache file. +# For build in directory: /home/stone/source/cpp/qt/coderdbc-core/bin +# It was generated by CMake: /snap/cmake/775/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:STRING=/usr/bin/g++ + +//A wrapper around 'ar' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 + +//A wrapper around 'ranlib' adding the appropriate '--plugin' option +// for the GCC compiler +CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler. +CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=dbcscanner-lib + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=/usr/bin/readelf + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the linker during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Value Computed by CMake +dbcscanner-lib_BINARY_DIR:STATIC=/home/stone/source/cpp/qt/coderdbc-core/bin + +//Value Computed by CMake +dbcscanner-lib_SOURCE_DIR:STATIC=/home/stone/source/cpp/qt/coderdbc-core/src + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/stone/source/cpp/qt/coderdbc-core/bin +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=19 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/snap/cmake/775/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/snap/cmake/775/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/snap/cmake/775/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR +CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB +CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/snap/cmake/775/bin/cmake-gui +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/stone/source/cpp/qt/coderdbc-core/src +//Install .so files without execute permission. +CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/snap/cmake/775/share/cmake-3.19 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake b/bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake new file mode 100644 index 0000000..193f52d --- /dev/null +++ b/bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake @@ -0,0 +1,89 @@ +set(CMAKE_CXX_COMPILER "/usr/bin/g++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "GNU") +set(CMAKE_CXX_COMPILER_VERSION "9.3.0") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") + +set(CMAKE_CXX_PLATFORM_ID "Linux") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") +set(CMAKE_CXX_SIMULATE_VERSION "") + + + + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_MT "") +set(CMAKE_COMPILER_IS_GNUCXX 1) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) +set(CMAKE_COMPILER_IS_MINGW ) +set(CMAKE_COMPILER_IS_CYGWIN ) +if(CMAKE_COMPILER_IS_CYGWIN) + set(CYGWIN 1) + set(UNIX 1) +endif() + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +if(CMAKE_COMPILER_IS_MINGW) + set(MINGW 1) +endif() +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "ELF") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/bin/CMakeFiles/3.19.4/CMakeDetermineCompilerABI_CXX.bin b/bin/CMakeFiles/3.19.4/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000000000000000000000000000000000000..89f78821c080a0bac7801e4d246023d487c5714b GIT binary patch literal 16560 zcmeHOZ)_Y#6`%9j$)!!smoyM58;2toOPR26|D@ulzq#0S7pN?L(HjgU$aRG31AsnXO54Kg&z@!rgP z=iT)g${&dj>_~UNncuuWvu|ehW^ZRc6N~pW_EZJhx1t3j`}-*9$+%GcKLhUO zBjj(Xeh5+g87aJCMezqgLOfcOn#xY~tj4v#0yk#sJR zNk5W;B379tD^aw}Y$BZ#z45-zE_0W@OWz~RzW#$|GF42Crb||;*nhAqlh3946GIu) z9L?r)q-iSAx`MJjDvBISA4Cvi$m62CA-w{l`$1|u&rhBg+GNo$>##+rG9nKGeBRh-tl#S=FI}-q4Wb; z>K3xR^NqgB#RrYbtH$IX=I-f_Pc@x_rLQrys#!wEIj~e+R|J)}&KOf2Uxkb@)$~P# zee>2jaD52#;Ce-Mrg`&8bbOu=9 z{+}L(N;EV8dX+~n8I|(P^ResL%+s+;##6@Bx*rE2I^S&!HUDth7rV~v^Dg%K@$+aV zdS861qXbVL(R=$UFGUCXD%Ya@(aQA!W2!X?^wIeC8`vka=FMu=ICsNuZQl87ibuS1 zHD0;gUHN0Qy7srmcD(m<7)UR95%415MZk-I7XdEMGXLKL-XH!STIBt!yiFsfSWT(}?pbKw2yb~Aq1{mlE%oqVJCbX_}5 zwQ=N>UsfAGPJX%IapvR$g8R$KuMphNPW~3b zXH?z~vpH0k=ex~<4$iYiaizMzs2tw68bnYOT=9e*7?OY5#cv^=?}N&U5PKm5qqf!_ zp4UB+UmOSAe2;$lzRGqcr2OJ|;{Rjy+W)MS4~dWl8AyCzy8w9~461D!vI0D*v{W2^ z0o6X}-y~k3E7kM+J1KM9qW--KyboL9>fg6X-aSr&GEj@h+ZNz`b;iR_fo~9t=gVH; z*T7ZI(C-cZKJ)^wN#D+|(~@62u7-gRiS@O9WUVOhYZ?~Mqfa2uLN=_B9rw8XGVq#B zjh;gcjEq4B(fsxJbM z^6q)`3dwIL`|`g}(0LVjY^PiPGVmJNv_k+6EyzDu?Ih-hi&n`h!;Yh2v2bj|w6f+f z9^5Fwp^aqT9L?m15*agT<%=aVQ63k=`D`JRvQkMs+}7S!UkHzkq|HRJn3ynAIjcA! zMv94S%1oBC*$Ggwl}wPd9HLzZ6Q4|V4GwmJqjV-!jCS_v!-aw{KNjEFp3aTrP1~Q` z$c7~e|8Rrlo+HtNF*A0k+k{glPTNUgcHe&}da$p{StF0L00rlG%$PwIjP4`C?2RAp zjK72SpZk&gFoJ|vY zX(DSSh5)Ui!ZFUJb8yP1AoN_`O6jAyvR)|W3#pQhtCkK&(9f*XHW?eUL(et_4)ZA4IExF>+^b&k)KmQ zL?*OhPY*!>pBY%6*PV>~{Kf5OImQ#9kIx`n=JhF~M$X*rCt6HF24l+lypCm@CPDV^ zzW%R3Jzf*n<4>AQg#0{6tn|fs#IM1}uCI|EBb#F#E;Byk(&zOvBg-wN|1Fn(gcKO@ z_uHP__P*`X=k+)vKQFTl_xSxD>2v&rMv{a$zwF8F|3^@XO=SJBrlc9~R>j)4+yBp? z#;!lEDN)9`nx@Kd|1nazu^z|qo4}z6>+}Bv)3lI^K%G6YKI1%8+Vw?*q}vp-A7X3% zxqK5cXp8;x`YS~G?1$y)a=0k`Kp;orHJ>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) +# define COMPILER_ID "Fujitsu" + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) +# define COMPILER_ID "ADSP" +#if defined(__VISUALDSPVERSION__) + /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) +# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(_CRAYC) || defined(__cray__) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number components. */ +#ifdef COMPILER_VERSION_MAJOR +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L +# if defined(__INTEL_CXX11_MODE__) +# if defined(__cpp_aggregate_nsdmi) +# define CXX_STD 201402L +# else +# define CXX_STD 201103L +# endif +# else +# define CXX_STD 199711L +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# define CXX_STD _MSVC_LANG +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_dialect_default = "INFO" ":" "dialect_default[" +#if CXX_STD > 201703L + "20" +#elif CXX_STD >= 201703L + "17" +#elif CXX_STD >= 201402L + "14" +#elif CXX_STD >= 201103L + "11" +#else + "98" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#ifdef COMPILER_VERSION_INTERNAL + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(_CRAYC) || defined(__cray__) + require += info_cray[argc]; +#endif + require += info_language_dialect_default[argc]; + (void)argv; + return require; +} diff --git a/bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out b/bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out new file mode 100755 index 0000000000000000000000000000000000000000..c8684265455284359fc556a1ef0b98aa7a612508 GIT binary patch literal 16720 zcmeHOZ)_Y#6`%9jiIXPhOX@TxY3glABq!9Dvy-?^T9Z55=j@?N(k6E6;=0S)ceYR5 zA9J@y?243t)1p%_L~11Z0i>u%2#KHqABu`pa1@#XBD6tO2?_`ci0Yz{x`iSGX^!`1 z-#hQFFBPJE0qsb)znS0rGqZ1I_jYz?J{yVkRCzptlUICHU@7D`nGgy5dnp4D676C& z95;zO#WE;YOU{&sOaQ5wE?3#HmUu59+BION0^VuTP=lGcg@|Z(tJH)Ig2X83JkYKN z1ypw8ZfYkZ%ggmCXbee_$1+|<1xSomJ8a5)vlNT@4m*aZK9!K|uqaOSN@1VodPYPVsc2VtOez-)YxRc24XjJ4UPn(~+x2{6DGh0kS)*NH@ZX_nWj}!b_6cw^gB*oX_C-CFQNDK5&@0*_-+pby#g_)Q-&6m~sTc0cun(*gbughl4+$(| z9_v6I^ZY*tIU37=mlD57OX3!XcHor?vJJqkt-$vJr&QpFZ^7RN{N@V!0^&D};c63_ zHawwgBgu@ON4_GH)buy$8Bd z*-WBWA4;L+XgZrAOU+cRs3_ZGMv-Ibfe2y@d0Z4WBv)W`@1eHy^~u+Tvc?oF&~?lF zEIFtRnR4d2?04{rV(K+G_#E+ygZ~2YO%DEP;xF$LGT~Uj^WijW;rX0VHfP~^Y$88z z;rSXve!;@a`z4ZYawFhIz>R<#0XG6}1l$O?5%|A}z+dX_`iDAotyVo*^XnZ#s87xq zRi#(esUO##m*-g8{VdS$l(v2ypsrD%K9pXRrEVe1Eq{&{FFmFff3HscasGkc*mTVW zcr;a~S09qlaSl9{*5$zDucy@Mju#-KPS<=7Vb6lG4yrzgd8m3tX|}HMI97a~5cG>u zfA{ARw%t^V^Xj?l`_yv_Ue$9!y>!#42M1fpL2YSvq^=R##rD|V;~fzYi^50x)Txdt z%&Nt!#wzt>$1*6)Z7Y>Zb8$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5*?ED)7>&-c zIM{Q^v^R&TX~B7LuBVg3&>Zah0K{DcpdZpO?D+!xfQa(}xJAG{-Aw#^$H?;m5=&jq zBYqfu_^izK{2a)rfXtf8_Xi@|0Il}@^jyfe#cB+BzW*{Eb=dQBC8NTMgiia1f&Uvk z^K<)op2NuX<2Ni!&i3oT;T(tUc^<@g3XLG)IbxjIp64$~;P8~$o}XtKc^(BSGNBJ^ z`VvxXd?~^^pUnrzWc$SI`L~~L62y)m&wm(Y>jQ5u{&5X1Di$GiLc^<+z z@380oXZlx=!Do7&4)XIU@Bek`bD8lEU|VOg=jZu_W*{N4o>^KfGyfI{aO`pY<>zKt z-;HU8`VYrHCbr{#{04BS!uI?gV}>5&LLjpywr5-bq19f5NIPgE0g;RKGjS6#=!@&; z=eZymay_h1r^7|z1p+x|J#4?dtZ8Q0-ikbStg4?NhbmpzcpYPxaC`Xvw*okByVd@i d_{RY0A%}CW*OcP3XJz}F?WV>mhk>Ig{sl?qig^G4 literal 0 HcmV?d00001 diff --git a/bin/CMakeFiles/CMakeDirectoryInformation.cmake b/bin/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 0000000..2bbe5e6 --- /dev/null +++ b/bin/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/stone/source/cpp/qt/coderdbc-core/src") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/stone/source/cpp/qt/coderdbc-core/bin") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/bin/CMakeFiles/Makefile.cmake b/bin/CMakeFiles/Makefile.cmake new file mode 100644 index 0000000..f398819 --- /dev/null +++ b/bin/CMakeFiles/Makefile.cmake @@ -0,0 +1,96 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "CMakeFiles/3.19.4/CMakeCXXCompiler.cmake" + "CMakeFiles/3.19.4/CMakeSystem.cmake" + "/home/stone/source/cpp/qt/coderdbc-core/src/CMakeLists.txt" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCXXCompiler.cmake.in" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCXXCompilerABI.cpp" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCXXInformation.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCommonLanguageInclude.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCompilerIdDetection.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCXXCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompileFeatures.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompilerABI.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineSystem.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeGenericSystem.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeInitializeConfigs.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeLanguageInformation.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeParseImplicitIncludeInfo.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeParseImplicitLinkInfo.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeSystem.cmake.in" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeSystemSpecificInformation.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeSystemSpecificInitialize.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeTestCompilerCommon.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/CMakeUnixFindMake.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/ADSP-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/ARMCC-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/ARMClang-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/AppleClang-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Borland-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Clang-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Cray-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GHS-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU-CXX.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU-FindBinUtils.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/IAR-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Intel-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/MSVC-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/PGI-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/PathScale-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/SCO-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/TI-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Watcom-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Internal/FeatureTesting.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux-Determine-CXX.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux-GNU-CXX.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux-GNU.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux.cmake" + "/snap/cmake/775/share/cmake-3.19/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/3.19.4/CMakeSystem.cmake" + "CMakeFiles/3.19.4/CMakeCXXCompiler.cmake" + "CMakeFiles/3.19.4/CMakeCXXCompiler.cmake" + "CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake" + ) diff --git a/bin/CMakeFiles/Makefile2 b/bin/CMakeFiles/Makefile2 new file mode 100644 index 0000000..f6cb518 --- /dev/null +++ b/bin/CMakeFiles/Makefile2 @@ -0,0 +1,125 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /snap/cmake/775/bin/cmake + +# The command to remove a file. +RM = /snap/cmake/775/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/stone/source/cpp/qt/coderdbc-core/src + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/stone/source/cpp/qt/coderdbc-core/bin + +#============================================================================= +# Directory level rules for the build root directory + +# The main recursive "all" target. +all: CMakeFiles/dbcscanner-lib.dir/all + +.PHONY : all + +# The main recursive "preinstall" target. +preinstall: + +.PHONY : preinstall + +# The main recursive "clean" target. +clean: CMakeFiles/dbcscanner-lib.dir/clean + +.PHONY : clean + +#============================================================================= +# Target rules for target CMakeFiles/dbcscanner-lib.dir + +# All Build rule for target. +CMakeFiles/dbcscanner-lib.dir/all: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/depend + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9,10 "Built target dbcscanner-lib" +.PHONY : CMakeFiles/dbcscanner-lib.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/dbcscanner-lib.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles 10 + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/dbcscanner-lib.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles 0 +.PHONY : CMakeFiles/dbcscanner-lib.dir/rule + +# Convenience name for target. +dbcscanner-lib: CMakeFiles/dbcscanner-lib.dir/rule + +.PHONY : dbcscanner-lib + +# clean rule for target. +CMakeFiles/dbcscanner-lib.dir/clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/clean +.PHONY : CMakeFiles/dbcscanner-lib.dir/clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/bin/CMakeFiles/TargetDirectories.txt b/bin/CMakeFiles/TargetDirectories.txt new file mode 100644 index 0000000..44260b2 --- /dev/null +++ b/bin/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,3 @@ +/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/rebuild_cache.dir +/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir +/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/edit_cache.dir diff --git a/bin/CMakeFiles/cmake.check_cache b/bin/CMakeFiles/cmake.check_cache new file mode 100644 index 0000000..3dccd73 --- /dev/null +++ b/bin/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache b/bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache new file mode 100644 index 0000000..cf281fc --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache @@ -0,0 +1,216 @@ +#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) + +#IncludeRegexScan: ^.*$ + +#IncludeRegexComplain: ^$ + +#IncludeRegexTransform: + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp +sys/types.h +- +sys/stat.h +- +iostream +- +fstream +- +cstdlib +- +stdarg.h +- +filesystem +- +algorithm +- +regex +- +helpers/formatter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h +c-main-generator.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h +stdint.h +- +c-sigprinter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h +filewriter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h +../types/message.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +../types/outfile.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h +fs-creator.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp +stdlib.h +- +c-sigprinter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h +helpers/formatter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h +../types/c-expr.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp +c-util-generator.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h +helpers/formatter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h +algorithm +- + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h +types/message.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/types/message.h +fs-creator.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h +filewriter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h +conditional-tree.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp +conditional-tree.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h +helpers/formatter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h +string +- + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp +iostream +- +fstream +- +filewriter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h +stdint.h +- +string +- +sstream +- + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp +sys/stat.h +- +filesystem +- +fs-creator.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h +helpers/formatter.h +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h + +/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h +stdint.h +- +string +- +../types/outfile.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h + +/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp +formatter.h +/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +algorithm +- + +/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +stdint.h +- +stdlib.h +- +stdarg.h +- +string +- + +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp +dbclineparser.h +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h +regex +- +math.h +- +limits.h +- + +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h +stdint.h +- +../types/message.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h + +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp +dbcscanner.h +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h +algorithm +- +math.h +- + +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h +stdint.h +- +stdlib.h +- +iostream +- +../types/message.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +dbclineparser.h +/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h + +/home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +stdint.h +- +vector +- +string +- + +/home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h +stdlib.h +- +message.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +vector +- +string +- + +/home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h +stdint.h +- +string +- + +/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +stdint.h +- +stdlib.h +- +string +- +vector +- +attributes.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +comment.h +/home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h + +/home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h +stdint.h +- +string +- + diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake b/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake new file mode 100644 index 0000000..d614d98 --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake @@ -0,0 +1,36 @@ +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + "CXX" + ) +# The set of files for implicit dependencies of each language: +set(CMAKE_DEPENDS_CHECK_CXX + "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" + "/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" + ) +set(CMAKE_CXX_COMPILER_ID "GNU") + +# Preprocessor definitions for this target. +set(CMAKE_TARGET_DEFINITIONS_CXX + "DBCSCANNERLIB_LIBRARY" + "dbcscanner_lib_EXPORTS" + ) + +# The include file search paths: +set(CMAKE_CXX_TARGET_INCLUDE_PATH + "." + "/home/stone/source/cpp/qt/coderdbc-core/src" + ) + +# Targets to which this target links. +set(CMAKE_TARGET_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/build.make b/bin/CMakeFiles/dbcscanner-lib.dir/build.make new file mode 100644 index 0000000..271f580 --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/build.make @@ -0,0 +1,237 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /snap/cmake/775/bin/cmake + +# The command to remove a file. +RM = /snap/cmake/775/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/stone/source/cpp/qt/coderdbc-core/src + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/stone/source/cpp/qt/coderdbc-core/bin + +# Include any dependencies generated for this target. +include CMakeFiles/dbcscanner-lib.dir/depend.make + +# Include the progress variables for this target. +include CMakeFiles/dbcscanner-lib.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/dbcscanner-lib.dir/flags.make + +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp + +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i + +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s + +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp + +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i + +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s + +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp + +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i + +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s + +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp + +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i + +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s + +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp + +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i + +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s + +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp + +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i + +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s + +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp + +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp > CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i + +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp -o CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s + +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp + +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp > CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i + +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp -o CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s + +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp + +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp > CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i + +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s" + /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp -o CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s + +# Object files for target dbcscanner-lib +dbcscanner__lib_OBJECTS = \ +"CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" \ +"CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" + +# External object files for target dbcscanner-lib +dbcscanner__lib_EXTERNAL_OBJECTS = + +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/build.make +libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Linking CXX shared library libdbcscanner-lib.so" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/dbcscanner-lib.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/dbcscanner-lib.dir/build: libdbcscanner-lib.so + +.PHONY : CMakeFiles/dbcscanner-lib.dir/build + +CMakeFiles/dbcscanner-lib.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake +.PHONY : CMakeFiles/dbcscanner-lib.dir/clean + +CMakeFiles/dbcscanner-lib.dir/depend: + cd /home/stone/source/cpp/qt/coderdbc-core/bin && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/stone/source/cpp/qt/coderdbc-core/src /home/stone/source/cpp/qt/coderdbc-core/src /home/stone/source/cpp/qt/coderdbc-core/bin /home/stone/source/cpp/qt/coderdbc-core/bin /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake --color=$(COLOR) +.PHONY : CMakeFiles/dbcscanner-lib.dir/depend + diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake b/bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake new file mode 100644 index 0000000..d3ed29b --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake @@ -0,0 +1,18 @@ +file(REMOVE_RECURSE + "CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" + "CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" + "libdbcscanner-lib.pdb" + "libdbcscanner-lib.so" +) + +# Per-language clean rules from dependency scanning. +foreach(lang CXX) + include(CMakeFiles/dbcscanner-lib.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/depend.internal b/bin/CMakeFiles/dbcscanner-lib.dir/depend.internal new file mode 100644 index 0000000..97fb6bc --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/depend.internal @@ -0,0 +1,62 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o + /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h + /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp + /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h + /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/depend.make b/bin/CMakeFiles/dbcscanner-lib.dir/depend.make new file mode 100644 index 0000000..d7680b8 --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/depend.make @@ -0,0 +1,62 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h + +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h + +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h +CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h + +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h +CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h + +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp +CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h + +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h +CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h + +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp +CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h + +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h +CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h + +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h +CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h + diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/flags.make b/bin/CMakeFiles/dbcscanner-lib.dir/flags.make new file mode 100644 index 0000000..f0fb1b0 --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/flags.make @@ -0,0 +1,10 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# compile CXX with /usr/bin/g++ +CXX_DEFINES = -DDBCSCANNERLIB_LIBRARY -Ddbcscanner_lib_EXPORTS + +CXX_INCLUDES = -I/home/stone/source/cpp/qt/coderdbc-core/bin -I/home/stone/source/cpp/qt/coderdbc-core/src + +CXX_FLAGS = -fPIC -std=gnu++17 + diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/link.txt b/bin/CMakeFiles/dbcscanner-lib.dir/link.txt new file mode 100644 index 0000000..1c404aa --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/g++ -fPIC -shared -Wl,-soname,libdbcscanner-lib.so -o libdbcscanner-lib.so CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/progress.make b/bin/CMakeFiles/dbcscanner-lib.dir/progress.make new file mode 100644 index 0000000..6c587e2 --- /dev/null +++ b/bin/CMakeFiles/dbcscanner-lib.dir/progress.make @@ -0,0 +1,11 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 +CMAKE_PROGRESS_3 = 3 +CMAKE_PROGRESS_4 = 4 +CMAKE_PROGRESS_5 = 5 +CMAKE_PROGRESS_6 = 6 +CMAKE_PROGRESS_7 = 7 +CMAKE_PROGRESS_8 = 8 +CMAKE_PROGRESS_9 = 9 +CMAKE_PROGRESS_10 = 10 + diff --git a/bin/CMakeFiles/progress.marks b/bin/CMakeFiles/progress.marks new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/bin/CMakeFiles/progress.marks @@ -0,0 +1 @@ +10 diff --git a/bin/Makefile b/bin/Makefile new file mode 100644 index 0000000..8b6df52 --- /dev/null +++ b/bin/Makefile @@ -0,0 +1,437 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.19 + +# Default target executed when no arguments are given to make. +default_target: all + +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + + +# Disable VCS-based implicit rules. +% : %,v + + +# Disable VCS-based implicit rules. +% : RCS/% + + +# Disable VCS-based implicit rules. +% : RCS/%,v + + +# Disable VCS-based implicit rules. +% : SCCS/s.% + + +# Disable VCS-based implicit rules. +% : s.% + + +.SUFFIXES: .hpux_make_needs_suffix_list + + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: + +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /snap/cmake/775/bin/cmake + +# The command to remove a file. +RM = /snap/cmake/775/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/stone/source/cpp/qt/coderdbc-core/src + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/stone/source/cpp/qt/coderdbc-core/bin + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /snap/cmake/775/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache + +.PHONY : rebuild_cache/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /snap/cmake/775/bin/cmake-gui -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache + +.PHONY : edit_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles /home/stone/source/cpp/qt/coderdbc-core/bin//CMakeFiles/progress.marks + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean + +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named dbcscanner-lib + +# Build rule for target. +dbcscanner-lib: cmake_check_build_system + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 dbcscanner-lib +.PHONY : dbcscanner-lib + +# fast build rule for target. +dbcscanner-lib/fast: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/build +.PHONY : dbcscanner-lib/fast + +codegen/c-main-generator.o: codegen/c-main-generator.cpp.o + +.PHONY : codegen/c-main-generator.o + +# target to build an object file +codegen/c-main-generator.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o +.PHONY : codegen/c-main-generator.cpp.o + +codegen/c-main-generator.i: codegen/c-main-generator.cpp.i + +.PHONY : codegen/c-main-generator.i + +# target to preprocess a source file +codegen/c-main-generator.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i +.PHONY : codegen/c-main-generator.cpp.i + +codegen/c-main-generator.s: codegen/c-main-generator.cpp.s + +.PHONY : codegen/c-main-generator.s + +# target to generate assembly for a file +codegen/c-main-generator.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s +.PHONY : codegen/c-main-generator.cpp.s + +codegen/c-sigprinter.o: codegen/c-sigprinter.cpp.o + +.PHONY : codegen/c-sigprinter.o + +# target to build an object file +codegen/c-sigprinter.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o +.PHONY : codegen/c-sigprinter.cpp.o + +codegen/c-sigprinter.i: codegen/c-sigprinter.cpp.i + +.PHONY : codegen/c-sigprinter.i + +# target to preprocess a source file +codegen/c-sigprinter.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i +.PHONY : codegen/c-sigprinter.cpp.i + +codegen/c-sigprinter.s: codegen/c-sigprinter.cpp.s + +.PHONY : codegen/c-sigprinter.s + +# target to generate assembly for a file +codegen/c-sigprinter.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s +.PHONY : codegen/c-sigprinter.cpp.s + +codegen/c-util-generator.o: codegen/c-util-generator.cpp.o + +.PHONY : codegen/c-util-generator.o + +# target to build an object file +codegen/c-util-generator.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o +.PHONY : codegen/c-util-generator.cpp.o + +codegen/c-util-generator.i: codegen/c-util-generator.cpp.i + +.PHONY : codegen/c-util-generator.i + +# target to preprocess a source file +codegen/c-util-generator.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i +.PHONY : codegen/c-util-generator.cpp.i + +codegen/c-util-generator.s: codegen/c-util-generator.cpp.s + +.PHONY : codegen/c-util-generator.s + +# target to generate assembly for a file +codegen/c-util-generator.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s +.PHONY : codegen/c-util-generator.cpp.s + +codegen/conditional-tree.o: codegen/conditional-tree.cpp.o + +.PHONY : codegen/conditional-tree.o + +# target to build an object file +codegen/conditional-tree.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o +.PHONY : codegen/conditional-tree.cpp.o + +codegen/conditional-tree.i: codegen/conditional-tree.cpp.i + +.PHONY : codegen/conditional-tree.i + +# target to preprocess a source file +codegen/conditional-tree.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i +.PHONY : codegen/conditional-tree.cpp.i + +codegen/conditional-tree.s: codegen/conditional-tree.cpp.s + +.PHONY : codegen/conditional-tree.s + +# target to generate assembly for a file +codegen/conditional-tree.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s +.PHONY : codegen/conditional-tree.cpp.s + +codegen/filewriter.o: codegen/filewriter.cpp.o + +.PHONY : codegen/filewriter.o + +# target to build an object file +codegen/filewriter.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o +.PHONY : codegen/filewriter.cpp.o + +codegen/filewriter.i: codegen/filewriter.cpp.i + +.PHONY : codegen/filewriter.i + +# target to preprocess a source file +codegen/filewriter.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i +.PHONY : codegen/filewriter.cpp.i + +codegen/filewriter.s: codegen/filewriter.cpp.s + +.PHONY : codegen/filewriter.s + +# target to generate assembly for a file +codegen/filewriter.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s +.PHONY : codegen/filewriter.cpp.s + +codegen/fs-creator.o: codegen/fs-creator.cpp.o + +.PHONY : codegen/fs-creator.o + +# target to build an object file +codegen/fs-creator.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o +.PHONY : codegen/fs-creator.cpp.o + +codegen/fs-creator.i: codegen/fs-creator.cpp.i + +.PHONY : codegen/fs-creator.i + +# target to preprocess a source file +codegen/fs-creator.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i +.PHONY : codegen/fs-creator.cpp.i + +codegen/fs-creator.s: codegen/fs-creator.cpp.s + +.PHONY : codegen/fs-creator.s + +# target to generate assembly for a file +codegen/fs-creator.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s +.PHONY : codegen/fs-creator.cpp.s + +helpers/formatter.o: helpers/formatter.cpp.o + +.PHONY : helpers/formatter.o + +# target to build an object file +helpers/formatter.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o +.PHONY : helpers/formatter.cpp.o + +helpers/formatter.i: helpers/formatter.cpp.i + +.PHONY : helpers/formatter.i + +# target to preprocess a source file +helpers/formatter.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i +.PHONY : helpers/formatter.cpp.i + +helpers/formatter.s: helpers/formatter.cpp.s + +.PHONY : helpers/formatter.s + +# target to generate assembly for a file +helpers/formatter.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s +.PHONY : helpers/formatter.cpp.s + +parser/dbclineparser.o: parser/dbclineparser.cpp.o + +.PHONY : parser/dbclineparser.o + +# target to build an object file +parser/dbclineparser.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o +.PHONY : parser/dbclineparser.cpp.o + +parser/dbclineparser.i: parser/dbclineparser.cpp.i + +.PHONY : parser/dbclineparser.i + +# target to preprocess a source file +parser/dbclineparser.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i +.PHONY : parser/dbclineparser.cpp.i + +parser/dbclineparser.s: parser/dbclineparser.cpp.s + +.PHONY : parser/dbclineparser.s + +# target to generate assembly for a file +parser/dbclineparser.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s +.PHONY : parser/dbclineparser.cpp.s + +parser/dbcscanner.o: parser/dbcscanner.cpp.o + +.PHONY : parser/dbcscanner.o + +# target to build an object file +parser/dbcscanner.cpp.o: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o +.PHONY : parser/dbcscanner.cpp.o + +parser/dbcscanner.i: parser/dbcscanner.cpp.i + +.PHONY : parser/dbcscanner.i + +# target to preprocess a source file +parser/dbcscanner.cpp.i: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i +.PHONY : parser/dbcscanner.cpp.i + +parser/dbcscanner.s: parser/dbcscanner.cpp.s + +.PHONY : parser/dbcscanner.s + +# target to generate assembly for a file +parser/dbcscanner.cpp.s: + $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s +.PHONY : parser/dbcscanner.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... dbcscanner-lib" + @echo "... codegen/c-main-generator.o" + @echo "... codegen/c-main-generator.i" + @echo "... codegen/c-main-generator.s" + @echo "... codegen/c-sigprinter.o" + @echo "... codegen/c-sigprinter.i" + @echo "... codegen/c-sigprinter.s" + @echo "... codegen/c-util-generator.o" + @echo "... codegen/c-util-generator.i" + @echo "... codegen/c-util-generator.s" + @echo "... codegen/conditional-tree.o" + @echo "... codegen/conditional-tree.i" + @echo "... codegen/conditional-tree.s" + @echo "... codegen/filewriter.o" + @echo "... codegen/filewriter.i" + @echo "... codegen/filewriter.s" + @echo "... codegen/fs-creator.o" + @echo "... codegen/fs-creator.i" + @echo "... codegen/fs-creator.s" + @echo "... helpers/formatter.o" + @echo "... helpers/formatter.i" + @echo "... helpers/formatter.s" + @echo "... parser/dbclineparser.o" + @echo "... parser/dbclineparser.i" + @echo "... parser/dbclineparser.s" + @echo "... parser/dbcscanner.o" + @echo "... parser/dbcscanner.i" + @echo "... parser/dbcscanner.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/bin/cmake_install.cmake b/bin/cmake_install.cmake new file mode 100644 index 0000000..0ab6a6b --- /dev/null +++ b/bin/cmake_install.cmake @@ -0,0 +1,54 @@ +# Install script for directory: /home/stone/source/cpp/qt/coderdbc-core/src + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/usr/local") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +# Set default install directory permissions. +if(NOT DEFINED CMAKE_OBJDUMP) + set(CMAKE_OBJDUMP "/usr/bin/objdump") +endif() + +if(CMAKE_INSTALL_COMPONENT) + set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") +else() + set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") +endif() + +string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT + "${CMAKE_INSTALL_MANIFEST_FILES}") +file(WRITE "/home/stone/source/cpp/qt/coderdbc-core/bin/${CMAKE_INSTALL_MANIFEST}" + "${CMAKE_INSTALL_MANIFEST_CONTENT}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..6e92d02 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.5) + +project(dbcscanner-lib LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +add_library(dbcscanner-lib SHARED + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-main-generator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-util-generator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/conditional-tree.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-sigprinter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/filewriter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/fs-creator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbclineparser.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbcscanner.cpp +) + + +target_compile_definitions(dbcscanner-lib PRIVATE DBCSCANNERLIB_LIBRARY) From c369336ceb9245dbf7d5f4e2d51a24412bb0b951 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 17 Feb 2021 10:38:43 +0300 Subject: [PATCH 056/181] resplit has more param - type of pslit strategy. (was only NOT matched). --- src/parser/dbclineparser.cpp | 38 ++++++++++++++++++++++-------------- src/parser/dbcscanner.cpp | 4 ++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index e4d5d40..01e7444 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -38,11 +38,20 @@ static uint64_t __maxsignedvals[] = LLONG_MAX }; -std::vector resplit(const std::string& s, const std::string& rgx_str) +//* @param __submatch +// - -1 each enumerated subexpression does NOT +// match the regular expression (aka field +// splitting) +// - 0 the entire string matching the +// subexpression is returned for each match +// within the text. +// - >0 enumerates only the indicated +// subexpression from a match within the text. +std::vector resplit(const std::string& s, const std::string& rgx_str, int32_t submatch) { std::vector elems; std::regex rgx(rgx_str); - std::sregex_token_iterator iter(s.begin(), s.end(), rgx, -1); + std::sregex_token_iterator iter(s.begin(), s.end(), rgx, submatch); std::sregex_token_iterator end; while (iter != end) @@ -92,7 +101,7 @@ bool DbcLineParser::IsMessageLine(const std::string& line) bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string& line) { // Parse DBC message line - auto items = resplit(line, regMessage); + auto items = resplit(line, regMessage, -1); if (items.size() < 5) return false; @@ -127,18 +136,18 @@ bool DbcLineParser::IsSignalLine(const std::string& line) bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& line) { // split line in two parts - auto halfs = resplit(line, kRegSigSplit1); + auto halfs = resplit(line, kRegSigSplit1, -1); if (halfs.size() < 2) return false; // split tail - auto tailpart = resplit(halfs[1], kregSigSplit2); + auto tailpart = resplit(halfs[1], kregSigSplit2, -1); // split middle part on dedicated values - auto valpart = resplit(trim(tailpart[0]), kRegSigReceivers); + auto valpart = resplit(trim(tailpart[0]), kRegSigReceivers, -1); - halfs = resplit(halfs[0], kRegSigSplit0); + halfs = resplit(halfs[0], kRegSigSplit0, -1); if (halfs.size() > 1) { @@ -210,7 +219,7 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // part 2 is the measure unit sig->Unit = tailpart[1]; // part 3 is the list of RX modules - auto recs = resplit(trim(tailpart[2]), kRegSigReceivers); + auto recs = resplit(trim(tailpart[2]), kRegSigReceivers, -1); for (size_t i = 0; i < recs.size(); i++) { @@ -365,12 +374,12 @@ bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line) cm->ca_target = CommentTarget::Undefined; // comment line must have 3 part: meta, text, semicolon - auto items = resplit(commentline, kRegCommMain); + auto items = resplit(commentline, kRegCommMain, -1); if (items.size() == 3) { // part 1 (meta) contains service fields - auto meta = resplit(items[0], kRegCommMeta); + auto meta = resplit(items[0], kRegCommMeta, -1); if (meta.size() >= 3) { @@ -429,7 +438,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s { attr->Type = AttributeType::Undefined; // raw line is ready - auto items = resplit(attribline, kRegAttrMain); + auto items = resplit(attribline, kRegAttrMain, -1); if (items.size() > 4 && items[1] == "GenMsgCycleTime" && items[2] == "BO_") { @@ -467,12 +476,12 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) if (valueline.size() > 0 && line.back() == ';') { // split all line by quote char - auto items = resplit(valueline, kRegValTable); + auto items = resplit(valueline, kRegValTable, 0); if (items.size() >= 2) { // split first part by spaces, the last item will have first value key - auto meta = resplit(items[0], kRegCommMeta); + auto meta = resplit(items[0], kRegCommMeta, -1); if (meta.size() == 4) { @@ -487,8 +496,7 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) for (size_t valpair = 0; valpair < (items.size() / 2); valpair++) { - comm->Text += items[valpair * 2 + 0] + " : "; - comm->Text += items[valpair * 2 + 1] + "\n"; + comm->Text += items[valpair * 2 + 0] + " : " + items[valpair * 2 + 1] + '\n'; } // value table params were parse successfully diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index f676b36..1a44dea 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -158,7 +158,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) msg->RollSig = &msg->Signals[i]; } - extern std::vector resplit(const std::string & s, const std::string & rgx_str); + extern std::vector resplit(const std::string & s, const std::string & rgx_str, int32_t submatch); size_t openpos = cmmnt.Text.find('<'); @@ -170,7 +170,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { auto substr = cmmnt.Text.substr(openpos + 1, closepos - 1); - auto meta = resplit(substr, "(\\:)"); + auto meta = resplit(substr, "(\\:)", -1); if (meta.size() == 3 && meta[0] == "Checksum") { From 051df8e991963cf9a17f9c17220eb0ce55056663 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 17 Feb 2021 10:48:17 +0300 Subject: [PATCH 057/181] Fixed value table code printing issue. --- src/parser/dbclineparser.cpp | 44 +++++++++++++++++------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 01e7444..3f4c998 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -20,7 +20,13 @@ static const std::string kRegCommMeta = "[ ]+"; // This reg splits line to parts (for attributes) static const std::string kRegAttrMain = "[^A-Za-z0-9_\\.]+"; -static const std::string kRegValTable = "\""; +// Regex template to split string by spaces BUT NOT what inside quotes OR apostrophes +// [^\s"']+|"([^"]*)"|'([^']*)' + +// Reges template to split string by spaces BUT NOT what inside quotes +// [^\s"]+|"([^"]*)" + +static const std::string kRegValTable = "[^\\s\"]+|\"([^\"]*)\""; static uint64_t __maxunsigvalues[] = { @@ -38,7 +44,7 @@ static uint64_t __maxsignedvals[] = LLONG_MAX }; -//* @param __submatch +//* @param __submatch // - -1 each enumerated subexpression does NOT // match the regular expression (aka field // splitting) @@ -475,33 +481,25 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) // check if the current line is last if (valueline.size() > 0 && line.back() == ';') { - // split all line by quote char + // split all items by spaces and inside quotes. + // after this step proper value items will have count >= 5 + // last item will be ';' and number of items will be even auto items = resplit(valueline, kRegValTable, 0); - if (items.size() >= 2) + if ((items.size() >= 5) && (items.back() == ";") && (items.size() % 2 == 0)) { - // split first part by spaces, the last item will have first value key - auto meta = resplit(items[0], kRegCommMeta, -1); + comm->MsgId = (clear_msgid(atoi(items[1].c_str()))); + comm->SigName = items[2]; + comm->Text = ""; - if (meta.size() == 4) + for (size_t valpair = 5; valpair < (items.size() - 1); valpair += 2) { - // ok, set items[0] -> meta[3] (set value key as first @items element) - items[0] = meta[3]; - - comm->MsgId = (clear_msgid(atoi(meta[1].c_str()))); - - comm->SigName = meta[2]; - // Load value table params to container - comm->Text = ""; - - for (size_t valpair = 0; valpair < (items.size() / 2); valpair++) - { - comm->Text += items[valpair * 2 + 0] + " : " + items[valpair * 2 + 1] + '\n'; - } - - // value table params were parse successfully - ret = true; + comm->Text += " " + items[valpair + 0] + " : "; + comm->Text += items[valpair + 1] + '\n'; } + + // value table params were parse successfully + ret = true; } } } From b952fab0bdcc5a0fe43966c41b7527b4a4b12013 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 17 Feb 2021 10:48:37 +0300 Subject: [PATCH 058/181] Fixed issue with comment text for message. --- src/codegen/c-main-generator.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index d272063..2e622f0 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -72,6 +72,12 @@ void CiMainGenerator::Gen_MainHeader() // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + if (m.CommentText.size() > 0) + { + // replace all '\n' on "\n //" for c code comment text + fwriter->AppendLine("// " + std::regex_replace(m.CommentText, std::regex("\n"), "\n// ")); + } + fwriter->AppendLine(StrPrint("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID)); fwriter->AppendLine(StrPrint("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt)); fwriter->AppendLine(StrPrint("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC)); @@ -82,11 +88,6 @@ void CiMainGenerator::Gen_MainHeader() fwriter->AppendLine(StrPrint("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle)); } - if (m.CommentText.size() > 0) - { - fwriter->AppendLine("// -- " + m.CommentText); - } - size_t max_sig_name_len = 27; for (size_t signum = 0; signum < m.Signals.size(); signum++) @@ -525,7 +526,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->msg.Signals[n].IsDoubleSig) { // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s_phys);", + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s_phys);", sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); } @@ -533,7 +534,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp { // print toS from original named signal to itself (because this signal // has enough space for scaling by factor and proper sign - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s);", + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s);", sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); } @@ -558,7 +559,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp // code for getting checksum value and putting it in array fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d));", + fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d));", sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); From cf4ac280374412c49ab25eb833d17e19c73e528a Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 17 Feb 2021 11:56:42 +0300 Subject: [PATCH 059/181] Simple support for multiplexed signals. --- src/codegen/c-main-generator.cpp | 9 +++++++++ src/parser/dbclineparser.cpp | 20 +++++++++++++++++--- src/types/message.h | 9 +++++++++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 2e622f0..813a0fc 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -322,6 +322,15 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendLine(" // " + std::regex_replace(sig.ValueText, std::regex("\n"), "\n // ")); } + if (sig.Multiplex == MultiplexType::kMulValue) + { + fwriter->AppendLine(" // multiplex variable"); + } + else if (sig.Multiplex == MultiplexType::kMaster) + { + fwriter->AppendLine(" // MULTIPLEX master signal"); + } + std::string dtype = ""; dtype += " " + PrintType((int)sig.Type) + " " + sig.Name; diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 3f4c998..63fa321 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -153,11 +153,25 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // split middle part on dedicated values auto valpart = resplit(trim(tailpart[0]), kRegSigReceivers, -1); - halfs = resplit(halfs[0], kRegSigSplit0, -1); + halfs = resplit(halfs[0], kRegValTable, 0); - if (halfs.size() > 1) + if (halfs.size() >= 2) { - sig->Name = halfs[halfs.size() - 1]; + sig->Name = halfs[1]; + sig->Multiplex = MultiplexType::kNone; + + if (halfs.size() == 3) + { + // Multiplex signal, put additional comment + if (halfs[2] == "M") + { + sig->Multiplex = MultiplexType::kMaster; + } + else + { + sig->Multiplex = MultiplexType::kMulValue; + } + } } else { diff --git a/src/types/message.h b/src/types/message.h index e3ead02..9b25cd7 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -13,6 +13,13 @@ enum class BitLayout kMotorolla }; +enum class MultiplexType +{ + kNone, + kMaster, + kMulValue +}; + enum class SigType { i8 = 0, @@ -77,6 +84,8 @@ typedef struct std::string ValueText; + MultiplexType Multiplex; + } SignalDescriptor_t; typedef struct From 60abfecff28f543f112bc7c9147ec5da2d436a44 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 17 Feb 2021 14:13:04 +0300 Subject: [PATCH 060/181] Added template ***-config.h generation. --- src/codegen/c-main-generator.cpp | 73 +++++++++++++++++++++++++++++++- src/codegen/c-main-generator.h | 1 + 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 813a0fc..bbd83e9 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -43,6 +43,9 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs // 5 step is to print fmon source file Gen_FMonSource(); + + // 6 step is to print template for drv-config.h + Gen_ConfigHeader(); } void CiMainGenerator::Gen_MainHeader() @@ -254,6 +257,73 @@ void CiMainGenerator::Gen_MainSource() fwriter->Flush(fdesc->core_c.fpath); } +void CiMainGenerator::Gen_ConfigHeader() +{ + fwriter->AppendLine("#pragma once", 2); + + fwriter->AppendLine("/* include common dbccode configurations */"); + fwriter->AppendLine("#include \"dbccodeconf.h\"", 3); + fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); + fwriter->AppendLine("/* To enable using messaged typedefs based on bit-fields"); + fwriter->AppendLine(" uncomment define below. (Note(!): bit-feild was not tested"); + fwriter->AppendLine(" properly, so using is up to user). */",2 ); + fwriter->AppendLine(StrPrint("// #define %s", fdesc->usebits_def.c_str()), 3); + fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); + fwriter->AppendLine("/* By default signature of pack function intakes a few simple typed params"); + fwriter->AppendLine(" for loading data, len, etc. To enable specific struct based signature"); + fwriter->AppendLine(" uncomment define below. */", 2); + fwriter->AppendLine(StrPrint("// #define %s", fdesc->usesruct_def.c_str()), 3); + fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); + fwriter->AppendLine("/* To enable phys values handling uncomment define below. It will:"); + fwriter->AppendLine(" - adds additional members to message struct with name extension *_phys"); + fwriter->AppendLine(" which have user defined type @sigfloat_t (must be defined by user in"); + fwriter->AppendLine(" dbccodeconf.h)"); + fwriter->AppendLine(" - in unpack function these signal will be loaded by the converted "); + fwriter->AppendLine(" value (with factor and offset)"); + fwriter->AppendLine(" - in pack function the CAN frame signal values will be loaded from"); + fwriter->AppendLine(" *_phys value with factor and offset conversion. */", 2); + fwriter->AppendLine(StrPrint("// #define %s", fdesc->usesigfloat_def.c_str()), 3); + + fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); + fwriter->AppendLine("/* To enable monitor functions uncomment define below."); + fwriter->AppendLine("/* (Note(!): the \"canmonitorutil.h\" must be accessed in include path):"); + fwriter->AppendLine(" It will:"); + fwriter->AppendLine(" - bring to message struct special monitor member @mon1 "); + fwriter->AppendLine(" - calling function FMon_*** function inside unpack function "); + fwriter->AppendLine(" which is empty by default and must be filled by user code"); + fwriter->AppendLine(" to check if any fault state detected. */", 2); + fwriter->AppendLine(StrPrint("// #define %s", fdesc->usemon_def.c_str()), 3); + + fwriter->AppendLine(StrPrint("/* When monitor using is enabled (%s)", fdesc->usemon_def.c_str())); + fwriter->AppendLine(" and define below uncommented, additional signal will be added"); + fwriter->AppendLine(" to message struct. ***_expt - expected rolling counter, to "); + fwriter->AppendLine(" perform monitoring rolling counter sequence automatically. */", 2); + fwriter->AppendLine(StrPrint("// #define %s", fdesc->useroll_def.c_str()), 3); + + fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); + fwriter->AppendLine(StrPrint("/* When monitor using is enabled (%s)", fdesc->usemon_def.c_str())); + fwriter->AppendLine(" and define below uncommented, checksum calculation in unpack"); + fwriter->AppendLine(" function will be performed. in pack function checksum signal will"); + fwriter->AppendLine(" be calculated automatically too. ", 2); + fwriter->AppendLine(" The signal that can be selected as checksum must have in comment substring with next format:"); + fwriter->AppendLine(" where:"); + fwriter->AppendLine(" - Checksum : constant marker word"); + fwriter->AppendLine(" - XOR8 : type of method, this text will be passed to GetFrameHash function as is,"); + fwriter->AppendLine(" so the best use case is to pre-define enum collection which have value from this position"); + fwriter->AppendLine(" - 3 : optional value that will be passed to GetFrameHash as integer value", 2); + fwriter->AppendLine(" To this case user must define specific function", 2); + fwriter->AppendLine(" function: uint8_t GetFrameHash(data_ptr, len, msgid, type, option)", 2); + fwriter->AppendLine(" where:"); + fwriter->AppendLine(" - data_ptr : pointer to payload"); + fwriter->AppendLine(" - len : message dlc or payload len"); + fwriter->AppendLine(" - msgid : CAN Message ID"); + fwriter->AppendLine(" - type : method of algorythm"); + fwriter->AppendLine(" - option : optional integer param */", 2); + fwriter->AppendLine(StrPrint("// #define %s", fdesc->usecsm_def.c_str()), 2); + + fwriter->Flush(fdesc->core_c.dir + '/' + fdesc->drvname + "-config.h"); +} + void CiMainGenerator::Gen_FMonHeader() { fwriter->AppendLine("#pragma once", 2); @@ -461,7 +531,8 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) { // Put checksum check function call here fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->mon1.csm_error = ((uint8_t)GetFrameCRC(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", + fwriter->AppendLine( + StrPrint(" _m->mon1.csm_error = ((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index fd186d8..76b7a3d 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -17,6 +17,7 @@ class CiMainGenerator { void Gen_MainHeader(); void Gen_MainSource(); + void Gen_ConfigHeader(); void Gen_FMonHeader(); void Gen_FMonSource(); From 0cc9b3efe9c8a84b0bb1db587c4129517241ef45 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 17 Feb 2021 14:46:17 +0300 Subject: [PATCH 061/181] Removed cmake dir. --- .gitignore | 2 +- bin/CMakeCache.txt | 329 --------- bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake | 89 --- .../3.19.4/CMakeDetermineCompilerABI_CXX.bin | Bin 16560 -> 0 bytes bin/CMakeFiles/3.19.4/CMakeSystem.cmake | 15 - .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 680 ------------------ bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out | Bin 16720 -> 0 bytes .../CMakeDirectoryInformation.cmake | 16 - bin/CMakeFiles/Makefile.cmake | 96 --- bin/CMakeFiles/Makefile2 | 125 ---- bin/CMakeFiles/TargetDirectories.txt | 3 - bin/CMakeFiles/cmake.check_cache | 1 - .../dbcscanner-lib.dir/CXX.includecache | 216 ------ .../dbcscanner-lib.dir/DependInfo.cmake | 36 - bin/CMakeFiles/dbcscanner-lib.dir/build.make | 237 ------ .../dbcscanner-lib.dir/cmake_clean.cmake | 18 - .../dbcscanner-lib.dir/depend.internal | 62 -- bin/CMakeFiles/dbcscanner-lib.dir/depend.make | 62 -- bin/CMakeFiles/dbcscanner-lib.dir/flags.make | 10 - bin/CMakeFiles/dbcscanner-lib.dir/link.txt | 1 - .../dbcscanner-lib.dir/progress.make | 11 - bin/CMakeFiles/progress.marks | 1 - bin/Makefile | 437 ----------- bin/cmake_install.cmake | 54 -- 24 files changed, 1 insertion(+), 2500 deletions(-) delete mode 100644 bin/CMakeCache.txt delete mode 100644 bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake delete mode 100755 bin/CMakeFiles/3.19.4/CMakeDetermineCompilerABI_CXX.bin delete mode 100644 bin/CMakeFiles/3.19.4/CMakeSystem.cmake delete mode 100644 bin/CMakeFiles/3.19.4/CompilerIdCXX/CMakeCXXCompilerId.cpp delete mode 100755 bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out delete mode 100644 bin/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 bin/CMakeFiles/Makefile.cmake delete mode 100644 bin/CMakeFiles/Makefile2 delete mode 100644 bin/CMakeFiles/TargetDirectories.txt delete mode 100644 bin/CMakeFiles/cmake.check_cache delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/build.make delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/depend.internal delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/depend.make delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/flags.make delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/link.txt delete mode 100644 bin/CMakeFiles/dbcscanner-lib.dir/progress.make delete mode 100644 bin/CMakeFiles/progress.marks delete mode 100644 bin/Makefile delete mode 100644 bin/cmake_install.cmake diff --git a/.gitignore b/.gitignore index c2cb081..56d1937 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,7 @@ bld/ *.o *.so *.out - +**/build # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot diff --git a/bin/CMakeCache.txt b/bin/CMakeCache.txt deleted file mode 100644 index 29f1f2f..0000000 --- a/bin/CMakeCache.txt +++ /dev/null @@ -1,329 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /home/stone/source/cpp/qt/coderdbc-core/bin -# It was generated by CMake: /snap/cmake/775/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:STRING=/usr/bin/g++ - -//A wrapper around 'ar' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar-9 - -//A wrapper around 'ranlib' adding the appropriate '--plugin' option -// for the GCC compiler -CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib-9 - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler. -CMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=dbcscanner-lib - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=/usr/bin/readelf - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the linker during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Value Computed by CMake -dbcscanner-lib_BINARY_DIR:STATIC=/home/stone/source/cpp/qt/coderdbc-core/bin - -//Value Computed by CMake -dbcscanner-lib_SOURCE_DIR:STATIC=/home/stone/source/cpp/qt/coderdbc-core/src - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/home/stone/source/cpp/qt/coderdbc-core/bin -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=19 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=4 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/snap/cmake/775/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/snap/cmake/775/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/snap/cmake/775/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR -CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB -CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/snap/cmake/775/bin/cmake-gui -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/home/stone/source/cpp/qt/coderdbc-core/src -//Install .so files without execute permission. -CMAKE_INSTALL_SO_NO_EXE:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/snap/cmake/775/share/cmake-3.19 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake b/bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake deleted file mode 100644 index 193f52d..0000000 --- a/bin/CMakeFiles/3.19.4/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,89 +0,0 @@ -set(CMAKE_CXX_COMPILER "/usr/bin/g++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "GNU") -set(CMAKE_CXX_COMPILER_VERSION "9.3.0") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") - -set(CMAKE_CXX_PLATFORM_ID "Linux") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "") -set(CMAKE_CXX_SIMULATE_VERSION "") - - - - -set(CMAKE_AR "/usr/bin/ar") -set(CMAKE_CXX_COMPILER_AR "/usr/bin/gcc-ar-9") -set(CMAKE_RANLIB "/usr/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "/usr/bin/gcc-ranlib-9") -set(CMAKE_LINKER "/usr/bin/ld") -set(CMAKE_MT "") -set(CMAKE_COMPILER_IS_GNUCXX 1) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) -set(CMAKE_COMPILER_IS_MINGW ) -set(CMAKE_COMPILER_IS_CYGWIN ) -if(CMAKE_COMPILER_IS_CYGWIN) - set(CYGWIN 1) - set(UNIX 1) -endif() - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -if(CMAKE_COMPILER_IS_MINGW) - set(MINGW 1) -endif() -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "ELF") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/include/c++/9;/usr/include/x86_64-linux-gnu/c++/9;/usr/include/c++/9/backward;/usr/lib/gcc/x86_64-linux-gnu/9/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc_s;gcc;c;gcc_s;gcc") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/usr/lib/gcc/x86_64-linux-gnu/9;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "") diff --git a/bin/CMakeFiles/3.19.4/CMakeDetermineCompilerABI_CXX.bin b/bin/CMakeFiles/3.19.4/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index 89f78821c080a0bac7801e4d246023d487c5714b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16560 zcmeHOZ)_Y#6`%9j$)!!smoyM58;2toOPR26|D@ulzq#0S7pN?L(HjgU$aRG31AsnXO54Kg&z@!rgP z=iT)g${&dj>_~UNncuuWvu|ehW^ZRc6N~pW_EZJhx1t3j`}-*9$+%GcKLhUO zBjj(Xeh5+g87aJCMezqgLOfcOn#xY~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da$p{StF0L00rlG%$PwIjP4`C?2RAp zjK72SpZk&gFoJ|vY zX(DSSh5)Ui!ZFUJb8yP1AoN_`O6jAyvR)|W3#pQhtCkK&(9f*XHW?eUL(et_4)ZA4IExF>+^b&k)KmQ zL?*OhPY*!>pBY%6*PV>~{Kf5OImQ#9kIx`n=JhF~M$X*rCt6HF24l+lypCm@CPDV^ zzW%R3Jzf*n<4>AQg#0{6tn|fs#IM1}uCI|EBb#F#E;Byk(&zOvBg-wN|1Fn(gcKO@ z_uHP__P*`X=k+)vKQFTl_xSxD>2v&rMv{a$zwF8F|3^@XO=SJBrlc9~R>j)4+yBp? z#;!lEDN)9`nx@Kd|1nazu^z|qo4}z6>+}Bv)3lI^K%G6YKI1%8+Vw?*q}vp-A7X3% zxqK5cXp8;x`YS~G?1$y)a=0k`Kp;orHJ>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__FUJITSU) || defined(__FCC_VERSION) || defined(__fcc_version) -# define COMPILER_ID "Fujitsu" - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(__VISUALDSPVERSION__) || defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) -# define COMPILER_ID "ADSP" -#if defined(__VISUALDSPVERSION__) - /* __VISUALDSPVERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24) -# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(_CRAYC) || defined(__cray__) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number components. */ -#ifdef COMPILER_VERSION_MAJOR -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L -# if defined(__INTEL_CXX11_MODE__) -# if defined(__cpp_aggregate_nsdmi) -# define CXX_STD 201402L -# else -# define CXX_STD 201103L -# endif -# else -# define CXX_STD 199711L -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# define CXX_STD _MSVC_LANG -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_dialect_default = "INFO" ":" "dialect_default[" -#if CXX_STD > 201703L - "20" -#elif CXX_STD >= 201703L - "17" -#elif CXX_STD >= 201402L - "14" -#elif CXX_STD >= 201103L - "11" -#else - "98" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#ifdef COMPILER_VERSION_INTERNAL - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(_CRAYC) || defined(__cray__) - require += info_cray[argc]; -#endif - require += info_language_dialect_default[argc]; - (void)argv; - return require; -} diff --git a/bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out b/bin/CMakeFiles/3.19.4/CompilerIdCXX/a.out deleted file mode 100755 index c8684265455284359fc556a1ef0b98aa7a612508..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16720 zcmeHOZ)_Y#6`%9jiIXPhOX@TxY3glABq!9Dvy-?^T9Z55=j@?N(k6E6;=0S)ceYR5 zA9J@y?243t)1p%_L~11Z0i>u%2#KHqABu`pa1@#XBD6tO2?_`ci0Yz{x`i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^ z`VvxXd?~^^pUnrzWc$SI`L~~L62y)m&wm(Y>jQ5u{&5X1Di$GiLc^<+z z@380oXZlx=!Do7&4)XIU@Bek`bD8lEU|VOg=jZu_W*{N4o>^KfGyfI{aO`pY<>zKt z-;HU8`VYrHCbr{#{04BS!uI?gV}>5&LLjpywr5-bq19f5NIPgE0g;RKGjS6#=!@&; z=eZymay_h1r^7|z1p+x|J#4?dtZ8Q0-ikbStg4?NhbmpzcpYPxaC`Xvw*okByVd@i d_{RY0A%}CW*OcP3XJz}F?WV>mhk>Ig{sl?qig^G4 diff --git a/bin/CMakeFiles/CMakeDirectoryInformation.cmake b/bin/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index 2bbe5e6..0000000 --- a/bin/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/home/stone/source/cpp/qt/coderdbc-core/src") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/home/stone/source/cpp/qt/coderdbc-core/bin") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/bin/CMakeFiles/Makefile.cmake b/bin/CMakeFiles/Makefile.cmake deleted file mode 100644 index f398819..0000000 --- a/bin/CMakeFiles/Makefile.cmake +++ /dev/null @@ -1,96 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -# The generator used is: -set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") - -# The top level Makefile was generated from the following files: -set(CMAKE_MAKEFILE_DEPENDS - "CMakeCache.txt" - "CMakeFiles/3.19.4/CMakeCXXCompiler.cmake" - "CMakeFiles/3.19.4/CMakeSystem.cmake" - "/home/stone/source/cpp/qt/coderdbc-core/src/CMakeLists.txt" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCXXCompiler.cmake.in" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCXXCompilerABI.cpp" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCXXInformation.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCommonLanguageInclude.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeCompilerIdDetection.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCXXCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompileFeatures.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompilerABI.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineCompilerId.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeDetermineSystem.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeFindBinUtils.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeGenericSystem.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeInitializeConfigs.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeLanguageInformation.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeParseImplicitIncludeInfo.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeParseImplicitLinkInfo.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeSystem.cmake.in" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeSystemSpecificInformation.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeSystemSpecificInitialize.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeTestCXXCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeTestCompilerCommon.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/CMakeUnixFindMake.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/ADSP-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/ARMCC-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/ARMClang-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/AppleClang-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Borland-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Clang-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Clang-DetermineCompilerInternal.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Cray-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Embarcadero-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Fujitsu-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GHS-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU-CXX.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU-FindBinUtils.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/GNU.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/HP-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/IAR-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Intel-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/MSVC-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/NVIDIA-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/PGI-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/PathScale-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/SCO-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/TI-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/Watcom-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/XL-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/XLClang-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Internal/FeatureTesting.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux-Determine-CXX.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux-GNU-CXX.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux-GNU.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Platform/Linux.cmake" - "/snap/cmake/775/share/cmake-3.19/Modules/Platform/UnixPaths.cmake" - ) - -# The corresponding makefile is: -set(CMAKE_MAKEFILE_OUTPUTS - "Makefile" - "CMakeFiles/cmake.check_cache" - ) - -# Byproducts of CMake generate step: -set(CMAKE_MAKEFILE_PRODUCTS - "CMakeFiles/3.19.4/CMakeSystem.cmake" - "CMakeFiles/3.19.4/CMakeCXXCompiler.cmake" - "CMakeFiles/3.19.4/CMakeCXXCompiler.cmake" - "CMakeFiles/CMakeDirectoryInformation.cmake" - ) - -# Dependency information for all targets: -set(CMAKE_DEPEND_INFO_FILES - "CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake" - ) diff --git a/bin/CMakeFiles/Makefile2 b/bin/CMakeFiles/Makefile2 deleted file mode 100644 index f6cb518..0000000 --- a/bin/CMakeFiles/Makefile2 +++ /dev/null @@ -1,125 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Disable VCS-based implicit rules. -% : %,v - - -# Disable VCS-based implicit rules. -% : RCS/% - - -# Disable VCS-based implicit rules. -% : RCS/%,v - - -# Disable VCS-based implicit rules. -% : SCCS/s.% - - -# Disable VCS-based implicit rules. -% : s.% - - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /snap/cmake/775/bin/cmake - -# The command to remove a file. -RM = /snap/cmake/775/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/stone/source/cpp/qt/coderdbc-core/src - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/stone/source/cpp/qt/coderdbc-core/bin - -#============================================================================= -# Directory level rules for the build root directory - -# The main recursive "all" target. -all: CMakeFiles/dbcscanner-lib.dir/all - -.PHONY : all - -# The main recursive "preinstall" target. -preinstall: - -.PHONY : preinstall - -# The main recursive "clean" target. -clean: CMakeFiles/dbcscanner-lib.dir/clean - -.PHONY : clean - -#============================================================================= -# Target rules for target CMakeFiles/dbcscanner-lib.dir - -# All Build rule for target. -CMakeFiles/dbcscanner-lib.dir/all: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/depend - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=1,2,3,4,5,6,7,8,9,10 "Built target dbcscanner-lib" -.PHONY : CMakeFiles/dbcscanner-lib.dir/all - -# Build rule for subdir invocation for target. -CMakeFiles/dbcscanner-lib.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles 10 - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/dbcscanner-lib.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles 0 -.PHONY : CMakeFiles/dbcscanner-lib.dir/rule - -# Convenience name for target. -dbcscanner-lib: CMakeFiles/dbcscanner-lib.dir/rule - -.PHONY : dbcscanner-lib - -# clean rule for target. -CMakeFiles/dbcscanner-lib.dir/clean: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/clean -.PHONY : CMakeFiles/dbcscanner-lib.dir/clean - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/bin/CMakeFiles/TargetDirectories.txt b/bin/CMakeFiles/TargetDirectories.txt deleted file mode 100644 index 44260b2..0000000 --- a/bin/CMakeFiles/TargetDirectories.txt +++ /dev/null @@ -1,3 +0,0 @@ -/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/rebuild_cache.dir -/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir -/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/edit_cache.dir diff --git a/bin/CMakeFiles/cmake.check_cache b/bin/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd73..0000000 --- a/bin/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache b/bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache deleted file mode 100644 index cf281fc..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/CXX.includecache +++ /dev/null @@ -1,216 +0,0 @@ -#IncludeRegexLine: ^[ ]*[#%][ ]*(include|import)[ ]*[<"]([^">]+)([">]) - -#IncludeRegexScan: ^.*$ - -#IncludeRegexComplain: ^$ - -#IncludeRegexTransform: - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp -sys/types.h -- -sys/stat.h -- -iostream -- -fstream -- -cstdlib -- -stdarg.h -- -filesystem -- -algorithm -- -regex -- -helpers/formatter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h -c-main-generator.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h -stdint.h -- -c-sigprinter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h -filewriter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h -../types/message.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -../types/outfile.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h -fs-creator.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp -stdlib.h -- -c-sigprinter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h -helpers/formatter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h -../types/c-expr.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp -c-util-generator.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h -helpers/formatter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h -algorithm -- - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h -types/message.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/types/message.h -fs-creator.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h -filewriter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h -conditional-tree.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp -conditional-tree.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h -helpers/formatter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h -string -- - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp -iostream -- -fstream -- -filewriter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h -stdint.h -- -string -- -sstream -- - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp -sys/stat.h -- -filesystem -- -fs-creator.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h -helpers/formatter.h -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/helpers/formatter.h - -/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h -stdint.h -- -string -- -../types/outfile.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h - -/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp -formatter.h -/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -algorithm -- - -/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -stdint.h -- -stdlib.h -- -stdarg.h -- -string -- - -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp -dbclineparser.h -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h -regex -- -math.h -- -limits.h -- - -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h -stdint.h -- -../types/message.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h - -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp -dbcscanner.h -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h -algorithm -- -math.h -- - -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h -stdint.h -- -stdlib.h -- -iostream -- -../types/message.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -dbclineparser.h -/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h - -/home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -stdint.h -- -vector -- -string -- - -/home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h -stdlib.h -- -message.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -vector -- -string -- - -/home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h -stdint.h -- -string -- - -/home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -stdint.h -- -stdlib.h -- -string -- -vector -- -attributes.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -comment.h -/home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h - -/home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h -stdint.h -- -string -- - diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake b/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake deleted file mode 100644 index d614d98..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - "CXX" - ) -# The set of files for implicit dependencies of each language: -set(CMAKE_DEPENDS_CHECK_CXX - "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" - "/home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp" "/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" - ) -set(CMAKE_CXX_COMPILER_ID "GNU") - -# Preprocessor definitions for this target. -set(CMAKE_TARGET_DEFINITIONS_CXX - "DBCSCANNERLIB_LIBRARY" - "dbcscanner_lib_EXPORTS" - ) - -# The include file search paths: -set(CMAKE_CXX_TARGET_INCLUDE_PATH - "." - "/home/stone/source/cpp/qt/coderdbc-core/src" - ) - -# Targets to which this target links. -set(CMAKE_TARGET_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/build.make b/bin/CMakeFiles/dbcscanner-lib.dir/build.make deleted file mode 100644 index 271f580..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/build.make +++ /dev/null @@ -1,237 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Disable VCS-based implicit rules. -% : %,v - - -# Disable VCS-based implicit rules. -% : RCS/% - - -# Disable VCS-based implicit rules. -% : RCS/%,v - - -# Disable VCS-based implicit rules. -% : SCCS/s.% - - -# Disable VCS-based implicit rules. -% : s.% - - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /snap/cmake/775/bin/cmake - -# The command to remove a file. -RM = /snap/cmake/775/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/stone/source/cpp/qt/coderdbc-core/src - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/stone/source/cpp/qt/coderdbc-core/bin - -# Include any dependencies generated for this target. -include CMakeFiles/dbcscanner-lib.dir/depend.make - -# Include the progress variables for this target. -include CMakeFiles/dbcscanner-lib.dir/progress.make - -# Include the compile flags for this target's objects. -include CMakeFiles/dbcscanner-lib.dir/flags.make - -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp - -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i - -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s - -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp - -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i - -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s - -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp - -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i - -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s - -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp - -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i - -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s - -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp - -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i - -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s - -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp - -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp > CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i - -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp -o CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s - -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp - -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp > CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i - -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp -o CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s - -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp - -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp > CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i - -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp -o CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s - -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: CMakeFiles/dbcscanner-lib.dir/flags.make -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Building CXX object CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -o CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o -c /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp - -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp > CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i - -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s" - /usr/bin/g++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp -o CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s - -# Object files for target dbcscanner-lib -dbcscanner__lib_OBJECTS = \ -"CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" \ -"CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" - -# External object files for target dbcscanner-lib -dbcscanner__lib_EXTERNAL_OBJECTS = - -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/build.make -libdbcscanner-lib.so: CMakeFiles/dbcscanner-lib.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles --progress-num=$(CMAKE_PROGRESS_10) "Linking CXX shared library libdbcscanner-lib.so" - $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/dbcscanner-lib.dir/link.txt --verbose=$(VERBOSE) - -# Rule to build all files generated by this target. -CMakeFiles/dbcscanner-lib.dir/build: libdbcscanner-lib.so - -.PHONY : CMakeFiles/dbcscanner-lib.dir/build - -CMakeFiles/dbcscanner-lib.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake -.PHONY : CMakeFiles/dbcscanner-lib.dir/clean - -CMakeFiles/dbcscanner-lib.dir/depend: - cd /home/stone/source/cpp/qt/coderdbc-core/bin && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/stone/source/cpp/qt/coderdbc-core/src /home/stone/source/cpp/qt/coderdbc-core/src /home/stone/source/cpp/qt/coderdbc-core/bin /home/stone/source/cpp/qt/coderdbc-core/bin /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles/dbcscanner-lib.dir/DependInfo.cmake --color=$(COLOR) -.PHONY : CMakeFiles/dbcscanner-lib.dir/depend - diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake b/bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake deleted file mode 100644 index d3ed29b..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/cmake_clean.cmake +++ /dev/null @@ -1,18 +0,0 @@ -file(REMOVE_RECURSE - "CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o" - "CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o" - "libdbcscanner-lib.pdb" - "libdbcscanner-lib.so" -) - -# Per-language clean rules from dependency scanning. -foreach(lang CXX) - include(CMakeFiles/dbcscanner-lib.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/depend.internal b/bin/CMakeFiles/dbcscanner-lib.dir/depend.internal deleted file mode 100644 index 97fb6bc..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/depend.internal +++ /dev/null @@ -1,62 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o - /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h - /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp - /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h - /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/depend.make b/bin/CMakeFiles/dbcscanner-lib.dir/depend.make deleted file mode 100644 index d7680b8..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/depend.make +++ /dev/null @@ -1,62 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.cpp -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-main-generator.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h - -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.cpp -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-sigprinter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/c-expr.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h - -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.cpp -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/c-util-generator.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h -CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h - -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.cpp -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/conditional-tree.h -CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h - -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.cpp -CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/filewriter.h - -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.cpp -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/codegen/fs-creator.h -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h -CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/outfile.h - -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.cpp -CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/helpers/formatter.h - -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.cpp -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h -CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h - -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbclineparser.h -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.cpp -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/parser/dbcscanner.h -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/attributes.h -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/comment.h -CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o: /home/stone/source/cpp/qt/coderdbc-core/src/types/message.h - diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/flags.make b/bin/CMakeFiles/dbcscanner-lib.dir/flags.make deleted file mode 100644 index f0fb1b0..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/flags.make +++ /dev/null @@ -1,10 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -# compile CXX with /usr/bin/g++ -CXX_DEFINES = -DDBCSCANNERLIB_LIBRARY -Ddbcscanner_lib_EXPORTS - -CXX_INCLUDES = -I/home/stone/source/cpp/qt/coderdbc-core/bin -I/home/stone/source/cpp/qt/coderdbc-core/src - -CXX_FLAGS = -fPIC -std=gnu++17 - diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/link.txt b/bin/CMakeFiles/dbcscanner-lib.dir/link.txt deleted file mode 100644 index 1c404aa..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/link.txt +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/g++ -fPIC -shared -Wl,-soname,libdbcscanner-lib.so -o libdbcscanner-lib.so CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o diff --git a/bin/CMakeFiles/dbcscanner-lib.dir/progress.make b/bin/CMakeFiles/dbcscanner-lib.dir/progress.make deleted file mode 100644 index 6c587e2..0000000 --- a/bin/CMakeFiles/dbcscanner-lib.dir/progress.make +++ /dev/null @@ -1,11 +0,0 @@ -CMAKE_PROGRESS_1 = 1 -CMAKE_PROGRESS_2 = 2 -CMAKE_PROGRESS_3 = 3 -CMAKE_PROGRESS_4 = 4 -CMAKE_PROGRESS_5 = 5 -CMAKE_PROGRESS_6 = 6 -CMAKE_PROGRESS_7 = 7 -CMAKE_PROGRESS_8 = 8 -CMAKE_PROGRESS_9 = 9 -CMAKE_PROGRESS_10 = 10 - diff --git a/bin/CMakeFiles/progress.marks b/bin/CMakeFiles/progress.marks deleted file mode 100644 index f599e28..0000000 --- a/bin/CMakeFiles/progress.marks +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/bin/Makefile b/bin/Makefile deleted file mode 100644 index 8b6df52..0000000 --- a/bin/Makefile +++ /dev/null @@ -1,437 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 3.19 - -# Default target executed when no arguments are given to make. -default_target: all - -.PHONY : default_target - -# Allow only one "make -f Makefile2" at a time, but pass parallelism. -.NOTPARALLEL: - - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - - -# Disable VCS-based implicit rules. -% : %,v - - -# Disable VCS-based implicit rules. -% : RCS/% - - -# Disable VCS-based implicit rules. -% : RCS/%,v - - -# Disable VCS-based implicit rules. -% : SCCS/s.% - - -# Disable VCS-based implicit rules. -% : s.% - - -.SUFFIXES: .hpux_make_needs_suffix_list - - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: - -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /snap/cmake/775/bin/cmake - -# The command to remove a file. -RM = /snap/cmake/775/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/stone/source/cpp/qt/coderdbc-core/src - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/stone/source/cpp/qt/coderdbc-core/bin - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /snap/cmake/775/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache - -.PHONY : rebuild_cache/fast - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /snap/cmake/775/bin/cmake-gui -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache - -.PHONY : edit_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles /home/stone/source/cpp/qt/coderdbc-core/bin//CMakeFiles/progress.marks - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/stone/source/cpp/qt/coderdbc-core/bin/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean - -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named dbcscanner-lib - -# Build rule for target. -dbcscanner-lib: cmake_check_build_system - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 dbcscanner-lib -.PHONY : dbcscanner-lib - -# fast build rule for target. -dbcscanner-lib/fast: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/build -.PHONY : dbcscanner-lib/fast - -codegen/c-main-generator.o: codegen/c-main-generator.cpp.o - -.PHONY : codegen/c-main-generator.o - -# target to build an object file -codegen/c-main-generator.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.o -.PHONY : codegen/c-main-generator.cpp.o - -codegen/c-main-generator.i: codegen/c-main-generator.cpp.i - -.PHONY : codegen/c-main-generator.i - -# target to preprocess a source file -codegen/c-main-generator.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.i -.PHONY : codegen/c-main-generator.cpp.i - -codegen/c-main-generator.s: codegen/c-main-generator.cpp.s - -.PHONY : codegen/c-main-generator.s - -# target to generate assembly for a file -codegen/c-main-generator.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-main-generator.cpp.s -.PHONY : codegen/c-main-generator.cpp.s - -codegen/c-sigprinter.o: codegen/c-sigprinter.cpp.o - -.PHONY : codegen/c-sigprinter.o - -# target to build an object file -codegen/c-sigprinter.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.o -.PHONY : codegen/c-sigprinter.cpp.o - -codegen/c-sigprinter.i: codegen/c-sigprinter.cpp.i - -.PHONY : codegen/c-sigprinter.i - -# target to preprocess a source file -codegen/c-sigprinter.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.i -.PHONY : codegen/c-sigprinter.cpp.i - -codegen/c-sigprinter.s: codegen/c-sigprinter.cpp.s - -.PHONY : codegen/c-sigprinter.s - -# target to generate assembly for a file -codegen/c-sigprinter.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-sigprinter.cpp.s -.PHONY : codegen/c-sigprinter.cpp.s - -codegen/c-util-generator.o: codegen/c-util-generator.cpp.o - -.PHONY : codegen/c-util-generator.o - -# target to build an object file -codegen/c-util-generator.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.o -.PHONY : codegen/c-util-generator.cpp.o - -codegen/c-util-generator.i: codegen/c-util-generator.cpp.i - -.PHONY : codegen/c-util-generator.i - -# target to preprocess a source file -codegen/c-util-generator.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.i -.PHONY : codegen/c-util-generator.cpp.i - -codegen/c-util-generator.s: codegen/c-util-generator.cpp.s - -.PHONY : codegen/c-util-generator.s - -# target to generate assembly for a file -codegen/c-util-generator.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/c-util-generator.cpp.s -.PHONY : codegen/c-util-generator.cpp.s - -codegen/conditional-tree.o: codegen/conditional-tree.cpp.o - -.PHONY : codegen/conditional-tree.o - -# target to build an object file -codegen/conditional-tree.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.o -.PHONY : codegen/conditional-tree.cpp.o - -codegen/conditional-tree.i: codegen/conditional-tree.cpp.i - -.PHONY : codegen/conditional-tree.i - -# target to preprocess a source file -codegen/conditional-tree.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.i -.PHONY : codegen/conditional-tree.cpp.i - -codegen/conditional-tree.s: codegen/conditional-tree.cpp.s - -.PHONY : codegen/conditional-tree.s - -# target to generate assembly for a file -codegen/conditional-tree.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/conditional-tree.cpp.s -.PHONY : codegen/conditional-tree.cpp.s - -codegen/filewriter.o: codegen/filewriter.cpp.o - -.PHONY : codegen/filewriter.o - -# target to build an object file -codegen/filewriter.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.o -.PHONY : codegen/filewriter.cpp.o - -codegen/filewriter.i: codegen/filewriter.cpp.i - -.PHONY : codegen/filewriter.i - -# target to preprocess a source file -codegen/filewriter.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.i -.PHONY : codegen/filewriter.cpp.i - -codegen/filewriter.s: codegen/filewriter.cpp.s - -.PHONY : codegen/filewriter.s - -# target to generate assembly for a file -codegen/filewriter.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/filewriter.cpp.s -.PHONY : codegen/filewriter.cpp.s - -codegen/fs-creator.o: codegen/fs-creator.cpp.o - -.PHONY : codegen/fs-creator.o - -# target to build an object file -codegen/fs-creator.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.o -.PHONY : codegen/fs-creator.cpp.o - -codegen/fs-creator.i: codegen/fs-creator.cpp.i - -.PHONY : codegen/fs-creator.i - -# target to preprocess a source file -codegen/fs-creator.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.i -.PHONY : codegen/fs-creator.cpp.i - -codegen/fs-creator.s: codegen/fs-creator.cpp.s - -.PHONY : codegen/fs-creator.s - -# target to generate assembly for a file -codegen/fs-creator.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/codegen/fs-creator.cpp.s -.PHONY : codegen/fs-creator.cpp.s - -helpers/formatter.o: helpers/formatter.cpp.o - -.PHONY : helpers/formatter.o - -# target to build an object file -helpers/formatter.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.o -.PHONY : helpers/formatter.cpp.o - -helpers/formatter.i: helpers/formatter.cpp.i - -.PHONY : helpers/formatter.i - -# target to preprocess a source file -helpers/formatter.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.i -.PHONY : helpers/formatter.cpp.i - -helpers/formatter.s: helpers/formatter.cpp.s - -.PHONY : helpers/formatter.s - -# target to generate assembly for a file -helpers/formatter.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/helpers/formatter.cpp.s -.PHONY : helpers/formatter.cpp.s - -parser/dbclineparser.o: parser/dbclineparser.cpp.o - -.PHONY : parser/dbclineparser.o - -# target to build an object file -parser/dbclineparser.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.o -.PHONY : parser/dbclineparser.cpp.o - -parser/dbclineparser.i: parser/dbclineparser.cpp.i - -.PHONY : parser/dbclineparser.i - -# target to preprocess a source file -parser/dbclineparser.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.i -.PHONY : parser/dbclineparser.cpp.i - -parser/dbclineparser.s: parser/dbclineparser.cpp.s - -.PHONY : parser/dbclineparser.s - -# target to generate assembly for a file -parser/dbclineparser.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbclineparser.cpp.s -.PHONY : parser/dbclineparser.cpp.s - -parser/dbcscanner.o: parser/dbcscanner.cpp.o - -.PHONY : parser/dbcscanner.o - -# target to build an object file -parser/dbcscanner.cpp.o: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.o -.PHONY : parser/dbcscanner.cpp.o - -parser/dbcscanner.i: parser/dbcscanner.cpp.i - -.PHONY : parser/dbcscanner.i - -# target to preprocess a source file -parser/dbcscanner.cpp.i: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.i -.PHONY : parser/dbcscanner.cpp.i - -parser/dbcscanner.s: parser/dbcscanner.cpp.s - -.PHONY : parser/dbcscanner.s - -# target to generate assembly for a file -parser/dbcscanner.cpp.s: - $(MAKE) $(MAKESILENT) -f CMakeFiles/dbcscanner-lib.dir/build.make CMakeFiles/dbcscanner-lib.dir/parser/dbcscanner.cpp.s -.PHONY : parser/dbcscanner.cpp.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... edit_cache" - @echo "... rebuild_cache" - @echo "... dbcscanner-lib" - @echo "... codegen/c-main-generator.o" - @echo "... codegen/c-main-generator.i" - @echo "... codegen/c-main-generator.s" - @echo "... codegen/c-sigprinter.o" - @echo "... codegen/c-sigprinter.i" - @echo "... codegen/c-sigprinter.s" - @echo "... codegen/c-util-generator.o" - @echo "... codegen/c-util-generator.i" - @echo "... codegen/c-util-generator.s" - @echo "... codegen/conditional-tree.o" - @echo "... codegen/conditional-tree.i" - @echo "... codegen/conditional-tree.s" - @echo "... codegen/filewriter.o" - @echo "... codegen/filewriter.i" - @echo "... codegen/filewriter.s" - @echo "... codegen/fs-creator.o" - @echo "... codegen/fs-creator.i" - @echo "... codegen/fs-creator.s" - @echo "... helpers/formatter.o" - @echo "... helpers/formatter.i" - @echo "... helpers/formatter.s" - @echo "... parser/dbclineparser.o" - @echo "... parser/dbclineparser.i" - @echo "... parser/dbclineparser.s" - @echo "... parser/dbcscanner.o" - @echo "... parser/dbcscanner.i" - @echo "... parser/dbcscanner.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/bin/cmake_install.cmake b/bin/cmake_install.cmake deleted file mode 100644 index 0ab6a6b..0000000 --- a/bin/cmake_install.cmake +++ /dev/null @@ -1,54 +0,0 @@ -# Install script for directory: /home/stone/source/cpp/qt/coderdbc-core/src - -# Set the install prefix -if(NOT DEFINED CMAKE_INSTALL_PREFIX) - set(CMAKE_INSTALL_PREFIX "/usr/local") -endif() -string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") - -# Set the install configuration name. -if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) - if(BUILD_TYPE) - string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" - CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") - else() - set(CMAKE_INSTALL_CONFIG_NAME "") - endif() - message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") -endif() - -# Set the component getting installed. -if(NOT CMAKE_INSTALL_COMPONENT) - if(COMPONENT) - message(STATUS "Install component: \"${COMPONENT}\"") - set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") - else() - set(CMAKE_INSTALL_COMPONENT) - endif() -endif() - -# Install shared libraries without execute permission? -if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) - set(CMAKE_INSTALL_SO_NO_EXE "1") -endif() - -# Is this installation the result of a crosscompile? -if(NOT DEFINED CMAKE_CROSSCOMPILING) - set(CMAKE_CROSSCOMPILING "FALSE") -endif() - -# Set default install directory permissions. -if(NOT DEFINED CMAKE_OBJDUMP) - set(CMAKE_OBJDUMP "/usr/bin/objdump") -endif() - -if(CMAKE_INSTALL_COMPONENT) - set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt") -else() - set(CMAKE_INSTALL_MANIFEST "install_manifest.txt") -endif() - -string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT - "${CMAKE_INSTALL_MANIFEST_FILES}") -file(WRITE "/home/stone/source/cpp/qt/coderdbc-core/bin/${CMAKE_INSTALL_MANIFEST}" - "${CMAKE_INSTALL_MANIFEST_CONTENT}") From ab5ccece612f3d268319a83e742b580fad728162 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 18 Feb 2021 22:19:48 +0300 Subject: [PATCH 062/181] Fixed grammar errors. --- src/codegen/c-main-generator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index bbd83e9..807d876 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -266,7 +266,7 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); fwriter->AppendLine("/* To enable using messaged typedefs based on bit-fields"); fwriter->AppendLine(" uncomment define below. (Note(!): bit-feild was not tested"); - fwriter->AppendLine(" properly, so using is up to user). */",2 ); + fwriter->AppendLine(" properly, so using is up to user). */", 2 ); fwriter->AppendLine(StrPrint("// #define %s", fdesc->usebits_def.c_str()), 3); fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); fwriter->AppendLine("/* By default signature of pack function intakes a few simple typed params"); @@ -524,7 +524,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(StrPrint(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); // Put rolling monitor here - fwriter->AppendLine(StrPrint("#ifdef // %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); } if (sgs->msg.CsmSig != nullptr) @@ -580,9 +580,9 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->msg.RollSig != nullptr) { fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = (_m->%s + 1) & (0x%02XU)", sgs->msg.RollSig->Name.c_str(), + fwriter->AppendLine(StrPrint(" _m->%s = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); - fwriter->AppendLine(StrPrint("#ifdef // %s", fdesc->useroll_def.c_str()), 2); + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); } if (sgs->msg.CsmSig != nullptr) From b67759bdceac636c2c6f025752efe4ab82e812ee Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 28 Feb 2021 16:03:41 +0300 Subject: [PATCH 063/181] GetSystemTick func name. --- src/codegen/c-main-generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 807d876..44094b1 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -512,7 +512,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); fwriter->AppendLine(StrPrint(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); - fwriter->AppendLine(" _m->mon1.last_cycle = GetSysTick();"); + fwriter->AppendLine(" _m->mon1.last_cycle = GetSystemTick();"); fwriter->AppendLine(" _m->mon1.frame_cnt++;", 2); if (sgs->msg.RollSig != nullptr) From 1e837ce27539afdf3e0c448b09cdce3fbbdd3d93 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 4 Mar 2021 12:32:55 +0300 Subject: [PATCH 064/181] Fixed issue when DLC is less then actual Message layout takes. --- src/codegen/c-sigprinter.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index fc6f5e4..97af1d6 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -173,6 +173,12 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec // value for collecting expression (to_signal) std::string tosigexpr; + if (to_bytes.size() == 0) + { + // return empty line is bytes count somehow equals 0 + return "Error in DBC file !!!! Dlc of this message must be greater."; + } + uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); @@ -181,6 +187,14 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec int32_t bn = startb / 8; + if (to_bytes.size() < bn) + { + // DLC from message doesn't fit to signal layout + // make code uncomplilable + to_bytes[0] = "Error in DBC file !!!! Dlc of this message must be greater."; + return to_bytes[0]; + } + // set valid to_byte prefix int32_t bbc = (startb % 8) + 1; int32_t slen = sig->LengthBit; @@ -215,8 +229,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[bbc].c_str(), slen); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, - msk[bbc].c_str()); + snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, msk[bbc].c_str()); AppendToByteLine(to_bytes[bn], workbuff); while ((slen - 8) >= 0) @@ -227,6 +240,14 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec bn = ShiftByte(sig, bn); + if (to_bytes.size() < bn) + { + // DLC from message doesn't fit to signal layout + // make code uncomplilable + to_bytes[0] = "Error in DBC file !!!! Dlc of this message must be greater."; + return to_bytes[0]; + } + tosigexpr += " | "; if (slen == 0) From 43730ed8d9cb9028097b38504b847aee9ba666a4 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 4 Mar 2021 12:33:20 +0300 Subject: [PATCH 065/181] Changed comments in gen code. --- src/codegen/c-main-generator.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 44094b1..95f8c16 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -62,8 +62,8 @@ void CiMainGenerator::Gen_MainHeader() fwriter->AppendText( "// This file must define:\n" "// base monitor struct\n" - "// function signature for CRC calculation\n" - "// function signature for getting system tick value (100 us step)\n" + "// function signature for HASH calculation: (@GetFrameHash)\n" + "// function signature for getting system tick value: (@GetSystemTick)\n" "#include \"canmonitorutil.h\"\n" "\n" ); @@ -204,10 +204,8 @@ void CiMainGenerator::Gen_MainSource() fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); fwriter->AppendText( - "// This file must define:\n" - "// base monitor struct\n" - "// function signature for CRC calculation\n" - "// function signature for getting system tick value (100 us step)\n"); + "// Function prototypes to be called each time CAN frame is unpacked\n" + "// FMon function may detect RC, CRC or DLC violation \n"); fwriter->AppendLine(StrPrint("#include \"%s-fmon.h\"", fdesc->drvname.c_str()), 2); From b5a687b23e257b92a2e397cc3de780760d97fbe0 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 4 Mar 2021 13:08:31 +0300 Subject: [PATCH 066/181] Fixed integer x = ***_toS(x) issue. Added postfix *_ro to non simple signals. --- src/codegen/c-main-generator.cpp | 32 +++++++++++++++----------------- src/parser/dbclineparser.cpp | 9 +++++++++ src/types/message.h | 3 ++- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 95f8c16..421143a 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -456,19 +456,26 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendLine("", 2); - if (sig.IsDoubleSig) + if (!sig.IsSimpleSig) { // this code only required be d-signals (floating point values based) // it placed additional signals to struct for conversion // to/from physical values. For non-simple and non-double signal // there is no necessity to create addition fields // @sigfloat_t must be typedefed by user (e.g. double / float) + + // UPD: from this commit, all non-Simple signals has it's + // own 'shadow' (_phys) copies, the problem with intermediate type (not simpe and + // not double) is that the x = ***_toS(x) takes place in each Pack_* call + // the signals which are not changing from Pack_* to Pack_* will change its values (!) fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(StrPrint(" sigfloat_t %s_phys;", sig.Name.c_str())); + if (sig.IsDoubleSig) + fwriter->AppendLine(StrPrint(" sigfloat_t %s;", sig.NameFloat.c_str())); + else + fwriter->AppendLine(StrPrint(" %s %s;", PrintType((int)sig.Type).c_str(), sig.NameFloat.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); - } } @@ -484,23 +491,14 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(StrPrint(" _m->%s = %s;", sname, expr.c_str())); // print sigfloat conversion - if (sgs->msg.Signals[num].IsDoubleSig) + if (!sgs->msg.Signals[num].IsSimpleSig) { fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s_phys = (sigfloat_t)(%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, - sname)); + fwriter->AppendLine(StrPrint(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", + sgs->msg.Signals[num].NameFloat.c_str(), fdesc->DRVNAME.c_str(), sname, sname)); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } - else if (!sgs->msg.Signals[num].IsSimpleSig) - { - // print unpack conversion for non-simple and non-double signals - // for this case conversion fromS is performed to signal itself - // without (sigfloat_t) type casting - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = (%s_%s_fromS(_m->%s));", sname, fdesc->DRVNAME.c_str(), sname, sname)); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); - } else if (num + 1 == sgs->to_signals.size()) { // last signal without phys part, put \n manually @@ -604,9 +602,9 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->msg.Signals[n].IsDoubleSig) { // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s_phys);", + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s);", sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str())); } else { diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 63fa321..32d6a2f 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -231,6 +231,15 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& { sig->IsSimpleSig = true; } + + if (!sig->IsSimpleSig) + { + // For this case the name of signal must be marked specially + // to pay attention that if SIGFLOAT is enabled, this signal + // must behave as ReadOnly (_ro) + sig->NameFloat = sig->Name + "_phys"; + sig->Name += "_ro"; + } } if (tailpart.size() == 3) diff --git a/src/types/message.h b/src/types/message.h index 9b25cd7..947c01d 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -37,7 +37,8 @@ typedef struct { // Signal name std::string Name; - + // Signal float name + std::string NameFloat; // Unit std::string Unit; From d15afe698a0603ac2c9b761328b353620f29e614 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 4 Mar 2021 13:08:48 +0300 Subject: [PATCH 067/181] Updated comment text in drv_conf.h file. --- src/codegen/c-main-generator.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 421143a..b135797 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -272,10 +272,17 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine(" uncomment define below. */", 2); fwriter->AppendLine(StrPrint("// #define %s", fdesc->usesruct_def.c_str()), 3); fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); - fwriter->AppendLine("/* To enable phys values handling uncomment define below. It will:"); + fwriter->AppendLine("/* All signal's names which have factor != 1 and offset != 0 will be added"); + fwriter->AppendLine(" *_ro postfix, to pay attention in the clinet code, that these signals will be"); + fwriter->AppendLine(" overwritten by *_phys value if definition below uncommented (!)"); + fwriter->AppendLine(""); + fwriter->AppendLine(" To enable phys values handling uncomment define below. It will:"); fwriter->AppendLine(" - adds additional members to message struct with name extension *_phys"); - fwriter->AppendLine(" which have user defined type @sigfloat_t (must be defined by user in"); + fwriter->AppendLine(" which have either:"); + fwriter->AppendLine(" 1. user defined type @sigfloat_t (must be defined by user in"); fwriter->AppendLine(" dbccodeconf.h)"); + fwriter->AppendLine(" 2. the same type as signal has (for the case when niether factor nor offset"); + fwriter->AppendLine(" are not real based) "); fwriter->AppendLine(" - in unpack function these signal will be loaded by the converted "); fwriter->AppendLine(" value (with factor and offset)"); fwriter->AppendLine(" - in pack function the CAN frame signal values will be loaded from"); @@ -284,7 +291,7 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); fwriter->AppendLine("/* To enable monitor functions uncomment define below."); - fwriter->AppendLine("/* (Note(!): the \"canmonitorutil.h\" must be accessed in include path):"); + fwriter->AppendLine(" (Note(!) that the \"canmonitorutil.h\" must be accessed in include path):"); fwriter->AppendLine(" It will:"); fwriter->AppendLine(" - bring to message struct special monitor member @mon1 "); fwriter->AppendLine(" - calling function FMon_*** function inside unpack function "); From 2ccb121d67659536c22cbcc5a56c179a743b55a1 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 6 Mar 2021 19:10:51 +0300 Subject: [PATCH 068/181] Fixed macros for *_phys <-> *_ro signal conversion. --- src/codegen/c-main-generator.cpp | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index b135797..1087707 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -501,8 +501,19 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) if (!sgs->msg.Signals[num].IsSimpleSig) { fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", - sgs->msg.Signals[num].NameFloat.c_str(), fdesc->DRVNAME.c_str(), sname, sname)); + + if (sgs->msg.Signals[num].IsDoubleSig) + { + // for double signals (sigfloat_t) type cast + fwriter->AppendLine(StrPrint(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", + sgs->msg.Signals[num].NameFloat.c_str(), fdesc->DRVNAME.c_str(), sname, sname)); + } + else + { + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s);", + sgs->msg.Signals[num].NameFloat.c_str(), fdesc->DRVNAME.c_str(), sname, sname)); + } + fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } @@ -606,21 +617,10 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp { if (sgs->msg.Signals[n].IsSimpleSig == false) { - if (sgs->msg.Signals[n].IsDoubleSig) - { - // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str())); - } - else - { - // print toS from original named signal to itself (because this signal - // has enough space for scaling by factor and proper sign - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].Name.c_str())); - } + // print toS from *_phys to original named sigint (integer duplicate of signal) + fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str())); } } From b714eb0a2ba33d69f382ae803796f0cf29c7064d Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 14 Mar 2021 22:50:22 +0300 Subject: [PATCH 069/181] Fixed issue with big comment and localization. --- src/helpers/formatter.cpp | 28 ++++++++++++++++++++++++++++ src/helpers/formatter.h | 2 ++ src/parser/dbclineparser.cpp | 2 ++ src/parser/dbcscanner.cpp | 10 +++------- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index 770acf8..7c54ded 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -57,3 +57,31 @@ std::string str_tolower(std::string s) }); return s; } + +std::string str_trim(std::string s) +{ + size_t passed = 0; + + if (s.empty()) + return s + '\n'; + + passed = 0; + + while (passed < s.size()) + { + if (s[s.size() - passed - 1] > ' ') + { + break; + } + + ++passed; + } + + if (passed != 0) + { + // remove tail with non-printable values + s.erase(s.size() - passed, passed); + } + + return s; +} diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index d5be580..5c29c0d 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -12,3 +12,5 @@ std::string PrintType(uint8_t tid); std::string str_toupper(std::string s); std::string str_tolower(std::string s); + +std::string str_trim(std::string s); diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 32d6a2f..02d9d51 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -206,6 +206,8 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& //value into the signal's physical value and vice versa: // physical_value = raw_value * factor + offset // raw_value = (physical_value - offset) / factor + std::setlocale(LC_ALL, "en_US.UTF-8"); + sig->Factor = atof(valpart[3].c_str()); sig->Offset = atof(valpart[4].c_str()); diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 1a44dea..1bf17ac 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -1,6 +1,7 @@ #include "dbcscanner.h" #include #include +#include "../helpers/formatter.h" #define MAX_LINE 4096 @@ -67,7 +68,7 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) { readstrm.getline(line, MAX_LINE); - sline = line; + sline = str_trim(line); // New message line has been found if (lparser.IsMessageLine(sline)) @@ -121,12 +122,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { readstrm.getline(line, MAX_LINE); - sline = line; - - if (sline.size() > 0 && sline.back() < ' ') - { - sline.erase(sline.size() - 1, 1); - } + sline = str_trim(line); if (lparser.ParseCommentLine(&cmmnt, sline)) { From abfcc41eeb6ca76b5e0cbb8ab94a7095d31ba0d4 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 27 Mar 2021 14:17:25 +0300 Subject: [PATCH 070/181] True fix issue with big comment section. --- src/parser/dbclineparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 02d9d51..8bec13c 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -207,7 +207,7 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // physical_value = raw_value * factor + offset // raw_value = (physical_value - offset) / factor std::setlocale(LC_ALL, "en_US.UTF-8"); - + sig->Factor = atof(valpart[3].c_str()); sig->Offset = atof(valpart[4].c_str()); @@ -526,6 +526,8 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) // value table params were parse successfully ret = true; } + + valueline.clear(); } } From 1ff121bb1f5cb3ae60ec5e7e6c3a07876c116408 Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 30 Mar 2021 21:38:02 +0300 Subject: [PATCH 071/181] Fixed GetFrameHash call syntax. --- src/codegen/c-main-generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 1087707..6b72ac7 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -546,7 +546,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // Put checksum check function call here fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); fwriter->AppendLine( - StrPrint(" _m->mon1.csm_error = ((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s))", + StrPrint(" _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s));", sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); @@ -642,8 +642,8 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp // code for getting checksum value and putting it in array fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d));", - sgs->msg.CsmSig->Name.c_str(), sgs->msg.Name.c_str(), + fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameHash(%s, %s_DLC, %s_CANID, %s, %d));", + sgs->msg.CsmSig->Name.c_str(), arrtxt.c_str(), sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); fwriter->AppendLine(StrPrint(" %s[%d] = %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); From 12c735fb2238d72547de3bb772564802baeef155 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 1 Apr 2021 20:13:05 +0300 Subject: [PATCH 072/181] Fixed value table first pair skipping. --- src/parser/dbclineparser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 8bec13c..2b0189f 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -511,13 +511,13 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) // last item will be ';' and number of items will be even auto items = resplit(valueline, kRegValTable, 0); - if ((items.size() >= 5) && (items.back() == ";") && (items.size() % 2 == 0)) + if ((items.size() >= 3) && (items.back() == ";") && (items.size() % 2 == 0)) { comm->MsgId = (clear_msgid(atoi(items[1].c_str()))); comm->SigName = items[2]; comm->Text = ""; - for (size_t valpair = 5; valpair < (items.size() - 1); valpair += 2) + for (size_t valpair = 3; valpair < (items.size() - 1); valpair += 2) { comm->Text += " " + items[valpair + 0] + " : "; comm->Text += items[valpair + 1] + '\n'; From e06f777de2bb4fe2252a8bfeb25778456eebe21e Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 4 Apr 2021 13:40:01 +0300 Subject: [PATCH 073/181] Added start info as user defined text. --- src/codegen/c-main-generator.cpp | 33 +++++++++++++++++++++++++++++++- src/codegen/c-util-generator.cpp | 11 +++++++++++ src/codegen/fs-creator.cpp | 10 +++++++++- src/codegen/fs-creator.h | 4 +++- 4 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 6b72ac7..f8f17b9 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -50,6 +50,13 @@ void CiMainGenerator::Generate(std::vector& msgs, const Fs void CiMainGenerator::Gen_MainHeader() { + // write comment start text + if (fdesc->start_info.size() > 0) + { + // replace all '\n' on "\n //" for c code comment text + fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); @@ -196,6 +203,12 @@ void CiMainGenerator::Gen_MainHeader() void CiMainGenerator::Gen_MainSource() { + if (fdesc->start_info.size() > 0) + { + // replace all '\n' on "\n //" for c code comment text + fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + // include main header file fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->core_h.fname.c_str()), 3); @@ -257,6 +270,12 @@ void CiMainGenerator::Gen_MainSource() void CiMainGenerator::Gen_ConfigHeader() { + if (fdesc->start_info.size() > 0) + { + // replace all '\n' on "\n //" for c code comment text + fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("/* include common dbccode configurations */"); @@ -331,6 +350,12 @@ void CiMainGenerator::Gen_ConfigHeader() void CiMainGenerator::Gen_FMonHeader() { + if (fdesc->start_info.size() > 0) + { + // replace all '\n' on "\n //" for c code comment text + fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + fwriter->AppendLine("#pragma once", 2); fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); @@ -363,6 +388,12 @@ separated .c file. If it won't be done the linkage error will happen\n*/", 2); void CiMainGenerator::Gen_FMonSource() { + if (fdesc->start_info.size() > 0) + { + // replace all '\n' on "\n //" for c code comment text + fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->fmon_h.fname.c_str()), 2); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function @@ -376,7 +407,7 @@ next generation will completely clear all manually added code (!)\n\ for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n}\n", + fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n (void)_mon;\n}\n", msg->Name.c_str(), fdesc->drvname.c_str())); } diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 1947bda..ecfd091 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -1,6 +1,7 @@ #include "c-util-generator.h" #include "helpers/formatter.h" #include +#include static const std::string openguard = "#ifdef __cplusplus\n\ extern \"C\" {\n\ @@ -96,6 +97,11 @@ void CiUtilGenerator::PrintHeader() { tof->Flush(); + if (fdesc->start_info.size() > 0) + { + tof->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + tof->AppendLine("#pragma once", 2); tof->AppendLine(openguard.c_str(), 2); @@ -171,6 +177,11 @@ void CiUtilGenerator::PrintHeader() void CiUtilGenerator::PrintSource() { + if (fdesc->start_info.size() > 0) + { + tof->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + } + tof->AppendLine(StrPrint("#include \"%s\"", fdesc->util_h.fname.c_str()), 2); // optional RX and TX struct allocations diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index ffab06e..628f6d3 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -11,7 +11,7 @@ FsCreator::FsCreator() { } -bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool) +bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool, std::string& strinfo) { bool ret = false; @@ -96,6 +96,14 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.DRVNAME.c_str()); FS.usecsm_def = _tmpb; + + // load start info to fdescriptor + FS.start_info.clear(); + + if (strinfo.size() > 0) + { + FS.start_info = strinfo; + } } return ret; diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 68a1ffe..a614205 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -28,6 +28,8 @@ typedef struct std::string usesigfloat_def; std::string useroll_def; std::string usecsm_def; + // inforamtion to be placed at the start of each source file + std::string start_info; } FsDescriptor_t; @@ -40,7 +42,7 @@ class FsCreator { public: FsCreator(); - bool PrepareDirectory(std::string drvname, std::string basepath, bool rw); + bool PrepareDirectory(std::string drvname, std::string basepath, bool rw, std::string& info); FsDescriptor_t FS; From 776a05a9465f84451c4657e5b614831d4748cbf0 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 15 May 2021 12:59:49 +0300 Subject: [PATCH 074/181] Added DBC version info parsing. --- docs/RELEASES.md | 14 +++++++++++++ src/codegen/c-main-generator.cpp | 13 ++++++++++-- src/codegen/c-main-generator.h | 4 +++- src/codegen/c-sigprinter.cpp | 2 +- src/codegen/c-util-generator.cpp | 14 ++++++++++--- src/codegen/c-util-generator.h | 3 ++- src/codegen/fs-creator.cpp | 6 ++++++ src/codegen/fs-creator.h | 5 +++++ src/codegen/version.h | 6 ++++++ src/parser/dbcscanner.cpp | 34 +++++++++++++++++++++++++++----- src/parser/dbcscanner.h | 5 ++--- src/types/message.h | 11 +++++++++++ 12 files changed, 101 insertions(+), 16 deletions(-) create mode 100644 docs/RELEASES.md create mode 100644 src/codegen/version.h diff --git a/docs/RELEASES.md b/docs/RELEASES.md new file mode 100644 index 0000000..8fd22ba --- /dev/null +++ b/docs/RELEASES.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to this project will be documented in this file. + +## v1.0 - 2021-05-15 +### Added +- Added DBC file version ("VERSION "x.x"") tag parsing +- Added dbc version info in: fmon, main and util drivers +- Added codegen lib version file + +### Changed +- Generate interface takes DbcMessageList instance which has version info + +### Fixed +- Fixed some warnings diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index f8f17b9..d74bee7 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -17,10 +17,11 @@ CiMainGenerator::CiMainGenerator() fwriter = new FileWriter; } -void CiMainGenerator::Generate(std::vector& msgs, const FsDescriptor_t& fsd) +void CiMainGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd) { + p_dlist = &dlist; // Load income messages to sig printer - sigprt->LoadMessages(msgs); + sigprt->LoadMessages(dlist.msgs); // save pointer to output file descriptor struct to // enable using this information inside class member functions @@ -61,6 +62,10 @@ void CiMainGenerator::Gen_MainHeader() fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); fwriter->AppendLine("#include ", 2); + fwriter->AppendLine("// DBC file version"); + fwriter->AppendLine(StrPrint("#define %s (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); + fwriter->AppendLine(StrPrint("#define %s (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); + fwriter->AppendLine("// include current dbc-driver compilation config"); fwriter->AppendLine(StrPrint("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); @@ -360,6 +365,10 @@ void CiMainGenerator::Gen_FMonHeader() fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); + fwriter->AppendLine("// DBC file version"); + fwriter->AppendLine(StrPrint("#define %s_FMON (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); + fwriter->AppendLine(StrPrint("#define %s_FMON (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); + fwriter->AppendLine(StrPrint("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); // put diagmonitor ifdef selection for including @drv-fmon header diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 76b7a3d..58a974a 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -11,7 +11,7 @@ class CiMainGenerator { public: CiMainGenerator(); - void Generate(std::vector& msgs, const FsDescriptor_t& fsd); + void Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd); private: @@ -36,4 +36,6 @@ class CiMainGenerator { FileWriter* fwriter; const FsDescriptor_t* fdesc; + + const DbcMessageList_t* p_dlist; }; diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 97af1d6..2e1e7df 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -185,7 +185,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec if (startb > 63) startb = 63; - int32_t bn = startb / 8; + uint32_t bn = (startb / 8); if (to_bytes.size() < bn) { diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index ecfd091..ccedc5e 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -27,16 +27,18 @@ void CiUtilGenerator::Clear() } -void CiUtilGenerator::Generate(std::vector& msgs, const FsDescriptor_t& fsd, +void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd, const MsgsClassification& groups, const std::string& drvname) { Clear(); + p_dlist = &dlist; + code_drvname = drvname; file_drvname = str_tolower(drvname); // 1 step is to prepare vectors of message's groups - for (auto m : msgs) + for (auto m : dlist.msgs) { auto v = std::find_if(groups.Both.begin(), groups.Both.end(), [&](const uint32_t& msgid) { @@ -108,9 +110,16 @@ void CiUtilGenerator::PrintHeader() // include common dbc code config header tof->AppendLine("#include \"dbccodeconf.h\"", 2); + // include c-main driver header tof->AppendLine(StrPrint("#include \"%s.h\"", file_drvname.c_str()), 2); + // put version info macros + tof->AppendLine("// This version definition comes from main driver version and"); + tof->AppendLine("// can be compared in user code space for strict compatibility test"); + tof->AppendLine(StrPrint("#define %s (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); + tof->AppendLine(StrPrint("#define %s (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); + if (rx.size() == 0) { tof->AppendLine("// There is no any RX mapped massage.", 2); @@ -238,7 +247,6 @@ ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vector& msgs, const FsDescriptor_t& fsd, + void Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd, const MsgsClassification& groups, const std::string& drvname); private: @@ -43,6 +43,7 @@ class CiUtilGenerator { const FsDescriptor_t* fdesc; ConditionalTree* condtree; + const DbcMessageList_t* p_dlist; bool treestarted; }; diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 628f6d3..46a62f4 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -97,6 +97,12 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.DRVNAME.c_str()); FS.usecsm_def = _tmpb; + snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.DRVNAME.c_str()); + FS.verhigh_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.DRVNAME.c_str()); + FS.verlow_def = _tmpb; + // load start info to fdescriptor FS.start_info.clear(); diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index a614205..b5ded9e 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -28,6 +28,11 @@ typedef struct std::string usesigfloat_def; std::string useroll_def; std::string usecsm_def; + + // for dbc version info + std::string verhigh_def; + std::string verlow_def; + // inforamtion to be placed at the start of each source file std::string start_info; diff --git a/src/codegen/version.h b/src/codegen/version.h new file mode 100644 index 0000000..75f7ccd --- /dev/null +++ b/src/codegen/version.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +#define CODEGEN_LIB_VERSION_MAJ (1) +#define CODEGEN_LIB_VERSION_MIN (0) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 1bf17ac..1abaec4 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -1,4 +1,5 @@ #include "dbcscanner.h" +#include #include #include #include "../helpers/formatter.h" @@ -36,7 +37,8 @@ DbcScanner::~DbcScanner() int32_t DbcScanner::TrimDbcText(istream& readstrm) { - msgs.clear(); + dblist.msgs.clear(); + dblist.ver.hi = dblist.ver.low = 0; readstrm.clear(); readstrm.seekg(0); @@ -70,6 +72,8 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) sline = str_trim(line); + FindVersion(sline); + // New message line has been found if (lparser.IsMessageLine(sline)) { @@ -127,7 +131,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) if (lparser.ParseCommentLine(&cmmnt, sline)) { // update message comment field - auto msg = find_message(msgs, cmmnt.MsgId); + auto msg = find_message(dblist.msgs, cmmnt.MsgId); if (msg != nullptr) { @@ -194,7 +198,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) if (lparser.ParseValTableLine(&cmmnt, sline)) { // update message comment field - auto msg = find_message(msgs, cmmnt.MsgId); + auto msg = find_message(dblist.msgs, cmmnt.MsgId); if (msg != nullptr) { @@ -220,7 +224,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) if (lparser.ParseAttributeLine(&attr, sline)) { - auto msg = find_message(msgs, attr.MsgId); + auto msg = find_message(dblist.msgs, attr.MsgId); if (msg != nullptr) { @@ -264,7 +268,7 @@ void DbcScanner::AddMessage(MessageDescriptor_t* message) } // save pointer on message - msgs.push_back(message); + dblist.msgs.push_back(message); } } @@ -287,3 +291,23 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->CsmOp = 0; message->CsmToByteExpr = ""; } + + +void DbcScanner::FindVersion(const std::string& instr) +{ + // try to find version string which looks like: VERSION "x.x" + uint32_t h = 0, l = 0; + char marker[8]; + + if (instr[0] != 'V' && instr[1] != 'E') + return; + + int32_t ret = std::sscanf(instr.c_str(), "%8s \"%u.%u\"", marker, &h, &l); + + if ((ret == 3) && (std::strcmp(marker, "VERSION") == 0)) + { + // versions have been found, save numeric values + dblist.ver.hi = h; + dblist.ver.low = l; + } +} diff --git a/src/parser/dbcscanner.h b/src/parser/dbcscanner.h index 6276282..0aefda1 100644 --- a/src/parser/dbcscanner.h +++ b/src/parser/dbcscanner.h @@ -13,7 +13,7 @@ class DbcScanner { DbcScanner(); ~DbcScanner(); - std::vector msgs; + DbcMessageList_t dblist; // Trim makes dbc source data analyze and returns count of // found CAN messages. @@ -23,10 +23,9 @@ class DbcScanner { void ParseMessageInfo(istream& instrm); void ParseOtherInfo(istream& instrm); - void AddMessage(MessageDescriptor_t* message); - void SetDefualtMessage(MessageDescriptor_t* message); + void FindVersion(const std::string& instr); private: diff --git a/src/types/message.h b/src/types/message.h index 947c01d..2a1474d 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -152,3 +152,14 @@ typedef struct } MsgsClassification; +typedef struct +{ + uint32_t hi; + uint32_t low; +} DbcFileVersion_t; + +typedef struct +{ + std::vector msgs; + DbcFileVersion_t ver; +} DbcMessageList_t; From 8456d4c243f25234426e1a5dc04866ac38ae15e8 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 10 Jul 2021 15:20:45 +0300 Subject: [PATCH 075/181] Fixed windows related issues. --- src/parser/dbclineparser.cpp | 1 + src/parser/dbcscanner.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 2b0189f..f1db014 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -1,4 +1,5 @@ #include "dbclineparser.h" +#include #include #include #include diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 1abaec4..953607c 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -297,7 +297,7 @@ void DbcScanner::FindVersion(const std::string& instr) { // try to find version string which looks like: VERSION "x.x" uint32_t h = 0, l = 0; - char marker[8]; + char marker[9]; if (instr[0] != 'V' && instr[1] != 'E') return; From 1d168d9e2621475b2a8a4d55bcd31c6ca6502d02 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 10 Jul 2021 15:21:30 +0300 Subject: [PATCH 076/181] Added option for rewriting source output files. --- src/codegen/fs-creator.cpp | 49 +++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 46a62f4..09bb498 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -11,7 +11,7 @@ FsCreator::FsCreator() { } -bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool, std::string& strinfo) +bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool rw, std::string& strinfo) { bool ret = false; @@ -20,30 +20,47 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool std::string work_dir_path; - for (int32_t dirnum = 0; dirnum < 1000; dirnum++) + if (rw) { - snprintf(_tmpb, kTmpLen, "%03d", dirnum); - work_dir_path = basepath + "/" + _tmpb; + work_dir_path = basepath; + ret = true; + // for this case check only if directory exists if (stat(work_dir_path.c_str(), &info) != 0) { - if (std::filesystem::create_directory(work_dir_path)) + if (std::filesystem::create_directory(work_dir_path) != 0) { - ret = true; - break; + ret = false; } } - else if (info.st_mode & S_IFDIR) - { - // directory exists, try next num - continue; - } - else + } + else + { + for (int32_t dirnum = 0; dirnum < 1000; dirnum++) { - if (std::filesystem::create_directory(work_dir_path) != 0) + snprintf(_tmpb, kTmpLen, "%03d", dirnum); + work_dir_path = basepath + "/" + _tmpb; + + if (stat(work_dir_path.c_str(), &info) != 0) { - ret = false; - break; + if (std::filesystem::create_directory(work_dir_path)) + { + ret = true; + break; + } + } + else if (info.st_mode & S_IFDIR) + { + // directory exists, try next num + continue; + } + else + { + if (std::filesystem::create_directory(work_dir_path) != 0) + { + ret = false; + break; + } } } } From eca35e01304bdd5cf309164b1a119312efcbac96 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 10 Jul 2021 15:22:25 +0300 Subject: [PATCH 077/181] Project became executable (CLI). --- src/CMakeLists.txt | 8 ++-- src/maincli.cpp | 98 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 src/maincli.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6e92d02..358eaa4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(dbcscanner-lib LANGUAGES CXX) +project(dbccoder-cli LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOUIC ON) @@ -9,7 +9,7 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_library(dbcscanner-lib SHARED +add_executable(dbccoder ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-main-generator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-util-generator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/conditional-tree.cpp @@ -19,7 +19,5 @@ add_library(dbcscanner-lib SHARED ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbclineparser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbcscanner.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/maincli.cpp ) - - -target_compile_definitions(dbcscanner-lib PRIVATE DBCSCANNERLIB_LIBRARY) diff --git a/src/maincli.cpp b/src/maincli.cpp new file mode 100644 index 0000000..b116fd3 --- /dev/null +++ b/src/maincli.cpp @@ -0,0 +1,98 @@ + +#include +#include +#include +#include "parser/dbcscanner.h" +#include "codegen/c-main-generator.h" +#include "codegen/c-util-generator.h" +#include "codegen/fs-creator.h" + +#define GEN_UTIL_CODE + +DbcScanner* scanner; +CiMainGenerator* cigen; +CiUtilGenerator* ciugen; +FsCreator* fscreator; + +std::string source_files_out_path; +std::string dbc_file_path; +std::string dbc_driver_name; + +int main(int argc, char* argv[]) +{ + scanner = new DbcScanner; + cigen = new CiMainGenerator; + ciugen = new CiUtilGenerator; + fscreator = new FsCreator; + + bool numberLines = false; // Default is no line numbers. + + if (argc == 4) + numberLines = true; + + if (numberLines) + { + std::ifstream reader; + // copy dbc file name to string variable + dbc_file_path = argv[1]; + source_files_out_path = argv[2]; + dbc_driver_name = argv[3]; + + std::cout << "dbc file : " << argv[1] << std::endl; + std::cout << "gen path : " << argv[2] << std::endl; + std::cout << "drv name : " << argv[3] << std::endl; + + if (std::filesystem::exists(dbc_file_path) == false) + { + std::cout << "DBC file is not exists!" << std::endl; + return -1; + } + + reader.open(dbc_file_path); + + std::istream& s = reader; + + scanner->TrimDbcText(s); + + std::string info("this is test"); + + auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), true, info); + + if (ret) + { + cigen->Generate(scanner->dblist, fscreator->FS); + } + else + { + std::cout << "One or both are invalid\n"; + } + +#if defined (GEN_UTIL_CODE) + + + // test utility generation + + ret = fscreator->PrepareDirectory(dbc_driver_name.c_str() , (source_files_out_path).c_str(), true, info); + + MsgsClassification groups; + + for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + { + groups.Rx.push_back(scanner->dblist.msgs[i]->MsgID); + } + + if (ret) + { + ciugen->Generate(scanner->dblist, fscreator->FS, groups, dbc_driver_name); + } + +#endif + + } + else + { + std::cout << "Argument list is bad." << std::endl; + } + + std::cout << "Finished... Press any key." << std::endl; +} From 359da554595212aad4b8c9ca883e9f9c5317fdbe Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 10 Jul 2021 15:41:38 +0300 Subject: [PATCH 078/181] Added help message. --- src/maincli.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index b116fd3..3873b3c 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -9,6 +9,15 @@ #define GEN_UTIL_CODE +const char* helptext = + "welcome to dbccoder v1.1.\n\n" + "author: Andrey Astakhov (https://github.com/astand)\n\n" + "to use utility you need to provide 3 arguments:\n\n" + "1. dbc file path\n" + "2. directory for generated source codegen\n" + "3. prefix (driver name) which will be used in driver elements naming\n\n" + "Example: ./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb\n\n"; + DbcScanner* scanner; CiMainGenerator* cigen; CiUtilGenerator* ciugen; @@ -25,12 +34,7 @@ int main(int argc, char* argv[]) ciugen = new CiUtilGenerator; fscreator = new FsCreator; - bool numberLines = false; // Default is no line numbers. - if (argc == 4) - numberLines = true; - - if (numberLines) { std::ifstream reader; // copy dbc file name to string variable @@ -69,10 +73,7 @@ int main(int argc, char* argv[]) #if defined (GEN_UTIL_CODE) - - // test utility generation - - ret = fscreator->PrepareDirectory(dbc_driver_name.c_str() , (source_files_out_path).c_str(), true, info); + ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), (source_files_out_path).c_str(), true, info); MsgsClassification groups; @@ -91,8 +92,6 @@ int main(int argc, char* argv[]) } else { - std::cout << "Argument list is bad." << std::endl; + std::cout << helptext; } - - std::cout << "Finished... Press any key." << std::endl; } From 84601a99676f947f842ba0968a8ec0ea0d36f2d1 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 10 Jul 2021 17:05:18 +0300 Subject: [PATCH 079/181] Removed useless files and settings. --- DbcScanner.vcxproj | 186 ------------------------------------- DbcScanner.vcxproj.filters | 84 ----------------- src/CMakeLists.txt | 3 - 3 files changed, 273 deletions(-) delete mode 100644 DbcScanner.vcxproj delete mode 100644 DbcScanner.vcxproj.filters diff --git a/DbcScanner.vcxproj b/DbcScanner.vcxproj deleted file mode 100644 index dbc0d2e..0000000 --- a/DbcScanner.vcxproj +++ /dev/null @@ -1,186 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {7fbe11bf-78a5-4c47-b5d0-323c00075e19} - DbcScanner - 10.0 - - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - $(ProjectDir)/src;$(IncludePath) - - - false - - - - Level3 - true - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - true - - - - - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - stdcpp17 - - - - - true - true - true - - - - - Level3 - true - _DEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - stdcpp17 - - - - - true - - - - - Level3 - true - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - stdcpp17 - - - - - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/DbcScanner.vcxproj.filters b/DbcScanner.vcxproj.filters deleted file mode 100644 index a81149e..0000000 --- a/DbcScanner.vcxproj.filters +++ /dev/null @@ -1,84 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 358eaa4..1b247c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,9 +3,6 @@ cmake_minimum_required(VERSION 3.5) project(dbccoder-cli LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) From 3376c580b8168c7f13f9287087eb53dfde884894 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 10 Jul 2021 17:10:18 +0300 Subject: [PATCH 080/181] Fixed type casting warning. --- src/codegen/c-util-generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index ccedc5e..d1f7099 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -217,7 +217,7 @@ void CiUtilGenerator::PrintSource() // scope is responsible for deletion these resources // tree is the struct tree-view which is used to execute // binary search on FrameID for selecting unpacking function - auto tree = FillTreeLevel(rx, 0, rx.size()); + auto tree = FillTreeLevel(rx, 0, static_cast(rx.size())); tof->AppendLine(StrPrint("uint32_t %s_Receive(%s_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)", fdesc->drvname.c_str(), fdesc->drvname.c_str())); From 64745a172900f95c330ad60a4f1808f543213a05 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 12:20:54 +0300 Subject: [PATCH 081/181] Application executable name changed - coderdbc. --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b247c8..01fcc06 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 3.5) -project(dbccoder-cli LANGUAGES CXX) +project(coderdbc-cli LANGUAGES CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -add_executable(dbccoder +add_executable(coderdbc ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-main-generator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-util-generator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/conditional-tree.cpp From 0628848deae72fb9a656018843073ea57d2b9389 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 13:18:20 +0300 Subject: [PATCH 082/181] Improved help message text. --- src/maincli.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index 3873b3c..af63428 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -6,17 +6,20 @@ #include "codegen/c-main-generator.h" #include "codegen/c-util-generator.h" #include "codegen/fs-creator.h" +#include "codegen/version.h" #define GEN_UTIL_CODE +char verstr[128] = {0}; + const char* helptext = - "welcome to dbccoder v1.1.\n\n" - "author: Andrey Astakhov (https://github.com/astand)\n\n" - "to use utility you need to provide 3 arguments:\n\n" + "https://github.com/astand/c-coderdbc (project source code)\n\n" + "https://coderdbc.com (web application)\n\n" + "To use utility you need to provide 3 arguments:\n\n" "1. dbc file path\n" - "2. directory for generated source codegen\n" - "3. prefix (driver name) which will be used in driver elements naming\n\n" - "Example: ./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb\n\n"; + "2. directory for generated source files (existable)\n" + "3. prefix (driver name) which will be used for naming dirver parts\n\n" + "Usage example:\n\n./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb\n\n"; DbcScanner* scanner; CiMainGenerator* cigen; @@ -34,6 +37,9 @@ int main(int argc, char* argv[]) ciugen = new CiUtilGenerator; fscreator = new FsCreator; + std::snprintf(verstr, 128, "\nDbccoder v%u.%u\n\n", CODEGEN_LIB_VERSION_MAJ, CODEGEN_LIB_VERSION_MIN); + std::cout << verstr; + if (argc == 4) { std::ifstream reader; From 0ad29f6a55916b0a10c262c21f40aa2eaf84506e Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 13:19:39 +0300 Subject: [PATCH 083/181] Added LICENSE and README. --- LICENSE.md | 674 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 37 +++ 2 files changed, 711 insertions(+) create mode 100644 LICENSE.md create mode 100644 README.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a6a3fd6 --- /dev/null +++ b/README.md @@ -0,0 +1,37 @@ + # CODERDBC + + ## What is it + + CLI utilty for generating C code from dbc (CAN matrix) files + + ## Build and run + + Below setup works on Ubuntu 20.04 and Windows 10. You need to ensure that your system has + C++ compile and builing toolchain (in my case for windows - VS Studio 2019 Community) + + To build coderdbc you need to make next steps: + + 1 install cmake + + 2 download source code: + + `git clone https://github.com/astand/c-coderdbc.git coderdbc` + + 3 goto source code directory: + + `cd coderdbc` + + 4 run cmake configuration: + + `cmake -S src -B build` + + 5 run cmake build: + + `cmake --build build --config release` + + 6 goto to build directory and run: + + `./coderdbc` + + Call without argument will print instruction how to pass DBC file for generation + From e7a4cab503c69684d5b800ccab0cecfff70a9f37 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 13:19:53 +0300 Subject: [PATCH 084/181] v1.2 --- docs/RELEASES.md | 16 ++++++++++++++++ src/codegen/version.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 8fd22ba..16d5e5e 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,22 @@ # Changelog All notable changes to this project will be documented in this file. + +## v1.2 - 2021-07-11 +### Added +- Option for rewriting generated files +- Added README.md (base build and run instruction) +- Added LICENSE.md + +### Changed +- Lib has become CLI utility "coderdbc" +- Added help to CLI +- Refactored project settings (cmake) to make easy way to build on windows PC + +### Fixed +- Fixed some warnings + + ## v1.0 - 2021-05-15 ### Added - Added DBC file version ("VERSION "x.x"") tag parsing diff --git a/src/codegen/version.h b/src/codegen/version.h index 75f7ccd..1082afb 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (0) +#define CODEGEN_LIB_VERSION_MIN (2) From f604b883c07b43573d10499701e52dec7b6fd600 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 17:59:17 +0300 Subject: [PATCH 085/181] Readme updated. --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6a3fd6..b063d6a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ `cd coderdbc` - 4 run cmake configuration: + 4 run cmake configuration to 'build' directory: `cmake -S src -B build` @@ -31,7 +31,43 @@ 6 goto to build directory and run: + `cd build` + `./coderdbc` Call without argument will print instruction how to pass DBC file for generation + ## Driver functionality description + + The full pack of source code (both generated and manually edited) will be looked this + (presuming that the dbc driver name is ecudb): + + ecudb.c / ecudb.h (1) RO / lib + + Main driver which have all dbc frames structs / pack functions / unpack functions these source files preferably to place in lib level directory because they are RO using model and can be shared among few separated projects. + + ecudb-fmon.h (2) RO / lib + + Contains monitoring functions signatures which can be optionally called from unpack frame functions. Best option to place file beside main driver files (above). + + ecudb-fmon.c (3) app + + User defined functions with diagnostic purpose. DLC, rolling, checksum errors can be handled automatically if dedicated configuration enabled. This file is user level source code. + + ecudb-config.h (4) app + + This is application specific configuration file. If you have a few projects (applications) which referenced on single main driver (1,2) source file each project must have self copy of this configuration. Source code (1,2) includes this configuration. If a few dbc matrix is in use in your application then for each of (1,2) specific configuration file must be presented + + dbccodeconf.h (5) app + + This is application specific configuration file. This file may include CanRxFrame definition, sigfloat_t typedef and + binutil macros which enables rx and tx structures allocation inside binutil code. This file must be single for application, source code (4,6) includes this configuration + + ecudb-binutil.c / ecudb-binutil.h (6) RO / app + + Basically this is application specific file. But it also can be used at the lib level. Depends on using. Some times there are few different modules which handle different parts of the single matrix (and single (1,2) instances) + + canmonitorutil.h (7) lib + + This is lib level source code. This file is basic for all automatic monitoring functions. + \ No newline at end of file From 2ba501e3493097f673bcb07bacd8b1c7a2693b79 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 22:04:10 +0300 Subject: [PATCH 086/181] Added template file generation. Refactored config comment text. --- src/codegen/c-main-generator.cpp | 265 +++++++++++++++++++++++-------- src/codegen/c-main-generator.h | 2 + 2 files changed, 200 insertions(+), 67 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index d74bee7..f41dd7b 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -47,6 +47,12 @@ void CiMainGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fs // 6 step is to print template for drv-config.h Gen_ConfigHeader(); + + // 7 step is to print canmonitorutil.h template code + Gen_CanMonUtil(); + + // 8 step is to print dbccodeconf.h template + Gen_DbcCodeConf(); } void CiMainGenerator::Gen_MainHeader() @@ -281,74 +287,109 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); } - fwriter->AppendLine("#pragma once", 2); - + fwriter->AppendLine("#pragma once"); + fwriter->AppendLine(""); fwriter->AppendLine("/* include common dbccode configurations */"); - fwriter->AppendLine("#include \"dbccodeconf.h\"", 3); - fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); - fwriter->AppendLine("/* To enable using messaged typedefs based on bit-fields"); - fwriter->AppendLine(" uncomment define below. (Note(!): bit-feild was not tested"); - fwriter->AppendLine(" properly, so using is up to user). */", 2 ); - fwriter->AppendLine(StrPrint("// #define %s", fdesc->usebits_def.c_str()), 3); - fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); - fwriter->AppendLine("/* By default signature of pack function intakes a few simple typed params"); - fwriter->AppendLine(" for loading data, len, etc. To enable specific struct based signature"); - fwriter->AppendLine(" uncomment define below. */", 2); - fwriter->AppendLine(StrPrint("// #define %s", fdesc->usesruct_def.c_str()), 3); - fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); - fwriter->AppendLine("/* All signal's names which have factor != 1 and offset != 0 will be added"); - fwriter->AppendLine(" *_ro postfix, to pay attention in the clinet code, that these signals will be"); - fwriter->AppendLine(" overwritten by *_phys value if definition below uncommented (!)"); - fwriter->AppendLine(""); - fwriter->AppendLine(" To enable phys values handling uncomment define below. It will:"); - fwriter->AppendLine(" - adds additional members to message struct with name extension *_phys"); - fwriter->AppendLine(" which have either:"); - fwriter->AppendLine(" 1. user defined type @sigfloat_t (must be defined by user in"); - fwriter->AppendLine(" dbccodeconf.h)"); - fwriter->AppendLine(" 2. the same type as signal has (for the case when niether factor nor offset"); - fwriter->AppendLine(" are not real based) "); - fwriter->AppendLine(" - in unpack function these signal will be loaded by the converted "); - fwriter->AppendLine(" value (with factor and offset)"); - fwriter->AppendLine(" - in pack function the CAN frame signal values will be loaded from"); - fwriter->AppendLine(" *_phys value with factor and offset conversion. */", 2); - fwriter->AppendLine(StrPrint("// #define %s", fdesc->usesigfloat_def.c_str()), 3); - - fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); - fwriter->AppendLine("/* To enable monitor functions uncomment define below."); - fwriter->AppendLine(" (Note(!) that the \"canmonitorutil.h\" must be accessed in include path):"); - fwriter->AppendLine(" It will:"); - fwriter->AppendLine(" - bring to message struct special monitor member @mon1 "); - fwriter->AppendLine(" - calling function FMon_*** function inside unpack function "); - fwriter->AppendLine(" which is empty by default and must be filled by user code"); - fwriter->AppendLine(" to check if any fault state detected. */", 2); - fwriter->AppendLine(StrPrint("// #define %s", fdesc->usemon_def.c_str()), 3); - - fwriter->AppendLine(StrPrint("/* When monitor using is enabled (%s)", fdesc->usemon_def.c_str())); - fwriter->AppendLine(" and define below uncommented, additional signal will be added"); - fwriter->AppendLine(" to message struct. ***_expt - expected rolling counter, to "); - fwriter->AppendLine(" perform monitoring rolling counter sequence automatically. */", 2); - fwriter->AppendLine(StrPrint("// #define %s", fdesc->useroll_def.c_str()), 3); - - fwriter->AppendLine("/* ----------------------------------------------------------------------------------- */"); - fwriter->AppendLine(StrPrint("/* When monitor using is enabled (%s)", fdesc->usemon_def.c_str())); - fwriter->AppendLine(" and define below uncommented, checksum calculation in unpack"); - fwriter->AppendLine(" function will be performed. in pack function checksum signal will"); - fwriter->AppendLine(" be calculated automatically too. ", 2); - fwriter->AppendLine(" The signal that can be selected as checksum must have in comment substring with next format:"); - fwriter->AppendLine(" where:"); - fwriter->AppendLine(" - Checksum : constant marker word"); - fwriter->AppendLine(" - XOR8 : type of method, this text will be passed to GetFrameHash function as is,"); - fwriter->AppendLine(" so the best use case is to pre-define enum collection which have value from this position"); - fwriter->AppendLine(" - 3 : optional value that will be passed to GetFrameHash as integer value", 2); - fwriter->AppendLine(" To this case user must define specific function", 2); - fwriter->AppendLine(" function: uint8_t GetFrameHash(data_ptr, len, msgid, type, option)", 2); - fwriter->AppendLine(" where:"); - fwriter->AppendLine(" - data_ptr : pointer to payload"); - fwriter->AppendLine(" - len : message dlc or payload len"); - fwriter->AppendLine(" - msgid : CAN Message ID"); - fwriter->AppendLine(" - type : method of algorythm"); - fwriter->AppendLine(" - option : optional integer param */", 2); - fwriter->AppendLine(StrPrint("// #define %s", fdesc->usecsm_def.c_str()), 2); + fwriter->AppendLine("#include \"dbccodeconf.h\""); + fwriter->AppendLine(""); + fwriter->AppendLine(""); + fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); + fwriter->AppendLine(" This define enables using CAN message structs with bit-fielded signals"); + fwriter->AppendLine(" layout."); + fwriter->AppendLine(""); + fwriter->AppendLine(" Note(!): bit-feild was not tested properly. */"); + fwriter->AppendLine(""); + fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usebits_def.c_str()), 3); + + fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); + fwriter->AppendLine(" This macro enables using CAN message descriptive struct packing functions"); + fwriter->AppendLine(" (by default signature of pack function intakes a few simple typed params"); + fwriter->AppendLine(" for loading data, len, etc). To compile you need to define the struct"); + fwriter->AppendLine(" __CoderDbcCanFrame_t__ which must have fields:"); + fwriter->AppendLine(""); + fwriter->AppendLine(" u32 MsgId (CAN Frame message ID)"); + fwriter->AppendLine(" u8 DLC (CAN Frame payload length field)"); + fwriter->AppendLine(" u8 Data[8] (CAN Frame payload data)"); + fwriter->AppendLine(" u8 IDE (CAN Frame Extended (1) / Standard (0) ID type)"); + fwriter->AppendLine(""); + fwriter->AppendLine(" This struct definition have to be placed (or be included) in dbccodeconf.h */"); + fwriter->AppendLine(""); + fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usesruct_def.c_str()), 3); + + fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); + fwriter->AppendLine(" All the signals which have values of factor != 1 or offset != 0"); + fwriter->AppendLine(" will be named in message struct with posfix '_ro'. Pack to payload"); + fwriter->AppendLine(" operations will be made on this signal value as well as unpack from payload."); + fwriter->AppendLine(""); + fwriter->AppendLine(" USE_SIGFLOAT macro makes some difference:"); + fwriter->AppendLine(""); + fwriter->AppendLine(" 1. All the '_ro' fields will have a pair field with '_phys' postfix."); + fwriter->AppendLine(" If only offset != 0 is true then the type of '_phys' signal is the same"); + fwriter->AppendLine(" as '_ro' signal. In other case the type will be @sigfloat_t which"); + fwriter->AppendLine(" have to be defined in user dbccodeconf.h"); + fwriter->AppendLine(""); + fwriter->AppendLine(" 2. In pack function '_ro' signal will be rewritten by '_phys' signal, which"); + fwriter->AppendLine(" requires from user to use ONLY '_phys' signal for packing frame"); + fwriter->AppendLine(""); + fwriter->AppendLine(" 3. In unpack function '_phys' signal will be written by '_ro' signal."); + fwriter->AppendLine(" User have to use '_phys' signal to read physical value. */"); + fwriter->AppendLine(""); + fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usesigfloat_def.c_str()), 3); + + fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); + fwriter->AppendLine(" Note(!) that the \"canmonitorutil.h\" must be accessed in include path:"); + fwriter->AppendLine(""); + fwriter->AppendLine(" This macro adds:"); + fwriter->AppendLine(""); + fwriter->AppendLine(" - monitor field @mon1 to message struct"); + fwriter->AppendLine(""); + fwriter->AppendLine(" - capture system tick in unpack function and save value to mon1 field"); + fwriter->AppendLine(" to provide to user better missing frame detection code. For this case"); + fwriter->AppendLine(" user must provide function declared in canmonitorutil.h - GetSysTick()"); + fwriter->AppendLine(" which may return 1ms uptime."); + fwriter->AppendLine(""); + fwriter->AppendLine(" - calling function FMon_*** (from 'fmon' driver) inside unpack function"); + fwriter->AppendLine(" which is empty by default and have to be filled by user if"); + fwriter->AppendLine(" tests for DLC, rolling, checksum are necessary */"); + fwriter->AppendLine(""); + fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usemon_def.c_str()), 3); + + fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); + fwriter->AppendLine(StrPrint(" When monitor using is enabled (%s) and define below", fdesc->usemon_def.c_str())); + fwriter->AppendLine(" uncommented, additional signal will be added to message struct. ***_expt:"); + fwriter->AppendLine(" expected rolling counter, to perform monitoring rolling counter sequence"); + fwriter->AppendLine(" automatically (result may be tested in dedicated Fmon_*** function) */"); + fwriter->AppendLine(""); + fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->useroll_def.c_str()), 3); + + fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); + fwriter->AppendLine(StrPrint(" When monitor using is enabled (%s) and define below", fdesc->usemon_def.c_str())); + fwriter->AppendLine(" uncommented, frame checksum signal may be handled automatically."); + fwriter->AppendLine(""); + fwriter->AppendLine(" The signal which may be marked as checksum signal must have substring"); + fwriter->AppendLine(" with next format:"); + fwriter->AppendLine(" "); + fwriter->AppendLine(""); + fwriter->AppendLine(" where:"); + fwriter->AppendLine(""); + fwriter->AppendLine(" - \"Checksum\": constant marker word"); + fwriter->AppendLine(""); + fwriter->AppendLine(" - \"XOR8\": type of method, this text will be passed to GetFrameHash"); + fwriter->AppendLine(" (canmonitorutil.h) function as is, the best use case is to define 'enum"); + fwriter->AppendLine(" DbcCanCrcMethods' in canmonitorutil.h file with all possible"); + fwriter->AppendLine(" checksum algorithms (e.g. XOR8, XOR4 etc)"); + fwriter->AppendLine(""); + fwriter->AppendLine(" - \"3\": optional value that will be passed to GetFrameHash as integer value"); + fwriter->AppendLine(""); + fwriter->AppendLine(" Function GetFrameHash have to be implemented by user"); + fwriter->AppendLine(""); + fwriter->AppendLine(" In pack function checksum signal will be calculated automatically"); + fwriter->AppendLine(" and loaded to payload"); + fwriter->AppendLine(""); + fwriter->AppendLine(" In unpack function checksum signal is checked with calculated."); + fwriter->AppendLine(" (result may be tested in dedicated Fmon_*** function)."); + fwriter->AppendLine(""); + fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usecsm_def.c_str()), 2); fwriter->Flush(fdesc->core_c.dir + '/' + fdesc->drvname + "-config.h"); } @@ -425,6 +466,95 @@ next generation will completely clear all manually added code (!)\n\ fwriter->Flush(fdesc->fmon_c.fpath); } +void CiMainGenerator::Gen_CanMonUtil() +{ + fwriter->AppendLine("#pragma once"); + fwriter->AppendLine(""); + fwriter->AppendLine("#include "); + fwriter->AppendLine(""); + fwriter->AppendLine("#ifdef __cplusplus"); + fwriter->AppendLine("extern \"C\" {"); + fwriter->AppendLine("#endif"); + fwriter->AppendLine(""); + fwriter->AppendLine("// declare here all availible checksum algorithms"); + fwriter->AppendLine("typedef enum"); + fwriter->AppendLine("{"); + fwriter->AppendLine(" // XOR8 = 0,"); + fwriter->AppendLine(" // XOR4 = 1,"); + fwriter->AppendLine(" // etc"); + fwriter->AppendLine("} DbcCanCrcMethods;"); + fwriter->AppendLine(""); + fwriter->AppendLine("typedef struct"); + fwriter->AppendLine("{"); + fwriter->AppendLine(" // @last_cycle keeps tick-value when last frame was received"); + fwriter->AppendLine(" uint32_t last_cycle;"); + fwriter->AppendLine(""); + fwriter->AppendLine(" // @timeout_cycle keeps maximum timeout for frame, user responsibility"); + fwriter->AppendLine(" // to init this field and use it in missing frame monitoring function"); + fwriter->AppendLine(" uint32_t timeout_cycle;"); + fwriter->AppendLine(""); + fwriter->AppendLine(" // @frame_cnt keeps count of all the received frames"); + fwriter->AppendLine(" uint32_t frame_cnt;"); + fwriter->AppendLine(""); + fwriter->AppendLine(" // setting up @roll_error bit indicates roll counting fail."); + fwriter->AppendLine(" // Bit is not clearing automatically!"); + fwriter->AppendLine(" uint32_t roll_error : 1;"); + fwriter->AppendLine(""); + fwriter->AppendLine(" // setting up @checksum_error bit indicates checksum checking failure."); + fwriter->AppendLine(" // Bit is not clearing automatically!"); + fwriter->AppendLine(" uint32_t csm_error : 1;"); + fwriter->AppendLine(""); + fwriter->AppendLine(" // setting up @cycle_error bit indicates that time was overrunned."); + fwriter->AppendLine(" // Bit is not clearing automatically!"); + fwriter->AppendLine(" uint32_t cycle_error : 1;"); + fwriter->AppendLine(""); + fwriter->AppendLine(" // setting up @dlc_error bit indicates that the actual length of"); + fwriter->AppendLine(" // CAN frame is less then defined by CAN matrix!"); + fwriter->AppendLine(" uint32_t dlc_error : 1;"); + fwriter->AppendLine(""); + fwriter->AppendLine("} FrameMonitor_t;"); + fwriter->AppendLine(""); + fwriter->AppendLine("/* ----------------------------------------------------------------------------- */"); + fwriter->AppendLine("// @d - buff for hash calculation"); + fwriter->AppendLine("// @len - number of bytes for hash calculation"); + fwriter->AppendLine("// @method - hash algorythm."); + fwriter->AppendLine("// @op - optional value"); + fwriter->AppendLine("uint8_t GetFrameHash(const uint8_t* data_ptr, uint8_t len, uint32_t msgid, DbcCanCrcMethods type, uint32_t option);"); + fwriter->AppendLine(""); + fwriter->AppendLine("/* ----------------------------------------------------------------------------- */"); + fwriter->AppendLine("// this function will be called when unpacking is performing. Value will be saved"); + fwriter->AppendLine("// in @last_cycle variable"); + fwriter->AppendLine("uint32_t GetSystemTick(void);"); + fwriter->AppendLine(""); + fwriter->AppendLine(""); + fwriter->AppendLine("#ifdef __cplusplus"); + fwriter->AppendLine("}"); + fwriter->AppendLine("#endif"); + fwriter->AppendLine(""); + + fwriter->Flush(fdesc->core_c.dir + '/' + "canmonitorutil.h"); +} + +void CiMainGenerator::Gen_DbcCodeConf() +{ + fwriter->AppendLine("#pragma once"); + fwriter->AppendLine(""); + fwriter->AppendLine("#include "); + fwriter->AppendLine(""); + fwriter->AppendLine("// when USE_SIGFLOAT enabed the sigfloat_t must be defined"); + fwriter->AppendLine("// typedef double sigfloat_t;"); + fwriter->AppendLine(""); + fwriter->AppendLine("// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined"); + fwriter->AppendLine("// #include \"{header_with_can_struct}\""); + fwriter->AppendLine("// typedef {can_struct} __CoderDbcCanFrame_t__;"); + fwriter->AppendLine(""); + fwriter->AppendLine("// if you need to allocate rx and tx messages structs put the allocation macro here"); + fwriter->AppendLine("// #define __DEF_{your_driver_name}__"); + fwriter->AppendLine(""); + + fwriter->Flush(fdesc->core_c.dir + '/' + "dbccodeconf.h"); +} + void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) { if (sig.CommentText.size() > 0) @@ -691,3 +821,4 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); } } + diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 58a974a..9d47881 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -20,6 +20,8 @@ class CiMainGenerator { void Gen_ConfigHeader(); void Gen_FMonHeader(); void Gen_FMonSource(); + void Gen_CanMonUtil(); + void Gen_DbcCodeConf(); void WriteSigStructField(const SignalDescriptor_t& sig, bool bitfield, size_t pad); From 002c86b8759733631cb9946bbfbaeed5d2064d4f Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 22:04:23 +0300 Subject: [PATCH 087/181] v1.3 --- docs/RELEASES.md | 7 +++++++ src/codegen/version.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 16d5e5e..750e54c 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## v1.3 - 2021-07-11 +### Added +- Printing template canmonitorutil.h +- Printing template dbccodeconf.h +- Updated driver-config comment text + + ## v1.2 - 2021-07-11 ### Added - Option for rewriting generated files diff --git a/src/codegen/version.h b/src/codegen/version.h index 1082afb..74daef5 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (2) +#define CODEGEN_LIB_VERSION_MIN (3) From ff67c1fc9d0ed8213675ee98bbde67aa83133419 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 11 Jul 2021 22:07:48 +0300 Subject: [PATCH 088/181] Hotfixed README layout. --- README.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index b063d6a..6afc8a0 100644 --- a/README.md +++ b/README.md @@ -44,28 +44,41 @@ ecudb.c / ecudb.h (1) RO / lib - Main driver which have all dbc frames structs / pack functions / unpack functions these source files preferably to place in lib level directory because they are RO using model and can be shared among few separated projects. + Main driver which have all dbc frames structs / pack functions / unpack functions these + source files preferably to place in lib level directory because they are RO using model + and can be shared among few separated projects. ecudb-fmon.h (2) RO / lib - Contains monitoring functions signatures which can be optionally called from unpack frame functions. Best option to place file beside main driver files (above). + Contains monitoring functions signatures which can be optionally called from unpack + frame functions. Best option to place file beside main driver files (above). ecudb-fmon.c (3) app - User defined functions with diagnostic purpose. DLC, rolling, checksum errors can be handled automatically if dedicated configuration enabled. This file is user level source code. + User defined functions with diagnostic purpose. DLC, rolling, checksum errors can be + handled automatically if dedicated configuration enabled. This file is user level + source code. ecudb-config.h (4) app - This is application specific configuration file. If you have a few projects (applications) which referenced on single main driver (1,2) source file each project must have self copy of this configuration. Source code (1,2) includes this configuration. If a few dbc matrix is in use in your application then for each of (1,2) specific configuration file must be presented + This is application specific configuration file. If you have a few projects + (applications) which referenced on single main driver (1,2) source file each project + must have self copy of this configuration. Source code (1,2) includes this + configuration. If a few dbc matrix is in use in your application then for each of (1,2) + specific configuration file must be presented dbccodeconf.h (5) app - This is application specific configuration file. This file may include CanRxFrame definition, sigfloat_t typedef and - binutil macros which enables rx and tx structures allocation inside binutil code. This file must be single for application, source code (4,6) includes this configuration + This is application specific configuration file. This file may include CanRxFrame + definition, sigfloat_t typedef and binutil macros which enables rx and tx structures + allocation inside binutil code. This file must be single for application, + source code (4,6) includes this configuration ecudb-binutil.c / ecudb-binutil.h (6) RO / app - Basically this is application specific file. But it also can be used at the lib level. Depends on using. Some times there are few different modules which handle different parts of the single matrix (and single (1,2) instances) + Basically this is application specific file. But it also can be used at the lib level. + Depends on using. Some times there are few different modules which handle different + parts of the single matrix (and single (1,2) instances) canmonitorutil.h (7) lib From 75f0193ac80e9ee1f0478bc094c019cba32e4522 Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 13 Jul 2021 21:56:13 +0300 Subject: [PATCH 089/181] Removed test info. Edited README.md. --- README.md | 51 ++++++++++++++++++++++--------------------- docs/RELEASES.md | 5 +++++ src/codegen/version.h | 2 +- src/maincli.cpp | 2 +- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 6afc8a0..93a1964 100644 --- a/README.md +++ b/README.md @@ -40,47 +40,48 @@ ## Driver functionality description The full pack of source code (both generated and manually edited) will be looked this - (presuming that the dbc driver name is ecudb): + (presuming that the dbc driver name is "ecudb"): ecudb.c / ecudb.h (1) RO / lib - Main driver which have all dbc frames structs / pack functions / unpack functions these - source files preferably to place in lib level directory because they are RO using model - and can be shared among few separated projects. + Main driver which has all dbc frames structs / pack functions / unpack functions these source + files preferably to place in lib level directory because they are RO using model and can be + shared among few separated projects. ecudb-fmon.h (2) RO / lib - Contains monitoring functions signatures which can be optionally called from unpack - frame functions. Best option to place file beside main driver files (above). + Contains monitoring functions signatures which can be optionally called from unpack frame. + Best option to place file beside Main driver files (1). ecudb-fmon.c (3) app - User defined functions with diagnostic purpose. DLC, rolling, checksum errors can be - handled automatically if dedicated configuration enabled. This file is user level - source code. + User defined functions with diagnostic purpose. DLC, rolling, checksum errors can be handled + automatically if specific configuration enabled. This file is user level source code. - ecudb-config.h (4) app + ecudb-config.h (4) app / inc* - This is application specific configuration file. If you have a few projects - (applications) which referenced on single main driver (1,2) source file each project - must have self copy of this configuration. Source code (1,2) includes this - configuration. If a few dbc matrix is in use in your application then for each of (1,2) - specific configuration file must be presented + This is application specific configuration file. If you have a few projects (applications) + which referenced on single main driver (1,2) then each project have to have own copy of this + configuration. Source code (1,2) includes this configuration. If a few dbc matrix is in use + in your application then for each of (1,2) specific configuration file must be presented. - dbccodeconf.h (5) app + dbccodeconf.h (5) app / inc - This is application specific configuration file. This file may include CanRxFrame - definition, sigfloat_t typedef and binutil macros which enables rx and tx structures - allocation inside binutil code. This file must be single for application, - source code (4,6) includes this configuration + This is application specific configuration file. This file may include "CanFrame" definition, + sigfloat_t typedef and binutil macros which enables rx and tx structures allocation inside + ecudb-binutil.c. This file must be single for application (see template dbccodeconf.h), source + code (4,6) includes this configuration. ecudb-binutil.c / ecudb-binutil.h (6) RO / app - Basically this is application specific file. But it also can be used at the lib level. - Depends on using. Some times there are few different modules which handle different - parts of the single matrix (and single (1,2) instances) - + Basically this is application specific file. This driver has one function which intakes CAN + message data and calls dedicated unpacking function. Function selection based on binary search. + canmonitorutil.h (7) lib This is lib level source code. This file is basic for all automatic monitoring functions. - \ No newline at end of file + This configuration file location have to be added to project include path. + + ----------------------------------------------------------------------------------------------- + + *inc - file location have to be added to project include path. \ No newline at end of file diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 750e54c..d397917 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## v1.4 - 2021-07-13 +### Fixed +- Removed default into "this is test" +- Edited README.md + ## v1.3 - 2021-07-11 ### Added diff --git a/src/codegen/version.h b/src/codegen/version.h index 74daef5..478a993 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (3) +#define CODEGEN_LIB_VERSION_MIN (4) diff --git a/src/maincli.cpp b/src/maincli.cpp index af63428..87c233a 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -64,7 +64,7 @@ int main(int argc, char* argv[]) scanner->TrimDbcText(s); - std::string info("this is test"); + std::string info(""); auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), true, info); From 6481e7e3213fccb5213f7873ae10a3f300272805 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 26 Aug 2021 23:38:09 +0300 Subject: [PATCH 090/181] Fixed some issues. --- docs/RELEASES.md | 7 +++++++ src/codegen/c-sigprinter.cpp | 2 +- src/codegen/version.h | 2 +- src/parser/dbclineparser.cpp | 9 +++++---- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index d397917..94f91cd 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,13 @@ # Changelog All notable changes to this project will be documented in this file. +## v1.5 - 2021-08-26 +### Fixed +- Fixed 'atoi' with Extended ID on Windows OS ([@shevu](https://github.com/shevu)) +- Fixed issue with parsing value table values ([@shevu](https://github.com/shevu)) +- Fixed issue with frames where signals goes out of DLC range + + ## v1.4 - 2021-07-13 ### Fixed - Removed default into "this is test" diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 2e1e7df..b65c5e4 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -187,7 +187,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec uint32_t bn = (startb / 8); - if (to_bytes.size() < bn) + if (to_bytes.size() <= bn) { // DLC from message doesn't fit to signal layout // make code uncomplilable diff --git a/src/codegen/version.h b/src/codegen/version.h index 478a993..c9c6eae 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (4) +#define CODEGEN_LIB_VERSION_MIN (5) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index f1db014..9a6687a 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -117,7 +117,7 @@ bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string msg->Name = items[2]; - msg->MsgID = static_cast(atoi(items[1].c_str())); + msg->MsgID = static_cast(atoll(items[1].c_str())); msg->DLC = atoi(items[4].c_str()); @@ -418,7 +418,7 @@ bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line) // 1 CM_ marker // 2 target (message or signal) // 3 msg id - uint32_t id = ((uint32_t)(atoi(meta[2].c_str()))); + uint32_t id = static_cast((atoll(meta[2].c_str()))); // clear message id from high 3 bits cm->MsgId = clear_msgid(id); @@ -475,7 +475,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s if (items.size() > 4 && items[1] == "GenMsgCycleTime" && items[2] == "BO_") { attr->Type = AttributeType::CycleTime; - attr->MsgId = clear_msgid(atoi(items[3].c_str())); + attr->MsgId = clear_msgid(atoll(items[3].c_str())); // read value of ms of cycle time for the current message attr->Value = atoi(items[4].c_str()); ret = true; @@ -514,9 +514,10 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) if ((items.size() >= 3) && (items.back() == ";") && (items.size() % 2 == 0)) { - comm->MsgId = (clear_msgid(atoi(items[1].c_str()))); + comm->MsgId = (clear_msgid(atoll(items[1].c_str()))); comm->SigName = items[2]; comm->Text = ""; + comm->ca_target = CommentTarget::Signal; for (size_t valpair = 3; valpair < (items.size() - 1); valpair += 2) { From 6439bccdb82f8026f5d62fc9a9aac73bfbaebdf7 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 8 Sep 2021 23:19:21 +0300 Subject: [PATCH 091/181] Added optional binutil generation for each node in DBC. --- src/maincli.cpp | 99 +++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 88 insertions(+), 11 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index 87c233a..b80dcfa 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "parser/dbcscanner.h" #include "codegen/c-main-generator.h" #include "codegen/c-util-generator.h" @@ -10,6 +11,9 @@ #define GEN_UTIL_CODE +#define MIN_ARGC_NUM 4 +#define MAX_ARGC_NUM 5 + char verstr[128] = {0}; const char* helptext = @@ -18,8 +22,10 @@ const char* helptext = "To use utility you need to provide 3 arguments:\n\n" "1. dbc file path\n" "2. directory for generated source files (existable)\n" - "3. prefix (driver name) which will be used for naming dirver parts\n\n" - "Usage example:\n\n./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb\n\n"; + "3. prefix (driver name) which will be used for naming dirver parts\n" + "4. (optional) --node-utils will generate specific pairs of binutils drivers for each node" + " which is either transmitter or receiver of at least one frame from dbc.\n\n" + "Usage example:\n\n./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb --node-utils\n\n"; DbcScanner* scanner; CiMainGenerator* cigen; @@ -40,7 +46,7 @@ int main(int argc, char* argv[]) std::snprintf(verstr, 128, "\nDbccoder v%u.%u\n\n", CODEGEN_LIB_VERSION_MAJ, CODEGEN_LIB_VERSION_MIN); std::cout << verstr; - if (argc == 4) + if (argc >= MIN_ARGC_NUM) { std::ifstream reader; // copy dbc file name to string variable @@ -79,18 +85,89 @@ int main(int argc, char* argv[]) #if defined (GEN_UTIL_CODE) - ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), (source_files_out_path).c_str(), true, info); - - MsgsClassification groups; + std::string node_util = "--node-utils"; - for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + // check if option --node-utils is requested, when requested binutil generation + // wiil be performed on each node from DBC file in accordance to its RX / TX subscription + if (argc == MAX_ARGC_NUM && node_util.compare(argv[4]) == 0) { - groups.Rx.push_back(scanner->dblist.msgs[i]->MsgID); + std::vector nodes; + + for (size_t num = 0; num < scanner->dblist.msgs.size(); num++) + { + // iterate all messages and collect All nodes assign to at least one message + auto m = scanner->dblist.msgs[num]; + + // test transmitter + std::string nodename = m->Transmitter; + bool found = (std::find(nodes.begin(), nodes.end(), nodename) != nodes.end()); + + if (!found) + { + nodes.push_back(nodename); + } + + for (size_t recs = 0; recs < m->RecS.size(); recs++) + { + // test all recs + found = (std::find(nodes.begin(), nodes.end(), nodename) != nodes.end()); + + if (!found) + { + nodes.push_back(nodename); + } + } + } + + // for each node in collection perform specific bin-util generation + for (size_t node = 0; node < nodes.size(); node++) + { + std::string util_name = nodes[node] + "_" + dbc_driver_name; + + ret = fscreator->PrepareDirectory(util_name.c_str(), source_files_out_path.c_str(), true, info); + + MsgsClassification groups; + + for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + { + auto m = scanner->dblist.msgs[i]; + + if (m->Transmitter.compare(nodes[node]) == 0) + { + groups.Tx.push_back(m->MsgID); + } + else + { + bool found = (std::find(m->RecS.begin(), m->RecS.end(), nodes[node]) != m->RecS.end()); + + if (found) + { + groups.Rx.push_back(m->MsgID); + } + } + } + + if (ret) + { + ciugen->Generate(scanner->dblist, fscreator->FS, groups, dbc_driver_name); + } + } } - - if (ret) + else { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, dbc_driver_name); + ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), (source_files_out_path).c_str(), true, info); + + MsgsClassification groups; + + for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + { + groups.Rx.push_back(scanner->dblist.msgs[i]->MsgID); + } + + if (ret) + { + ciugen->Generate(scanner->dblist, fscreator->FS, groups, dbc_driver_name); + } } #endif From f918d0163e8417fefa8a026ab3a08885b948af8a Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 9 Sep 2021 22:45:43 +0300 Subject: [PATCH 092/181] Fixed issue with 1 frame in RX struct. --- src/codegen/c-util-generator.cpp | 4 ++-- src/codegen/conditional-tree.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index d1f7099..6e6e77a 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -263,8 +263,8 @@ ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vectorConditionExpresion = StrPrint("_id == 0x%XU", msg->MsgID); ret->High = new ConditionalTree_t; - ret->Type = ConditionalType::Express; - ret->UtilCodeBody = StrPrint("recid = Unpack_%s_%s(&(_m->%s), _d, dlc_);", + ret->High->Type = ConditionalType::Single; + ret->High->UtilCodeBody = StrPrint("recid = Unpack_%s_%s(&(_m->%s), _d, dlc_);", msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); return ret; } diff --git a/src/codegen/conditional-tree.cpp b/src/codegen/conditional-tree.cpp index 621aa60..1486f14 100644 --- a/src/codegen/conditional-tree.cpp +++ b/src/codegen/conditional-tree.cpp @@ -37,7 +37,7 @@ std::string ConditionalTree::WriteCode(const ConditionalTree_t* tree, std::strin } else { - temp = "} else {"; + temp = "}"; PrintCode(temp, intend); } From a2c0079bffe9b4331bed929054b4e7c2781e1ae7 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 9 Sep 2021 22:50:54 +0300 Subject: [PATCH 093/181] Releases updated for v1.6. --- docs/RELEASES.md | 9 +++++++++ src/codegen/version.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 94f91cd..f68a3d1 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,15 @@ # Changelog All notable changes to this project will be documented in this file. +## v1.6 2021-09-09 +### Added +- 4th CLI param '--node-utils' for generation pairs of binutil for each +network node defined in DBC + +### Fixed +- Bad *_Receive() function body when there is only 1 frame in RX struct + + ## v1.5 - 2021-08-26 ### Fixed - Fixed 'atoi' with Extended ID on Windows OS ([@shevu](https://github.com/shevu)) diff --git a/src/codegen/version.h b/src/codegen/version.h index c9c6eae..8c44c29 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (5) +#define CODEGEN_LIB_VERSION_MIN (6) From 9af49b087ec18bf0e27619b7cad915945b002e5a Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 10 Oct 2021 21:30:01 +0300 Subject: [PATCH 094/181] Changes on style guide. --- src/parser/dbclineparser.cpp | 6 ++++++ src/parser/dbcscanner.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 9a6687a..2528142 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -100,7 +100,9 @@ DbcLineParser::DbcLineParser() bool DbcLineParser::IsMessageLine(const std::string& line) { if (line.find(MessageLineStart) == 0) + { return true; + } return false; } @@ -111,7 +113,9 @@ bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string auto items = resplit(line, regMessage, -1); if (items.size() < 5) + { return false; + } msg->Transmitter = (items.size() >= 6) ? (items[5]) : (""); @@ -146,7 +150,9 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& auto halfs = resplit(line, kRegSigSplit1, -1); if (halfs.size() < 2) + { return false; + } // split tail auto tailpart = resplit(halfs[1], kregSigSplit2, -1); diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 953607c..23d6160 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -13,15 +13,19 @@ MessageDescriptor_t* find_message(vector msgs, uint32_t ID MessageDescriptor_t* ret = nullptr; if (msgs.size() == 0) + { return ret; + } for (size_t i = 0; i < msgs.size(); i++) { ret = msgs[i]; if (ret->MsgID == ID) + { // Frame found break; + } } return ret; @@ -300,7 +304,9 @@ void DbcScanner::FindVersion(const std::string& instr) char marker[9]; if (instr[0] != 'V' && instr[1] != 'E') + { return; + } int32_t ret = std::sscanf(instr.c_str(), "%8s \"%u.%u\"", marker, &h, &l); From 02d1e28b40b43a7b9356e237ccccec7f12612d4b Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 10 Oct 2021 21:31:36 +0300 Subject: [PATCH 095/181] Fixed potential bug. Missing node adding on RecS item matching. --- src/maincli.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index b80dcfa..b058d52 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -109,12 +109,13 @@ int main(int argc, char* argv[]) for (size_t recs = 0; recs < m->RecS.size(); recs++) { - // test all recs - found = (std::find(nodes.begin(), nodes.end(), nodename) != nodes.end()); + std::string rx_node_name = m->RecS[recs]; - if (!found) + // test all recs + if (std::find(nodes.begin(), nodes.end(), rx_node_name) == nodes.end()) { - nodes.push_back(nodename); + // New node name, put it in the node collection + nodes.push_back(rx_node_name); } } } From c5bbd7fca998352ccb9b86a107abbb6fc3b6165e Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 10 Oct 2021 21:32:55 +0300 Subject: [PATCH 096/181] Added suppot for multi Transmiters. --- src/codegen/c-util-generator.cpp | 2 -- src/maincli.cpp | 32 ++++++++++++++++++-------------- src/parser/dbclineparser.cpp | 31 ++++++++++++++++++++++++++++++- src/parser/dbclineparser.h | 9 +++++++++ src/parser/dbcscanner.cpp | 32 +++++++++++++++++++++++++++++++- src/types/message.h | 2 +- 6 files changed, 89 insertions(+), 19 deletions(-) diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 6e6e77a..f461503 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -61,7 +61,6 @@ void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fs if (v != std::end(groups.Rx)) { rx.push_back(m); - continue; } v = std::find_if(groups.Tx.begin(), groups.Tx.end(), [&](const uint32_t& msgid) @@ -72,7 +71,6 @@ void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fs if (v != std::end(groups.Tx)) { tx.push_back(m); - continue; } } diff --git a/src/maincli.cpp b/src/maincli.cpp index b058d52..a28c379 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -98,13 +98,15 @@ int main(int argc, char* argv[]) // iterate all messages and collect All nodes assign to at least one message auto m = scanner->dblist.msgs[num]; - // test transmitter - std::string nodename = m->Transmitter; - bool found = (std::find(nodes.begin(), nodes.end(), nodename) != nodes.end()); - - if (!found) + for (size_t txs = 0; txs < m->TranS.size(); txs++) { - nodes.push_back(nodename); + std::string tx_node_name = m->TranS[txs]; + + if (std::find(nodes.begin(), nodes.end(), tx_node_name) == nodes.end()) + { + // New node name. put it in the node collection + nodes.push_back(tx_node_name); + } } for (size_t recs = 0; recs < m->RecS.size(); recs++) @@ -133,18 +135,20 @@ int main(int argc, char* argv[]) { auto m = scanner->dblist.msgs[i]; - if (m->Transmitter.compare(nodes[node]) == 0) + bool found = (std::find(m->TranS.begin(), m->TranS.end(), nodes[node]) != m->TranS.end()); + + if (found) { + // Message is in Tx array of current node groups.Tx.push_back(m->MsgID); } - else - { - bool found = (std::find(m->RecS.begin(), m->RecS.end(), nodes[node]) != m->RecS.end()); - if (found) - { - groups.Rx.push_back(m->MsgID); - } + found = (std::find(m->RecS.begin(), m->RecS.end(), nodes[node]) != m->RecS.end()); + + if (found) + { + // Message is in Rx array of current node + groups.Rx.push_back(m->MsgID); } } diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 2528142..177938c 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -20,6 +20,7 @@ static const std::string kRegCommMeta = "[ ]+"; // This reg splits line to parts (for attributes) static const std::string kRegAttrMain = "[^A-Za-z0-9_\\.]+"; +static const std::string kTransmittersList = "[^a-zA-Z_0-9]+"; // Regex template to split string by spaces BUT NOT what inside quotes OR apostrophes // [^\s"']+|"([^"]*)"|'([^']*)' @@ -117,7 +118,12 @@ bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string return false; } - msg->Transmitter = (items.size() >= 6) ? (items[5]) : (""); + std::string txname = (items.size() >= 6) ? (items[5]) : (""); + + if (txname.size() > 1) + { + msg->TranS.push_back(txname); + } msg->Name = items[2]; @@ -137,6 +143,29 @@ bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string return true; } +uint32_t DbcLineParser::ParseMultiTrans(std::vector& outnodes, std::string& line) +{ + uint32_t ret = 0; + + auto chunks = resplit(line, kTransmittersList, -1); + + if (chunks.size() >= 3 && chunks[0] == "BO_TX_BU_") + { + ret = clear_msgid(atoll(chunks[1].c_str())); + + if (ret != 0) + { + for (size_t i = 2; i < chunks.size(); i++) + { + outnodes.push_back(chunks[i]); + } + } + } + + return ret; +} + + bool DbcLineParser::IsSignalLine(const std::string& line) { const std::regex sigMatch("\\s+SG_"); diff --git a/src/parser/dbclineparser.h b/src/parser/dbclineparser.h index 5d76237..a069c9a 100644 --- a/src/parser/dbclineparser.h +++ b/src/parser/dbclineparser.h @@ -68,6 +68,15 @@ class DbcLineParser { // and load result to attr ValueStr, return true if parsed ok bool ParseValTableLine(Comment_t* cm, const std::string& line); + /** + * @brief tries to find string with information about frame which has + * multiple TX nodes + * @param outnodes vector to load names of TX nodes + * @param str line to parse from DBC file + * @retval MsgId if parsed successfully or zero + */ + uint32_t ParseMultiTrans(std::vector& outnodes, std::string& str); + private: // defines the type for the message struct member SigType GetSigType(SignalDescriptor_t* sig); diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 23d6160..4f9dbe9 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -108,7 +108,37 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) pMsg->Signals.push_back(sig); if (sig.IsDoubleSig || sig.IsSimpleSig != true) + { pMsg->hasPhys = true; + } + } + } + + std::vector tx_nodes; + tx_nodes.clear(); + + uint32_t msgid = lparser.ParseMultiTrans(tx_nodes, sline); + + if (msgid != 0) + { + // In this place no messages will captured after, + // so put temp pMsg as last message and null it + AddMessage(pMsg); + pMsg = nullptr; + + // Multi TXs line detected, expand information + auto msg = find_message(dblist.msgs, msgid); + + if (msg != nullptr) + { + for (size_t i = 0; i < tx_nodes.size(); i++) + { + if (std::find(msg->TranS.begin(), msg->TranS.end(), tx_nodes[i]) == msg->TranS.end()) + { + // add another one RX node + msg->TranS.push_back(tx_nodes[i]); + } + } } } } @@ -287,7 +317,7 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->Name = ""; message->RecS.clear(); message->Signals.clear(); - message->Transmitter = ""; + message->TranS.clear(); message->hasPhys = false; message->RollSig = nullptr; message->CsmSig = nullptr; diff --git a/src/types/message.h b/src/types/message.h index 2a1474d..7e729bd 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -108,7 +108,7 @@ typedef struct uint32_t Cycle; // Name of transmitter ECU - std::string Transmitter; + std::vector TranS; // List of ECUs to receive frame std::vector RecS; From 48556b35a6d302afeb38c1bcc86ec034bbc5bb6e Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 10 Oct 2021 21:35:48 +0300 Subject: [PATCH 097/181] Releases updated for v1.7. --- docs/RELEASES.md | 7 +++++++ src/codegen/version.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index f68a3d1..c0d5a4b 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,13 @@ # Changelog All notable changes to this project will be documented in this file. +## v1.7 2021-10-10 +### Fixed +- Potential issue when node is only Receiver (presumably will be skipped in node-util struct) + +### Added +- Support multiple transmitters on single frame (for --node-utils generation variant) + ## v1.6 2021-09-09 ### Added - 4th CLI param '--node-utils' for generation pairs of binutil for each diff --git a/src/codegen/version.h b/src/codegen/version.h index 8c44c29..4a5a1be 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (6) +#define CODEGEN_LIB_VERSION_MIN (7) From 906b274f654cb463f9e9e70bed76293e1b516038 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 25 Oct 2021 20:58:58 +0300 Subject: [PATCH 098/181] Fixed wrong way of rewriting CSM signal. --- src/codegen/c-main-generator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index f41dd7b..00afcb7 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -816,7 +816,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp sgs->msg.CsmSig->Name.c_str(), arrtxt.c_str(), sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); - fwriter->AppendLine(StrPrint(" %s[%d] = %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); + fwriter->AppendLine(StrPrint(" %s[%d] |= %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); } From 3b6b7bcfd2f1d58c3c3de44846678bebb2757b4a Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 1 Nov 2021 22:14:28 +0300 Subject: [PATCH 099/181] Release updated for v1.8. --- docs/RELEASES.md | 5 +++++ src/codegen/version.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index c0d5a4b..7af5d05 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,11 @@ # Changelog All notable changes to this project will be documented in this file. +## v1.7 2021-11-01 +### Fixed +- Issue #6. Incorrect checksum signal assigning. + + ## v1.7 2021-10-10 ### Fixed - Potential issue when node is only Receiver (presumably will be skipped in node-util struct) diff --git a/src/codegen/version.h b/src/codegen/version.h index 4a5a1be..5f74236 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (7) +#define CODEGEN_LIB_VERSION_MIN (8) From 2f22c2e4b9c1cb985239fa3239385d11c5cb428b Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 9 Nov 2021 09:40:12 +0300 Subject: [PATCH 100/181] Fixed: closing comment in -config.h, minor code style. --- src/codegen/c-main-generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 00afcb7..251bd25 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -229,7 +229,7 @@ void CiMainGenerator::Gen_MainSource() fwriter->AppendText( "// Function prototypes to be called each time CAN frame is unpacked\n" - "// FMon function may detect RC, CRC or DLC violation \n"); + "// FMon function may detect RC, CRC or DLC violation\n"); fwriter->AppendLine(StrPrint("#include \"%s-fmon.h\"", fdesc->drvname.c_str()), 2); @@ -387,7 +387,7 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine(" and loaded to payload"); fwriter->AppendLine(""); fwriter->AppendLine(" In unpack function checksum signal is checked with calculated."); - fwriter->AppendLine(" (result may be tested in dedicated Fmon_*** function)."); + fwriter->AppendLine(" (result may be tested in dedicated Fmon_*** function). */"); fwriter->AppendLine(""); fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usecsm_def.c_str()), 2); @@ -728,7 +728,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); + fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); } void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) From 3d3605f62c174165e34282346837f0ad0c43ba93 Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 9 Nov 2021 09:43:55 +0300 Subject: [PATCH 101/181] All sources processed by code style tool. --- src/codegen/c-main-generator.cpp | 8 ++++++++ src/codegen/c-sigprinter.cpp | 6 ++++++ src/codegen/c-util-generator.cpp | 4 ++++ src/codegen/filewriter.cpp | 2 ++ src/helpers/formatter.cpp | 2 ++ src/types/c-expr.h | 7 ++++--- 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 251bd25..6ccdabc 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -121,7 +121,9 @@ void CiMainGenerator::Gen_MainHeader() } if (s.Name.size() > max_sig_name_len) + { max_sig_name_len = s.Name.size(); + } } fwriter->AppendText("\n"); @@ -648,9 +650,13 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); if (sig.IsDoubleSig) + { fwriter->AppendLine(StrPrint(" sigfloat_t %s;", sig.NameFloat.c_str())); + } else + { fwriter->AppendLine(StrPrint(" %s %s;", PrintType((int)sig.Type).c_str(), sig.NameFloat.c_str())); + } fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); } @@ -800,7 +806,9 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp for (size_t i = 0; i < sgs->to_bytes.size(); i++) { if (sgs->to_bytes[i].size() < 2) + { continue; + } fwriter->AppendLine(StrPrint(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str())); } diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index b65c5e4..1e94f78 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -56,9 +56,13 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const retstr = StrPrint("// signal: @%s\n", sig->Name.c_str()); if (sig->IsDoubleSig) + { retstr += StrPrint("#define %s_%s_CovFactor (%f)\n", drvname.c_str(), sig->Name.c_str(), sig->Factor); + } else + { retstr += StrPrint("#define %s_%s_CovFactor (%d)\n", drvname.c_str(), sig->Name.c_str(), (int32_t)sig->Factor); + } retstr += StrPrint("#define %s_%s_toS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), PrintType((uint8_t)sig->Type).c_str()); @@ -183,7 +187,9 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); if (startb > 63) + { startb = 63; + } uint32_t bn = (startb / 8); diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index f461503..56d9008 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -272,9 +272,13 @@ ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vectorType = ConditionalType::Cond; if (lowhalf > 1) + { ret->ConditionExpresion = StrPrint("(_id >= 0x%XU) && (_id < 0x%XU)", list[l]->MsgID, list[(l + lowhalf)]->MsgID); + } else + { ret->ConditionExpresion = StrPrint("_id == 0x%XU", list[l]->MsgID); + } ret->High = FillTreeLevel(list, l, l + lowhalf, true); ret->Low = FillTreeLevel(list, l + lowhalf, h, true); diff --git a/src/codegen/filewriter.cpp b/src/codegen/filewriter.cpp index d9859aa..bb43904 100644 --- a/src/codegen/filewriter.cpp +++ b/src/codegen/filewriter.cpp @@ -40,7 +40,9 @@ void FileWriter::AppendLine(const char* text, int32_t post_empty_lines) AppendText(text); for (int32_t i = 0; i < post_empty_lines; i++) + { AppendText("\n"); + } } diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index 7c54ded..0fb3df4 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -63,7 +63,9 @@ std::string str_trim(std::string s) size_t passed = 0; if (s.empty()) + { return s + '\n'; + } passed = 0; diff --git a/src/types/c-expr.h b/src/types/c-expr.h index 98dfebf..996cca8 100644 --- a/src/types/c-expr.h +++ b/src/types/c-expr.h @@ -1,11 +1,12 @@ -#pragma once +#pragma once #include #include "message.h" #include #include -typedef struct { +typedef struct +{ MessageDescriptor_t msg; @@ -13,7 +14,7 @@ typedef struct { // data bytes to actual signals std::vector to_signals; - // this field contains all expressions for converting + // this field contains all expressions for converting // frame fields to data bytes std::vector to_bytes; From 2938aa6d7db736d8bbc66f24119ba3d3cdadb13a Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 9 Nov 2021 10:14:23 +0300 Subject: [PATCH 102/181] Releases updated for v1.9. --- docs/RELEASES.md | 9 ++++++++- src/codegen/version.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 7af5d05..0c67005 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,7 +1,14 @@ # Changelog All notable changes to this project will be documented in this file. -## v1.7 2021-11-01 +## v1.9 2021-11-09 +### Fixed +- Closing last comment section in -config.h ([@SamFisher940425](https://github.com/SamFisher940425)) +- A few minor style changes in generated code +- All sources of repo processed by code style formatting tool + + +## v1.8 2021-11-01 ### Fixed - Issue #6. Incorrect checksum signal assigning. diff --git a/src/codegen/version.h b/src/codegen/version.h index 5f74236..cab39a3 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (8) +#define CODEGEN_LIB_VERSION_MIN (9) From 4e3f22f51ae3e49a31e3e8584f8ca6b2d909eaef Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 9 Nov 2021 13:58:23 +0300 Subject: [PATCH 103/181] Updated readme. --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 93a1964..ff91a8c 100644 --- a/README.md +++ b/README.md @@ -84,4 +84,11 @@ ----------------------------------------------------------------------------------------------- - *inc - file location have to be added to project include path. \ No newline at end of file + *inc - file location have to be added to project include path. + + ## "--node-utils" option + + If your matrix has strict routing setup, where each CAN device (node) has defined collection + of TX frames as well as defined collection of RX frames the "--node-utils" option may be used. + In this mode all the nodes defined in CAN matrix will be handled as specific ECU and + for each of these specific ECUs dedicated "***-binutil.c/h" pair of source code will be generated From 25eae4133962ba46fe24f740d3ff8836696a41f0 Mon Sep 17 00:00:00 2001 From: Astakhov Andrey Date: Tue, 9 Nov 2021 14:45:37 +0300 Subject: [PATCH 104/181] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ff91a8c..e094346 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,9 @@ ecudb.c / ecudb.h (1) RO / lib - Main driver which has all dbc frames structs / pack functions / unpack functions these source - files preferably to place in lib level directory because they are RO using model and can be + Main driver which has all dbc frames structs / pack functions / unpack functions these + source files preferably to place in lib level directory because they are RO using model + and can be shared among few separated projects. ecudb-fmon.h (2) RO / lib @@ -88,7 +89,7 @@ ## "--node-utils" option - If your matrix has strict routing setup, where each CAN device (node) has defined collection - of TX frames as well as defined collection of RX frames the "--node-utils" option may be used. - In this mode all the nodes defined in CAN matrix will be handled as specific ECU and - for each of these specific ECUs dedicated "***-binutil.c/h" pair of source code will be generated + If your matrix has strict routing setup, where each CAN device (node) has defined collection + of TX frames as well as defined collection of RX frames the "--node-utils" option may be used. + In this mode all the nodes defined in CAN matrix will be handled as specific ECU and + for each of these specific ECUs dedicated "***-binutil.c/h" pair of source code will be generated From f80fb2a7d1f3c92260454977fe896001ac5641c4 Mon Sep 17 00:00:00 2001 From: Astakhov Andrey Date: Tue, 9 Nov 2021 21:50:22 +0300 Subject: [PATCH 105/181] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e094346..6536f75 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ ## Build and run - Below setup works on Ubuntu 20.04 and Windows 10. You need to ensure that your system has - C++ compile and builing toolchain (in my case for windows - VS Studio 2019 Community) + This manual works on Ubuntu 20.04 and Windows 10. You need to ensure that your system has + C++ compile and builing toolchain (**c++17**) To build coderdbc you need to make next steps: @@ -92,4 +92,6 @@ If your matrix has strict routing setup, where each CAN device (node) has defined collection of TX frames as well as defined collection of RX frames the "--node-utils" option may be used. In this mode all the nodes defined in CAN matrix will be handled as specific ECU and - for each of these specific ECUs dedicated "***-binutil.c/h" pair of source code will be generated + for each of these specific ECUs dedicated "###-binutil.c/h" pair of source code will be generated. + + See help output using details. From ebe6786c08b88e7d33eca38c16e846f4d08883d7 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 17 Dec 2021 23:32:32 +0300 Subject: [PATCH 106/181] Fixed extra line for ValTable parsed lines. --- src/parser/dbclineparser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 177938c..b8852ff 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -560,6 +560,12 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) comm->Text += items[valpair + 1] + '\n'; } + if (comm->Text.size() > 0) + { + // remove last '\n' symbol in the string end + comm->Text.pop_back(); + } + // value table params were parse successfully ret = true; } From 8526c87e65a4f334f871a4e688ef84d4a0bed582 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 17 Jan 2022 09:11:02 +0300 Subject: [PATCH 107/181] Enhanced directory structure for generated files. --- src/codegen/c-main-generator.cpp | 13 +++-- src/codegen/fs-creator.cpp | 94 ++++++++++++++++++++++++++++++-- src/codegen/fs-creator.h | 8 +++ src/maincli.cpp | 5 +- 4 files changed, 106 insertions(+), 14 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 6ccdabc..657a5f7 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -393,7 +393,7 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine(""); fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usecsm_def.c_str()), 2); - fwriter->Flush(fdesc->core_c.dir + '/' + fdesc->drvname + "-config.h"); + fwriter->Flush(fdesc->confdir + '/' + fdesc->drvname + "-config.h"); } void CiMainGenerator::Gen_FMonHeader() @@ -427,7 +427,7 @@ separated .c file. If it won't be done the linkage error will happen\n*/", 2); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon);", + fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid);", msg->Name.c_str(), fdesc->drvname.c_str())); } @@ -459,7 +459,8 @@ next generation will completely clear all manually added code (!)\n\ for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon)\n{\n (void)_mon;\n}\n", + fwriter->AppendLine( + StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid)\n{\n (void)_mon;\n (void)msgid;\n}\n", msg->Name.c_str(), fdesc->drvname.c_str())); } @@ -534,7 +535,7 @@ void CiMainGenerator::Gen_CanMonUtil() fwriter->AppendLine("#endif"); fwriter->AppendLine(""); - fwriter->Flush(fdesc->core_c.dir + '/' + "canmonitorutil.h"); + fwriter->Flush(fdesc->incdir + '/' + "canmonitorutil.h"); } void CiMainGenerator::Gen_DbcCodeConf() @@ -554,7 +555,7 @@ void CiMainGenerator::Gen_DbcCodeConf() fwriter->AppendLine("// #define __DEF_{your_driver_name}__"); fwriter->AppendLine(""); - fwriter->Flush(fdesc->core_c.dir + '/' + "dbccodeconf.h"); + fwriter->Flush(fdesc->confdir + '/' + "dbccodeconf.h"); } void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) @@ -730,7 +731,7 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->drvname; - fwriter->AppendLine(StrPrint(" %s(&_m->mon1);", Fmon_func.c_str())); + fwriter->AppendLine(StrPrint(" %s(&_m->mon1, %s_CANID);", Fmon_func.c_str(), sgs->msg.Name.c_str())); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 2); diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 09bb498..d1e81bd 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -7,6 +7,12 @@ static const int32_t kTmpLen = 1024; static char _tmpb[kTmpLen]; +static const char* kLibDir = "/lib"; +static const char* kUsrDir = "/usr"; +static const char* kIncDir = "/inc"; +static const char* kConfDir = "/conf"; +static const char* kUtilDir = "/butl"; + FsCreator::FsCreator() { } @@ -36,10 +42,12 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool } else { + std::string separator = basepath.at(basepath.size() - 1) == '/' ? "" : "/"; + for (int32_t dirnum = 0; dirnum < 1000; dirnum++) { snprintf(_tmpb, kTmpLen, "%03d", dirnum); - work_dir_path = basepath + "/" + _tmpb; + work_dir_path = basepath + separator + _tmpb; if (stat(work_dir_path.c_str(), &info) != 0) { @@ -63,9 +71,44 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool } } } + + FS.libdir = work_dir_path + kLibDir; + + if (std::filesystem::create_directory(FS.libdir)) + { + // ret = false; + } + + FS.usrdir = work_dir_path + kUsrDir; + + if (std::filesystem::create_directory(FS.usrdir)) + { + // ret = false; + } + + FS.incdir = work_dir_path + kIncDir; + + if (std::filesystem::create_directory(FS.incdir)) + { + // ret = false; + } + + FS.confdir = work_dir_path + kConfDir; + + if (std::filesystem::create_directory(FS.confdir)) + { + // ret = false; + } + + FS.utildir = work_dir_path + kUtilDir; + + if (std::filesystem::create_directory(FS.utildir)) + { + // ret = false; + } } - if (ret) + if (true) { // directory valid and exists, set all the values FS.DrvName_orig = drvname; @@ -74,11 +117,11 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.core_h.dir = work_dir_path; FS.core_h.fname = FS.drvname + ".h"; - FS.core_h.fpath = work_dir_path + "/" + FS.core_h.fname; + FS.core_h.fpath = FS.libdir + "/" + FS.core_h.fname; FS.core_c.dir = work_dir_path; FS.core_c.fname = FS.drvname + ".c"; - FS.core_c.fpath = work_dir_path + "/" + FS.core_c.fname; + FS.core_c.fpath = FS.libdir + "/" + FS.core_c.fname; FS.util_h.dir = work_dir_path; FS.util_h.fname = FS.drvname + "-binutil" + ".h"; @@ -90,11 +133,11 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.fmon_h.dir = work_dir_path; FS.fmon_h.fname = FS.drvname + "-fmon.h"; - FS.fmon_h.fpath = work_dir_path + "/" + FS.fmon_h.fname; + FS.fmon_h.fpath = FS.libdir + "/" + FS.fmon_h.fname; FS.fmon_c.dir = work_dir_path; FS.fmon_c.fname = FS.drvname + "-fmon.c"; - FS.fmon_c.fpath = work_dir_path + "/" + FS.fmon_c.fname; + FS.fmon_c.fpath = FS.usrdir + "/" + FS.fmon_c.fname; snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.DRVNAME.c_str()); FS.usebits_def = _tmpb; @@ -131,3 +174,42 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool return ret; } + +std::string FsCreator::CreateSubDir(std::string basepath, std::string sub, bool rw) +{ + std::string ret = basepath; + struct stat info; + + if (basepath.size() == 0 || sub.size() == 0) + { + return ""; + } + + if (basepath.at(basepath.size() - 1) != '/') + { + basepath.append("/"); + } + + basepath.append(sub); + + bool ok = true; + + if (stat(basepath.c_str(), &info) != 0 && rw) + { + // directory already exists and rewrite option is requested + ok = std::filesystem::remove(basepath); + } + + if (!ok) + { + // error on removing directory + return ""; + } + + if (std::filesystem::create_directory(basepath) != 0) + { + ret = ""; + } + + return basepath; +} diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index b5ded9e..d470ae4 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -13,6 +13,12 @@ typedef struct // up case driver name std::string DRVNAME; + std::string libdir; + std::string usrdir; + std::string incdir; + std::string confdir; + std::string utildir; + OutFileDescriptor_t core_h; OutFileDescriptor_t core_c; @@ -49,6 +55,8 @@ class FsCreator { bool PrepareDirectory(std::string drvname, std::string basepath, bool rw, std::string& info); + std::string CreateSubDir(std::string basepath, std::string subdir, bool rm = true); + FsDescriptor_t FS; }; diff --git a/src/maincli.cpp b/src/maincli.cpp index a28c379..a593324 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -72,7 +72,8 @@ int main(int argc, char* argv[]) std::string info(""); - auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), true, info); + // create main destination directory + auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), false, info); if (ret) { @@ -127,7 +128,7 @@ int main(int argc, char* argv[]) { std::string util_name = nodes[node] + "_" + dbc_driver_name; - ret = fscreator->PrepareDirectory(util_name.c_str(), source_files_out_path.c_str(), true, info); + ret = fscreator->PrepareDirectory(util_name.c_str(), fscreator->FS.utildir.c_str(), true, info); MsgsClassification groups; From d1993618192d1b8d9917e9ac40cd58d80965563b Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 17 Jan 2022 21:50:24 +0300 Subject: [PATCH 108/181] Added astyle bin and format script. --- astyle | Bin 0 -> 460872 bytes astyle-all.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100755 astyle create mode 100755 astyle-all.sh diff --git a/astyle b/astyle new file mode 100755 index 0000000000000000000000000000000000000000..496853ea46ad5d7e5c489b4a4f6d4cabdbb0d4b7 GIT binary patch literal 460872 zcmb?^3tUuX`v0JyXxd;&i)BSMw%8R?3`z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G}O zb@+nAN%Nh4hc`LA+hMiCH4Zm8eAMA?ho5%%q{F8iKJD-shtE2E!QrF@PQSyO9Nz7) z+Tj|98yr6BaJR!xJABgNQx2bY_>9A69lqdjQkB#1@Fs_MJFIrN#^DBsk2>7#@Y4>T zboi9RryV}y@L7j1IGnW5>34XO!@C_;J6z*%gTqH1?soWThfg|u%Hh)vpKaa&93 z_NK=-Z+m=Gi0xa$l1H1jZriwJ^N5pmlx=NpZ4`scwY9cO`l_|s_-%bQESFLav)}3&@=A9~Yrmb_`fu1PW)9h}I%dCU zI(ST;l247__9KS2A2I#LZ|zqUihn*yhwX0+Z9gP_?SbO_AA_bQ%03;oA2hUmQ&<}6 zvb^wdQk1{V?Gp^U67={0%( zBgSw0UqjmmTK#zZ|GMM1{_Ax6XT!b^x&U$l;`%=u$7vizlB#G zGX7q7J<;pcPB=^u&`BYZ~wKdPak*8l(j literal 0 HcmV?d00001 diff --git a/astyle-all.sh b/astyle-all.sh new file mode 100755 index 0000000..9f0e45c --- /dev/null +++ b/astyle-all.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# cd {root_of_repo} +# ln -s ${PWD}/utl/format/pre-commit-astyle.sh .git/hooks/pre-commit +# chmod u+x utl/format/pre-commit-astyle.sh + +OPTIONS="--suffix=none \ +--style=allman \ +--attach-inlines \ +--indent-switches \ +--indent-preproc-define \ +--indent=spaces=2 \ +--min-conditional-indent=2 \ +--break-blocks \ +--pad-oper \ +--pad-header \ +--unpad-paren \ +--align-pointer=type \ +--align-reference=type \ +--indent-modifiers \ +--attach-classes \ +--break-after-logical \ +--keep-one-line-statements \ +--indent-after-parens \ +--add-braces \ +--max-code-length=120 \ +--max-continuation-indent=120" + +RETURN=0 +ASTYLE='astyle' +if [ $? -ne 0 ]; then + echo "[!] astyle not installed. Unable to check source file format policy." >&2 + exit 1 +fi + +FILES=`find . | grep -P "^(?!(.*\/thirdparty|.*\/lib\/dbc|.*\/bin|.*\/doc|.*\/utl|.*\/tst|.*\/generated*)).*\.(c|cpp|h)$"` +for FILE in $FILES; do + # compare files + # $ASTYLE $OPTIONS < $FILE | cmp -s $FILE - + # if [ $? -ne 0 ]; then + # echo "[!] $FILE does not respect the agreed coding style." >&2 + # RETURN=1 + # fi + # forcibly format file + $ASTYLE $OPTIONS $FILE + # git add $FILE + echo $FILE +done + +if [ $RETURN -eq 1 ]; then + echo "" >&2 + echo "Make sure you have run astyle with the following options:" >&2 + echo $OPTIONS >&2 +fi + +exit $RETURN From 5d9a5a7b3c40a69d5c4396f58b0b665ff4c7a3f1 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 24 Jan 2022 11:37:19 +0300 Subject: [PATCH 109/181] Changelog editing. --- docs/RELEASES.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 0c67005..8608e51 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,17 +1,26 @@ # Changelog -All notable changes to this project will be documented in this file. + + +## v1.10 2021-01-24 + +### Changed +- Source files placed to separated directories +### Fixed +- Incorrect comments for valuetable's values +- Minor changes +*** ## v1.9 2021-11-09 ### Fixed - Closing last comment section in -config.h ([@SamFisher940425](https://github.com/SamFisher940425)) - A few minor style changes in generated code - All sources of repo processed by code style formatting tool - +*** ## v1.8 2021-11-01 ### Fixed - Issue #6. Incorrect checksum signal assigning. - +*** ## v1.7 2021-10-10 ### Fixed @@ -19,6 +28,7 @@ All notable changes to this project will be documented in this file. ### Added - Support multiple transmitters on single frame (for --node-utils generation variant) +*** ## v1.6 2021-09-09 ### Added @@ -27,27 +37,27 @@ network node defined in DBC ### Fixed - Bad *_Receive() function body when there is only 1 frame in RX struct - +*** ## v1.5 - 2021-08-26 ### Fixed - Fixed 'atoi' with Extended ID on Windows OS ([@shevu](https://github.com/shevu)) - Fixed issue with parsing value table values ([@shevu](https://github.com/shevu)) - Fixed issue with frames where signals goes out of DLC range - +*** ## v1.4 - 2021-07-13 ### Fixed - Removed default into "this is test" - Edited README.md - +*** ## v1.3 - 2021-07-11 ### Added - Printing template canmonitorutil.h - Printing template dbccodeconf.h - Updated driver-config comment text - +*** ## v1.2 - 2021-07-11 ### Added @@ -62,7 +72,7 @@ network node defined in DBC ### Fixed - Fixed some warnings - +*** ## v1.0 - 2021-05-15 ### Added From 57f38633138380c717717be2b6813a06cae2ddc7 Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 1 Feb 2022 22:15:04 +0300 Subject: [PATCH 110/181] Simple fix problem with too long lines. --- src/parser/dbcscanner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 4f9dbe9..76b2820 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -4,7 +4,7 @@ #include #include "../helpers/formatter.h" -#define MAX_LINE 4096 +#define MAX_LINE 4096 * 4 char line[MAX_LINE] = { 0 }; From 770bb9b9ff78b5f70fa29e8099927a0dc5941ecd Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 1 Feb 2022 22:15:23 +0300 Subject: [PATCH 111/181] Added filter for local test infrustructure. --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 56d1937..13b13c1 100644 --- a/.gitignore +++ b/.gitignore @@ -339,4 +339,6 @@ ASALocalRun/ .localhistory/ # BeatPulse healthcheck temp database -healthchecksdb \ No newline at end of file +healthchecksdb + +loc-test* From 196b17d24bc12275dbe5f62383bb9475eaf9609c Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 2 Feb 2022 00:02:39 +0300 Subject: [PATCH 112/181] Fixed error in with bitutil wrong dir generation. --- src/codegen/fs-creator.cpp | 54 +++++++++++++++++++------------------- src/maincli.cpp | 11 +++++--- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index d1e81bd..04eb5d4 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -71,41 +71,41 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool } } } + } - FS.libdir = work_dir_path + kLibDir; + FS.libdir = work_dir_path + kLibDir; - if (std::filesystem::create_directory(FS.libdir)) - { - // ret = false; - } + if (std::filesystem::create_directory(FS.libdir)) + { + // ret = false; + } - FS.usrdir = work_dir_path + kUsrDir; + FS.usrdir = work_dir_path + kUsrDir; - if (std::filesystem::create_directory(FS.usrdir)) - { - // ret = false; - } + if (std::filesystem::create_directory(FS.usrdir)) + { + // ret = false; + } - FS.incdir = work_dir_path + kIncDir; + FS.incdir = work_dir_path + kIncDir; - if (std::filesystem::create_directory(FS.incdir)) - { - // ret = false; - } + if (std::filesystem::create_directory(FS.incdir)) + { + // ret = false; + } - FS.confdir = work_dir_path + kConfDir; + FS.confdir = work_dir_path + kConfDir; - if (std::filesystem::create_directory(FS.confdir)) - { - // ret = false; - } + if (std::filesystem::create_directory(FS.confdir)) + { + // ret = false; + } - FS.utildir = work_dir_path + kUtilDir; + FS.utildir = work_dir_path + kUtilDir; - if (std::filesystem::create_directory(FS.utildir)) - { - // ret = false; - } + if (std::filesystem::create_directory(FS.utildir)) + { + // ret = false; } if (true) @@ -125,11 +125,11 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.util_h.dir = work_dir_path; FS.util_h.fname = FS.drvname + "-binutil" + ".h"; - FS.util_h.fpath = work_dir_path + "/" + FS.util_h.fname; + FS.util_h.fpath = FS.utildir + "/" + FS.util_h.fname; FS.util_c.dir = work_dir_path; FS.util_c.fname = FS.drvname + "-binutil" + ".c"; - FS.util_c.fpath = work_dir_path + "/" + FS.util_c.fname; + FS.util_c.fpath = FS.utildir + "/" + FS.util_c.fname; FS.fmon_h.dir = work_dir_path; FS.fmon_h.fname = FS.drvname + "-fmon.h"; diff --git a/src/maincli.cpp b/src/maincli.cpp index a593324..c046e12 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -128,7 +128,14 @@ int main(int argc, char* argv[]) { std::string util_name = nodes[node] + "_" + dbc_driver_name; - ret = fscreator->PrepareDirectory(util_name.c_str(), fscreator->FS.utildir.c_str(), true, info); + fscreator->FS.util_c.dir = fscreator->FS.utildir; + fscreator->FS.util_h.dir = fscreator->FS.utildir; + + fscreator->FS.util_h.fname = util_name + ".h"; + fscreator->FS.util_h.fpath = fscreator->FS.utildir + "/" + fscreator->FS.util_h.fname; + + fscreator->FS.util_c.fname = util_name + ".c"; + fscreator->FS.util_c.fpath = fscreator->FS.utildir + "/" + fscreator->FS.util_c.fname; MsgsClassification groups; @@ -161,8 +168,6 @@ int main(int argc, char* argv[]) } else { - ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), (source_files_out_path).c_str(), true, info); - MsgsClassification groups; for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) From 7d42aec031c6e8650d87d8a09f060c9d25a4a13b Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 2 Feb 2022 09:28:07 +0300 Subject: [PATCH 113/181] Explicit cast from int64 to uint32. --- src/parser/dbclineparser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index b8852ff..b866fe3 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -151,7 +151,7 @@ uint32_t DbcLineParser::ParseMultiTrans(std::vector& outnodes, std: if (chunks.size() >= 3 && chunks[0] == "BO_TX_BU_") { - ret = clear_msgid(atoll(chunks[1].c_str())); + ret = clear_msgid(static_cast(atoll(chunks[1].c_str()))); if (ret != 0) { @@ -453,7 +453,7 @@ bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line) // 1 CM_ marker // 2 target (message or signal) // 3 msg id - uint32_t id = static_cast((atoll(meta[2].c_str()))); + uint32_t id = static_cast(atoll(meta[2].c_str())); // clear message id from high 3 bits cm->MsgId = clear_msgid(id); @@ -510,7 +510,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s if (items.size() > 4 && items[1] == "GenMsgCycleTime" && items[2] == "BO_") { attr->Type = AttributeType::CycleTime; - attr->MsgId = clear_msgid(atoll(items[3].c_str())); + attr->MsgId = clear_msgid(static_cast(atoll(items[3].c_str()))); // read value of ms of cycle time for the current message attr->Value = atoi(items[4].c_str()); ret = true; @@ -549,7 +549,7 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) if ((items.size() >= 3) && (items.back() == ";") && (items.size() % 2 == 0)) { - comm->MsgId = (clear_msgid(atoll(items[1].c_str()))); + comm->MsgId = (clear_msgid(static_cast(atoll(items[1].c_str())))); comm->SigName = items[2]; comm->Text = ""; comm->ca_target = CommentTarget::Signal; From f470bbc18ba6b9310f92a479d7b29388b4ee4576 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 2 Feb 2022 11:18:09 +0300 Subject: [PATCH 114/181] Change way of passing calling arguments. --- src/maincli.cpp | 170 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 140 insertions(+), 30 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index c046e12..b012ad5 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "parser/dbcscanner.h" #include "codegen/c-main-generator.h" #include "codegen/c-util-generator.h" @@ -16,17 +17,6 @@ char verstr[128] = {0}; -const char* helptext = - "https://github.com/astand/c-coderdbc (project source code)\n\n" - "https://coderdbc.com (web application)\n\n" - "To use utility you need to provide 3 arguments:\n\n" - "1. dbc file path\n" - "2. directory for generated source files (existable)\n" - "3. prefix (driver name) which will be used for naming dirver parts\n" - "4. (optional) --node-utils will generate specific pairs of binutils drivers for each node" - " which is either transmitter or receiver of at least one frame from dbc.\n\n" - "Usage example:\n\n./dbccoder /home/user/docs/driveshaft.dbc /home/user/docs/gen/ drivedb --node-utils\n\n"; - DbcScanner* scanner; CiMainGenerator* cigen; CiUtilGenerator* ciugen; @@ -36,27 +26,117 @@ std::string source_files_out_path; std::string dbc_file_path; std::string dbc_driver_name; +typedef struct +{ + std::string arg; + std::string param; +} ParamPair_t; + +void PrintUsage(); + +std::vector getoptions(int argc, char** argv) +{ + std::vector ret; + + ParamPair_t pair; + + if (argc <= 0) + { + return ret; + } + + for (int i = 0; i < argc; i++) + { + // key found (must start with '-' (e.g. '-dbc')) + if (argv[i][0] == '-') + { + pair.arg = std::string(argv[i]); + pair.param.clear(); + + if (i + 1 < argc && argv[i + 1][0] != '-') + { + // key param + pair.param = std::string(argv[i + 1]); + // unlooped i incremention + ++i; + } + + ret.push_back(pair); + } + } + + return ret; +} + int main(int argc, char* argv[]) { - scanner = new DbcScanner; - cigen = new CiMainGenerator; - ciugen = new CiUtilGenerator; - fscreator = new FsCreator; + const std::string arg_ops = "dbc:out:rxnodes:rw"; + + bool err = false; + bool dbc_ok = false; + bool path_ok = false; + bool drvname_ok = false; + bool rewrite_src = false; + bool gen_nodeutils = false; + bool help = false; - std::snprintf(verstr, 128, "\nDbccoder v%u.%u\n\n", CODEGEN_LIB_VERSION_MAJ, CODEGEN_LIB_VERSION_MIN); - std::cout << verstr; + std::vector opts = getoptions(argc, argv); + + if (opts.size() < 3) + { + PrintUsage(); + } - if (argc >= MIN_ARGC_NUM) + for (size_t i = 0; i < opts.size(); i++) { + if (opts[i].arg == "-dbc") + { + dbc_file_path = opts[i].param; + dbc_ok = true; + } + else if (opts[i].arg == "-out") + { + source_files_out_path = opts[i].param; + path_ok = true; + } + else if (opts[i].arg == "-drvname") + { + dbc_driver_name = opts[i].param; + drvname_ok = true; + } + else if (opts[i].arg == "-rw") + { + rewrite_src = true; + } + else if (opts[i].arg == "-nodeutils") + { + gen_nodeutils = true; + } + else if (opts[i].arg == "-help") + { + help = true; + } + } + + if (help) + { + PrintUsage(); + return 0; + } + + if (drvname_ok && path_ok && dbc_ok) + { + + scanner = new DbcScanner; + cigen = new CiMainGenerator; + ciugen = new CiUtilGenerator; + fscreator = new FsCreator; + std::ifstream reader; - // copy dbc file name to string variable - dbc_file_path = argv[1]; - source_files_out_path = argv[2]; - dbc_driver_name = argv[3]; - std::cout << "dbc file : " << argv[1] << std::endl; - std::cout << "gen path : " << argv[2] << std::endl; - std::cout << "drv name : " << argv[3] << std::endl; + std::cout << "dbc file : " << dbc_file_path << std::endl; + std::cout << "gen path : " << source_files_out_path << std::endl; + std::cout << "drv name : " << dbc_driver_name << std::endl; if (std::filesystem::exists(dbc_file_path) == false) { @@ -73,7 +153,7 @@ int main(int argc, char* argv[]) std::string info(""); // create main destination directory - auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), false, info); + auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), rewrite_src, info); if (ret) { @@ -86,11 +166,9 @@ int main(int argc, char* argv[]) #if defined (GEN_UTIL_CODE) - std::string node_util = "--node-utils"; - // check if option --node-utils is requested, when requested binutil generation // wiil be performed on each node from DBC file in accordance to its RX / TX subscription - if (argc == MAX_ARGC_NUM && node_util.compare(argv[4]) == 0) + if (gen_nodeutils) { std::vector nodes; @@ -186,6 +264,38 @@ int main(int argc, char* argv[]) } else { - std::cout << helptext; + PrintUsage(); } } + +void PrintUsage() +{ + std::cout << "C-CoderDbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; + std::cout << "Project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; + std::cout << "Free web application:\thttps://coderdbc.com" << std::endl; + std::cout << std::endl; + std::cout << "Usage rules." << std::endl; + std::cout << "To use code generator you need to provide three obligatory arguments:" << std::endl; + + std::cout << " -dbc\t\t path to dbc file" << std::endl; + std::cout << " -out\t\t directory for generated source files." << std::endl; + std::cout << " \t\t (directory have to be created in advance)" << std::endl; + std::cout << " -drvname\t driver name - will be used for naming driver parts" << std::endl; + std::cout << std::endl; + std::cout << "Optional parameters:" << std::endl; + std::cout << " -nodeutils\t will generate specific pairs of binutils drivers for each node" << std::endl; + std::cout << " -rw\t\t by default each new generation with previously used params" << std::endl; + std::cout << " \t\t will create new directory with source files (000, 001, 002, ... etc)" << std::endl; + std::cout << " \t\t '-rw' option enables rewriting: all source files previously generated" << std::endl; + std::cout << " \t\t will be replaced by new ones." << std::endl; + std::cout << std::endl; + + std::cout << "Examples:" << std::endl; + std::cout << std::endl; + + std::cout << + "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" << std::endl; + + std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb" << std::endl; + std::cout << std::endl; +} From b29a47aa52ffab2aa67a79602d00c69dbb3191d5 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 2 Feb 2022 11:18:16 +0300 Subject: [PATCH 115/181] Version update (v2.0). --- src/codegen/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/version.h b/src/codegen/version.h index cab39a3..00ab256 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -2,5 +2,5 @@ #include -#define CODEGEN_LIB_VERSION_MAJ (1) -#define CODEGEN_LIB_VERSION_MIN (9) +#define CODEGEN_LIB_VERSION_MAJ (2) +#define CODEGEN_LIB_VERSION_MIN (0) From bdef03ca8411ab1fab2cafdc48834eb3827eae24 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 2 Feb 2022 11:25:02 +0300 Subject: [PATCH 116/181] Minor fixes. --- src/maincli.cpp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index b012ad5..8f3d74d 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -82,11 +82,6 @@ int main(int argc, char* argv[]) std::vector opts = getoptions(argc, argv); - if (opts.size() < 3) - { - PrintUsage(); - } - for (size_t i = 0; i < opts.size(); i++) { if (opts[i].arg == "-dbc") @@ -270,32 +265,31 @@ int main(int argc, char* argv[]) void PrintUsage() { - std::cout << "C-CoderDbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; - std::cout << "Project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; - std::cout << "Free web application:\thttps://coderdbc.com" << std::endl; + std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; + std::cout << "project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; + std::cout << "free web application:\thttps://coderdbc.com" << std::endl; std::cout << std::endl; - std::cout << "Usage rules." << std::endl; - std::cout << "To use code generator you need to provide three obligatory arguments:" << std::endl; + std::cout << "required parameters:" << std::endl; std::cout << " -dbc\t\t path to dbc file" << std::endl; - std::cout << " -out\t\t directory for generated source files." << std::endl; - std::cout << " \t\t (directory have to be created in advance)" << std::endl; + std::cout << " -out\t\t directory for generated source files (must be pre-created)" << std::endl; std::cout << " -drvname\t driver name - will be used for naming driver parts" << std::endl; std::cout << std::endl; - std::cout << "Optional parameters:" << std::endl; + std::cout << "optional parameters:" << std::endl; std::cout << " -nodeutils\t will generate specific pairs of binutils drivers for each node" << std::endl; std::cout << " -rw\t\t by default each new generation with previously used params" << std::endl; - std::cout << " \t\t will create new directory with source files (000, 001, 002, ... etc)" << std::endl; + std::cout << " \t\t will create new sud-directory with source files (000, 001, ... etc)" << std::endl; std::cout << " \t\t '-rw' option enables rewriting: all source files previously generated" << std::endl; - std::cout << " \t\t will be replaced by new ones." << std::endl; + std::cout << " \t\t will be replaced by new ones" << std::endl; std::cout << std::endl; - std::cout << "Examples:" << std::endl; + std::cout << "examples:" << std::endl; std::cout << std::endl; std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" << std::endl; + std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils" << std::endl; std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb" << std::endl; std::cout << std::endl; } From 83d894d3aaea9e6f2c5835d2505dac9304b7fa42 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 2 Feb 2022 16:10:35 +0300 Subject: [PATCH 117/181] Updated docs. --- README.md | 4 ++-- docs/RELEASES.md | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6536f75..cd17837 100644 --- a/README.md +++ b/README.md @@ -87,10 +87,10 @@ *inc - file location have to be added to project include path. - ## "--node-utils" option + ## "-nodeutils" option If your matrix has strict routing setup, where each CAN device (node) has defined collection - of TX frames as well as defined collection of RX frames the "--node-utils" option may be used. + of TX frames as well as defined collection of RX frames the "-nodeutils" option may be used. In this mode all the nodes defined in CAN matrix will be handled as specific ECU and for each of these specific ECUs dedicated "###-binutil.c/h" pair of source code will be generated. diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 8608e51..d9ab5e4 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,19 @@ # Changelog +## v2.0 2022-02-02 + +### Added +- '-rw' and '-nodeutils' (renamed '--node-utils') options + +### Changed +- Argument passing way to view: 'key' - 'value' + +### Fixed +- Minor warnings +- Bad source files placement for -rw key +*** + ## v1.10 2021-01-24 ### Changed From ad43ded46a38eeccf0a52a67fcbf4bc51a501010 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 19 Feb 2022 23:16:34 +0300 Subject: [PATCH 118/181] Target signals type selection optimized. --- src/codegen/c-main-generator.cpp | 4 +- src/codegen/c-sigprinter.cpp | 2 +- src/parser/dbclineparser.cpp | 144 +++++++++++++++---------------- src/types/message.h | 6 +- 4 files changed, 75 insertions(+), 81 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 657a5f7..64cc3d3 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -581,7 +581,7 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi std::string dtype = ""; - dtype += " " + PrintType((int)sig.Type) + " " + sig.Name; + dtype += " " + PrintType((int)sig.TypeRo) + " " + sig.Name; if (bits && (sig.LengthBit < 8)) { @@ -656,7 +656,7 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi } else { - fwriter->AppendLine(StrPrint(" %s %s;", PrintType((int)sig.Type).c_str(), sig.NameFloat.c_str())); + fwriter->AppendLine(StrPrint(" %s %s;", PrintType((int)sig.TypePhys).c_str(), sig.NameFloat.c_str())); } fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 1e94f78..4e44a29 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -65,7 +65,7 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const } retstr += StrPrint("#define %s_%s_toS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), - PrintType((uint8_t)sig->Type).c_str()); + PrintType((uint8_t)sig->TypeRo).c_str()); if (sig->IsDoubleSig) { diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index b866fe3..b26f710 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -262,7 +262,7 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // value_type = '+' | '-'; (*+= unsigned, -=signed*) sig->Signed = (valpart[2].find('-') == std::string::npos) ? 0 : 1; - sig->Type = GetSigType(sig); + GetSigType(sig); // mark all simple signals to make using them easier if (!sig->IsDoubleSig && (sig->Factor == 1) && (sig->Offset == 0)) @@ -312,80 +312,89 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) uint64_t max_v = 0; - if (!sig->IsDoubleSig) + // 1 step is to detect type of _ro + int64_t max_abs, min_abs; + + int64_t addon = 0; + + if (sig->Signed) { - int64_t i_offset = (int64_t)sig->Offset; - int64_t i_factor = (int64_t)sig->Factor; + addon = 1; + max_abs = static_cast( (std::pow(2, sig->LengthBit - 1) - 1) ); + min_abs = (max_abs + 1) * -1; - // for this case physical value needs to be allowed to - // fit inside field type - if (sig->Signed) + for (size_t i = 0; i < 4; i++) { - // physical_value = raw_value * factor + offset - // 1 get the max value for the positive part - max_v = (uint64_t)(std::pow(2, sig->LengthBit - 1)); - // 2 scale to max value - max_v *= i_factor; - - // 3 add offset - // factor affects on difference between min and max values - // abs(max_neg)-(max_pos) = sig->Factor; - // so if offset == Factor - if (sig->Offset > (int32_t)(sig->Factor - 1)) - { - // positive value less then - max_v = (max_v + i_offset - ((int64_t)sig->Factor)); - } - else + sig->TypeRo = (SigType)(i); + + if (max_abs <= __maxsignedvals[i]) { - max_v = (max_v - i_offset) - 1; + break; } + } + } + else + { + max_abs = static_cast( (std::pow(2, sig->LengthBit) - 1) ); + min_abs = 0; - for (uint8_t i = 0; i < 4; i++) + for (size_t i = 0; i < 4; i++) + { + sig->TypeRo = (SigType)(i + 4); + + if (max_abs <= __maxunsigvalues[i]) { - if (max_v <= (__maxsignedvals[i])) - { - ret = (SigType)(i + (is_unsigned * 4)); - break; - } + break; } } - else - { - is_unsigned = 1; + } - max_v = (uint64_t)(std::pow(2, sig->LengthBit)) - 1; + if (sig->IsSimpleSig) + { + // the most simple case, TypePhys is the same as TypeRo + sig->TypePhys = sig->TypeRo; + } - max_v *= (int32_t)sig->Factor; + else if (sig->IsDoubleSig == false) + { + int64_t i_offset = (int64_t)sig->Offset; + int64_t i_factor = (int64_t)sig->Factor; - if (sig->Offset >= 0) + // get max and min values with applied factor and offset (physical values) + max_abs = max_abs * i_factor + i_offset; + min_abs = min_abs * i_factor + i_offset; + + if (sig->Signed || max_abs < 0 || min_abs < 0) + { + // phys value must be signed + uint64_t max_v = std::abs(max_abs); + uint64_t addon = 0; + + if ((max_v + 1) < std::abs(min_abs)) { - // when offset positive the max physical value is got just - // adding roffset value - max_v += roffset; + // low part is main + addon = 1; + max_v = std::abs(min_abs); } - else + + for (size_t i = 0; i < 4; i++) { - is_unsigned = 0; - // this code must determmine which part of range is larger - positive or negative - // the largest part will define which sig type will be used for signal - // roffset here - negative value - - // max positive value fot the LenBits if it would have signed type - uint64_t maxpos = (uint64_t)(std::pow(2, sig->LengthBit) - 1); - // max negative value - uint64_t maxneg = (uint64_t)(std::abs(roffset)); - - max_v = std::max(maxpos, maxneg); - // mul 2 for using unsinged compare levels (int8_t (127) like uint8_t (255)) - max_v *= 2; - } + sig->TypePhys = (SigType)(i); + if (max_v <= __maxsignedvals[i] + addon) + { + break; + } + } + } + else + { + // phys value must be unsigned for (uint8_t i = 0; i < 4; i++) { - if (max_v <= (__maxunsigvalues[i])) + if ((uint64_t)max_abs <= __maxunsigvalues[i]) { - ret = (SigType)(i + (is_unsigned * 4)); + sig->TypePhys = (SigType)(i + 4); break; } } @@ -393,28 +402,11 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) } else { - // this type definition is simple (without - // additional type-expanded operations inside - // main driver, so to determine type simple - // operations is needed - max_v = (uint64_t)(std::pow(2, sig->LengthBit) - 1); - - if (!sig->Signed) - { - is_unsigned = 1; - } - - for (uint8_t i = 0; i < 4; i++) - { - if (max_v <= __maxunsigvalues[i]) - { - ret = (SigType)(i + (is_unsigned * 4)); - break; - } - } + // in this case TypePhys will be (sigfloat_t), so + // there is no necessity to determine physical signal type } - return ret; + return sig->TypeRo; } bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line) diff --git a/src/types/message.h b/src/types/message.h index 7e729bd..bd33f9c 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -58,7 +58,7 @@ typedef struct // this flag shows if the signal has factor = 1 and offset = 0 // to reject any sigfloat or "toS"/"fromS" operations - // this only when : IsDoubleSig == true || ((s.Factor != 1) || (s.Offset != 0) + // SimpleSig is true when: IsDoubleSig == false && Factor == 1 && Offset == 0 bool IsSimpleSig; double Factor; @@ -71,7 +71,9 @@ typedef struct bool Signed; - SigType Type; + SigType TypeRo; + + SigType TypePhys; std::vector SigToByte; From 634b4b75f2e6c19ee2d9dab18945a7e6af4fec82 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 19 Feb 2022 23:17:11 +0300 Subject: [PATCH 119/181] Added signature extension for signed signal types. --- src/codegen/c-main-generator.cpp | 25 ++++++++++++++++++++++++- src/parser/dbclineparser.cpp | 4 ++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 64cc3d3..94e68fe 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -11,6 +11,19 @@ #include "c-main-generator.h" +const char* ext_sig_func_name = "__ext_sig__"; + +const char* extend_func_body = + "// To compile this function you need to typedef 'bitext_t' and 'ubitext_t'\n" + "// globally in @dbccodeconf.h or locally in 'dbcdrvname'-config.h\n" + "// Type selection may affect common performance. Most useful types are:\n" + "// bitext_t : int64_t and ubitext_t : uint64_t\n" + "static bitext_t %s( ubitext_t val, uint8_t bits )\n" + "{\n" + " ubitext_t const m = 1u << (bits - 1);\n" + " return (val ^ m) - m;\n" + "}\n"; + CiMainGenerator::CiMainGenerator() { sigprt = new CSigPrinter; @@ -237,6 +250,8 @@ void CiMainGenerator::Gen_MainSource() fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 3); + fwriter->AppendLine(StrPrint(extend_func_body, ext_sig_func_name), 1); + // for each message 3 functions must be defined - 1 unpack function, // 2: pack with raw signature // 3: pack with canstruct @@ -672,7 +687,15 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) // for code shortening const char* sname = sgs->msg.Signals[num].Name.c_str(); - fwriter->AppendLine(StrPrint(" _m->%s = %s;", sname, expr.c_str())); + if (sgs->msg.Signals[num].Signed) + { + fwriter->AppendLine(StrPrint(" _m->%s = %s(( %s ), %d);", + sname, ext_sig_func_name, expr.c_str(), (int32_t)sgs->msg.Signals[num].LengthBit)); + } + else + { + fwriter->AppendLine(StrPrint(" _m->%s = %s;", sname, expr.c_str())); + } // print sigfloat conversion if (!sgs->msg.Signals[num].IsSimpleSig) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index b26f710..b080752 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -320,7 +320,7 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) if (sig->Signed) { addon = 1; - max_abs = static_cast( (std::pow(2, sig->LengthBit - 1) - 1) ); + max_abs = static_cast((std::pow(2, sig->LengthBit - 1) - 1)); min_abs = (max_abs + 1) * -1; for (size_t i = 0; i < 4; i++) @@ -335,7 +335,7 @@ SigType DbcLineParser::GetSigType(SignalDescriptor_t* sig) } else { - max_abs = static_cast( (std::pow(2, sig->LengthBit) - 1) ); + max_abs = static_cast((std::pow(2, sig->LengthBit) - 1)); min_abs = 0; for (size_t i = 0; i < 4; i++) From 75b5813d1c0b6c4f76e7b5ac3ace53e2d5676768 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 19 Feb 2022 23:21:41 +0300 Subject: [PATCH 120/181] Changelog editing. --- docs/RELEASES.md | 10 ++++++++++ src/codegen/version.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index d9ab5e4..72dbe19 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,6 +1,16 @@ # Changelog +## v2.1 2022-02-19 + +### Fixed +- Some times incorrect _ro and _phys type deduction + +### Added +- Sign extension for signal which have signed type ([@2Black2](https://github.com/2Black2)) + +--- + ## v2.0 2022-02-02 ### Added diff --git a/src/codegen/version.h b/src/codegen/version.h index 00ab256..3f25c17 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (0) +#define CODEGEN_LIB_VERSION_MIN (1) From 45209db1ba68e615654e53bfbe79251aa5902881 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 11 Mar 2022 22:50:17 +0300 Subject: [PATCH 121/181] Gitignore and gitattribute unused content removed. --- .gitattributes | 62 --------- .gitignore | 342 ------------------------------------------------- 2 files changed, 404 deletions(-) diff --git a/.gitattributes b/.gitattributes index 1ff0c42..176a458 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,63 +1 @@ -############################################################################### -# Set default behavior to automatically normalize line endings. -############################################################################### * text=auto - -############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line -############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore index 13b13c1..d1f2963 100644 --- a/.gitignore +++ b/.gitignore @@ -1,344 +1,2 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Oo]bj/ -[Ll]og/ -*.o -*.so -*.out **/build -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- Backup*.rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - loc-test* From 323d2a838cd41d3f2c426b49d241832be1ce8a64 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 11 Mar 2022 23:06:29 +0300 Subject: [PATCH 122/181] Added test DBC CAN matrix and generation scripts. --- run-test-gen.bat | 2 + run-test-gen.sh | 1 + test/gencode/butl/BCM_testdb.c | 26 ++ test/gencode/butl/BCM_testdb.h | 43 +++ test/gencode/butl/BMS_testdb.c | 30 ++ test/gencode/butl/BMS_testdb.h | 42 +++ test/gencode/butl/EPS_testdb.c | 8 + test/gencode/butl/EPS_testdb.h | 31 ++ test/gencode/butl/ESP_testdb.c | 22 ++ test/gencode/butl/ESP_testdb.h | 39 +++ test/gencode/conf/dbccodeconf.h | 14 + test/gencode/conf/testdb-config.h | 109 ++++++ test/gencode/inc/canmonitorutil.h | 63 ++++ test/gencode/lib/testdb-fmon.h | 34 ++ test/gencode/lib/testdb.c | 534 ++++++++++++++++++++++++++++++ test/gencode/lib/testdb.h | 510 ++++++++++++++++++++++++++++ test/gencode/usr/testdb-fmon.c | 46 +++ test/testdb.dbc | 138 ++++++++ 18 files changed, 1692 insertions(+) create mode 100755 run-test-gen.bat create mode 100755 run-test-gen.sh create mode 100644 test/gencode/butl/BCM_testdb.c create mode 100644 test/gencode/butl/BCM_testdb.h create mode 100644 test/gencode/butl/BMS_testdb.c create mode 100644 test/gencode/butl/BMS_testdb.h create mode 100644 test/gencode/butl/EPS_testdb.c create mode 100644 test/gencode/butl/EPS_testdb.h create mode 100644 test/gencode/butl/ESP_testdb.c create mode 100644 test/gencode/butl/ESP_testdb.h create mode 100644 test/gencode/conf/dbccodeconf.h create mode 100644 test/gencode/conf/testdb-config.h create mode 100644 test/gencode/inc/canmonitorutil.h create mode 100644 test/gencode/lib/testdb-fmon.h create mode 100644 test/gencode/lib/testdb.c create mode 100644 test/gencode/lib/testdb.h create mode 100644 test/gencode/usr/testdb-fmon.c create mode 100755 test/testdb.dbc diff --git a/run-test-gen.bat b/run-test-gen.bat new file mode 100755 index 0000000..0e4d466 --- /dev/null +++ b/run-test-gen.bat @@ -0,0 +1,2 @@ +start "coder" "build/Release/coderdbc.exe" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw +pause \ No newline at end of file diff --git a/run-test-gen.sh b/run-test-gen.sh new file mode 100755 index 0000000..86bea7f --- /dev/null +++ b/run-test-gen.sh @@ -0,0 +1 @@ +./build/coderdbc -dbc test/testdb.dbc -out test/gencode -drvname testdb -nodeutils -rw \ No newline at end of file diff --git a/test/gencode/butl/BCM_testdb.c b/test/gencode/butl/BCM_testdb.c new file mode 100644 index 0000000..a62802f --- /dev/null +++ b/test/gencode/butl/BCM_testdb.c @@ -0,0 +1,26 @@ +#include "BCM_testdb.h" + +#ifdef __DEF_TESTDB__ + +testdb_rx_t testdb_rx; + +testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +uint32_t testdb_Receive(testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) +{ + uint32_t recid = 0; + if (_id == 0x360U) { + recid = Unpack_FLT_TEST_1_testdb(&(_m->FLT_TEST_1), _d, dlc_); + } else { + if (_id == 0x777U) { + recid = Unpack_SIG_TEST_1_testdb(&(_m->SIG_TEST_1), _d, dlc_); + } else if (_id == 0x1FFFFFF6U) { + recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); + } + } + + return recid; +} + diff --git a/test/gencode/butl/BCM_testdb.h b/test/gencode/butl/BCM_testdb.h new file mode 100644 index 0000000..ff116e0 --- /dev/null +++ b/test/gencode/butl/BCM_testdb.h @@ -0,0 +1,43 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +// This version definition comes from main driver version and +// can be compared in user code space for strict compatibility test +#define VER_TESTDB_MAJ (1U) +#define VER_TESTDB_MIN (10U) + +typedef struct +{ + FLT_TEST_1_t FLT_TEST_1; + SIG_TEST_1_t SIG_TEST_1; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} testdb_rx_t; + +typedef struct +{ + UTEST_2_t UTEST_2; + EMPTY_0_t EMPTY_0; + UTEST_3_t UTEST_3; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} testdb_tx_t; + +uint32_t testdb_Receive(testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); + +#ifdef __DEF_TESTDB__ + +extern testdb_rx_t testdb_rx; + +extern testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/butl/BMS_testdb.c b/test/gencode/butl/BMS_testdb.c new file mode 100644 index 0000000..60526d4 --- /dev/null +++ b/test/gencode/butl/BMS_testdb.c @@ -0,0 +1,30 @@ +#include "BMS_testdb.h" + +#ifdef __DEF_TESTDB__ + +testdb_rx_t testdb_rx; + +testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +uint32_t testdb_Receive(testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) +{ + uint32_t recid = 0; + if ((_id >= 0x14DU) && (_id < 0x22BU)) { + if (_id == 0x14DU) { + recid = Unpack_UTEST_2_testdb(&(_m->UTEST_2), _d, dlc_); + } else if (_id == 0x160U) { + recid = Unpack_EMPTY_0_testdb(&(_m->EMPTY_0), _d, dlc_); + } + } else { + if (_id == 0x22BU) { + recid = Unpack_UTEST_3_testdb(&(_m->UTEST_3), _d, dlc_); + } else if (_id == 0x1FFFFFF6U) { + recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); + } + } + + return recid; +} + diff --git a/test/gencode/butl/BMS_testdb.h b/test/gencode/butl/BMS_testdb.h new file mode 100644 index 0000000..26b2c31 --- /dev/null +++ b/test/gencode/butl/BMS_testdb.h @@ -0,0 +1,42 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +// This version definition comes from main driver version and +// can be compared in user code space for strict compatibility test +#define VER_TESTDB_MAJ (1U) +#define VER_TESTDB_MIN (10U) + +typedef struct +{ + UTEST_2_t UTEST_2; + EMPTY_0_t EMPTY_0; + UTEST_3_t UTEST_3; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} testdb_rx_t; + +typedef struct +{ + EMPTY_0_t EMPTY_0; + FLT_TEST_1_t FLT_TEST_1; +} testdb_tx_t; + +uint32_t testdb_Receive(testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); + +#ifdef __DEF_TESTDB__ + +extern testdb_rx_t testdb_rx; + +extern testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/butl/EPS_testdb.c b/test/gencode/butl/EPS_testdb.c new file mode 100644 index 0000000..735e2c9 --- /dev/null +++ b/test/gencode/butl/EPS_testdb.c @@ -0,0 +1,8 @@ +#include "EPS_testdb.h" + +#ifdef __DEF_TESTDB__ + +testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + diff --git a/test/gencode/butl/EPS_testdb.h b/test/gencode/butl/EPS_testdb.h new file mode 100644 index 0000000..c395ffc --- /dev/null +++ b/test/gencode/butl/EPS_testdb.h @@ -0,0 +1,31 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +// This version definition comes from main driver version and +// can be compared in user code space for strict compatibility test +#define VER_TESTDB_MAJ (1U) +#define VER_TESTDB_MIN (10U) + +// There is no any RX mapped massage. + +typedef struct +{ + SIG_TEST_1_t SIG_TEST_1; +} testdb_tx_t; + +#ifdef __DEF_TESTDB__ + +extern testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/butl/ESP_testdb.c b/test/gencode/butl/ESP_testdb.c new file mode 100644 index 0000000..51c441e --- /dev/null +++ b/test/gencode/butl/ESP_testdb.c @@ -0,0 +1,22 @@ +#include "ESP_testdb.h" + +#ifdef __DEF_TESTDB__ + +testdb_rx_t testdb_rx; + +testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +uint32_t testdb_Receive(testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) +{ + uint32_t recid = 0; + if (_id == 0x14DU) { + recid = Unpack_UTEST_2_testdb(&(_m->UTEST_2), _d, dlc_); + } else if (_id == 0x1FFFFFF6U) { + recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); + } + + return recid; +} + diff --git a/test/gencode/butl/ESP_testdb.h b/test/gencode/butl/ESP_testdb.h new file mode 100644 index 0000000..a6c2efa --- /dev/null +++ b/test/gencode/butl/ESP_testdb.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +// This version definition comes from main driver version and +// can be compared in user code space for strict compatibility test +#define VER_TESTDB_MAJ (1U) +#define VER_TESTDB_MIN (10U) + +typedef struct +{ + UTEST_2_t UTEST_2; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} testdb_rx_t; + +typedef struct +{ + EMPTY_0_t EMPTY_0; +} testdb_tx_t; + +uint32_t testdb_Receive(testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); + +#ifdef __DEF_TESTDB__ + +extern testdb_rx_t testdb_rx; + +extern testdb_tx_t testdb_tx; + +#endif // __DEF_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/conf/dbccodeconf.h b/test/gencode/conf/dbccodeconf.h new file mode 100644 index 0000000..34201b7 --- /dev/null +++ b/test/gencode/conf/dbccodeconf.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +// when USE_SIGFLOAT enabed the sigfloat_t must be defined +// typedef double sigfloat_t; + +// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined +// #include "{header_with_can_struct}" +// typedef {can_struct} __CoderDbcCanFrame_t__; + +// if you need to allocate rx and tx messages structs put the allocation macro here +// #define __DEF_{your_driver_name}__ + diff --git a/test/gencode/conf/testdb-config.h b/test/gencode/conf/testdb-config.h new file mode 100644 index 0000000..2aaa634 --- /dev/null +++ b/test/gencode/conf/testdb-config.h @@ -0,0 +1,109 @@ +#pragma once + +/* include common dbccode configurations */ +#include "dbccodeconf.h" + + +/* ------------------------------------------------------------------------- * + This define enables using CAN message structs with bit-fielded signals + layout. + + Note(!): bit-feild was not tested properly. */ + +/* #define TESTDB_USE_BITS_SIGNAL */ + + +/* ------------------------------------------------------------------------- * + This macro enables using CAN message descriptive struct packing functions + (by default signature of pack function intakes a few simple typed params + for loading data, len, etc). To compile you need to define the struct + __CoderDbcCanFrame_t__ which must have fields: + + u32 MsgId (CAN Frame message ID) + u8 DLC (CAN Frame payload length field) + u8 Data[8] (CAN Frame payload data) + u8 IDE (CAN Frame Extended (1) / Standard (0) ID type) + + This struct definition have to be placed (or be included) in dbccodeconf.h */ + +/* #define TESTDB_USE_CANSTRUCT */ + + +/* ------------------------------------------------------------------------- * + All the signals which have values of factor != 1 or offset != 0 + will be named in message struct with posfix '_ro'. Pack to payload + operations will be made on this signal value as well as unpack from payload. + + USE_SIGFLOAT macro makes some difference: + + 1. All the '_ro' fields will have a pair field with '_phys' postfix. + If only offset != 0 is true then the type of '_phys' signal is the same + as '_ro' signal. In other case the type will be @sigfloat_t which + have to be defined in user dbccodeconf.h + + 2. In pack function '_ro' signal will be rewritten by '_phys' signal, which + requires from user to use ONLY '_phys' signal for packing frame + + 3. In unpack function '_phys' signal will be written by '_ro' signal. + User have to use '_phys' signal to read physical value. */ + +/* #define TESTDB_USE_SIGFLOAT */ + + +/* ------------------------------------------------------------------------- * + Note(!) that the "canmonitorutil.h" must be accessed in include path: + + This macro adds: + + - monitor field @mon1 to message struct + + - capture system tick in unpack function and save value to mon1 field + to provide to user better missing frame detection code. For this case + user must provide function declared in canmonitorutil.h - GetSysTick() + which may return 1ms uptime. + + - calling function FMon_*** (from 'fmon' driver) inside unpack function + which is empty by default and have to be filled by user if + tests for DLC, rolling, checksum are necessary */ + +/* #define TESTDB_USE_DIAG_MONITORS */ + + +/* ------------------------------------------------------------------------- * + When monitor using is enabled (TESTDB_USE_DIAG_MONITORS) and define below + uncommented, additional signal will be added to message struct. ***_expt: + expected rolling counter, to perform monitoring rolling counter sequence + automatically (result may be tested in dedicated Fmon_*** function) */ + +/* #define TESTDB_AUTO_ROLL */ + + +/* ------------------------------------------------------------------------- * + When monitor using is enabled (TESTDB_USE_DIAG_MONITORS) and define below + uncommented, frame checksum signal may be handled automatically. + + The signal which may be marked as checksum signal must have substring + with next format: + + + where: + + - "Checksum": constant marker word + + - "XOR8": type of method, this text will be passed to GetFrameHash + (canmonitorutil.h) function as is, the best use case is to define 'enum + DbcCanCrcMethods' in canmonitorutil.h file with all possible + checksum algorithms (e.g. XOR8, XOR4 etc) + + - "3": optional value that will be passed to GetFrameHash as integer value + + Function GetFrameHash have to be implemented by user + + In pack function checksum signal will be calculated automatically + and loaded to payload + + In unpack function checksum signal is checked with calculated. + (result may be tested in dedicated Fmon_*** function). */ + +/* #define TESTDB_AUTO_CSM */ + diff --git a/test/gencode/inc/canmonitorutil.h b/test/gencode/inc/canmonitorutil.h new file mode 100644 index 0000000..48cd48f --- /dev/null +++ b/test/gencode/inc/canmonitorutil.h @@ -0,0 +1,63 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// declare here all availible checksum algorithms +typedef enum +{ + // XOR8 = 0, + // XOR4 = 1, + // etc +} DbcCanCrcMethods; + +typedef struct +{ + // @last_cycle keeps tick-value when last frame was received + uint32_t last_cycle; + + // @timeout_cycle keeps maximum timeout for frame, user responsibility + // to init this field and use it in missing frame monitoring function + uint32_t timeout_cycle; + + // @frame_cnt keeps count of all the received frames + uint32_t frame_cnt; + + // setting up @roll_error bit indicates roll counting fail. + // Bit is not clearing automatically! + uint32_t roll_error : 1; + + // setting up @checksum_error bit indicates checksum checking failure. + // Bit is not clearing automatically! + uint32_t csm_error : 1; + + // setting up @cycle_error bit indicates that time was overrunned. + // Bit is not clearing automatically! + uint32_t cycle_error : 1; + + // setting up @dlc_error bit indicates that the actual length of + // CAN frame is less then defined by CAN matrix! + uint32_t dlc_error : 1; + +} FrameMonitor_t; + +/* ----------------------------------------------------------------------------- */ +// @d - buff for hash calculation +// @len - number of bytes for hash calculation +// @method - hash algorythm. +// @op - optional value +uint8_t GetFrameHash(const uint8_t* data_ptr, uint8_t len, uint32_t msgid, DbcCanCrcMethods type, uint32_t option); + +/* ----------------------------------------------------------------------------- */ +// this function will be called when unpacking is performing. Value will be saved +// in @last_cycle variable +uint32_t GetSystemTick(void); + + +#ifdef __cplusplus +} +#endif + diff --git a/test/gencode/lib/testdb-fmon.h b/test/gencode/lib/testdb-fmon.h new file mode 100644 index 0000000..308a541 --- /dev/null +++ b/test/gencode/lib/testdb-fmon.h @@ -0,0 +1,34 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +// DBC file version +#define VER_TESTDB_MAJ_FMON (1U) +#define VER_TESTDB_MIN_FMON (10U) + +#include "testdb-config.h" + +#ifdef TESTDB_USE_DIAG_MONITORS + +#include "canmonitorutil.h" +/* +This file contains the prototypes of all the functions that will be called +from each Unpack_*name* function to detect DBC related errors +It is the user responsibility to defined these functions in the +separated .c file. If it won't be done the linkage error will happen +*/ + +void FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid); + +#endif // TESTDB_USE_DIAG_MONITORS + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c new file mode 100644 index 0000000..e72a643 --- /dev/null +++ b/test/gencode/lib/testdb.c @@ -0,0 +1,534 @@ +#include "testdb.h" + + +#ifdef TESTDB_USE_DIAG_MONITORS +// Function prototypes to be called each time CAN frame is unpacked +// FMon function may detect RC, CRC or DLC violation +#include "testdb-fmon.h" + +#endif // TESTDB_USE_DIAG_MONITORS + + +// To compile this function you need to typedef 'bitext_t' and 'ubitext_t' +// globally in @dbccodeconf.h or locally in 'dbcdrvname'-config.h +// Type selection may affect common performance. Most useful types are: +// bitext_t : int64_t and ubitext_t : uint64_t +static bitext_t __ext_sig__( ubitext_t val, uint8_t bits ) +{ + ubitext_t const m = 1u << (bits - 1); + return (val ^ m) - m; +} + +uint32_t Unpack_UTEST_2_testdb(UTEST_2_t* _m, const uint8_t* _d, uint8_t dlc_) +{ + (void)dlc_; + _m->U28_TEST_1 = ((_d[3] & (0x0FU)) << 24) | ((_d[2] & (0xFFU)) << 16) | ((_d[1] & (0xFFU)) << 8) | (_d[0] & (0xFFU)); + _m->ValTest = ((_d[3] >> 5) & (0x03U)); + _m->U8_TEST_1 = (_d[4] & (0xFFU)); + _m->U7_TEST_1_ro = ((_d[5] >> 1) & (0x7FU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->U7_TEST_1_phys = TESTDB_U7_TEST_1_ro_fromS(_m->U7_TEST_1_ro); +#endif // TESTDB_USE_SIGFLOAT + +#ifdef TESTDB_USE_DIAG_MONITORS + _m->mon1.dlc_error = (dlc_ < UTEST_2_DLC); + _m->mon1.last_cycle = GetSystemTick(); + _m->mon1.frame_cnt++; + + FMon_UTEST_2_testdb(&_m->mon1, UTEST_2_CANID); +#endif // TESTDB_USE_DIAG_MONITORS + + return UTEST_2_CANID; +} + +#ifdef TESTDB_USE_CANSTRUCT + +uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, __CoderDbcCanFrame_t__* cframe) +{ + uint8_t i; for (i = 0; (i < UTEST_2_DLC) && (i < 8); cframe->Data[i++] = 0); + +#ifdef TESTDB_USE_SIGFLOAT + _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); +#endif // TESTDB_USE_SIGFLOAT + + cframe->Data[0] |= (_m->U28_TEST_1 & (0xFFU)); + cframe->Data[1] |= ((_m->U28_TEST_1 >> 8) & (0xFFU)); + cframe->Data[2] |= ((_m->U28_TEST_1 >> 16) & (0xFFU)); + cframe->Data[3] |= ((_m->U28_TEST_1 >> 24) & (0x0FU)) | ((_m->ValTest & (0x03U)) << 5); + cframe->Data[4] |= (_m->U8_TEST_1 & (0xFFU)); + cframe->Data[5] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + + cframe->MsgId = UTEST_2_CANID; + cframe->DLC = UTEST_2_DLC; + cframe->IDE = UTEST_2_IDE; + return UTEST_2_CANID; +} + +#else + +uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) +{ + uint8_t i; for (i = 0; (i < UTEST_2_DLC) && (i < 8); _d[i++] = 0); + +#ifdef TESTDB_USE_SIGFLOAT + _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); +#endif // TESTDB_USE_SIGFLOAT + + _d[0] |= (_m->U28_TEST_1 & (0xFFU)); + _d[1] |= ((_m->U28_TEST_1 >> 8) & (0xFFU)); + _d[2] |= ((_m->U28_TEST_1 >> 16) & (0xFFU)); + _d[3] |= ((_m->U28_TEST_1 >> 24) & (0x0FU)) | ((_m->ValTest & (0x03U)) << 5); + _d[4] |= (_m->U8_TEST_1 & (0xFFU)); + _d[5] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + + *_len = UTEST_2_DLC; + *_ide = UTEST_2_IDE; + return UTEST_2_CANID; +} + +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_EMPTY_0_testdb(EMPTY_0_t* _m, const uint8_t* _d, uint8_t dlc_) +{ + (void)dlc_; + _m->CS = ((_d[4] >> 1) & (0x3FU)); + _m->RC = ((_d[6] & (0x07U)) << 1) | ((_d[5] >> 7) & (0x01U)); + +#ifdef TESTDB_USE_DIAG_MONITORS + _m->mon1.dlc_error = (dlc_ < EMPTY_0_DLC); + _m->mon1.last_cycle = GetSystemTick(); + _m->mon1.frame_cnt++; + +#ifdef TESTDB_AUTO_ROLL + _m->mon1.roll_error = (_m->RC != _m->RC_expt); + _m->RC_expt = (_m->RC + 1) & (0x0FU); +#endif // TESTDB_AUTO_ROLL + +#ifdef TESTDB_AUTO_CSM + _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, EMPTY_0_DLC, EMPTY_0_CANID, kXor8, 1)) != (_m->CS)); +#endif // TESTDB_AUTO_CSM + + FMon_EMPTY_0_testdb(&_m->mon1, EMPTY_0_CANID); +#endif // TESTDB_USE_DIAG_MONITORS + + return EMPTY_0_CANID; +} + +#ifdef TESTDB_USE_CANSTRUCT + +uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, __CoderDbcCanFrame_t__* cframe) +{ + uint8_t i; for (i = 0; (i < EMPTY_0_DLC) && (i < 8); cframe->Data[i++] = 0); + +#ifdef TESTDB_AUTO_ROLL + _m->RC = (_m->RC + 1) & (0x0FU); +#endif // TESTDB_AUTO_ROLL + +#ifdef TESTDB_AUTO_CSM + _m->CS = 0U; +#endif // TESTDB_AUTO_CSM + + cframe->Data[4] |= ((_m->CS & (0x3FU)) << 1); + cframe->Data[5] |= ((_m->RC & (0x01U)) << 7); + cframe->Data[6] |= ((_m->RC >> 1) & (0x07U)); + +#ifdef TESTDB_AUTO_CSM + _m->CS = ((uint8_t)GetFrameHash(cframe->Data, EMPTY_0_DLC, EMPTY_0_CANID, kXor8, 1)); + cframe->Data[4] |= ((_m->CS & (0x3FU)) << 1); +#endif // TESTDB_AUTO_CSM + + cframe->MsgId = EMPTY_0_CANID; + cframe->DLC = EMPTY_0_DLC; + cframe->IDE = EMPTY_0_IDE; + return EMPTY_0_CANID; +} + +#else + +uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) +{ + uint8_t i; for (i = 0; (i < EMPTY_0_DLC) && (i < 8); _d[i++] = 0); + +#ifdef TESTDB_AUTO_ROLL + _m->RC = (_m->RC + 1) & (0x0FU); +#endif // TESTDB_AUTO_ROLL + +#ifdef TESTDB_AUTO_CSM + _m->CS = 0U; +#endif // TESTDB_AUTO_CSM + + _d[4] |= ((_m->CS & (0x3FU)) << 1); + _d[5] |= ((_m->RC & (0x01U)) << 7); + _d[6] |= ((_m->RC >> 1) & (0x07U)); + +#ifdef TESTDB_AUTO_CSM + _m->CS = ((uint8_t)GetFrameHash(_d, EMPTY_0_DLC, EMPTY_0_CANID, kXor8, 1)); + _d[4] |= ((_m->CS & (0x3FU)) << 1); +#endif // TESTDB_AUTO_CSM + + *_len = EMPTY_0_DLC; + *_ide = EMPTY_0_IDE; + return EMPTY_0_CANID; +} + +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_UTEST_3_testdb(UTEST_3_t* _m, const uint8_t* _d, uint8_t dlc_) +{ + (void)dlc_; + _m->U32_TEST_1 = ((_d[3] & (0xFFU)) << 24) | ((_d[2] & (0xFFU)) << 16) | ((_d[1] & (0xFFU)) << 8) | (_d[0] & (0xFFU)); + +#ifdef TESTDB_USE_DIAG_MONITORS + _m->mon1.dlc_error = (dlc_ < UTEST_3_DLC); + _m->mon1.last_cycle = GetSystemTick(); + _m->mon1.frame_cnt++; + + FMon_UTEST_3_testdb(&_m->mon1, UTEST_3_CANID); +#endif // TESTDB_USE_DIAG_MONITORS + + return UTEST_3_CANID; +} + +#ifdef TESTDB_USE_CANSTRUCT + +uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, __CoderDbcCanFrame_t__* cframe) +{ + uint8_t i; for (i = 0; (i < UTEST_3_DLC) && (i < 8); cframe->Data[i++] = 0); + + cframe->Data[0] |= (_m->U32_TEST_1 & (0xFFU)); + cframe->Data[1] |= ((_m->U32_TEST_1 >> 8) & (0xFFU)); + cframe->Data[2] |= ((_m->U32_TEST_1 >> 16) & (0xFFU)); + cframe->Data[3] |= ((_m->U32_TEST_1 >> 24) & (0xFFU)); + + cframe->MsgId = UTEST_3_CANID; + cframe->DLC = UTEST_3_DLC; + cframe->IDE = UTEST_3_IDE; + return UTEST_3_CANID; +} + +#else + +uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) +{ + uint8_t i; for (i = 0; (i < UTEST_3_DLC) && (i < 8); _d[i++] = 0); + + _d[0] |= (_m->U32_TEST_1 & (0xFFU)); + _d[1] |= ((_m->U32_TEST_1 >> 8) & (0xFFU)); + _d[2] |= ((_m->U32_TEST_1 >> 16) & (0xFFU)); + _d[3] |= ((_m->U32_TEST_1 >> 24) & (0xFFU)); + + *_len = UTEST_3_DLC; + *_ide = UTEST_3_IDE; + return UTEST_3_CANID; +} + +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, const uint8_t* _d, uint8_t dlc_) +{ + (void)dlc_; + _m->ValTable = (_d[0] & (0x03U)); + _m->Position = ((_d[0] >> 4) & (0x0FU)); + _m->INT_TEST_2_ro = __ext_sig__(( ((_d[1] >> 1) & (0x7FU)) ), 7); +#ifdef TESTDB_USE_SIGFLOAT + _m->INT_TEST_2_phys = TESTDB_INT_TEST_2_ro_fromS(_m->INT_TEST_2_ro); +#endif // TESTDB_USE_SIGFLOAT + + _m->RC = (_d[2] & (0x0FU)); + _m->CS = ((_d[2] >> 4) & (0x0FU)); + _m->Accel_ro = ((_d[4] & (0x0FU)) << 8) | (_d[3] & (0xFFU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->Accel_phys = (sigfloat_t)(TESTDB_Accel_ro_fromS(_m->Accel_ro)); +#endif // TESTDB_USE_SIGFLOAT + + _m->FLT4_TEST_1_ro = ((_d[4] >> 4) & (0x0FU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->FLT4_TEST_1_phys = (sigfloat_t)(TESTDB_FLT4_TEST_1_ro_fromS(_m->FLT4_TEST_1_ro)); +#endif // TESTDB_USE_SIGFLOAT + + _m->FLT4_TEST_2_ro = (_d[5] & (0x0FU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->FLT4_TEST_2_phys = (sigfloat_t)(TESTDB_FLT4_TEST_2_ro_fromS(_m->FLT4_TEST_2_ro)); +#endif // TESTDB_USE_SIGFLOAT + + _m->FLT4_TEST_3_ro = ((_d[5] >> 4) & (0x0FU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->FLT4_TEST_3_phys = (sigfloat_t)(TESTDB_FLT4_TEST_3_ro_fromS(_m->FLT4_TEST_3_ro)); +#endif // TESTDB_USE_SIGFLOAT + + _m->INT_TEST_1_ro = ((_d[6] >> 2) & (0x0FU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->INT_TEST_1_phys = TESTDB_INT_TEST_1_ro_fromS(_m->INT_TEST_1_ro); +#endif // TESTDB_USE_SIGFLOAT + +#ifdef TESTDB_USE_DIAG_MONITORS + _m->mon1.dlc_error = (dlc_ < FLT_TEST_1_DLC); + _m->mon1.last_cycle = GetSystemTick(); + _m->mon1.frame_cnt++; + +#ifdef TESTDB_AUTO_ROLL + _m->mon1.roll_error = (_m->RC != _m->RC_expt); + _m->RC_expt = (_m->RC + 1) & (0x0FU); +#endif // TESTDB_AUTO_ROLL + +#ifdef TESTDB_AUTO_CSM + _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, FLT_TEST_1_DLC, FLT_TEST_1_CANID, kXor4, 1)) != (_m->CS)); +#endif // TESTDB_AUTO_CSM + + FMon_FLT_TEST_1_testdb(&_m->mon1, FLT_TEST_1_CANID); +#endif // TESTDB_USE_DIAG_MONITORS + + return FLT_TEST_1_CANID; +} + +#ifdef TESTDB_USE_CANSTRUCT + +uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe) +{ + uint8_t i; for (i = 0; (i < FLT_TEST_1_DLC) && (i < 8); cframe->Data[i++] = 0); + +#ifdef TESTDB_AUTO_ROLL + _m->RC = (_m->RC + 1) & (0x0FU); +#endif // TESTDB_AUTO_ROLL + +#ifdef TESTDB_AUTO_CSM + _m->CS = 0U; +#endif // TESTDB_AUTO_CSM + +#ifdef TESTDB_USE_SIGFLOAT + _m->INT_TEST_2_ro = TESTDB_INT_TEST_2_ro_toS(_m->INT_TEST_2_phys); + _m->Accel_ro = TESTDB_Accel_ro_toS(_m->Accel_phys); + _m->FLT4_TEST_1_ro = TESTDB_FLT4_TEST_1_ro_toS(_m->FLT4_TEST_1_phys); + _m->FLT4_TEST_2_ro = TESTDB_FLT4_TEST_2_ro_toS(_m->FLT4_TEST_2_phys); + _m->FLT4_TEST_3_ro = TESTDB_FLT4_TEST_3_ro_toS(_m->FLT4_TEST_3_phys); + _m->INT_TEST_1_ro = TESTDB_INT_TEST_1_ro_toS(_m->INT_TEST_1_phys); +#endif // TESTDB_USE_SIGFLOAT + + cframe->Data[0] |= (_m->ValTable & (0x03U)) | ((_m->Position & (0x0FU)) << 4); + cframe->Data[1] |= ((_m->INT_TEST_2_ro & (0x7FU)) << 1); + cframe->Data[2] |= (_m->RC & (0x0FU)) | ((_m->CS & (0x0FU)) << 4); + cframe->Data[3] |= (_m->Accel_ro & (0xFFU)); + cframe->Data[4] |= ((_m->Accel_ro >> 8) & (0x0FU)) | ((_m->FLT4_TEST_1_ro & (0x0FU)) << 4); + cframe->Data[5] |= (_m->FLT4_TEST_2_ro & (0x0FU)) | ((_m->FLT4_TEST_3_ro & (0x0FU)) << 4); + cframe->Data[6] |= ((_m->INT_TEST_1_ro & (0x0FU)) << 2); + +#ifdef TESTDB_AUTO_CSM + _m->CS = ((uint8_t)GetFrameHash(cframe->Data, FLT_TEST_1_DLC, FLT_TEST_1_CANID, kXor4, 1)); + cframe->Data[2] |= ((_m->CS & (0x0FU)) << 4); +#endif // TESTDB_AUTO_CSM + + cframe->MsgId = FLT_TEST_1_CANID; + cframe->DLC = FLT_TEST_1_DLC; + cframe->IDE = FLT_TEST_1_IDE; + return FLT_TEST_1_CANID; +} + +#else + +uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) +{ + uint8_t i; for (i = 0; (i < FLT_TEST_1_DLC) && (i < 8); _d[i++] = 0); + +#ifdef TESTDB_AUTO_ROLL + _m->RC = (_m->RC + 1) & (0x0FU); +#endif // TESTDB_AUTO_ROLL + +#ifdef TESTDB_AUTO_CSM + _m->CS = 0U; +#endif // TESTDB_AUTO_CSM + +#ifdef TESTDB_USE_SIGFLOAT + _m->INT_TEST_2_ro = TESTDB_INT_TEST_2_ro_toS(_m->INT_TEST_2_phys); + _m->Accel_ro = TESTDB_Accel_ro_toS(_m->Accel_phys); + _m->FLT4_TEST_1_ro = TESTDB_FLT4_TEST_1_ro_toS(_m->FLT4_TEST_1_phys); + _m->FLT4_TEST_2_ro = TESTDB_FLT4_TEST_2_ro_toS(_m->FLT4_TEST_2_phys); + _m->FLT4_TEST_3_ro = TESTDB_FLT4_TEST_3_ro_toS(_m->FLT4_TEST_3_phys); + _m->INT_TEST_1_ro = TESTDB_INT_TEST_1_ro_toS(_m->INT_TEST_1_phys); +#endif // TESTDB_USE_SIGFLOAT + + _d[0] |= (_m->ValTable & (0x03U)) | ((_m->Position & (0x0FU)) << 4); + _d[1] |= ((_m->INT_TEST_2_ro & (0x7FU)) << 1); + _d[2] |= (_m->RC & (0x0FU)) | ((_m->CS & (0x0FU)) << 4); + _d[3] |= (_m->Accel_ro & (0xFFU)); + _d[4] |= ((_m->Accel_ro >> 8) & (0x0FU)) | ((_m->FLT4_TEST_1_ro & (0x0FU)) << 4); + _d[5] |= (_m->FLT4_TEST_2_ro & (0x0FU)) | ((_m->FLT4_TEST_3_ro & (0x0FU)) << 4); + _d[6] |= ((_m->INT_TEST_1_ro & (0x0FU)) << 2); + +#ifdef TESTDB_AUTO_CSM + _m->CS = ((uint8_t)GetFrameHash(_d, FLT_TEST_1_DLC, FLT_TEST_1_CANID, kXor4, 1)); + _d[2] |= ((_m->CS & (0x0FU)) << 4); +#endif // TESTDB_AUTO_CSM + + *_len = FLT_TEST_1_DLC; + *_ide = FLT_TEST_1_IDE; + return FLT_TEST_1_CANID; +} + +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, const uint8_t* _d, uint8_t dlc_) +{ + (void)dlc_; + _m->sig15_ro = __ext_sig__(( ((_d[1] & (0x7FU)) << 8) | (_d[0] & (0xFFU)) ), 15); +#ifdef TESTDB_USE_SIGFLOAT + _m->sig15_phys = TESTDB_sig15_ro_fromS(_m->sig15_ro); +#endif // TESTDB_USE_SIGFLOAT + + _m->sig15_2_ro = __ext_sig__(( ((_d[3] & (0x7FU)) << 8) | (_d[2] & (0xFFU)) ), 15); +#ifdef TESTDB_USE_SIGFLOAT + _m->sig15_2_phys = (sigfloat_t)(TESTDB_sig15_2_ro_fromS(_m->sig15_2_ro)); +#endif // TESTDB_USE_SIGFLOAT + + _m->sig8_ro = __ext_sig__(( (_d[4] & (0xFFU)) ), 8); +#ifdef TESTDB_USE_SIGFLOAT + _m->sig8_phys = TESTDB_sig8_ro_fromS(_m->sig8_ro); +#endif // TESTDB_USE_SIGFLOAT + + _m->sig_7_ro = __ext_sig__(( (_d[5] & (0x7FU)) ), 7); +#ifdef TESTDB_USE_SIGFLOAT + _m->sig_7_phys = (sigfloat_t)(TESTDB_sig_7_ro_fromS(_m->sig_7_ro)); +#endif // TESTDB_USE_SIGFLOAT + + _m->U7_TEST_1_ro = ((_d[6] >> 1) & (0x7FU)); +#ifdef TESTDB_USE_SIGFLOAT + _m->U7_TEST_1_phys = TESTDB_U7_TEST_1_ro_fromS(_m->U7_TEST_1_ro); +#endif // TESTDB_USE_SIGFLOAT + +#ifdef TESTDB_USE_DIAG_MONITORS + _m->mon1.dlc_error = (dlc_ < SIG_TEST_1_DLC); + _m->mon1.last_cycle = GetSystemTick(); + _m->mon1.frame_cnt++; + + FMon_SIG_TEST_1_testdb(&_m->mon1, SIG_TEST_1_CANID); +#endif // TESTDB_USE_DIAG_MONITORS + + return SIG_TEST_1_CANID; +} + +#ifdef TESTDB_USE_CANSTRUCT + +uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe) +{ + uint8_t i; for (i = 0; (i < SIG_TEST_1_DLC) && (i < 8); cframe->Data[i++] = 0); + +#ifdef TESTDB_USE_SIGFLOAT + _m->sig15_ro = TESTDB_sig15_ro_toS(_m->sig15_phys); + _m->sig15_2_ro = TESTDB_sig15_2_ro_toS(_m->sig15_2_phys); + _m->sig8_ro = TESTDB_sig8_ro_toS(_m->sig8_phys); + _m->sig_7_ro = TESTDB_sig_7_ro_toS(_m->sig_7_phys); + _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); +#endif // TESTDB_USE_SIGFLOAT + + cframe->Data[0] |= (_m->sig15_ro & (0xFFU)); + cframe->Data[1] |= ((_m->sig15_ro >> 8) & (0x7FU)); + cframe->Data[2] |= (_m->sig15_2_ro & (0xFFU)); + cframe->Data[3] |= ((_m->sig15_2_ro >> 8) & (0x7FU)); + cframe->Data[4] |= (_m->sig8_ro & (0xFFU)); + cframe->Data[5] |= (_m->sig_7_ro & (0x7FU)); + cframe->Data[6] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + + cframe->MsgId = SIG_TEST_1_CANID; + cframe->DLC = SIG_TEST_1_DLC; + cframe->IDE = SIG_TEST_1_IDE; + return SIG_TEST_1_CANID; +} + +#else + +uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) +{ + uint8_t i; for (i = 0; (i < SIG_TEST_1_DLC) && (i < 8); _d[i++] = 0); + +#ifdef TESTDB_USE_SIGFLOAT + _m->sig15_ro = TESTDB_sig15_ro_toS(_m->sig15_phys); + _m->sig15_2_ro = TESTDB_sig15_2_ro_toS(_m->sig15_2_phys); + _m->sig8_ro = TESTDB_sig8_ro_toS(_m->sig8_phys); + _m->sig_7_ro = TESTDB_sig_7_ro_toS(_m->sig_7_phys); + _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); +#endif // TESTDB_USE_SIGFLOAT + + _d[0] |= (_m->sig15_ro & (0xFFU)); + _d[1] |= ((_m->sig15_ro >> 8) & (0x7FU)); + _d[2] |= (_m->sig15_2_ro & (0xFFU)); + _d[3] |= ((_m->sig15_2_ro >> 8) & (0x7FU)); + _d[4] |= (_m->sig8_ro & (0xFFU)); + _d[5] |= (_m->sig_7_ro & (0x7FU)); + _d[6] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + + *_len = SIG_TEST_1_DLC; + *_ide = SIG_TEST_1_IDE; + return SIG_TEST_1_CANID; +} + +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, const uint8_t* _d, uint8_t dlc_) +{ + (void)dlc_; + _m->ValTest = ((_d[0] >> 6) & (0x03U)); + _m->CS = (_d[1] & (0x3FU)); + +#ifdef TESTDB_USE_DIAG_MONITORS + _m->mon1.dlc_error = (dlc_ < EMPTY_EXT_ID_DLC); + _m->mon1.last_cycle = GetSystemTick(); + _m->mon1.frame_cnt++; + +#ifdef TESTDB_AUTO_CSM + _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, EMPTY_EXT_ID_DLC, EMPTY_EXT_ID_CANID, kXor8, 1)) != (_m->CS)); +#endif // TESTDB_AUTO_CSM + + FMon_EMPTY_EXT_ID_testdb(&_m->mon1, EMPTY_EXT_ID_CANID); +#endif // TESTDB_USE_DIAG_MONITORS + + return EMPTY_EXT_ID_CANID; +} + +#ifdef TESTDB_USE_CANSTRUCT + +uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, __CoderDbcCanFrame_t__* cframe) +{ + uint8_t i; for (i = 0; (i < EMPTY_EXT_ID_DLC) && (i < 8); cframe->Data[i++] = 0); + +#ifdef TESTDB_AUTO_CSM + _m->CS = 0U; +#endif // TESTDB_AUTO_CSM + + cframe->Data[0] |= ((_m->ValTest & (0x03U)) << 6); + cframe->Data[1] |= (_m->CS & (0x3FU)); + +#ifdef TESTDB_AUTO_CSM + _m->CS = ((uint8_t)GetFrameHash(cframe->Data, EMPTY_EXT_ID_DLC, EMPTY_EXT_ID_CANID, kXor8, 1)); + cframe->Data[1] |= (_m->CS & (0x3FU)); +#endif // TESTDB_AUTO_CSM + + cframe->MsgId = EMPTY_EXT_ID_CANID; + cframe->DLC = EMPTY_EXT_ID_DLC; + cframe->IDE = EMPTY_EXT_ID_IDE; + return EMPTY_EXT_ID_CANID; +} + +#else + +uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) +{ + uint8_t i; for (i = 0; (i < EMPTY_EXT_ID_DLC) && (i < 8); _d[i++] = 0); + +#ifdef TESTDB_AUTO_CSM + _m->CS = 0U; +#endif // TESTDB_AUTO_CSM + + _d[0] |= ((_m->ValTest & (0x03U)) << 6); + _d[1] |= (_m->CS & (0x3FU)); + +#ifdef TESTDB_AUTO_CSM + _m->CS = ((uint8_t)GetFrameHash(_d, EMPTY_EXT_ID_DLC, EMPTY_EXT_ID_CANID, kXor8, 1)); + _d[1] |= (_m->CS & (0x3FU)); +#endif // TESTDB_AUTO_CSM + + *_len = EMPTY_EXT_ID_DLC; + *_ide = EMPTY_EXT_ID_IDE; + return EMPTY_EXT_ID_CANID; +} + +#endif // TESTDB_USE_CANSTRUCT + diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h new file mode 100644 index 0000000..3ef3753 --- /dev/null +++ b/test/gencode/lib/testdb.h @@ -0,0 +1,510 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +// DBC file version +#define VER_TESTDB_MAJ (1U) +#define VER_TESTDB_MIN (10U) + +// include current dbc-driver compilation config +#include "testdb-config.h" + +#ifdef TESTDB_USE_DIAG_MONITORS +// This file must define: +// base monitor struct +// function signature for HASH calculation: (@GetFrameHash) +// function signature for getting system tick value: (@GetSystemTick) +#include "canmonitorutil.h" + +#endif // TESTDB_USE_DIAG_MONITORS + + +// def @UTEST_2 CAN Message (333 0x14d) +#define UTEST_2_IDE (0U) +#define UTEST_2_DLC (8U) +#define UTEST_2_CANID (0x14d) +// signal: @U7_TEST_1_ro +#define TESTDB_U7_TEST_1_ro_CovFactor (1) +#define TESTDB_U7_TEST_1_ro_toS(x) ( (uint8_t) ((x) - (-255)) ) +#define TESTDB_U7_TEST_1_ro_fromS(x) ( ((x) + (-255)) ) + +typedef struct +{ +#ifdef TESTDB_USE_BITS_SIGNAL + + uint32_t U28_TEST_1; // Bits=28 + + // This is test signal for Value Table + // + // 3 : "Unsupported" + // 2 : "Fail" + // 1 : "OK" + // 0 : "Undefined" + uint8_t ValTest : 2; // Bits= 2 Unit:'c' + + uint8_t U8_TEST_1; // Bits= 8 + + uint8_t U7_TEST_1_ro : 7; // Bits= 7 Offset= -255 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t U7_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + +#else + + uint32_t U28_TEST_1; // Bits=28 + + // This is test signal for Value Table + // + // 3 : "Unsupported" + // 2 : "Fail" + // 1 : "OK" + // 0 : "Undefined" + uint8_t ValTest; // Bits= 2 Unit:'c' + + uint8_t U8_TEST_1; // Bits= 8 + + uint8_t U7_TEST_1_ro; // Bits= 7 Offset= -255 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t U7_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + +#endif // TESTDB_USE_BITS_SIGNAL + +#ifdef TESTDB_USE_DIAG_MONITORS + + FrameMonitor_t mon1; + +#endif // TESTDB_USE_DIAG_MONITORS + +} UTEST_2_t; + +// def @EMPTY_0 CAN Message (352 0x160) +#define EMPTY_0_IDE (0U) +#define EMPTY_0_DLC (8U) +#define EMPTY_0_CANID (0x160) +#define EMPTY_0_CYC (101U) + +typedef struct +{ +#ifdef TESTDB_USE_BITS_SIGNAL + + // test pattern + uint8_t CS : 6; // Bits= 6 + + // + uint8_t RC : 4; // Bits= 4 + +#ifdef TESTDB_AUTO_ROLL + + uint8_t RC_expt : 4; // Bits= 4 + +#endif // TESTDB_AUTO_ROLL + +#else + + // test pattern + uint8_t CS; // Bits= 6 + + // + uint8_t RC; // Bits= 4 + +#ifdef TESTDB_AUTO_ROLL + + uint8_t RC_expt; // Bits= 4 + +#endif // TESTDB_AUTO_ROLL + +#endif // TESTDB_USE_BITS_SIGNAL + +#ifdef TESTDB_USE_DIAG_MONITORS + + FrameMonitor_t mon1; + +#endif // TESTDB_USE_DIAG_MONITORS + +} EMPTY_0_t; + +// def @UTEST_3 CAN Message (555 0x22b) +#define UTEST_3_IDE (0U) +#define UTEST_3_DLC (8U) +#define UTEST_3_CANID (0x22b) + +typedef struct +{ +#ifdef TESTDB_USE_BITS_SIGNAL + + uint32_t U32_TEST_1; // Bits=32 + +#else + + uint32_t U32_TEST_1; // Bits=32 + +#endif // TESTDB_USE_BITS_SIGNAL + +#ifdef TESTDB_USE_DIAG_MONITORS + + FrameMonitor_t mon1; + +#endif // TESTDB_USE_DIAG_MONITORS + +} UTEST_3_t; + +// def @FLT_TEST_1 CAN Message (864 0x360) +#define FLT_TEST_1_IDE (0U) +#define FLT_TEST_1_DLC (8U) +#define FLT_TEST_1_CANID (0x360) +#define FLT_TEST_1_CYC (101U) +// signal: @INT_TEST_2_ro +#define TESTDB_INT_TEST_2_ro_CovFactor (5) +#define TESTDB_INT_TEST_2_ro_toS(x) ( (int8_t) ((x) / (5)) ) +#define TESTDB_INT_TEST_2_ro_fromS(x) ( ((x) * (5)) ) +// signal: @Accel_ro +#define TESTDB_Accel_ro_CovFactor (0.100000) +#define TESTDB_Accel_ro_toS(x) ( (uint16_t) (((x) - (-100.000000)) / (0.100000)) ) +#define TESTDB_Accel_ro_fromS(x) ( (((x) * (0.100000)) + (-100.000000)) ) +// signal: @FLT4_TEST_1_ro +#define TESTDB_FLT4_TEST_1_ro_CovFactor (2.010000) +#define TESTDB_FLT4_TEST_1_ro_toS(x) ( (uint8_t) (((x) - (-0.010000)) / (2.010000)) ) +#define TESTDB_FLT4_TEST_1_ro_fromS(x) ( (((x) * (2.010000)) + (-0.010000)) ) +// signal: @FLT4_TEST_2_ro +#define TESTDB_FLT4_TEST_2_ro_CovFactor (2.010000) +#define TESTDB_FLT4_TEST_2_ro_toS(x) ( (uint8_t) (((x) - (-5.000000)) / (2.010000)) ) +#define TESTDB_FLT4_TEST_2_ro_fromS(x) ( (((x) * (2.010000)) + (-5.000000)) ) +// signal: @FLT4_TEST_3_ro +#define TESTDB_FLT4_TEST_3_ro_CovFactor (2.000000) +#define TESTDB_FLT4_TEST_3_ro_toS(x) ( (uint8_t) (((x) - (-10.100000)) / (2.000000)) ) +#define TESTDB_FLT4_TEST_3_ro_fromS(x) ( (((x) * (2.000000)) + (-10.100000)) ) +// signal: @INT_TEST_1_ro +#define TESTDB_INT_TEST_1_ro_CovFactor (9) +#define TESTDB_INT_TEST_1_ro_toS(x) ( (uint8_t) (((x) - (-11)) / (9)) ) +#define TESTDB_INT_TEST_1_ro_fromS(x) ( (((x) * (9)) + (-11)) ) + +typedef struct +{ +#ifdef TESTDB_USE_BITS_SIGNAL + + // This is just comment. + // Next line. + // 3 : "Unsupported" + // 2 : "Fail" + // 1 : "OK" + // 0 : "Undefined" + uint8_t ValTable : 2; // Bits= 2 Unit:'e' + + uint8_t Position : 4; // Bits= 4 + + int8_t INT_TEST_2_ro : 7; // [-] Bits= 7 Factor= 5 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t INT_TEST_2_phys; +#endif // TESTDB_USE_SIGFLOAT + + // + uint8_t RC : 4; // Bits= 4 + + // + uint8_t CS : 4; // Bits= 4 + + uint16_t Accel_ro; // Bits=12 Offset= -100.000000 Factor= 0.100000 Unit:'m/s' + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t Accel_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t FLT4_TEST_1_ro : 4; // Bits= 4 Offset= -0.010000 Factor= 2.010000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t FLT4_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t FLT4_TEST_2_ro : 4; // Bits= 4 Offset= -5.000000 Factor= 2.010000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t FLT4_TEST_2_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t FLT4_TEST_3_ro : 4; // Bits= 4 Offset= -10.100000 Factor= 2.000000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t FLT4_TEST_3_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t INT_TEST_1_ro : 4; // Bits= 4 Offset= -11 Factor= 9 + +#ifdef TESTDB_USE_SIGFLOAT + int8_t INT_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + +#ifdef TESTDB_AUTO_ROLL + + uint8_t RC_expt : 4; // Bits= 4 + +#endif // TESTDB_AUTO_ROLL + +#else + + // This is just comment. + // Next line. + // 3 : "Unsupported" + // 2 : "Fail" + // 1 : "OK" + // 0 : "Undefined" + uint8_t ValTable; // Bits= 2 Unit:'e' + + uint8_t Position; // Bits= 4 + + int8_t INT_TEST_2_ro; // [-] Bits= 7 Factor= 5 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t INT_TEST_2_phys; +#endif // TESTDB_USE_SIGFLOAT + + // + uint8_t RC; // Bits= 4 + + // + uint8_t CS; // Bits= 4 + + uint16_t Accel_ro; // Bits=12 Offset= -100.000000 Factor= 0.100000 Unit:'m/s' + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t Accel_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t FLT4_TEST_1_ro; // Bits= 4 Offset= -0.010000 Factor= 2.010000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t FLT4_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t FLT4_TEST_2_ro; // Bits= 4 Offset= -5.000000 Factor= 2.010000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t FLT4_TEST_2_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t FLT4_TEST_3_ro; // Bits= 4 Offset= -10.100000 Factor= 2.000000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t FLT4_TEST_3_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t INT_TEST_1_ro; // Bits= 4 Offset= -11 Factor= 9 + +#ifdef TESTDB_USE_SIGFLOAT + int8_t INT_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + +#ifdef TESTDB_AUTO_ROLL + + uint8_t RC_expt; // Bits= 4 + +#endif // TESTDB_AUTO_ROLL + +#endif // TESTDB_USE_BITS_SIGNAL + +#ifdef TESTDB_USE_DIAG_MONITORS + + FrameMonitor_t mon1; + +#endif // TESTDB_USE_DIAG_MONITORS + +} FLT_TEST_1_t; + +// def @SIG_TEST_1 CAN Message (1911 0x777) +#define SIG_TEST_1_IDE (0U) +#define SIG_TEST_1_DLC (8U) +#define SIG_TEST_1_CANID (0x777) +// signal: @sig15_ro +#define TESTDB_sig15_ro_CovFactor (3) +#define TESTDB_sig15_ro_toS(x) ( (int16_t) (((x) - (-1024)) / (3)) ) +#define TESTDB_sig15_ro_fromS(x) ( (((x) * (3)) + (-1024)) ) +// signal: @sig15_2_ro +#define TESTDB_sig15_2_ro_CovFactor (1.900000) +#define TESTDB_sig15_2_ro_toS(x) ( (int16_t) (((x) - (-2500.000000)) / (1.900000)) ) +#define TESTDB_sig15_2_ro_fromS(x) ( (((x) * (1.900000)) + (-2500.000000)) ) +// signal: @sig8_ro +#define TESTDB_sig8_ro_CovFactor (5) +#define TESTDB_sig8_ro_toS(x) ( (int8_t) ((x) / (5)) ) +#define TESTDB_sig8_ro_fromS(x) ( ((x) * (5)) ) +// signal: @sig_7_ro +#define TESTDB_sig_7_ro_CovFactor (1.200000) +#define TESTDB_sig_7_ro_toS(x) ( (int8_t) (((x) - (0.000000)) / (1.200000)) ) +#define TESTDB_sig_7_ro_fromS(x) ( (((x) * (1.200000)) + (0.000000)) ) +// signal: @U7_TEST_1_ro +#define TESTDB_U7_TEST_1_ro_CovFactor (1) +#define TESTDB_U7_TEST_1_ro_toS(x) ( (uint8_t) ((x) - (-255)) ) +#define TESTDB_U7_TEST_1_ro_fromS(x) ( ((x) + (-255)) ) + +typedef struct +{ +#ifdef TESTDB_USE_BITS_SIGNAL + + int16_t sig15_ro; // [-] Bits=15 Offset= -1024 Factor= 3 + +#ifdef TESTDB_USE_SIGFLOAT + int32_t sig15_phys; +#endif // TESTDB_USE_SIGFLOAT + + int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t sig15_2_phys; +#endif // TESTDB_USE_SIGFLOAT + + int8_t sig8_ro; // [-] Bits= 8 Factor= 5 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t sig8_phys; +#endif // TESTDB_USE_SIGFLOAT + + int8_t sig_7_ro : 7; // [-] Bits= 7 Factor= 1.200000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t sig_7_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t U7_TEST_1_ro : 7; // Bits= 7 Offset= -255 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t U7_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + +#else + + int16_t sig15_ro; // [-] Bits=15 Offset= -1024 Factor= 3 + +#ifdef TESTDB_USE_SIGFLOAT + int32_t sig15_phys; +#endif // TESTDB_USE_SIGFLOAT + + int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t sig15_2_phys; +#endif // TESTDB_USE_SIGFLOAT + + int8_t sig8_ro; // [-] Bits= 8 Factor= 5 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t sig8_phys; +#endif // TESTDB_USE_SIGFLOAT + + int8_t sig_7_ro; // [-] Bits= 7 Factor= 1.200000 + +#ifdef TESTDB_USE_SIGFLOAT + sigfloat_t sig_7_phys; +#endif // TESTDB_USE_SIGFLOAT + + uint8_t U7_TEST_1_ro; // Bits= 7 Offset= -255 + +#ifdef TESTDB_USE_SIGFLOAT + int16_t U7_TEST_1_phys; +#endif // TESTDB_USE_SIGFLOAT + +#endif // TESTDB_USE_BITS_SIGNAL + +#ifdef TESTDB_USE_DIAG_MONITORS + + FrameMonitor_t mon1; + +#endif // TESTDB_USE_DIAG_MONITORS + +} SIG_TEST_1_t; + +// def @EMPTY_EXT_ID CAN Message (536870902 0x1ffffff6) +#define EMPTY_EXT_ID_IDE (1U) +#define EMPTY_EXT_ID_DLC (8U) +#define EMPTY_EXT_ID_CANID (0x1ffffff6) + +typedef struct +{ +#ifdef TESTDB_USE_BITS_SIGNAL + + // This is test signal for Value Table + // + // 3 : "Unsupported" + // 2 : "Fail" + // 1 : "OK" + // 0 : "Undefined" + uint8_t ValTest : 2; // Bits= 2 Unit:'c' + + // test pattern + uint8_t CS : 6; // Bits= 6 + +#else + + // This is test signal for Value Table + // + // 3 : "Unsupported" + // 2 : "Fail" + // 1 : "OK" + // 0 : "Undefined" + uint8_t ValTest; // Bits= 2 Unit:'c' + + // test pattern + uint8_t CS; // Bits= 6 + +#endif // TESTDB_USE_BITS_SIGNAL + +#ifdef TESTDB_USE_DIAG_MONITORS + + FrameMonitor_t mon1; + +#endif // TESTDB_USE_DIAG_MONITORS + +} EMPTY_EXT_ID_t; + +// Function signatures + +uint32_t Unpack_UTEST_2_testdb(UTEST_2_t* _m, const uint8_t* _d, uint8_t dlc_); +#ifdef TESTDB_USE_CANSTRUCT +uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, __CoderDbcCanFrame_t__* cframe); +#else +uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide); +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_EMPTY_0_testdb(EMPTY_0_t* _m, const uint8_t* _d, uint8_t dlc_); +#ifdef TESTDB_USE_CANSTRUCT +uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, __CoderDbcCanFrame_t__* cframe); +#else +uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide); +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_UTEST_3_testdb(UTEST_3_t* _m, const uint8_t* _d, uint8_t dlc_); +#ifdef TESTDB_USE_CANSTRUCT +uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, __CoderDbcCanFrame_t__* cframe); +#else +uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide); +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, const uint8_t* _d, uint8_t dlc_); +#ifdef TESTDB_USE_CANSTRUCT +uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe); +#else +uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide); +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, const uint8_t* _d, uint8_t dlc_); +#ifdef TESTDB_USE_CANSTRUCT +uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe); +#else +uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide); +#endif // TESTDB_USE_CANSTRUCT + +uint32_t Unpack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, const uint8_t* _d, uint8_t dlc_); +#ifdef TESTDB_USE_CANSTRUCT +uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, __CoderDbcCanFrame_t__* cframe); +#else +uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide); +#endif // TESTDB_USE_CANSTRUCT + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/usr/testdb-fmon.c b/test/gencode/usr/testdb-fmon.c new file mode 100644 index 0000000..11e7607 --- /dev/null +++ b/test/gencode/usr/testdb-fmon.c @@ -0,0 +1,46 @@ +#include "testdb-fmon.h" + +#ifdef TESTDB_USE_DIAG_MONITORS + +/* +Put the monitor function content here, keep in mind - +next generation will completely clear all manually added code (!) +*/ + +void FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +void FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +void FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +void FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +void FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +void FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +#endif // TESTDB_USE_DIAG_MONITORS diff --git a/test/testdb.dbc b/test/testdb.dbc new file mode 100755 index 0000000..d03d2d6 --- /dev/null +++ b/test/testdb.dbc @@ -0,0 +1,138 @@ +VERSION "1.10" + + +NS_ : + NS_DESC_ + CM_ + BA_DEF_ + BA_ + VAL_ + CAT_DEF_ + CAT_ + FILTER + BA_DEF_DEF_ + EV_DATA_ + ENVVAR_DATA_ + SGTYPE_ + SGTYPE_VAL_ + BA_DEF_SGTYPE_ + BA_SGTYPE_ + SIG_TYPE_REF_ + VAL_TABLE_ + SIG_GROUP_ + SIG_VALTYPE_ + SIGTYPE_VALTYPE_ + BO_TX_BU_ + BA_DEF_REL_ + BA_REL_ + BA_DEF_DEF_REL_ + BU_SG_REL_ + BU_EV_REL_ + BU_BO_REL_ + SG_MUL_VAL_ + +BS_: + +BU_: EPS ESP BMS BCM + + +BO_ 1911 SIG_TEST_1: 8 EPS + SG_ U7_TEST_1 : 55|7@0+ (1,-255) [-255|-128] "" BCM + SG_ sig_7 : 40|7@1- (1.2,0) [-76.8|75.6] "" BCM + SG_ sig8 : 32|8@1- (5,0) [-640|635] "" BCM + SG_ sig15_2 : 16|15@1- (1.9,-2500) [-33629.6|28627.7] "" BCM + SG_ sig15 : 0|15@1- (3,-1024) [-50176|48125] "" BCM + +BO_ 2684354550 EMPTY_EXT_ID: 8 BCM + SG_ CS : 13|6@0+ (1,0) [0|255] "" BCM,ESP,BMS + SG_ ValTest : 7|2@0+ (1,0) [0|0] "c" BCM,ESP,BMS + +BO_ 555 UTEST_3: 8 BCM + SG_ U32_TEST_1 : 0|32@1+ (1,0) [0|4294967295] "" BMS + +BO_ 333 UTEST_2: 8 BCM + SG_ U8_TEST_1 : 39|8@0+ (1,0) [0|255] "" BMS + SG_ U7_TEST_1 : 47|7@0+ (1,-255) [-255|-128] "" BMS + SG_ ValTest : 30|2@0+ (1,0) [0|3] "c" ESP,BMS + SG_ U28_TEST_1 : 0|28@1+ (1,0) [0|4294967295] "" ESP,BMS + +BO_ 864 FLT_TEST_1: 8 BMS + SG_ INT_TEST_2 : 15|7@0- (5,0) [-320|315] "" BCM + SG_ INT_TEST_1 : 53|4@0+ (9,-11) [-11|124] "" BCM + SG_ FLT4_TEST_2 : 43|4@0+ (2.01,-5) [-5|25.15] "" BCM + SG_ FLT4_TEST_1 : 39|4@0+ (2.01,-0.01) [-0.01|30.14] "" BCM + SG_ FLT4_TEST_3 : 47|4@0+ (2,-10.1) [-10.1|19.9] "" BCM + SG_ Accel : 24|12@1+ (0.1,-100) [-100|309.5] "m/s" BCM + SG_ ValTable : 1|2@0+ (1,0) [0|3] "e" BCM + SG_ Position : 7|4@0+ (1,0) [0|15] "" BCM + SG_ RC : 16|4@1+ (1,0) [0|15] "" BCM + SG_ CS : 20|4@1+ (1,0) [0|15] "" BCM + +BO_ 352 EMPTY_0: 8 BCM + SG_ CS : 38|6@0+ (1,0) [0|63] "" BMS + SG_ RC : 47|4@1+ (1,0) [0|15] "" BMS + +BO_TX_BU_ 352 : BMS,ESP,BCM; + + +CM_ BU_ BMS "Selector ECU info block +"; +CM_ BU_ BCM "ESP ECU information"; +CM_ SG_ 2684354550 CS " test pattern"; +CM_ SG_ 2684354550 ValTest "This is test signal for Value Table + + + +"; +CM_ SG_ 333 ValTest "This is test signal for Value Table + + + +"; +CM_ SG_ 864 Accel "Test floating point value."; +CM_ SG_ 864 ValTable "This is just comment. +Next line."; +CM_ SG_ 864 RC ""; +CM_ SG_ 864 CS ""; +CM_ SG_ 352 CS " test pattern"; +CM_ SG_ 352 RC ""; +BA_DEF_ SG_ "GenSigSendType" ENUM "Cyclic","OnWrite","OnWriteWithRepetition","OnChange","OnChangeWithRepetition","IfActive","IfActiveWithRepetition","NoSigSendType"; +BA_DEF_ BO_ "GenMsgSendType " ENUM "Cyclic","not_used","not_used","not_used","not_used","Cyclic","not_used","IfActive","NoMsgSendType"; +BA_DEF_ BU_ "NmStationAddress" HEX 0 0; +BA_DEF_ "BusType" STRING ; +BA_DEF_ "DBName" STRING ; +BA_DEF_ BO_ "GenMsgCycleTime" INT 2 50000; +BA_DEF_ BO_ "GenMsgDelayTime" INT 1 1000; +BA_DEF_ BO_ "GenMsgNrOfRepetitions" INT 1 999999; +BA_DEF_ BO_ "GenMsgSendType" ENUM "cyclic","spontaneous","cyclicIfActive","spontaneousWithDelay","cyclicAndSpontaneous","cyclicAndSpontaneousWithDelay","spontaneousWithRepetition","cyclicIfActiveAndSpontaneousWD"; +BA_DEF_ SG_ "GenSigInactiveValue" INT 0 100000; +BA_DEF_ SG_ "GenSigStartValue" FLOAT 0 100000000000; +BA_DEF_DEF_ "GenSigSendType" "Cyclic"; +BA_DEF_DEF_ "GenMsgSendType " "NoMsgSendType"; +BA_DEF_DEF_ "NmStationAddress" 0; +BA_DEF_DEF_ "BusType" ""; +BA_DEF_DEF_ "DBName" ""; +BA_DEF_DEF_ "GenMsgCycleTime" 100; +BA_DEF_DEF_ "GenMsgDelayTime" 1; +BA_DEF_DEF_ "GenMsgNrOfRepetitions" 1; +BA_DEF_DEF_ "GenMsgSendType" "spontaneous"; +BA_DEF_DEF_ "GenSigInactiveValue" 0; +BA_DEF_DEF_ "GenSigStartValue" 0; +BA_ "DBName" "ceedselector"; +BA_ "GenMsgSendType" BO_ 2684354550 0; +BA_ "GenMsgSendType" BO_ 864 0; +BA_ "GenMsgCycleTime" BO_ 864 101; +BA_ "GenMsgSendType" BO_ 352 0; +BA_ "GenMsgCycleTime" BO_ 352 101; +BA_ "GenSigStartValue" SG_ 1911 sig15_2 1315.78947368421; +BA_ "GenSigStartValue" SG_ 1911 sig15 341.333333333333; +BA_ "GenSigStartValue" SG_ 864 INT_TEST_2 0.6; +BA_ "GenSigStartValue" SG_ 864 INT_TEST_1 0; +BA_ "GenSigStartValue" SG_ 864 FLT4_TEST_2 0; +BA_ "GenSigStartValue" SG_ 864 FLT4_TEST_1 0; +BA_ "GenSigStartValue" SG_ 864 FLT4_TEST_3 5.05; +BA_ "GenSigStartValue" SG_ 864 Accel 1000; +VAL_ 2684354550 ValTest 3 "Unsupported" 2 "Fail" 1 "OK" 0 "Undefined" ; +VAL_ 333 ValTest 3 "Unsupported" 2 "Fail" 1 "OK" 0 "Undefined" ; +VAL_ 864 ValTable 3 "Unsupported" 2 "Fail" 1 "OK" 0 "Undefined" ; + From 9100dba4c764c3c1ca763c33a949d3d63fedc4ed Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 11 Mar 2022 23:10:16 +0300 Subject: [PATCH 123/181] Removed unused line. --- src/maincli.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index 8f3d74d..f2dd653 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -70,8 +70,6 @@ std::vector getoptions(int argc, char** argv) int main(int argc, char* argv[]) { - const std::string arg_ops = "dbc:out:rxnodes:rw"; - bool err = false; bool dbc_ok = false; bool path_ok = false; From 3eff250217a97e5bbd60ab8169be2e3577eaf5e0 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 6 May 2022 22:41:47 +0300 Subject: [PATCH 124/181] Added helper for valid C-identifier stripper. --- src/helpers/formatter.cpp | 43 +++++++++++++++++++++++++++++++++++++++ src/helpers/formatter.h | 8 ++++++++ 2 files changed, 51 insertions(+) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index 0fb3df4..4847e7c 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -87,3 +87,46 @@ std::string str_trim(std::string s) return s; } + +template +static inline bool in_range(const char c) +{ + return ((c >= L) && (c <= U)); +} + +static bool is_first_valid(const char c) +{ + return in_range<'a', 'z'>(c) || in_range<'A', 'Z'>(c) || c == '_'; +} + +static bool is_nonfirst_valid(const char c) +{ + return is_first_valid(c) || in_range<'0', '9'>(c); +} + +std::string make_c_name(const std::string& s) +{ + std::string ret{}; + + if (s.length() == 0) + { + return ret; + } + + for (auto i = 0; i < s.length(); i++) + { + if ((ret.length() == 0 && is_first_valid(s[i])) || + (ret.length() > 0 && is_nonfirst_valid(s[i]))) + { + // basic C-identifier rule + ret += s[i]; + } + else if (s[i] == ' ') + { + // special case for whitespaces + ret += '_'; + } + } + + return ret; +} diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index 5c29c0d..1ca914e 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -14,3 +14,11 @@ std::string str_toupper(std::string s); std::string str_tolower(std::string s); std::string str_trim(std::string s); + +/** + * @brief Makes input string valid C-identifier + * + * @param s source string + * @return std::string + */ +std::string make_c_name(const std::string& s); From cb9137ec554775887efb4f629b1d870da6489c45 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 6 May 2022 22:42:51 +0300 Subject: [PATCH 125/181] Main dbc driver name stripped by C-name checker. --- src/maincli.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/maincli.cpp b/src/maincli.cpp index f2dd653..c7c1669 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "parser/dbcscanner.h" #include "codegen/c-main-generator.h" #include "codegen/c-util-generator.h" @@ -117,6 +118,16 @@ int main(int argc, char* argv[]) return 0; } + if (drvname_ok) + { + dbc_driver_name = make_c_name(dbc_driver_name); + + if (dbc_driver_name.length() == 0) + { + drvname_ok = false; + } + } + if (drvname_ok && path_ok && dbc_ok) { From 961c15b644499b1079cf95ab65657c32622348b7 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 11:01:19 +0300 Subject: [PATCH 126/181] Added more specific value tables handling. --- src/parser/dbclineparser.cpp | 11 ++++++++++- src/parser/dbclineparser.h | 5 +++-- src/parser/dbcscanner.cpp | 6 +++++- src/parser/dbcscanner.h | 3 +++ src/types/comment.h | 10 ++++++++++ src/types/message.h | 2 ++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index b080752..4ae6546 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -1,4 +1,6 @@ #include "dbclineparser.h" +#include +#include #include #include #include @@ -515,7 +517,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s return ret; } -bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) +bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line, ValTable_t& vtab) { bool ret = false; @@ -546,10 +548,17 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) comm->Text = ""; comm->ca_target = CommentTarget::Signal; + // prepare value table container + vtab.SigName = items[2]; + vtab.vpairs.clear(); + for (size_t valpair = 3; valpair < (items.size() - 1); valpair += 2) { comm->Text += " " + items[valpair + 0] + " : "; comm->Text += items[valpair + 1] + '\n'; + + auto valdef = make_c_name(items[valpair + 1]); + vtab.vpairs.push_back({valdef, (uint32_t)atoll((items[valpair + 0]).c_str())}); } if (comm->Text.size() > 0) diff --git a/src/parser/dbclineparser.h b/src/parser/dbclineparser.h index a069c9a..9b0c025 100644 --- a/src/parser/dbclineparser.h +++ b/src/parser/dbclineparser.h @@ -65,8 +65,9 @@ class DbcLineParser { bool ParseCommentLine(Comment_t* cm, const std::string& line); // tries to parse value table string in line - // and load result to attr ValueStr, return true if parsed ok - bool ParseValTableLine(Comment_t* cm, const std::string& line); + // saves result as comment text in @cm object, and as + // pairs of items (definition / value) in @vtab + bool ParseValTableLine(Comment_t* cm, const std::string& line, ValTable_t& vtab); /** * @brief tries to find string with information about frame which has diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 76b2820..d221a6f 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -154,6 +154,8 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) Comment_t cmmnt; + ValTable_t vals; + AttributeDescriptor_t attr; while (!readstrm.eof()) @@ -229,7 +231,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) } } - if (lparser.ParseValTableLine(&cmmnt, sline)) + if (lparser.ParseValTableLine(&cmmnt, sline, vals)) { // update message comment field auto msg = find_message(dblist.msgs, cmmnt.MsgId); @@ -250,6 +252,8 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { // signal has been found, update commnet text msg->Signals[i].ValueText = cmmnt.Text; + // save collected value table's definitions to signal + msg->Signals[i].ValDefs = vals; } } } diff --git a/src/parser/dbcscanner.h b/src/parser/dbcscanner.h index 0aefda1..7abff93 100644 --- a/src/parser/dbcscanner.h +++ b/src/parser/dbcscanner.h @@ -31,4 +31,7 @@ class DbcScanner { DbcLineParser lparser; + // this variable is used for gathering value table signal's information + std::pair vpairs; + }; diff --git a/src/types/comment.h b/src/types/comment.h index 34527b3..ff1e3f2 100644 --- a/src/types/comment.h +++ b/src/types/comment.h @@ -2,6 +2,7 @@ #include #include +#include enum class CommentTarget { @@ -27,3 +28,12 @@ typedef struct std::string Text; } Comment_t; + + +typedef struct +{ + std::string SigName; + + std::vector> vpairs{}; + +} ValTable_t; diff --git a/src/types/message.h b/src/types/message.h index bd33f9c..99b0225 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -83,6 +83,8 @@ typedef struct std::vector RecS; + ValTable_t ValDefs; + std::string CommentText; std::string ValueText; From 6661cdd2c48324a033d60fa1ce1a08dd459f9ec8 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 11:02:17 +0300 Subject: [PATCH 127/181] Added value table's macros printing to main driver header. --- src/codegen/c-main-generator.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 94e68fe..cf0697b 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -137,6 +137,30 @@ void CiMainGenerator::Gen_MainHeader() { max_sig_name_len = s.Name.size(); } + + // For each signal in current message print value tables definitions + if (s.ValDefs.vpairs.size() > 0) + { + fwriter->AppendLine(StrPrint("\n// Value tables for @%s signal", s.Name.c_str()), 2); + + for (auto i = 0; i < s.ValDefs.vpairs.size(); i++) + { + // The value table definition consists of 'signal name + message name + value definition' + // This provides reliable way of avoiding issues with same macros names + std::string defname = StrPrint("%s_%s_%s", s.Name.c_str(), m.Name.c_str(), s.ValDefs.vpairs[i].first.c_str()); + + // @ifndef guard for the case when different values of table have + // the same name (it is valid for DBC file format) + // For this case only one of same named values will be available as macro + fwriter->AppendLine(StrPrint("#ifndef %s", defname.c_str())); + + fwriter->AppendLine(StrPrint("#define %s_%s_%s (%d)", + s.Name.c_str(), m.Name.c_str(), s.ValDefs.vpairs[i].first.c_str(), + s.ValDefs.vpairs[i].second)); + + fwriter->AppendLine(StrPrint("#endif"), 2); + } + } } fwriter->AppendText("\n"); From 013b993c0220c7ddff36a2e9c1c4ceda43575dc2 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 11:57:55 +0300 Subject: [PATCH 128/181] Test DBC with new val table macros generated. --- test/gencode/lib/testdb.c | 17 ++++-- test/gencode/lib/testdb.h | 118 ++++++++++++++++++++++++++++++++++++++ test/testdb.dbc | 3 + 3 files changed, 133 insertions(+), 5 deletions(-) diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index e72a643..c662af0 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -9,11 +9,15 @@ #endif // TESTDB_USE_DIAG_MONITORS -// To compile this function you need to typedef 'bitext_t' and 'ubitext_t' -// globally in @dbccodeconf.h or locally in 'dbcdrvname'-config.h -// Type selection may affect common performance. Most useful types are: -// bitext_t : int64_t and ubitext_t : uint64_t -static bitext_t __ext_sig__( ubitext_t val, uint8_t bits ) +// This function performs extension of sign for the signals +// which have non-aligned to power of 2 bit's width. +// The types 'bitext_t' and 'ubitext_t' define maximal bit width which +// can be correctly handled. You need to select type which can contain +// n+1 bits where n is the largest signed signal width. For example if +// the most wide signed signal has a width of 31 bits you need to set +// bitext_t as int32_t and ubitext_t as uint32_t +// Defined these typedefs in @dbccodeconf.h or locally in 'dbcdrvname'-config.h +static bitext_t __ext_sig__(ubitext_t val, uint8_t bits) { ubitext_t const m = 1u << (bits - 1); return (val ^ m) - m; @@ -177,6 +181,7 @@ uint32_t Unpack_UTEST_3_testdb(UTEST_3_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; _m->U32_TEST_1 = ((_d[3] & (0xFFU)) << 24) | ((_d[2] & (0xFFU)) << 16) | ((_d[1] & (0xFFU)) << 8) | (_d[0] & (0xFFU)); + _m->TestValTableID = (_d[4] & (0x07U)); #ifdef TESTDB_USE_DIAG_MONITORS _m->mon1.dlc_error = (dlc_ < UTEST_3_DLC); @@ -199,6 +204,7 @@ uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, __CoderDbcCanFrame_t__* cframe) cframe->Data[1] |= ((_m->U32_TEST_1 >> 8) & (0xFFU)); cframe->Data[2] |= ((_m->U32_TEST_1 >> 16) & (0xFFU)); cframe->Data[3] |= ((_m->U32_TEST_1 >> 24) & (0xFFU)); + cframe->Data[4] |= (_m->TestValTableID & (0x07U)); cframe->MsgId = UTEST_3_CANID; cframe->DLC = UTEST_3_DLC; @@ -216,6 +222,7 @@ uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _d[1] |= ((_m->U32_TEST_1 >> 8) & (0xFFU)); _d[2] |= ((_m->U32_TEST_1 >> 16) & (0xFFU)); _d[3] |= ((_m->U32_TEST_1 >> 24) & (0xFFU)); + _d[4] |= (_m->TestValTableID & (0x07U)); *_len = UTEST_3_DLC; *_ide = UTEST_3_IDE; diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 3ef3753..707ec95 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -27,6 +27,25 @@ extern "C" { #define UTEST_2_IDE (0U) #define UTEST_2_DLC (8U) #define UTEST_2_CANID (0x14d) + +// Value tables for @ValTest signal + +#ifndef ValTest_UTEST_2_Unsupported +#define ValTest_UTEST_2_Unsupported (3) +#endif + +#ifndef ValTest_UTEST_2_Fail +#define ValTest_UTEST_2_Fail (2) +#endif + +#ifndef ValTest_UTEST_2_OK +#define ValTest_UTEST_2_OK (1) +#endif + +#ifndef ValTest_UTEST_2_Undefined +#define ValTest_UTEST_2_Undefined (0) +#endif + // signal: @U7_TEST_1_ro #define TESTDB_U7_TEST_1_ro_CovFactor (1) #define TESTDB_U7_TEST_1_ro_toS(x) ( (uint8_t) ((x) - (-255)) ) @@ -135,16 +154,77 @@ typedef struct #define UTEST_3_DLC (8U) #define UTEST_3_CANID (0x22b) +// Value tables for @TestValTableID signal + +#ifndef TestValTableID_UTEST_3_Description_for_the_value_0x7 +#define TestValTableID_UTEST_3_Description_for_the_value_0x7 (-2) +#endif + +#ifndef TestValTableID_UTEST_3_Udef +#define TestValTableID_UTEST_3_Udef (-1) +#endif + +#ifndef TestValTableID_UTEST_3_Udef +#define TestValTableID_UTEST_3_Udef (6) +#endif + +#ifndef TestValTableID_UTEST_3_Udef +#define TestValTableID_UTEST_3_Udef (5) +#endif + +#ifndef TestValTableID_UTEST_3_Udef +#define TestValTableID_UTEST_3_Udef (4) +#endif + +#ifndef TestValTableID_UTEST_3_Error +#define TestValTableID_UTEST_3_Error (3) +#endif + +#ifndef TestValTableID_UTEST_3_Ok +#define TestValTableID_UTEST_3_Ok (2) +#endif + +#ifndef TestValTableID_UTEST_3_State_one +#define TestValTableID_UTEST_3_State_one (1) +#endif + +#ifndef TestValTableID_UTEST_3_State_1 +#define TestValTableID_UTEST_3_State_1 (0) +#endif + + typedef struct { #ifdef TESTDB_USE_BITS_SIGNAL uint32_t U32_TEST_1; // Bits=32 + // -2 : "Description for the value '0x7'" + // -1 : "Udef" + // 6 : "Udef" + // 5 : "Udef" + // 4 : "Udef" + // 3 : "Error" + // 2 : "Ok" + // 1 : "State one" + // 0 : "State 1" + uint8_t TestValTableID : 3; // Bits= 3 + #else uint32_t U32_TEST_1; // Bits=32 + // -2 : "Description for the value '0x7'" + // -1 : "Udef" + // 6 : "Udef" + // 5 : "Udef" + // 4 : "Udef" + // 3 : "Error" + // 2 : "Ok" + // 1 : "State one" + // 0 : "State 1" + uint8_t TestValTableID; // Bits= 3 + #endif // TESTDB_USE_BITS_SIGNAL #ifdef TESTDB_USE_DIAG_MONITORS @@ -160,6 +240,25 @@ typedef struct #define FLT_TEST_1_DLC (8U) #define FLT_TEST_1_CANID (0x360) #define FLT_TEST_1_CYC (101U) + +// Value tables for @ValTable signal + +#ifndef ValTable_FLT_TEST_1_Unsupported +#define ValTable_FLT_TEST_1_Unsupported (3) +#endif + +#ifndef ValTable_FLT_TEST_1_Fail +#define ValTable_FLT_TEST_1_Fail (2) +#endif + +#ifndef ValTable_FLT_TEST_1_OK +#define ValTable_FLT_TEST_1_OK (1) +#endif + +#ifndef ValTable_FLT_TEST_1_Undefined +#define ValTable_FLT_TEST_1_Undefined (0) +#endif + // signal: @INT_TEST_2_ro #define TESTDB_INT_TEST_2_ro_CovFactor (5) #define TESTDB_INT_TEST_2_ro_toS(x) ( (int8_t) ((x) / (5)) ) @@ -423,6 +522,25 @@ typedef struct #define EMPTY_EXT_ID_DLC (8U) #define EMPTY_EXT_ID_CANID (0x1ffffff6) +// Value tables for @ValTest signal + +#ifndef ValTest_EMPTY_EXT_ID_Unsupported +#define ValTest_EMPTY_EXT_ID_Unsupported (3) +#endif + +#ifndef ValTest_EMPTY_EXT_ID_Fail +#define ValTest_EMPTY_EXT_ID_Fail (2) +#endif + +#ifndef ValTest_EMPTY_EXT_ID_OK +#define ValTest_EMPTY_EXT_ID_OK (1) +#endif + +#ifndef ValTest_EMPTY_EXT_ID_Undefined +#define ValTest_EMPTY_EXT_ID_Undefined (0) +#endif + + typedef struct { #ifdef TESTDB_USE_BITS_SIGNAL diff --git a/test/testdb.dbc b/test/testdb.dbc index d03d2d6..cbbc77f 100755 --- a/test/testdb.dbc +++ b/test/testdb.dbc @@ -34,6 +34,7 @@ NS_ : BS_: BU_: EPS ESP BMS BCM +VAL_TABLE_ VtTestSig -2 "Description for the value '0x7'" -1 "Udef" 6 "Udef" 5 "Udef" 4 "Udef" 3 "Error" 2 "Ok" 1 "State one" 0 "State 1" ; BO_ 1911 SIG_TEST_1: 8 EPS @@ -48,6 +49,7 @@ BO_ 2684354550 EMPTY_EXT_ID: 8 BCM SG_ ValTest : 7|2@0+ (1,0) [0|0] "c" BCM,ESP,BMS BO_ 555 UTEST_3: 8 BCM + SG_ TestValTableID : 32|3@1+ (1,0) [0|7] "" BMS SG_ U32_TEST_1 : 0|32@1+ (1,0) [0|4294967295] "" BMS BO_ 333 UTEST_2: 8 BCM @@ -133,6 +135,7 @@ BA_ "GenSigStartValue" SG_ 864 FLT4_TEST_1 0; BA_ "GenSigStartValue" SG_ 864 FLT4_TEST_3 5.05; BA_ "GenSigStartValue" SG_ 864 Accel 1000; VAL_ 2684354550 ValTest 3 "Unsupported" 2 "Fail" 1 "OK" 0 "Undefined" ; +VAL_ 555 TestValTableID -2 "Description for the value '0x7'" -1 "Udef" 6 "Udef" 5 "Udef" 4 "Udef" 3 "Error" 2 "Ok" 1 "State one" 0 "State 1" ; VAL_ 333 ValTest 3 "Unsupported" 2 "Fail" 1 "OK" 0 "Undefined" ; VAL_ 864 ValTable 3 "Unsupported" 2 "Fail" 1 "OK" 0 "Undefined" ; From e4fd53f28f45d33510fca571e480020993ca37e7 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 11:58:10 +0300 Subject: [PATCH 129/181] Added more info about sign extending function. --- src/codegen/c-main-generator.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index cf0697b..9e9f3b3 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -14,11 +14,15 @@ const char* ext_sig_func_name = "__ext_sig__"; const char* extend_func_body = - "// To compile this function you need to typedef 'bitext_t' and 'ubitext_t'\n" - "// globally in @dbccodeconf.h or locally in 'dbcdrvname'-config.h\n" - "// Type selection may affect common performance. Most useful types are:\n" - "// bitext_t : int64_t and ubitext_t : uint64_t\n" - "static bitext_t %s( ubitext_t val, uint8_t bits )\n" + "// This function performs extension of sign for the signals\n" + "// which have non-aligned to power of 2 bit's width.\n" + "// The types 'bitext_t' and 'ubitext_t' define maximal bit width which\n" + "// can be correctly handled. You need to select type which can contain\n" + "// n+1 bits where n is the largest signed signal width. For example if\n" + "// the most wide signed signal has a width of 31 bits you need to set\n" + "// bitext_t as int32_t and ubitext_t as uint32_t\n" + "// Defined these typedefs in @dbccodeconf.h or locally in 'dbcdrvname'-config.h\n" + "static bitext_t %s(ubitext_t val, uint8_t bits)\n" "{\n" " ubitext_t const m = 1u << (bits - 1);\n" " return (val ^ m) - m;\n" From 230933fb0639340126f65d683e9832c211564ce5 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 12:07:25 +0300 Subject: [PATCH 130/181] Minor improvement in signal's info comments. --- src/codegen/c-main-generator.cpp | 24 +++++++++++++---- src/helpers/formatter.cpp | 13 ++++++++++ src/helpers/formatter.h | 2 ++ test/gencode/lib/testdb.h | 44 ++++++++++++++++---------------- 4 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 9e9f3b3..6239c66 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -646,16 +646,23 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendText(StrPrint(" Bits=%2d", sig.LengthBit)); + size_t offset = 0; + std::string infocmnt{}; + if (sig.IsDoubleSig) { if (sig.Offset != 0) { - fwriter->AppendText(StrPrint(" Offset= %-18f", sig.Offset)); + infocmnt = IndentedString(offset, infocmnt); + offset += 27; + infocmnt += StrPrint(" Offset= %f", sig.Offset); } if (sig.Factor != 1) { - fwriter->AppendText(StrPrint(" Factor= %-15f", sig.Factor)); + infocmnt = IndentedString(offset, infocmnt); + offset += 24; + infocmnt += StrPrint(" Factor= %f", sig.Factor); } } else if (sig.IsSimpleSig == false) @@ -663,20 +670,27 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi // 2 type of signal if (sig.Offset != 0) { - fwriter->AppendText(StrPrint(" Offset= %-18d", (int)sig.Offset)); + infocmnt = IndentedString(offset, infocmnt); + offset += 27; + infocmnt += StrPrint(" Offset= %d", (int)sig.Offset); } if (sig.Factor != 1) { - fwriter->AppendText(StrPrint(" Factor= %-15d", (int)sig.Factor)); + infocmnt = IndentedString(offset, infocmnt); + offset += 24; + infocmnt += StrPrint(" Factor= %d", (int)sig.Factor); } } if (sig.Unit.size() > 0) { - fwriter->AppendText(StrPrint(" Unit:'%s'", sig.Unit.c_str())); + infocmnt = IndentedString(offset, infocmnt); + infocmnt += StrPrint(" Unit:'%s'", sig.Unit.c_str()); } + fwriter->AppendText(infocmnt); + fwriter->AppendLine("", 2); if (!sig.IsSimpleSig) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index 4847e7c..eb7d74d 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -17,6 +17,19 @@ static const std::string __typeprint[8] = "uint64_t" }; +std::string IndentedString(size_t n, const std::string& source, const char c) +{ + if (source.length() >= n) + { + return source; + } + else + { + std::string indent(n - source.length(), c); + return source + indent; + } +} + const char* StrPrint(const char* format, ...) { va_list args; diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index 1ca914e..d9f5599 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -5,6 +5,8 @@ #include #include +std::string IndentedString(size_t n, const std::string& source, const char c = ' '); + const char* StrPrint(const char* format, ...); std::string PrintType(uint8_t tid); diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 707ec95..0379cb4 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -67,7 +67,7 @@ typedef struct uint8_t U8_TEST_1; // Bits= 8 - uint8_t U7_TEST_1_ro : 7; // Bits= 7 Offset= -255 + uint8_t U7_TEST_1_ro : 7; // Bits= 7 Offset= -255 #ifdef TESTDB_USE_SIGFLOAT int16_t U7_TEST_1_phys; @@ -87,7 +87,7 @@ typedef struct uint8_t U8_TEST_1; // Bits= 8 - uint8_t U7_TEST_1_ro; // Bits= 7 Offset= -255 + uint8_t U7_TEST_1_ro; // Bits= 7 Offset= -255 #ifdef TESTDB_USE_SIGFLOAT int16_t U7_TEST_1_phys; @@ -298,7 +298,7 @@ typedef struct uint8_t Position : 4; // Bits= 4 - int8_t INT_TEST_2_ro : 7; // [-] Bits= 7 Factor= 5 + int8_t INT_TEST_2_ro : 7; // [-] Bits= 7 Factor= 5 #ifdef TESTDB_USE_SIGFLOAT int16_t INT_TEST_2_phys; @@ -316,25 +316,25 @@ typedef struct sigfloat_t Accel_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_1_ro : 4; // Bits= 4 Offset= -0.010000 Factor= 2.010000 + uint8_t FLT4_TEST_1_ro : 4; // Bits= 4 Offset= -0.010000 Factor= 2.010000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_1_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_2_ro : 4; // Bits= 4 Offset= -5.000000 Factor= 2.010000 + uint8_t FLT4_TEST_2_ro : 4; // Bits= 4 Offset= -5.000000 Factor= 2.010000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_2_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_3_ro : 4; // Bits= 4 Offset= -10.100000 Factor= 2.000000 + uint8_t FLT4_TEST_3_ro : 4; // Bits= 4 Offset= -10.100000 Factor= 2.000000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_3_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t INT_TEST_1_ro : 4; // Bits= 4 Offset= -11 Factor= 9 + uint8_t INT_TEST_1_ro : 4; // Bits= 4 Offset= -11 Factor= 9 #ifdef TESTDB_USE_SIGFLOAT int8_t INT_TEST_1_phys; @@ -358,7 +358,7 @@ typedef struct uint8_t Position; // Bits= 4 - int8_t INT_TEST_2_ro; // [-] Bits= 7 Factor= 5 + int8_t INT_TEST_2_ro; // [-] Bits= 7 Factor= 5 #ifdef TESTDB_USE_SIGFLOAT int16_t INT_TEST_2_phys; @@ -376,25 +376,25 @@ typedef struct sigfloat_t Accel_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_1_ro; // Bits= 4 Offset= -0.010000 Factor= 2.010000 + uint8_t FLT4_TEST_1_ro; // Bits= 4 Offset= -0.010000 Factor= 2.010000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_1_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_2_ro; // Bits= 4 Offset= -5.000000 Factor= 2.010000 + uint8_t FLT4_TEST_2_ro; // Bits= 4 Offset= -5.000000 Factor= 2.010000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_2_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_3_ro; // Bits= 4 Offset= -10.100000 Factor= 2.000000 + uint8_t FLT4_TEST_3_ro; // Bits= 4 Offset= -10.100000 Factor= 2.000000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_3_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t INT_TEST_1_ro; // Bits= 4 Offset= -11 Factor= 9 + uint8_t INT_TEST_1_ro; // Bits= 4 Offset= -11 Factor= 9 #ifdef TESTDB_USE_SIGFLOAT int8_t INT_TEST_1_phys; @@ -445,31 +445,31 @@ typedef struct { #ifdef TESTDB_USE_BITS_SIGNAL - int16_t sig15_ro; // [-] Bits=15 Offset= -1024 Factor= 3 + int16_t sig15_ro; // [-] Bits=15 Offset= -1024 Factor= 3 #ifdef TESTDB_USE_SIGFLOAT int32_t sig15_phys; #endif // TESTDB_USE_SIGFLOAT - int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 + int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig15_2_phys; #endif // TESTDB_USE_SIGFLOAT - int8_t sig8_ro; // [-] Bits= 8 Factor= 5 + int8_t sig8_ro; // [-] Bits= 8 Factor= 5 #ifdef TESTDB_USE_SIGFLOAT int16_t sig8_phys; #endif // TESTDB_USE_SIGFLOAT - int8_t sig_7_ro : 7; // [-] Bits= 7 Factor= 1.200000 + int8_t sig_7_ro : 7; // [-] Bits= 7 Factor= 1.200000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig_7_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t U7_TEST_1_ro : 7; // Bits= 7 Offset= -255 + uint8_t U7_TEST_1_ro : 7; // Bits= 7 Offset= -255 #ifdef TESTDB_USE_SIGFLOAT int16_t U7_TEST_1_phys; @@ -477,31 +477,31 @@ typedef struct #else - int16_t sig15_ro; // [-] Bits=15 Offset= -1024 Factor= 3 + int16_t sig15_ro; // [-] Bits=15 Offset= -1024 Factor= 3 #ifdef TESTDB_USE_SIGFLOAT int32_t sig15_phys; #endif // TESTDB_USE_SIGFLOAT - int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 + int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig15_2_phys; #endif // TESTDB_USE_SIGFLOAT - int8_t sig8_ro; // [-] Bits= 8 Factor= 5 + int8_t sig8_ro; // [-] Bits= 8 Factor= 5 #ifdef TESTDB_USE_SIGFLOAT int16_t sig8_phys; #endif // TESTDB_USE_SIGFLOAT - int8_t sig_7_ro; // [-] Bits= 7 Factor= 1.200000 + int8_t sig_7_ro; // [-] Bits= 7 Factor= 1.200000 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig_7_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t U7_TEST_1_ro; // Bits= 7 Offset= -255 + uint8_t U7_TEST_1_ro; // Bits= 7 Offset= -255 #ifdef TESTDB_USE_SIGFLOAT int16_t U7_TEST_1_phys; From 739870b524b1bad84a8f9a0607986e17a6798c8c Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 12:17:55 +0300 Subject: [PATCH 131/181] Remove extra empty comment line generation. --- src/parser/dbclineparser.cpp | 6 ++++++ test/gencode/lib/testdb.h | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 4ae6546..cb4d163 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -468,6 +468,12 @@ bool DbcLineParser::ParseCommentLine(Comment_t* cm, const std::string& line) cm->Text = items[1]; } + if (cm->Text.size() > 0 && cm->Text.back() == '\n') + { + // remove last '\n' symbol in the string end + cm->Text.pop_back(); + } + ret = true; } diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 0379cb4..a559dd4 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -58,7 +58,6 @@ typedef struct uint32_t U28_TEST_1; // Bits=28 // This is test signal for Value Table - // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" @@ -78,7 +77,6 @@ typedef struct uint32_t U28_TEST_1; // Bits=28 // This is test signal for Value Table - // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" @@ -546,7 +544,6 @@ typedef struct #ifdef TESTDB_USE_BITS_SIGNAL // This is test signal for Value Table - // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" @@ -559,7 +556,6 @@ typedef struct #else // This is test signal for Value Table - // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" From 556c0729dd2074536eb9e638107e396689d63832 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 12:44:32 +0300 Subject: [PATCH 132/181] Added test on source code versions (main driver h/c). --- src/codegen/c-main-generator.cpp | 7 +++++++ test/gencode/lib/testdb.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 6239c66..9a1a612 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -266,6 +266,13 @@ void CiMainGenerator::Gen_MainSource() // include main header file fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->core_h.fname.c_str()), 3); + fwriter->AppendLine("// DBC file version"); + fwriter->AppendLine(StrPrint("#if (%s != (%uU)) || (%s != (%uU))", + fdesc->verhigh_def.c_str(), p_dlist->ver.hi, fdesc->verlow_def.c_str(), p_dlist->ver.low)); + + fwriter->AppendLine(StrPrint("#error The %s dbc source files have different versions", fdesc->DRVNAME.c_str())); + fwriter->AppendLine("#endif", 2); + // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index c662af0..19dae3e 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -1,6 +1,11 @@ #include "testdb.h" +// DBC file version +#if (VER_TESTDB_MAJ != (1U)) || (VER_TESTDB_MIN != (10U)) +#error The TESTDB dbc source files have different versions +#endif + #ifdef TESTDB_USE_DIAG_MONITORS // Function prototypes to be called each time CAN frame is unpacked // FMon function may detect RC, CRC or DLC violation From a14407aa0fe9df31995d420b62e919f1505805a8 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 13:20:28 +0300 Subject: [PATCH 133/181] Added test on binutil souce code version (compare with main lib). --- src/codegen/c-util-generator.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 56d9008..368fa1d 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -112,11 +112,6 @@ void CiUtilGenerator::PrintHeader() // include c-main driver header tof->AppendLine(StrPrint("#include \"%s.h\"", file_drvname.c_str()), 2); - // put version info macros - tof->AppendLine("// This version definition comes from main driver version and"); - tof->AppendLine("// can be compared in user code space for strict compatibility test"); - tof->AppendLine(StrPrint("#define %s (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); - tof->AppendLine(StrPrint("#define %s (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); if (rx.size() == 0) { @@ -191,6 +186,14 @@ void CiUtilGenerator::PrintSource() tof->AppendLine(StrPrint("#include \"%s\"", fdesc->util_h.fname.c_str()), 2); + tof->AppendLine("// DBC file version"); + tof->AppendLine(StrPrint("#if (%s != (%uU)) || (%s != (%uU))", + fdesc->verhigh_def.c_str(), p_dlist->ver.hi, fdesc->verlow_def.c_str(), p_dlist->ver.low)); + + tof->AppendLine(StrPrint("#error The %s binutil source file has inconsistency with core dbc lib!", + fdesc->DRVNAME.c_str())); + tof->AppendLine("#endif", 2); + // optional RX and TX struct allocations if (rx.size() > 0 || tx.size() > 0) { From 500427f8eb05d6dd9caf094d093e344efcf795c9 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 13:21:07 +0300 Subject: [PATCH 134/181] Minor style change. --- src/maincli.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/maincli.cpp b/src/maincli.cpp index c7c1669..afd79a9 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -298,7 +298,9 @@ void PrintUsage() std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" << std::endl; - std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils" << std::endl; + std::cout << + "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils" << std::endl; + std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb" << std::endl; std::cout << std::endl; } From 1d163c6f77453aa329b57f0097c40991d0fb5b4e Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 13:21:25 +0300 Subject: [PATCH 135/181] WTF was that? --- src/maincli.cpp | 7 ++- test/gencode/butl/BCM_testdb.c | 26 ----------- test/gencode/butl/BCM_testdb.h | 43 ------------------- test/gencode/butl/BMS_testdb.h | 42 ------------------ test/gencode/butl/EPS_testdb.c | 8 ---- test/gencode/butl/EPS_testdb.h | 31 ------------- test/gencode/butl/ESP_testdb.c | 22 ---------- test/gencode/butl/ESP_testdb.h | 39 ----------------- test/gencode/butl/bcm_testdb-binutil.c | 31 +++++++++++++ test/gencode/butl/bcm_testdb-binutil.h | 38 ++++++++++++++++ .../{BMS_testdb.c => bms_testdb-binutil.c} | 17 +++++--- test/gencode/butl/bms_testdb-binutil.h | 37 ++++++++++++++++ test/gencode/butl/eps_testdb-binutil.c | 13 ++++++ test/gencode/butl/eps_testdb-binutil.h | 26 +++++++++++ test/gencode/butl/esp_testdb-binutil.c | 27 ++++++++++++ test/gencode/butl/esp_testdb-binutil.h | 34 +++++++++++++++ 16 files changed, 222 insertions(+), 219 deletions(-) delete mode 100644 test/gencode/butl/BCM_testdb.c delete mode 100644 test/gencode/butl/BCM_testdb.h delete mode 100644 test/gencode/butl/BMS_testdb.h delete mode 100644 test/gencode/butl/EPS_testdb.c delete mode 100644 test/gencode/butl/EPS_testdb.h delete mode 100644 test/gencode/butl/ESP_testdb.c delete mode 100644 test/gencode/butl/ESP_testdb.h create mode 100644 test/gencode/butl/bcm_testdb-binutil.c create mode 100644 test/gencode/butl/bcm_testdb-binutil.h rename test/gencode/butl/{BMS_testdb.c => bms_testdb-binutil.c} (53%) create mode 100644 test/gencode/butl/bms_testdb-binutil.h create mode 100644 test/gencode/butl/eps_testdb-binutil.c create mode 100644 test/gencode/butl/eps_testdb-binutil.h create mode 100644 test/gencode/butl/esp_testdb-binutil.c create mode 100644 test/gencode/butl/esp_testdb-binutil.h diff --git a/src/maincli.cpp b/src/maincli.cpp index afd79a9..4d8c5c2 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -210,13 +210,16 @@ int main(int argc, char* argv[]) { std::string util_name = nodes[node] + "_" + dbc_driver_name; + // set new driver name for current node + fscreator->FS.drvname = str_tolower(util_name); + fscreator->FS.DRVNAME = str_toupper(fscreator->FS.drvname); fscreator->FS.util_c.dir = fscreator->FS.utildir; fscreator->FS.util_h.dir = fscreator->FS.utildir; - fscreator->FS.util_h.fname = util_name + ".h"; + fscreator->FS.util_h.fname = str_tolower(fscreator->FS.drvname + "-binutil.h"); fscreator->FS.util_h.fpath = fscreator->FS.utildir + "/" + fscreator->FS.util_h.fname; - fscreator->FS.util_c.fname = util_name + ".c"; + fscreator->FS.util_c.fname = str_tolower(fscreator->FS.drvname + "-binutil.c"); fscreator->FS.util_c.fpath = fscreator->FS.utildir + "/" + fscreator->FS.util_c.fname; MsgsClassification groups; diff --git a/test/gencode/butl/BCM_testdb.c b/test/gencode/butl/BCM_testdb.c deleted file mode 100644 index a62802f..0000000 --- a/test/gencode/butl/BCM_testdb.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "BCM_testdb.h" - -#ifdef __DEF_TESTDB__ - -testdb_rx_t testdb_rx; - -testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - -uint32_t testdb_Receive(testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) -{ - uint32_t recid = 0; - if (_id == 0x360U) { - recid = Unpack_FLT_TEST_1_testdb(&(_m->FLT_TEST_1), _d, dlc_); - } else { - if (_id == 0x777U) { - recid = Unpack_SIG_TEST_1_testdb(&(_m->SIG_TEST_1), _d, dlc_); - } else if (_id == 0x1FFFFFF6U) { - recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); - } - } - - return recid; -} - diff --git a/test/gencode/butl/BCM_testdb.h b/test/gencode/butl/BCM_testdb.h deleted file mode 100644 index ff116e0..0000000 --- a/test/gencode/butl/BCM_testdb.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dbccodeconf.h" - -#include "testdb.h" - -// This version definition comes from main driver version and -// can be compared in user code space for strict compatibility test -#define VER_TESTDB_MAJ (1U) -#define VER_TESTDB_MIN (10U) - -typedef struct -{ - FLT_TEST_1_t FLT_TEST_1; - SIG_TEST_1_t SIG_TEST_1; - EMPTY_EXT_ID_t EMPTY_EXT_ID; -} testdb_rx_t; - -typedef struct -{ - UTEST_2_t UTEST_2; - EMPTY_0_t EMPTY_0; - UTEST_3_t UTEST_3; - EMPTY_EXT_ID_t EMPTY_EXT_ID; -} testdb_tx_t; - -uint32_t testdb_Receive(testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); - -#ifdef __DEF_TESTDB__ - -extern testdb_rx_t testdb_rx; - -extern testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - -#ifdef __cplusplus -} -#endif diff --git a/test/gencode/butl/BMS_testdb.h b/test/gencode/butl/BMS_testdb.h deleted file mode 100644 index 26b2c31..0000000 --- a/test/gencode/butl/BMS_testdb.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dbccodeconf.h" - -#include "testdb.h" - -// This version definition comes from main driver version and -// can be compared in user code space for strict compatibility test -#define VER_TESTDB_MAJ (1U) -#define VER_TESTDB_MIN (10U) - -typedef struct -{ - UTEST_2_t UTEST_2; - EMPTY_0_t EMPTY_0; - UTEST_3_t UTEST_3; - EMPTY_EXT_ID_t EMPTY_EXT_ID; -} testdb_rx_t; - -typedef struct -{ - EMPTY_0_t EMPTY_0; - FLT_TEST_1_t FLT_TEST_1; -} testdb_tx_t; - -uint32_t testdb_Receive(testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); - -#ifdef __DEF_TESTDB__ - -extern testdb_rx_t testdb_rx; - -extern testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - -#ifdef __cplusplus -} -#endif diff --git a/test/gencode/butl/EPS_testdb.c b/test/gencode/butl/EPS_testdb.c deleted file mode 100644 index 735e2c9..0000000 --- a/test/gencode/butl/EPS_testdb.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "EPS_testdb.h" - -#ifdef __DEF_TESTDB__ - -testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - diff --git a/test/gencode/butl/EPS_testdb.h b/test/gencode/butl/EPS_testdb.h deleted file mode 100644 index c395ffc..0000000 --- a/test/gencode/butl/EPS_testdb.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dbccodeconf.h" - -#include "testdb.h" - -// This version definition comes from main driver version and -// can be compared in user code space for strict compatibility test -#define VER_TESTDB_MAJ (1U) -#define VER_TESTDB_MIN (10U) - -// There is no any RX mapped massage. - -typedef struct -{ - SIG_TEST_1_t SIG_TEST_1; -} testdb_tx_t; - -#ifdef __DEF_TESTDB__ - -extern testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - -#ifdef __cplusplus -} -#endif diff --git a/test/gencode/butl/ESP_testdb.c b/test/gencode/butl/ESP_testdb.c deleted file mode 100644 index 51c441e..0000000 --- a/test/gencode/butl/ESP_testdb.c +++ /dev/null @@ -1,22 +0,0 @@ -#include "ESP_testdb.h" - -#ifdef __DEF_TESTDB__ - -testdb_rx_t testdb_rx; - -testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - -uint32_t testdb_Receive(testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) -{ - uint32_t recid = 0; - if (_id == 0x14DU) { - recid = Unpack_UTEST_2_testdb(&(_m->UTEST_2), _d, dlc_); - } else if (_id == 0x1FFFFFF6U) { - recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); - } - - return recid; -} - diff --git a/test/gencode/butl/ESP_testdb.h b/test/gencode/butl/ESP_testdb.h deleted file mode 100644 index a6c2efa..0000000 --- a/test/gencode/butl/ESP_testdb.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include "dbccodeconf.h" - -#include "testdb.h" - -// This version definition comes from main driver version and -// can be compared in user code space for strict compatibility test -#define VER_TESTDB_MAJ (1U) -#define VER_TESTDB_MIN (10U) - -typedef struct -{ - UTEST_2_t UTEST_2; - EMPTY_EXT_ID_t EMPTY_EXT_ID; -} testdb_rx_t; - -typedef struct -{ - EMPTY_0_t EMPTY_0; -} testdb_tx_t; - -uint32_t testdb_Receive(testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); - -#ifdef __DEF_TESTDB__ - -extern testdb_rx_t testdb_rx; - -extern testdb_tx_t testdb_tx; - -#endif // __DEF_TESTDB__ - -#ifdef __cplusplus -} -#endif diff --git a/test/gencode/butl/bcm_testdb-binutil.c b/test/gencode/butl/bcm_testdb-binutil.c new file mode 100644 index 0000000..fc430fc --- /dev/null +++ b/test/gencode/butl/bcm_testdb-binutil.c @@ -0,0 +1,31 @@ +#include "bcm_testdb-binutil.h" + +// DBC file version +#if (VER_TESTDB_MAJ != (1U)) || (VER_TESTDB_MIN != (10U)) +#error The BCM_TESTDB binutil source file has inconsistency with core dbc lib! +#endif + +#ifdef __DEF_BCM_TESTDB__ + +bcm_testdb_rx_t bcm_testdb_rx; + +bcm_testdb_tx_t bcm_testdb_tx; + +#endif // __DEF_BCM_TESTDB__ + +uint32_t bcm_testdb_Receive(bcm_testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) +{ + uint32_t recid = 0; + if (_id == 0x360U) { + recid = Unpack_FLT_TEST_1_testdb(&(_m->FLT_TEST_1), _d, dlc_); + } else { + if (_id == 0x777U) { + recid = Unpack_SIG_TEST_1_testdb(&(_m->SIG_TEST_1), _d, dlc_); + } else if (_id == 0x1FFFFFF6U) { + recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); + } + } + + return recid; +} + diff --git a/test/gencode/butl/bcm_testdb-binutil.h b/test/gencode/butl/bcm_testdb-binutil.h new file mode 100644 index 0000000..c9d9b31 --- /dev/null +++ b/test/gencode/butl/bcm_testdb-binutil.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +typedef struct +{ + FLT_TEST_1_t FLT_TEST_1; + SIG_TEST_1_t SIG_TEST_1; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} bcm_testdb_rx_t; + +typedef struct +{ + UTEST_2_t UTEST_2; + EMPTY_0_t EMPTY_0; + UTEST_3_t UTEST_3; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} bcm_testdb_tx_t; + +uint32_t bcm_testdb_Receive(bcm_testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); + +#ifdef __DEF_BCM_TESTDB__ + +extern bcm_testdb_rx_t bcm_testdb_rx; + +extern bcm_testdb_tx_t bcm_testdb_tx; + +#endif // __DEF_BCM_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/butl/BMS_testdb.c b/test/gencode/butl/bms_testdb-binutil.c similarity index 53% rename from test/gencode/butl/BMS_testdb.c rename to test/gencode/butl/bms_testdb-binutil.c index 60526d4..23f3ba8 100644 --- a/test/gencode/butl/BMS_testdb.c +++ b/test/gencode/butl/bms_testdb-binutil.c @@ -1,14 +1,19 @@ -#include "BMS_testdb.h" +#include "bms_testdb-binutil.h" -#ifdef __DEF_TESTDB__ +// DBC file version +#if (VER_TESTDB_MAJ != (1U)) || (VER_TESTDB_MIN != (10U)) +#error The BMS_TESTDB binutil source file has inconsistency with core dbc lib! +#endif -testdb_rx_t testdb_rx; +#ifdef __DEF_BMS_TESTDB__ -testdb_tx_t testdb_tx; +bms_testdb_rx_t bms_testdb_rx; -#endif // __DEF_TESTDB__ +bms_testdb_tx_t bms_testdb_tx; -uint32_t testdb_Receive(testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) +#endif // __DEF_BMS_TESTDB__ + +uint32_t bms_testdb_Receive(bms_testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) { uint32_t recid = 0; if ((_id >= 0x14DU) && (_id < 0x22BU)) { diff --git a/test/gencode/butl/bms_testdb-binutil.h b/test/gencode/butl/bms_testdb-binutil.h new file mode 100644 index 0000000..db8574c --- /dev/null +++ b/test/gencode/butl/bms_testdb-binutil.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +typedef struct +{ + UTEST_2_t UTEST_2; + EMPTY_0_t EMPTY_0; + UTEST_3_t UTEST_3; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} bms_testdb_rx_t; + +typedef struct +{ + EMPTY_0_t EMPTY_0; + FLT_TEST_1_t FLT_TEST_1; +} bms_testdb_tx_t; + +uint32_t bms_testdb_Receive(bms_testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); + +#ifdef __DEF_BMS_TESTDB__ + +extern bms_testdb_rx_t bms_testdb_rx; + +extern bms_testdb_tx_t bms_testdb_tx; + +#endif // __DEF_BMS_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/butl/eps_testdb-binutil.c b/test/gencode/butl/eps_testdb-binutil.c new file mode 100644 index 0000000..d9713a1 --- /dev/null +++ b/test/gencode/butl/eps_testdb-binutil.c @@ -0,0 +1,13 @@ +#include "eps_testdb-binutil.h" + +// DBC file version +#if (VER_TESTDB_MAJ != (1U)) || (VER_TESTDB_MIN != (10U)) +#error The EPS_TESTDB binutil source file has inconsistency with core dbc lib! +#endif + +#ifdef __DEF_EPS_TESTDB__ + +eps_testdb_tx_t eps_testdb_tx; + +#endif // __DEF_EPS_TESTDB__ + diff --git a/test/gencode/butl/eps_testdb-binutil.h b/test/gencode/butl/eps_testdb-binutil.h new file mode 100644 index 0000000..c77b52a --- /dev/null +++ b/test/gencode/butl/eps_testdb-binutil.h @@ -0,0 +1,26 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +// There is no any RX mapped massage. + +typedef struct +{ + SIG_TEST_1_t SIG_TEST_1; +} eps_testdb_tx_t; + +#ifdef __DEF_EPS_TESTDB__ + +extern eps_testdb_tx_t eps_testdb_tx; + +#endif // __DEF_EPS_TESTDB__ + +#ifdef __cplusplus +} +#endif diff --git a/test/gencode/butl/esp_testdb-binutil.c b/test/gencode/butl/esp_testdb-binutil.c new file mode 100644 index 0000000..93dd31b --- /dev/null +++ b/test/gencode/butl/esp_testdb-binutil.c @@ -0,0 +1,27 @@ +#include "esp_testdb-binutil.h" + +// DBC file version +#if (VER_TESTDB_MAJ != (1U)) || (VER_TESTDB_MIN != (10U)) +#error The ESP_TESTDB binutil source file has inconsistency with core dbc lib! +#endif + +#ifdef __DEF_ESP_TESTDB__ + +esp_testdb_rx_t esp_testdb_rx; + +esp_testdb_tx_t esp_testdb_tx; + +#endif // __DEF_ESP_TESTDB__ + +uint32_t esp_testdb_Receive(esp_testdb_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_) +{ + uint32_t recid = 0; + if (_id == 0x14DU) { + recid = Unpack_UTEST_2_testdb(&(_m->UTEST_2), _d, dlc_); + } else if (_id == 0x1FFFFFF6U) { + recid = Unpack_EMPTY_EXT_ID_testdb(&(_m->EMPTY_EXT_ID), _d, dlc_); + } + + return recid; +} + diff --git a/test/gencode/butl/esp_testdb-binutil.h b/test/gencode/butl/esp_testdb-binutil.h new file mode 100644 index 0000000..13b8c68 --- /dev/null +++ b/test/gencode/butl/esp_testdb-binutil.h @@ -0,0 +1,34 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "dbccodeconf.h" + +#include "testdb.h" + +typedef struct +{ + UTEST_2_t UTEST_2; + EMPTY_EXT_ID_t EMPTY_EXT_ID; +} esp_testdb_rx_t; + +typedef struct +{ + EMPTY_0_t EMPTY_0; +} esp_testdb_tx_t; + +uint32_t esp_testdb_Receive(esp_testdb_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc); + +#ifdef __DEF_ESP_TESTDB__ + +extern esp_testdb_rx_t esp_testdb_rx; + +extern esp_testdb_tx_t esp_testdb_tx; + +#endif // __DEF_ESP_TESTDB__ + +#ifdef __cplusplus +} +#endif From dcce732399c9d44a2241b967cb4dd6926fecbae0 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 20:28:45 +0300 Subject: [PATCH 136/181] Files which is presumed to be in __include__ in square brackets. --- src/codegen/c-main-generator.cpp | 10 +++++----- src/codegen/c-util-generator.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 9a1a612..30e536d 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -90,7 +90,7 @@ void CiMainGenerator::Gen_MainHeader() fwriter->AppendLine(StrPrint("#define %s (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); fwriter->AppendLine("// include current dbc-driver compilation config"); - fwriter->AppendLine(StrPrint("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include <%s-config.h>", fdesc->drvname.c_str()), 2); fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); @@ -99,7 +99,7 @@ void CiMainGenerator::Gen_MainHeader() "// base monitor struct\n" "// function signature for HASH calculation: (@GetFrameHash)\n" "// function signature for getting system tick value: (@GetSystemTick)\n" - "#include \"canmonitorutil.h\"\n" + "#include \n" "\n" ); @@ -281,7 +281,7 @@ void CiMainGenerator::Gen_MainSource() "// Function prototypes to be called each time CAN frame is unpacked\n" "// FMon function may detect RC, CRC or DLC violation\n"); - fwriter->AppendLine(StrPrint("#include \"%s-fmon.h\"", fdesc->drvname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include <%s-fmon.h>", fdesc->drvname.c_str()), 2); fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 3); @@ -342,7 +342,7 @@ void CiMainGenerator::Gen_ConfigHeader() fwriter->AppendLine("#pragma once"); fwriter->AppendLine(""); fwriter->AppendLine("/* include common dbccode configurations */"); - fwriter->AppendLine("#include \"dbccodeconf.h\""); + fwriter->AppendLine("#include "); fwriter->AppendLine(""); fwriter->AppendLine(""); fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); @@ -496,7 +496,7 @@ void CiMainGenerator::Gen_FMonSource() fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); } - fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->fmon_h.fname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include <%s>", fdesc->fmon_h.fname.c_str()), 2); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 368fa1d..0e20bab 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -107,10 +107,10 @@ void CiUtilGenerator::PrintHeader() tof->AppendLine(openguard.c_str(), 2); // include common dbc code config header - tof->AppendLine("#include \"dbccodeconf.h\"", 2); + tof->AppendLine("#include ", 2); // include c-main driver header - tof->AppendLine(StrPrint("#include \"%s.h\"", file_drvname.c_str()), 2); + tof->AppendLine(StrPrint("#include <%s.h>", file_drvname.c_str()), 2); if (rx.size() == 0) From 4c13d07252213ff58c2f7bf8d4a490efb7f72022 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 20:29:07 +0300 Subject: [PATCH 137/181] Test DBC generation with square brakets includes. --- test/gencode/butl/bcm_testdb-binutil.h | 4 ++-- test/gencode/butl/bms_testdb-binutil.h | 4 ++-- test/gencode/butl/eps_testdb-binutil.h | 4 ++-- test/gencode/butl/esp_testdb-binutil.h | 4 ++-- test/gencode/conf/testdb-config.h | 2 +- test/gencode/lib/testdb.c | 2 +- test/gencode/lib/testdb.h | 4 ++-- test/gencode/usr/testdb-fmon.c | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/gencode/butl/bcm_testdb-binutil.h b/test/gencode/butl/bcm_testdb-binutil.h index c9d9b31..9a2aa30 100644 --- a/test/gencode/butl/bcm_testdb-binutil.h +++ b/test/gencode/butl/bcm_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include "dbccodeconf.h" +#include -#include "testdb.h" +#include typedef struct { diff --git a/test/gencode/butl/bms_testdb-binutil.h b/test/gencode/butl/bms_testdb-binutil.h index db8574c..fe1d027 100644 --- a/test/gencode/butl/bms_testdb-binutil.h +++ b/test/gencode/butl/bms_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include "dbccodeconf.h" +#include -#include "testdb.h" +#include typedef struct { diff --git a/test/gencode/butl/eps_testdb-binutil.h b/test/gencode/butl/eps_testdb-binutil.h index c77b52a..0abef17 100644 --- a/test/gencode/butl/eps_testdb-binutil.h +++ b/test/gencode/butl/eps_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include "dbccodeconf.h" +#include -#include "testdb.h" +#include // There is no any RX mapped massage. diff --git a/test/gencode/butl/esp_testdb-binutil.h b/test/gencode/butl/esp_testdb-binutil.h index 13b8c68..bd3a650 100644 --- a/test/gencode/butl/esp_testdb-binutil.h +++ b/test/gencode/butl/esp_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include "dbccodeconf.h" +#include -#include "testdb.h" +#include typedef struct { diff --git a/test/gencode/conf/testdb-config.h b/test/gencode/conf/testdb-config.h index 2aaa634..d273328 100644 --- a/test/gencode/conf/testdb-config.h +++ b/test/gencode/conf/testdb-config.h @@ -1,7 +1,7 @@ #pragma once /* include common dbccode configurations */ -#include "dbccodeconf.h" +#include /* ------------------------------------------------------------------------- * diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index 19dae3e..a49f1ab 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -9,7 +9,7 @@ #ifdef TESTDB_USE_DIAG_MONITORS // Function prototypes to be called each time CAN frame is unpacked // FMon function may detect RC, CRC or DLC violation -#include "testdb-fmon.h" +#include #endif // TESTDB_USE_DIAG_MONITORS diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index a559dd4..076099a 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -11,14 +11,14 @@ extern "C" { #define VER_TESTDB_MIN (10U) // include current dbc-driver compilation config -#include "testdb-config.h" +#include #ifdef TESTDB_USE_DIAG_MONITORS // This file must define: // base monitor struct // function signature for HASH calculation: (@GetFrameHash) // function signature for getting system tick value: (@GetSystemTick) -#include "canmonitorutil.h" +#include #endif // TESTDB_USE_DIAG_MONITORS diff --git a/test/gencode/usr/testdb-fmon.c b/test/gencode/usr/testdb-fmon.c index 11e7607..053af3b 100644 --- a/test/gencode/usr/testdb-fmon.c +++ b/test/gencode/usr/testdb-fmon.c @@ -1,4 +1,4 @@ -#include "testdb-fmon.h" +#include #ifdef TESTDB_USE_DIAG_MONITORS From 33191387b33078a129a35aff082adc23206e3cd1 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 20:52:09 +0300 Subject: [PATCH 138/181] Release notes editing. --- docs/RELEASES.md | 17 +++++++++++++++++ src/codegen/version.h | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 72dbe19..3aa26c7 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,22 @@ # Changelog +## v2.2 2022-05-07 + +### Fixed +- "C valid name" check for main driver name and value table descriptions +- Fixed some minor printing artefacts (extra whitespaces, extra lines) +- Very strange issue with wrong naming through all bunch of __***-binutil__ drivers (WTF?) + + +### Added +- Values from value tables and it's descpriptions are printed as macroses + ([issue#9](https://github.com/astand/c-coderdbc/issues/9) from [@delipl](https://github.com/delipl)) +- Added more information about __\_\_ext_sig\_\___ function +- Added strong check of matching of the versions of secondary dbc source + files to main dbc source file (drvname.h) +- Sources which are presumed to be located in __include__ directory are in square brakets + +--- ## v2.1 2022-02-19 diff --git a/src/codegen/version.h b/src/codegen/version.h index 3f25c17..aea8d00 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (1) +#define CODEGEN_LIB_VERSION_MIN (2) From 6fbb51b90f79509096baea45d0a27f5461f43786 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 21:00:48 +0300 Subject: [PATCH 139/181] Fixed incompleted square brakets migration. --- src/codegen/c-main-generator.cpp | 4 ++-- test/gencode/lib/testdb-fmon.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 30e536d..4906044 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -462,12 +462,12 @@ void CiMainGenerator::Gen_FMonHeader() fwriter->AppendLine(StrPrint("#define %s_FMON (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); fwriter->AppendLine(StrPrint("#define %s_FMON (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); - fwriter->AppendLine(StrPrint("#include \"%s-config.h\"", fdesc->drvname.c_str()), 2); + fwriter->AppendLine(StrPrint("#include <%s-config.h>", fdesc->drvname.c_str()), 2); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine("#include \"canmonitorutil.h\""); + fwriter->AppendLine("#include "); fwriter->AppendLine("/*\n\ This file contains the prototypes of all the functions that will be called\n\ from each Unpack_*name* function to detect DBC related errors\n\ diff --git a/test/gencode/lib/testdb-fmon.h b/test/gencode/lib/testdb-fmon.h index 308a541..c056e9e 100644 --- a/test/gencode/lib/testdb-fmon.h +++ b/test/gencode/lib/testdb-fmon.h @@ -8,11 +8,11 @@ extern "C" { #define VER_TESTDB_MAJ_FMON (1U) #define VER_TESTDB_MIN_FMON (10U) -#include "testdb-config.h" +#include #ifdef TESTDB_USE_DIAG_MONITORS -#include "canmonitorutil.h" +#include /* This file contains the prototypes of all the functions that will be called from each Unpack_*name* function to detect DBC related errors From 2e104d4f0e981d46007f908fed67dde716b2851a Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 7 May 2022 21:01:06 +0300 Subject: [PATCH 140/181] Config update for windows using. --- .gitignore | 2 +- run-test-gen.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d1f2963..c1d45a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -**/build +**/build* loc-test* diff --git a/run-test-gen.bat b/run-test-gen.bat index 0e4d466..0c38fdb 100755 --- a/run-test-gen.bat +++ b/run-test-gen.bat @@ -1,2 +1,2 @@ -start "coder" "build/Release/coderdbc.exe" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw +start "coder" "build-win/Release/coderdbc.exe" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw pause \ No newline at end of file From 322becfb0c87b219835be4ca704efb8bc75850f2 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 2 Jul 2022 21:05:09 +0300 Subject: [PATCH 141/181] Updates in fmon-* source code, some inner optimizations etc. Some service level improvements. New fmon generator and fmon model. Config section for MONO fmon mode. FS splitted to gen and file settings. Direct appending to fwriter. Removed useless methods. FileWriter API update. Mon generator with new FWriter API. Update in FWriter API. All users use new API. Added main header with empty lines in comments of some signals. Ignore vscode config. Driver compilation config printer as separated driver. AStyle format to all sources. Update realese notes. --- .gitignore | 1 + docs/RELEASES.md | 13 + src/CMakeLists.txt | 3 + src/app.cpp | 238 ++++++++++ src/app.h | 32 ++ src/codegen/c-main-generator.cpp | 705 ++++++++++++++---------------- src/codegen/c-main-generator.h | 14 +- src/codegen/c-sigprinter.cpp | 5 +- src/codegen/c-util-generator.cpp | 113 +++-- src/codegen/c-util-generator.h | 8 +- src/codegen/config-generator.cpp | 133 ++++++ src/codegen/config-generator.h | 11 + src/codegen/filewriter.cpp | 63 ++- src/codegen/filewriter.h | 12 +- src/codegen/fs-creator.cpp | 101 ++--- src/codegen/fs-creator.h | 27 +- src/codegen/mon-generator.cpp | 75 ++++ src/codegen/mon-generator.h | 15 + src/codegen/version.h | 2 +- src/helpers/formatter.h | 17 + src/maincli.cpp | 288 +----------- test/gencode/conf/testdb-config.h | 19 + test/gencode/lib/testdb-fmon.h | 34 +- test/gencode/lib/testdb.h | 24 + test/gencode/usr/testdb-fmon.c | 24 +- 25 files changed, 1161 insertions(+), 816 deletions(-) create mode 100644 src/app.cpp create mode 100644 src/app.h create mode 100644 src/codegen/config-generator.cpp create mode 100644 src/codegen/config-generator.h create mode 100644 src/codegen/mon-generator.cpp create mode 100644 src/codegen/mon-generator.h diff --git a/.gitignore b/.gitignore index c1d45a3..954b15b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ **/build* loc-test* +.vscode diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 3aa26c7..fa233bc 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,18 @@ # Changelog +## v2.3 19.07.2022 + +### Changed +- The gGeneration and the file configurations are splitted to different structs +- Specific generators moved to separated files (fmon, config) +- FileWriter API more simple + +### Added +- FMon driver can be configured for using MONO function approach or +dedicated function (how it was before) by setting _USE_MONO_FMON macro + +--- + ## v2.2 2022-05-07 ### Fixed diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 01fcc06..ba68034 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(coderdbc ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-main-generator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/mon-generator.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/codegen/config-generator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-util-generator.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/conditional-tree.cpp ${CMAKE_CURRENT_SOURCE_DIR}/codegen/c-sigprinter.cpp @@ -16,5 +18,6 @@ add_executable(coderdbc ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbclineparser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbcscanner.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/app.cpp ${CMAKE_CURRENT_SOURCE_DIR}/maincli.cpp ) diff --git a/src/app.cpp b/src/app.cpp new file mode 100644 index 0000000..2f0ea41 --- /dev/null +++ b/src/app.cpp @@ -0,0 +1,238 @@ +#include "app.h" +#include +#include +#include +#include +#include +#include +#include "app.h" +#include "parser/dbcscanner.h" +#include "codegen/c-main-generator.h" +#include "codegen/c-util-generator.h" +#include "codegen/fs-creator.h" +#include "codegen/version.h" +#include +#include + +void CoderApp::Run() +{ + if (ParseParams()) + { + GenerateCode(); + } + else + { + PrintHelp(); + } +} + +bool CoderApp::ParseParams() +{ + for (size_t i = 0; i < Params.size(); i++) + { + if (Params[i].first.compare("-dbc") == 0) + { + dbc.value = Params[i].second; + dbc.ok = true; + } + else if (Params[i].first.compare("-out") == 0) + { + outdir.value = Params[i].second; + outdir.ok = true; + } + else if (Params[i].first.compare("-drvname") == 0) + { + drvname.value = make_c_name(Params[i].second); + drvname.ok = true; + + if (drvname.value.length() == 0) + { + drvname.ok = false; + } + } + else if (Params[i].first.compare("-rw") == 0) + { + rewrite_src = true; + } + else if (Params[i].first.compare("-nodeutils") == 0) + { + gen_nodeutils = true; + } + else if (Params[i].first.compare("-help") == 0) + { + return false; + } + } + + return (dbc.ok && outdir.ok && drvname.ok); +} + +void CoderApp::GenerateCode() +{ + auto scanner = std::make_unique(); + auto cigen = std::make_unique(); + auto ciugen = std::make_unique(); + auto fscreator = std::make_unique(); + + std::ifstream reader; + + std::cout << "dbc file : " << dbc.value << std::endl; + std::cout << "gen path : " << outdir.value << std::endl; + std::cout << "drv name : " << drvname.value << std::endl; + + if (std::filesystem::exists(dbc.value) == false) + { + std::cout << "DBC file is not exists!" << std::endl; + return; + } + + reader.open(dbc.value); + + std::istream& s = reader; + + scanner->TrimDbcText(s); + + std::string info(""); + + // create main destination directory + auto ret = fscreator->PrepareDirectory(drvname.value.c_str(), outdir.value.c_str(), rewrite_src, info); + + if (ret) + { + cigen->Generate(scanner->dblist, fscreator->FS); + } + else + { + std::cout << "One or both are invalid\n"; + } + + // check if option --node-utils is requested, when requested binutil generation + // wiil be performed on each node from DBC file in accordance to its RX / TX subscription + if (gen_nodeutils) + { + std::vector nodes; + + for (size_t num = 0; num < scanner->dblist.msgs.size(); num++) + { + // iterate all messages and collect All nodes assign to at least one message + auto m = scanner->dblist.msgs[num]; + + for (size_t txs = 0; txs < m->TranS.size(); txs++) + { + std::string tx_node_name = m->TranS[txs]; + + if (std::find(nodes.begin(), nodes.end(), tx_node_name) == nodes.end()) + { + // New node name. put it in the node collection + nodes.push_back(tx_node_name); + } + } + + for (size_t recs = 0; recs < m->RecS.size(); recs++) + { + std::string rx_node_name = m->RecS[recs]; + + // test all recs + if (std::find(nodes.begin(), nodes.end(), rx_node_name) == nodes.end()) + { + // New node name, put it in the node collection + nodes.push_back(rx_node_name); + } + } + } + + // for each node in collection perform specific bin-util generation + for (size_t node = 0; node < nodes.size(); node++) + { + std::string util_name = nodes[node] + "_" + drvname.value; + + // set new driver name for current node + fscreator->FS.gen.drvname = str_tolower(util_name); + fscreator->FS.gen.DRVNAME = str_toupper(fscreator->FS.gen.drvname); + fscreator->FS.file.util_c.dir = fscreator->FS.file.utildir; + fscreator->FS.file.util_h.dir = fscreator->FS.file.utildir; + + fscreator->FS.file.util_h.fname = str_tolower(fscreator->FS.gen.drvname + "-binutil.h"); + fscreator->FS.file.util_h.fpath = fscreator->FS.file.utildir + "/" + fscreator->FS.file.util_h.fname; + + fscreator->FS.file.util_c.fname = str_tolower(fscreator->FS.gen.drvname + "-binutil.c"); + fscreator->FS.file.util_c.fpath = fscreator->FS.file.utildir + "/" + fscreator->FS.file.util_c.fname; + + MsgsClassification groups; + + for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + { + auto m = scanner->dblist.msgs[i]; + + bool found = (std::find(m->TranS.begin(), m->TranS.end(), nodes[node]) != m->TranS.end()); + + if (found) + { + // Message is in Tx array of current node + groups.Tx.push_back(m->MsgID); + } + + found = (std::find(m->RecS.begin(), m->RecS.end(), nodes[node]) != m->RecS.end()); + + if (found) + { + // Message is in Rx array of current node + groups.Rx.push_back(m->MsgID); + } + } + + if (ret) + { + ciugen->Generate(scanner->dblist, fscreator->FS, groups, drvname.value); + } + } + } + else + { + MsgsClassification groups; + + for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + { + groups.Rx.push_back(scanner->dblist.msgs[i]->MsgID); + } + + if (ret) + { + ciugen->Generate(scanner->dblist, fscreator->FS, groups, drvname.value); + } + } +} + + +void CoderApp::PrintHelp() +{ + std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; + std::cout << "project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; + std::cout << "free web application:\thttps://coderdbc.com" << std::endl; + std::cout << std::endl; + std::cout << "required parameters:" << std::endl; + + std::cout << " -dbc\t\t path to dbc file" << std::endl; + std::cout << " -out\t\t directory for generated source files (must be pre-created)" << std::endl; + std::cout << " -drvname\t driver name - will be used for naming driver parts" << std::endl; + std::cout << std::endl; + std::cout << "optional parameters:" << std::endl; + std::cout << " -nodeutils\t will generate specific pairs of binutils drivers for each node" << std::endl; + std::cout << " -rw\t\t by default each new generation with previously used params" << std::endl; + std::cout << " \t\t will create new sud-directory with source files (000, 001, ... etc)" << std::endl; + std::cout << " \t\t '-rw' option enables rewriting: all source files previously generated" << std::endl; + std::cout << " \t\t will be replaced by new ones" << std::endl; + std::cout << std::endl; + + std::cout << "examples:" << std::endl; + std::cout << std::endl; + + std::cout << + "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" << std::endl; + + std::cout << + "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils" << std::endl; + + std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb" << std::endl; + std::cout << std::endl; +} diff --git a/src/app.h b/src/app.h new file mode 100644 index 0000000..6557a37 --- /dev/null +++ b/src/app.h @@ -0,0 +1,32 @@ +#pragma once + +#include +#include +#include + +class CoderApp { + public: + CoderApp(const std::vector>& params) : Params(params) {} + + void Run(); + + private: + bool ParseParams(); + void GenerateCode(); + void PrintHelp(); + + typedef struct app + { + std::string value; + bool ok{false}; + } StrParam_t; + + const std::vector>& Params; + + StrParam_t dbc{}; + StrParam_t outdir{}; + StrParam_t drvname{}; + + bool rewrite_src{false}; + bool gen_nodeutils{false}; +}; diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 4906044..c01e7f6 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -8,6 +8,8 @@ #include #include #include "helpers/formatter.h" +#include "mon-generator.h" +#include "config-generator.h" #include "c-main-generator.h" @@ -26,15 +28,15 @@ const char* extend_func_body = "{\n" " ubitext_t const m = 1u << (bits - 1);\n" " return (val ^ m) - m;\n" - "}\n"; + "}\n\n"; CiMainGenerator::CiMainGenerator() { - sigprt = new CSigPrinter; - fwriter = new FileWriter; + sigprt = std::make_unique(); + fwriter = std::make_unique(); } -void CiMainGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd) +void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd) { p_dlist = &dlist; // Load income messages to sig printer @@ -75,26 +77,31 @@ void CiMainGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fs void CiMainGenerator::Gen_MainHeader() { // write comment start text - if (fdesc->start_info.size() > 0) + if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } - fwriter->AppendLine("#pragma once", 2); - fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); - fwriter->AppendLine("#include ", 2); + fwriter->Append("#pragma once"); + fwriter->Append(); + fwriter->Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); + fwriter->Append(); + fwriter->Append("#include "); + fwriter->Append(); - fwriter->AppendLine("// DBC file version"); - fwriter->AppendLine(StrPrint("#define %s (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); - fwriter->AppendLine(StrPrint("#define %s (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); + fwriter->Append("// DBC file version"); + fwriter->Append("#define %s (%uU)", fdesc->gen.verhigh_def.c_str(), p_dlist->ver.hi); + fwriter->Append("#define %s (%uU)", fdesc->gen.verlow_def.c_str(), p_dlist->ver.low); + fwriter->Append(); - fwriter->AppendLine("// include current dbc-driver compilation config"); - fwriter->AppendLine(StrPrint("#include <%s-config.h>", fdesc->drvname.c_str()), 2); + fwriter->Append("// include current dbc-driver compilation config"); + fwriter->Append("#include <%s-config.h>", fdesc->gen.drvname.c_str()); + fwriter->Append(); - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->AppendText( + fwriter->Append( "// This file must define:\n" "// base monitor struct\n" "// function signature for HASH calculation: (@GetFrameHash)\n" @@ -103,7 +110,8 @@ void CiMainGenerator::Gen_MainHeader() "\n" ); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 3); + fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(2); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { @@ -113,17 +121,17 @@ void CiMainGenerator::Gen_MainHeader() if (m.CommentText.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->AppendLine("// " + std::regex_replace(m.CommentText, std::regex("\n"), "\n// ")); + fwriter->Append("// " + std::regex_replace(m.CommentText, std::regex("\n"), "\n// ")); } - fwriter->AppendLine(StrPrint("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID)); - fwriter->AppendLine(StrPrint("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt)); - fwriter->AppendLine(StrPrint("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC)); - fwriter->AppendLine(StrPrint("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID)); + fwriter->Append("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID); + fwriter->Append("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt); + fwriter->Append("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC); + fwriter->Append("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID); if (m.Cycle > 0) { - fwriter->AppendLine(StrPrint("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle)); + fwriter->Append("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle); } size_t max_sig_name_len = 27; @@ -134,7 +142,7 @@ void CiMainGenerator::Gen_MainHeader() if (!s.IsSimpleSig) { - fwriter->AppendText(sigprt->PrintPhysicalToRaw(&s, fdesc->DRVNAME)); + fwriter->Append(sigprt->PrintPhysicalToRaw(&s, fdesc->gen.DRVNAME)); } if (s.Name.size() > max_sig_name_len) @@ -145,7 +153,8 @@ void CiMainGenerator::Gen_MainHeader() // For each signal in current message print value tables definitions if (s.ValDefs.vpairs.size() > 0) { - fwriter->AppendLine(StrPrint("\n// Value tables for @%s signal", s.Name.c_str()), 2); + fwriter->Append("\n// Value tables for @%s signal", s.Name.c_str()); + fwriter->Append(); for (auto i = 0; i < s.ValDefs.vpairs.size(); i++) { @@ -156,25 +165,25 @@ void CiMainGenerator::Gen_MainHeader() // @ifndef guard for the case when different values of table have // the same name (it is valid for DBC file format) // For this case only one of same named values will be available as macro - fwriter->AppendLine(StrPrint("#ifndef %s", defname.c_str())); + fwriter->Append("#ifndef %s", defname.c_str()); - fwriter->AppendLine(StrPrint("#define %s_%s_%s (%d)", - s.Name.c_str(), m.Name.c_str(), s.ValDefs.vpairs[i].first.c_str(), - s.ValDefs.vpairs[i].second)); + fwriter->Append("#define %s_%s_%s (%d)", + s.Name.c_str(), m.Name.c_str(), s.ValDefs.vpairs[i].first.c_str(), + s.ValDefs.vpairs[i].second); - fwriter->AppendLine(StrPrint("#endif"), 2); + fwriter->Append("#endif"); + fwriter->Append(); } } } - fwriter->AppendText("\n"); - - fwriter->AppendLine(StrPrint("typedef struct")); - - fwriter->AppendLine("{"); + fwriter->Append(); + fwriter->Append("typedef struct"); + fwriter->Append("{"); // Write section for bitfielded part - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usebits_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.usebits_def.c_str()); + fwriter->Append(); SignalDescriptor_t rollsig; @@ -195,13 +204,16 @@ void CiMainGenerator::Gen_MainHeader() if (m.RollSig != nullptr) { - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(); WriteSigStructField(rollsig, true, max_sig_name_len); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(); } // Write clean part - fwriter->AppendLine("#else", 2); + fwriter->Append("#else"); + fwriter->Append(); for (size_t signum = 0; signum < m.Signals.size(); signum++) { @@ -212,80 +224,93 @@ void CiMainGenerator::Gen_MainHeader() if (m.RollSig != nullptr) { - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(); WriteSigStructField(rollsig, false, max_sig_name_len); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(); } - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usebits_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usebits_def.c_str()); + fwriter->Append(); // start mon1 section - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine(" FrameMonitor_t mon1;", 2); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine(StrPrint("} %s_t;", m.Name.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(); + fwriter->Append(" FrameMonitor_t mon1;"); + fwriter->Append(); + fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(); + fwriter->Append("} %s_t;", m.Name.c_str()); + fwriter->Append(); } - fwriter->AppendLine("// Function signatures", 2); + fwriter->Append("// Function signatures"); + fwriter->Append(); for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) { // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; - fwriter->AppendLine(StrPrint("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", + m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesruct_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usesruct_def.c_str()); - fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", + m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - fwriter->AppendLine("#else"); + fwriter->Append("#else"); - fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesruct_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usesruct_def.c_str()); + fwriter->Append(); } - fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); + fwriter->Append("#ifdef __cplusplus\n}\n#endif"); // save fwrite cached text to file - fwriter->Flush(fdesc->core_h.fpath); + fwriter->Flush(fdesc->file.core_h.fpath); } void CiMainGenerator::Gen_MainSource() { - if (fdesc->start_info.size() > 0) + if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } // include main header file - fwriter->AppendLine(StrPrint("#include \"%s\"", fdesc->core_h.fname.c_str()), 3); + fwriter->Append("#include \"%s\"", fdesc->file.core_h.fname.c_str()); + fwriter->Append(2); - fwriter->AppendLine("// DBC file version"); - fwriter->AppendLine(StrPrint("#if (%s != (%uU)) || (%s != (%uU))", - fdesc->verhigh_def.c_str(), p_dlist->ver.hi, fdesc->verlow_def.c_str(), p_dlist->ver.low)); + fwriter->Append("// DBC file version"); + fwriter->Append("#if (%s != (%uU)) || (%s != (%uU))", + fdesc->gen.verhigh_def.c_str(), p_dlist->ver.hi, fdesc->gen.verlow_def.c_str(), p_dlist->ver.low); - fwriter->AppendLine(StrPrint("#error The %s dbc source files have different versions", fdesc->DRVNAME.c_str())); - fwriter->AppendLine("#endif", 2); + fwriter->Append("#error The %s dbc source files have different versions", fdesc->gen.DRVNAME.c_str()); + fwriter->Append("#endif"); + fwriter->Append(); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->AppendText( + fwriter->Append( "// Function prototypes to be called each time CAN frame is unpacked\n" "// FMon function may detect RC, CRC or DLC violation\n"); - fwriter->AppendLine(StrPrint("#include <%s-fmon.h>", fdesc->drvname.c_str()), 2); + fwriter->Append("#include <%s-fmon.h>", fdesc->gen.drvname.c_str()); + fwriter->Append(); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 3); + fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(2); - fwriter->AppendLine(StrPrint(extend_func_body, ext_sig_func_name), 1); + fwriter->Append(extend_func_body, ext_sig_func_name), 1; // for each message 3 functions must be defined - 1 unpack function, // 2: pack with raw signature @@ -296,337 +321,242 @@ void CiMainGenerator::Gen_MainSource() MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; // first function - fwriter->AppendLine(StrPrint("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", + m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); // put dirt trick to avoid warning about unusing parameter // (dlc) when monitora are disabled. trick is better than // selection different signatures because of external API consistency - fwriter->AppendLine(" (void)dlc_;"); + fwriter->Append(" (void)dlc_;"); WriteUnpackBody(sigprt->sigs_expr[num]); - fwriter->AppendLine("}", 2); + fwriter->Append("}"); + fwriter->Append(); // next one is the pack function for using with CANFrame struct - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesruct_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.usesruct_def.c_str()); + fwriter->Append(); // second function - fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", + m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); WritePackStructBody(sigprt->sigs_expr[num]); - fwriter->AppendLine("#else", 2); + fwriter->Append("#else"); + fwriter->Append(); // third function - fwriter->AppendLine(StrPrint("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", - m.Name.c_str(), fdesc->DrvName_orig.c_str(), m.Name.c_str())); + fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", + m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); WritePackArrayBody(sigprt->sigs_expr[num]); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesruct_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usesruct_def.c_str()); + fwriter->Append(); } - fwriter->Flush(fdesc->core_c.fpath); + fwriter->Flush(fdesc->file.core_c.fpath); } void CiMainGenerator::Gen_ConfigHeader() { - if (fdesc->start_info.size() > 0) + if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } - fwriter->AppendLine("#pragma once"); - fwriter->AppendLine(""); - fwriter->AppendLine("/* include common dbccode configurations */"); - fwriter->AppendLine("#include "); - fwriter->AppendLine(""); - fwriter->AppendLine(""); - fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); - fwriter->AppendLine(" This define enables using CAN message structs with bit-fielded signals"); - fwriter->AppendLine(" layout."); - fwriter->AppendLine(""); - fwriter->AppendLine(" Note(!): bit-feild was not tested properly. */"); - fwriter->AppendLine(""); - fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usebits_def.c_str()), 3); - - fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); - fwriter->AppendLine(" This macro enables using CAN message descriptive struct packing functions"); - fwriter->AppendLine(" (by default signature of pack function intakes a few simple typed params"); - fwriter->AppendLine(" for loading data, len, etc). To compile you need to define the struct"); - fwriter->AppendLine(" __CoderDbcCanFrame_t__ which must have fields:"); - fwriter->AppendLine(""); - fwriter->AppendLine(" u32 MsgId (CAN Frame message ID)"); - fwriter->AppendLine(" u8 DLC (CAN Frame payload length field)"); - fwriter->AppendLine(" u8 Data[8] (CAN Frame payload data)"); - fwriter->AppendLine(" u8 IDE (CAN Frame Extended (1) / Standard (0) ID type)"); - fwriter->AppendLine(""); - fwriter->AppendLine(" This struct definition have to be placed (or be included) in dbccodeconf.h */"); - fwriter->AppendLine(""); - fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usesruct_def.c_str()), 3); - - fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); - fwriter->AppendLine(" All the signals which have values of factor != 1 or offset != 0"); - fwriter->AppendLine(" will be named in message struct with posfix '_ro'. Pack to payload"); - fwriter->AppendLine(" operations will be made on this signal value as well as unpack from payload."); - fwriter->AppendLine(""); - fwriter->AppendLine(" USE_SIGFLOAT macro makes some difference:"); - fwriter->AppendLine(""); - fwriter->AppendLine(" 1. All the '_ro' fields will have a pair field with '_phys' postfix."); - fwriter->AppendLine(" If only offset != 0 is true then the type of '_phys' signal is the same"); - fwriter->AppendLine(" as '_ro' signal. In other case the type will be @sigfloat_t which"); - fwriter->AppendLine(" have to be defined in user dbccodeconf.h"); - fwriter->AppendLine(""); - fwriter->AppendLine(" 2. In pack function '_ro' signal will be rewritten by '_phys' signal, which"); - fwriter->AppendLine(" requires from user to use ONLY '_phys' signal for packing frame"); - fwriter->AppendLine(""); - fwriter->AppendLine(" 3. In unpack function '_phys' signal will be written by '_ro' signal."); - fwriter->AppendLine(" User have to use '_phys' signal to read physical value. */"); - fwriter->AppendLine(""); - fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usesigfloat_def.c_str()), 3); - - fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); - fwriter->AppendLine(" Note(!) that the \"canmonitorutil.h\" must be accessed in include path:"); - fwriter->AppendLine(""); - fwriter->AppendLine(" This macro adds:"); - fwriter->AppendLine(""); - fwriter->AppendLine(" - monitor field @mon1 to message struct"); - fwriter->AppendLine(""); - fwriter->AppendLine(" - capture system tick in unpack function and save value to mon1 field"); - fwriter->AppendLine(" to provide to user better missing frame detection code. For this case"); - fwriter->AppendLine(" user must provide function declared in canmonitorutil.h - GetSysTick()"); - fwriter->AppendLine(" which may return 1ms uptime."); - fwriter->AppendLine(""); - fwriter->AppendLine(" - calling function FMon_*** (from 'fmon' driver) inside unpack function"); - fwriter->AppendLine(" which is empty by default and have to be filled by user if"); - fwriter->AppendLine(" tests for DLC, rolling, checksum are necessary */"); - fwriter->AppendLine(""); - fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usemon_def.c_str()), 3); - - fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); - fwriter->AppendLine(StrPrint(" When monitor using is enabled (%s) and define below", fdesc->usemon_def.c_str())); - fwriter->AppendLine(" uncommented, additional signal will be added to message struct. ***_expt:"); - fwriter->AppendLine(" expected rolling counter, to perform monitoring rolling counter sequence"); - fwriter->AppendLine(" automatically (result may be tested in dedicated Fmon_*** function) */"); - fwriter->AppendLine(""); - fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->useroll_def.c_str()), 3); - - fwriter->AppendLine("/* ------------------------------------------------------------------------- *"); - fwriter->AppendLine(StrPrint(" When monitor using is enabled (%s) and define below", fdesc->usemon_def.c_str())); - fwriter->AppendLine(" uncommented, frame checksum signal may be handled automatically."); - fwriter->AppendLine(""); - fwriter->AppendLine(" The signal which may be marked as checksum signal must have substring"); - fwriter->AppendLine(" with next format:"); - fwriter->AppendLine(" "); - fwriter->AppendLine(""); - fwriter->AppendLine(" where:"); - fwriter->AppendLine(""); - fwriter->AppendLine(" - \"Checksum\": constant marker word"); - fwriter->AppendLine(""); - fwriter->AppendLine(" - \"XOR8\": type of method, this text will be passed to GetFrameHash"); - fwriter->AppendLine(" (canmonitorutil.h) function as is, the best use case is to define 'enum"); - fwriter->AppendLine(" DbcCanCrcMethods' in canmonitorutil.h file with all possible"); - fwriter->AppendLine(" checksum algorithms (e.g. XOR8, XOR4 etc)"); - fwriter->AppendLine(""); - fwriter->AppendLine(" - \"3\": optional value that will be passed to GetFrameHash as integer value"); - fwriter->AppendLine(""); - fwriter->AppendLine(" Function GetFrameHash have to be implemented by user"); - fwriter->AppendLine(""); - fwriter->AppendLine(" In pack function checksum signal will be calculated automatically"); - fwriter->AppendLine(" and loaded to payload"); - fwriter->AppendLine(""); - fwriter->AppendLine(" In unpack function checksum signal is checked with calculated."); - fwriter->AppendLine(" (result may be tested in dedicated Fmon_*** function). */"); - fwriter->AppendLine(""); - fwriter->AppendLine(StrPrint("/* #define %s */", fdesc->usecsm_def.c_str()), 2); - - fwriter->Flush(fdesc->confdir + '/' + fdesc->drvname + "-config.h"); + ConfigGenerator confgen; + confgen.FillHeader((*fwriter), fdesc->gen); + + fwriter->Flush(fdesc->file.confdir + '/' + fdesc->gen.drvname + "-config.h"); } void CiMainGenerator::Gen_FMonHeader() { - if (fdesc->start_info.size() > 0) + if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } - fwriter->AppendLine("#pragma once", 2); + fwriter->Append("#pragma once"); + fwriter->Append(); - fwriter->AppendLine("#ifdef __cplusplus\nextern \"C\" {\n#endif", 2); + fwriter->Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); + fwriter->Append(); - fwriter->AppendLine("// DBC file version"); - fwriter->AppendLine(StrPrint("#define %s_FMON (%uU)", fdesc->verhigh_def.c_str(), p_dlist->ver.hi)); - fwriter->AppendLine(StrPrint("#define %s_FMON (%uU)", fdesc->verlow_def.c_str(), p_dlist->ver.low), 2); + fwriter->Append("// DBC file version"); + fwriter->Append("#define %s_FMON (%uU)", fdesc->gen.verhigh_def.c_str(), p_dlist->ver.hi); + fwriter->Append("#define %s_FMON (%uU)", fdesc->gen.verlow_def.c_str(), p_dlist->ver.low); + fwriter->Append(); - fwriter->AppendLine(StrPrint("#include <%s-config.h>", fdesc->drvname.c_str()), 2); + fwriter->Append("#include <%s-config.h>", fdesc->gen.drvname.c_str()); + fwriter->Append(); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); - fwriter->AppendLine("#include "); - fwriter->AppendLine("/*\n\ + fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(); + fwriter->Append("#include "); + fwriter->Append("/*\n\ This file contains the prototypes of all the functions that will be called\n\ from each Unpack_*name* function to detect DBC related errors\n\ It is the user responsibility to defined these functions in the\n\ -separated .c file. If it won't be done the linkage error will happen\n*/", 2); +separated .c file. If it won't be done the linkage error will happen\n*/"); + fwriter->Append(); - for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) - { - auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine(StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid);", - msg->Name.c_str(), fdesc->drvname.c_str())); - } + MonGenerator mongen; - fwriter->AppendLine(StrPrint("\n#endif // %s", fdesc->usemon_def.c_str()), 2); + mongen.FillHeader((*fwriter), sigprt->sigs_expr, fdesc->gen); - fwriter->AppendLine("#ifdef __cplusplus\n}\n#endif"); + fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(); - fwriter->Flush(fdesc->fmon_h.fpath); + fwriter->Append("#ifdef __cplusplus\n}\n#endif"); + + fwriter->Flush(fdesc->file.fmon_h.fpath); } void CiMainGenerator::Gen_FMonSource() { - if (fdesc->start_info.size() > 0) + if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } - fwriter->AppendLine(StrPrint("#include <%s>", fdesc->fmon_h.fname.c_str()), 2); + fwriter->Append("#include <%s>", fdesc->file.fmon_h.fname.c_str()); + fwriter->Append(); // put diagmonitor ifdef selection for including @drv-fmon header -// with FMon_* signatures to call from unpack function - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str()), 2); + // with FMon_* signatures to call from unpack function + fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(); - fwriter->AppendLine("/*\n\ + fwriter->Append("/*\n\ Put the monitor function content here, keep in mind -\n\ next generation will completely clear all manually added code (!)\n\ -*/\n"); +*/\n\n"); - for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) - { - auto msg = &(sigprt->sigs_expr[num]->msg); - fwriter->AppendLine( - StrPrint("void FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid)\n{\n (void)_mon;\n (void)msgid;\n}\n", - msg->Name.c_str(), fdesc->drvname.c_str())); - } + MonGenerator mongen; + + mongen.FillSource((*fwriter), sigprt->sigs_expr, fdesc->gen); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str())); + fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Flush(fdesc->fmon_c.fpath); + fwriter->Flush(fdesc->file.fmon_c.fpath); } void CiMainGenerator::Gen_CanMonUtil() { - fwriter->AppendLine("#pragma once"); - fwriter->AppendLine(""); - fwriter->AppendLine("#include "); - fwriter->AppendLine(""); - fwriter->AppendLine("#ifdef __cplusplus"); - fwriter->AppendLine("extern \"C\" {"); - fwriter->AppendLine("#endif"); - fwriter->AppendLine(""); - fwriter->AppendLine("// declare here all availible checksum algorithms"); - fwriter->AppendLine("typedef enum"); - fwriter->AppendLine("{"); - fwriter->AppendLine(" // XOR8 = 0,"); - fwriter->AppendLine(" // XOR4 = 1,"); - fwriter->AppendLine(" // etc"); - fwriter->AppendLine("} DbcCanCrcMethods;"); - fwriter->AppendLine(""); - fwriter->AppendLine("typedef struct"); - fwriter->AppendLine("{"); - fwriter->AppendLine(" // @last_cycle keeps tick-value when last frame was received"); - fwriter->AppendLine(" uint32_t last_cycle;"); - fwriter->AppendLine(""); - fwriter->AppendLine(" // @timeout_cycle keeps maximum timeout for frame, user responsibility"); - fwriter->AppendLine(" // to init this field and use it in missing frame monitoring function"); - fwriter->AppendLine(" uint32_t timeout_cycle;"); - fwriter->AppendLine(""); - fwriter->AppendLine(" // @frame_cnt keeps count of all the received frames"); - fwriter->AppendLine(" uint32_t frame_cnt;"); - fwriter->AppendLine(""); - fwriter->AppendLine(" // setting up @roll_error bit indicates roll counting fail."); - fwriter->AppendLine(" // Bit is not clearing automatically!"); - fwriter->AppendLine(" uint32_t roll_error : 1;"); - fwriter->AppendLine(""); - fwriter->AppendLine(" // setting up @checksum_error bit indicates checksum checking failure."); - fwriter->AppendLine(" // Bit is not clearing automatically!"); - fwriter->AppendLine(" uint32_t csm_error : 1;"); - fwriter->AppendLine(""); - fwriter->AppendLine(" // setting up @cycle_error bit indicates that time was overrunned."); - fwriter->AppendLine(" // Bit is not clearing automatically!"); - fwriter->AppendLine(" uint32_t cycle_error : 1;"); - fwriter->AppendLine(""); - fwriter->AppendLine(" // setting up @dlc_error bit indicates that the actual length of"); - fwriter->AppendLine(" // CAN frame is less then defined by CAN matrix!"); - fwriter->AppendLine(" uint32_t dlc_error : 1;"); - fwriter->AppendLine(""); - fwriter->AppendLine("} FrameMonitor_t;"); - fwriter->AppendLine(""); - fwriter->AppendLine("/* ----------------------------------------------------------------------------- */"); - fwriter->AppendLine("// @d - buff for hash calculation"); - fwriter->AppendLine("// @len - number of bytes for hash calculation"); - fwriter->AppendLine("// @method - hash algorythm."); - fwriter->AppendLine("// @op - optional value"); - fwriter->AppendLine("uint8_t GetFrameHash(const uint8_t* data_ptr, uint8_t len, uint32_t msgid, DbcCanCrcMethods type, uint32_t option);"); - fwriter->AppendLine(""); - fwriter->AppendLine("/* ----------------------------------------------------------------------------- */"); - fwriter->AppendLine("// this function will be called when unpacking is performing. Value will be saved"); - fwriter->AppendLine("// in @last_cycle variable"); - fwriter->AppendLine("uint32_t GetSystemTick(void);"); - fwriter->AppendLine(""); - fwriter->AppendLine(""); - fwriter->AppendLine("#ifdef __cplusplus"); - fwriter->AppendLine("}"); - fwriter->AppendLine("#endif"); - fwriter->AppendLine(""); - - fwriter->Flush(fdesc->incdir + '/' + "canmonitorutil.h"); + fwriter->Append("#pragma once"); + fwriter->Append(""); + fwriter->Append("#include "); + fwriter->Append(""); + fwriter->Append("#ifdef __cplusplus"); + fwriter->Append("extern \"C\" {"); + fwriter->Append("#endif"); + fwriter->Append(""); + fwriter->Append("// declare here all availible checksum algorithms"); + fwriter->Append("typedef enum"); + fwriter->Append("{"); + fwriter->Append(" // XOR8 = 0,"); + fwriter->Append(" // XOR4 = 1,"); + fwriter->Append(" // etc"); + fwriter->Append("} DbcCanCrcMethods;"); + fwriter->Append(""); + fwriter->Append("typedef struct"); + fwriter->Append("{"); + fwriter->Append(" // @last_cycle keeps tick-value when last frame was received"); + fwriter->Append(" uint32_t last_cycle;"); + fwriter->Append(""); + fwriter->Append(" // @timeout_cycle keeps maximum timeout for frame, user responsibility"); + fwriter->Append(" // to init this field and use it in missing frame monitoring function"); + fwriter->Append(" uint32_t timeout_cycle;"); + fwriter->Append(""); + fwriter->Append(" // @frame_cnt keeps count of all the received frames"); + fwriter->Append(" uint32_t frame_cnt;"); + fwriter->Append(""); + fwriter->Append(" // setting up @roll_error bit indicates roll counting fail."); + fwriter->Append(" // Bit is not clearing automatically!"); + fwriter->Append(" uint32_t roll_error : 1;"); + fwriter->Append(""); + fwriter->Append(" // setting up @checksum_error bit indicates checksum checking failure."); + fwriter->Append(" // Bit is not clearing automatically!"); + fwriter->Append(" uint32_t csm_error : 1;"); + fwriter->Append(""); + fwriter->Append(" // setting up @cycle_error bit indicates that time was overrunned."); + fwriter->Append(" // Bit is not clearing automatically!"); + fwriter->Append(" uint32_t cycle_error : 1;"); + fwriter->Append(""); + fwriter->Append(" // setting up @dlc_error bit indicates that the actual length of"); + fwriter->Append(" // CAN frame is less then defined by CAN matrix!"); + fwriter->Append(" uint32_t dlc_error : 1;"); + fwriter->Append(""); + fwriter->Append("} FrameMonitor_t;"); + fwriter->Append(""); + fwriter->Append("/* ----------------------------------------------------------------------------- */"); + fwriter->Append("// @d - buff for hash calculation"); + fwriter->Append("// @len - number of bytes for hash calculation"); + fwriter->Append("// @method - hash algorythm."); + fwriter->Append("// @op - optional value"); + fwriter->Append("uint8_t GetFrameHash(const uint8_t* data_ptr, uint8_t len, uint32_t msgid, DbcCanCrcMethods type, uint32_t option);"); + fwriter->Append(""); + fwriter->Append("/* ----------------------------------------------------------------------------- */"); + fwriter->Append("// this function will be called when unpacking is performing. Value will be saved"); + fwriter->Append("// in @last_cycle variable"); + fwriter->Append("uint32_t GetSystemTick(void);"); + fwriter->Append(""); + fwriter->Append(""); + fwriter->Append("#ifdef __cplusplus"); + fwriter->Append("}"); + fwriter->Append("#endif"); + fwriter->Append(""); + + fwriter->Flush(fdesc->file.incdir + '/' + "canmonitorutil.h"); } void CiMainGenerator::Gen_DbcCodeConf() { - fwriter->AppendLine("#pragma once"); - fwriter->AppendLine(""); - fwriter->AppendLine("#include "); - fwriter->AppendLine(""); - fwriter->AppendLine("// when USE_SIGFLOAT enabed the sigfloat_t must be defined"); - fwriter->AppendLine("// typedef double sigfloat_t;"); - fwriter->AppendLine(""); - fwriter->AppendLine("// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined"); - fwriter->AppendLine("// #include \"{header_with_can_struct}\""); - fwriter->AppendLine("// typedef {can_struct} __CoderDbcCanFrame_t__;"); - fwriter->AppendLine(""); - fwriter->AppendLine("// if you need to allocate rx and tx messages structs put the allocation macro here"); - fwriter->AppendLine("// #define __DEF_{your_driver_name}__"); - fwriter->AppendLine(""); - - fwriter->Flush(fdesc->confdir + '/' + "dbccodeconf.h"); + fwriter->Append("#pragma once"); + fwriter->Append(""); + fwriter->Append("#include "); + fwriter->Append(""); + fwriter->Append("// when USE_SIGFLOAT enabed the sigfloat_t must be defined"); + fwriter->Append("// typedef double sigfloat_t;"); + fwriter->Append(""); + fwriter->Append("// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined"); + fwriter->Append("// #include \"{header_with_can_struct}\""); + fwriter->Append("// typedef {can_struct} __CoderDbcCanFrame_t__;"); + fwriter->Append(""); + fwriter->Append("// if you need to allocate rx and tx messages structs put the allocation macro here"); + fwriter->Append("// #define __DEF_{your_driver_name}__"); + fwriter->Append(""); + + fwriter->Flush(fdesc->file.confdir + '/' + "dbccodeconf.h"); } void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) { if (sig.CommentText.size() > 0) { - fwriter->AppendLine(" // " + std::regex_replace(sig.CommentText, std::regex("\n"), "\n // ")); + fwriter->Append(" // " + std::regex_replace(sig.CommentText, std::regex("\n"), "\n // ")); } if (sig.ValueText.size() > 0) { - fwriter->AppendLine(" // " + std::regex_replace(sig.ValueText, std::regex("\n"), "\n // ")); + fwriter->Append(" // " + std::regex_replace(sig.ValueText, std::regex("\n"), "\n // ")); } if (sig.Multiplex == MultiplexType::kMulValue) { - fwriter->AppendLine(" // multiplex variable"); + fwriter->Append(" // multiplex variable"); } else if (sig.Multiplex == MultiplexType::kMaster) { - fwriter->AppendLine(" // MULTIPLEX master signal"); + fwriter->Append(" // MULTIPLEX master signal"); } std::string dtype = ""; @@ -651,7 +581,7 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendText(pad); - fwriter->AppendText(StrPrint(" Bits=%2d", sig.LengthBit)); + fwriter->AppendText(" Bits=%2d", sig.LengthBit); size_t offset = 0; std::string infocmnt{}; @@ -698,7 +628,8 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi fwriter->AppendText(infocmnt); - fwriter->AppendLine("", 2); + fwriter->Append(""); + fwriter->Append(); if (!sig.IsSimpleSig) { @@ -712,18 +643,19 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi // own 'shadow' (_phys) copies, the problem with intermediate type (not simpe and // not double) is that the x = ***_toS(x) takes place in each Pack_* call // the signals which are not changing from Pack_* to Pack_* will change its values (!) - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); if (sig.IsDoubleSig) { - fwriter->AppendLine(StrPrint(" sigfloat_t %s;", sig.NameFloat.c_str())); + fwriter->Append(" sigfloat_t %s;", sig.NameFloat.c_str()); } else { - fwriter->AppendLine(StrPrint(" %s %s;", PrintType((int)sig.TypePhys).c_str(), sig.NameFloat.c_str())); + fwriter->Append(" %s %s;", PrintType((int)sig.TypePhys).c_str(), sig.NameFloat.c_str()); } - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter->Append(); } } @@ -738,97 +670,103 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) if (sgs->msg.Signals[num].Signed) { - fwriter->AppendLine(StrPrint(" _m->%s = %s(( %s ), %d);", - sname, ext_sig_func_name, expr.c_str(), (int32_t)sgs->msg.Signals[num].LengthBit)); + fwriter->Append(" _m->%s = %s(( %s ), %d);", + sname, ext_sig_func_name, expr.c_str(), (int32_t)sgs->msg.Signals[num].LengthBit); } else { - fwriter->AppendLine(StrPrint(" _m->%s = %s;", sname, expr.c_str())); + fwriter->Append(" _m->%s = %s;", sname, expr.c_str()); } // print sigfloat conversion if (!sgs->msg.Signals[num].IsSimpleSig) { - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); if (sgs->msg.Signals[num].IsDoubleSig) { // for double signals (sigfloat_t) type cast - fwriter->AppendLine(StrPrint(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", - sgs->msg.Signals[num].NameFloat.c_str(), fdesc->DRVNAME.c_str(), sname, sname)); + fwriter->Append(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", + sgs->msg.Signals[num].NameFloat.c_str(), fdesc->gen.DRVNAME.c_str(), sname, sname); } else { - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_fromS(_m->%s);", - sgs->msg.Signals[num].NameFloat.c_str(), fdesc->DRVNAME.c_str(), sname, sname)); + fwriter->Append(" _m->%s = %s_%s_fromS(_m->%s);", + sgs->msg.Signals[num].NameFloat.c_str(), fdesc->gen.DRVNAME.c_str(), sname, sname); } - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter->Append(); } else if (num + 1 == sgs->to_signals.size()) { // last signal without phys part, put \n manually - fwriter->AppendLine(""); + fwriter->Append(""); } } - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usemon_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str())); - fwriter->AppendLine(" _m->mon1.last_cycle = GetSystemTick();"); - fwriter->AppendLine(" _m->mon1.frame_cnt++;", 2); + fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str()); + fwriter->Append(" _m->mon1.last_cycle = GetSystemTick();"); + fwriter->Append(" _m->mon1.frame_cnt++;"); + fwriter->Append(); if (sgs->msg.RollSig != nullptr) { // Put rolling monitor here - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", - sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); + fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", + sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str()); + fwriter->Append(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1); // Put rolling monitor here - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(); } if (sgs->msg.CsmSig != nullptr) { // Put checksum check function call here - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine( - StrPrint(" _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s));", - sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), - sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str())); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); + fwriter->Append(" _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s));", + sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), + sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str()); + fwriter->Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); + fwriter->Append(); } - auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->drvname; + auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->gen.drvname; - fwriter->AppendLine(StrPrint(" %s(&_m->mon1, %s_CANID);", Fmon_func.c_str(), sgs->msg.Name.c_str())); + fwriter->Append(" %s(&_m->mon1, %s_CANID);", Fmon_func.c_str(), sgs->msg.Name.c_str()); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usemon_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter->Append(); - fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); + fwriter->Append(" return %s_CANID;", sgs->msg.Name.c_str()); } void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) { - fwriter->AppendLine("{"); + fwriter->Append("{"); PrintPackCommonText("cframe->Data", sgs); - fwriter->AppendLine(StrPrint(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str())); - fwriter->AppendLine(StrPrint(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str())); - fwriter->AppendLine(StrPrint(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); - fwriter->AppendLine("}", 2); + fwriter->Append(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str()); + fwriter->Append(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str()); + fwriter->Append(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str()); + fwriter->Append(" return %s_CANID;", sgs->msg.Name.c_str()); + fwriter->Append("}"); + fwriter->Append(); } void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) { - fwriter->AppendLine("{"); + fwriter->Append("{"); PrintPackCommonText("_d", sgs); - fwriter->AppendLine(StrPrint(" *_len = %s_DLC;", sgs->msg.Name.c_str())); - fwriter->AppendLine(StrPrint(" *_ide = %s_IDE;", sgs->msg.Name.c_str(), 2)); - fwriter->AppendLine(StrPrint(" return %s_CANID;", sgs->msg.Name.c_str())); - fwriter->AppendLine("}", 2); + fwriter->Append(" *_len = %s_DLC;", sgs->msg.Name.c_str()); + fwriter->Append(" *_ide = %s_IDE;", sgs->msg.Name.c_str()); + fwriter->Append(" return %s_CANID;", sgs->msg.Name.c_str()); + fwriter->Append("}"); + fwriter->Append(); } void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs) @@ -837,43 +775,47 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp // which is differs only by arra var name // pring array content clearin loop - fwriter->AppendLine(StrPrint(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", - sgs->msg.Name.c_str(), arrtxt.c_str()), 2); + fwriter->Append(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", + sgs->msg.Name.c_str(), arrtxt.c_str()); + fwriter->Append(); if (sgs->msg.RollSig != nullptr) { - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->useroll_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), - sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1)); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->useroll_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(" _m->%s = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), + sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1); + fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter->Append(); } if (sgs->msg.CsmSig != nullptr) { // code for clearing checksum - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); - fwriter->AppendLine(StrPrint(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str())); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); + fwriter->Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); + fwriter->Append(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str()); + fwriter->Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); + fwriter->Append(); } if (sgs->msg.hasPhys) { // first step is to put code for sigfloat conversion, before // sigint packing to bytes. - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usesigfloat_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); for (size_t n = 0; n < sgs->to_signals.size(); n++) { if (sgs->msg.Signals[n].IsSimpleSig == false) { // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->AppendLine(StrPrint(" _m->%s = %s_%s_toS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->DRVNAME.c_str(), - sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str())); + fwriter->Append(" _m->%s = %s_%s_toS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), fdesc->gen.DRVNAME.c_str(), + sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str()); } } - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usesigfloat_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter->Append(); } for (size_t i = 0; i < sgs->to_bytes.size(); i++) @@ -883,23 +825,24 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp continue; } - fwriter->AppendLine(StrPrint(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str())); + fwriter->Append(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str()); } - fwriter->AppendLine(""); + fwriter->Append(""); if (sgs->msg.CsmSig != nullptr) { // code for getting checksum value and putting it in array - fwriter->AppendLine(StrPrint("#ifdef %s", fdesc->usecsm_def.c_str())); + fwriter->Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); - fwriter->AppendLine(StrPrint(" _m->%s = ((uint8_t)GetFrameHash(%s, %s_DLC, %s_CANID, %s, %d));", - sgs->msg.CsmSig->Name.c_str(), arrtxt.c_str(), sgs->msg.Name.c_str(), - sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp)); + fwriter->Append(" _m->%s = ((uint8_t)GetFrameHash(%s, %s_DLC, %s_CANID, %s, %d));", + sgs->msg.CsmSig->Name.c_str(), arrtxt.c_str(), sgs->msg.Name.c_str(), + sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp); - fwriter->AppendLine(StrPrint(" %s[%d] |= %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str())); + fwriter->Append(" %s[%d] |= %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str()); - fwriter->AppendLine(StrPrint("#endif // %s", fdesc->usecsm_def.c_str()), 2); + fwriter->Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); + fwriter->Append(); } } diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 9d47881..c6b9406 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "c-sigprinter.h" #include "filewriter.h" #include "../types/message.h" @@ -11,7 +12,7 @@ class CiMainGenerator { public: CiMainGenerator(); - void Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd); + void Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd); private: @@ -31,13 +32,8 @@ class CiMainGenerator { void PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs); private: - std::vector tmpvect; - - CSigPrinter* sigprt; - - FileWriter* fwriter; - - const FsDescriptor_t* fdesc; - + std::unique_ptr sigprt; + std::unique_ptr fwriter; + const AppSettings_t* fdesc; const DbcMessageList_t* p_dlist; }; diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 4e44a29..82cda5c 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -1,4 +1,5 @@ #include +#include #include "c-sigprinter.h" #include "helpers/formatter.h" @@ -28,9 +29,9 @@ void CSigPrinter::LoadMessages(const std::vector message) { sigs_expr.clear(); - for (size_t i = 0; i < message.size(); i++) + for (auto it = message.cbegin(); it != message.cend(); ++it) { - LoadMessage(*(message[i])); + LoadMessage(*(*it)); } } diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 0e20bab..7ff459f 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -14,8 +14,8 @@ static const std::string closeguard = "#ifdef __cplusplus\n\ CiUtilGenerator::CiUtilGenerator() { Clear(); - tof = new FileWriter; - condtree = new ConditionalTree; + tof = std::make_unique(); + condtree = std::make_unique(); } void CiUtilGenerator::Clear() @@ -27,7 +27,7 @@ void CiUtilGenerator::Clear() } -void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd, +void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd, const MsgsClassification& groups, const std::string& drvname) { Clear(); @@ -84,7 +84,8 @@ void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fs return a->MsgID < b->MsgID; }); - fdesc = &fsd; + fdesc = &fsd.file; + gdesc = &fsd.gen; // print header for util code PrintHeader(); @@ -97,119 +98,138 @@ void CiUtilGenerator::PrintHeader() { tof->Flush(); - if (fdesc->start_info.size() > 0) + if (gdesc->start_info.size() > 0) { - tof->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + tof->Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); } - tof->AppendLine("#pragma once", 2); + tof->Append("#pragma once"); + tof->Append(); - tof->AppendLine(openguard.c_str(), 2); + tof->Append(openguard); + tof->Append(); // include common dbc code config header - tof->AppendLine("#include ", 2); + tof->Append("#include "); + tof->Append(); // include c-main driver header - tof->AppendLine(StrPrint("#include <%s.h>", file_drvname.c_str()), 2); + tof->Append("#include <%s.h>", file_drvname.c_str()); + tof->Append(); if (rx.size() == 0) { - tof->AppendLine("// There is no any RX mapped massage.", 2); + tof->Append("// There is no any RX mapped massage."); + tof->Append(); } else { // print the typedef - tof->AppendLine("typedef struct\n{"); + tof->Append("typedef struct\n{"); for (auto m : rx) { - tof->AppendLine(StrPrint(" %s_t %s;", m->Name.c_str(), m->Name.c_str())); + tof->Append(" %s_t %s;", m->Name.c_str(), m->Name.c_str()); } - tof->AppendLine(StrPrint("} %s_rx_t;", fdesc->drvname.c_str()), 2); + tof->Append("} %s_rx_t;", gdesc->drvname.c_str()); + tof->Append(); } if (tx.size() == 0) { - tof->AppendLine("// There is no any TX mapped massage.", 2); + tof->Append("// There is no any TX mapped massage."); + tof->Append(); } else { // print the typedef - tof->AppendLine("typedef struct\n{"); + tof->Append("typedef struct\n{"); for (auto m : tx) { - tof->AppendLine(StrPrint(" %s_t %s;", m->Name.c_str(), m->Name.c_str())); + tof->Append(" %s_t %s;", m->Name.c_str(), m->Name.c_str()); } - tof->AppendLine(StrPrint("} %s_tx_t;", fdesc->drvname.c_str()), 2); + tof->Append("} %s_tx_t;", gdesc->drvname.c_str()); + tof->Append(); } if (rx.size() > 0) { // receive function necessary only when more than 0 rx messages were mapped - tof->AppendLine(StrPrint("uint32_t %s_Receive(%s_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc);", - fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + tof->Append("uint32_t %s_Receive(%s_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc);", + gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof->Append(); } // print extern for super structs if (rx.size() > 0 || tx.size() > 0) { - tof->AppendLine(StrPrint("#ifdef __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + tof->Append("#ifdef __DEF_%s__", gdesc->DRVNAME.c_str()); + tof->Append(); if (rx.size() > 0) { - tof->AppendLine(StrPrint("extern %s_rx_t %s_rx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + tof->Append("extern %s_rx_t %s_rx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof->Append(); } if (tx.size() > 0) { - tof->AppendLine(StrPrint("extern %s_tx_t %s_tx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + tof->Append("extern %s_tx_t %s_tx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof->Append(); } - tof->AppendLine(StrPrint("#endif // __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + tof->Append("#endif // __DEF_%s__", gdesc->DRVNAME.c_str()); + tof->Append(); } - tof->AppendLine(closeguard.c_str()); + tof->Append(closeguard); tof->Flush(fdesc->util_h.fpath); } void CiUtilGenerator::PrintSource() { - if (fdesc->start_info.size() > 0) + if (gdesc->start_info.size() > 0) { - tof->AppendLine("// " + std::regex_replace(fdesc->start_info, std::regex("\n"), "\n// ")); + tof->Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); } - tof->AppendLine(StrPrint("#include \"%s\"", fdesc->util_h.fname.c_str()), 2); + tof->Append("#include \"%s\"", fdesc->util_h.fname.c_str()); + tof->Append(); - tof->AppendLine("// DBC file version"); - tof->AppendLine(StrPrint("#if (%s != (%uU)) || (%s != (%uU))", - fdesc->verhigh_def.c_str(), p_dlist->ver.hi, fdesc->verlow_def.c_str(), p_dlist->ver.low)); + tof->Append("// DBC file version"); + tof->Append("#if (%s != (%uU)) || (%s != (%uU))", + gdesc->verhigh_def.c_str(), p_dlist->ver.hi, gdesc->verlow_def.c_str(), p_dlist->ver.low); - tof->AppendLine(StrPrint("#error The %s binutil source file has inconsistency with core dbc lib!", - fdesc->DRVNAME.c_str())); - tof->AppendLine("#endif", 2); + tof->Append("#error The %s binutil source file has inconsistency with core dbc lib!", + gdesc->DRVNAME.c_str()); + tof->Append("#endif"); + tof->Append(); // optional RX and TX struct allocations if (rx.size() > 0 || tx.size() > 0) { - tof->AppendLine(StrPrint("#ifdef __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + tof->Append("#ifdef __DEF_%s__", gdesc->DRVNAME.c_str()); + tof->Append(); if (rx.size() > 0) { - tof->AppendLine(StrPrint("%s_rx_t %s_rx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + tof->Append("%s_rx_t %s_rx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof->Append(); } if (tx.size() > 0) { - tof->AppendLine(StrPrint("%s_tx_t %s_tx;", fdesc->drvname.c_str(), fdesc->drvname.c_str()), 2); + tof->Append("%s_tx_t %s_tx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof->Append(); } - tof->AppendLine(StrPrint("#endif // __DEF_%s__", fdesc->DRVNAME.c_str()), 2); + tof->Append("#endif // __DEF_%s__", gdesc->DRVNAME.c_str()); + tof->Append(); } if (rx.size() > 0) @@ -220,19 +240,20 @@ void CiUtilGenerator::PrintSource() // binary search on FrameID for selecting unpacking function auto tree = FillTreeLevel(rx, 0, static_cast(rx.size())); - tof->AppendLine(StrPrint("uint32_t %s_Receive(%s_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)", - fdesc->drvname.c_str(), fdesc->drvname.c_str())); + tof->Append("uint32_t %s_Receive(%s_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)", + gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->AppendLine("{"); - tof->AppendLine(" uint32_t recid = 0;"); + tof->Append("{"); + tof->Append(" uint32_t recid = 0;"); // put tree-view struct on code (in treestr variable) std::string treestr; condtree->Clear(); - tof->AppendLine(condtree->WriteCode(tree, treestr, 1)); - - tof->AppendLine(" return recid;"); - tof->AppendLine("}", 2); + tof->Append(condtree->WriteCode(tree, treestr, 1)); + tof->Append(); + tof->Append(" return recid;"); + tof->Append("}"); + tof->Append(); // clear tree after using condtree->DeleteTree(tree); diff --git a/src/codegen/c-util-generator.h b/src/codegen/c-util-generator.h index 07b10f9..15156ce 100644 --- a/src/codegen/c-util-generator.h +++ b/src/codegen/c-util-generator.h @@ -1,5 +1,6 @@ #pragma once +#include #include "types/message.h" #include "fs-creator.h" #include "filewriter.h" @@ -20,7 +21,7 @@ class CiUtilGenerator { // - function to Unpack incoming frame to dedicated RX message struct field // - optional (through define in global "dbccodeconf.h") variable allocation in source files // - void Generate(DbcMessageList_t& dlist, const FsDescriptor_t& fsd, + void Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd, const MsgsClassification& groups, const std::string& drvname); private: @@ -36,13 +37,14 @@ class CiUtilGenerator { std::vector both; // to file writer - FileWriter* tof; + std::unique_ptr tof; + std::unique_ptr condtree; std::string code_drvname; std::string file_drvname; const FsDescriptor_t* fdesc; - ConditionalTree* condtree; + const GenDescriptor_t* gdesc; const DbcMessageList_t* p_dlist; bool treestarted; diff --git a/src/codegen/config-generator.cpp b/src/codegen/config-generator.cpp new file mode 100644 index 0000000..015fb9a --- /dev/null +++ b/src/codegen/config-generator.cpp @@ -0,0 +1,133 @@ +#include "config-generator.h" + +void ConfigGenerator::FillHeader(FileWriter& wr, const GenDescriptor_t& gsett) +{ + wr.Append("#pragma once"); + wr.Append(""); + wr.Append("/* include common dbccode configurations */"); + wr.Append("#include "); + wr.Append(""); + wr.Append(""); + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" This define enables using CAN message structs with bit-fielded signals"); + wr.Append(" layout."); + wr.Append(""); + wr.Append(" Note(!): bit-feild was not tested properly. */"); + wr.Append(""); + wr.Append("/* #define %s */", gsett.usebits_def.c_str()); + wr.Append(2); + + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" This macro enables using CAN message descriptive struct packing functions"); + wr.Append(" (by default signature of pack function intakes a few simple typed params"); + wr.Append(" for loading data, len, etc). To compile you need to define the struct"); + wr.Append(" __CoderDbcCanFrame_t__ which must have fields:"); + wr.Append(""); + wr.Append(" u32 MsgId (CAN Frame message ID)"); + wr.Append(" u8 DLC (CAN Frame payload length field)"); + wr.Append(" u8 Data[8] (CAN Frame payload data)"); + wr.Append(" u8 IDE (CAN Frame Extended (1) / Standard (0) ID type)"); + wr.Append(""); + wr.Append(" This struct definition have to be placed (or be included) in dbccodeconf.h */"); + wr.Append(""); + wr.Append("/* #define %s */", gsett.usesruct_def.c_str()); + wr.Append(2); + + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" All the signals which have values of factor != 1 or offset != 0"); + wr.Append(" will be named in message struct with posfix '_ro'. Pack to payload"); + wr.Append(" operations will be made on this signal value as well as unpack from payload."); + wr.Append(""); + wr.Append(" USE_SIGFLOAT macro makes some difference:"); + wr.Append(""); + wr.Append(" 1. All the '_ro' fields will have a pair field with '_phys' postfix."); + wr.Append(" If only offset != 0 is true then the type of '_phys' signal is the same"); + wr.Append(" as '_ro' signal. In other case the type will be @sigfloat_t which"); + wr.Append(" have to be defined in user dbccodeconf.h"); + wr.Append(""); + wr.Append(" 2. In pack function '_ro' signal will be rewritten by '_phys' signal, which"); + wr.Append(" requires from user to use ONLY '_phys' signal for packing frame"); + wr.Append(""); + wr.Append(" 3. In unpack function '_phys' signal will be written by '_ro' signal."); + wr.Append(" User have to use '_phys' signal to read physical value. */"); + wr.Append(""); + wr.Append("/* #define %s */", gsett.usesigfloat_def.c_str()); + wr.Append(2); + + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" Note(!) that the \"canmonitorutil.h\" must be accessed in include path:"); + wr.Append(""); + wr.Append(" This macro adds:"); + wr.Append(""); + wr.Append(" - monitor field @mon1 to message struct"); + wr.Append(""); + wr.Append(" - capture system tick in unpack function and save value to mon1 field"); + wr.Append(" to provide to user better missing frame detection code. For this case"); + wr.Append(" user must provide function declared in canmonitorutil.h - GetSysTick()"); + wr.Append(" which may return 1ms uptime."); + wr.Append(""); + wr.Append(" - calling function FMon_*** (from 'fmon' driver) inside unpack function"); + wr.Append(" which is empty by default and have to be filled by user if"); + wr.Append(" tests for DLC, rolling, checksum are necessary */"); + wr.Append(""); + wr.Append("/* #define %s */", gsett.usemon_def.c_str()); + wr.Append(2); + + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" When monitor using is enabled (%s) and define below", gsett.usemon_def.c_str()); + wr.Append(" uncommented, additional signal will be added to message struct. ***_expt:"); + wr.Append(" expected rolling counter, to perform monitoring rolling counter sequence"); + wr.Append(" automatically (result may be tested in dedicated Fmon_*** function) */"); + wr.Append(""); + wr.Append("/* #define %s */", gsett.useroll_def.c_str()); + wr.Append(2); + + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" When monitor using is enabled (%s) and define below", gsett.usemon_def.c_str()); + wr.Append(" uncommented, frame checksum signal may be handled automatically."); + wr.Append(""); + wr.Append(" The signal which may be marked as checksum signal must have substring"); + wr.Append(" with next format:"); + wr.Append(" "); + wr.Append(""); + wr.Append(" where:"); + wr.Append(""); + wr.Append(" - \"Checksum\": constant marker word"); + wr.Append(""); + wr.Append(" - \"XOR8\": type of method, this text will be passed to GetFrameHash"); + wr.Append(" (canmonitorutil.h) function as is, the best use case is to define 'enum"); + wr.Append(" DbcCanCrcMethods' in canmonitorutil.h file with all possible"); + wr.Append(" checksum algorithms (e.g. XOR8, XOR4 etc)"); + wr.Append(""); + wr.Append(" - \"3\": optional value that will be passed to GetFrameHash as integer value"); + wr.Append(""); + wr.Append(" Function GetFrameHash have to be implemented by user"); + wr.Append(""); + wr.Append(" In pack function checksum signal will be calculated automatically"); + wr.Append(" and loaded to payload"); + wr.Append(""); + wr.Append(" In unpack function checksum signal is checked with calculated."); + wr.Append(" (result may be tested in dedicated Fmon_*** function). */"); + wr.Append(""); + wr.Append("/* #define %s */", gsett.usecsm_def.c_str()); + wr.Append(2); + wr.Append("/* ------------------------------------------------------------------------- *"); + wr.Append(" FMon handling model can be build in two ways: "); + wr.Append(""); + wr.Append(" 1 - Default. In this case when specific frame unpack is called the "); + wr.Append(" specific FMon_{Frame name}_{driver name} functoin will be called."); + wr.Append(" User's code scope has to define each of these functions. Each function is"); + wr.Append(" responsible for the error handling of one frame"); + wr.Append(""); + wr.Append(" 2 - MONO. In this case there is only one function to perform any frame "); + wr.Append(" monitoring. This function has to be implemented in the user's code scope."); + wr.Append(" This function is named as FMon_MONO_{driver name}. It takes frame id"); + wr.Append(" which can be used for selection of the logic for a frame monitoring."); + wr.Append(" This mode costs a bit more in runtime but when you often edit you DBC and you "); + wr.Append(" have more than one project it could be more maintanable (there is"); + wr.Append(" no necessity to replace source code)"); + wr.Append(""); + wr.Append(" For using MONO way uncomment line below */"); + wr.Append("/* #define %s */", gsett.usemonofmon_def.c_str()); + +} diff --git a/src/codegen/config-generator.h b/src/codegen/config-generator.h new file mode 100644 index 0000000..e78ba81 --- /dev/null +++ b/src/codegen/config-generator.h @@ -0,0 +1,11 @@ +#pragma once + +#include +#include "filewriter.h" +#include "c-sigprinter.h" +#include "fs-creator.h" + +class ConfigGenerator { + public: + void FillHeader(FileWriter& wr, const GenDescriptor_t& gsett); +}; diff --git a/src/codegen/filewriter.cpp b/src/codegen/filewriter.cpp index bb43904..5ceef2b 100644 --- a/src/codegen/filewriter.cpp +++ b/src/codegen/filewriter.cpp @@ -1,14 +1,20 @@ #include #include +#include +#include +#include #include "filewriter.h" - -FileWriter::FileWriter() +template +std::string __print_loc__(const char* format, va_list args) { -} + // TODO: make N sanitizing here to prevent memory errors + char work_buff[N] = {0}; + auto ret = vsnprintf(work_buff, N, format, args); -FileWriter::~FileWriter() -{ + assert(ret < N); + // make string from local array + return work_buff; } void FileWriter::Flush() @@ -19,41 +25,54 @@ void FileWriter::Flush() void FileWriter::Flush(const std::string& fpath) { std::ofstream wfile; - wfile.open(fpath, std::ios::out); - wfile << strm.rdbuf(); - wfile.close(); - Flush(); } -void FileWriter::AppendText(const char* text) +void FileWriter::Append(const char* frmt, ...) { - std::string str = text; - AppendText(str); + va_list args; + va_start(args, frmt); + auto ret = __print_loc__(frmt, args); + va_end(args); + Append(ret); } -void FileWriter::AppendLine(const char* text, int32_t post_empty_lines) +void FileWriter::AppendText(const char* frmt, ...) { - AppendText(text); - - for (int32_t i = 0; i < post_empty_lines; i++) - { - AppendText("\n"); - } + va_list args; + va_start(args, frmt); + auto ret = __print_loc__(frmt, args); + va_end(args); + AppendText(ret); } - void FileWriter::AppendText(const std::string& str) { strm << str; } -void FileWriter::AppendLine(const std::string& str) +void FileWriter::Append(const std::string& str) { AppendText(str); - AppendText("\n"); + NewLine(str.back()); +} + +void FileWriter::Append(size_t empty_lines) +{ + for (auto i = empty_lines; i != 0; --i) + { + NewLine(); + } +} + +void FileWriter::NewLine(const char c) +{ + if (c != '\n') + { + strm << '\n'; + } } diff --git a/src/codegen/filewriter.h b/src/codegen/filewriter.h index 080a537..90ab3b0 100644 --- a/src/codegen/filewriter.h +++ b/src/codegen/filewriter.h @@ -8,21 +8,21 @@ class FileWriter { public: - FileWriter(); - ~FileWriter(); - void Flush(); void Flush(const std::string& filename); - void AppendText(const char* text); - void AppendLine(const char* text, int32_t post_empty_lines = 1); + void Append(const char* frmt, ...); + void Append(const std::string& str); + void AppendText(const char* frmt, ...); void AppendText(const std::string& str); - void AppendLine(const std::string& str); + void Append(size_t empty_lines = 1); private: + void NewLine(const char c = ' '); + std::stringstream strm; }; diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 04eb5d4..b22c754 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -73,37 +73,37 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool } } - FS.libdir = work_dir_path + kLibDir; + FS.file.libdir = work_dir_path + kLibDir; - if (std::filesystem::create_directory(FS.libdir)) + if (std::filesystem::create_directory(FS.file.libdir)) { // ret = false; } - FS.usrdir = work_dir_path + kUsrDir; + FS.file.usrdir = work_dir_path + kUsrDir; - if (std::filesystem::create_directory(FS.usrdir)) + if (std::filesystem::create_directory(FS.file.usrdir)) { // ret = false; } - FS.incdir = work_dir_path + kIncDir; + FS.file.incdir = work_dir_path + kIncDir; - if (std::filesystem::create_directory(FS.incdir)) + if (std::filesystem::create_directory(FS.file.incdir)) { // ret = false; } - FS.confdir = work_dir_path + kConfDir; + FS.file.confdir = work_dir_path + kConfDir; - if (std::filesystem::create_directory(FS.confdir)) + if (std::filesystem::create_directory(FS.file.confdir)) { // ret = false; } - FS.utildir = work_dir_path + kUtilDir; + FS.file.utildir = work_dir_path + kUtilDir; - if (std::filesystem::create_directory(FS.utildir)) + if (std::filesystem::create_directory(FS.file.utildir)) { // ret = false; } @@ -111,64 +111,67 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool if (true) { // directory valid and exists, set all the values - FS.DrvName_orig = drvname; - FS.DRVNAME = str_toupper(drvname); - FS.drvname = str_tolower(drvname); + FS.gen.DrvName_orig = drvname; + FS.gen.DRVNAME = str_toupper(drvname); + FS.gen.drvname = str_tolower(drvname); - FS.core_h.dir = work_dir_path; - FS.core_h.fname = FS.drvname + ".h"; - FS.core_h.fpath = FS.libdir + "/" + FS.core_h.fname; + FS.file.core_h.dir = work_dir_path; + FS.file.core_h.fname = FS.gen.drvname + ".h"; + FS.file.core_h.fpath = FS.file.libdir + "/" + FS.file.core_h.fname; - FS.core_c.dir = work_dir_path; - FS.core_c.fname = FS.drvname + ".c"; - FS.core_c.fpath = FS.libdir + "/" + FS.core_c.fname; + FS.file.core_c.dir = work_dir_path; + FS.file.core_c.fname = FS.gen.drvname + ".c"; + FS.file.core_c.fpath = FS.file.libdir + "/" + FS.file.core_c.fname; - FS.util_h.dir = work_dir_path; - FS.util_h.fname = FS.drvname + "-binutil" + ".h"; - FS.util_h.fpath = FS.utildir + "/" + FS.util_h.fname; + FS.file.util_h.dir = work_dir_path; + FS.file.util_h.fname = FS.gen.drvname + "-binutil" + ".h"; + FS.file.util_h.fpath = FS.file.utildir + "/" + FS.file.util_h.fname; - FS.util_c.dir = work_dir_path; - FS.util_c.fname = FS.drvname + "-binutil" + ".c"; - FS.util_c.fpath = FS.utildir + "/" + FS.util_c.fname; + FS.file.util_c.dir = work_dir_path; + FS.file.util_c.fname = FS.gen.drvname + "-binutil" + ".c"; + FS.file.util_c.fpath = FS.file.utildir + "/" + FS.file.util_c.fname; - FS.fmon_h.dir = work_dir_path; - FS.fmon_h.fname = FS.drvname + "-fmon.h"; - FS.fmon_h.fpath = FS.libdir + "/" + FS.fmon_h.fname; + FS.file.fmon_h.dir = work_dir_path; + FS.file.fmon_h.fname = FS.gen.drvname + "-fmon.h"; + FS.file.fmon_h.fpath = FS.file.libdir + "/" + FS.file.fmon_h.fname; - FS.fmon_c.dir = work_dir_path; - FS.fmon_c.fname = FS.drvname + "-fmon.c"; - FS.fmon_c.fpath = FS.usrdir + "/" + FS.fmon_c.fname; + FS.file.fmon_c.dir = work_dir_path; + FS.file.fmon_c.fname = FS.gen.drvname + "-fmon.c"; + FS.file.fmon_c.fpath = FS.file.usrdir + "/" + FS.file.fmon_c.fname; - snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.DRVNAME.c_str()); - FS.usebits_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.gen.DRVNAME.c_str()); + FS.gen.usebits_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.DRVNAME.c_str()); - FS.usemon_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.gen.DRVNAME.c_str()); + FS.gen.usemon_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.DRVNAME.c_str()); - FS.usesigfloat_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_MONO_FMON", FS.gen.DRVNAME.c_str()); + FS.gen.usemonofmon_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.DRVNAME.c_str()); - FS.usesruct_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.gen.DRVNAME.c_str()); + FS.gen.usesigfloat_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.DRVNAME.c_str()); - FS.useroll_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.gen.DRVNAME.c_str()); + FS.gen.usesruct_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.DRVNAME.c_str()); - FS.usecsm_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.gen.DRVNAME.c_str()); + FS.gen.useroll_def = _tmpb; - snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.DRVNAME.c_str()); - FS.verhigh_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.gen.DRVNAME.c_str()); + FS.gen.usecsm_def = _tmpb; - snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.DRVNAME.c_str()); - FS.verlow_def = _tmpb; + snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.gen.DRVNAME.c_str()); + FS.gen.verhigh_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.gen.DRVNAME.c_str()); + FS.gen.verlow_def = _tmpb; // load start info to fdescriptor - FS.start_info.clear(); + FS.gen.start_info.clear(); if (strinfo.size() > 0) { - FS.start_info = strinfo; + FS.gen.start_info = strinfo; } } diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index d470ae4..6fa0e5b 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -6,13 +6,6 @@ typedef struct { - // original driver name view - std::string DrvName_orig; - // low case driver name - std::string drvname; - // up case driver name - std::string DRVNAME; - std::string libdir; std::string usrdir; std::string incdir; @@ -27,10 +20,21 @@ typedef struct OutFileDescriptor_t fmon_h; OutFileDescriptor_t fmon_c; +} FsDescriptor_t; + +typedef struct +{ + // original driver name view + std::string DrvName_orig; + // low case driver name + std::string drvname; + // up case driver name + std::string DRVNAME; std::string usebits_def; std::string usesruct_def; std::string usemon_def; + std::string usemonofmon_def; std::string usesigfloat_def; std::string useroll_def; std::string usecsm_def; @@ -41,8 +45,13 @@ typedef struct // inforamtion to be placed at the start of each source file std::string start_info; +} GenDescriptor_t; -} FsDescriptor_t; +typedef struct +{ + FsDescriptor_t file; + GenDescriptor_t gen; +} AppSettings_t; // This class is used to build all neccessary string -ed // value that will be required during code generation @@ -57,7 +66,7 @@ class FsCreator { std::string CreateSubDir(std::string basepath, std::string subdir, bool rm = true); - FsDescriptor_t FS; + AppSettings_t FS; }; diff --git a/src/codegen/mon-generator.cpp b/src/codegen/mon-generator.cpp new file mode 100644 index 0000000..7ba4b3c --- /dev/null +++ b/src/codegen/mon-generator.cpp @@ -0,0 +1,75 @@ +#include "mon-generator.h" +#include "helpers/formatter.h" + +uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, + const GenDescriptor_t& gsett) +{ + wr.Append("#ifdef %s_USE_MONO_FMON", gsett.DRVNAME.c_str()); + wr.Append(); + + wr.Append("void _FMon_MONO_%s(FrameMonitor_t* _mon, uint32_t msgid);", gsett.drvname.c_str()); + wr.Append(); + + for (auto it = sigs.begin(); it != sigs.end(); ++it) + { + + auto msg = &((*it)->msg); + wr.Append("#define FMon_%s_%s(x, y) _FMon_MONO_%s((x), (y))", msg->Name.c_str(), + gsett.drvname.c_str(), + gsett.drvname.c_str()); + } + + wr.Append(); + wr.Append("#else"); + wr.Append(); + + for (auto it = sigs.begin(); it != sigs.end(); ++it) + { + auto msg = &((*it)->msg); + wr.Append("void _FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid);", + msg->Name.c_str(), gsett.drvname.c_str()); + } + + wr.Append(); + + for (auto it = sigs.begin(); it != sigs.end(); ++it) + { + auto msg = &((*it)->msg); + wr.Append("#define FMon_%s_%s(x, y) _FMon_%s_%s((x), (y))", + msg->Name.c_str(), gsett.drvname.c_str(), + msg->Name.c_str(), gsett.drvname.c_str()); + } + + wr.Append(); + wr.Append("#endif"); + wr.Append(); + + return 0; +} + +uint32_t MonGenerator::FillSource(FileWriter& wr, std::vector& sigs, + const GenDescriptor_t& gsett) +{ + wr.Append("#ifdef %s_USE_MONO_FMON", gsett.DRVNAME.c_str()); + wr.Append(); + wr.Append("void _FMon_MONO_%s(FrameMonitor_t* _mon, uint32_t msgid)", gsett.drvname.c_str()); + wr.Append("{"); + wr.Append(" (void)_mon;"); + wr.Append(" (void)msgid;"); + wr.Append("}"); + wr.Append(); + wr.Append("#else"); + wr.Append(); + + for (auto it = sigs.begin(); it != sigs.end(); ++it) + { + auto msg = &((*it)->msg); + wr.Append("void _FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid)\n{\n (void)_mon;\n (void)msgid;\n}\n\n", + msg->Name.c_str(), gsett.drvname.c_str()); + } + + wr.Append("#endif // %s_USE_MONO_FMON", gsett.DRVNAME.c_str()); + wr.Append(); + + return 0; +} diff --git a/src/codegen/mon-generator.h b/src/codegen/mon-generator.h new file mode 100644 index 0000000..004a77e --- /dev/null +++ b/src/codegen/mon-generator.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include "filewriter.h" +#include "c-sigprinter.h" +#include "fs-creator.h" + +class MonGenerator { + public: + + MonGenerator() = default; + + uint32_t FillHeader(FileWriter& wr, std::vector& sigs, const GenDescriptor_t& gsett); + uint32_t FillSource(FileWriter& wr, std::vector& sigs, const GenDescriptor_t& gsett); +}; diff --git a/src/codegen/version.h b/src/codegen/version.h index aea8d00..b5b6298 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (2) +#define CODEGEN_LIB_VERSION_MIN (3) diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index d9f5599..333fa69 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -24,3 +24,20 @@ std::string str_trim(std::string s); * @return std::string */ std::string make_c_name(const std::string& s); + +template +std::string StrPrintLoc(const char* format, ...) +{ + va_list args; + va_start(args, format); + + // TODO: make N sanitizing here to prevent memory errors + char work_buff[N] = {0}; + + vsnprintf(work_buff, N, format, args); + + va_end(args); + + // make string from local array + return work_buff; +} diff --git a/src/maincli.cpp b/src/maincli.cpp index 4d8c5c2..3226a2c 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -1,45 +1,13 @@ -#include -#include -#include -#include #include -#include -#include "parser/dbcscanner.h" -#include "codegen/c-main-generator.h" -#include "codegen/c-util-generator.h" -#include "codegen/fs-creator.h" -#include "codegen/version.h" +#include +#include "app.h" -#define GEN_UTIL_CODE - -#define MIN_ARGC_NUM 4 -#define MAX_ARGC_NUM 5 - -char verstr[128] = {0}; - -DbcScanner* scanner; -CiMainGenerator* cigen; -CiUtilGenerator* ciugen; -FsCreator* fscreator; - -std::string source_files_out_path; -std::string dbc_file_path; -std::string dbc_driver_name; - -typedef struct -{ - std::string arg; - std::string param; -} ParamPair_t; - -void PrintUsage(); - -std::vector getoptions(int argc, char** argv) +std::vector> getoptions(int argc, char** argv) { - std::vector ret; + std::vector> ret{}; - ParamPair_t pair; + std::pair pair{}; if (argc <= 0) { @@ -51,13 +19,13 @@ std::vector getoptions(int argc, char** argv) // key found (must start with '-' (e.g. '-dbc')) if (argv[i][0] == '-') { - pair.arg = std::string(argv[i]); - pair.param.clear(); + pair.first = std::string(argv[i]); + pair.second.clear(); - if (i + 1 < argc && argv[i + 1][0] != '-') + if ((i + 1) < argc && argv[i + 1][0] != '-') { // key param - pair.param = std::string(argv[i + 1]); + pair.second = std::string(argv[i + 1]); // unlooped i incremention ++i; } @@ -71,239 +39,7 @@ std::vector getoptions(int argc, char** argv) int main(int argc, char* argv[]) { - bool err = false; - bool dbc_ok = false; - bool path_ok = false; - bool drvname_ok = false; - bool rewrite_src = false; - bool gen_nodeutils = false; - bool help = false; - - std::vector opts = getoptions(argc, argv); - - for (size_t i = 0; i < opts.size(); i++) - { - if (opts[i].arg == "-dbc") - { - dbc_file_path = opts[i].param; - dbc_ok = true; - } - else if (opts[i].arg == "-out") - { - source_files_out_path = opts[i].param; - path_ok = true; - } - else if (opts[i].arg == "-drvname") - { - dbc_driver_name = opts[i].param; - drvname_ok = true; - } - else if (opts[i].arg == "-rw") - { - rewrite_src = true; - } - else if (opts[i].arg == "-nodeutils") - { - gen_nodeutils = true; - } - else if (opts[i].arg == "-help") - { - help = true; - } - } - - if (help) - { - PrintUsage(); - return 0; - } - - if (drvname_ok) - { - dbc_driver_name = make_c_name(dbc_driver_name); - - if (dbc_driver_name.length() == 0) - { - drvname_ok = false; - } - } - - if (drvname_ok && path_ok && dbc_ok) - { - - scanner = new DbcScanner; - cigen = new CiMainGenerator; - ciugen = new CiUtilGenerator; - fscreator = new FsCreator; - - std::ifstream reader; - - std::cout << "dbc file : " << dbc_file_path << std::endl; - std::cout << "gen path : " << source_files_out_path << std::endl; - std::cout << "drv name : " << dbc_driver_name << std::endl; - - if (std::filesystem::exists(dbc_file_path) == false) - { - std::cout << "DBC file is not exists!" << std::endl; - return -1; - } - - reader.open(dbc_file_path); - - std::istream& s = reader; - - scanner->TrimDbcText(s); - - std::string info(""); - - // create main destination directory - auto ret = fscreator->PrepareDirectory(dbc_driver_name.c_str(), source_files_out_path.c_str(), rewrite_src, info); - - if (ret) - { - cigen->Generate(scanner->dblist, fscreator->FS); - } - else - { - std::cout << "One or both are invalid\n"; - } - -#if defined (GEN_UTIL_CODE) - - // check if option --node-utils is requested, when requested binutil generation - // wiil be performed on each node from DBC file in accordance to its RX / TX subscription - if (gen_nodeutils) - { - std::vector nodes; - - for (size_t num = 0; num < scanner->dblist.msgs.size(); num++) - { - // iterate all messages and collect All nodes assign to at least one message - auto m = scanner->dblist.msgs[num]; - - for (size_t txs = 0; txs < m->TranS.size(); txs++) - { - std::string tx_node_name = m->TranS[txs]; - - if (std::find(nodes.begin(), nodes.end(), tx_node_name) == nodes.end()) - { - // New node name. put it in the node collection - nodes.push_back(tx_node_name); - } - } - - for (size_t recs = 0; recs < m->RecS.size(); recs++) - { - std::string rx_node_name = m->RecS[recs]; - - // test all recs - if (std::find(nodes.begin(), nodes.end(), rx_node_name) == nodes.end()) - { - // New node name, put it in the node collection - nodes.push_back(rx_node_name); - } - } - } - - // for each node in collection perform specific bin-util generation - for (size_t node = 0; node < nodes.size(); node++) - { - std::string util_name = nodes[node] + "_" + dbc_driver_name; - - // set new driver name for current node - fscreator->FS.drvname = str_tolower(util_name); - fscreator->FS.DRVNAME = str_toupper(fscreator->FS.drvname); - fscreator->FS.util_c.dir = fscreator->FS.utildir; - fscreator->FS.util_h.dir = fscreator->FS.utildir; - - fscreator->FS.util_h.fname = str_tolower(fscreator->FS.drvname + "-binutil.h"); - fscreator->FS.util_h.fpath = fscreator->FS.utildir + "/" + fscreator->FS.util_h.fname; - - fscreator->FS.util_c.fname = str_tolower(fscreator->FS.drvname + "-binutil.c"); - fscreator->FS.util_c.fpath = fscreator->FS.utildir + "/" + fscreator->FS.util_c.fname; - - MsgsClassification groups; - - for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) - { - auto m = scanner->dblist.msgs[i]; - - bool found = (std::find(m->TranS.begin(), m->TranS.end(), nodes[node]) != m->TranS.end()); - - if (found) - { - // Message is in Tx array of current node - groups.Tx.push_back(m->MsgID); - } - - found = (std::find(m->RecS.begin(), m->RecS.end(), nodes[node]) != m->RecS.end()); - - if (found) - { - // Message is in Rx array of current node - groups.Rx.push_back(m->MsgID); - } - } - - if (ret) - { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, dbc_driver_name); - } - } - } - else - { - MsgsClassification groups; - - for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) - { - groups.Rx.push_back(scanner->dblist.msgs[i]->MsgID); - } - - if (ret) - { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, dbc_driver_name); - } - } - -#endif - - } - else - { - PrintUsage(); - } -} - -void PrintUsage() -{ - std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; - std::cout << "project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; - std::cout << "free web application:\thttps://coderdbc.com" << std::endl; - std::cout << std::endl; - std::cout << "required parameters:" << std::endl; - - std::cout << " -dbc\t\t path to dbc file" << std::endl; - std::cout << " -out\t\t directory for generated source files (must be pre-created)" << std::endl; - std::cout << " -drvname\t driver name - will be used for naming driver parts" << std::endl; - std::cout << std::endl; - std::cout << "optional parameters:" << std::endl; - std::cout << " -nodeutils\t will generate specific pairs of binutils drivers for each node" << std::endl; - std::cout << " -rw\t\t by default each new generation with previously used params" << std::endl; - std::cout << " \t\t will create new sud-directory with source files (000, 001, ... etc)" << std::endl; - std::cout << " \t\t '-rw' option enables rewriting: all source files previously generated" << std::endl; - std::cout << " \t\t will be replaced by new ones" << std::endl; - std::cout << std::endl; - - std::cout << "examples:" << std::endl; - std::cout << std::endl; - - std::cout << - "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" << std::endl; - - std::cout << - "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils" << std::endl; - - std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb" << std::endl; - std::cout << std::endl; + auto opts = getoptions(argc, argv); + auto app = std::make_unique(opts); + app->Run(); } diff --git a/test/gencode/conf/testdb-config.h b/test/gencode/conf/testdb-config.h index d273328..32485f6 100644 --- a/test/gencode/conf/testdb-config.h +++ b/test/gencode/conf/testdb-config.h @@ -107,3 +107,22 @@ /* #define TESTDB_AUTO_CSM */ + +/* ------------------------------------------------------------------------- * + FMon handling model can be build in two ways: + + 1 - Default. In this case when specific frame unpack is called the + specific FMon_{Frame name}_{driver name} functoin will be called. + User's code scope has to define each of these functions. Each function is + responsible for the error handling of one frame + + 2 - MONO. In this case there is only one function to perform any frame + monitoring. This function has to be implemented in the user's code scope. + This function is named as FMon_MONO_{driver name}. It takes frame id + which can be used for selection of the logic for a frame monitoring. + This mode costs a bit more in runtime but when you often edit you DBC and you + have more than one project it could be more maintanable (there is + no necessity to replace source code) + + For using MONO way uncomment line below */ +/* #define TESTDB_USE_MONO_FMON */ diff --git a/test/gencode/lib/testdb-fmon.h b/test/gencode/lib/testdb-fmon.h index c056e9e..9c54c3c 100644 --- a/test/gencode/lib/testdb-fmon.h +++ b/test/gencode/lib/testdb-fmon.h @@ -20,12 +20,34 @@ It is the user responsibility to defined these functions in the separated .c file. If it won't be done the linkage error will happen */ -void FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid); -void FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid); -void FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid); -void FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); -void FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); -void FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid); +#ifdef TESTDB_USE_MONO_FMON + +void _FMon_MONO_testdb(FrameMonitor_t* _mon, uint32_t msgid); + +#define FMon_UTEST_2_testdb(x, y) _FMon_MONO_testdb((x), (y)) +#define FMon_EMPTY_0_testdb(x, y) _FMon_MONO_testdb((x), (y)) +#define FMon_UTEST_3_testdb(x, y) _FMon_MONO_testdb((x), (y)) +#define FMon_FLT_TEST_1_testdb(x, y) _FMon_MONO_testdb((x), (y)) +#define FMon_SIG_TEST_1_testdb(x, y) _FMon_MONO_testdb((x), (y)) +#define FMon_EMPTY_EXT_ID_testdb(x, y) _FMon_MONO_testdb((x), (y)) + +#else + +void _FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void _FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void _FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void _FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void _FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); +void _FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid); + +#define FMon_UTEST_2_testdb(x, y) _FMon_UTEST_2_testdb((x), (y)) +#define FMon_EMPTY_0_testdb(x, y) _FMon_EMPTY_0_testdb((x), (y)) +#define FMon_UTEST_3_testdb(x, y) _FMon_UTEST_3_testdb((x), (y)) +#define FMon_FLT_TEST_1_testdb(x, y) _FMon_FLT_TEST_1_testdb((x), (y)) +#define FMon_SIG_TEST_1_testdb(x, y) _FMon_SIG_TEST_1_testdb((x), (y)) +#define FMon_EMPTY_EXT_ID_testdb(x, y) _FMon_EMPTY_EXT_ID_testdb((x), (y)) + +#endif #endif // TESTDB_USE_DIAG_MONITORS diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 076099a..0e4a1b9 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -58,6 +58,12 @@ typedef struct uint32_t U28_TEST_1; // Bits=28 // This is test signal for Value Table + // + // + // + // + // + // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" @@ -77,6 +83,12 @@ typedef struct uint32_t U28_TEST_1; // Bits=28 // This is test signal for Value Table + // + // + // + // + // + // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" @@ -544,6 +556,12 @@ typedef struct #ifdef TESTDB_USE_BITS_SIGNAL // This is test signal for Value Table + // + // + // + // + // + // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" @@ -556,6 +574,12 @@ typedef struct #else // This is test signal for Value Table + // + // + // + // + // + // // 3 : "Unsupported" // 2 : "Fail" // 1 : "OK" diff --git a/test/gencode/usr/testdb-fmon.c b/test/gencode/usr/testdb-fmon.c index 053af3b..9d33445 100644 --- a/test/gencode/usr/testdb-fmon.c +++ b/test/gencode/usr/testdb-fmon.c @@ -7,40 +7,52 @@ Put the monitor function content here, keep in mind - next generation will completely clear all manually added code (!) */ -void FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid) +#ifdef TESTDB_USE_MONO_FMON + +void _FMon_MONO_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + +#else + +void _FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; (void)msgid; } -void FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid) +void _FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; (void)msgid; } -void FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid) +void _FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; (void)msgid; } -void FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid) +void _FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; (void)msgid; } -void FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid) +void _FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; (void)msgid; } -void FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid) +void _FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; (void)msgid; } +#endif // TESTDB_USE_MONO_FMON + #endif // TESTDB_USE_DIAG_MONITORS From 4c4bf72ebd452660f452730569f5ba47900807d3 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 20 Jul 2022 00:16:42 +0300 Subject: [PATCH 142/181] Added GTEST support. --- src/CMakeLists.txt | 26 ++++++++++++++++++++++++++ src/tests/args-test.cpp | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 src/tests/args-test.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba68034..338930e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,3 +21,29 @@ add_executable(coderdbc ${CMAKE_CURRENT_SOURCE_DIR}/app.cpp ${CMAKE_CURRENT_SOURCE_DIR}/maincli.cpp ) + + +include(FetchContent) +FetchContent_Declare( + googletest + GIT_REPOSITORY https://github.com/google/googletest.git + GIT_TAG release-1.12.1 +) +# For Windows: Prevent overriding the parent project's compiler/linker settings +set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) +FetchContent_MakeAvailable(googletest) + +enable_testing() + +add_executable( + cctest + ${CMAKE_CURRENT_SOURCE_DIR}/tests/args-test.cpp +) + +target_link_libraries( + cctest + GTest::gtest_main +) + +include(GoogleTest) +gtest_discover_tests(cctest) diff --git a/src/tests/args-test.cpp b/src/tests/args-test.cpp new file mode 100644 index 0000000..f185183 --- /dev/null +++ b/src/tests/args-test.cpp @@ -0,0 +1,6 @@ +#include + +TEST(ArgParserTest, BasicAssert) +{ + EXPECT_EQ(1, 1); +} \ No newline at end of file From b6cb00081a2d0df431287f8c6f77b96aa22a1fba Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 19 Jul 2022 11:39:31 +0300 Subject: [PATCH 143/181] New generation options are introduced in help message. --- src/app.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app.cpp b/src/app.cpp index 2f0ea41..b1f9ccc 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -222,6 +222,9 @@ void CoderApp::PrintHelp() std::cout << " \t\t will create new sud-directory with source files (000, 001, ... etc)" << std::endl; std::cout << " \t\t '-rw' option enables rewriting: all source files previously generated" << std::endl; std::cout << " \t\t will be replaced by new ones" << std::endl; + std::cout << " -noconfig:\t no {drivername}-config and dbccodeconfig generation" << std::endl; + std::cout << " -noinc:\t no canmonitorutil.h generation" << std::endl; + std::cout << " -nofmon:\t no ***-fmon.c generation" << std::endl; std::cout << std::endl; std::cout << "examples:" << std::endl; From 92d1b9479f48f4acc6b7e1a35a2ff0a5000fa1fe Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 20 Jul 2022 23:39:22 +0300 Subject: [PATCH 144/181] Arguments parsing in separated class. --- src/CMakeLists.txt | 2 ++ src/app.h | 5 +++-- src/maincli.cpp | 38 +++----------------------------------- src/options-parser.cpp | 35 +++++++++++++++++++++++++++++++++++ src/options-parser.h | 18 ++++++++++++++++++ src/tests/args-test.cpp | 22 ++++++++++++++++++++++ 6 files changed, 83 insertions(+), 37 deletions(-) create mode 100644 src/options-parser.cpp create mode 100644 src/options-parser.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 338930e..d68aa5e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,6 +18,7 @@ add_executable(coderdbc ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbclineparser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbcscanner.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/options-parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/app.cpp ${CMAKE_CURRENT_SOURCE_DIR}/maincli.cpp ) @@ -37,6 +38,7 @@ enable_testing() add_executable( cctest + ${CMAKE_CURRENT_SOURCE_DIR}/options-parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/args-test.cpp ) diff --git a/src/app.h b/src/app.h index 6557a37..6dfc63f 100644 --- a/src/app.h +++ b/src/app.h @@ -3,10 +3,11 @@ #include #include #include +#include class CoderApp { public: - CoderApp(const std::vector>& params) : Params(params) {} + CoderApp(const OptionsParser::Pairs& params) : Params(params) {} void Run(); @@ -21,7 +22,7 @@ class CoderApp { bool ok{false}; } StrParam_t; - const std::vector>& Params; + const OptionsParser::Pairs& Params; StrParam_t dbc{}; StrParam_t outdir{}; diff --git a/src/maincli.cpp b/src/maincli.cpp index 3226a2c..fe66db8 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -2,44 +2,12 @@ #include #include #include "app.h" - -std::vector> getoptions(int argc, char** argv) -{ - std::vector> ret{}; - - std::pair pair{}; - - if (argc <= 0) - { - return ret; - } - - for (int i = 0; i < argc; i++) - { - // key found (must start with '-' (e.g. '-dbc')) - if (argv[i][0] == '-') - { - pair.first = std::string(argv[i]); - pair.second.clear(); - - if ((i + 1) < argc && argv[i + 1][0] != '-') - { - // key param - pair.second = std::string(argv[i + 1]); - // unlooped i incremention - ++i; - } - - ret.push_back(pair); - } - } - - return ret; -} +#include "options-parser.h" int main(int argc, char* argv[]) { - auto opts = getoptions(argc, argv); + OptionsParser parser; + auto opts = parser.GetOptions(argc, argv); auto app = std::make_unique(opts); app->Run(); } diff --git a/src/options-parser.cpp b/src/options-parser.cpp new file mode 100644 index 0000000..84bd0e8 --- /dev/null +++ b/src/options-parser.cpp @@ -0,0 +1,35 @@ +#include "options-parser.h" + +OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) +{ + Pairs ret{}; + + OnePair pair{}; + + if (argc <= 0) + { + return ret; + } + + for (int i = 0; i < argc; i++) + { + // key found (must start with '-' (e.g. '-dbc')) + if (argv[i][0] == '-') + { + pair.first = std::string(argv[i]); + pair.second.clear(); + + if ((i + 1) < argc && argv[i + 1][0] != '-') + { + // key param + pair.second = std::string(argv[i + 1]); + // unlooped i incremention + ++i; + } + + ret.push_back(pair); + } + } + + return ret; +} diff --git a/src/options-parser.h b/src/options-parser.h new file mode 100644 index 0000000..3b9d018 --- /dev/null +++ b/src/options-parser.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include +#include +#include + +class OptionsParser { + public: + + using OnePair = std::pair; + using Pairs = std::vector; + + Pairs GetOptions(int argc, char** argv); + +}; + + diff --git a/src/tests/args-test.cpp b/src/tests/args-test.cpp index f185183..ad95311 100644 --- a/src/tests/args-test.cpp +++ b/src/tests/args-test.cpp @@ -1,6 +1,28 @@ #include +#include TEST(ArgParserTest, BasicAssert) { + static char* testchunks[] = + { + (char*)"appname", + (char*)"-out", + (char*)"path/to/out", + (char*)"-dbc", + (char*)"path/to/test.dbc", + (char*)"-rw" + }; + + OptionsParser parser; + auto ret = parser.GetOptions(6, testchunks); + EXPECT_TRUE(ret.size() == 3); + + EXPECT_EQ(ret[0].first.compare("-out"), 0); + EXPECT_EQ(ret[0].second.compare("path/to/out"), 0); + EXPECT_EQ(ret[1].first.compare("-dbc"), 0); + EXPECT_EQ(ret[1].second.compare("path/to/test.dbc"), 0); + EXPECT_EQ(ret[2].first.compare("-rw"), 0); + EXPECT_EQ(ret[2].second.size(), 0); + EXPECT_EQ(1, 1); } \ No newline at end of file From e3d732f448e18168633b4ea21d79d9612dd3abe4 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jul 2022 22:06:31 +0300 Subject: [PATCH 145/181] New config in new config parser class. --- src/app.cpp | 66 ++++++++++-------------------------------- src/app.h | 13 --------- src/options-parser.cpp | 46 +++++++++++++++++++++++++---- src/options-parser.h | 23 +++++++++++++-- 4 files changed, 76 insertions(+), 72 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index b1f9ccc..6396063 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -26,47 +26,6 @@ void CoderApp::Run() } } -bool CoderApp::ParseParams() -{ - for (size_t i = 0; i < Params.size(); i++) - { - if (Params[i].first.compare("-dbc") == 0) - { - dbc.value = Params[i].second; - dbc.ok = true; - } - else if (Params[i].first.compare("-out") == 0) - { - outdir.value = Params[i].second; - outdir.ok = true; - } - else if (Params[i].first.compare("-drvname") == 0) - { - drvname.value = make_c_name(Params[i].second); - drvname.ok = true; - - if (drvname.value.length() == 0) - { - drvname.ok = false; - } - } - else if (Params[i].first.compare("-rw") == 0) - { - rewrite_src = true; - } - else if (Params[i].first.compare("-nodeutils") == 0) - { - gen_nodeutils = true; - } - else if (Params[i].first.compare("-help") == 0) - { - return false; - } - } - - return (dbc.ok && outdir.ok && drvname.ok); -} - void CoderApp::GenerateCode() { auto scanner = std::make_unique(); @@ -76,17 +35,17 @@ void CoderApp::GenerateCode() std::ifstream reader; - std::cout << "dbc file : " << dbc.value << std::endl; - std::cout << "gen path : " << outdir.value << std::endl; - std::cout << "drv name : " << drvname.value << std::endl; + std::cout << "dbc file : " << Params.dbc.value << std::endl; + std::cout << "gen path : " << Params.outdir.value << std::endl; + std::cout << "drv name : " << Params.drvname.value << std::endl; - if (std::filesystem::exists(dbc.value) == false) + if (std::filesystem::exists(Params.dbc.value) == false) { std::cout << "DBC file is not exists!" << std::endl; return; } - reader.open(dbc.value); + reader.open(Params.dbc.value); std::istream& s = reader; @@ -95,7 +54,8 @@ void CoderApp::GenerateCode() std::string info(""); // create main destination directory - auto ret = fscreator->PrepareDirectory(drvname.value.c_str(), outdir.value.c_str(), rewrite_src, info); + auto ret = fscreator->PrepareDirectory(Params.drvname.value.c_str(), Params.outdir.value.c_str(), Params.is_rewrite, + info); if (ret) { @@ -108,7 +68,7 @@ void CoderApp::GenerateCode() // check if option --node-utils is requested, when requested binutil generation // wiil be performed on each node from DBC file in accordance to its RX / TX subscription - if (gen_nodeutils) + if (Params.is_nodeutils) { std::vector nodes; @@ -144,7 +104,7 @@ void CoderApp::GenerateCode() // for each node in collection perform specific bin-util generation for (size_t node = 0; node < nodes.size(); node++) { - std::string util_name = nodes[node] + "_" + drvname.value; + std::string util_name = nodes[node] + "_" + Params.drvname.value; // set new driver name for current node fscreator->FS.gen.drvname = str_tolower(util_name); @@ -183,7 +143,7 @@ void CoderApp::GenerateCode() if (ret) { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, drvname.value); + ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.value); } } } @@ -198,11 +158,15 @@ void CoderApp::GenerateCode() if (ret) { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, drvname.value); + ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.value); } } } +bool CoderApp::ParseParams() +{ + return (Params.dbc.ok && Params.outdir.ok && Params.drvname.ok) && (Params.is_help == false); +} void CoderApp::PrintHelp() { diff --git a/src/app.h b/src/app.h index 6dfc63f..ed41fda 100644 --- a/src/app.h +++ b/src/app.h @@ -16,18 +16,5 @@ class CoderApp { void GenerateCode(); void PrintHelp(); - typedef struct app - { - std::string value; - bool ok{false}; - } StrParam_t; - const OptionsParser::Pairs& Params; - - StrParam_t dbc{}; - StrParam_t outdir{}; - StrParam_t drvname{}; - - bool rewrite_src{false}; - bool gen_nodeutils{false}; }; diff --git a/src/options-parser.cpp b/src/options-parser.cpp index 84bd0e8..5c73cef 100644 --- a/src/options-parser.cpp +++ b/src/options-parser.cpp @@ -1,15 +1,13 @@ #include "options-parser.h" +#include "helpers/formatter.h" OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) { - Pairs ret{}; + std::vector ret{}; OnePair pair{}; - if (argc <= 0) - { - return ret; - } + Pairs pairs; for (int i = 0; i < argc; i++) { @@ -31,5 +29,41 @@ OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) } } - return ret; + for (size_t i = 0; i < ret.size(); i++) + { + if (ret[i].first.compare("-dbc") == 0) + { + pairs.dbc.value = ret[i].second; + pairs.dbc.ok = true; + } + else if (ret[i].first.compare("-out") == 0) + { + pairs.outdir.value = ret[i].second; + pairs.outdir.ok = true; + } + else if (ret[i].first.compare("-drvname") == 0) + { + pairs.drvname.value = make_c_name(ret[i].second); + pairs.drvname.ok = true; + + if (pairs.drvname.value.length() == 0) + { + pairs.drvname.ok = false; + } + } + else if (ret[i].first.compare("-rw") == 0) + { + pairs.is_rewrite = true; + } + else if (ret[i].first.compare("-nodeutils") == 0) + { + pairs.is_nodeutils = true; + } + else if (ret[i].first.compare("-help") == 0) + { + pairs.is_help = true; + } + } + + return pairs; } diff --git a/src/options-parser.h b/src/options-parser.h index 3b9d018..8be5b53 100644 --- a/src/options-parser.h +++ b/src/options-parser.h @@ -5,13 +5,32 @@ #include #include +typedef struct +{ + std::string value; + bool ok{false}; +} StrParam_t; + +typedef struct +{ + StrParam_t dbc; + StrParam_t outdir; + StrParam_t drvname; + bool is_rewrite{false}; + bool is_nodeutils{false}; + bool is_noconfig{false}; + bool is_nomon{false}; + bool is_nofmon{false}; + bool is_help{false}; +} ParamConfig_t; + class OptionsParser { public: using OnePair = std::pair; - using Pairs = std::vector; + using Pairs = ParamConfig_t; - Pairs GetOptions(int argc, char** argv); + ParamConfig_t GetOptions(int argc, char** argv); }; From 0f95aaec334ad4b0760d304a72a691b9d2a23888 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 21 Jul 2022 22:19:26 +0300 Subject: [PATCH 146/181] Tests updated. --- src/CMakeLists.txt | 1 + src/options-parser.h | 2 +- src/tests/args-test.cpp | 31 ++++++++++++++++++++----------- src/tests/testapi.h | 7 +++++++ 4 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 src/tests/testapi.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d68aa5e..b1c545b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,7 @@ enable_testing() add_executable( cctest + ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/options-parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/args-test.cpp ) diff --git a/src/options-parser.h b/src/options-parser.h index 8be5b53..002e731 100644 --- a/src/options-parser.h +++ b/src/options-parser.h @@ -19,7 +19,7 @@ typedef struct bool is_rewrite{false}; bool is_nodeutils{false}; bool is_noconfig{false}; - bool is_nomon{false}; + bool is_nocanmon{false}; bool is_nofmon{false}; bool is_help{false}; } ParamConfig_t; diff --git a/src/tests/args-test.cpp b/src/tests/args-test.cpp index ad95311..e01e532 100644 --- a/src/tests/args-test.cpp +++ b/src/tests/args-test.cpp @@ -1,4 +1,4 @@ -#include +#include "testapi.h" #include TEST(ArgParserTest, BasicAssert) @@ -10,19 +10,28 @@ TEST(ArgParserTest, BasicAssert) (char*)"path/to/out", (char*)"-dbc", (char*)"path/to/test.dbc", + (char*)"-drvname", + (char*)"testdbc", (char*)"-rw" }; OptionsParser parser; - auto ret = parser.GetOptions(6, testchunks); - EXPECT_TRUE(ret.size() == 3); + auto ret = parser.GetOptions(9, testchunks); - EXPECT_EQ(ret[0].first.compare("-out"), 0); - EXPECT_EQ(ret[0].second.compare("path/to/out"), 0); - EXPECT_EQ(ret[1].first.compare("-dbc"), 0); - EXPECT_EQ(ret[1].second.compare("path/to/test.dbc"), 0); - EXPECT_EQ(ret[2].first.compare("-rw"), 0); - EXPECT_EQ(ret[2].second.size(), 0); + expect_true(ret.dbc.ok); + expect_true(ret.dbc.value.compare("path/to/test.dbc") == 0); - EXPECT_EQ(1, 1); -} \ No newline at end of file + expect_true(ret.outdir.ok); + expect_true(ret.outdir.value.compare("path/to/out") == 0); + + expect_true(ret.drvname.ok); + expect_true(ret.drvname.value.compare("testdbc") == 0); + expect_true(ret.is_rewrite); + + expect_false(ret.is_help); + expect_false(ret.is_noconfig); + expect_false(ret.is_nodeutils); + expect_false(ret.is_nofmon); + expect_false(ret.is_nocanmon); + +} diff --git a/src/tests/testapi.h b/src/tests/testapi.h new file mode 100644 index 0000000..688b0b8 --- /dev/null +++ b/src/tests/testapi.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +#define expect_eq EXPECT_EQ +#define expect_true EXPECT_TRUE +#define expect_false EXPECT_FALSE From e0b0d41b9e59ba43ad4bfee5fa0fc388dc28bb27 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 23 Jul 2022 15:49:46 +0300 Subject: [PATCH 147/181] Small enhancement, --- src/codegen/fs-creator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index b22c754..d744dcd 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -42,7 +42,7 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool } else { - std::string separator = basepath.at(basepath.size() - 1) == '/' ? "" : "/"; + std::string separator = basepath.back() == '/' ? "" : "/"; for (int32_t dirnum = 0; dirnum < 1000; dirnum++) { @@ -188,7 +188,7 @@ std::string FsCreator::CreateSubDir(std::string basepath, std::string sub, bool return ""; } - if (basepath.at(basepath.size() - 1) != '/') + if (basepath.back() != '/') { basepath.append("/"); } From 792423ef2197eec390fc654f7241eb7910d0f38e Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 23 Jul 2022 16:33:24 +0300 Subject: [PATCH 148/181] Added tests for bitext function (from gen code). --- src/CMakeLists.txt | 1 + src/tests/bitext-test.cpp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/tests/bitext-test.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b1c545b..9a5c47d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,7 @@ add_executable( ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/options-parser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/args-test.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tests/bitext-test.cpp ) target_link_libraries( diff --git a/src/tests/bitext-test.cpp b/src/tests/bitext-test.cpp new file mode 100644 index 0000000..00786d0 --- /dev/null +++ b/src/tests/bitext-test.cpp @@ -0,0 +1,30 @@ +#include +#include "testapi.h" + +template +static iT bitext(uT val, uint8_t bits) +{ + uT const m = 1u << (bits - 1); + return (val ^ m) - m; +} + +TEST(TestBitExt, FullTest) +{ + // 1 test: 3 bits signal + static const int32_t cmp[] {0, 1, 2, 3, -4, -3, -2, -1}; + + for (auto val = 0; val < 8; val++) + { + auto ret = bitext(val, 3); + expect_eq(ret, cmp[val]); + } + + static const uint8_t val2[] { 126, 127, 128, 129 }; + static const int32_t cmp2[] { 126, 127, -128, -127}; + + for (uint8_t i = 0; i < 4; i++) + { + auto ret = bitext(val2[i], 8); + expect_eq(ret, cmp2[i]); + } +} From 2ae86732ec4fa79146bb6c0490df2178e1f58609 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 23 Jul 2022 16:52:47 +0300 Subject: [PATCH 149/181] Removed overhead in fs-creator. --- src/codegen/fs-creator.cpp | 122 +++++++++++++++---------------------- 1 file changed, 50 insertions(+), 72 deletions(-) diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index d744dcd..827daed 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -75,104 +75,82 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool FS.file.libdir = work_dir_path + kLibDir; - if (std::filesystem::create_directory(FS.file.libdir)) - { - // ret = false; - } - + std::filesystem::create_directory(FS.file.libdir); FS.file.usrdir = work_dir_path + kUsrDir; - if (std::filesystem::create_directory(FS.file.usrdir)) - { - // ret = false; - } - + std::filesystem::create_directory(FS.file.usrdir); FS.file.incdir = work_dir_path + kIncDir; - if (std::filesystem::create_directory(FS.file.incdir)) - { - // ret = false; - } - + std::filesystem::create_directory(FS.file.incdir); FS.file.confdir = work_dir_path + kConfDir; - if (std::filesystem::create_directory(FS.file.confdir)) - { - // ret = false; - } - + std::filesystem::create_directory(FS.file.confdir); FS.file.utildir = work_dir_path + kUtilDir; - if (std::filesystem::create_directory(FS.file.utildir)) - { - // ret = false; - } + std::filesystem::create_directory(FS.file.utildir); - if (true) - { - // directory valid and exists, set all the values - FS.gen.DrvName_orig = drvname; - FS.gen.DRVNAME = str_toupper(drvname); - FS.gen.drvname = str_tolower(drvname); + // directory valid and exists, set all the values + FS.gen.DrvName_orig = drvname; + FS.gen.DRVNAME = str_toupper(drvname); + FS.gen.drvname = str_tolower(drvname); - FS.file.core_h.dir = work_dir_path; - FS.file.core_h.fname = FS.gen.drvname + ".h"; - FS.file.core_h.fpath = FS.file.libdir + "/" + FS.file.core_h.fname; + FS.file.core_h.dir = work_dir_path; + FS.file.core_h.fname = FS.gen.drvname + ".h"; + FS.file.core_h.fpath = FS.file.libdir + "/" + FS.file.core_h.fname; - FS.file.core_c.dir = work_dir_path; - FS.file.core_c.fname = FS.gen.drvname + ".c"; - FS.file.core_c.fpath = FS.file.libdir + "/" + FS.file.core_c.fname; + FS.file.core_c.dir = work_dir_path; + FS.file.core_c.fname = FS.gen.drvname + ".c"; + FS.file.core_c.fpath = FS.file.libdir + "/" + FS.file.core_c.fname; - FS.file.util_h.dir = work_dir_path; - FS.file.util_h.fname = FS.gen.drvname + "-binutil" + ".h"; - FS.file.util_h.fpath = FS.file.utildir + "/" + FS.file.util_h.fname; + FS.file.util_h.dir = work_dir_path; + FS.file.util_h.fname = FS.gen.drvname + "-binutil" + ".h"; + FS.file.util_h.fpath = FS.file.utildir + "/" + FS.file.util_h.fname; - FS.file.util_c.dir = work_dir_path; - FS.file.util_c.fname = FS.gen.drvname + "-binutil" + ".c"; - FS.file.util_c.fpath = FS.file.utildir + "/" + FS.file.util_c.fname; + FS.file.util_c.dir = work_dir_path; + FS.file.util_c.fname = FS.gen.drvname + "-binutil" + ".c"; + FS.file.util_c.fpath = FS.file.utildir + "/" + FS.file.util_c.fname; - FS.file.fmon_h.dir = work_dir_path; - FS.file.fmon_h.fname = FS.gen.drvname + "-fmon.h"; - FS.file.fmon_h.fpath = FS.file.libdir + "/" + FS.file.fmon_h.fname; + FS.file.fmon_h.dir = work_dir_path; + FS.file.fmon_h.fname = FS.gen.drvname + "-fmon.h"; + FS.file.fmon_h.fpath = FS.file.libdir + "/" + FS.file.fmon_h.fname; - FS.file.fmon_c.dir = work_dir_path; - FS.file.fmon_c.fname = FS.gen.drvname + "-fmon.c"; - FS.file.fmon_c.fpath = FS.file.usrdir + "/" + FS.file.fmon_c.fname; + FS.file.fmon_c.dir = work_dir_path; + FS.file.fmon_c.fname = FS.gen.drvname + "-fmon.c"; + FS.file.fmon_c.fpath = FS.file.usrdir + "/" + FS.file.fmon_c.fname; - snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.gen.DRVNAME.c_str()); - FS.gen.usebits_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.gen.DRVNAME.c_str()); + FS.gen.usebits_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.gen.DRVNAME.c_str()); - FS.gen.usemon_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.gen.DRVNAME.c_str()); + FS.gen.usemon_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_MONO_FMON", FS.gen.DRVNAME.c_str()); - FS.gen.usemonofmon_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_MONO_FMON", FS.gen.DRVNAME.c_str()); + FS.gen.usemonofmon_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.gen.DRVNAME.c_str()); - FS.gen.usesigfloat_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.gen.DRVNAME.c_str()); + FS.gen.usesigfloat_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.gen.DRVNAME.c_str()); - FS.gen.usesruct_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.gen.DRVNAME.c_str()); + FS.gen.usesruct_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.gen.DRVNAME.c_str()); - FS.gen.useroll_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.gen.DRVNAME.c_str()); + FS.gen.useroll_def = _tmpb; - snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.gen.DRVNAME.c_str()); - FS.gen.usecsm_def = _tmpb; + snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.gen.DRVNAME.c_str()); + FS.gen.usecsm_def = _tmpb; - snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.gen.DRVNAME.c_str()); - FS.gen.verhigh_def = _tmpb; + snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.gen.DRVNAME.c_str()); + FS.gen.verhigh_def = _tmpb; - snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.gen.DRVNAME.c_str()); - FS.gen.verlow_def = _tmpb; + snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.gen.DRVNAME.c_str()); + FS.gen.verlow_def = _tmpb; - // load start info to fdescriptor - FS.gen.start_info.clear(); + // load start info to fdescriptor + FS.gen.start_info.clear(); - if (strinfo.size() > 0) - { - FS.gen.start_info = strinfo; - } + if (strinfo.size() > 0) + { + FS.gen.start_info = strinfo; } return ret; From c05ee54ec1fee47e43255cf6c5347bdf88947649 Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 23 Jul 2022 17:12:25 +0300 Subject: [PATCH 150/181] Added versions to FS gen config. --- src/app.cpp | 5 +- src/codegen/fs-creator.cpp | 156 +++++++++++++++++++------------------ src/codegen/fs-creator.h | 6 +- 3 files changed, 88 insertions(+), 79 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 6396063..3fc12af 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -54,8 +54,9 @@ void CoderApp::GenerateCode() std::string info(""); // create main destination directory - auto ret = fscreator->PrepareDirectory(Params.drvname.value.c_str(), Params.outdir.value.c_str(), Params.is_rewrite, - info); + fscreator->Configure(Params.drvname.value, Params.outdir.value, info, scanner->dblist.ver.hi, scanner->dblist.ver.low); + + auto ret = fscreator->PrepareDirectory(Params.is_rewrite); if (ret) { diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 827daed..15e08f2 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -17,7 +17,84 @@ FsCreator::FsCreator() { } -bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool rw, std::string& strinfo) + +void FsCreator::Configure(const std::string& drvname, const std::string& outpath, + const std::string& info, uint32_t h, uint32_t l) +{ + FS.file.libdir = outpath + kLibDir; + FS.file.usrdir = outpath + kUsrDir; + FS.file.incdir = outpath + kIncDir; + FS.file.confdir = outpath + kConfDir; + FS.file.utildir = outpath + kUtilDir; +// directory valid and exists, set all the values + FS.gen.DrvName_orig = drvname; + FS.gen.DRVNAME = str_toupper(drvname); + FS.gen.drvname = str_tolower(drvname); + + FS.file.core_h.dir = outpath; + FS.file.core_h.fname = FS.gen.drvname + ".h"; + FS.file.core_h.fpath = FS.file.libdir + "/" + FS.file.core_h.fname; + + FS.file.core_c.dir = outpath; + FS.file.core_c.fname = FS.gen.drvname + ".c"; + FS.file.core_c.fpath = FS.file.libdir + "/" + FS.file.core_c.fname; + + FS.file.util_h.dir = outpath; + FS.file.util_h.fname = FS.gen.drvname + "-binutil" + ".h"; + FS.file.util_h.fpath = FS.file.utildir + "/" + FS.file.util_h.fname; + + FS.file.util_c.dir = outpath; + FS.file.util_c.fname = FS.gen.drvname + "-binutil" + ".c"; + FS.file.util_c.fpath = FS.file.utildir + "/" + FS.file.util_c.fname; + + FS.file.fmon_h.dir = outpath; + FS.file.fmon_h.fname = FS.gen.drvname + "-fmon.h"; + FS.file.fmon_h.fpath = FS.file.libdir + "/" + FS.file.fmon_h.fname; + + FS.file.fmon_c.dir = outpath; + FS.file.fmon_c.fname = FS.gen.drvname + "-fmon.c"; + FS.file.fmon_c.fpath = FS.file.usrdir + "/" + FS.file.fmon_c.fname; + + snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.gen.DRVNAME.c_str()); + FS.gen.usebits_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.gen.DRVNAME.c_str()); + FS.gen.usemon_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_USE_MONO_FMON", FS.gen.DRVNAME.c_str()); + FS.gen.usemonofmon_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.gen.DRVNAME.c_str()); + FS.gen.usesigfloat_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.gen.DRVNAME.c_str()); + FS.gen.usesruct_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.gen.DRVNAME.c_str()); + FS.gen.useroll_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.gen.DRVNAME.c_str()); + FS.gen.usecsm_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.gen.DRVNAME.c_str()); + FS.gen.verhigh_def = _tmpb; + + snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.gen.DRVNAME.c_str()); + FS.gen.verlow_def = _tmpb; + + // load start info to fdescriptor + FS.gen.start_info.clear(); + + if (info.size() > 0) + { + FS.gen.start_info = info; + } + + FS.gen.hiver = h; + FS.gen.lowver = l; +} + +bool FsCreator::PrepareDirectory(bool rw) { bool ret = false; @@ -25,6 +102,7 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool struct stat info; std::string work_dir_path; + const auto& basepath = FS.file.core_h.dir; if (rw) { @@ -34,7 +112,7 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool // for this case check only if directory exists if (stat(work_dir_path.c_str(), &info) != 0) { - if (std::filesystem::create_directory(work_dir_path) != 0) + if (!std::filesystem::create_directory(work_dir_path)) { ret = false; } @@ -73,86 +151,12 @@ bool FsCreator::PrepareDirectory(std::string drvname, std::string basepath, bool } } - FS.file.libdir = work_dir_path + kLibDir; - std::filesystem::create_directory(FS.file.libdir); - FS.file.usrdir = work_dir_path + kUsrDir; - std::filesystem::create_directory(FS.file.usrdir); - FS.file.incdir = work_dir_path + kIncDir; - std::filesystem::create_directory(FS.file.incdir); - FS.file.confdir = work_dir_path + kConfDir; - std::filesystem::create_directory(FS.file.confdir); - FS.file.utildir = work_dir_path + kUtilDir; - std::filesystem::create_directory(FS.file.utildir); - // directory valid and exists, set all the values - FS.gen.DrvName_orig = drvname; - FS.gen.DRVNAME = str_toupper(drvname); - FS.gen.drvname = str_tolower(drvname); - - FS.file.core_h.dir = work_dir_path; - FS.file.core_h.fname = FS.gen.drvname + ".h"; - FS.file.core_h.fpath = FS.file.libdir + "/" + FS.file.core_h.fname; - - FS.file.core_c.dir = work_dir_path; - FS.file.core_c.fname = FS.gen.drvname + ".c"; - FS.file.core_c.fpath = FS.file.libdir + "/" + FS.file.core_c.fname; - - FS.file.util_h.dir = work_dir_path; - FS.file.util_h.fname = FS.gen.drvname + "-binutil" + ".h"; - FS.file.util_h.fpath = FS.file.utildir + "/" + FS.file.util_h.fname; - - FS.file.util_c.dir = work_dir_path; - FS.file.util_c.fname = FS.gen.drvname + "-binutil" + ".c"; - FS.file.util_c.fpath = FS.file.utildir + "/" + FS.file.util_c.fname; - - FS.file.fmon_h.dir = work_dir_path; - FS.file.fmon_h.fname = FS.gen.drvname + "-fmon.h"; - FS.file.fmon_h.fpath = FS.file.libdir + "/" + FS.file.fmon_h.fname; - - FS.file.fmon_c.dir = work_dir_path; - FS.file.fmon_c.fname = FS.gen.drvname + "-fmon.c"; - FS.file.fmon_c.fpath = FS.file.usrdir + "/" + FS.file.fmon_c.fname; - - snprintf(_tmpb, kTmpLen, "%s_USE_BITS_SIGNAL", FS.gen.DRVNAME.c_str()); - FS.gen.usebits_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "%s_USE_DIAG_MONITORS", FS.gen.DRVNAME.c_str()); - FS.gen.usemon_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "%s_USE_MONO_FMON", FS.gen.DRVNAME.c_str()); - FS.gen.usemonofmon_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "%s_USE_SIGFLOAT", FS.gen.DRVNAME.c_str()); - FS.gen.usesigfloat_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "%s_USE_CANSTRUCT", FS.gen.DRVNAME.c_str()); - FS.gen.usesruct_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "%s_AUTO_ROLL", FS.gen.DRVNAME.c_str()); - FS.gen.useroll_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "%s_AUTO_CSM", FS.gen.DRVNAME.c_str()); - FS.gen.usecsm_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "VER_%s_MAJ", FS.gen.DRVNAME.c_str()); - FS.gen.verhigh_def = _tmpb; - - snprintf(_tmpb, kTmpLen, "VER_%s_MIN", FS.gen.DRVNAME.c_str()); - FS.gen.verlow_def = _tmpb; - - // load start info to fdescriptor - FS.gen.start_info.clear(); - - if (strinfo.size() > 0) - { - FS.gen.start_info = strinfo; - } - return ret; } diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 6fa0e5b..fa8200c 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -45,6 +45,9 @@ typedef struct // inforamtion to be placed at the start of each source file std::string start_info; + + uint32_t hiver{0}; + uint32_t lowver{0}; } GenDescriptor_t; typedef struct @@ -62,7 +65,8 @@ class FsCreator { public: FsCreator(); - bool PrepareDirectory(std::string drvname, std::string basepath, bool rw, std::string& info); + void Configure(const std::string& drvname, const std::string& outpath, const std::string& info, uint32_t h, uint32_t l); + bool PrepareDirectory(bool rw); std::string CreateSubDir(std::string basepath, std::string subdir, bool rm = true); From f8848a335230d4402bd53eedb08164f54e7fe3df Mon Sep 17 00:00:00 2001 From: astand Date: Sat, 23 Jul 2022 21:28:19 +0300 Subject: [PATCH 151/181] Removed unuseful things. --- src/codegen/c-main-generator.cpp | 72 ++-------------------------- src/codegen/c-main-generator.h | 1 - src/codegen/mon-generator.cpp | 81 +++++++++++++++++++++++++++----- src/codegen/mon-generator.h | 4 +- 4 files changed, 75 insertions(+), 83 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index c01e7f6..043724d 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -38,7 +38,6 @@ CiMainGenerator::CiMainGenerator() void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd) { - p_dlist = &dlist; // Load income messages to sig printer sigprt->LoadMessages(dlist.msgs); @@ -91,8 +90,8 @@ void CiMainGenerator::Gen_MainHeader() fwriter->Append(); fwriter->Append("// DBC file version"); - fwriter->Append("#define %s (%uU)", fdesc->gen.verhigh_def.c_str(), p_dlist->ver.hi); - fwriter->Append("#define %s (%uU)", fdesc->gen.verlow_def.c_str(), p_dlist->ver.low); + fwriter->Append("#define %s (%uU)", fdesc->gen.verhigh_def.c_str(), fdesc->gen.hiver); + fwriter->Append("#define %s (%uU)", fdesc->gen.verlow_def.c_str(), fdesc->gen.lowver); fwriter->Append(); fwriter->Append("// include current dbc-driver compilation config"); @@ -290,7 +289,7 @@ void CiMainGenerator::Gen_MainSource() fwriter->Append("// DBC file version"); fwriter->Append("#if (%s != (%uU)) || (%s != (%uU))", - fdesc->gen.verhigh_def.c_str(), p_dlist->ver.hi, fdesc->gen.verlow_def.c_str(), p_dlist->ver.low); + fdesc->gen.verhigh_def.c_str(), fdesc->gen.hiver, fdesc->gen.verlow_def.c_str(), fdesc->gen.lowver); fwriter->Append("#error The %s dbc source files have different versions", fdesc->gen.DRVNAME.c_str()); fwriter->Append("#endif"); @@ -376,76 +375,15 @@ void CiMainGenerator::Gen_ConfigHeader() void CiMainGenerator::Gen_FMonHeader() { - if (fdesc->gen.start_info.size() > 0) - { - // replace all '\n' on "\n //" for c code comment text - fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); - } - - fwriter->Append("#pragma once"); - fwriter->Append(); - - fwriter->Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); - fwriter->Append(); - - fwriter->Append("// DBC file version"); - fwriter->Append("#define %s_FMON (%uU)", fdesc->gen.verhigh_def.c_str(), p_dlist->ver.hi); - fwriter->Append("#define %s_FMON (%uU)", fdesc->gen.verlow_def.c_str(), p_dlist->ver.low); - fwriter->Append(); - - fwriter->Append("#include <%s-config.h>", fdesc->gen.drvname.c_str()); - fwriter->Append(); - - // put diagmonitor ifdef selection for including @drv-fmon header - // with FMon_* signatures to call from unpack function - fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(); - fwriter->Append("#include "); - fwriter->Append("/*\n\ -This file contains the prototypes of all the functions that will be called\n\ -from each Unpack_*name* function to detect DBC related errors\n\ -It is the user responsibility to defined these functions in the\n\ -separated .c file. If it won't be done the linkage error will happen\n*/"); - fwriter->Append(); - MonGenerator mongen; - - mongen.FillHeader((*fwriter), sigprt->sigs_expr, fdesc->gen); - - fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(); - - fwriter->Append("#ifdef __cplusplus\n}\n#endif"); - + mongen.FillHeader((*fwriter), sigprt->sigs_expr, *fdesc); fwriter->Flush(fdesc->file.fmon_h.fpath); } void CiMainGenerator::Gen_FMonSource() { - if (fdesc->gen.start_info.size() > 0) - { - // replace all '\n' on "\n //" for c code comment text - fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); - } - - fwriter->Append("#include <%s>", fdesc->file.fmon_h.fname.c_str()); - fwriter->Append(); - // put diagmonitor ifdef selection for including @drv-fmon header - // with FMon_* signatures to call from unpack function - fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(); - - fwriter->Append("/*\n\ -Put the monitor function content here, keep in mind -\n\ -next generation will completely clear all manually added code (!)\n\ -*/\n\n"); - MonGenerator mongen; - - mongen.FillSource((*fwriter), sigprt->sigs_expr, fdesc->gen); - - fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - + mongen.FillSource((*fwriter), sigprt->sigs_expr, *fdesc); fwriter->Flush(fdesc->file.fmon_c.fpath); } diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index c6b9406..f2180cc 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -35,5 +35,4 @@ class CiMainGenerator { std::unique_ptr sigprt; std::unique_ptr fwriter; const AppSettings_t* fdesc; - const DbcMessageList_t* p_dlist; }; diff --git a/src/codegen/mon-generator.cpp b/src/codegen/mon-generator.cpp index 7ba4b3c..5082808 100644 --- a/src/codegen/mon-generator.cpp +++ b/src/codegen/mon-generator.cpp @@ -2,12 +2,43 @@ #include "helpers/formatter.h" uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, - const GenDescriptor_t& gsett) + const AppSettings_t& aset) { - wr.Append("#ifdef %s_USE_MONO_FMON", gsett.DRVNAME.c_str()); + if (aset.gen.start_info.size() > 0) + { + wr.Append(aset.gen.start_info); + } + + wr.Append("#pragma once"); + wr.Append(); + + wr.Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); + wr.Append(); + + wr.Append("// DBC file version"); + wr.Append("#define %s_FMON (%uU)", aset.gen.verhigh_def.c_str(), aset.gen.hiver); + wr.Append("#define %s_FMON (%uU)", aset.gen.verlow_def.c_str(), aset.gen.lowver); wr.Append(); - wr.Append("void _FMon_MONO_%s(FrameMonitor_t* _mon, uint32_t msgid);", gsett.drvname.c_str()); + wr.Append("#include <%s-config.h>", aset.gen.drvname.c_str()); + wr.Append(); + + // put diagmonitor ifdef selection for including @drv-fmon header + // with FMon_* signatures to call from unpack function + wr.Append("#ifdef %s", aset.gen.usemon_def.c_str()); + wr.Append(); + wr.Append("#include "); + wr.Append("/*\n\ +This file contains the prototypes of all the functions that will be called\n\ +from each Unpack_*name* function to detect DBC related errors\n\ +It is the user responsibility to defined these functions in the\n\ +separated .c file. If it won't be done the linkage error will happen\n*/"); + wr.Append(); + + wr.Append("#ifdef %s_USE_MONO_FMON", aset.gen.DRVNAME.c_str()); + wr.Append(); + + wr.Append("void _FMon_MONO_%s(FrameMonitor_t* _mon, uint32_t msgid);", aset.gen.drvname.c_str()); wr.Append(); for (auto it = sigs.begin(); it != sigs.end(); ++it) @@ -15,8 +46,8 @@ uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, auto msg = &((*it)->msg); wr.Append("#define FMon_%s_%s(x, y) _FMon_MONO_%s((x), (y))", msg->Name.c_str(), - gsett.drvname.c_str(), - gsett.drvname.c_str()); + aset.gen.drvname.c_str(), + aset.gen.drvname.c_str()); } wr.Append(); @@ -27,7 +58,7 @@ uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, { auto msg = &((*it)->msg); wr.Append("void _FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid);", - msg->Name.c_str(), gsett.drvname.c_str()); + msg->Name.c_str(), aset.gen.drvname.c_str()); } wr.Append(); @@ -36,23 +67,45 @@ uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, { auto msg = &((*it)->msg); wr.Append("#define FMon_%s_%s(x, y) _FMon_%s_%s((x), (y))", - msg->Name.c_str(), gsett.drvname.c_str(), - msg->Name.c_str(), gsett.drvname.c_str()); + msg->Name.c_str(), aset.gen.drvname.c_str(), + msg->Name.c_str(), aset.gen.drvname.c_str()); } wr.Append(); wr.Append("#endif"); wr.Append(); + wr.Append("#endif // %s", aset.gen.usemon_def.c_str()); + wr.Append(); + + wr.Append("#ifdef __cplusplus\n}\n#endif"); + return 0; } uint32_t MonGenerator::FillSource(FileWriter& wr, std::vector& sigs, - const GenDescriptor_t& gsett) + const AppSettings_t& aset) { - wr.Append("#ifdef %s_USE_MONO_FMON", gsett.DRVNAME.c_str()); + if (aset.gen.start_info.size() > 0) + { + wr.Append(aset.gen.start_info); + } + + wr.Append("#include <%s>", aset.file.fmon_h.fname.c_str()); + wr.Append(); + // put diagmonitor ifdef selection for including @drv-fmon header + // with FMon_* signatures to call from unpack function + wr.Append("#ifdef %s", aset.gen.usemon_def.c_str()); + wr.Append(); + + wr.Append("/*\n\ +Put the monitor function content here, keep in mind -\n\ +next generation will completely clear all manually added code (!)\n\ +*/\n\n"); + + wr.Append("#ifdef %s_USE_MONO_FMON", aset.gen.DRVNAME.c_str()); wr.Append(); - wr.Append("void _FMon_MONO_%s(FrameMonitor_t* _mon, uint32_t msgid)", gsett.drvname.c_str()); + wr.Append("void _FMon_MONO_%s(FrameMonitor_t* _mon, uint32_t msgid)", aset.gen.drvname.c_str()); wr.Append("{"); wr.Append(" (void)_mon;"); wr.Append(" (void)msgid;"); @@ -65,11 +118,13 @@ uint32_t MonGenerator::FillSource(FileWriter& wr, std::vector& sigs, { auto msg = &((*it)->msg); wr.Append("void _FMon_%s_%s(FrameMonitor_t* _mon, uint32_t msgid)\n{\n (void)_mon;\n (void)msgid;\n}\n\n", - msg->Name.c_str(), gsett.drvname.c_str()); + msg->Name.c_str(), aset.gen.drvname.c_str()); } - wr.Append("#endif // %s_USE_MONO_FMON", gsett.DRVNAME.c_str()); + wr.Append("#endif // %s_USE_MONO_FMON", aset.gen.DRVNAME.c_str()); wr.Append(); + wr.Append("#endif // %s", aset.gen.usemon_def.c_str()); + return 0; } diff --git a/src/codegen/mon-generator.h b/src/codegen/mon-generator.h index 004a77e..8369c56 100644 --- a/src/codegen/mon-generator.h +++ b/src/codegen/mon-generator.h @@ -10,6 +10,6 @@ class MonGenerator { MonGenerator() = default; - uint32_t FillHeader(FileWriter& wr, std::vector& sigs, const GenDescriptor_t& gsett); - uint32_t FillSource(FileWriter& wr, std::vector& sigs, const GenDescriptor_t& gsett); + uint32_t FillHeader(FileWriter& wr, std::vector& sigs, const AppSettings_t& gsett); + uint32_t FillSource(FileWriter& wr, std::vector& sigs, const AppSettings_t& gsett); }; From 54ff5c0950fb9befe95a90a22b53f98cbbe0123c Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 24 Jul 2022 23:01:27 +0300 Subject: [PATCH 152/181] Extended bitext test. --- src/tests/bitext-test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/bitext-test.cpp b/src/tests/bitext-test.cpp index 00786d0..11ac7e1 100644 --- a/src/tests/bitext-test.cpp +++ b/src/tests/bitext-test.cpp @@ -19,10 +19,10 @@ TEST(TestBitExt, FullTest) expect_eq(ret, cmp[val]); } - static const uint8_t val2[] { 126, 127, 128, 129 }; - static const int32_t cmp2[] { 126, 127, -128, -127}; + static const uint8_t val2[] { 126, 127, 128, 129, 255, 0, 1}; + static const int32_t cmp2[] { 126, 127, -128, -127, -1, 0, 1}; - for (uint8_t i = 0; i < 4; i++) + for (uint8_t i = 0; i < 7; i++) { auto ret = bitext(val2[i], 8); expect_eq(ret, cmp2[i]); From aad15d4cb61d637836395e42766a270aec9e8828 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 24 Jul 2022 23:36:01 +0300 Subject: [PATCH 153/181] Added option to disable some sources generation. --- src/app.cpp | 4 ++++ src/codegen/c-main-generator.cpp | 25 +++++++++++++++++-------- src/codegen/fs-creator.h | 4 ++++ src/options-parser.cpp | 14 +++++++++++++- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 3fc12af..a0b5c43 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -58,6 +58,10 @@ void CoderApp::GenerateCode() auto ret = fscreator->PrepareDirectory(Params.is_rewrite); + fscreator->FS.gen.no_config = Params.is_noconfig; + fscreator->FS.gen.no_inc = Params.is_nocanmon; + fscreator->FS.gen.no_fmon = Params.is_nofmon; + if (ret) { cigen->Generate(scanner->dblist, fscreator->FS); diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 043724d..2dc8d3b 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -60,17 +60,26 @@ void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd // 4 step is to pring fmon head file Gen_FMonHeader(); - // 5 step is to print fmon source file - Gen_FMonSource(); + if (!fsd.gen.no_fmon) + { + // 5 step is to print fmon source file + Gen_FMonSource(); + } - // 6 step is to print template for drv-config.h - Gen_ConfigHeader(); + if (!fsd.gen.no_config) + { + // 6 step is to print template for drv-config.h + Gen_ConfigHeader(); - // 7 step is to print canmonitorutil.h template code - Gen_CanMonUtil(); + // 8 step is to print dbccodeconf.h template + Gen_DbcCodeConf(); + } - // 8 step is to print dbccodeconf.h template - Gen_DbcCodeConf(); + if (!fsd.gen.no_inc) + { + // 7 step is to print canmonitorutil.h template code + Gen_CanMonUtil(); + } } void CiMainGenerator::Gen_MainHeader() diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index fa8200c..4bf649f 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -48,6 +48,10 @@ typedef struct uint32_t hiver{0}; uint32_t lowver{0}; + + bool no_fmon{false}; + bool no_inc{false}; + bool no_config{false}; } GenDescriptor_t; typedef struct diff --git a/src/options-parser.cpp b/src/options-parser.cpp index 5c73cef..2fc26bc 100644 --- a/src/options-parser.cpp +++ b/src/options-parser.cpp @@ -7,7 +7,7 @@ OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) OnePair pair{}; - Pairs pairs; + Pairs pairs{}; for (int i = 0; i < argc; i++) { @@ -63,6 +63,18 @@ OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) { pairs.is_help = true; } + else if (ret[i].first.compare("-noinc") == 0) + { + pairs.is_nocanmon = true; + } + else if (ret[i].first.compare("-noconfig") == 0) + { + pairs.is_noconfig = true; + } + else if (ret[i].first.compare("-nofmon") == 0) + { + pairs.is_nofmon = true; + } } return pairs; From 630e4ebaa71dcadbb7f2f884d1ac052675c5f276 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 24 Jul 2022 23:36:15 +0300 Subject: [PATCH 154/181] Added script to remove all generated code. --- rm-driver.sh | 1 + 1 file changed, 1 insertion(+) create mode 100755 rm-driver.sh diff --git a/rm-driver.sh b/rm-driver.sh new file mode 100755 index 0000000..3638dbc --- /dev/null +++ b/rm-driver.sh @@ -0,0 +1 @@ +(cd test/gencode && rm -r *) \ No newline at end of file From d95209af3a2cc2f2a764561ad339c931cdc93f1f Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 24 Jul 2022 23:37:24 +0300 Subject: [PATCH 155/181] Fixed astyle script. --- astyle-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astyle-all.sh b/astyle-all.sh index 9f0e45c..0b286aa 100755 --- a/astyle-all.sh +++ b/astyle-all.sh @@ -32,7 +32,7 @@ if [ $? -ne 0 ]; then exit 1 fi -FILES=`find . | grep -P "^(?!(.*\/thirdparty|.*\/lib\/dbc|.*\/bin|.*\/doc|.*\/utl|.*\/tst|.*\/generated*)).*\.(c|cpp|h)$"` +FILES=`find . | grep -P "^(?!(.*\/test\/gencode)).*\.(c|cpp|h)$"` for FILE in $FILES; do # compare files # $ASTYLE $OPTIONS < $FILE | cmp -s $FILE - From f93b2972d5e668b5cad8e3a486145ca92f400a10 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 24 Jul 2022 23:44:55 +0300 Subject: [PATCH 156/181] Update release notes. --- docs/RELEASES.md | 9 +++++++++ src/codegen/version.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index fa233bc..51f7a90 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,14 @@ # Changelog +## v2.4 24.07.2022 + +### Added + +- Three new CLI keys to optionally disable some source code generation (see help) +- Added more tests + +--- + ## v2.3 19.07.2022 ### Changed diff --git a/src/codegen/version.h b/src/codegen/version.h index b5b6298..8c6c3c9 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (3) +#define CODEGEN_LIB_VERSION_MIN (4) From 9fbe4fd2a50c6b02d48b8ab92a0f22accc958cc5 Mon Sep 17 00:00:00 2001 From: Astakhov Andrey Date: Tue, 26 Jul 2022 22:51:21 +0300 Subject: [PATCH 157/181] New monitor impl (#14) * Added build configuration for generated files. * Hash and SysTick monitor function wrapped to macros. * Release editing. App version printing. --- docs/RELEASES.md | 9 ++++++ src/CMakeLists.txt | 17 +++++++++- src/app.cpp | 3 +- src/codegen/c-main-generator.cpp | 54 ++++++++++++++++++++++--------- src/codegen/version.h | 2 +- test/gencode/conf/dbccodeconf.h | 16 +++++++++ test/gencode/inc/canmonitorutil.h | 16 ++------- test/gencode/lib/testdb.c | 16 +++++++++ test/gencode/lib/testdb.h | 2 -- 9 files changed, 101 insertions(+), 34 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 51f7a90..fecdaa7 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,14 @@ # Changelog +## v2.5 26.07.2022 + +### Changed + +- GetSystemTick and GetFrameHash functions became macroses. It makes coupling lighter +and adds more flexibility to configure driver +- bitext_t and ubitext_t defined by default in dbccodeconf.h file +- App version is printed when generator runs (not only in help print case) + ## v2.4 24.07.2022 ### Added diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9a5c47d..76f8ce5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.5) -project(coderdbc-cli LANGUAGES CXX) +project(${project} LANGUAGES C CXX) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_CXX_STANDARD 17) @@ -51,3 +51,18 @@ target_link_libraries( include(GoogleTest) gtest_discover_tests(cctest) + + +add_library( + dummy OBJECT + ${CMAKE_CURRENT_SOURCE_DIR}/../test/gencode/usr/testdb-fmon.c + ${CMAKE_CURRENT_SOURCE_DIR}/../test/gencode/lib/testdb.c + ${CMAKE_CURRENT_SOURCE_DIR}/../test/gencode/butl/bms_testdb-binutil.c +) + +target_include_directories( + dummy PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/../test/gencode/conf + ${CMAKE_CURRENT_SOURCE_DIR}/../test/gencode/lib + ${CMAKE_CURRENT_SOURCE_DIR}/../test/gencode/inc +) diff --git a/src/app.cpp b/src/app.cpp index a0b5c43..18ab98d 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -16,6 +16,8 @@ void CoderApp::Run() { + std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; + if (ParseParams()) { GenerateCode(); @@ -175,7 +177,6 @@ bool CoderApp::ParseParams() void CoderApp::PrintHelp() { - std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; std::cout << "project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; std::cout << "free web application:\thttps://coderdbc.com" << std::endl; std::cout << std::endl; diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 2dc8d3b..5fd44bd 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -112,8 +112,6 @@ void CiMainGenerator::Gen_MainHeader() fwriter->Append( "// This file must define:\n" "// base monitor struct\n" - "// function signature for HASH calculation: (@GetFrameHash)\n" - "// function signature for getting system tick value: (@GetSystemTick)\n" "#include \n" "\n" ); @@ -316,7 +314,24 @@ void CiMainGenerator::Gen_MainSource() fwriter->Append(); fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(2); + fwriter->Append(""); + fwriter->Append("// This macro guard for the case when you need to enable"); + fwriter->Append("// using diag monitors but there is no necessity in proper"); + fwriter->Append("// SysTick provider. For providing one you need define macro"); + fwriter->Append("// before this line - in dbccodeconf.h"); + fwriter->Append(""); + fwriter->Append("#ifndef GetSystemTick"); + fwriter->Append("#define GetSystemTick() (0u)"); + fwriter->Append("#endif"); + fwriter->Append(""); + fwriter->Append("// This macro guard is for the case when you want to build"); + fwriter->Append("// app with enabled optoin auto CSM, but don't yet have"); + fwriter->Append("// proper getframehash implementation"); + fwriter->Append(""); + fwriter->Append("#ifndef GetFrameHash"); + fwriter->Append("#define GetFrameHash(a,b,c,d,e) (0u)"); + fwriter->Append("#endif"); + fwriter->Append(); fwriter->Append(extend_func_body, ext_sig_func_name), 1; @@ -412,6 +427,9 @@ void CiMainGenerator::Gen_CanMonUtil() fwriter->Append(" // XOR8 = 0,"); fwriter->Append(" // XOR4 = 1,"); fwriter->Append(" // etc"); + fwriter->Append(""); + fwriter->Append(" // it is up to user to have or to skip final enum value - @CRC_ALG_COUNT"); + fwriter->Append(" CRC_ALG_COUNT"); fwriter->Append("} DbcCanCrcMethods;"); fwriter->Append(""); fwriter->Append("typedef struct"); @@ -444,19 +462,6 @@ void CiMainGenerator::Gen_CanMonUtil() fwriter->Append(""); fwriter->Append("} FrameMonitor_t;"); fwriter->Append(""); - fwriter->Append("/* ----------------------------------------------------------------------------- */"); - fwriter->Append("// @d - buff for hash calculation"); - fwriter->Append("// @len - number of bytes for hash calculation"); - fwriter->Append("// @method - hash algorythm."); - fwriter->Append("// @op - optional value"); - fwriter->Append("uint8_t GetFrameHash(const uint8_t* data_ptr, uint8_t len, uint32_t msgid, DbcCanCrcMethods type, uint32_t option);"); - fwriter->Append(""); - fwriter->Append("/* ----------------------------------------------------------------------------- */"); - fwriter->Append("// this function will be called when unpacking is performing. Value will be saved"); - fwriter->Append("// in @last_cycle variable"); - fwriter->Append("uint32_t GetSystemTick(void);"); - fwriter->Append(""); - fwriter->Append(""); fwriter->Append("#ifdef __cplusplus"); fwriter->Append("}"); fwriter->Append("#endif"); @@ -482,6 +487,23 @@ void CiMainGenerator::Gen_DbcCodeConf() fwriter->Append("// #define __DEF_{your_driver_name}__"); fwriter->Append(""); + fwriter->Append("// defualt @__ext_sig__ help types definition"); + fwriter->Append(""); + fwriter->Append("typedef uint32_t ubitext_t;"); + fwriter->Append("typedef int32_t bitext_t;"); + fwriter->Append(""); + fwriter->Append("// To provide a way to make missing control correctly you"); + fwriter->Append("// have to define macro @GetSystemTick() which has to"); + fwriter->Append("// return kind of tick counter (e.g. 1 ms ticker)"); + fwriter->Append(""); + fwriter->Append("// #define GetSystemTick() __get__tick__()"); + fwriter->Append(""); + fwriter->Append("// To provide a way to calculate hash (crc) for CAN"); + fwriter->Append("// frame's data field you have to define macro @GetFrameHash"); + fwriter->Append(""); + fwriter->Append("// #define GetFrameHash(a,b,c,d,e) __get_hash__(a,b,c,d,e)"); + fwriter->Append(""); + fwriter->Flush(fdesc->file.confdir + '/' + "dbccodeconf.h"); } diff --git a/src/codegen/version.h b/src/codegen/version.h index 8c6c3c9..c028225 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (4) +#define CODEGEN_LIB_VERSION_MIN (5) diff --git a/test/gencode/conf/dbccodeconf.h b/test/gencode/conf/dbccodeconf.h index 34201b7..9dc616c 100644 --- a/test/gencode/conf/dbccodeconf.h +++ b/test/gencode/conf/dbccodeconf.h @@ -12,3 +12,19 @@ // if you need to allocate rx and tx messages structs put the allocation macro here // #define __DEF_{your_driver_name}__ +// defualt @__ext_sig__ help types definition + +typedef uint32_t ubitext_t; +typedef int32_t bitext_t; + +// To provide a way to make missing control correctly you +// have to define macro @GetSystemTick() which has to +// return kind of tick counter (e.g. 1 ms ticker) + +// #define GetSystemTick() __get__tick__() + +// To provide a way to calculate hash (crc) for CAN +// frame's data field you have to define macro @GetFrameHash + +// #define GetFrameHash(a,b,c,d,e) __get_hash__(a,b,c,d,e) + diff --git a/test/gencode/inc/canmonitorutil.h b/test/gencode/inc/canmonitorutil.h index 48cd48f..b93dd75 100644 --- a/test/gencode/inc/canmonitorutil.h +++ b/test/gencode/inc/canmonitorutil.h @@ -12,6 +12,9 @@ typedef enum // XOR8 = 0, // XOR4 = 1, // etc + + // it is up to user to have or to skip final enum value - @CRC_ALG_COUNT + CRC_ALG_COUNT } DbcCanCrcMethods; typedef struct @@ -44,19 +47,6 @@ typedef struct } FrameMonitor_t; -/* ----------------------------------------------------------------------------- */ -// @d - buff for hash calculation -// @len - number of bytes for hash calculation -// @method - hash algorythm. -// @op - optional value -uint8_t GetFrameHash(const uint8_t* data_ptr, uint8_t len, uint32_t msgid, DbcCanCrcMethods type, uint32_t option); - -/* ----------------------------------------------------------------------------- */ -// this function will be called when unpacking is performing. Value will be saved -// in @last_cycle variable -uint32_t GetSystemTick(void); - - #ifdef __cplusplus } #endif diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index a49f1ab..4541c55 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -13,6 +13,22 @@ #endif // TESTDB_USE_DIAG_MONITORS +// This macro guard for the case when you need to enable +// using diag monitors but there is no necessity in proper +// SysTick provider. For providing one you need define macro +// before this line - in dbccodeconf.h + +#ifndef GetSystemTick +#define GetSystemTick() (0u) +#endif + +// This macro guard is for the case when you want to build +// app with enabled optoin auto CSM, but don't yet have +// proper getframehash implementation + +#ifndef GetFrameHash +#define GetFrameHash(a,b,c,d,e) (0u) +#endif // This function performs extension of sign for the signals // which have non-aligned to power of 2 bit's width. diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 0e4a1b9..add0dd2 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -16,8 +16,6 @@ extern "C" { #ifdef TESTDB_USE_DIAG_MONITORS // This file must define: // base monitor struct -// function signature for HASH calculation: (@GetFrameHash) -// function signature for getting system tick value: (@GetSystemTick) #include #endif // TESTDB_USE_DIAG_MONITORS From d63b36a2280e5785ff5f29a8cddf89784aee9f34 Mon Sep 17 00:00:00 2001 From: astand Date: Thu, 29 Sep 2022 22:40:32 +0300 Subject: [PATCH 158/181] Fixed long line reading from istream. --- docs/RELEASES.md | 8 ++++++++ src/codegen/filewriter.cpp | 10 +++++++--- src/parser/dbcscanner.cpp | 14 ++++---------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index fecdaa7..d430b6e 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,13 @@ # Changelog +## v2.6 29.09.2022 + +### Fixed + +- [issue #9](https://github.com/astand/c-coderdbc/issues/16) found by [@DPOH357](https://github.com/DPOH357) + +--- + ## v2.5 26.07.2022 ### Changed diff --git a/src/codegen/filewriter.cpp b/src/codegen/filewriter.cpp index 5ceef2b..6ff5c15 100644 --- a/src/codegen/filewriter.cpp +++ b/src/codegen/filewriter.cpp @@ -5,14 +5,18 @@ #include #include "filewriter.h" -template +template std::string __print_loc__(const char* format, va_list args) { - // TODO: make N sanitizing here to prevent memory errors char work_buff[N] = {0}; auto ret = vsnprintf(work_buff, N, format, args); - assert(ret < N); + if (ret >= N) + { + std::cout << "Attention (!) the line has been shortened : " << std::endl; + std::cout << work_buff << std::endl; + } + // make string from local array return work_buff; } diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index d221a6f..d29d7c0 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -4,10 +4,6 @@ #include #include "../helpers/formatter.h" -#define MAX_LINE 4096 * 4 - -char line[MAX_LINE] = { 0 }; - MessageDescriptor_t* find_message(vector msgs, uint32_t ID) { MessageDescriptor_t* ret = nullptr; @@ -72,9 +68,8 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) while (readstrm.eof() == false) { - readstrm.getline(line, MAX_LINE); - - sline = str_trim(line); + std::getline(readstrm, sline); + sline = str_trim(sline); FindVersion(sline); @@ -160,9 +155,8 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) while (!readstrm.eof()) { - readstrm.getline(line, MAX_LINE); - - sline = str_trim(line); + std::getline(readstrm, sline); + sline = str_trim(sline); if (lparser.ParseCommentLine(&cmmnt, sline)) { From b89d2ee4ee58221c7c62cdd1ae3b99bbcf5fd926 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 15 Jan 2023 14:55:58 +0100 Subject: [PATCH 159/181] Fixed floating parsing, better printing, removed duplication. --- docs/RELEASES.md | 14 ++++ src/CMakeLists.txt | 2 + src/codegen/c-main-generator.cpp | 14 +++- src/codegen/c-sigprinter.cpp | 9 ++- src/codegen/version.h | 2 +- src/helpers/formatter.cpp | 57 ++++++++++++++ src/helpers/formatter.h | 7 ++ src/parser/dbclineparser.cpp | 43 +++++++---- src/tests/dbcline-test.cpp | 126 +++++++++++++++++++++++++++++++ test/gencode/lib/testdb.h | 64 ++++++++-------- 10 files changed, 284 insertions(+), 54 deletions(-) create mode 100644 src/tests/dbcline-test.cpp diff --git a/docs/RELEASES.md b/docs/RELEASES.md index d430b6e..441d323 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,19 @@ # Changelog +## v2.7 + +### Fixed + +- Removed signal conversion macroses duplication ([issue #11](https://github.com/astand/c-coderdbc/issues/18)) +- More precise floating factor/offset values handling ([issue #10](https://github.com/astand/c-coderdbc/issues/20)) + +### Added + +- Better print for floating factor/offset values (removed tailing zeros) +- Signals with too low factor/offset values (less than 0.000000001) are considered as plain integer signals, it is up to client to handle them + +--- + ## v2.6 29.09.2022 ### Fixed diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 76f8ce5..b3996bb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,8 +40,10 @@ add_executable( cctest ${CMAKE_CURRENT_SOURCE_DIR}/helpers/formatter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/options-parser.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/parser/dbclineparser.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/args-test.cpp ${CMAKE_CURRENT_SOURCE_DIR}/tests/bitext-test.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/tests/dbcline-test.cpp ) target_link_libraries( diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 5fd44bd..f83691a 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "helpers/formatter.h" #include "mon-generator.h" @@ -84,6 +85,8 @@ void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd void CiMainGenerator::Gen_MainHeader() { + std::set passed_sigs; + // write comment start text if (fdesc->gen.start_info.size() > 0) { @@ -148,7 +151,12 @@ void CiMainGenerator::Gen_MainHeader() if (!s.IsSimpleSig) { - fwriter->Append(sigprt->PrintPhysicalToRaw(&s, fdesc->gen.DRVNAME)); + if (passed_sigs.find(s.Name) == passed_sigs.end()) + { + // print signal macroses only it was not printed before + fwriter->Append(sigprt->PrintPhysicalToRaw(&s, fdesc->gen.DRVNAME)); + passed_sigs.insert(s.Name); + } } if (s.Name.size() > max_sig_name_len) @@ -561,14 +569,14 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi { infocmnt = IndentedString(offset, infocmnt); offset += 27; - infocmnt += StrPrint(" Offset= %f", sig.Offset); + infocmnt += StrPrint(" Offset= %s", prt_double(sig.Offset, 9)); } if (sig.Factor != 1) { infocmnt = IndentedString(offset, infocmnt); offset += 24; - infocmnt += StrPrint(" Factor= %f", sig.Factor); + infocmnt += StrPrint(" Factor= %s", prt_double(sig.Factor, 9)); } } else if (sig.IsSimpleSig == false) diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 82cda5c..35667ff 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -54,11 +54,14 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const { std::string retstr = ""; + const std::string prtFactor = prt_double(sig->Factor, 9); + const std::string prtOffset = prt_double(sig->Offset, 9); + retstr = StrPrint("// signal: @%s\n", sig->Name.c_str()); if (sig->IsDoubleSig) { - retstr += StrPrint("#define %s_%s_CovFactor (%f)\n", drvname.c_str(), sig->Name.c_str(), sig->Factor); + retstr += StrPrint("#define %s_%s_CovFactor (%s)\n", drvname.c_str(), sig->Name.c_str(), prtFactor.c_str()); } else { @@ -70,7 +73,7 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const if (sig->IsDoubleSig) { - retstr += StrPrint("(((x) - (%f)) / (%f)) )\n", sig->Offset, sig->Factor); + retstr += StrPrint("(((x) - (%s)) / (%s)) )\n", prtOffset.c_str(), prtFactor.c_str()); } else { @@ -95,7 +98,7 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const if (sig->IsDoubleSig) { - retstr += StrPrint("(((x) * (%f)) + (%f)) )\n", sig->Factor, sig->Offset); + retstr += StrPrint("(((x) * (%s)) + (%s)) )\n", prtFactor.c_str(), prtOffset.c_str()); } else { diff --git a/src/codegen/version.h b/src/codegen/version.h index c028225..d3d5629 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (5) +#define CODEGEN_LIB_VERSION_MIN (7) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index eb7d74d..561dea8 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -143,3 +143,60 @@ std::string make_c_name(const std::string& s) return ret; } + +const char* prt_double(double value, size_t presicsion, bool usedot) +{ + constexpr size_t MAX_CAP = 1024u; + + static char buff[MAX_CAP] = {0}; + + // sprint value with max precision (currently 15 digits) + snprintf(buff, MAX_CAP, "%.15f", value); + + size_t last_non_zero_id = 0u; + size_t dot_id = 0u; + size_t left_to_check = presicsion; + + for (size_t i = 0u; i < MAX_CAP - 1u; i++) + { + if ((buff[i] == '.') && (last_non_zero_id == 0u)) + { + // dot is detected + last_non_zero_id = i; + + if (usedot) + { + // forcibly leave at least 1 position after dot + last_non_zero_id = i + 1u; + } + + dot_id = i; + } + else if (last_non_zero_id != 0u) + { + if ((left_to_check == 0u) || (buff[i] < '0') || (buff[i] > '9')) + { + break; + } + + if ((buff[i] > '0') && (buff[i] < '9')) + { + last_non_zero_id = i; + } + + left_to_check--; + } + } + + if (last_non_zero_id == dot_id) + { + buff[dot_id] = '\0'; + } + else + { + buff[last_non_zero_id + 1u] = '\0'; + } + + return buff; +} + diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index 333fa69..034c2b3 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -17,6 +17,13 @@ std::string str_tolower(std::string s); std::string str_trim(std::string s); +/// @brief Function prints double value with dropping tailing zeros +/// @param value value to format +/// @param presicsion maximal precision length +/// @param usedot true for forcibly print presicion 1 (one digit after dot) +/// @return pointer to internal char array with value representation +const char* prt_double(double value, size_t presicsion, bool usedot = true); + /** * @brief Makes input string valid C-identifier * diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index cb4d163..6473613 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -6,6 +6,9 @@ #include #include +/// @brief Minimal possible value for Factor/Offset +constexpr double MIN_FAC_OFF = 0.000000001; + // Message line definitions static const std::string regMessage = "[^A-Za-z0-9_.-]"; static const std::string MessageLineStart = "BO_ "; @@ -232,36 +235,50 @@ bool DbcLineParser::ParseSignalLine(SignalDescriptor_t* sig, const std::string& // for enabling double conversation the factor or offset // substring must have dot ('.') character - if (valpart[3].find_first_of('.') != std::string::npos || - valpart[4].find_first_of('.') != std::string::npos) + if (valpart[3].find_first_of('.') != std::string::npos + || valpart[4].find_first_of('.') != std::string::npos + || valpart[3].find_first_of('E') != std::string::npos + || valpart[3].find_first_of('e') != std::string::npos + || valpart[4].find_first_of('E') != std::string::npos + || valpart[4].find_first_of('e') != std::string::npos + ) { sig->IsDoubleSig = true; } - // factor = double; - // offset = double; - //The factorand offset define the linear conversion rule to convert the signals raw - //value into the signal's physical value and vice versa: - // physical_value = raw_value * factor + offset - // raw_value = (physical_value - offset) / factor + // factor = double; + // offset = double; + // + // The factorand offset define the linear conversion rule to convert the signals raw + // value into the signal's physical value and vice versa: + // physical_value = raw_value * factor + offset + // raw_value = (physical_value - offset) / factor std::setlocale(LC_ALL, "en_US.UTF-8"); sig->Factor = atof(valpart[3].c_str()); sig->Offset = atof(valpart[4].c_str()); + if (((std::fabs(sig->Factor) < MIN_FAC_OFF) && (sig->Factor != 0.0)) || + ((std::fabs(sig->Offset) < MIN_FAC_OFF) && (sig->Offset != 0.0))) + { + // this values are not supported, treat this signal as a plain integer + sig->Factor = 1.0; + sig->Offset = 0.0; + sig->IsDoubleSig = false; + } + sig->RawOffset = sig->Offset / sig->Factor; sig->MinValue = atof(valpart[5].c_str()); sig->MaxValue = atof(valpart[6].c_str()); - //The signal_size specifies the size of the signal in bits - // byte_order = '0' | '1'; (*0 = little endian, 1 = big endian*) + // Bytes layout + // 0: Big endian (Motorolla) + // 1: Little endian (Intel) sig->Order = (valpart[2].find('1') == std::string::npos) ? BitLayout::kMotorolla : BitLayout::kIntel; - //The byte_format is 0 if the signal's byte order is Intel (little endian) or 1 if the byte - //order is Motorola(big endian). - // value_type = '+' | '-'; (*+= unsigned, -=signed*) + // value_type = '+' | '-'; (*+= unsigned, -=signed*) sig->Signed = (valpart[2].find('-') == std::string::npos) ? 0 : 1; GetSigType(sig); diff --git a/src/tests/dbcline-test.cpp b/src/tests/dbcline-test.cpp new file mode 100644 index 0000000..d80e584 --- /dev/null +++ b/src/tests/dbcline-test.cpp @@ -0,0 +1,126 @@ +#include +#include "testapi.h" +#include "parser/dbclineparser.h" +#include "helpers/formatter.h" + + +TEST(TestSigLineParsing, test1) +{ + DbcLineParser parser; + + const std::string t2 = " SG_ FLT4_TEST_1 : 39|4@0+ (2.01,1E-002) [-0.01|30.14] \"\" BCM"; + + expect_true(parser.IsSignalLine(t2)); + + SignalDescriptor_t dsc; + + parser.ParseSignalLine(&dsc, t2); + + expect_true(dsc.IsDoubleSig); + expect_true(dsc.Offset == 0.01); + + const std::string t3 = " SG_ FLT4_TEST_1 : 39|4@0+ (2, 1) [-0.01|30.14] \"\" BCM"; + + parser.ParseSignalLine(&dsc, t3); + + expect_false(dsc.IsDoubleSig); + expect_true(dsc.Offset == 1.0); + + // last supported double values + const std::string t2_ok_norm = " SG_ FLT4_TEST_1 : 39|4@0+ (2, 0.000000001) [-0.01|30.14] \"\" BCM"; + const std::string t2_ok_scie = " SG_ FLT4_TEST_1 : 39|4@0+ (2, 1e-9) [-0.01|30.14] \"\" BCM"; + // next values (and less than) are not currently supported + const std::string t2_nok_norm = " SG_ FLT4_TEST_1 : 39|4@0+ (2, 0.00000000099) [-0.01|30.14] \"\" BCM"; + const std::string t2_nok_scie = " SG_ FLT4_TEST_1 : 39|4@0+ (2, 1e-10) [-0.01|30.14] \"\" BCM"; + const std::string t3_nok_scie = " SG_ FLT4_TEST_1 : 39|4@0+ (1e-10, 44) [-0.01|30.14] \"\" BCM"; + const std::string t3_nok_norm = " SG_ FLT4_TEST_1 : 39|4@0+ (0.00000000099, 2) [-0.01|30.14] \"\" BCM"; + + parser.ParseSignalLine(&dsc, t2_ok_norm); + + expect_true(dsc.IsDoubleSig); + expect_eq(dsc.Offset, 0.000000001); + expect_eq(dsc.Factor, 2.0); + + parser.ParseSignalLine(&dsc, t2_ok_scie); + + expect_true(dsc.IsDoubleSig); + expect_eq(dsc.Offset, 0.000000001); + expect_eq(dsc.Factor, 2.0); + + parser.ParseSignalLine(&dsc, t3_nok_norm); + + expect_false(dsc.IsDoubleSig); + expect_eq(dsc.Offset, 0.0); + expect_eq(dsc.Factor, 1.0); + + parser.ParseSignalLine(&dsc, t3_nok_scie); + + expect_false(dsc.IsDoubleSig); + expect_eq(dsc.Offset, 0.0); + expect_eq(dsc.Factor, 1.0); + +} + +TEST(TestSigLineParsing, test_02) +{ + const std::string t3_ok = " SG_ FLT4_TEST_1 : 39|4@0+ (0.99, 0) [-0.01|30.14] \"\" BCM"; + const std::string t4_ok = " SG_ FLT4_TEST_1 : 39|4@0+ (0, -0.11) [-0.01|30.14] \"\" BCM"; + const std::string t5_notok = " SG_ FLT4_TEST_1 : 39|4@0+ (0.00000000099, 0) [-0.01|30.14] \"\" BCM"; + const std::string t6_ok = " SG_ FLT4_TEST_1 : 39|4@0+ (0, 0.000000000000) [-0.01|30.14] \"\" BCM"; + + DbcLineParser parser; + + SignalDescriptor_t dsc; + + parser.ParseSignalLine(&dsc, t3_ok); + + expect_true(dsc.IsDoubleSig); + + parser.ParseSignalLine(&dsc, t4_ok); + + expect_true(dsc.IsDoubleSig); + expect_eq(dsc.Factor, 0.0); + expect_eq(dsc.Offset, -0.11); + + parser.ParseSignalLine(&dsc, t5_notok); + + expect_false(dsc.IsDoubleSig); + expect_eq(dsc.Factor, 1.0); + expect_eq(dsc.Offset, 0.0); + + parser.ParseSignalLine(&dsc, t6_ok); + + expect_true(dsc.IsDoubleSig); + expect_eq(dsc.Factor, 0.0); + expect_eq(dsc.Offset, 0.0); + +} + +TEST(TestSigLineParsing, test_prt_double) +{ + constexpr double v = -124.10001110002220; + + expect_eq((std::string)prt_double(v, 0, false), (std::string)"-124"); + expect_eq((std::string)prt_double(v, 1, false), (std::string)"-124.1"); + expect_eq((std::string)prt_double(v, 2, false), (std::string)"-124.1"); + expect_eq((std::string)prt_double(v, 3, false), (std::string)"-124.1"); + expect_eq((std::string)prt_double(v, 4, false), (std::string)"-124.1"); + expect_eq((std::string)prt_double(v, 5, false), (std::string)"-124.10001"); + expect_eq((std::string)prt_double(v, 6, false), (std::string)"-124.100011"); + expect_eq((std::string)prt_double(v, 7, false), (std::string)"-124.1000111"); + expect_eq((std::string)prt_double(v, 8, false), (std::string)"-124.1000111"); + expect_eq((std::string)prt_double(v, 9, false), (std::string)"-124.1000111"); + + constexpr double vint = 123.0000; + + expect_eq((std::string)prt_double(vint, 3), (std::string)"123.0"); + expect_eq((std::string)prt_double(vint, 2), (std::string)"123.0"); + expect_eq((std::string)prt_double(vint, 1), (std::string)"123.0"); + expect_eq((std::string)prt_double(vint, 0), (std::string)"123.0"); + expect_eq((std::string)prt_double(vint, 100), (std::string)"123.0"); + expect_eq((std::string)prt_double(vint, 1000), (std::string)"123.0"); + + constexpr double v2 = 0.0110022; + + expect_eq((std::string)prt_double(v2, 0), "0.0"); +} diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index add0dd2..29e6799 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -272,21 +272,21 @@ typedef struct #define TESTDB_INT_TEST_2_ro_toS(x) ( (int8_t) ((x) / (5)) ) #define TESTDB_INT_TEST_2_ro_fromS(x) ( ((x) * (5)) ) // signal: @Accel_ro -#define TESTDB_Accel_ro_CovFactor (0.100000) -#define TESTDB_Accel_ro_toS(x) ( (uint16_t) (((x) - (-100.000000)) / (0.100000)) ) -#define TESTDB_Accel_ro_fromS(x) ( (((x) * (0.100000)) + (-100.000000)) ) +#define TESTDB_Accel_ro_CovFactor (0.1) +#define TESTDB_Accel_ro_toS(x) ( (uint16_t) (((x) - (-100.0)) / (0.1)) ) +#define TESTDB_Accel_ro_fromS(x) ( (((x) * (0.1)) + (-100.0)) ) // signal: @FLT4_TEST_1_ro -#define TESTDB_FLT4_TEST_1_ro_CovFactor (2.010000) -#define TESTDB_FLT4_TEST_1_ro_toS(x) ( (uint8_t) (((x) - (-0.010000)) / (2.010000)) ) -#define TESTDB_FLT4_TEST_1_ro_fromS(x) ( (((x) * (2.010000)) + (-0.010000)) ) +#define TESTDB_FLT4_TEST_1_ro_CovFactor (2.01) +#define TESTDB_FLT4_TEST_1_ro_toS(x) ( (uint8_t) (((x) - (-0.01)) / (2.01)) ) +#define TESTDB_FLT4_TEST_1_ro_fromS(x) ( (((x) * (2.01)) + (-0.01)) ) // signal: @FLT4_TEST_2_ro -#define TESTDB_FLT4_TEST_2_ro_CovFactor (2.010000) -#define TESTDB_FLT4_TEST_2_ro_toS(x) ( (uint8_t) (((x) - (-5.000000)) / (2.010000)) ) -#define TESTDB_FLT4_TEST_2_ro_fromS(x) ( (((x) * (2.010000)) + (-5.000000)) ) +#define TESTDB_FLT4_TEST_2_ro_CovFactor (2.01) +#define TESTDB_FLT4_TEST_2_ro_toS(x) ( (uint8_t) (((x) - (-5.0)) / (2.01)) ) +#define TESTDB_FLT4_TEST_2_ro_fromS(x) ( (((x) * (2.01)) + (-5.0)) ) // signal: @FLT4_TEST_3_ro -#define TESTDB_FLT4_TEST_3_ro_CovFactor (2.000000) -#define TESTDB_FLT4_TEST_3_ro_toS(x) ( (uint8_t) (((x) - (-10.100000)) / (2.000000)) ) -#define TESTDB_FLT4_TEST_3_ro_fromS(x) ( (((x) * (2.000000)) + (-10.100000)) ) +#define TESTDB_FLT4_TEST_3_ro_CovFactor (2.0) +#define TESTDB_FLT4_TEST_3_ro_toS(x) ( (uint8_t) (((x) - (-10.1)) / (2.0)) ) +#define TESTDB_FLT4_TEST_3_ro_fromS(x) ( (((x) * (2.0)) + (-10.1)) ) // signal: @INT_TEST_1_ro #define TESTDB_INT_TEST_1_ro_CovFactor (9) #define TESTDB_INT_TEST_1_ro_toS(x) ( (uint8_t) (((x) - (-11)) / (9)) ) @@ -318,25 +318,25 @@ typedef struct // uint8_t CS : 4; // Bits= 4 - uint16_t Accel_ro; // Bits=12 Offset= -100.000000 Factor= 0.100000 Unit:'m/s' + uint16_t Accel_ro; // Bits=12 Offset= -100.0 Factor= 0.1 Unit:'m/s' #ifdef TESTDB_USE_SIGFLOAT sigfloat_t Accel_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_1_ro : 4; // Bits= 4 Offset= -0.010000 Factor= 2.010000 + uint8_t FLT4_TEST_1_ro : 4; // Bits= 4 Offset= -0.01 Factor= 2.01 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_1_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_2_ro : 4; // Bits= 4 Offset= -5.000000 Factor= 2.010000 + uint8_t FLT4_TEST_2_ro : 4; // Bits= 4 Offset= -5.0 Factor= 2.01 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_2_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_3_ro : 4; // Bits= 4 Offset= -10.100000 Factor= 2.000000 + uint8_t FLT4_TEST_3_ro : 4; // Bits= 4 Offset= -10.1 Factor= 2.0 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_3_phys; @@ -378,25 +378,25 @@ typedef struct // uint8_t CS; // Bits= 4 - uint16_t Accel_ro; // Bits=12 Offset= -100.000000 Factor= 0.100000 Unit:'m/s' + uint16_t Accel_ro; // Bits=12 Offset= -100.0 Factor= 0.1 Unit:'m/s' #ifdef TESTDB_USE_SIGFLOAT sigfloat_t Accel_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_1_ro; // Bits= 4 Offset= -0.010000 Factor= 2.010000 + uint8_t FLT4_TEST_1_ro; // Bits= 4 Offset= -0.01 Factor= 2.01 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_1_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_2_ro; // Bits= 4 Offset= -5.000000 Factor= 2.010000 + uint8_t FLT4_TEST_2_ro; // Bits= 4 Offset= -5.0 Factor= 2.01 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_2_phys; #endif // TESTDB_USE_SIGFLOAT - uint8_t FLT4_TEST_3_ro; // Bits= 4 Offset= -10.100000 Factor= 2.000000 + uint8_t FLT4_TEST_3_ro; // Bits= 4 Offset= -10.1 Factor= 2.0 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t FLT4_TEST_3_phys; @@ -433,21 +433,17 @@ typedef struct #define TESTDB_sig15_ro_toS(x) ( (int16_t) (((x) - (-1024)) / (3)) ) #define TESTDB_sig15_ro_fromS(x) ( (((x) * (3)) + (-1024)) ) // signal: @sig15_2_ro -#define TESTDB_sig15_2_ro_CovFactor (1.900000) -#define TESTDB_sig15_2_ro_toS(x) ( (int16_t) (((x) - (-2500.000000)) / (1.900000)) ) -#define TESTDB_sig15_2_ro_fromS(x) ( (((x) * (1.900000)) + (-2500.000000)) ) +#define TESTDB_sig15_2_ro_CovFactor (1.9) +#define TESTDB_sig15_2_ro_toS(x) ( (int16_t) (((x) - (-2500.0)) / (1.9)) ) +#define TESTDB_sig15_2_ro_fromS(x) ( (((x) * (1.9)) + (-2500.0)) ) // signal: @sig8_ro #define TESTDB_sig8_ro_CovFactor (5) #define TESTDB_sig8_ro_toS(x) ( (int8_t) ((x) / (5)) ) #define TESTDB_sig8_ro_fromS(x) ( ((x) * (5)) ) // signal: @sig_7_ro -#define TESTDB_sig_7_ro_CovFactor (1.200000) -#define TESTDB_sig_7_ro_toS(x) ( (int8_t) (((x) - (0.000000)) / (1.200000)) ) -#define TESTDB_sig_7_ro_fromS(x) ( (((x) * (1.200000)) + (0.000000)) ) -// signal: @U7_TEST_1_ro -#define TESTDB_U7_TEST_1_ro_CovFactor (1) -#define TESTDB_U7_TEST_1_ro_toS(x) ( (uint8_t) ((x) - (-255)) ) -#define TESTDB_U7_TEST_1_ro_fromS(x) ( ((x) + (-255)) ) +#define TESTDB_sig_7_ro_CovFactor (1.2) +#define TESTDB_sig_7_ro_toS(x) ( (int8_t) (((x) - (0.0)) / (1.2)) ) +#define TESTDB_sig_7_ro_fromS(x) ( (((x) * (1.2)) + (0.0)) ) typedef struct { @@ -459,7 +455,7 @@ typedef struct int32_t sig15_phys; #endif // TESTDB_USE_SIGFLOAT - int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 + int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.0 Factor= 1.9 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig15_2_phys; @@ -471,7 +467,7 @@ typedef struct int16_t sig8_phys; #endif // TESTDB_USE_SIGFLOAT - int8_t sig_7_ro : 7; // [-] Bits= 7 Factor= 1.200000 + int8_t sig_7_ro : 7; // [-] Bits= 7 Factor= 1.2 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig_7_phys; @@ -491,7 +487,7 @@ typedef struct int32_t sig15_phys; #endif // TESTDB_USE_SIGFLOAT - int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.000000 Factor= 1.900000 + int16_t sig15_2_ro; // [-] Bits=15 Offset= -2500.0 Factor= 1.9 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig15_2_phys; @@ -503,7 +499,7 @@ typedef struct int16_t sig8_phys; #endif // TESTDB_USE_SIGFLOAT - int8_t sig_7_ro; // [-] Bits= 7 Factor= 1.200000 + int8_t sig_7_ro; // [-] Bits= 7 Factor= 1.2 #ifdef TESTDB_USE_SIGFLOAT sigfloat_t sig_7_phys; From 17218df8e2c5c522657c19a6937404fba2ca42f1 Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 17 Jan 2023 22:17:07 +0100 Subject: [PATCH 160/181] Fixed bug in prt_double --- src/codegen/c-main-generator.cpp | 4 ++-- src/helpers/formatter.cpp | 6 +++--- src/helpers/formatter.h | 4 ++-- src/tests/dbcline-test.cpp | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index f83691a..9da792c 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -569,14 +569,14 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi { infocmnt = IndentedString(offset, infocmnt); offset += 27; - infocmnt += StrPrint(" Offset= %s", prt_double(sig.Offset, 9)); + infocmnt += StrPrint(" Offset= %s", prt_double(sig.Offset, 9).c_str()); } if (sig.Factor != 1) { infocmnt = IndentedString(offset, infocmnt); offset += 24; - infocmnt += StrPrint(" Factor= %s", prt_double(sig.Factor, 9)); + infocmnt += StrPrint(" Factor= %s", prt_double(sig.Factor, 9).c_str()); } } else if (sig.IsSimpleSig == false) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index 561dea8..ee66d3f 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -144,11 +144,11 @@ std::string make_c_name(const std::string& s) return ret; } -const char* prt_double(double value, size_t presicsion, bool usedot) +std::string prt_double(double value, size_t presicsion, bool usedot) { constexpr size_t MAX_CAP = 1024u; - static char buff[MAX_CAP] = {0}; + char buff[MAX_CAP] = {0}; // sprint value with max precision (currently 15 digits) snprintf(buff, MAX_CAP, "%.15f", value); @@ -179,7 +179,7 @@ const char* prt_double(double value, size_t presicsion, bool usedot) break; } - if ((buff[i] > '0') && (buff[i] < '9')) + if ((buff[i] > '0') && (buff[i] <= '9')) { last_non_zero_id = i; } diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index 034c2b3..fb44296 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -21,8 +21,8 @@ std::string str_trim(std::string s); /// @param value value to format /// @param presicsion maximal precision length /// @param usedot true for forcibly print presicion 1 (one digit after dot) -/// @return pointer to internal char array with value representation -const char* prt_double(double value, size_t presicsion, bool usedot = true); +/// @return string object fixed formatted value +std::string prt_double(double value, size_t presicsion, bool usedot = true); /** * @brief Makes input string valid C-identifier diff --git a/src/tests/dbcline-test.cpp b/src/tests/dbcline-test.cpp index d80e584..8c1a51f 100644 --- a/src/tests/dbcline-test.cpp +++ b/src/tests/dbcline-test.cpp @@ -123,4 +123,18 @@ TEST(TestSigLineParsing, test_prt_double) constexpr double v2 = 0.0110022; expect_eq((std::string)prt_double(v2, 0), "0.0"); + + constexpr double v3 = 20.4699999999; + + expect_eq((std::string)prt_double(v3, 9), "20.469999999"); + expect_eq((std::string)prt_double(v3, 8), "20.46999999"); + expect_eq((std::string)prt_double(v3, 7), "20.4699999"); + expect_eq((std::string)prt_double(v3, 3), "20.469"); + + constexpr double v4 = -20.4699999999; + + expect_eq((std::string)prt_double(v4, 9), "-20.469999999"); + expect_eq((std::string)prt_double(v4, 8), "-20.46999999"); + expect_eq((std::string)prt_double(v4, 7), "-20.4699999"); + expect_eq((std::string)prt_double(v4, 3), "-20.469"); } From 286b76c075921cc63e8ea8b6693985b13ddefbec Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 18 Jan 2023 20:58:10 +0100 Subject: [PATCH 161/181] Style script handles 'src' directory only --- astyle-all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astyle-all.sh b/astyle-all.sh index 0b286aa..fe43d65 100755 --- a/astyle-all.sh +++ b/astyle-all.sh @@ -32,7 +32,7 @@ if [ $? -ne 0 ]; then exit 1 fi -FILES=`find . | grep -P "^(?!(.*\/test\/gencode)).*\.(c|cpp|h)$"` +FILES=`find . | grep -P "^(.*\/src).*\.(c|cpp|h)$"` for FILE in $FILES; do # compare files # $ASTYLE $OPTIONS < $FILE | cmp -s $FILE - From 5648e4ac7e1b861cf4fa74cf739664c44e719114 Mon Sep 17 00:00:00 2001 From: Alex Ch Date: Wed, 25 Jan 2023 21:04:58 +0300 Subject: [PATCH 162/181] prt_double fix (#21) * prt_double fix (for e.g. '-20.47') * generator updated * Styling and doxy fixes * astyle script corrected * RELEASES file updated * Rebased with master * DBC line test fixed Co-authored-by: Alexey Chernobaev --- astyle-all.sh | 2 +- docs/RELEASES.md | 6 +++ src/codegen/c-main-generator.cpp | 4 +- src/helpers/formatter.cpp | 68 +++++++++++++++----------------- src/helpers/formatter.h | 6 +-- src/tests/dbcline-test.cpp | 61 +++++++++++++++------------- 6 files changed, 77 insertions(+), 70 deletions(-) diff --git a/astyle-all.sh b/astyle-all.sh index fe43d65..292a094 100755 --- a/astyle-all.sh +++ b/astyle-all.sh @@ -26,7 +26,7 @@ OPTIONS="--suffix=none \ --max-continuation-indent=120" RETURN=0 -ASTYLE='astyle' +ASTYLE='./astyle' if [ $? -ne 0 ]; then echo "[!] astyle not installed. Unable to check source file format policy." >&2 exit 1 diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 441d323..3f97205 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,11 @@ # Changelog +## v2.8 + +### Fixed + +- Floating factor/offset values handling (incorrect rounding in some cases). + ## v2.7 ### Fixed diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 9da792c..a2a7d97 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -569,14 +569,14 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi { infocmnt = IndentedString(offset, infocmnt); offset += 27; - infocmnt += StrPrint(" Offset= %s", prt_double(sig.Offset, 9).c_str()); + infocmnt += " Offset= " + prt_double(sig.Offset, 9); } if (sig.Factor != 1) { infocmnt = IndentedString(offset, infocmnt); offset += 24; - infocmnt += StrPrint(" Factor= %s", prt_double(sig.Factor, 9).c_str()); + infocmnt += " Factor= " + prt_double(sig.Factor, 9); } } else if (sig.IsSimpleSig == false) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index ee66d3f..4ca9f28 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -1,5 +1,7 @@ #include "formatter.h" #include +#include +#include static const size_t kMaxWorkArrLength = 4096; @@ -144,59 +146,51 @@ std::string make_c_name(const std::string& s) return ret; } -std::string prt_double(double value, size_t presicsion, bool usedot) +std::string prt_double(double value, size_t precision, bool usedot) { - constexpr size_t MAX_CAP = 1024u; + precision = std::min(precision, (size_t)std::numeric_limits::digits10); - char buff[MAX_CAP] = {0}; + std::stringstream ss; + ss.imbue(std::locale::classic()); + ss << std::fixed << std::setprecision(precision) << value; - // sprint value with max precision (currently 15 digits) - snprintf(buff, MAX_CAP, "%.15f", value); + std::string s(ss.str()); - size_t last_non_zero_id = 0u; - size_t dot_id = 0u; - size_t left_to_check = presicsion; + size_t i = s.find('.'); - for (size_t i = 0u; i < MAX_CAP - 1u; i++) + if (i == std::string::npos) { - if ((buff[i] == '.') && (last_non_zero_id == 0u)) + if (usedot) { - // dot is detected - last_non_zero_id = i; - - if (usedot) - { - // forcibly leave at least 1 position after dot - last_non_zero_id = i + 1u; - } - - dot_id = i; + s += ".0"; } - else if (last_non_zero_id != 0u) - { - if ((left_to_check == 0u) || (buff[i] < '0') || (buff[i] > '9')) - { - break; - } - if ((buff[i] > '0') && (buff[i] <= '9')) - { - last_non_zero_id = i; - } + return s; + } - left_to_check--; - } + // remove trailing zeros after decimal delimiter (dot char) + size_t j; + + for (j = s.size() - 1; (j > i) && (s[j] == '0'); --j) + { } - if (last_non_zero_id == dot_id) + if (j == i) { - buff[dot_id] = '\0'; + if (usedot) + { + s.resize(j + 1); + s += '0'; + } + else + { + s.resize(j); + } } else { - buff[last_non_zero_id + 1u] = '\0'; + s.resize(j + 1); } - return buff; + return s; } - diff --git a/src/helpers/formatter.h b/src/helpers/formatter.h index fb44296..163373f 100644 --- a/src/helpers/formatter.h +++ b/src/helpers/formatter.h @@ -19,10 +19,10 @@ std::string str_trim(std::string s); /// @brief Function prints double value with dropping tailing zeros /// @param value value to format -/// @param presicsion maximal precision length -/// @param usedot true for forcibly print presicion 1 (one digit after dot) +/// @param precision maximal precision length +/// @param usedot true for forcibly print precision 1 (one digit after dot) /// @return string object fixed formatted value -std::string prt_double(double value, size_t presicsion, bool usedot = true); +std::string prt_double(double value, size_t precision, bool usedot = true); /** * @brief Makes input string valid C-identifier diff --git a/src/tests/dbcline-test.cpp b/src/tests/dbcline-test.cpp index 8c1a51f..d46364d 100644 --- a/src/tests/dbcline-test.cpp +++ b/src/tests/dbcline-test.cpp @@ -100,41 +100,48 @@ TEST(TestSigLineParsing, test_prt_double) { constexpr double v = -124.10001110002220; - expect_eq((std::string)prt_double(v, 0, false), (std::string)"-124"); - expect_eq((std::string)prt_double(v, 1, false), (std::string)"-124.1"); - expect_eq((std::string)prt_double(v, 2, false), (std::string)"-124.1"); - expect_eq((std::string)prt_double(v, 3, false), (std::string)"-124.1"); - expect_eq((std::string)prt_double(v, 4, false), (std::string)"-124.1"); - expect_eq((std::string)prt_double(v, 5, false), (std::string)"-124.10001"); - expect_eq((std::string)prt_double(v, 6, false), (std::string)"-124.100011"); - expect_eq((std::string)prt_double(v, 7, false), (std::string)"-124.1000111"); - expect_eq((std::string)prt_double(v, 8, false), (std::string)"-124.1000111"); - expect_eq((std::string)prt_double(v, 9, false), (std::string)"-124.1000111"); + expect_eq(prt_double(v, 0, false), "-124"); + expect_eq(prt_double(v, 1, false), "-124.1"); + expect_eq(prt_double(v, 2, false), "-124.1"); + expect_eq(prt_double(v, 3, false), "-124.1"); + expect_eq(prt_double(v, 4, false), "-124.1"); + expect_eq(prt_double(v, 5, false), "-124.10001"); + expect_eq(prt_double(v, 6, false), "-124.100011"); + expect_eq(prt_double(v, 7, false), "-124.1000111"); + expect_eq(prt_double(v, 8, false), "-124.1000111"); + expect_eq(prt_double(v, 9, false), "-124.1000111"); constexpr double vint = 123.0000; - expect_eq((std::string)prt_double(vint, 3), (std::string)"123.0"); - expect_eq((std::string)prt_double(vint, 2), (std::string)"123.0"); - expect_eq((std::string)prt_double(vint, 1), (std::string)"123.0"); - expect_eq((std::string)prt_double(vint, 0), (std::string)"123.0"); - expect_eq((std::string)prt_double(vint, 100), (std::string)"123.0"); - expect_eq((std::string)prt_double(vint, 1000), (std::string)"123.0"); + expect_eq(prt_double(vint, 3), "123.0"); + expect_eq(prt_double(vint, 2), "123.0"); + expect_eq(prt_double(vint, 1), "123.0"); + expect_eq(prt_double(vint, 0), "123.0"); + expect_eq(prt_double(vint, 0, false), "123"); + expect_eq(prt_double(vint, 1, false), "123"); + expect_eq(prt_double(vint, 100), "123.0"); + expect_eq(prt_double(vint, 1000), "123.0"); constexpr double v2 = 0.0110022; - expect_eq((std::string)prt_double(v2, 0), "0.0"); + expect_eq(prt_double(v2, 0), "0.0"); - constexpr double v3 = 20.4699999999; + constexpr double v3 = -20.47; - expect_eq((std::string)prt_double(v3, 9), "20.469999999"); - expect_eq((std::string)prt_double(v3, 8), "20.46999999"); - expect_eq((std::string)prt_double(v3, 7), "20.4699999"); - expect_eq((std::string)prt_double(v3, 3), "20.469"); + expect_eq(prt_double(v3, 2), "-20.47"); + expect_eq(prt_double(v3, 10), "-20.47"); - constexpr double v4 = -20.4699999999; + constexpr double v4 = 20.4699999999; - expect_eq((std::string)prt_double(v4, 9), "-20.469999999"); - expect_eq((std::string)prt_double(v4, 8), "-20.46999999"); - expect_eq((std::string)prt_double(v4, 7), "-20.4699999"); - expect_eq((std::string)prt_double(v4, 3), "-20.469"); + expect_eq(prt_double(v4, 9), "20.47"); + expect_eq(prt_double(v4, 8), "20.47"); + expect_eq(prt_double(v4, 7), "20.47"); + expect_eq(prt_double(v4, 3), "20.47"); + + constexpr double v5 = -20.4699999999; + + expect_eq(prt_double(v5, 8), "-20.47"); + expect_eq(prt_double(v5, 7), "-20.47"); + expect_eq(prt_double(v5, 3), "-20.47"); + expect_eq(prt_double(v5, 9), "-20.47"); } From 1f47c93d88fb25507e7e7b8f82918a2f9f3b5e13 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 27 Jan 2023 22:20:20 +0100 Subject: [PATCH 163/181] Build fixes (v2.8). --- src/codegen/version.h | 2 +- src/helpers/formatter.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/codegen/version.h b/src/codegen/version.h index d3d5629..04e7833 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (7) +#define CODEGEN_LIB_VERSION_MIN (8) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index 4ca9f28..d908695 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -1,4 +1,5 @@ #include "formatter.h" +#include #include #include #include From 39611296382a3a222fa80c2b0bd95871d2c39701 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 27 Jan 2023 22:28:17 +0100 Subject: [PATCH 164/181] Refactored ptr_double. --- docs/RELEASES.md | 4 ++++ src/codegen/version.h | 2 +- src/helpers/formatter.cpp | 45 +++++++++++++++++++++----------------- src/tests/dbcline-test.cpp | 23 ++++++++++++------- 4 files changed, 45 insertions(+), 29 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 3f97205..4efe7b1 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,5 +1,9 @@ # Changelog +## v2.9 + +- prt_double refactored + ## v2.8 ### Fixed diff --git a/src/codegen/version.h b/src/codegen/version.h index 04e7833..3bdbbff 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (8) +#define CODEGEN_LIB_VERSION_MIN (9) diff --git a/src/helpers/formatter.cpp b/src/helpers/formatter.cpp index d908695..fd45a22 100644 --- a/src/helpers/formatter.cpp +++ b/src/helpers/formatter.cpp @@ -1,8 +1,8 @@ -#include "formatter.h" -#include #include +#include #include #include +#include "formatter.h" static const size_t kMaxWorkArrLength = 4096; @@ -149,18 +149,17 @@ std::string make_c_name(const std::string& s) std::string prt_double(double value, size_t precision, bool usedot) { - precision = std::min(precision, (size_t)std::numeric_limits::digits10); - - std::stringstream ss; - ss.imbue(std::locale::classic()); - ss << std::fixed << std::setprecision(precision) << value; + std::stringstream strstrm; + strstrm.imbue(std::locale::classic()); + strstrm << std::fixed << std::setprecision(10) << value; - std::string s(ss.str()); + std::string s(strstrm.str()); - size_t i = s.find('.'); + size_t dotpos = s.find('.'); - if (i == std::string::npos) + if (dotpos == std::string::npos) { + // dot not found if (usedot) { s += ".0"; @@ -170,27 +169,33 @@ std::string prt_double(double value, size_t precision, bool usedot) } // remove trailing zeros after decimal delimiter (dot char) - size_t j; + size_t tailsize = std::min((s.size() - (dotpos + 1u)), precision); + size_t addtail = 0u; - for (j = s.size() - 1; (j > i) && (s[j] == '0'); --j) + for (size_t j = 0; j < tailsize; j++) { + auto ch = s[dotpos + 1u + j]; + + if (ch > '0' && ch <= '9') + { + addtail = j + 1; + } } - if (j == i) + if (addtail == 0) { + // precision == 0 or xxx.0(0) resize cut tail with dot + s.resize(dotpos); + if (usedot) { - s.resize(j + 1); - s += '0'; - } - else - { - s.resize(j); + s += ".0"; } } else { - s.resize(j + 1); + // xxx.x(x) + s.resize(dotpos + addtail + 1); } return s; diff --git a/src/tests/dbcline-test.cpp b/src/tests/dbcline-test.cpp index d46364d..e273a8b 100644 --- a/src/tests/dbcline-test.cpp +++ b/src/tests/dbcline-test.cpp @@ -133,15 +133,22 @@ TEST(TestSigLineParsing, test_prt_double) constexpr double v4 = 20.4699999999; - expect_eq(prt_double(v4, 9), "20.47"); - expect_eq(prt_double(v4, 8), "20.47"); - expect_eq(prt_double(v4, 7), "20.47"); - expect_eq(prt_double(v4, 3), "20.47"); + expect_eq(prt_double(v4, 9), "20.469999999"); + expect_eq(prt_double(v4, 8), "20.46999999"); + expect_eq(prt_double(v4, 7), "20.4699999"); + expect_eq(prt_double(v4, 3), "20.469"); constexpr double v5 = -20.4699999999; - expect_eq(prt_double(v5, 8), "-20.47"); - expect_eq(prt_double(v5, 7), "-20.47"); - expect_eq(prt_double(v5, 3), "-20.47"); - expect_eq(prt_double(v5, 9), "-20.47"); + expect_eq(prt_double(v5, 8), "-20.46999999"); + expect_eq(prt_double(v5, 7), "-20.4699999"); + expect_eq(prt_double(v5, 3), "-20.469"); + expect_eq(prt_double(v5, 10), "-20.4699999999"); + expect_eq(prt_double(v5, 11), "-20.4699999999"); + expect_eq(prt_double(v5, 15), "-20.4699999999"); + + constexpr double v6 = 123.012345678900000; + expect_eq(prt_double(v6, 10), "123.0123456789"); + expect_eq(prt_double(v6, 11), "123.0123456789"); + expect_eq(prt_double(v6, 15), "123.0123456789"); } From 3cd9bb8aea4933a33c6d8e737f35a494e7472d1b Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 30 Jan 2023 20:17:41 +0100 Subject: [PATCH 165/181] Style and naming improvements. --- src/app.cpp | 28 +++++++++------- src/app.h | 10 ++++-- src/options-parser.cpp | 71 +++++++++++++++++++++-------------------- src/options-parser.h | 64 ++++++++++++++++++++++++------------- src/tests/args-test.cpp | 14 ++++---- 5 files changed, 108 insertions(+), 79 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 18ab98d..310f016 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -18,7 +18,7 @@ void CoderApp::Run() { std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; - if (ParseParams()) + if (AreParamsValid()) { GenerateCode(); } @@ -28,6 +28,7 @@ void CoderApp::Run() } } +/// @brief Main generation process void CoderApp::GenerateCode() { auto scanner = std::make_unique(); @@ -37,17 +38,17 @@ void CoderApp::GenerateCode() std::ifstream reader; - std::cout << "dbc file : " << Params.dbc.value << std::endl; - std::cout << "gen path : " << Params.outdir.value << std::endl; - std::cout << "drv name : " << Params.drvname.value << std::endl; + std::cout << "dbc file : " << Params.dbc.first << std::endl; + std::cout << "gen path : " << Params.outdir.first << std::endl; + std::cout << "drv name : " << Params.drvname.first << std::endl; - if (std::filesystem::exists(Params.dbc.value) == false) + if (std::filesystem::exists(Params.dbc.first) == false) { std::cout << "DBC file is not exists!" << std::endl; return; } - reader.open(Params.dbc.value); + reader.open(Params.dbc.first); std::istream& s = reader; @@ -56,7 +57,7 @@ void CoderApp::GenerateCode() std::string info(""); // create main destination directory - fscreator->Configure(Params.drvname.value, Params.outdir.value, info, scanner->dblist.ver.hi, scanner->dblist.ver.low); + fscreator->Configure(Params.drvname.first, Params.outdir.first, info, scanner->dblist.ver.hi, scanner->dblist.ver.low); auto ret = fscreator->PrepareDirectory(Params.is_rewrite); @@ -111,7 +112,7 @@ void CoderApp::GenerateCode() // for each node in collection perform specific bin-util generation for (size_t node = 0; node < nodes.size(); node++) { - std::string util_name = nodes[node] + "_" + Params.drvname.value; + std::string util_name = nodes[node] + "_" + Params.drvname.first; // set new driver name for current node fscreator->FS.gen.drvname = str_tolower(util_name); @@ -150,7 +151,7 @@ void CoderApp::GenerateCode() if (ret) { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.value); + ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.first); } } } @@ -165,16 +166,19 @@ void CoderApp::GenerateCode() if (ret) { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.value); + ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.first); } } } -bool CoderApp::ParseParams() +/// @brief Checks if all mandatory configuration parameters are provided +/// @return TRUE if configuration valid, otherwise FALSE +bool CoderApp::AreParamsValid() { - return (Params.dbc.ok && Params.outdir.ok && Params.drvname.ok) && (Params.is_help == false); + return (Params.dbc.second && Params.outdir.second && Params.drvname.second) && (Params.is_help == false); } +/// @brief Help message printer void CoderApp::PrintHelp() { std::cout << "project source code:\thttps://github.com/astand/c-coderdbc\t\t" << std::endl; diff --git a/src/app.h b/src/app.h index ed41fda..9805872 100644 --- a/src/app.h +++ b/src/app.h @@ -5,16 +5,20 @@ #include #include +/// @brief App wrapper class class CoderApp { public: - CoderApp(const OptionsParser::Pairs& params) : Params(params) {} + /// @brief Constructor + /// @param params - general generation configuration + CoderApp(const OptionsParser::GenOptions& params) : Params(params) {} + /// @brief Main generation process void Run(); private: - bool ParseParams(); + bool AreParamsValid(); void GenerateCode(); void PrintHelp(); - const OptionsParser::Pairs& Params; + const OptionsParser::GenOptions& Params; }; diff --git a/src/options-parser.cpp b/src/options-parser.cpp index 2fc26bc..3d675bc 100644 --- a/src/options-parser.cpp +++ b/src/options-parser.cpp @@ -1,14 +1,15 @@ #include "options-parser.h" #include "helpers/formatter.h" -OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) +OptionsParser::GenOptions OptionsParser::GetOptions(int argc, char** argv) { - std::vector ret{}; + using onepair_t = std::pair; - OnePair pair{}; - - Pairs pairs{}; + std::vector temppairs{}; + onepair_t pair{}; + GenOptions retpairs{}; + // collect arguments/values to vector for (int i = 0; i < argc; i++) { // key found (must start with '-' (e.g. '-dbc')) @@ -17,65 +18,67 @@ OptionsParser::Pairs OptionsParser::GetOptions(int argc, char** argv) pair.first = std::string(argv[i]); pair.second.clear(); - if ((i + 1) < argc && argv[i + 1][0] != '-') + size_t valindex = i + 1; + + if ((valindex < argc) && (argv[valindex][0] != '-')) { // key param - pair.second = std::string(argv[i + 1]); - // unlooped i incremention + pair.second = std::string(argv[valindex]); + // shift position to next key ++i; } - ret.push_back(pair); + temppairs.push_back(pair); } } - for (size_t i = 0; i < ret.size(); i++) + for (size_t i = 0; i < temppairs.size(); i++) { - if (ret[i].first.compare("-dbc") == 0) + if (temppairs[i].first.compare("-dbc") == 0) { - pairs.dbc.value = ret[i].second; - pairs.dbc.ok = true; + retpairs.dbc.first = temppairs[i].second; + retpairs.dbc.second = true; } - else if (ret[i].first.compare("-out") == 0) + else if (temppairs[i].first.compare("-out") == 0) { - pairs.outdir.value = ret[i].second; - pairs.outdir.ok = true; + retpairs.outdir.first = temppairs[i].second; + retpairs.outdir.second = true; } - else if (ret[i].first.compare("-drvname") == 0) + else if (temppairs[i].first.compare("-drvname") == 0) { - pairs.drvname.value = make_c_name(ret[i].second); - pairs.drvname.ok = true; + retpairs.drvname.first = make_c_name(temppairs[i].second); + retpairs.drvname.second = true; - if (pairs.drvname.value.length() == 0) + if (retpairs.drvname.first.length() == 0) { - pairs.drvname.ok = false; + retpairs.drvname.second = false; } } - else if (ret[i].first.compare("-rw") == 0) + else if (temppairs[i].first.compare("-rw") == 0) { - pairs.is_rewrite = true; + retpairs.is_rewrite = true; } - else if (ret[i].first.compare("-nodeutils") == 0) + else if (temppairs[i].first.compare("-nodeutils") == 0) { - pairs.is_nodeutils = true; + retpairs.is_nodeutils = true; } - else if (ret[i].first.compare("-help") == 0) + else if (temppairs[i].first.compare("-help") == 0) { - pairs.is_help = true; + retpairs.is_help = true; } - else if (ret[i].first.compare("-noinc") == 0) + else if (temppairs[i].first.compare("-noinc") == 0) { - pairs.is_nocanmon = true; + retpairs.is_nocanmon = true; } - else if (ret[i].first.compare("-noconfig") == 0) + else if (temppairs[i].first.compare("-noconfig") == 0) { - pairs.is_noconfig = true; + retpairs.is_noconfig = true; } - else if (ret[i].first.compare("-nofmon") == 0) + else if (temppairs[i].first.compare("-nofmon") == 0) { - pairs.is_nofmon = true; + retpairs.is_nofmon = true; } } - return pairs; + return retpairs; } diff --git a/src/options-parser.h b/src/options-parser.h index 002e731..a27af2b 100644 --- a/src/options-parser.h +++ b/src/options-parser.h @@ -1,36 +1,54 @@ #pragma once +#include #include #include -#include +#include #include -typedef struct -{ - std::string value; - bool ok{false}; -} StrParam_t; - -typedef struct -{ - StrParam_t dbc; - StrParam_t outdir; - StrParam_t drvname; - bool is_rewrite{false}; - bool is_nodeutils{false}; - bool is_noconfig{false}; - bool is_nocanmon{false}; - bool is_nofmon{false}; - bool is_help{false}; -} ParamConfig_t; - +/// @brief CLI arguments parser class OptionsParser { public: - using OnePair = std::pair; - using Pairs = ParamConfig_t; + /// @brief key/value type wrapper + using dualparam_t = std::pair; + + /// @brief Arguments description struct + struct GenOptions + { + /// @brief dbc file name + dualparam_t dbc; + + /// @brief output directory for generated files + dualparam_t outdir; + + /// @brief main driver name + dualparam_t drvname; + + /// @brief rewrite previously generated files or generate to next subdirectory + bool is_rewrite{false}; + + /// @brief generate specific utility drivers for each ECU defined in the matrix + bool is_nodeutils{false}; + + /// @brief do not generate configuration file + bool is_noconfig{false}; + + /// @brief do not generate canmonitorutil header + bool is_nocanmon{false}; + + /// @brief do not generate fmon header + bool is_nofmon{false}; + + /// @brief help is requested + bool is_help{false}; + }; - ParamConfig_t GetOptions(int argc, char** argv); + /// @brief Parses arguments and theirs optional values + /// @param argc arguments number + /// @param argv pointer to array with arguments + /// @return parsed arguments in structured form + GenOptions GetOptions(int argc, char** argv); }; diff --git a/src/tests/args-test.cpp b/src/tests/args-test.cpp index e01e532..399198a 100644 --- a/src/tests/args-test.cpp +++ b/src/tests/args-test.cpp @@ -18,16 +18,16 @@ TEST(ArgParserTest, BasicAssert) OptionsParser parser; auto ret = parser.GetOptions(9, testchunks); - expect_true(ret.dbc.ok); - expect_true(ret.dbc.value.compare("path/to/test.dbc") == 0); + expect_true(ret.dbc.second); + expect_true(ret.dbc.first.compare("path/to/test.dbc") == 0); - expect_true(ret.outdir.ok); - expect_true(ret.outdir.value.compare("path/to/out") == 0); + expect_true(ret.outdir.second); + expect_true(ret.outdir.first.compare("path/to/out") == 0); - expect_true(ret.drvname.ok); - expect_true(ret.drvname.value.compare("testdbc") == 0); - expect_true(ret.is_rewrite); + expect_true(ret.drvname.second); + expect_true(ret.drvname.first.compare("testdbc") == 0); + expect_true(ret.is_rewrite); expect_false(ret.is_help); expect_false(ret.is_noconfig); expect_false(ret.is_nodeutils); From b73bd366c3b0c64b1c82491ad4bd215fe8650eff Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 26 Feb 2023 14:54:04 +0100 Subject: [PATCH 166/181] Comment fixes. --- src/types/attributes.h | 15 +++++++++------ src/types/comment.h | 28 +++++++++++++++++----------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/types/attributes.h b/src/types/attributes.h index 796ee43..86ae2f8 100644 --- a/src/types/attributes.h +++ b/src/types/attributes.h @@ -4,21 +4,24 @@ #include #include +/// @brief Message attributes enum class AttributeType { + /// @brief Message cycle time attribute CycleTime, + + /// @brief Undefined attribute Undefined }; -typedef struct +struct AttributeDescriptor_t { - // message id of the attribute + /// @brief Attribute message ID uint32_t MsgId; - // value of the comment from line + /// @brief Attribute type AttributeType Type; - // attribute value + /// @brief Attribute value int32_t Value; - -} AttributeDescriptor_t; +}; diff --git a/src/types/comment.h b/src/types/comment.h index ff1e3f2..4af34fe 100644 --- a/src/types/comment.h +++ b/src/types/comment.h @@ -4,36 +4,42 @@ #include #include +/// @brief Type of commented value enum class CommentTarget { + /// @brief Comment is for CAN message Message, + /// @brief Comment is for CAN message signal Signal, + /// @brief Invalid type Undefined }; -typedef struct -{ - // CAN ID to which comment is belongs (in case of message targeting) +/// @brief Comment descripton +struct Comment_t +{ + /// @brief Message ID for which comment is bound uint32_t MsgId; - // name of signal of the CAN Frame to whick comment is belong (in case - // of signal targeting + /// @brief Signal name for which comment is bound std::string SigName; - // type of the comment in attribute line (message or signal) + /// @brief Comment target type CommentTarget ca_target; - // value of the comment from line + /// @brief Comment text std::string Text; - -} Comment_t; +}; -typedef struct +/// @brief Value table inforamtion +struct ValTable_t { + /// @brief Signal name for which value table is applied std::string SigName; + /// @brief Value table names and values pairs std::vector> vpairs{}; -} ValTable_t; +}; From 0553e92b361814a01f94b8fdd28892d515872d7a Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 26 Feb 2023 15:39:50 +0100 Subject: [PATCH 167/181] Unique pointers removed. --- src/app.cpp | 54 +-- src/codegen/c-main-generator.cpp | 596 +++++++++++++++---------------- src/codegen/c-main-generator.h | 6 +- src/codegen/c-util-generator.cpp | 124 ++++--- src/codegen/c-util-generator.h | 4 +- src/maincli.cpp | 4 +- 6 files changed, 389 insertions(+), 399 deletions(-) diff --git a/src/app.cpp b/src/app.cpp index 310f016..f5a57c3 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -31,10 +31,10 @@ void CoderApp::Run() /// @brief Main generation process void CoderApp::GenerateCode() { - auto scanner = std::make_unique(); - auto cigen = std::make_unique(); - auto ciugen = std::make_unique(); - auto fscreator = std::make_unique(); + DbcScanner scanner; + CiMainGenerator cigen; + CiUtilGenerator ciugen; + FsCreator fscreator; std::ifstream reader; @@ -52,22 +52,22 @@ void CoderApp::GenerateCode() std::istream& s = reader; - scanner->TrimDbcText(s); + scanner.TrimDbcText(s); std::string info(""); // create main destination directory - fscreator->Configure(Params.drvname.first, Params.outdir.first, info, scanner->dblist.ver.hi, scanner->dblist.ver.low); + fscreator.Configure(Params.drvname.first, Params.outdir.first, info, scanner.dblist.ver.hi, scanner.dblist.ver.low); - auto ret = fscreator->PrepareDirectory(Params.is_rewrite); + auto ret = fscreator.PrepareDirectory(Params.is_rewrite); - fscreator->FS.gen.no_config = Params.is_noconfig; - fscreator->FS.gen.no_inc = Params.is_nocanmon; - fscreator->FS.gen.no_fmon = Params.is_nofmon; + fscreator.FS.gen.no_config = Params.is_noconfig; + fscreator.FS.gen.no_inc = Params.is_nocanmon; + fscreator.FS.gen.no_fmon = Params.is_nofmon; if (ret) { - cigen->Generate(scanner->dblist, fscreator->FS); + cigen.Generate(scanner.dblist, fscreator.FS); } else { @@ -80,10 +80,10 @@ void CoderApp::GenerateCode() { std::vector nodes; - for (size_t num = 0; num < scanner->dblist.msgs.size(); num++) + for (size_t num = 0; num < scanner.dblist.msgs.size(); num++) { // iterate all messages and collect All nodes assign to at least one message - auto m = scanner->dblist.msgs[num]; + auto m = scanner.dblist.msgs[num]; for (size_t txs = 0; txs < m->TranS.size(); txs++) { @@ -115,22 +115,22 @@ void CoderApp::GenerateCode() std::string util_name = nodes[node] + "_" + Params.drvname.first; // set new driver name for current node - fscreator->FS.gen.drvname = str_tolower(util_name); - fscreator->FS.gen.DRVNAME = str_toupper(fscreator->FS.gen.drvname); - fscreator->FS.file.util_c.dir = fscreator->FS.file.utildir; - fscreator->FS.file.util_h.dir = fscreator->FS.file.utildir; + fscreator.FS.gen.drvname = str_tolower(util_name); + fscreator.FS.gen.DRVNAME = str_toupper(fscreator.FS.gen.drvname); + fscreator.FS.file.util_c.dir = fscreator.FS.file.utildir; + fscreator.FS.file.util_h.dir = fscreator.FS.file.utildir; - fscreator->FS.file.util_h.fname = str_tolower(fscreator->FS.gen.drvname + "-binutil.h"); - fscreator->FS.file.util_h.fpath = fscreator->FS.file.utildir + "/" + fscreator->FS.file.util_h.fname; + fscreator.FS.file.util_h.fname = str_tolower(fscreator.FS.gen.drvname + "-binutil.h"); + fscreator.FS.file.util_h.fpath = fscreator.FS.file.utildir + "/" + fscreator.FS.file.util_h.fname; - fscreator->FS.file.util_c.fname = str_tolower(fscreator->FS.gen.drvname + "-binutil.c"); - fscreator->FS.file.util_c.fpath = fscreator->FS.file.utildir + "/" + fscreator->FS.file.util_c.fname; + fscreator.FS.file.util_c.fname = str_tolower(fscreator.FS.gen.drvname + "-binutil.c"); + fscreator.FS.file.util_c.fpath = fscreator.FS.file.utildir + "/" + fscreator.FS.file.util_c.fname; MsgsClassification groups; - for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + for (size_t i = 0; i < scanner.dblist.msgs.size(); i++) { - auto m = scanner->dblist.msgs[i]; + auto m = scanner.dblist.msgs[i]; bool found = (std::find(m->TranS.begin(), m->TranS.end(), nodes[node]) != m->TranS.end()); @@ -151,7 +151,7 @@ void CoderApp::GenerateCode() if (ret) { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.first); + ciugen.Generate(scanner.dblist, fscreator.FS, groups, Params.drvname.first); } } } @@ -159,14 +159,14 @@ void CoderApp::GenerateCode() { MsgsClassification groups; - for (size_t i = 0; i < scanner->dblist.msgs.size(); i++) + for (size_t i = 0; i < scanner.dblist.msgs.size(); i++) { - groups.Rx.push_back(scanner->dblist.msgs[i]->MsgID); + groups.Rx.push_back(scanner.dblist.msgs[i]->MsgID); } if (ret) { - ciugen->Generate(scanner->dblist, fscreator->FS, groups, Params.drvname.first); + ciugen.Generate(scanner.dblist, fscreator.FS, groups, Params.drvname.first); } } } diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index a2a7d97..8ef182d 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -31,22 +31,16 @@ const char* extend_func_body = " return (val ^ m) - m;\n" "}\n\n"; -CiMainGenerator::CiMainGenerator() -{ - sigprt = std::make_unique(); - fwriter = std::make_unique(); -} - void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd) { // Load income messages to sig printer - sigprt->LoadMessages(dlist.msgs); + sigprt.LoadMessages(dlist.msgs); // save pointer to output file descriptor struct to // enable using this information inside class member functions fdesc = &fsd; - std::sort(sigprt->sigs_expr.begin(), sigprt->sigs_expr.end(), + std::sort(sigprt.sigs_expr.begin(), sigprt.sigs_expr.end(), [](const CiExpr_t* a, const CiExpr_t* b) -> bool { return a->msg.MsgID < b->msg.MsgID; @@ -91,56 +85,56 @@ void CiMainGenerator::Gen_MainHeader() if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); + fwriter.Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } - fwriter->Append("#pragma once"); - fwriter->Append(); - fwriter->Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); - fwriter->Append(); - fwriter->Append("#include "); - fwriter->Append(); + fwriter.Append("#pragma once"); + fwriter.Append(); + fwriter.Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); + fwriter.Append(); + fwriter.Append("#include "); + fwriter.Append(); - fwriter->Append("// DBC file version"); - fwriter->Append("#define %s (%uU)", fdesc->gen.verhigh_def.c_str(), fdesc->gen.hiver); - fwriter->Append("#define %s (%uU)", fdesc->gen.verlow_def.c_str(), fdesc->gen.lowver); - fwriter->Append(); + fwriter.Append("// DBC file version"); + fwriter.Append("#define %s (%uU)", fdesc->gen.verhigh_def.c_str(), fdesc->gen.hiver); + fwriter.Append("#define %s (%uU)", fdesc->gen.verlow_def.c_str(), fdesc->gen.lowver); + fwriter.Append(); - fwriter->Append("// include current dbc-driver compilation config"); - fwriter->Append("#include <%s-config.h>", fdesc->gen.drvname.c_str()); - fwriter->Append(); + fwriter.Append("// include current dbc-driver compilation config"); + fwriter.Append("#include <%s-config.h>", fdesc->gen.drvname.c_str()); + fwriter.Append(); - fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append( + fwriter.Append( "// This file must define:\n" "// base monitor struct\n" "#include \n" "\n" ); - fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(2); + fwriter.Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append(2); - for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + for (size_t num = 0; num < sigprt.sigs_expr.size(); num++) { // write message typedef s and additional expressions - MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + MessageDescriptor_t& m = sigprt.sigs_expr[num]->msg; if (m.CommentText.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->Append("// " + std::regex_replace(m.CommentText, std::regex("\n"), "\n// ")); + fwriter.Append("// " + std::regex_replace(m.CommentText, std::regex("\n"), "\n// ")); } - fwriter->Append("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID); - fwriter->Append("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt); - fwriter->Append("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC); - fwriter->Append("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID); + fwriter.Append("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID); + fwriter.Append("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt); + fwriter.Append("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC); + fwriter.Append("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID); if (m.Cycle > 0) { - fwriter->Append("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle); + fwriter.Append("#define %s_CYC (%dU)", m.Name.c_str(), m.Cycle); } size_t max_sig_name_len = 27; @@ -154,7 +148,7 @@ void CiMainGenerator::Gen_MainHeader() if (passed_sigs.find(s.Name) == passed_sigs.end()) { // print signal macroses only it was not printed before - fwriter->Append(sigprt->PrintPhysicalToRaw(&s, fdesc->gen.DRVNAME)); + fwriter.Append(sigprt.PrintPhysicalToRaw(&s, fdesc->gen.DRVNAME)); passed_sigs.insert(s.Name); } } @@ -167,8 +161,8 @@ void CiMainGenerator::Gen_MainHeader() // For each signal in current message print value tables definitions if (s.ValDefs.vpairs.size() > 0) { - fwriter->Append("\n// Value tables for @%s signal", s.Name.c_str()); - fwriter->Append(); + fwriter.Append("\n// Value tables for @%s signal", s.Name.c_str()); + fwriter.Append(); for (auto i = 0; i < s.ValDefs.vpairs.size(); i++) { @@ -179,25 +173,25 @@ void CiMainGenerator::Gen_MainHeader() // @ifndef guard for the case when different values of table have // the same name (it is valid for DBC file format) // For this case only one of same named values will be available as macro - fwriter->Append("#ifndef %s", defname.c_str()); + fwriter.Append("#ifndef %s", defname.c_str()); - fwriter->Append("#define %s_%s_%s (%d)", + fwriter.Append("#define %s_%s_%s (%d)", s.Name.c_str(), m.Name.c_str(), s.ValDefs.vpairs[i].first.c_str(), s.ValDefs.vpairs[i].second); - fwriter->Append("#endif"); - fwriter->Append(); + fwriter.Append("#endif"); + fwriter.Append(); } } } - fwriter->Append(); - fwriter->Append("typedef struct"); - fwriter->Append("{"); + fwriter.Append(); + fwriter.Append("typedef struct"); + fwriter.Append("{"); // Write section for bitfielded part - fwriter->Append("#ifdef %s", fdesc->gen.usebits_def.c_str()); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.usebits_def.c_str()); + fwriter.Append(); SignalDescriptor_t rollsig; @@ -218,16 +212,16 @@ void CiMainGenerator::Gen_MainHeader() if (m.RollSig != nullptr) { - fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(); WriteSigStructField(rollsig, true, max_sig_name_len); - fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(); } // Write clean part - fwriter->Append("#else"); - fwriter->Append(); + fwriter.Append("#else"); + fwriter.Append(); for (size_t signum = 0; signum < m.Signals.size(); signum++) { @@ -238,56 +232,56 @@ void CiMainGenerator::Gen_MainHeader() if (m.RollSig != nullptr) { - fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(); WriteSigStructField(rollsig, false, max_sig_name_len); - fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(); } - fwriter->Append("#endif // %s", fdesc->gen.usebits_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usebits_def.c_str()); + fwriter.Append(); // start mon1 section - fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(); - fwriter->Append(" FrameMonitor_t mon1;"); - fwriter->Append(); - fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(); - fwriter->Append("} %s_t;", m.Name.c_str()); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append(); + fwriter.Append(" FrameMonitor_t mon1;"); + fwriter.Append(); + fwriter.Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append(); + fwriter.Append("} %s_t;", m.Name.c_str()); + fwriter.Append(); } - fwriter->Append("// Function signatures"); - fwriter->Append(); + fwriter.Append("// Function signatures"); + fwriter.Append(); - for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + for (size_t num = 0; num < sigprt.sigs_expr.size(); num++) { // write message typedef s and additional expressions - MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + MessageDescriptor_t& m = sigprt.sigs_expr[num]->msg; - fwriter->Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", + fwriter.Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - fwriter->Append("#ifdef %s", fdesc->gen.usesruct_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usesruct_def.c_str()); - fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", + fwriter.Append("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe);", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - fwriter->Append("#else"); + fwriter.Append("#else"); - fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", + fwriter.Append("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide);", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - fwriter->Append("#endif // %s", fdesc->gen.usesruct_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usesruct_def.c_str()); + fwriter.Append(); } - fwriter->Append("#ifdef __cplusplus\n}\n#endif"); + fwriter.Append("#ifdef __cplusplus\n}\n#endif"); // save fwrite cached text to file - fwriter->Flush(fdesc->file.core_h.fpath); + fwriter.Flush(fdesc->file.core_h.fpath); } void CiMainGenerator::Gen_MainSource() @@ -295,100 +289,100 @@ void CiMainGenerator::Gen_MainSource() if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); + fwriter.Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } // include main header file - fwriter->Append("#include \"%s\"", fdesc->file.core_h.fname.c_str()); - fwriter->Append(2); + fwriter.Append("#include \"%s\"", fdesc->file.core_h.fname.c_str()); + fwriter.Append(2); - fwriter->Append("// DBC file version"); - fwriter->Append("#if (%s != (%uU)) || (%s != (%uU))", + fwriter.Append("// DBC file version"); + fwriter.Append("#if (%s != (%uU)) || (%s != (%uU))", fdesc->gen.verhigh_def.c_str(), fdesc->gen.hiver, fdesc->gen.verlow_def.c_str(), fdesc->gen.lowver); - fwriter->Append("#error The %s dbc source files have different versions", fdesc->gen.DRVNAME.c_str()); - fwriter->Append("#endif"); - fwriter->Append(); + fwriter.Append("#error The %s dbc source files have different versions", fdesc->gen.DRVNAME.c_str()); + fwriter.Append("#endif"); + fwriter.Append(); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function - fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append( + fwriter.Append( "// Function prototypes to be called each time CAN frame is unpacked\n" "// FMon function may detect RC, CRC or DLC violation\n"); - fwriter->Append("#include <%s-fmon.h>", fdesc->gen.drvname.c_str()); - fwriter->Append(); - - fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(""); - fwriter->Append("// This macro guard for the case when you need to enable"); - fwriter->Append("// using diag monitors but there is no necessity in proper"); - fwriter->Append("// SysTick provider. For providing one you need define macro"); - fwriter->Append("// before this line - in dbccodeconf.h"); - fwriter->Append(""); - fwriter->Append("#ifndef GetSystemTick"); - fwriter->Append("#define GetSystemTick() (0u)"); - fwriter->Append("#endif"); - fwriter->Append(""); - fwriter->Append("// This macro guard is for the case when you want to build"); - fwriter->Append("// app with enabled optoin auto CSM, but don't yet have"); - fwriter->Append("// proper getframehash implementation"); - fwriter->Append(""); - fwriter->Append("#ifndef GetFrameHash"); - fwriter->Append("#define GetFrameHash(a,b,c,d,e) (0u)"); - fwriter->Append("#endif"); - fwriter->Append(); - - fwriter->Append(extend_func_body, ext_sig_func_name), 1; + fwriter.Append("#include <%s-fmon.h>", fdesc->gen.drvname.c_str()); + fwriter.Append(); + + fwriter.Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append(""); + fwriter.Append("// This macro guard for the case when you need to enable"); + fwriter.Append("// using diag monitors but there is no necessity in proper"); + fwriter.Append("// SysTick provider. For providing one you need define macro"); + fwriter.Append("// before this line - in dbccodeconf.h"); + fwriter.Append(""); + fwriter.Append("#ifndef GetSystemTick"); + fwriter.Append("#define GetSystemTick() (0u)"); + fwriter.Append("#endif"); + fwriter.Append(""); + fwriter.Append("// This macro guard is for the case when you want to build"); + fwriter.Append("// app with enabled optoin auto CSM, but don't yet have"); + fwriter.Append("// proper getframehash implementation"); + fwriter.Append(""); + fwriter.Append("#ifndef GetFrameHash"); + fwriter.Append("#define GetFrameHash(a,b,c,d,e) (0u)"); + fwriter.Append("#endif"); + fwriter.Append(); + + fwriter.Append(extend_func_body, ext_sig_func_name), 1; // for each message 3 functions must be defined - 1 unpack function, // 2: pack with raw signature // 3: pack with canstruct - for (size_t num = 0; num < sigprt->sigs_expr.size(); num++) + for (size_t num = 0; num < sigprt.sigs_expr.size(); num++) { // write message typedef s and additional expressions - MessageDescriptor_t& m = sigprt->sigs_expr[num]->msg; + MessageDescriptor_t& m = sigprt.sigs_expr[num]->msg; // first function - fwriter->Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", + fwriter.Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); // put dirt trick to avoid warning about unusing parameter // (dlc) when monitora are disabled. trick is better than // selection different signatures because of external API consistency - fwriter->Append(" (void)dlc_;"); + fwriter.Append(" (void)dlc_;"); - WriteUnpackBody(sigprt->sigs_expr[num]); + WriteUnpackBody(sigprt.sigs_expr[num]); - fwriter->Append("}"); - fwriter->Append(); + fwriter.Append("}"); + fwriter.Append(); // next one is the pack function for using with CANFrame struct - fwriter->Append("#ifdef %s", fdesc->gen.usesruct_def.c_str()); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.usesruct_def.c_str()); + fwriter.Append(); // second function - fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", + fwriter.Append("uint32_t Pack_%s_%s(%s_t* _m, __CoderDbcCanFrame_t__* cframe)", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - WritePackStructBody(sigprt->sigs_expr[num]); + WritePackStructBody(sigprt.sigs_expr[num]); - fwriter->Append("#else"); - fwriter->Append(); + fwriter.Append("#else"); + fwriter.Append(); // third function - fwriter->Append("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", + fwriter.Append("uint32_t Pack_%s_%s(%s_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide)", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); - WritePackArrayBody(sigprt->sigs_expr[num]); + WritePackArrayBody(sigprt.sigs_expr[num]); - fwriter->Append("#endif // %s", fdesc->gen.usesruct_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usesruct_def.c_str()); + fwriter.Append(); } - fwriter->Flush(fdesc->file.core_c.fpath); + fwriter.Flush(fdesc->file.core_c.fpath); } void CiMainGenerator::Gen_ConfigHeader() @@ -396,144 +390,144 @@ void CiMainGenerator::Gen_ConfigHeader() if (fdesc->gen.start_info.size() > 0) { // replace all '\n' on "\n //" for c code comment text - fwriter->Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); + fwriter.Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); } ConfigGenerator confgen; - confgen.FillHeader((*fwriter), fdesc->gen); + confgen.FillHeader(fwriter, fdesc->gen); - fwriter->Flush(fdesc->file.confdir + '/' + fdesc->gen.drvname + "-config.h"); + fwriter.Flush(fdesc->file.confdir + '/' + fdesc->gen.drvname + "-config.h"); } void CiMainGenerator::Gen_FMonHeader() { MonGenerator mongen; - mongen.FillHeader((*fwriter), sigprt->sigs_expr, *fdesc); - fwriter->Flush(fdesc->file.fmon_h.fpath); + mongen.FillHeader(fwriter, sigprt.sigs_expr, *fdesc); + fwriter.Flush(fdesc->file.fmon_h.fpath); } void CiMainGenerator::Gen_FMonSource() { MonGenerator mongen; - mongen.FillSource((*fwriter), sigprt->sigs_expr, *fdesc); - fwriter->Flush(fdesc->file.fmon_c.fpath); + mongen.FillSource(fwriter, sigprt.sigs_expr, *fdesc); + fwriter.Flush(fdesc->file.fmon_c.fpath); } void CiMainGenerator::Gen_CanMonUtil() { - fwriter->Append("#pragma once"); - fwriter->Append(""); - fwriter->Append("#include "); - fwriter->Append(""); - fwriter->Append("#ifdef __cplusplus"); - fwriter->Append("extern \"C\" {"); - fwriter->Append("#endif"); - fwriter->Append(""); - fwriter->Append("// declare here all availible checksum algorithms"); - fwriter->Append("typedef enum"); - fwriter->Append("{"); - fwriter->Append(" // XOR8 = 0,"); - fwriter->Append(" // XOR4 = 1,"); - fwriter->Append(" // etc"); - fwriter->Append(""); - fwriter->Append(" // it is up to user to have or to skip final enum value - @CRC_ALG_COUNT"); - fwriter->Append(" CRC_ALG_COUNT"); - fwriter->Append("} DbcCanCrcMethods;"); - fwriter->Append(""); - fwriter->Append("typedef struct"); - fwriter->Append("{"); - fwriter->Append(" // @last_cycle keeps tick-value when last frame was received"); - fwriter->Append(" uint32_t last_cycle;"); - fwriter->Append(""); - fwriter->Append(" // @timeout_cycle keeps maximum timeout for frame, user responsibility"); - fwriter->Append(" // to init this field and use it in missing frame monitoring function"); - fwriter->Append(" uint32_t timeout_cycle;"); - fwriter->Append(""); - fwriter->Append(" // @frame_cnt keeps count of all the received frames"); - fwriter->Append(" uint32_t frame_cnt;"); - fwriter->Append(""); - fwriter->Append(" // setting up @roll_error bit indicates roll counting fail."); - fwriter->Append(" // Bit is not clearing automatically!"); - fwriter->Append(" uint32_t roll_error : 1;"); - fwriter->Append(""); - fwriter->Append(" // setting up @checksum_error bit indicates checksum checking failure."); - fwriter->Append(" // Bit is not clearing automatically!"); - fwriter->Append(" uint32_t csm_error : 1;"); - fwriter->Append(""); - fwriter->Append(" // setting up @cycle_error bit indicates that time was overrunned."); - fwriter->Append(" // Bit is not clearing automatically!"); - fwriter->Append(" uint32_t cycle_error : 1;"); - fwriter->Append(""); - fwriter->Append(" // setting up @dlc_error bit indicates that the actual length of"); - fwriter->Append(" // CAN frame is less then defined by CAN matrix!"); - fwriter->Append(" uint32_t dlc_error : 1;"); - fwriter->Append(""); - fwriter->Append("} FrameMonitor_t;"); - fwriter->Append(""); - fwriter->Append("#ifdef __cplusplus"); - fwriter->Append("}"); - fwriter->Append("#endif"); - fwriter->Append(""); - - fwriter->Flush(fdesc->file.incdir + '/' + "canmonitorutil.h"); + fwriter.Append("#pragma once"); + fwriter.Append(""); + fwriter.Append("#include "); + fwriter.Append(""); + fwriter.Append("#ifdef __cplusplus"); + fwriter.Append("extern \"C\" {"); + fwriter.Append("#endif"); + fwriter.Append(""); + fwriter.Append("// declare here all availible checksum algorithms"); + fwriter.Append("typedef enum"); + fwriter.Append("{"); + fwriter.Append(" // XOR8 = 0,"); + fwriter.Append(" // XOR4 = 1,"); + fwriter.Append(" // etc"); + fwriter.Append(""); + fwriter.Append(" // it is up to user to have or to skip final enum value - @CRC_ALG_COUNT"); + fwriter.Append(" CRC_ALG_COUNT"); + fwriter.Append("} DbcCanCrcMethods;"); + fwriter.Append(""); + fwriter.Append("typedef struct"); + fwriter.Append("{"); + fwriter.Append(" // @last_cycle keeps tick-value when last frame was received"); + fwriter.Append(" uint32_t last_cycle;"); + fwriter.Append(""); + fwriter.Append(" // @timeout_cycle keeps maximum timeout for frame, user responsibility"); + fwriter.Append(" // to init this field and use it in missing frame monitoring function"); + fwriter.Append(" uint32_t timeout_cycle;"); + fwriter.Append(""); + fwriter.Append(" // @frame_cnt keeps count of all the received frames"); + fwriter.Append(" uint32_t frame_cnt;"); + fwriter.Append(""); + fwriter.Append(" // setting up @roll_error bit indicates roll counting fail."); + fwriter.Append(" // Bit is not clearing automatically!"); + fwriter.Append(" uint32_t roll_error : 1;"); + fwriter.Append(""); + fwriter.Append(" // setting up @checksum_error bit indicates checksum checking failure."); + fwriter.Append(" // Bit is not clearing automatically!"); + fwriter.Append(" uint32_t csm_error : 1;"); + fwriter.Append(""); + fwriter.Append(" // setting up @cycle_error bit indicates that time was overrunned."); + fwriter.Append(" // Bit is not clearing automatically!"); + fwriter.Append(" uint32_t cycle_error : 1;"); + fwriter.Append(""); + fwriter.Append(" // setting up @dlc_error bit indicates that the actual length of"); + fwriter.Append(" // CAN frame is less then defined by CAN matrix!"); + fwriter.Append(" uint32_t dlc_error : 1;"); + fwriter.Append(""); + fwriter.Append("} FrameMonitor_t;"); + fwriter.Append(""); + fwriter.Append("#ifdef __cplusplus"); + fwriter.Append("}"); + fwriter.Append("#endif"); + fwriter.Append(""); + + fwriter.Flush(fdesc->file.incdir + '/' + "canmonitorutil.h"); } void CiMainGenerator::Gen_DbcCodeConf() { - fwriter->Append("#pragma once"); - fwriter->Append(""); - fwriter->Append("#include "); - fwriter->Append(""); - fwriter->Append("// when USE_SIGFLOAT enabed the sigfloat_t must be defined"); - fwriter->Append("// typedef double sigfloat_t;"); - fwriter->Append(""); - fwriter->Append("// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined"); - fwriter->Append("// #include \"{header_with_can_struct}\""); - fwriter->Append("// typedef {can_struct} __CoderDbcCanFrame_t__;"); - fwriter->Append(""); - fwriter->Append("// if you need to allocate rx and tx messages structs put the allocation macro here"); - fwriter->Append("// #define __DEF_{your_driver_name}__"); - fwriter->Append(""); - - fwriter->Append("// defualt @__ext_sig__ help types definition"); - fwriter->Append(""); - fwriter->Append("typedef uint32_t ubitext_t;"); - fwriter->Append("typedef int32_t bitext_t;"); - fwriter->Append(""); - fwriter->Append("// To provide a way to make missing control correctly you"); - fwriter->Append("// have to define macro @GetSystemTick() which has to"); - fwriter->Append("// return kind of tick counter (e.g. 1 ms ticker)"); - fwriter->Append(""); - fwriter->Append("// #define GetSystemTick() __get__tick__()"); - fwriter->Append(""); - fwriter->Append("// To provide a way to calculate hash (crc) for CAN"); - fwriter->Append("// frame's data field you have to define macro @GetFrameHash"); - fwriter->Append(""); - fwriter->Append("// #define GetFrameHash(a,b,c,d,e) __get_hash__(a,b,c,d,e)"); - fwriter->Append(""); - - fwriter->Flush(fdesc->file.confdir + '/' + "dbccodeconf.h"); + fwriter.Append("#pragma once"); + fwriter.Append(""); + fwriter.Append("#include "); + fwriter.Append(""); + fwriter.Append("// when USE_SIGFLOAT enabed the sigfloat_t must be defined"); + fwriter.Append("// typedef double sigfloat_t;"); + fwriter.Append(""); + fwriter.Append("// when USE_CANSTRUCT enabled __CoderDbcCanFrame_t__ must be defined"); + fwriter.Append("// #include \"{header_with_can_struct}\""); + fwriter.Append("// typedef {can_struct} __CoderDbcCanFrame_t__;"); + fwriter.Append(""); + fwriter.Append("// if you need to allocate rx and tx messages structs put the allocation macro here"); + fwriter.Append("// #define __DEF_{your_driver_name}__"); + fwriter.Append(""); + + fwriter.Append("// defualt @__ext_sig__ help types definition"); + fwriter.Append(""); + fwriter.Append("typedef uint32_t ubitext_t;"); + fwriter.Append("typedef int32_t bitext_t;"); + fwriter.Append(""); + fwriter.Append("// To provide a way to make missing control correctly you"); + fwriter.Append("// have to define macro @GetSystemTick() which has to"); + fwriter.Append("// return kind of tick counter (e.g. 1 ms ticker)"); + fwriter.Append(""); + fwriter.Append("// #define GetSystemTick() __get__tick__()"); + fwriter.Append(""); + fwriter.Append("// To provide a way to calculate hash (crc) for CAN"); + fwriter.Append("// frame's data field you have to define macro @GetFrameHash"); + fwriter.Append(""); + fwriter.Append("// #define GetFrameHash(a,b,c,d,e) __get_hash__(a,b,c,d,e)"); + fwriter.Append(""); + + fwriter.Flush(fdesc->file.confdir + '/' + "dbccodeconf.h"); } void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bits, size_t padwidth) { if (sig.CommentText.size() > 0) { - fwriter->Append(" // " + std::regex_replace(sig.CommentText, std::regex("\n"), "\n // ")); + fwriter.Append(" // " + std::regex_replace(sig.CommentText, std::regex("\n"), "\n // ")); } if (sig.ValueText.size() > 0) { - fwriter->Append(" // " + std::regex_replace(sig.ValueText, std::regex("\n"), "\n // ")); + fwriter.Append(" // " + std::regex_replace(sig.ValueText, std::regex("\n"), "\n // ")); } if (sig.Multiplex == MultiplexType::kMulValue) { - fwriter->Append(" // multiplex variable"); + fwriter.Append(" // multiplex variable"); } else if (sig.Multiplex == MultiplexType::kMaster) { - fwriter->Append(" // MULTIPLEX master signal"); + fwriter.Append(" // MULTIPLEX master signal"); } std::string dtype = ""; @@ -551,14 +545,14 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi dtype += pad.insert(0, padwidth + 16 - dtype.size(), ' '); - fwriter->AppendText(dtype); + fwriter.AppendText(dtype); pad = " // "; pad += (sig.Signed) ? " [-]" : " "; - fwriter->AppendText(pad); + fwriter.AppendText(pad); - fwriter->AppendText(" Bits=%2d", sig.LengthBit); + fwriter.AppendText(" Bits=%2d", sig.LengthBit); size_t offset = 0; std::string infocmnt{}; @@ -603,10 +597,10 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi infocmnt += StrPrint(" Unit:'%s'", sig.Unit.c_str()); } - fwriter->AppendText(infocmnt); + fwriter.AppendText(infocmnt); - fwriter->Append(""); - fwriter->Append(); + fwriter.Append(""); + fwriter.Append(); if (!sig.IsSimpleSig) { @@ -620,19 +614,19 @@ void CiMainGenerator::WriteSigStructField(const SignalDescriptor_t& sig, bool bi // own 'shadow' (_phys) copies, the problem with intermediate type (not simpe and // not double) is that the x = ***_toS(x) takes place in each Pack_* call // the signals which are not changing from Pack_* to Pack_* will change its values (!) - fwriter->Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); if (sig.IsDoubleSig) { - fwriter->Append(" sigfloat_t %s;", sig.NameFloat.c_str()); + fwriter.Append(" sigfloat_t %s;", sig.NameFloat.c_str()); } else { - fwriter->Append(" %s %s;", PrintType((int)sig.TypePhys).c_str(), sig.NameFloat.c_str()); + fwriter.Append(" %s %s;", PrintType((int)sig.TypePhys).c_str(), sig.NameFloat.c_str()); } - fwriter->Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter.Append(); } } @@ -647,103 +641,103 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) if (sgs->msg.Signals[num].Signed) { - fwriter->Append(" _m->%s = %s(( %s ), %d);", + fwriter.Append(" _m->%s = %s(( %s ), %d);", sname, ext_sig_func_name, expr.c_str(), (int32_t)sgs->msg.Signals[num].LengthBit); } else { - fwriter->Append(" _m->%s = %s;", sname, expr.c_str()); + fwriter.Append(" _m->%s = %s;", sname, expr.c_str()); } // print sigfloat conversion if (!sgs->msg.Signals[num].IsSimpleSig) { - fwriter->Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); if (sgs->msg.Signals[num].IsDoubleSig) { // for double signals (sigfloat_t) type cast - fwriter->Append(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", + fwriter.Append(" _m->%s = (sigfloat_t)(%s_%s_fromS(_m->%s));", sgs->msg.Signals[num].NameFloat.c_str(), fdesc->gen.DRVNAME.c_str(), sname, sname); } else { - fwriter->Append(" _m->%s = %s_%s_fromS(_m->%s);", + fwriter.Append(" _m->%s = %s_%s_fromS(_m->%s);", sgs->msg.Signals[num].NameFloat.c_str(), fdesc->gen.DRVNAME.c_str(), sname, sname); } - fwriter->Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter.Append(); } else if (num + 1 == sgs->to_signals.size()) { // last signal without phys part, put \n manually - fwriter->Append(""); + fwriter.Append(""); } } - fwriter->Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str()); - fwriter->Append(" _m->mon1.last_cycle = GetSystemTick();"); - fwriter->Append(" _m->mon1.frame_cnt++;"); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append(" _m->mon1.dlc_error = (dlc_ < %s_DLC);", sgs->msg.Name.c_str()); + fwriter.Append(" _m->mon1.last_cycle = GetSystemTick();"); + fwriter.Append(" _m->mon1.frame_cnt++;"); + fwriter.Append(); if (sgs->msg.RollSig != nullptr) { // Put rolling monitor here - fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", + fwriter.Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(" _m->mon1.roll_error = (_m->%s != _m->%s_expt);", sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str()); - fwriter->Append(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), + fwriter.Append(" _m->%s_expt = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1); // Put rolling monitor here - fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(); } if (sgs->msg.CsmSig != nullptr) { // Put checksum check function call here - fwriter->Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); - fwriter->Append(" _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s));", + fwriter.Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); + fwriter.Append(" _m->mon1.csm_error = (((uint8_t)GetFrameHash(_d, %s_DLC, %s_CANID, %s, %d)) != (_m->%s));", sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp, sgs->msg.CsmSig->Name.c_str()); - fwriter->Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); + fwriter.Append(); } auto Fmon_func = "FMon_" + sgs->msg.Name + "_" + fdesc->gen.drvname; - fwriter->Append(" %s(&_m->mon1, %s_CANID);", Fmon_func.c_str(), sgs->msg.Name.c_str()); + fwriter.Append(" %s(&_m->mon1, %s_CANID);", Fmon_func.c_str(), sgs->msg.Name.c_str()); - fwriter->Append("#endif // %s", fdesc->gen.usemon_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usemon_def.c_str()); + fwriter.Append(); - fwriter->Append(" return %s_CANID;", sgs->msg.Name.c_str()); + fwriter.Append(" return %s_CANID;", sgs->msg.Name.c_str()); } void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) { - fwriter->Append("{"); + fwriter.Append("{"); PrintPackCommonText("cframe->Data", sgs); - fwriter->Append(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str()); - fwriter->Append(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str()); - fwriter->Append(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str()); - fwriter->Append(" return %s_CANID;", sgs->msg.Name.c_str()); - fwriter->Append("}"); - fwriter->Append(); + fwriter.Append(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str()); + fwriter.Append(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str()); + fwriter.Append(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str()); + fwriter.Append(" return %s_CANID;", sgs->msg.Name.c_str()); + fwriter.Append("}"); + fwriter.Append(); } void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) { - fwriter->Append("{"); + fwriter.Append("{"); PrintPackCommonText("_d", sgs); - fwriter->Append(" *_len = %s_DLC;", sgs->msg.Name.c_str()); - fwriter->Append(" *_ide = %s_IDE;", sgs->msg.Name.c_str()); - fwriter->Append(" return %s_CANID;", sgs->msg.Name.c_str()); - fwriter->Append("}"); - fwriter->Append(); + fwriter.Append(" *_len = %s_DLC;", sgs->msg.Name.c_str()); + fwriter.Append(" *_ide = %s_IDE;", sgs->msg.Name.c_str()); + fwriter.Append(" return %s_CANID;", sgs->msg.Name.c_str()); + fwriter.Append("}"); + fwriter.Append(); } void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs) @@ -752,47 +746,47 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp // which is differs only by arra var name // pring array content clearin loop - fwriter->Append(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", + fwriter.Append(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", sgs->msg.Name.c_str(), arrtxt.c_str()); - fwriter->Append(); + fwriter.Append(); if (sgs->msg.RollSig != nullptr) { - fwriter->Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(" _m->%s = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), + fwriter.Append("#ifdef %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(" _m->%s = (_m->%s + 1) & (0x%02XU);", sgs->msg.RollSig->Name.c_str(), sgs->msg.RollSig->Name.c_str(), (1 << sgs->msg.RollSig->LengthBit) - 1); - fwriter->Append("#endif // %s", fdesc->gen.useroll_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.useroll_def.c_str()); + fwriter.Append(); } if (sgs->msg.CsmSig != nullptr) { // code for clearing checksum - fwriter->Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); - fwriter->Append(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str()); - fwriter->Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); - fwriter->Append(); + fwriter.Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); + fwriter.Append(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str()); + fwriter.Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); + fwriter.Append(); } if (sgs->msg.hasPhys) { // first step is to put code for sigfloat conversion, before // sigint packing to bytes. - fwriter->Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usesigfloat_def.c_str()); for (size_t n = 0; n < sgs->to_signals.size(); n++) { if (sgs->msg.Signals[n].IsSimpleSig == false) { // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter->Append(" _m->%s = %s_%s_toS(_m->%s);", + fwriter.Append(" _m->%s = %s_%s_toS(_m->%s);", sgs->msg.Signals[n].Name.c_str(), fdesc->gen.DRVNAME.c_str(), sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str()); } } - fwriter->Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); + fwriter.Append(); } for (size_t i = 0; i < sgs->to_bytes.size(); i++) @@ -802,24 +796,24 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp continue; } - fwriter->Append(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str()); + fwriter.Append(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str()); } - fwriter->Append(""); + fwriter.Append(""); if (sgs->msg.CsmSig != nullptr) { // code for getting checksum value and putting it in array - fwriter->Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); + fwriter.Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); - fwriter->Append(" _m->%s = ((uint8_t)GetFrameHash(%s, %s_DLC, %s_CANID, %s, %d));", + fwriter.Append(" _m->%s = ((uint8_t)GetFrameHash(%s, %s_DLC, %s_CANID, %s, %d));", sgs->msg.CsmSig->Name.c_str(), arrtxt.c_str(), sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp); - fwriter->Append(" %s[%d] |= %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str()); + fwriter.Append(" %s[%d] |= %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str()); - fwriter->Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); - fwriter->Append(); + fwriter.Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); + fwriter.Append(); } } diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index f2180cc..8eb7e90 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -10,8 +10,6 @@ class CiMainGenerator { public: - CiMainGenerator(); - void Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd); private: @@ -32,7 +30,7 @@ class CiMainGenerator { void PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs); private: - std::unique_ptr sigprt; - std::unique_ptr fwriter; + CSigPrinter sigprt; + FileWriter fwriter; const AppSettings_t* fdesc; }; diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 7ff459f..c1ef3db 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -14,8 +14,6 @@ static const std::string closeguard = "#ifdef __cplusplus\n\ CiUtilGenerator::CiUtilGenerator() { Clear(); - tof = std::make_unique(); - condtree = std::make_unique(); } void CiUtilGenerator::Clear() @@ -96,140 +94,140 @@ void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd void CiUtilGenerator::PrintHeader() { - tof->Flush(); + tof.Flush(); if (gdesc->start_info.size() > 0) { - tof->Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); + tof.Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); } - tof->Append("#pragma once"); - tof->Append(); + tof.Append("#pragma once"); + tof.Append(); - tof->Append(openguard); - tof->Append(); + tof.Append(openguard); + tof.Append(); // include common dbc code config header - tof->Append("#include "); - tof->Append(); + tof.Append("#include "); + tof.Append(); // include c-main driver header - tof->Append("#include <%s.h>", file_drvname.c_str()); - tof->Append(); + tof.Append("#include <%s.h>", file_drvname.c_str()); + tof.Append(); if (rx.size() == 0) { - tof->Append("// There is no any RX mapped massage."); - tof->Append(); + tof.Append("// There is no any RX mapped massage."); + tof.Append(); } else { // print the typedef - tof->Append("typedef struct\n{"); + tof.Append("typedef struct\n{"); for (auto m : rx) { - tof->Append(" %s_t %s;", m->Name.c_str(), m->Name.c_str()); + tof.Append(" %s_t %s;", m->Name.c_str(), m->Name.c_str()); } - tof->Append("} %s_rx_t;", gdesc->drvname.c_str()); - tof->Append(); + tof.Append("} %s_rx_t;", gdesc->drvname.c_str()); + tof.Append(); } if (tx.size() == 0) { - tof->Append("// There is no any TX mapped massage."); - tof->Append(); + tof.Append("// There is no any TX mapped massage."); + tof.Append(); } else { // print the typedef - tof->Append("typedef struct\n{"); + tof.Append("typedef struct\n{"); for (auto m : tx) { - tof->Append(" %s_t %s;", m->Name.c_str(), m->Name.c_str()); + tof.Append(" %s_t %s;", m->Name.c_str(), m->Name.c_str()); } - tof->Append("} %s_tx_t;", gdesc->drvname.c_str()); - tof->Append(); + tof.Append("} %s_tx_t;", gdesc->drvname.c_str()); + tof.Append(); } if (rx.size() > 0) { // receive function necessary only when more than 0 rx messages were mapped - tof->Append("uint32_t %s_Receive(%s_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc);", + tof.Append("uint32_t %s_Receive(%s_rx_t* m, const uint8_t* d, uint32_t msgid, uint8_t dlc);", gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->Append(); + tof.Append(); } // print extern for super structs if (rx.size() > 0 || tx.size() > 0) { - tof->Append("#ifdef __DEF_%s__", gdesc->DRVNAME.c_str()); - tof->Append(); + tof.Append("#ifdef __DEF_%s__", gdesc->DRVNAME.c_str()); + tof.Append(); if (rx.size() > 0) { - tof->Append("extern %s_rx_t %s_rx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->Append(); + tof.Append("extern %s_rx_t %s_rx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof.Append(); } if (tx.size() > 0) { - tof->Append("extern %s_tx_t %s_tx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->Append(); + tof.Append("extern %s_tx_t %s_tx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof.Append(); } - tof->Append("#endif // __DEF_%s__", gdesc->DRVNAME.c_str()); - tof->Append(); + tof.Append("#endif // __DEF_%s__", gdesc->DRVNAME.c_str()); + tof.Append(); } - tof->Append(closeguard); + tof.Append(closeguard); - tof->Flush(fdesc->util_h.fpath); + tof.Flush(fdesc->util_h.fpath); } void CiUtilGenerator::PrintSource() { if (gdesc->start_info.size() > 0) { - tof->Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); + tof.Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); } - tof->Append("#include \"%s\"", fdesc->util_h.fname.c_str()); - tof->Append(); + tof.Append("#include \"%s\"", fdesc->util_h.fname.c_str()); + tof.Append(); - tof->Append("// DBC file version"); - tof->Append("#if (%s != (%uU)) || (%s != (%uU))", + tof.Append("// DBC file version"); + tof.Append("#if (%s != (%uU)) || (%s != (%uU))", gdesc->verhigh_def.c_str(), p_dlist->ver.hi, gdesc->verlow_def.c_str(), p_dlist->ver.low); - tof->Append("#error The %s binutil source file has inconsistency with core dbc lib!", + tof.Append("#error The %s binutil source file has inconsistency with core dbc lib!", gdesc->DRVNAME.c_str()); - tof->Append("#endif"); - tof->Append(); + tof.Append("#endif"); + tof.Append(); // optional RX and TX struct allocations if (rx.size() > 0 || tx.size() > 0) { - tof->Append("#ifdef __DEF_%s__", gdesc->DRVNAME.c_str()); - tof->Append(); + tof.Append("#ifdef __DEF_%s__", gdesc->DRVNAME.c_str()); + tof.Append(); if (rx.size() > 0) { - tof->Append("%s_rx_t %s_rx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->Append(); + tof.Append("%s_rx_t %s_rx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof.Append(); } if (tx.size() > 0) { - tof->Append("%s_tx_t %s_tx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->Append(); + tof.Append("%s_tx_t %s_tx;", gdesc->drvname.c_str(), gdesc->drvname.c_str()); + tof.Append(); } - tof->Append("#endif // __DEF_%s__", gdesc->DRVNAME.c_str()); - tof->Append(); + tof.Append("#endif // __DEF_%s__", gdesc->DRVNAME.c_str()); + tof.Append(); } if (rx.size() > 0) @@ -240,26 +238,26 @@ void CiUtilGenerator::PrintSource() // binary search on FrameID for selecting unpacking function auto tree = FillTreeLevel(rx, 0, static_cast(rx.size())); - tof->Append("uint32_t %s_Receive(%s_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)", + tof.Append("uint32_t %s_Receive(%s_rx_t* _m, const uint8_t* _d, uint32_t _id, uint8_t dlc_)", gdesc->drvname.c_str(), gdesc->drvname.c_str()); - tof->Append("{"); - tof->Append(" uint32_t recid = 0;"); + tof.Append("{"); + tof.Append(" uint32_t recid = 0;"); // put tree-view struct on code (in treestr variable) std::string treestr; - condtree->Clear(); - tof->Append(condtree->WriteCode(tree, treestr, 1)); - tof->Append(); - tof->Append(" return recid;"); - tof->Append("}"); - tof->Append(); + condtree.Clear(); + tof.Append(condtree.WriteCode(tree, treestr, 1)); + tof.Append(); + tof.Append(" return recid;"); + tof.Append("}"); + tof.Append(); // clear tree after using - condtree->DeleteTree(tree); + condtree.DeleteTree(tree); } - tof->Flush(fdesc->util_c.fpath); + tof.Flush(fdesc->util_c.fpath); } ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vector& list, diff --git a/src/codegen/c-util-generator.h b/src/codegen/c-util-generator.h index 15156ce..adce69f 100644 --- a/src/codegen/c-util-generator.h +++ b/src/codegen/c-util-generator.h @@ -37,8 +37,8 @@ class CiUtilGenerator { std::vector both; // to file writer - std::unique_ptr tof; - std::unique_ptr condtree; + FileWriter tof; + ConditionalTree condtree; std::string code_drvname; std::string file_drvname; diff --git a/src/maincli.cpp b/src/maincli.cpp index fe66db8..2de1727 100644 --- a/src/maincli.cpp +++ b/src/maincli.cpp @@ -8,6 +8,6 @@ int main(int argc, char* argv[]) { OptionsParser parser; auto opts = parser.GetOptions(argc, argv); - auto app = std::make_unique(opts); - app->Run(); + CoderApp app(opts); + app.Run(); } From 4823582d19a4a919f41f110c63f6c2a93fe13c90 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 5 Aug 2022 11:25:04 +0300 Subject: [PATCH 168/181] New readme 1st edition. Readme update. --- README.md | 122 +++++++++++++++++++++++------------------------------- 1 file changed, 51 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index cd17837..0b9f7a8 100644 --- a/README.md +++ b/README.md @@ -1,97 +1,77 @@ - # CODERDBC +# CODERDBC - ## What is it - - CLI utilty for generating C code from dbc (CAN matrix) files - - ## Build and run - - This manual works on Ubuntu 20.04 and Windows 10. You need to ensure that your system has - C++ compile and builing toolchain (**c++17**) - - To build coderdbc you need to make next steps: - - 1 install cmake - - 2 download source code: - - `git clone https://github.com/astand/c-coderdbc.git coderdbc` - - 3 goto source code directory: - - `cd coderdbc` - - 4 run cmake configuration to 'build' directory: - - `cmake -S src -B build` - - 5 run cmake build: - - `cmake --build build --config release` - - 6 goto to build directory and run: - - `cd build` - - `./coderdbc` - - Call without argument will print instruction how to pass DBC file for generation - - ## Driver functionality description - - The full pack of source code (both generated and manually edited) will be looked this - (presuming that the dbc driver name is "ecudb"): +Coderdbc is a CLI utility for generating C code from DBC CAN matrix files + +### Features +- ***Pack*** and ***Unpack*** functions for conversion signals to CAN payload raw data and vice verse +- ***Node based*** Receive function _(each node (ECU) has its own ***Receive*** function according to its DBC configuration)_ +- Automation on monitoring functions: CRC, counter and missing tests +- Optional source code generation _(the generation of readonly and configuration files can be avoided)_ +- Flexible setup via driver configuration _(see comments in source code for details)_ + +## Build and run + +For building project you need to have cmake and c++ development toolkit in your system +1 download source code: +```sh +git clone https://github.com/astand/c-coderdbc.git coderdbc +``` +Go to the source code directory: +```sh +cd coderdbc +``` +Run cmake configuration to 'build' directory: +```sh +cmake -S src -B build +``` +Run cmake build: +```sh +--build build --config release +``` +Go to the build directory and run: +```sh +cd build +./coderdbc --help +``` + +Help information with main instructions about using the tool will be printed + +## Driver functionality description + + The source code package includes the following source files (presuming that the dbc driver name is "ecudb"): - ecudb.c / ecudb.h (1) RO / lib - - Main driver which has all dbc frames structs / pack functions / unpack functions these - source files preferably to place in lib level directory because they are RO using model - and can be - shared among few separated projects. + ecudb.c / ecudb.h (1) RO / lib + Pair of the main driver which contains all dbc frames structs / pack functions / unpack functions declarations. These source files preferably to place in the share/library directory. This part of the package is non-changable and has no any data, so can be used across multi projects. + ecudb-fmon.h (2) RO / lib - Contains monitoring functions signatures which can be optionally called from unpack frame. - Best option to place file beside Main driver files (1). + Fmon header is a readonly part of monitoring part of the package. It contains the list of functions for CAN message validation. Those functions should be defined in the scope of user code and can be optionally used in unpack messages. This file is preferably to place in the share/library directory next to the main driver source files. ecudb-fmon.c (3) app - User defined functions with diagnostic purpose. DLC, rolling, checksum errors can be handled - automatically if specific configuration enabled. This file is user level source code. + User specific part of monitoring functionality. If monitoring is fully enabled user code must define all the monitoring functions. This file is a part of the scope of user code. ecudb-config.h (4) app / inc* - This is application specific configuration file. If you have a few projects (applications) - which referenced on single main driver (1,2) then each project have to have own copy of this - configuration. Source code (1,2) includes this configuration. If a few dbc matrix is in use - in your application then for each of (1,2) specific configuration file must be presented. + An application specific configuration file for enabling features in the main driver. If there are a few projects (applications) which include a single main driver (1,2) then each project has to have its own copy of this configuration. Source code (1,2) includes this configuration. If a few dbc matrix is in use in your application then for each of (1,2) specific configuration file must be presented. dbccodeconf.h (5) app / inc - This is application specific configuration file. This file may include "CanFrame" definition, - sigfloat_t typedef and binutil macros which enables rx and tx structures allocation inside - ecudb-binutil.c. This file must be single for application (see template dbccodeconf.h), source - code (4,6) includes this configuration. + Application specific configuration file. This file might include "CanFrame" definition, sigfloat_t typedef and binutil macros which enables rx and tx structures allocation inside ecudb-binutil.c. Each project has to have its own copy of this configuration (see template dbccodeconf.h). Source code (4,6) includes this configuration. ecudb-binutil.c / ecudb-binutil.h (6) RO / app - Basically this is application specific file. This driver has one function which intakes CAN - message data and calls dedicated unpacking function. Function selection based on binary search. + The part which is used for generalization CAN frame flow receiving and unpacking. It also optionally can allocate CAN frame tx/rx structs. canmonitorutil.h (7) lib - This is lib level source code. This file is basic for all automatic monitoring functions. - This configuration file location have to be added to project include path. + General definitions for monitoring feature. The source file can be place to the share/library directory. ----------------------------------------------------------------------------------------------- *inc - file location have to be added to project include path. - ## "-nodeutils" option +## generation options - If your matrix has strict routing setup, where each CAN device (node) has defined collection - of TX frames as well as defined collection of RX frames the "-nodeutils" option may be used. - In this mode all the nodes defined in CAN matrix will be handled as specific ECU and - for each of these specific ECUs dedicated "###-binutil.c/h" pair of source code will be generated. - - See help output using details. + There are several available generation option, use '-help' option for details From cc7b4130a2aa02773a141df50a675bc8dd42415b Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 3 May 2023 22:40:35 +0200 Subject: [PATCH 169/181] New release notes format, style config in file. Fixed readme Include stdint before using uint8_t Fix Assertion '!empty()' failed Fix Assertion '__pos <= size()' failed Fixes from PR#25 updated --- README.md | 2 +- astyle-all.sh | 25 +------ conf/astylerc | 21 ++++++ docs/RELEASES.md | 116 +++++++++++++++++++++------------ src/codegen/conditional-tree.h | 1 + src/codegen/filewriter.cpp | 12 +++- src/parser/dbcscanner.cpp | 13 ++-- 7 files changed, 116 insertions(+), 74 deletions(-) create mode 100644 conf/astylerc diff --git a/README.md b/README.md index 0b9f7a8..59403aa 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ cmake -S src -B build ``` Run cmake build: ```sh ---build build --config release +cmake --build build --config release ``` Go to the build directory and run: ```sh diff --git a/astyle-all.sh b/astyle-all.sh index 292a094..f0dedd5 100755 --- a/astyle-all.sh +++ b/astyle-all.sh @@ -1,29 +1,6 @@ #!/bin/bash -# cd {root_of_repo} -# ln -s ${PWD}/utl/format/pre-commit-astyle.sh .git/hooks/pre-commit -# chmod u+x utl/format/pre-commit-astyle.sh -OPTIONS="--suffix=none \ ---style=allman \ ---attach-inlines \ ---indent-switches \ ---indent-preproc-define \ ---indent=spaces=2 \ ---min-conditional-indent=2 \ ---break-blocks \ ---pad-oper \ ---pad-header \ ---unpad-paren \ ---align-pointer=type \ ---align-reference=type \ ---indent-modifiers \ ---attach-classes \ ---break-after-logical \ ---keep-one-line-statements \ ---indent-after-parens \ ---add-braces \ ---max-code-length=120 \ ---max-continuation-indent=120" +OPTIONS="--options=conf/astylerc" RETURN=0 ASTYLE='./astyle' diff --git a/conf/astylerc b/conf/astylerc new file mode 100644 index 0000000..05f1d4a --- /dev/null +++ b/conf/astylerc @@ -0,0 +1,21 @@ +--suffix=none +--style=allman +--attach-inlines +--indent-switches +--indent-preproc-define +--indent=spaces=2 +--min-conditional-indent=2 +--break-blocks +--pad-oper +--pad-header +--unpad-paren +--align-pointer=type +--align-reference=type +--indent-modifiers +--attach-classes +--break-after-logical +--keep-one-line-statements +--indent-after-parens +--add-braces +--max-code-length=120 +--max-continuation-indent=120 \ No newline at end of file diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 4efe7b1..cf66ec3 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -1,16 +1,36 @@ -# Changelog +# C-Coderdbc -## v2.9 +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), + +## [Unreleased] + +### Changed + +- This changelog file format has been changed +- Added style option file +- Changed git flow +- README.md changed + +### Fixed + +- Fixed an issue in findversion function +- Fixed issue on appending new string which is empty + +## [v2.9] - 2023-01-27 + +### Changed - prt_double refactored -## v2.8 +## [v2.8] - 2023-01-27 ### Fixed - Floating factor/offset values handling (incorrect rounding in some cases). -## v2.7 +## [v2.7] - 2023-01-15 ### Fixed @@ -22,17 +42,13 @@ - Better print for floating factor/offset values (removed tailing zeros) - Signals with too low factor/offset values (less than 0.000000001) are considered as plain integer signals, it is up to client to handle them ---- - -## v2.6 29.09.2022 +## [v2.6] - 2022-09-29 ### Fixed - [issue #9](https://github.com/astand/c-coderdbc/issues/16) found by [@DPOH357](https://github.com/DPOH357) ---- - -## v2.5 26.07.2022 +## [v2.5] - 2022-07-26 ### Changed @@ -41,16 +57,14 @@ and adds more flexibility to configure driver - bitext_t and ubitext_t defined by default in dbccodeconf.h file - App version is printed when generator runs (not only in help print case) -## v2.4 24.07.2022 +## [v2.4] - 2022-07-24 ### Added - Three new CLI keys to optionally disable some source code generation (see help) - Added more tests ---- - -## v2.3 19.07.2022 +## [v2.3] - 2022-07-19 ### Changed - The gGeneration and the file configurations are splitted to different structs @@ -61,9 +75,7 @@ and adds more flexibility to configure driver - FMon driver can be configured for using MONO function approach or dedicated function (how it was before) by setting _USE_MONO_FMON macro ---- - -## v2.2 2022-05-07 +## [v2.2] - 2022-05-07 ### Fixed - "C valid name" check for main driver name and value table descriptions @@ -79,9 +91,7 @@ dedicated function (how it was before) by setting _USE_MONO_FMON macro files to main dbc source file (drvname.h) - Sources which are presumed to be located in __include__ directory are in square brakets ---- - -## v2.1 2022-02-19 +## [v2.1] - 2022-02-19 ### Fixed - Some times incorrect _ro and _phys type deduction @@ -89,9 +99,7 @@ dedicated function (how it was before) by setting _USE_MONO_FMON macro ### Added - Sign extension for signal which have signed type ([@2Black2](https://github.com/2Black2)) ---- - -## v2.0 2022-02-02 +## [v2.0] - 2022-02-02 ### Added - '-rw' and '-nodeutils' (renamed '--node-utils') options @@ -102,67 +110,66 @@ dedicated function (how it was before) by setting _USE_MONO_FMON macro ### Fixed - Minor warnings - Bad source files placement for -rw key -*** -## v1.10 2021-01-24 +## [v1.10] - 2021-01-24 ### Changed - Source files placed to separated directories ### Fixed - Incorrect comments for valuetable's values - Minor changes -*** -## v1.9 2021-11-09 +## [v1.9] - 2021-11-09 + ### Fixed - Closing last comment section in -config.h ([@SamFisher940425](https://github.com/SamFisher940425)) - A few minor style changes in generated code - All sources of repo processed by code style formatting tool -*** -## v1.8 2021-11-01 +## [v1.8] - 2021-11-01 + ### Fixed - Issue #6. Incorrect checksum signal assigning. -*** -## v1.7 2021-10-10 +## [v1.7] - 2021-10-10 + ### Fixed - Potential issue when node is only Receiver (presumably will be skipped in node-util struct) ### Added - Support multiple transmitters on single frame (for --node-utils generation variant) -*** -## v1.6 2021-09-09 +## [v1.6] - 2021-09-09 + ### Added - 4th CLI param '--node-utils' for generation pairs of binutil for each network node defined in DBC ### Fixed - Bad *_Receive() function body when there is only 1 frame in RX struct -*** -## v1.5 - 2021-08-26 +## [v1.5] - 2021-08-26 + ### Fixed - Fixed 'atoi' with Extended ID on Windows OS ([@shevu](https://github.com/shevu)) - Fixed issue with parsing value table values ([@shevu](https://github.com/shevu)) - Fixed issue with frames where signals goes out of DLC range -*** -## v1.4 - 2021-07-13 +## [v1.4] - 2021-07-13 + ### Fixed - Removed default into "this is test" - Edited README.md -*** -## v1.3 - 2021-07-11 +## [v1.3] - 2021-07-11 + ### Added - Printing template canmonitorutil.h - Printing template dbccodeconf.h - Updated driver-config comment text -*** -## v1.2 - 2021-07-11 +## [v1.2] - 2021-07-11 + ### Added - Option for rewriting generated files - Added README.md (base build and run instruction) @@ -175,9 +182,9 @@ network node defined in DBC ### Fixed - Fixed some warnings -*** -## v1.0 - 2021-05-15 +## [v1.0] - 2021-05-15 + ### Added - Added DBC file version ("VERSION "x.x"") tag parsing - Added dbc version info in: fmon, main and util drivers @@ -188,3 +195,26 @@ network node defined in DBC ### Fixed - Fixed some warnings + + +[Unreleased]: https://github.com/astand/c-coderdbc/compare/v2.9...HEAD +[v2.9]: https://github.com/astand/c-coderdbc/compare/v2.8...v2.9 +[v2.8]: https://github.com/astand/c-coderdbc/compare/v2.7...v2.8 +[v2.7]: https://github.com/astand/c-coderdbc/compare/v2.6...v2.7 +[v2.6]: https://github.com/astand/c-coderdbc/compare/v2.5...v2.6 +[v2.5]: https://github.com/astand/c-coderdbc/compare/v2.4...v2.5 +[v2.4]: https://github.com/astand/c-coderdbc/compare/v2.3...v2.4 +[v2.3]: https://github.com/astand/c-coderdbc/compare/v2.2...v2.3 +[v2.2]: https://github.com/astand/c-coderdbc/compare/v2.1...v2.2 +[v2.1]: https://github.com/astand/c-coderdbc/compare/v2.0...v2.1 +[v2.0]: https://github.com/astand/c-coderdbc/compare/v1.10...v2.0 +[v1.10]: https://github.com/astand/c-coderdbc/compare/v1.9...v1.10 +[v1.9]: https://github.com/astand/c-coderdbc/compare/v1.8...v1.9 +[v1.8]: https://github.com/astand/c-coderdbc/compare/v1.7...v1.8 +[v1.7]: https://github.com/astand/c-coderdbc/compare/v1.6...v1.7 +[v1.6]: https://github.com/astand/c-coderdbc/compare/v1.5...v1.6 +[v1.5]: https://github.com/astand/c-coderdbc/compare/v1.4...v1.5 +[v1.4]: https://github.com/astand/c-coderdbc/compare/v1.3...v1.4 +[v1.3]: https://github.com/astand/c-coderdbc/compare/v1.2...v1.3 +[v1.2]: https://github.com/astand/c-coderdbc/compare/v1.0...v1.2 +[v1.0]: https://github.com/astand/c-coderdbc/releases/tag/v1.0 \ No newline at end of file diff --git a/src/codegen/conditional-tree.h b/src/codegen/conditional-tree.h index 056f9bd..d551037 100644 --- a/src/codegen/conditional-tree.h +++ b/src/codegen/conditional-tree.h @@ -1,6 +1,7 @@ #pragma once #include +#include enum class ConditionalType { Cond, Express, Single }; diff --git a/src/codegen/filewriter.cpp b/src/codegen/filewriter.cpp index 6ff5c15..ba27e10 100644 --- a/src/codegen/filewriter.cpp +++ b/src/codegen/filewriter.cpp @@ -60,8 +60,16 @@ void FileWriter::AppendText(const std::string& str) void FileWriter::Append(const std::string& str) { - AppendText(str); - NewLine(str.back()); + if (str.empty()) + { + // the line is empty, just put 1 new empty line + Append(); + } + else + { + AppendText(str); + NewLine(str.back()); + } } void FileWriter::Append(size_t empty_lines) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index d29d7c0..7edb65f 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -69,6 +69,7 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) while (readstrm.eof() == false) { std::getline(readstrm, sline); + sline = str_trim(sline); FindVersion(sline); @@ -156,6 +157,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) while (!readstrm.eof()) { std::getline(readstrm, sline); + sline = str_trim(sline); if (lparser.ParseCommentLine(&cmmnt, sline)) @@ -328,17 +330,20 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) void DbcScanner::FindVersion(const std::string& instr) { // try to find version string which looks like: VERSION "x.x" + static constexpr char* versionAttr = (char*)"VERSION"; + static constexpr size_t VER_MIN_LENGTH = strlen(versionAttr); + uint32_t h = 0, l = 0; - char marker[9]; + char marker[VER_MIN_LENGTH + 1u]; - if (instr[0] != 'V' && instr[1] != 'E') + if (instr.size() < VER_MIN_LENGTH) { return; } - int32_t ret = std::sscanf(instr.c_str(), "%8s \"%u.%u\"", marker, &h, &l); + auto ret = std::sscanf(instr.c_str(), "%8s \"%u.%u\"", marker, &h, &l); - if ((ret == 3) && (std::strcmp(marker, "VERSION") == 0)) + if ((ret == 3) && (std::strcmp(marker, versionAttr) == 0)) { // versions have been found, save numeric values dblist.ver.hi = h; From 1229bd9cfa7645e522a6141c0788847e7cbe68be Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 15 Aug 2023 22:27:22 +0300 Subject: [PATCH 170/181] Changed include files quatation (quotes instead of angle brackets) Added empty frame to be remove from driver in next commit Frames with no signals are almost fully ignored New features regarding DLC handling, initial byte value Added more explicit type casting --- docs/RELEASES.md | 22 +- src/codegen/c-main-generator.cpp | 111 ++++++-- src/codegen/c-main-generator.h | 6 + src/codegen/c-sigprinter.cpp | 20 +- src/codegen/c-util-generator.cpp | 14 +- src/codegen/config-generator.cpp | 2 +- src/codegen/mon-generator.cpp | 6 +- src/parser/dbcscanner.cpp | 13 +- src/types/message.h | 7 + test/gencode/butl/bcm_testdb-binutil.h | 4 +- test/gencode/butl/bms_testdb-binutil.h | 4 +- test/gencode/butl/eps_testdb-binutil.h | 4 +- test/gencode/butl/esp_testdb-binutil.h | 4 +- test/gencode/conf/testdb-config.h | 2 +- test/gencode/lib/testdb-fmon.h | 7 +- test/gencode/lib/testdb.c | 342 ++++++++++++------------- test/gencode/lib/testdb.h | 40 ++- test/gencode/usr/testdb-fmon.c | 8 +- test/testdb.dbc | 6 +- 19 files changed, 384 insertions(+), 238 deletions(-) mode change 100755 => 100644 test/testdb.dbc diff --git a/docs/RELEASES.md b/docs/RELEASES.md index cf66ec3..1a6ebf7 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -6,8 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [v3.0] - 2023-10-09 + +### Added + +- Added explicit type casting on: + * Writing data bytes, IDE, DLC and MsgId on pack step + * Explicit unsigned nature ('U') to message CANID macro value +- ```-Wpedantic``` doesn't complain anymore on generated code (tested on test.dbc only) +- Added 'define' with value for filling initial value in frame's bytes before packing signals. + The value can be set in the user scope configuration file (driver-config) +- Added enhanced DLC handling: + * Added max detected DLC value (as a macro in main driver) + * User can specify its own max DLC value if necessary (by setting corresponding macro in driver-config file) + * Functions use new 'VALIDATE_DLC' test when checks the limit of frame data bytes count + ### Changed +- Include files in quotes instead of angle brackets - This changelog file format has been changed - Added style option file - Changed git flow @@ -15,7 +31,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed -- Fixed an issue in findversion function +- No more struct, pack and unpack for frames with no signals (empty frames). IDs and frame related info is left +- Fixed an issue in 'findversion' function - Fixed issue on appending new string which is empty ## [v2.9] - 2023-01-27 @@ -197,7 +214,8 @@ network node defined in DBC - Fixed some warnings -[Unreleased]: https://github.com/astand/c-coderdbc/compare/v2.9...HEAD +[Unreleased]: https://github.com/astand/c-coderdbc/compare/v3.0...HEAD +[v3.0]: https://github.com/astand/c-coderdbc/compare/v2.9...v3.0 [v2.9]: https://github.com/astand/c-coderdbc/compare/v2.8...v2.9 [v2.8]: https://github.com/astand/c-coderdbc/compare/v2.7...v2.8 [v2.7]: https://github.com/astand/c-coderdbc/compare/v2.6...v2.7 diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 8ef182d..0bcec02 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -36,6 +36,9 @@ void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd // Load income messages to sig printer sigprt.LoadMessages(dlist.msgs); + // save max dlc value from message list for printing on the following generation steps + val_maxDlcValueFromDbcList = dlist.maxDlcValue; + // save pointer to output file descriptor struct to // enable using this information inside class member functions fdesc = &fsd; @@ -101,7 +104,7 @@ void CiMainGenerator::Gen_MainHeader() fwriter.Append(); fwriter.Append("// include current dbc-driver compilation config"); - fwriter.Append("#include <%s-config.h>", fdesc->gen.drvname.c_str()); + fwriter.Append("#include \"%s-config.h\"", fdesc->gen.drvname.c_str()); fwriter.Append(); fwriter.Append("#ifdef %s", fdesc->gen.usemon_def.c_str()); @@ -109,14 +112,48 @@ void CiMainGenerator::Gen_MainHeader() fwriter.Append( "// This file must define:\n" "// base monitor struct\n" - "#include \n" + "#include \"canmonitorutil.h\"\n" "\n" ); fwriter.Append("#endif // %s", fdesc->gen.usemon_def.c_str()); fwriter.Append(2); - for (size_t num = 0; num < sigprt.sigs_expr.size(); num++) + // set macro name for max dlc value based on driver name + std::string maxDlcMacroName = fdesc->gen.DRVNAME + "_MAX_DLC_VALUE"; + + // set macro name for dlc validation + prt_dlcValidateMacroName = fdesc->gen.DRVNAME + "_VALIDATE_DLC"; + + // set macro name for initial data byte value based on driver name + prt_initialDataByteValueName = fdesc->gen.DRVNAME + "_INITIAL_BYTE_VALUE"; + + // print part with max DLC macro + fwriter.Append("// DLC maximum value which is used as the limit for frame's data buffer size."); + fwriter.Append("// Client can set its own value (not sure why) in driver-config"); + fwriter.Append("// or can test it on some limit specified by application"); + fwriter.Append("// e.g.: static_assert(TESTDB_MAX_DLC_VALUE <= APPLICATION_FRAME_DATA_SIZE, \"Max DLC value in the driver is too big\")"); + fwriter.Append("#ifndef %s", maxDlcMacroName.c_str()); + fwriter.Append("// The value which was found out by generator (real max value)"); + fwriter.Append("#define %s %uU", maxDlcMacroName.c_str(), val_maxDlcValueFromDbcList); + fwriter.Append("#endif"); + fwriter.Append(1); + + // actual macro for final DLC validation in the driver + fwriter.Append("// The limit is used for setting frame's data bytes"); + fwriter.Append("#define %s(msgDlc) (((msgDlc) <= (%s)) ? (msgDlc) : (%s))", + prt_dlcValidateMacroName.c_str(), maxDlcMacroName.c_str(), maxDlcMacroName.c_str()); + + // print initial data byte section + fwriter.Append(1); + fwriter.Append("// Initial byte value to be filles in data bytes of the frame before pack signals"); + fwriter.Append("// User can define its own custom value in driver-config file"); + fwriter.Append("#ifndef %s", prt_initialDataByteValueName.c_str()); + fwriter.Append("#define %s 0U", prt_initialDataByteValueName.c_str()); + fwriter.Append("#endif"); + fwriter.Append(2); + + for (size_t num = 0u; num < sigprt.sigs_expr.size(); num++) { // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt.sigs_expr[num]->msg; @@ -130,7 +167,7 @@ void CiMainGenerator::Gen_MainHeader() fwriter.Append("// def @%s CAN Message (%-4d %#x)", m.Name.c_str(), m.MsgID, m.MsgID); fwriter.Append("#define %s_IDE (%uU)", m.Name.c_str(), m.IsExt); fwriter.Append("#define %s_DLC (%uU)", m.Name.c_str(), m.DLC); - fwriter.Append("#define %s_CANID (%#x)", m.Name.c_str(), m.MsgID); + fwriter.Append("#define %s_CANID (%#xU)", m.Name.c_str(), m.MsgID); if (m.Cycle > 0) { @@ -139,6 +176,13 @@ void CiMainGenerator::Gen_MainHeader() size_t max_sig_name_len = 27; + if (!m.frameNotEmpty) + { + // do nothing with empty frame, leave only id other relevant constants + fwriter.Append(); + continue; + } + for (size_t signum = 0; signum < m.Signals.size(); signum++) { SignalDescriptor_t& s = m.Signals[signum]; @@ -261,6 +305,12 @@ void CiMainGenerator::Gen_MainHeader() // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt.sigs_expr[num]->msg; + if (!m.frameNotEmpty) + { + // do nothing with empty frame + continue; + } + fwriter.Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_);", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); @@ -312,7 +362,7 @@ void CiMainGenerator::Gen_MainSource() "// Function prototypes to be called each time CAN frame is unpacked\n" "// FMon function may detect RC, CRC or DLC violation\n"); - fwriter.Append("#include <%s-fmon.h>", fdesc->gen.drvname.c_str()); + fwriter.Append("#include \"%s-fmon.h\"", fdesc->gen.drvname.c_str()); fwriter.Append(); fwriter.Append("#endif // %s", fdesc->gen.usemon_def.c_str()); @@ -345,6 +395,12 @@ void CiMainGenerator::Gen_MainSource() // write message typedef s and additional expressions MessageDescriptor_t& m = sigprt.sigs_expr[num]->msg; + if (!m.frameNotEmpty) + { + // do nothing, no pack and unpack functions for empty frames + continue; + } + // first function fwriter.Append("uint32_t Unpack_%s_%s(%s_t* _m, const uint8_t* _d, uint8_t dlc_)\n{", m.Name.c_str(), fdesc->gen.DrvName_orig.c_str(), m.Name.c_str()); @@ -641,12 +697,14 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) if (sgs->msg.Signals[num].Signed) { - fwriter.Append(" _m->%s = %s(( %s ), %d);", - sname, ext_sig_func_name, expr.c_str(), (int32_t)sgs->msg.Signals[num].LengthBit); + fwriter.Append(" _m->%s = (%s) %s(( %s ), %d);", + sname, PrintType((int)sgs->msg.Signals[num].TypeRo).c_str(), + ext_sig_func_name, expr.c_str(), (int32_t)sgs->msg.Signals[num].LengthBit); } else { - fwriter.Append(" _m->%s = %s;", sname, expr.c_str()); + fwriter.Append(" _m->%s = (%s) ( %s );", sname, + PrintType((int)sgs->msg.Signals[num].TypeRo).c_str(), expr.c_str()); } // print sigfloat conversion @@ -662,8 +720,10 @@ void CiMainGenerator::WriteUnpackBody(const CiExpr_t* sgs) } else { - fwriter.Append(" _m->%s = %s_%s_fromS(_m->%s);", - sgs->msg.Signals[num].NameFloat.c_str(), fdesc->gen.DRVNAME.c_str(), sname, sname); + fwriter.Append(" _m->%s = (%s) %s_%s_fromS(_m->%s);", + sgs->msg.Signals[num].NameFloat.c_str(), + PrintType((int)sgs->msg.Signals[num].TypePhys).c_str(), + fdesc->gen.DRVNAME.c_str(), sname, sname); } fwriter.Append("#endif // %s", fdesc->gen.usesigfloat_def.c_str()); @@ -721,9 +781,9 @@ void CiMainGenerator::WritePackStructBody(const CiExpr_t* sgs) { fwriter.Append("{"); PrintPackCommonText("cframe->Data", sgs); - fwriter.Append(" cframe->MsgId = %s_CANID;", sgs->msg.Name.c_str()); - fwriter.Append(" cframe->DLC = %s_DLC;", sgs->msg.Name.c_str()); - fwriter.Append(" cframe->IDE = %s_IDE;", sgs->msg.Name.c_str()); + fwriter.Append(" cframe->MsgId = (uint32_t) %s_CANID;", sgs->msg.Name.c_str()); + fwriter.Append(" cframe->DLC = (uint8_t) %s_DLC;", sgs->msg.Name.c_str()); + fwriter.Append(" cframe->IDE = (uint8_t) %s_IDE;", sgs->msg.Name.c_str()); fwriter.Append(" return %s_CANID;", sgs->msg.Name.c_str()); fwriter.Append("}"); fwriter.Append(); @@ -733,8 +793,8 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) { fwriter.Append("{"); PrintPackCommonText("_d", sgs); - fwriter.Append(" *_len = %s_DLC;", sgs->msg.Name.c_str()); - fwriter.Append(" *_ide = %s_IDE;", sgs->msg.Name.c_str()); + fwriter.Append(" *_len = (uint8_t) %s_DLC;", sgs->msg.Name.c_str()); + fwriter.Append(" *_ide = (uint8_t) %s_IDE;", sgs->msg.Name.c_str()); fwriter.Append(" return %s_CANID;", sgs->msg.Name.c_str()); fwriter.Append("}"); fwriter.Append(); @@ -742,12 +802,13 @@ void CiMainGenerator::WritePackArrayBody(const CiExpr_t* sgs) void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExpr_t* sgs) { - // this function will print part of pack function - // which is differs only by arra var name + // this function will print body of packing function // pring array content clearin loop - fwriter.Append(" uint8_t i; for (i = 0; (i < %s_DLC) && (i < 8); %s[i++] = 0);", - sgs->msg.Name.c_str(), arrtxt.c_str()); + fwriter.Append(" uint8_t i; for (i = 0u; i < %s(%s_DLC); %s[i++] = %s);", + prt_dlcValidateMacroName.c_str(), + sgs->msg.Name.c_str(), arrtxt.c_str(), + prt_initialDataByteValueName.c_str()); fwriter.Append(); if (sgs->msg.RollSig != nullptr) @@ -763,7 +824,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp { // code for clearing checksum fwriter.Append("#ifdef %s", fdesc->gen.usecsm_def.c_str()); - fwriter.Append(" _m->%s = 0U;", sgs->msg.CsmSig->Name.c_str()); + fwriter.Append(" _m->%s = (%s) 0;", sgs->msg.CsmSig->Name.c_str(), PrintType((int)sgs->msg.CsmSig->TypeRo).c_str()); fwriter.Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); fwriter.Append(); } @@ -779,8 +840,10 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp if (sgs->msg.Signals[n].IsSimpleSig == false) { // print toS from *_phys to original named sigint (integer duplicate of signal) - fwriter.Append(" _m->%s = %s_%s_toS(_m->%s);", - sgs->msg.Signals[n].Name.c_str(), fdesc->gen.DRVNAME.c_str(), + fwriter.Append(" _m->%s = (%s) %s_%s_toS(_m->%s);", + sgs->msg.Signals[n].Name.c_str(), + PrintType((int) sgs->msg.Signals[n].TypeRo).c_str(), + fdesc->gen.DRVNAME.c_str(), sgs->msg.Signals[n].Name.c_str(), sgs->msg.Signals[n].NameFloat.c_str()); } } @@ -796,7 +859,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp continue; } - fwriter.Append(" %s[%d] |= %s;", arrtxt.c_str(), i, sgs->to_bytes[i].c_str()); + fwriter.Append(" %s[%d] |= (uint8_t) ( %s );", arrtxt.c_str(), i, sgs->to_bytes[i].c_str()); } fwriter.Append(""); @@ -810,7 +873,7 @@ void CiMainGenerator::PrintPackCommonText(const std::string& arrtxt, const CiExp sgs->msg.CsmSig->Name.c_str(), arrtxt.c_str(), sgs->msg.Name.c_str(), sgs->msg.Name.c_str(), sgs->msg.CsmMethod.c_str(), sgs->msg.CsmOp); - fwriter.Append(" %s[%d] |= %s;", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str()); + fwriter.Append(" %s[%d] |= (uint8_t) ( %s );", arrtxt.c_str(), sgs->msg.CsmByteNum, sgs->msg.CsmToByteExpr.c_str()); fwriter.Append("#endif // %s", fdesc->gen.usecsm_def.c_str()); fwriter.Append(); diff --git a/src/codegen/c-main-generator.h b/src/codegen/c-main-generator.h index 8eb7e90..33cbc96 100644 --- a/src/codegen/c-main-generator.h +++ b/src/codegen/c-main-generator.h @@ -32,5 +32,11 @@ class CiMainGenerator { private: CSigPrinter sigprt; FileWriter fwriter; + // Actual max DLC value from dbc list instance + size_t val_maxDlcValueFromDbcList; + // Macro for default initial frame's data bytes value + std::string prt_initialDataByteValueName; + // Macro for frame DLC validation + std::string prt_dlcValidateMacroName; const AppSettings_t* fdesc; }; diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 35667ff..2ec3c5e 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -69,7 +69,7 @@ std::string CSigPrinter::PrintPhysicalToRaw(const SignalDescriptor_t* sig, const } retstr += StrPrint("#define %s_%s_toS(x) ( (%s) ", drvname.c_str(), sig->Name.c_str(), - PrintType((uint8_t)sig->TypeRo).c_str()); + PrintType((uint8_t)sig->TypeRo).c_str()); if (sig->IsDoubleSig) { @@ -188,7 +188,7 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec } uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? - (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); + (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); if (startb > 63) { @@ -211,10 +211,10 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec if (bbc > slen) { - snprintf(workbuff, WBUFF_LEN, "((_d[%d] >> %d) & (%s))", bn, bbc - slen, msk[slen].c_str()); + snprintf(workbuff, WBUFF_LEN, "((_d[%d] >> %dU) & (%s))", bn, bbc - slen, msk[slen].c_str()); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), bbc - slen); + snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %dU)", sig->Name.c_str(), msk[slen].c_str(), bbc - slen); AppendToByteLine(to_bytes[bn], workbuff); } else if (bbc == slen) @@ -236,10 +236,10 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec t64 = "(uint64_t)"; } - snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[bbc].c_str(), slen); + snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %dU)", t64.c_str(), bn, msk[bbc].c_str(), slen); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, msk[bbc].c_str()); + snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %dU) & (%s))", sig->Name.c_str(), slen, msk[bbc].c_str()); AppendToByteLine(to_bytes[bn], workbuff); while ((slen - 8) >= 0) @@ -277,10 +277,10 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec t64 = "(uint64_t)"; } - snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %d)", t64.c_str(), bn, msk[8].c_str(), slen); + snprintf(workbuff, WBUFF_LEN, "(%s(_d[%d] & (%s)) << %dU)", t64.c_str(), bn, msk[8].c_str(), slen); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %d) & (%s))", sig->Name.c_str(), slen, msk[8].c_str()); + snprintf(workbuff, WBUFF_LEN, "((_m->%s >> %dU) & (%s))", sig->Name.c_str(), slen, msk[8].c_str()); AppendToByteLine(to_bytes[bn], workbuff); } } @@ -289,10 +289,10 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec { bn = ShiftByte(sig, bn); - snprintf(workbuff, WBUFF_LEN, " | ((_d[%d] >> %d) & (%s))", bn, 8 - slen, msk[slen].c_str()); + snprintf(workbuff, WBUFF_LEN, " | ((_d[%d] >> %dU) & (%s))", bn, 8 - slen, msk[slen].c_str()); tosigexpr += workbuff; - snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %d)", sig->Name.c_str(), msk[slen].c_str(), + snprintf(workbuff, WBUFF_LEN, "((_m->%s & (%s)) << %dU)", sig->Name.c_str(), msk[slen].c_str(), 8 - slen); AppendToByteLine(to_bytes[bn], workbuff); } diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index c1ef3db..8d3c2c3 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -38,6 +38,12 @@ void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd // 1 step is to prepare vectors of message's groups for (auto m : dlist.msgs) { + if (!m->frameNotEmpty) + { + // skip frame when it is empty + continue; + } + auto v = std::find_if(groups.Both.begin(), groups.Both.end(), [&](const uint32_t& msgid) { return msgid == m->MsgID; @@ -108,11 +114,11 @@ void CiUtilGenerator::PrintHeader() tof.Append(); // include common dbc code config header - tof.Append("#include "); + tof.Append("#include \"dbccodeconf.h\""); tof.Append(); // include c-main driver header - tof.Append("#include <%s.h>", file_drvname.c_str()); + tof.Append("#include \"%s.h\"", file_drvname.c_str()); tof.Append(); @@ -285,7 +291,7 @@ ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vectorHigh = new ConditionalTree_t; ret->High->Type = ConditionalType::Single; ret->High->UtilCodeBody = StrPrint("recid = Unpack_%s_%s(&(_m->%s), _d, dlc_);", - msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); + msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); return ret; } @@ -311,7 +317,7 @@ ConditionalTree_t* CiUtilGenerator::FillTreeLevel(std::vectorConditionExpresion = StrPrint("_id == 0x%XU", msg->MsgID); ret->UtilCodeBody = StrPrint("recid = Unpack_%s_%s(&(_m->%s), _d, dlc_);", - msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); + msg->Name.c_str(), code_drvname.c_str(), msg->Name.c_str()); } return ret; diff --git a/src/codegen/config-generator.cpp b/src/codegen/config-generator.cpp index 015fb9a..a50f44a 100644 --- a/src/codegen/config-generator.cpp +++ b/src/codegen/config-generator.cpp @@ -5,7 +5,7 @@ void ConfigGenerator::FillHeader(FileWriter& wr, const GenDescriptor_t& gsett) wr.Append("#pragma once"); wr.Append(""); wr.Append("/* include common dbccode configurations */"); - wr.Append("#include "); + wr.Append("#include \"dbccodeconf.h\""); wr.Append(""); wr.Append(""); wr.Append("/* ------------------------------------------------------------------------- *"); diff --git a/src/codegen/mon-generator.cpp b/src/codegen/mon-generator.cpp index 5082808..ea84195 100644 --- a/src/codegen/mon-generator.cpp +++ b/src/codegen/mon-generator.cpp @@ -20,14 +20,14 @@ uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, wr.Append("#define %s_FMON (%uU)", aset.gen.verlow_def.c_str(), aset.gen.lowver); wr.Append(); - wr.Append("#include <%s-config.h>", aset.gen.drvname.c_str()); + wr.Append("#include \"%s-config.h\"", aset.gen.drvname.c_str()); wr.Append(); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function wr.Append("#ifdef %s", aset.gen.usemon_def.c_str()); wr.Append(); - wr.Append("#include "); + wr.Append("#include \"canmonitorutil.h\""); wr.Append("/*\n\ This file contains the prototypes of all the functions that will be called\n\ from each Unpack_*name* function to detect DBC related errors\n\ @@ -91,7 +91,7 @@ uint32_t MonGenerator::FillSource(FileWriter& wr, std::vector& sigs, wr.Append(aset.gen.start_info); } - wr.Append("#include <%s>", aset.file.fmon_h.fname.c_str()); + wr.Append("#include \"%s\"", aset.file.fmon_h.fname.c_str()); wr.Append(); // put diagmonitor ifdef selection for including @drv-fmon header // with FMon_* signatures to call from unpack function diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 7edb65f..e9e9e13 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -29,6 +29,7 @@ MessageDescriptor_t* find_message(vector msgs, uint32_t ID DbcScanner::DbcScanner() { + dblist.maxDlcValue = 0u; } DbcScanner::~DbcScanner() @@ -77,7 +78,13 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) // New message line has been found if (lparser.IsMessageLine(sline)) { - // check if the pMsg takes previous message + // if actual message, check DLC value for being max + if ((pMsg != nullptr) && (pMsg->DLC > dblist.maxDlcValue)) + { + dblist.maxDlcValue = pMsg->DLC; + } + + // the message will be added only if pMsg is not nullptr AddMessage(pMsg); // create instance for the detected message @@ -100,6 +107,9 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) // parse signal line if (lparser.ParseSignalLine(&sig, sline)) { + // set non empty flag to true once signal has been found and ready to be added into message + pMsg->frameNotEmpty = true; + // put successfully parsed signal to the message signals pMsg->Signals.push_back(sig); @@ -319,6 +329,7 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) message->Signals.clear(); message->TranS.clear(); message->hasPhys = false; + message->frameNotEmpty = false; message->RollSig = nullptr; message->CsmSig = nullptr; message->CsmMethod = ""; diff --git a/src/types/message.h b/src/types/message.h index 99b0225..275b9fc 100644 --- a/src/types/message.h +++ b/src/types/message.h @@ -123,6 +123,9 @@ typedef struct // flag about having sigfloat fields bool hasPhys; + // flag if frame has at least one signal (not empty) + bool frameNotEmpty; + // pointer to rolling counter signal SignalDescriptor_t* RollSig; @@ -164,6 +167,10 @@ typedef struct typedef struct { + // Array of all the parsed messages from DBC file std::vector msgs; + // The value of maximum DLC value among the parsed messages + size_t maxDlcValue; + // DBC file version values to be printed as macro values inside driver source code DbcFileVersion_t ver; } DbcMessageList_t; diff --git a/test/gencode/butl/bcm_testdb-binutil.h b/test/gencode/butl/bcm_testdb-binutil.h index 9a2aa30..c9d9b31 100644 --- a/test/gencode/butl/bcm_testdb-binutil.h +++ b/test/gencode/butl/bcm_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include +#include "dbccodeconf.h" -#include +#include "testdb.h" typedef struct { diff --git a/test/gencode/butl/bms_testdb-binutil.h b/test/gencode/butl/bms_testdb-binutil.h index fe1d027..db8574c 100644 --- a/test/gencode/butl/bms_testdb-binutil.h +++ b/test/gencode/butl/bms_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include +#include "dbccodeconf.h" -#include +#include "testdb.h" typedef struct { diff --git a/test/gencode/butl/eps_testdb-binutil.h b/test/gencode/butl/eps_testdb-binutil.h index 0abef17..c77b52a 100644 --- a/test/gencode/butl/eps_testdb-binutil.h +++ b/test/gencode/butl/eps_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include +#include "dbccodeconf.h" -#include +#include "testdb.h" // There is no any RX mapped massage. diff --git a/test/gencode/butl/esp_testdb-binutil.h b/test/gencode/butl/esp_testdb-binutil.h index bd3a650..13b8c68 100644 --- a/test/gencode/butl/esp_testdb-binutil.h +++ b/test/gencode/butl/esp_testdb-binutil.h @@ -4,9 +4,9 @@ extern "C" { #endif -#include +#include "dbccodeconf.h" -#include +#include "testdb.h" typedef struct { diff --git a/test/gencode/conf/testdb-config.h b/test/gencode/conf/testdb-config.h index 32485f6..cf92cef 100644 --- a/test/gencode/conf/testdb-config.h +++ b/test/gencode/conf/testdb-config.h @@ -1,7 +1,7 @@ #pragma once /* include common dbccode configurations */ -#include +#include "dbccodeconf.h" /* ------------------------------------------------------------------------- * diff --git a/test/gencode/lib/testdb-fmon.h b/test/gencode/lib/testdb-fmon.h index 9c54c3c..3b4e4e3 100644 --- a/test/gencode/lib/testdb-fmon.h +++ b/test/gencode/lib/testdb-fmon.h @@ -8,11 +8,11 @@ extern "C" { #define VER_TESTDB_MAJ_FMON (1U) #define VER_TESTDB_MIN_FMON (10U) -#include +#include "testdb-config.h" #ifdef TESTDB_USE_DIAG_MONITORS -#include +#include "canmonitorutil.h" /* This file contains the prototypes of all the functions that will be called from each Unpack_*name* function to detect DBC related errors @@ -24,6 +24,7 @@ separated .c file. If it won't be done the linkage error will happen void _FMon_MONO_testdb(FrameMonitor_t* _mon, uint32_t msgid); +#define FMon_NO_SIGS_MSG_testdb(x, y) _FMon_MONO_testdb((x), (y)) #define FMon_UTEST_2_testdb(x, y) _FMon_MONO_testdb((x), (y)) #define FMon_EMPTY_0_testdb(x, y) _FMon_MONO_testdb((x), (y)) #define FMon_UTEST_3_testdb(x, y) _FMon_MONO_testdb((x), (y)) @@ -33,6 +34,7 @@ void _FMon_MONO_testdb(FrameMonitor_t* _mon, uint32_t msgid); #else +void _FMon_NO_SIGS_MSG_testdb(FrameMonitor_t* _mon, uint32_t msgid); void _FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid); void _FMon_EMPTY_0_testdb(FrameMonitor_t* _mon, uint32_t msgid); void _FMon_UTEST_3_testdb(FrameMonitor_t* _mon, uint32_t msgid); @@ -40,6 +42,7 @@ void _FMon_FLT_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); void _FMon_SIG_TEST_1_testdb(FrameMonitor_t* _mon, uint32_t msgid); void _FMon_EMPTY_EXT_ID_testdb(FrameMonitor_t* _mon, uint32_t msgid); +#define FMon_NO_SIGS_MSG_testdb(x, y) _FMon_NO_SIGS_MSG_testdb((x), (y)) #define FMon_UTEST_2_testdb(x, y) _FMon_UTEST_2_testdb((x), (y)) #define FMon_EMPTY_0_testdb(x, y) _FMon_EMPTY_0_testdb((x), (y)) #define FMon_UTEST_3_testdb(x, y) _FMon_UTEST_3_testdb((x), (y)) diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index 4541c55..1a64bb2 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -9,7 +9,7 @@ #ifdef TESTDB_USE_DIAG_MONITORS // Function prototypes to be called each time CAN frame is unpacked // FMon function may detect RC, CRC or DLC violation -#include +#include "testdb-fmon.h" #endif // TESTDB_USE_DIAG_MONITORS @@ -47,12 +47,12 @@ static bitext_t __ext_sig__(ubitext_t val, uint8_t bits) uint32_t Unpack_UTEST_2_testdb(UTEST_2_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; - _m->U28_TEST_1 = ((_d[3] & (0x0FU)) << 24) | ((_d[2] & (0xFFU)) << 16) | ((_d[1] & (0xFFU)) << 8) | (_d[0] & (0xFFU)); - _m->ValTest = ((_d[3] >> 5) & (0x03U)); - _m->U8_TEST_1 = (_d[4] & (0xFFU)); - _m->U7_TEST_1_ro = ((_d[5] >> 1) & (0x7FU)); + _m->U28_TEST_1 = (uint32_t) ( ((_d[3] & (0x0FU)) << 24U) | ((_d[2] & (0xFFU)) << 16U) | ((_d[1] & (0xFFU)) << 8U) | (_d[0] & (0xFFU)) ); + _m->ValTest = (uint8_t) ( ((_d[3] >> 5U) & (0x03U)) ); + _m->U8_TEST_1 = (uint8_t) ( (_d[4] & (0xFFU)) ); + _m->U7_TEST_1_ro = (uint8_t) ( ((_d[5] >> 1U) & (0x7FU)) ); #ifdef TESTDB_USE_SIGFLOAT - _m->U7_TEST_1_phys = TESTDB_U7_TEST_1_ro_fromS(_m->U7_TEST_1_ro); + _m->U7_TEST_1_phys = (int16_t) TESTDB_U7_TEST_1_ro_fromS(_m->U7_TEST_1_ro); #endif // TESTDB_USE_SIGFLOAT #ifdef TESTDB_USE_DIAG_MONITORS @@ -70,22 +70,22 @@ uint32_t Unpack_UTEST_2_testdb(UTEST_2_t* _m, const uint8_t* _d, uint8_t dlc_) uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, __CoderDbcCanFrame_t__* cframe) { - uint8_t i; for (i = 0; (i < UTEST_2_DLC) && (i < 8); cframe->Data[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(UTEST_2_DLC); cframe->Data[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_USE_SIGFLOAT - _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); + _m->U7_TEST_1_ro = (uint8_t) TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); #endif // TESTDB_USE_SIGFLOAT - cframe->Data[0] |= (_m->U28_TEST_1 & (0xFFU)); - cframe->Data[1] |= ((_m->U28_TEST_1 >> 8) & (0xFFU)); - cframe->Data[2] |= ((_m->U28_TEST_1 >> 16) & (0xFFU)); - cframe->Data[3] |= ((_m->U28_TEST_1 >> 24) & (0x0FU)) | ((_m->ValTest & (0x03U)) << 5); - cframe->Data[4] |= (_m->U8_TEST_1 & (0xFFU)); - cframe->Data[5] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + cframe->Data[0] |= (uint8_t) ( (_m->U28_TEST_1 & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( ((_m->U28_TEST_1 >> 8U) & (0xFFU)) ); + cframe->Data[2] |= (uint8_t) ( ((_m->U28_TEST_1 >> 16U) & (0xFFU)) ); + cframe->Data[3] |= (uint8_t) ( ((_m->U28_TEST_1 >> 24U) & (0x0FU)) | ((_m->ValTest & (0x03U)) << 5U) ); + cframe->Data[4] |= (uint8_t) ( (_m->U8_TEST_1 & (0xFFU)) ); + cframe->Data[5] |= (uint8_t) ( ((_m->U7_TEST_1_ro & (0x7FU)) << 1U) ); - cframe->MsgId = UTEST_2_CANID; - cframe->DLC = UTEST_2_DLC; - cframe->IDE = UTEST_2_IDE; + cframe->MsgId = (uint32_t) UTEST_2_CANID; + cframe->DLC = (uint8_t) UTEST_2_DLC; + cframe->IDE = (uint8_t) UTEST_2_IDE; return UTEST_2_CANID; } @@ -93,21 +93,21 @@ uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, __CoderDbcCanFrame_t__* cframe) uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) { - uint8_t i; for (i = 0; (i < UTEST_2_DLC) && (i < 8); _d[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(UTEST_2_DLC); _d[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_USE_SIGFLOAT - _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); + _m->U7_TEST_1_ro = (uint8_t) TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); #endif // TESTDB_USE_SIGFLOAT - _d[0] |= (_m->U28_TEST_1 & (0xFFU)); - _d[1] |= ((_m->U28_TEST_1 >> 8) & (0xFFU)); - _d[2] |= ((_m->U28_TEST_1 >> 16) & (0xFFU)); - _d[3] |= ((_m->U28_TEST_1 >> 24) & (0x0FU)) | ((_m->ValTest & (0x03U)) << 5); - _d[4] |= (_m->U8_TEST_1 & (0xFFU)); - _d[5] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + _d[0] |= (uint8_t) ( (_m->U28_TEST_1 & (0xFFU)) ); + _d[1] |= (uint8_t) ( ((_m->U28_TEST_1 >> 8U) & (0xFFU)) ); + _d[2] |= (uint8_t) ( ((_m->U28_TEST_1 >> 16U) & (0xFFU)) ); + _d[3] |= (uint8_t) ( ((_m->U28_TEST_1 >> 24U) & (0x0FU)) | ((_m->ValTest & (0x03U)) << 5U) ); + _d[4] |= (uint8_t) ( (_m->U8_TEST_1 & (0xFFU)) ); + _d[5] |= (uint8_t) ( ((_m->U7_TEST_1_ro & (0x7FU)) << 1U) ); - *_len = UTEST_2_DLC; - *_ide = UTEST_2_IDE; + *_len = (uint8_t) UTEST_2_DLC; + *_ide = (uint8_t) UTEST_2_IDE; return UTEST_2_CANID; } @@ -116,8 +116,8 @@ uint32_t Pack_UTEST_2_testdb(UTEST_2_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* uint32_t Unpack_EMPTY_0_testdb(EMPTY_0_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; - _m->CS = ((_d[4] >> 1) & (0x3FU)); - _m->RC = ((_d[6] & (0x07U)) << 1) | ((_d[5] >> 7) & (0x01U)); + _m->CS = (uint8_t) ( ((_d[4] >> 1U) & (0x3FU)) ); + _m->RC = (uint8_t) ( ((_d[6] & (0x07U)) << 1U) | ((_d[5] >> 7U) & (0x01U)) ); #ifdef TESTDB_USE_DIAG_MONITORS _m->mon1.dlc_error = (dlc_ < EMPTY_0_DLC); @@ -143,28 +143,28 @@ uint32_t Unpack_EMPTY_0_testdb(EMPTY_0_t* _m, const uint8_t* _d, uint8_t dlc_) uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, __CoderDbcCanFrame_t__* cframe) { - uint8_t i; for (i = 0; (i < EMPTY_0_DLC) && (i < 8); cframe->Data[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(EMPTY_0_DLC); cframe->Data[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_AUTO_ROLL _m->RC = (_m->RC + 1) & (0x0FU); #endif // TESTDB_AUTO_ROLL #ifdef TESTDB_AUTO_CSM - _m->CS = 0U; + _m->CS = (uint8_t) 0; #endif // TESTDB_AUTO_CSM - cframe->Data[4] |= ((_m->CS & (0x3FU)) << 1); - cframe->Data[5] |= ((_m->RC & (0x01U)) << 7); - cframe->Data[6] |= ((_m->RC >> 1) & (0x07U)); + cframe->Data[4] |= (uint8_t) ( ((_m->CS & (0x3FU)) << 1U) ); + cframe->Data[5] |= (uint8_t) ( ((_m->RC & (0x01U)) << 7U) ); + cframe->Data[6] |= (uint8_t) ( ((_m->RC >> 1U) & (0x07U)) ); #ifdef TESTDB_AUTO_CSM _m->CS = ((uint8_t)GetFrameHash(cframe->Data, EMPTY_0_DLC, EMPTY_0_CANID, kXor8, 1)); - cframe->Data[4] |= ((_m->CS & (0x3FU)) << 1); + cframe->Data[4] |= (uint8_t) ( ((_m->CS & (0x3FU)) << 1U) ); #endif // TESTDB_AUTO_CSM - cframe->MsgId = EMPTY_0_CANID; - cframe->DLC = EMPTY_0_DLC; - cframe->IDE = EMPTY_0_IDE; + cframe->MsgId = (uint32_t) EMPTY_0_CANID; + cframe->DLC = (uint8_t) EMPTY_0_DLC; + cframe->IDE = (uint8_t) EMPTY_0_IDE; return EMPTY_0_CANID; } @@ -172,27 +172,27 @@ uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, __CoderDbcCanFrame_t__* cframe) uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) { - uint8_t i; for (i = 0; (i < EMPTY_0_DLC) && (i < 8); _d[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(EMPTY_0_DLC); _d[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_AUTO_ROLL _m->RC = (_m->RC + 1) & (0x0FU); #endif // TESTDB_AUTO_ROLL #ifdef TESTDB_AUTO_CSM - _m->CS = 0U; + _m->CS = (uint8_t) 0; #endif // TESTDB_AUTO_CSM - _d[4] |= ((_m->CS & (0x3FU)) << 1); - _d[5] |= ((_m->RC & (0x01U)) << 7); - _d[6] |= ((_m->RC >> 1) & (0x07U)); + _d[4] |= (uint8_t) ( ((_m->CS & (0x3FU)) << 1U) ); + _d[5] |= (uint8_t) ( ((_m->RC & (0x01U)) << 7U) ); + _d[6] |= (uint8_t) ( ((_m->RC >> 1U) & (0x07U)) ); #ifdef TESTDB_AUTO_CSM _m->CS = ((uint8_t)GetFrameHash(_d, EMPTY_0_DLC, EMPTY_0_CANID, kXor8, 1)); - _d[4] |= ((_m->CS & (0x3FU)) << 1); + _d[4] |= (uint8_t) ( ((_m->CS & (0x3FU)) << 1U) ); #endif // TESTDB_AUTO_CSM - *_len = EMPTY_0_DLC; - *_ide = EMPTY_0_IDE; + *_len = (uint8_t) EMPTY_0_DLC; + *_ide = (uint8_t) EMPTY_0_IDE; return EMPTY_0_CANID; } @@ -201,8 +201,8 @@ uint32_t Pack_EMPTY_0_testdb(EMPTY_0_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* uint32_t Unpack_UTEST_3_testdb(UTEST_3_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; - _m->U32_TEST_1 = ((_d[3] & (0xFFU)) << 24) | ((_d[2] & (0xFFU)) << 16) | ((_d[1] & (0xFFU)) << 8) | (_d[0] & (0xFFU)); - _m->TestValTableID = (_d[4] & (0x07U)); + _m->U32_TEST_1 = (uint32_t) ( ((_d[3] & (0xFFU)) << 24U) | ((_d[2] & (0xFFU)) << 16U) | ((_d[1] & (0xFFU)) << 8U) | (_d[0] & (0xFFU)) ); + _m->TestValTableID = (uint8_t) ( (_d[4] & (0x07U)) ); #ifdef TESTDB_USE_DIAG_MONITORS _m->mon1.dlc_error = (dlc_ < UTEST_3_DLC); @@ -219,17 +219,17 @@ uint32_t Unpack_UTEST_3_testdb(UTEST_3_t* _m, const uint8_t* _d, uint8_t dlc_) uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, __CoderDbcCanFrame_t__* cframe) { - uint8_t i; for (i = 0; (i < UTEST_3_DLC) && (i < 8); cframe->Data[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(UTEST_3_DLC); cframe->Data[i++] = TESTDB_INITIAL_BYTE_VALUE); - cframe->Data[0] |= (_m->U32_TEST_1 & (0xFFU)); - cframe->Data[1] |= ((_m->U32_TEST_1 >> 8) & (0xFFU)); - cframe->Data[2] |= ((_m->U32_TEST_1 >> 16) & (0xFFU)); - cframe->Data[3] |= ((_m->U32_TEST_1 >> 24) & (0xFFU)); - cframe->Data[4] |= (_m->TestValTableID & (0x07U)); + cframe->Data[0] |= (uint8_t) ( (_m->U32_TEST_1 & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( ((_m->U32_TEST_1 >> 8U) & (0xFFU)) ); + cframe->Data[2] |= (uint8_t) ( ((_m->U32_TEST_1 >> 16U) & (0xFFU)) ); + cframe->Data[3] |= (uint8_t) ( ((_m->U32_TEST_1 >> 24U) & (0xFFU)) ); + cframe->Data[4] |= (uint8_t) ( (_m->TestValTableID & (0x07U)) ); - cframe->MsgId = UTEST_3_CANID; - cframe->DLC = UTEST_3_DLC; - cframe->IDE = UTEST_3_IDE; + cframe->MsgId = (uint32_t) UTEST_3_CANID; + cframe->DLC = (uint8_t) UTEST_3_DLC; + cframe->IDE = (uint8_t) UTEST_3_IDE; return UTEST_3_CANID; } @@ -237,16 +237,16 @@ uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, __CoderDbcCanFrame_t__* cframe) uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) { - uint8_t i; for (i = 0; (i < UTEST_3_DLC) && (i < 8); _d[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(UTEST_3_DLC); _d[i++] = TESTDB_INITIAL_BYTE_VALUE); - _d[0] |= (_m->U32_TEST_1 & (0xFFU)); - _d[1] |= ((_m->U32_TEST_1 >> 8) & (0xFFU)); - _d[2] |= ((_m->U32_TEST_1 >> 16) & (0xFFU)); - _d[3] |= ((_m->U32_TEST_1 >> 24) & (0xFFU)); - _d[4] |= (_m->TestValTableID & (0x07U)); + _d[0] |= (uint8_t) ( (_m->U32_TEST_1 & (0xFFU)) ); + _d[1] |= (uint8_t) ( ((_m->U32_TEST_1 >> 8U) & (0xFFU)) ); + _d[2] |= (uint8_t) ( ((_m->U32_TEST_1 >> 16U) & (0xFFU)) ); + _d[3] |= (uint8_t) ( ((_m->U32_TEST_1 >> 24U) & (0xFFU)) ); + _d[4] |= (uint8_t) ( (_m->TestValTableID & (0x07U)) ); - *_len = UTEST_3_DLC; - *_ide = UTEST_3_IDE; + *_len = (uint8_t) UTEST_3_DLC; + *_ide = (uint8_t) UTEST_3_IDE; return UTEST_3_CANID; } @@ -255,38 +255,38 @@ uint32_t Pack_UTEST_3_testdb(UTEST_3_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* uint32_t Unpack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; - _m->ValTable = (_d[0] & (0x03U)); - _m->Position = ((_d[0] >> 4) & (0x0FU)); - _m->INT_TEST_2_ro = __ext_sig__(( ((_d[1] >> 1) & (0x7FU)) ), 7); + _m->ValTable = (uint8_t) ( (_d[0] & (0x03U)) ); + _m->Position = (uint8_t) ( ((_d[0] >> 4U) & (0x0FU)) ); + _m->INT_TEST_2_ro = (int8_t) __ext_sig__(( ((_d[1] >> 1U) & (0x7FU)) ), 7); #ifdef TESTDB_USE_SIGFLOAT - _m->INT_TEST_2_phys = TESTDB_INT_TEST_2_ro_fromS(_m->INT_TEST_2_ro); + _m->INT_TEST_2_phys = (int16_t) TESTDB_INT_TEST_2_ro_fromS(_m->INT_TEST_2_ro); #endif // TESTDB_USE_SIGFLOAT - _m->RC = (_d[2] & (0x0FU)); - _m->CS = ((_d[2] >> 4) & (0x0FU)); - _m->Accel_ro = ((_d[4] & (0x0FU)) << 8) | (_d[3] & (0xFFU)); + _m->RC = (uint8_t) ( (_d[2] & (0x0FU)) ); + _m->CS = (uint8_t) ( ((_d[2] >> 4U) & (0x0FU)) ); + _m->Accel_ro = (uint16_t) ( ((_d[4] & (0x0FU)) << 8U) | (_d[3] & (0xFFU)) ); #ifdef TESTDB_USE_SIGFLOAT _m->Accel_phys = (sigfloat_t)(TESTDB_Accel_ro_fromS(_m->Accel_ro)); #endif // TESTDB_USE_SIGFLOAT - _m->FLT4_TEST_1_ro = ((_d[4] >> 4) & (0x0FU)); + _m->FLT4_TEST_1_ro = (uint8_t) ( ((_d[4] >> 4U) & (0x0FU)) ); #ifdef TESTDB_USE_SIGFLOAT _m->FLT4_TEST_1_phys = (sigfloat_t)(TESTDB_FLT4_TEST_1_ro_fromS(_m->FLT4_TEST_1_ro)); #endif // TESTDB_USE_SIGFLOAT - _m->FLT4_TEST_2_ro = (_d[5] & (0x0FU)); + _m->FLT4_TEST_2_ro = (uint8_t) ( (_d[5] & (0x0FU)) ); #ifdef TESTDB_USE_SIGFLOAT _m->FLT4_TEST_2_phys = (sigfloat_t)(TESTDB_FLT4_TEST_2_ro_fromS(_m->FLT4_TEST_2_ro)); #endif // TESTDB_USE_SIGFLOAT - _m->FLT4_TEST_3_ro = ((_d[5] >> 4) & (0x0FU)); + _m->FLT4_TEST_3_ro = (uint8_t) ( ((_d[5] >> 4U) & (0x0FU)) ); #ifdef TESTDB_USE_SIGFLOAT _m->FLT4_TEST_3_phys = (sigfloat_t)(TESTDB_FLT4_TEST_3_ro_fromS(_m->FLT4_TEST_3_ro)); #endif // TESTDB_USE_SIGFLOAT - _m->INT_TEST_1_ro = ((_d[6] >> 2) & (0x0FU)); + _m->INT_TEST_1_ro = (uint8_t) ( ((_d[6] >> 2U) & (0x0FU)) ); #ifdef TESTDB_USE_SIGFLOAT - _m->INT_TEST_1_phys = TESTDB_INT_TEST_1_ro_fromS(_m->INT_TEST_1_ro); + _m->INT_TEST_1_phys = (int8_t) TESTDB_INT_TEST_1_ro_fromS(_m->INT_TEST_1_ro); #endif // TESTDB_USE_SIGFLOAT #ifdef TESTDB_USE_DIAG_MONITORS @@ -313,41 +313,41 @@ uint32_t Unpack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, const uint8_t* _d, uint8_t d uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe) { - uint8_t i; for (i = 0; (i < FLT_TEST_1_DLC) && (i < 8); cframe->Data[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(FLT_TEST_1_DLC); cframe->Data[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_AUTO_ROLL _m->RC = (_m->RC + 1) & (0x0FU); #endif // TESTDB_AUTO_ROLL #ifdef TESTDB_AUTO_CSM - _m->CS = 0U; + _m->CS = (uint8_t) 0; #endif // TESTDB_AUTO_CSM #ifdef TESTDB_USE_SIGFLOAT - _m->INT_TEST_2_ro = TESTDB_INT_TEST_2_ro_toS(_m->INT_TEST_2_phys); - _m->Accel_ro = TESTDB_Accel_ro_toS(_m->Accel_phys); - _m->FLT4_TEST_1_ro = TESTDB_FLT4_TEST_1_ro_toS(_m->FLT4_TEST_1_phys); - _m->FLT4_TEST_2_ro = TESTDB_FLT4_TEST_2_ro_toS(_m->FLT4_TEST_2_phys); - _m->FLT4_TEST_3_ro = TESTDB_FLT4_TEST_3_ro_toS(_m->FLT4_TEST_3_phys); - _m->INT_TEST_1_ro = TESTDB_INT_TEST_1_ro_toS(_m->INT_TEST_1_phys); + _m->INT_TEST_2_ro = (int8_t) TESTDB_INT_TEST_2_ro_toS(_m->INT_TEST_2_phys); + _m->Accel_ro = (uint16_t) TESTDB_Accel_ro_toS(_m->Accel_phys); + _m->FLT4_TEST_1_ro = (uint8_t) TESTDB_FLT4_TEST_1_ro_toS(_m->FLT4_TEST_1_phys); + _m->FLT4_TEST_2_ro = (uint8_t) TESTDB_FLT4_TEST_2_ro_toS(_m->FLT4_TEST_2_phys); + _m->FLT4_TEST_3_ro = (uint8_t) TESTDB_FLT4_TEST_3_ro_toS(_m->FLT4_TEST_3_phys); + _m->INT_TEST_1_ro = (uint8_t) TESTDB_INT_TEST_1_ro_toS(_m->INT_TEST_1_phys); #endif // TESTDB_USE_SIGFLOAT - cframe->Data[0] |= (_m->ValTable & (0x03U)) | ((_m->Position & (0x0FU)) << 4); - cframe->Data[1] |= ((_m->INT_TEST_2_ro & (0x7FU)) << 1); - cframe->Data[2] |= (_m->RC & (0x0FU)) | ((_m->CS & (0x0FU)) << 4); - cframe->Data[3] |= (_m->Accel_ro & (0xFFU)); - cframe->Data[4] |= ((_m->Accel_ro >> 8) & (0x0FU)) | ((_m->FLT4_TEST_1_ro & (0x0FU)) << 4); - cframe->Data[5] |= (_m->FLT4_TEST_2_ro & (0x0FU)) | ((_m->FLT4_TEST_3_ro & (0x0FU)) << 4); - cframe->Data[6] |= ((_m->INT_TEST_1_ro & (0x0FU)) << 2); + cframe->Data[0] |= (uint8_t) ( (_m->ValTable & (0x03U)) | ((_m->Position & (0x0FU)) << 4U) ); + cframe->Data[1] |= (uint8_t) ( ((_m->INT_TEST_2_ro & (0x7FU)) << 1U) ); + cframe->Data[2] |= (uint8_t) ( (_m->RC & (0x0FU)) | ((_m->CS & (0x0FU)) << 4U) ); + cframe->Data[3] |= (uint8_t) ( (_m->Accel_ro & (0xFFU)) ); + cframe->Data[4] |= (uint8_t) ( ((_m->Accel_ro >> 8U) & (0x0FU)) | ((_m->FLT4_TEST_1_ro & (0x0FU)) << 4U) ); + cframe->Data[5] |= (uint8_t) ( (_m->FLT4_TEST_2_ro & (0x0FU)) | ((_m->FLT4_TEST_3_ro & (0x0FU)) << 4U) ); + cframe->Data[6] |= (uint8_t) ( ((_m->INT_TEST_1_ro & (0x0FU)) << 2U) ); #ifdef TESTDB_AUTO_CSM _m->CS = ((uint8_t)GetFrameHash(cframe->Data, FLT_TEST_1_DLC, FLT_TEST_1_CANID, kXor4, 1)); - cframe->Data[2] |= ((_m->CS & (0x0FU)) << 4); + cframe->Data[2] |= (uint8_t) ( ((_m->CS & (0x0FU)) << 4U) ); #endif // TESTDB_AUTO_CSM - cframe->MsgId = FLT_TEST_1_CANID; - cframe->DLC = FLT_TEST_1_DLC; - cframe->IDE = FLT_TEST_1_IDE; + cframe->MsgId = (uint32_t) FLT_TEST_1_CANID; + cframe->DLC = (uint8_t) FLT_TEST_1_DLC; + cframe->IDE = (uint8_t) FLT_TEST_1_IDE; return FLT_TEST_1_CANID; } @@ -355,40 +355,40 @@ uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) { - uint8_t i; for (i = 0; (i < FLT_TEST_1_DLC) && (i < 8); _d[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(FLT_TEST_1_DLC); _d[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_AUTO_ROLL _m->RC = (_m->RC + 1) & (0x0FU); #endif // TESTDB_AUTO_ROLL #ifdef TESTDB_AUTO_CSM - _m->CS = 0U; + _m->CS = (uint8_t) 0; #endif // TESTDB_AUTO_CSM #ifdef TESTDB_USE_SIGFLOAT - _m->INT_TEST_2_ro = TESTDB_INT_TEST_2_ro_toS(_m->INT_TEST_2_phys); - _m->Accel_ro = TESTDB_Accel_ro_toS(_m->Accel_phys); - _m->FLT4_TEST_1_ro = TESTDB_FLT4_TEST_1_ro_toS(_m->FLT4_TEST_1_phys); - _m->FLT4_TEST_2_ro = TESTDB_FLT4_TEST_2_ro_toS(_m->FLT4_TEST_2_phys); - _m->FLT4_TEST_3_ro = TESTDB_FLT4_TEST_3_ro_toS(_m->FLT4_TEST_3_phys); - _m->INT_TEST_1_ro = TESTDB_INT_TEST_1_ro_toS(_m->INT_TEST_1_phys); + _m->INT_TEST_2_ro = (int8_t) TESTDB_INT_TEST_2_ro_toS(_m->INT_TEST_2_phys); + _m->Accel_ro = (uint16_t) TESTDB_Accel_ro_toS(_m->Accel_phys); + _m->FLT4_TEST_1_ro = (uint8_t) TESTDB_FLT4_TEST_1_ro_toS(_m->FLT4_TEST_1_phys); + _m->FLT4_TEST_2_ro = (uint8_t) TESTDB_FLT4_TEST_2_ro_toS(_m->FLT4_TEST_2_phys); + _m->FLT4_TEST_3_ro = (uint8_t) TESTDB_FLT4_TEST_3_ro_toS(_m->FLT4_TEST_3_phys); + _m->INT_TEST_1_ro = (uint8_t) TESTDB_INT_TEST_1_ro_toS(_m->INT_TEST_1_phys); #endif // TESTDB_USE_SIGFLOAT - _d[0] |= (_m->ValTable & (0x03U)) | ((_m->Position & (0x0FU)) << 4); - _d[1] |= ((_m->INT_TEST_2_ro & (0x7FU)) << 1); - _d[2] |= (_m->RC & (0x0FU)) | ((_m->CS & (0x0FU)) << 4); - _d[3] |= (_m->Accel_ro & (0xFFU)); - _d[4] |= ((_m->Accel_ro >> 8) & (0x0FU)) | ((_m->FLT4_TEST_1_ro & (0x0FU)) << 4); - _d[5] |= (_m->FLT4_TEST_2_ro & (0x0FU)) | ((_m->FLT4_TEST_3_ro & (0x0FU)) << 4); - _d[6] |= ((_m->INT_TEST_1_ro & (0x0FU)) << 2); + _d[0] |= (uint8_t) ( (_m->ValTable & (0x03U)) | ((_m->Position & (0x0FU)) << 4U) ); + _d[1] |= (uint8_t) ( ((_m->INT_TEST_2_ro & (0x7FU)) << 1U) ); + _d[2] |= (uint8_t) ( (_m->RC & (0x0FU)) | ((_m->CS & (0x0FU)) << 4U) ); + _d[3] |= (uint8_t) ( (_m->Accel_ro & (0xFFU)) ); + _d[4] |= (uint8_t) ( ((_m->Accel_ro >> 8U) & (0x0FU)) | ((_m->FLT4_TEST_1_ro & (0x0FU)) << 4U) ); + _d[5] |= (uint8_t) ( (_m->FLT4_TEST_2_ro & (0x0FU)) | ((_m->FLT4_TEST_3_ro & (0x0FU)) << 4U) ); + _d[6] |= (uint8_t) ( ((_m->INT_TEST_1_ro & (0x0FU)) << 2U) ); #ifdef TESTDB_AUTO_CSM _m->CS = ((uint8_t)GetFrameHash(_d, FLT_TEST_1_DLC, FLT_TEST_1_CANID, kXor4, 1)); - _d[2] |= ((_m->CS & (0x0FU)) << 4); + _d[2] |= (uint8_t) ( ((_m->CS & (0x0FU)) << 4U) ); #endif // TESTDB_AUTO_CSM - *_len = FLT_TEST_1_DLC; - *_ide = FLT_TEST_1_IDE; + *_len = (uint8_t) FLT_TEST_1_DLC; + *_ide = (uint8_t) FLT_TEST_1_IDE; return FLT_TEST_1_CANID; } @@ -397,29 +397,29 @@ uint32_t Pack_FLT_TEST_1_testdb(FLT_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, ui uint32_t Unpack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; - _m->sig15_ro = __ext_sig__(( ((_d[1] & (0x7FU)) << 8) | (_d[0] & (0xFFU)) ), 15); + _m->sig15_ro = (int16_t) __ext_sig__(( ((_d[1] & (0x7FU)) << 8U) | (_d[0] & (0xFFU)) ), 15); #ifdef TESTDB_USE_SIGFLOAT - _m->sig15_phys = TESTDB_sig15_ro_fromS(_m->sig15_ro); + _m->sig15_phys = (int32_t) TESTDB_sig15_ro_fromS(_m->sig15_ro); #endif // TESTDB_USE_SIGFLOAT - _m->sig15_2_ro = __ext_sig__(( ((_d[3] & (0x7FU)) << 8) | (_d[2] & (0xFFU)) ), 15); + _m->sig15_2_ro = (int16_t) __ext_sig__(( ((_d[3] & (0x7FU)) << 8U) | (_d[2] & (0xFFU)) ), 15); #ifdef TESTDB_USE_SIGFLOAT _m->sig15_2_phys = (sigfloat_t)(TESTDB_sig15_2_ro_fromS(_m->sig15_2_ro)); #endif // TESTDB_USE_SIGFLOAT - _m->sig8_ro = __ext_sig__(( (_d[4] & (0xFFU)) ), 8); + _m->sig8_ro = (int8_t) __ext_sig__(( (_d[4] & (0xFFU)) ), 8); #ifdef TESTDB_USE_SIGFLOAT - _m->sig8_phys = TESTDB_sig8_ro_fromS(_m->sig8_ro); + _m->sig8_phys = (int16_t) TESTDB_sig8_ro_fromS(_m->sig8_ro); #endif // TESTDB_USE_SIGFLOAT - _m->sig_7_ro = __ext_sig__(( (_d[5] & (0x7FU)) ), 7); + _m->sig_7_ro = (int8_t) __ext_sig__(( (_d[5] & (0x7FU)) ), 7); #ifdef TESTDB_USE_SIGFLOAT _m->sig_7_phys = (sigfloat_t)(TESTDB_sig_7_ro_fromS(_m->sig_7_ro)); #endif // TESTDB_USE_SIGFLOAT - _m->U7_TEST_1_ro = ((_d[6] >> 1) & (0x7FU)); + _m->U7_TEST_1_ro = (uint8_t) ( ((_d[6] >> 1U) & (0x7FU)) ); #ifdef TESTDB_USE_SIGFLOAT - _m->U7_TEST_1_phys = TESTDB_U7_TEST_1_ro_fromS(_m->U7_TEST_1_ro); + _m->U7_TEST_1_phys = (int16_t) TESTDB_U7_TEST_1_ro_fromS(_m->U7_TEST_1_ro); #endif // TESTDB_USE_SIGFLOAT #ifdef TESTDB_USE_DIAG_MONITORS @@ -437,27 +437,27 @@ uint32_t Unpack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, const uint8_t* _d, uint8_t d uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe) { - uint8_t i; for (i = 0; (i < SIG_TEST_1_DLC) && (i < 8); cframe->Data[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(SIG_TEST_1_DLC); cframe->Data[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_USE_SIGFLOAT - _m->sig15_ro = TESTDB_sig15_ro_toS(_m->sig15_phys); - _m->sig15_2_ro = TESTDB_sig15_2_ro_toS(_m->sig15_2_phys); - _m->sig8_ro = TESTDB_sig8_ro_toS(_m->sig8_phys); - _m->sig_7_ro = TESTDB_sig_7_ro_toS(_m->sig_7_phys); - _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); + _m->sig15_ro = (int16_t) TESTDB_sig15_ro_toS(_m->sig15_phys); + _m->sig15_2_ro = (int16_t) TESTDB_sig15_2_ro_toS(_m->sig15_2_phys); + _m->sig8_ro = (int8_t) TESTDB_sig8_ro_toS(_m->sig8_phys); + _m->sig_7_ro = (int8_t) TESTDB_sig_7_ro_toS(_m->sig_7_phys); + _m->U7_TEST_1_ro = (uint8_t) TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); #endif // TESTDB_USE_SIGFLOAT - cframe->Data[0] |= (_m->sig15_ro & (0xFFU)); - cframe->Data[1] |= ((_m->sig15_ro >> 8) & (0x7FU)); - cframe->Data[2] |= (_m->sig15_2_ro & (0xFFU)); - cframe->Data[3] |= ((_m->sig15_2_ro >> 8) & (0x7FU)); - cframe->Data[4] |= (_m->sig8_ro & (0xFFU)); - cframe->Data[5] |= (_m->sig_7_ro & (0x7FU)); - cframe->Data[6] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); - - cframe->MsgId = SIG_TEST_1_CANID; - cframe->DLC = SIG_TEST_1_DLC; - cframe->IDE = SIG_TEST_1_IDE; + cframe->Data[0] |= (uint8_t) ( (_m->sig15_ro & (0xFFU)) ); + cframe->Data[1] |= (uint8_t) ( ((_m->sig15_ro >> 8U) & (0x7FU)) ); + cframe->Data[2] |= (uint8_t) ( (_m->sig15_2_ro & (0xFFU)) ); + cframe->Data[3] |= (uint8_t) ( ((_m->sig15_2_ro >> 8U) & (0x7FU)) ); + cframe->Data[4] |= (uint8_t) ( (_m->sig8_ro & (0xFFU)) ); + cframe->Data[5] |= (uint8_t) ( (_m->sig_7_ro & (0x7FU)) ); + cframe->Data[6] |= (uint8_t) ( ((_m->U7_TEST_1_ro & (0x7FU)) << 1U) ); + + cframe->MsgId = (uint32_t) SIG_TEST_1_CANID; + cframe->DLC = (uint8_t) SIG_TEST_1_DLC; + cframe->IDE = (uint8_t) SIG_TEST_1_IDE; return SIG_TEST_1_CANID; } @@ -465,26 +465,26 @@ uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, __CoderDbcCanFrame_t__* cframe uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) { - uint8_t i; for (i = 0; (i < SIG_TEST_1_DLC) && (i < 8); _d[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(SIG_TEST_1_DLC); _d[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_USE_SIGFLOAT - _m->sig15_ro = TESTDB_sig15_ro_toS(_m->sig15_phys); - _m->sig15_2_ro = TESTDB_sig15_2_ro_toS(_m->sig15_2_phys); - _m->sig8_ro = TESTDB_sig8_ro_toS(_m->sig8_phys); - _m->sig_7_ro = TESTDB_sig_7_ro_toS(_m->sig_7_phys); - _m->U7_TEST_1_ro = TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); + _m->sig15_ro = (int16_t) TESTDB_sig15_ro_toS(_m->sig15_phys); + _m->sig15_2_ro = (int16_t) TESTDB_sig15_2_ro_toS(_m->sig15_2_phys); + _m->sig8_ro = (int8_t) TESTDB_sig8_ro_toS(_m->sig8_phys); + _m->sig_7_ro = (int8_t) TESTDB_sig_7_ro_toS(_m->sig_7_phys); + _m->U7_TEST_1_ro = (uint8_t) TESTDB_U7_TEST_1_ro_toS(_m->U7_TEST_1_phys); #endif // TESTDB_USE_SIGFLOAT - _d[0] |= (_m->sig15_ro & (0xFFU)); - _d[1] |= ((_m->sig15_ro >> 8) & (0x7FU)); - _d[2] |= (_m->sig15_2_ro & (0xFFU)); - _d[3] |= ((_m->sig15_2_ro >> 8) & (0x7FU)); - _d[4] |= (_m->sig8_ro & (0xFFU)); - _d[5] |= (_m->sig_7_ro & (0x7FU)); - _d[6] |= ((_m->U7_TEST_1_ro & (0x7FU)) << 1); + _d[0] |= (uint8_t) ( (_m->sig15_ro & (0xFFU)) ); + _d[1] |= (uint8_t) ( ((_m->sig15_ro >> 8U) & (0x7FU)) ); + _d[2] |= (uint8_t) ( (_m->sig15_2_ro & (0xFFU)) ); + _d[3] |= (uint8_t) ( ((_m->sig15_2_ro >> 8U) & (0x7FU)) ); + _d[4] |= (uint8_t) ( (_m->sig8_ro & (0xFFU)) ); + _d[5] |= (uint8_t) ( (_m->sig_7_ro & (0x7FU)) ); + _d[6] |= (uint8_t) ( ((_m->U7_TEST_1_ro & (0x7FU)) << 1U) ); - *_len = SIG_TEST_1_DLC; - *_ide = SIG_TEST_1_IDE; + *_len = (uint8_t) SIG_TEST_1_DLC; + *_ide = (uint8_t) SIG_TEST_1_IDE; return SIG_TEST_1_CANID; } @@ -493,8 +493,8 @@ uint32_t Pack_SIG_TEST_1_testdb(SIG_TEST_1_t* _m, uint8_t* _d, uint8_t* _len, ui uint32_t Unpack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, const uint8_t* _d, uint8_t dlc_) { (void)dlc_; - _m->ValTest = ((_d[0] >> 6) & (0x03U)); - _m->CS = (_d[1] & (0x3FU)); + _m->ValTest = (uint8_t) ( ((_d[0] >> 6U) & (0x03U)) ); + _m->CS = (uint8_t) ( (_d[1] & (0x3FU)) ); #ifdef TESTDB_USE_DIAG_MONITORS _m->mon1.dlc_error = (dlc_ < EMPTY_EXT_ID_DLC); @@ -515,23 +515,23 @@ uint32_t Unpack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, const uint8_t* _d, uint8 uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, __CoderDbcCanFrame_t__* cframe) { - uint8_t i; for (i = 0; (i < EMPTY_EXT_ID_DLC) && (i < 8); cframe->Data[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(EMPTY_EXT_ID_DLC); cframe->Data[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_AUTO_CSM - _m->CS = 0U; + _m->CS = (uint8_t) 0; #endif // TESTDB_AUTO_CSM - cframe->Data[0] |= ((_m->ValTest & (0x03U)) << 6); - cframe->Data[1] |= (_m->CS & (0x3FU)); + cframe->Data[0] |= (uint8_t) ( ((_m->ValTest & (0x03U)) << 6U) ); + cframe->Data[1] |= (uint8_t) ( (_m->CS & (0x3FU)) ); #ifdef TESTDB_AUTO_CSM _m->CS = ((uint8_t)GetFrameHash(cframe->Data, EMPTY_EXT_ID_DLC, EMPTY_EXT_ID_CANID, kXor8, 1)); - cframe->Data[1] |= (_m->CS & (0x3FU)); + cframe->Data[1] |= (uint8_t) ( (_m->CS & (0x3FU)) ); #endif // TESTDB_AUTO_CSM - cframe->MsgId = EMPTY_EXT_ID_CANID; - cframe->DLC = EMPTY_EXT_ID_DLC; - cframe->IDE = EMPTY_EXT_ID_IDE; + cframe->MsgId = (uint32_t) EMPTY_EXT_ID_CANID; + cframe->DLC = (uint8_t) EMPTY_EXT_ID_DLC; + cframe->IDE = (uint8_t) EMPTY_EXT_ID_IDE; return EMPTY_EXT_ID_CANID; } @@ -539,22 +539,22 @@ uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, __CoderDbcCanFrame_t__* cf uint32_t Pack_EMPTY_EXT_ID_testdb(EMPTY_EXT_ID_t* _m, uint8_t* _d, uint8_t* _len, uint8_t* _ide) { - uint8_t i; for (i = 0; (i < EMPTY_EXT_ID_DLC) && (i < 8); _d[i++] = 0); + uint8_t i; for (i = 0u; i < TESTDB_VALIDATE_DLC(EMPTY_EXT_ID_DLC); _d[i++] = TESTDB_INITIAL_BYTE_VALUE); #ifdef TESTDB_AUTO_CSM - _m->CS = 0U; + _m->CS = (uint8_t) 0; #endif // TESTDB_AUTO_CSM - _d[0] |= ((_m->ValTest & (0x03U)) << 6); - _d[1] |= (_m->CS & (0x3FU)); + _d[0] |= (uint8_t) ( ((_m->ValTest & (0x03U)) << 6U) ); + _d[1] |= (uint8_t) ( (_m->CS & (0x3FU)) ); #ifdef TESTDB_AUTO_CSM _m->CS = ((uint8_t)GetFrameHash(_d, EMPTY_EXT_ID_DLC, EMPTY_EXT_ID_CANID, kXor8, 1)); - _d[1] |= (_m->CS & (0x3FU)); + _d[1] |= (uint8_t) ( (_m->CS & (0x3FU)) ); #endif // TESTDB_AUTO_CSM - *_len = EMPTY_EXT_ID_DLC; - *_ide = EMPTY_EXT_ID_IDE; + *_len = (uint8_t) EMPTY_EXT_ID_DLC; + *_ide = (uint8_t) EMPTY_EXT_ID_IDE; return EMPTY_EXT_ID_CANID; } diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 29e6799..7ea9a08 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -11,20 +11,44 @@ extern "C" { #define VER_TESTDB_MIN (10U) // include current dbc-driver compilation config -#include +#include "testdb-config.h" #ifdef TESTDB_USE_DIAG_MONITORS // This file must define: // base monitor struct -#include +#include "canmonitorutil.h" #endif // TESTDB_USE_DIAG_MONITORS +// DLC maximum value which is used as the limit for frame's data buffer size. +// Client can set its own value (not sure why) in driver-config +// or can test it on some limit specified by application +// e.g.: static_assert(TESTDB_MAX_DLC_VALUE <= APPLICATION_FRAME_DATA_SIZE, "Max DLC value in the driver is too big") +#ifndef TESTDB_MAX_DLC_VALUE +// The value which was found out by generator (real max value) +#define TESTDB_MAX_DLC_VALUE 8U +#endif + +// The limit is used for setting frame's data bytes +#define TESTDB_VALIDATE_DLC(msgDlc) (((msgDlc) <= (TESTDB_MAX_DLC_VALUE)) ? (msgDlc) : (TESTDB_MAX_DLC_VALUE)) + +// Initial byte value to be filles in data bytes of the frame before pack signals +// User can define its own custom value in driver-config file +#ifndef TESTDB_INITIAL_BYTE_VALUE +#define TESTDB_INITIAL_BYTE_VALUE 0U +#endif + + +// def @NO_SIGS_MSG CAN Message (273 0x111) +#define NO_SIGS_MSG_IDE (0U) +#define NO_SIGS_MSG_DLC (8U) +#define NO_SIGS_MSG_CANID (0x111U) + // def @UTEST_2 CAN Message (333 0x14d) #define UTEST_2_IDE (0U) #define UTEST_2_DLC (8U) -#define UTEST_2_CANID (0x14d) +#define UTEST_2_CANID (0x14dU) // Value tables for @ValTest signal @@ -114,7 +138,7 @@ typedef struct // def @EMPTY_0 CAN Message (352 0x160) #define EMPTY_0_IDE (0U) #define EMPTY_0_DLC (8U) -#define EMPTY_0_CANID (0x160) +#define EMPTY_0_CANID (0x160U) #define EMPTY_0_CYC (101U) typedef struct @@ -160,7 +184,7 @@ typedef struct // def @UTEST_3 CAN Message (555 0x22b) #define UTEST_3_IDE (0U) #define UTEST_3_DLC (8U) -#define UTEST_3_CANID (0x22b) +#define UTEST_3_CANID (0x22bU) // Value tables for @TestValTableID signal @@ -246,7 +270,7 @@ typedef struct // def @FLT_TEST_1 CAN Message (864 0x360) #define FLT_TEST_1_IDE (0U) #define FLT_TEST_1_DLC (8U) -#define FLT_TEST_1_CANID (0x360) +#define FLT_TEST_1_CANID (0x360U) #define FLT_TEST_1_CYC (101U) // Value tables for @ValTable signal @@ -427,7 +451,7 @@ typedef struct // def @SIG_TEST_1 CAN Message (1911 0x777) #define SIG_TEST_1_IDE (0U) #define SIG_TEST_1_DLC (8U) -#define SIG_TEST_1_CANID (0x777) +#define SIG_TEST_1_CANID (0x777U) // signal: @sig15_ro #define TESTDB_sig15_ro_CovFactor (3) #define TESTDB_sig15_ro_toS(x) ( (int16_t) (((x) - (-1024)) / (3)) ) @@ -524,7 +548,7 @@ typedef struct // def @EMPTY_EXT_ID CAN Message (536870902 0x1ffffff6) #define EMPTY_EXT_ID_IDE (1U) #define EMPTY_EXT_ID_DLC (8U) -#define EMPTY_EXT_ID_CANID (0x1ffffff6) +#define EMPTY_EXT_ID_CANID (0x1ffffff6U) // Value tables for @ValTest signal diff --git a/test/gencode/usr/testdb-fmon.c b/test/gencode/usr/testdb-fmon.c index 9d33445..ecf5b20 100644 --- a/test/gencode/usr/testdb-fmon.c +++ b/test/gencode/usr/testdb-fmon.c @@ -1,4 +1,4 @@ -#include +#include "testdb-fmon.h" #ifdef TESTDB_USE_DIAG_MONITORS @@ -17,6 +17,12 @@ void _FMon_MONO_testdb(FrameMonitor_t* _mon, uint32_t msgid) #else +void _FMon_NO_SIGS_MSG_testdb(FrameMonitor_t* _mon, uint32_t msgid) +{ + (void)_mon; + (void)msgid; +} + void _FMon_UTEST_2_testdb(FrameMonitor_t* _mon, uint32_t msgid) { (void)_mon; diff --git a/test/testdb.dbc b/test/testdb.dbc old mode 100755 new mode 100644 index cbbc77f..c0d818b --- a/test/testdb.dbc +++ b/test/testdb.dbc @@ -37,6 +37,8 @@ BU_: EPS ESP BMS BCM VAL_TABLE_ VtTestSig -2 "Description for the value '0x7'" -1 "Udef" 6 "Udef" 5 "Udef" 4 "Udef" 3 "Error" 2 "Ok" 1 "State one" 0 "State 1" ; +BO_ 273 NO_SIGS_MSG: 8 BCM + BO_ 1911 SIG_TEST_1: 8 EPS SG_ U7_TEST_1 : 55|7@0+ (1,-255) [-255|-128] "" BCM SG_ sig_7 : 40|7@1- (1.2,0) [-76.8|75.6] "" BCM @@ -122,10 +124,10 @@ BA_DEF_DEF_ "GenSigInactiveValue" 0; BA_DEF_DEF_ "GenSigStartValue" 0; BA_ "DBName" "ceedselector"; BA_ "GenMsgSendType" BO_ 2684354550 0; -BA_ "GenMsgSendType" BO_ 864 0; BA_ "GenMsgCycleTime" BO_ 864 101; -BA_ "GenMsgSendType" BO_ 352 0; +BA_ "GenMsgSendType" BO_ 864 0; BA_ "GenMsgCycleTime" BO_ 352 101; +BA_ "GenMsgSendType" BO_ 352 0; BA_ "GenSigStartValue" SG_ 1911 sig15_2 1315.78947368421; BA_ "GenSigStartValue" SG_ 1911 sig15 341.333333333333; BA_ "GenSigStartValue" SG_ 864 INT_TEST_2 0.6; From 023fd9991d6428b8fdbfbad6e330d090acd16c96 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 9 Oct 2023 16:11:57 +0300 Subject: [PATCH 171/181] Set version v3.0 --- src/codegen/version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/version.h b/src/codegen/version.h index 3bdbbff..385e841 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -2,5 +2,5 @@ #include -#define CODEGEN_LIB_VERSION_MAJ (2) -#define CODEGEN_LIB_VERSION_MIN (9) +#define CODEGEN_LIB_VERSION_MAJ (3) +#define CODEGEN_LIB_VERSION_MIN (0) From 4d0d2b04afbf11e66cc38ec24b82da387a4144dd Mon Sep 17 00:00:00 2001 From: astand Date: Tue, 26 Dec 2023 21:32:18 +0300 Subject: [PATCH 172/181] Added support for CAN FD 64 byte payload length --- docs/RELEASES.md | 4 ++++ src/codegen/c-sigprinter.cpp | 5 +++-- src/codegen/version.h | 2 +- src/conf-and-limits.h | 9 +++++++++ src/parser/dbclineparser.cpp | 7 ++++--- 5 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 src/conf-and-limits.h diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 1a6ebf7..154afb5 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Added + +- CAN FD frames with max DLC (64 bytes) are supported + ## [v3.0] - 2023-10-09 ### Added diff --git a/src/codegen/c-sigprinter.cpp b/src/codegen/c-sigprinter.cpp index 2ec3c5e..3ea51cd 100644 --- a/src/codegen/c-sigprinter.cpp +++ b/src/codegen/c-sigprinter.cpp @@ -2,6 +2,7 @@ #include #include "c-sigprinter.h" #include "helpers/formatter.h" +#include "conf-and-limits.h" // work buffer for all snprintf operations static const size_t WBUFF_LEN = 2048; @@ -190,9 +191,9 @@ std::string CSigPrinter::PrintSignalExpr(const SignalDescriptor_t* sig, std::vec uint16_t startb = (uint16_t)((sig->Order == BitLayout::kIntel) ? (sig->StartBit + (sig->LengthBit - 1)) : (sig->StartBit)); - if (startb > 63) + if (startb > CONF_LIMIT_HIGHEST_BIT_POSITION) { - startb = 63; + startb = CONF_LIMIT_HIGHEST_BIT_POSITION; } uint32_t bn = (startb / 8); diff --git a/src/codegen/version.h b/src/codegen/version.h index 385e841..6e1b24e 100644 --- a/src/codegen/version.h +++ b/src/codegen/version.h @@ -3,4 +3,4 @@ #include #define CODEGEN_LIB_VERSION_MAJ (3) -#define CODEGEN_LIB_VERSION_MIN (0) +#define CODEGEN_LIB_VERSION_MIN (1) diff --git a/src/conf-and-limits.h b/src/conf-and-limits.h new file mode 100644 index 0000000..89637a1 --- /dev/null +++ b/src/conf-and-limits.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +//! Maximum length of CAN frame payload in bytes +#define CONF_LIMIT_MAX_DLC 64u + +//! The highest possible bit position based on MAX Data size +#define CONF_LIMIT_HIGHEST_BIT_POSITION (CONF_LIMIT_MAX_DLC * 8u) - 1u diff --git a/src/parser/dbclineparser.cpp b/src/parser/dbclineparser.cpp index 6473613..d676f16 100644 --- a/src/parser/dbclineparser.cpp +++ b/src/parser/dbclineparser.cpp @@ -1,10 +1,11 @@ -#include "dbclineparser.h" -#include #include #include #include #include #include +#include "helpers/formatter.h" +#include "dbclineparser.h" +#include "conf-and-limits.h" /// @brief Minimal possible value for Factor/Offset constexpr double MIN_FAC_OFF = 0.000000001; @@ -136,7 +137,7 @@ bool DbcLineParser::ParseMessageLine(MessageDescriptor_t* msg, const std::string msg->DLC = atoi(items[4].c_str()); - if ((msg->MsgID & 0x60000000) != 0 || msg->DLC == 0 || msg->DLC > 8) + if ((msg->MsgID & 0x60000000) != 0 || msg->DLC == 0 || msg->DLC > CONF_LIMIT_MAX_DLC) { return false; } From 3499a5331c8de23a2b81705aded475391cd64710 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 29 Dec 2023 08:07:50 +0300 Subject: [PATCH 173/181] Fixed issue with using strlen result for constexprt --- src/parser/dbcscanner.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index e9e9e13..4856271 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -340,9 +340,12 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) void DbcScanner::FindVersion(const std::string& instr) { - // try to find version string which looks like: VERSION "x.x" - static constexpr char* versionAttr = (char*)"VERSION"; - static constexpr size_t VER_MIN_LENGTH = strlen(versionAttr); + #define VERSION_DBC_STRING "VERSION" + + static constexpr char* versionAttr = (char*)VERSION_DBC_STRING; + // sizeof on string literal returns size with null termination + static constexpr size_t VER_MIN_LENGTH = (sizeof(VERSION_DBC_STRING) - 1); + static_assert(VER_MIN_LENGTH == 7u, "Please check the dbc version string marker"); uint32_t h = 0, l = 0; char marker[VER_MIN_LENGTH + 1u]; @@ -352,6 +355,7 @@ void DbcScanner::FindVersion(const std::string& instr) return; } + // try to find dbc version marker which looks like: VERSION "x.x" auto ret = std::sscanf(instr.c_str(), "%8s \"%u.%u\"", marker, &h, &l); if ((ret == 3) && (std::strcmp(marker, versionAttr) == 0)) From acd7b3883f4c3e0ad236a391adfc92dbe957d6bb Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 8 Jan 2024 06:45:14 +0300 Subject: [PATCH 174/181] More strict type casts in 'bitext' operation --- src/codegen/c-main-generator.cpp | 8 ++++---- src/tests/bitext-test.cpp | 4 ++-- test/gencode/lib/testdb.c | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index 0bcec02..dd3eed8 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -18,8 +18,8 @@ const char* ext_sig_func_name = "__ext_sig__"; const char* extend_func_body = "// This function performs extension of sign for the signals\n" - "// which have non-aligned to power of 2 bit's width.\n" - "// The types 'bitext_t' and 'ubitext_t' define maximal bit width which\n" + "// whose bit width value is not aligned to one of power of 2 or less than 8.\n" + "// The types 'bitext_t' and 'ubitext_t' define the biggest bit width which\n" "// can be correctly handled. You need to select type which can contain\n" "// n+1 bits where n is the largest signed signal width. For example if\n" "// the most wide signed signal has a width of 31 bits you need to set\n" @@ -27,8 +27,8 @@ const char* extend_func_body = "// Defined these typedefs in @dbccodeconf.h or locally in 'dbcdrvname'-config.h\n" "static bitext_t %s(ubitext_t val, uint8_t bits)\n" "{\n" - " ubitext_t const m = 1u << (bits - 1);\n" - " return (val ^ m) - m;\n" + " ubitext_t const m = (ubitext_t) (1u << (bits - 1u));\n" + " return ((val ^ m) - m);\n" "}\n\n"; void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd) diff --git a/src/tests/bitext-test.cpp b/src/tests/bitext-test.cpp index 11ac7e1..b136411 100644 --- a/src/tests/bitext-test.cpp +++ b/src/tests/bitext-test.cpp @@ -4,8 +4,8 @@ template static iT bitext(uT val, uint8_t bits) { - uT const m = 1u << (bits - 1); - return (val ^ m) - m; + uT const m = (uT)(1u << (bits - 1u)); + return ((val ^ m) - m); } TEST(TestBitExt, FullTest) diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index 1a64bb2..a79a682 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -31,8 +31,8 @@ #endif // This function performs extension of sign for the signals -// which have non-aligned to power of 2 bit's width. -// The types 'bitext_t' and 'ubitext_t' define maximal bit width which +// whose bit width value is not aligned to one of power of 2 or less than 8. +// The types 'bitext_t' and 'ubitext_t' define the biggest bit width which // can be correctly handled. You need to select type which can contain // n+1 bits where n is the largest signed signal width. For example if // the most wide signed signal has a width of 31 bits you need to set @@ -40,8 +40,8 @@ // Defined these typedefs in @dbccodeconf.h or locally in 'dbcdrvname'-config.h static bitext_t __ext_sig__(ubitext_t val, uint8_t bits) { - ubitext_t const m = 1u << (bits - 1); - return (val ^ m) - m; + ubitext_t const m = (ubitext_t) (1u << (bits - 1u)); + return ((val ^ m) - m); } uint32_t Unpack_UTEST_2_testdb(UTEST_2_t* _m, const uint8_t* _d, uint8_t dlc_) From 70662a3fcdfa78a78da2bf2aa625079c23feacf7 Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 8 Jan 2024 06:45:35 +0300 Subject: [PATCH 175/181] Fixed windows script for testdb generation --- run-test-gen.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-test-gen.bat b/run-test-gen.bat index 0c38fdb..1dfe93a 100755 --- a/run-test-gen.bat +++ b/run-test-gen.bat @@ -1,2 +1,2 @@ -start "coder" "build-win/Release/coderdbc.exe" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw +start "coder" "build/coderdbc.exe" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw pause \ No newline at end of file From 2774fecf3bfce8fa5fc07c4b95386b03fe652f5e Mon Sep 17 00:00:00 2001 From: astand Date: Mon, 8 Jan 2024 06:47:29 +0300 Subject: [PATCH 176/181] Readme updated --- docs/RELEASES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 154afb5..a963ea5 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - CAN FD frames with max DLC (64 bytes) are supported +- Minor type cast improvements in the sign extension function (\_\_ext_sig\_\_) ## [v3.0] - 2023-10-09 From 213130dbd24458c90f1fc6f114c2dc6dffa37846 Mon Sep 17 00:00:00 2001 From: astand Date: Fri, 26 Apr 2024 09:00:08 +0300 Subject: [PATCH 177/181] Generation script modified for release/debug call Issue #28 fixed, other fixed and improvements (see changelog) --- docs/RELEASES.md | 7 +++ run-test-gen.bat | 32 ++++++++++- run-test-gen.sh | 29 +++++++++- src/app.cpp | 49 +++++++++++++++-- src/codegen/fs-creator.cpp | 8 +-- src/codegen/mon-generator.cpp | 7 ++- src/parser/dbcscanner.cpp | 75 ++++++++++++++++++-------- src/parser/dbcscanner.h | 2 +- test/gencode/butl/bcm_testdb-binutil.c | 3 ++ test/gencode/butl/bcm_testdb-binutil.h | 3 ++ test/gencode/butl/bms_testdb-binutil.c | 3 ++ test/gencode/butl/bms_testdb-binutil.h | 3 ++ test/gencode/butl/eps_testdb-binutil.c | 3 ++ test/gencode/butl/eps_testdb-binutil.h | 3 ++ test/gencode/butl/esp_testdb-binutil.c | 3 ++ test/gencode/butl/esp_testdb-binutil.h | 3 ++ test/gencode/conf/testdb-config.h | 3 ++ test/gencode/lib/testdb-fmon.h | 3 ++ test/gencode/lib/testdb.c | 3 ++ test/gencode/lib/testdb.h | 3 ++ test/gencode/usr/testdb-fmon.c | 3 ++ 21 files changed, 209 insertions(+), 39 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index a963ea5..7e84260 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -10,6 +10,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - CAN FD frames with max DLC (64 bytes) are supported - Minor type cast improvements in the sign extension function (\_\_ext_sig\_\_) +- (INFR) Test generation script takes one argument: release/debug to specify particular binary call +- istream handling improved in dbcscanner +- The head information with: coderdbc version, dbc file name, generation date added ([issue #28](https://github.com/astand/c-coderdbc/issues/28)) + +### Fixed +- Head part info conversion to source code comments in mon-generator module +- FindVersion function improved ## [v3.0] - 2023-10-09 diff --git a/run-test-gen.bat b/run-test-gen.bat index 1dfe93a..2414d41 100755 --- a/run-test-gen.bat +++ b/run-test-gen.bat @@ -1,2 +1,30 @@ -start "coder" "build/coderdbc.exe" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw -pause \ No newline at end of file +@echo off + +rem The bat file checks the first passed from the caller scope string argument +rem If the argument length is greater than 0 the argument is used in path to the coderdbc.exe +rem Examples: + +rem ./run-test-gen.bat release +rem build\release\coderdbc.exe + +rem ./run-test-gen.bat debug +rem build\debug\coderdbc.exe + +echo Argument passed: %~1 + +rem Check if an argument is provided +if "%~1"=="" ( + rem If no argument is provided, set the path directly to "build\coderdbc.exe" + set "CMD_PATH=build\coderdbc.exe" +) else ( + rem If an argument is provided, use it to construct the path + set "CMD_PATH=build\%~1\coderdbc.exe" +) + +rem Output the combined path for debugging +echo Combined path: %CMD_PATH% + +rem Run the program with the constructed path and other options +"%CMD_PATH%" -dbc test\testdb.dbc -out -out test\gencode -drvname testdb -nodeutils -rw + +pause diff --git a/run-test-gen.sh b/run-test-gen.sh index 86bea7f..960dd6c 100755 --- a/run-test-gen.sh +++ b/run-test-gen.sh @@ -1 +1,28 @@ -./build/coderdbc -dbc test/testdb.dbc -out test/gencode -drvname testdb -nodeutils -rw \ No newline at end of file +#!/bin/bash + +# The bat file checks the first passed from the caller scope string argument +# If the argument length is greater than 0 the argument is used in path to the coderdbc.exe +# Examples: + +# ./run-test-gen.sh release +# build/release/coderdbc + +# ./run-test-gen.sh debug +# build/debug/coderdbc + +# ATTENTION: this script is not tested in Linux yet!!! + +# Check if an argument is provided +if [ -z "$1" ]; then + # If no argument is provided, set the path directly + CMD_PATH="build/coderdbc" +else + # If an argument is provided, use it to construct the path + CMD_PATH="build/$1/coderdbc" +fi + +# Output the combined path for debugging +echo "Combined path: $CMD_PATH" + +# Run the program with the constructed path and other options +"$CMD_PATH" -dbc test/testdb.dbc -out test/gencode -drvname testdb -nodeutils -rw diff --git a/src/app.cpp b/src/app.cpp index f5a57c3..00e62c6 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -14,6 +14,20 @@ #include #include +/// @brief Function returns filename with extension extracted from full path +/// @param fullfilepath Full file path +/// @return Filename only +std::string ExtractFileName(const std::string& fullfilepath) +{ + // find the position of the last path separator + size_t pos = fullfilepath.find_last_of("/\\"); + + // extract the file name from the full path + std::string filename = (pos == std::string::npos) ? fullfilepath : fullfilepath.substr(pos + 1); + + return filename; +} + void CoderApp::Run() { std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; @@ -48,16 +62,39 @@ void CoderApp::GenerateCode() return; } - reader.open(Params.dbc.first); + std::ifstream file(Params.dbc.first); - std::istream& s = reader; + if (!file.is_open()) + { + // Pass ifstream as istream to processStream function + std::cerr << "Unable to open DBC file" << std::endl; + exit(1); + } - scanner.TrimDbcText(s); + scanner.TrimDbcText(file); + file.close(); - std::string info(""); + auto filename = ExtractFileName(Params.dbc.first); + // get current time + std::time_t now = std::time(nullptr); + // convert to local time + std::tm* loctime = std::localtime(&now); + // prepare string for source files head part + std::stringstream srcinfo; + srcinfo << "DBC filename : " << filename << "\n"; + srcinfo << "Generator version: v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN; + + if (loctime) + { + // put the date and time into source file header + srcinfo << std::endl << "Generation time : " << std::put_time(loctime, "%Y.%m.%d %H:%M:%S"); + } // create main destination directory - fscreator.Configure(Params.drvname.first, Params.outdir.first, info, scanner.dblist.ver.hi, scanner.dblist.ver.low); + fscreator.Configure(Params.drvname.first, Params.outdir.first, + srcinfo.str(), + scanner.dblist.ver.hi, + scanner.dblist.ver.low); auto ret = fscreator.PrepareDirectory(Params.is_rewrite); @@ -169,6 +206,8 @@ void CoderApp::GenerateCode() ciugen.Generate(scanner.dblist, fscreator.FS, groups, Params.drvname.first); } } + + std::cout << std::endl << "Source code generation completed." << std::endl; } /// @brief Checks if all mandatory configuration parameters are provided diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 15e08f2..faf36e7 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -83,13 +83,7 @@ void FsCreator::Configure(const std::string& drvname, const std::string& outpath FS.gen.verlow_def = _tmpb; // load start info to fdescriptor - FS.gen.start_info.clear(); - - if (info.size() > 0) - { - FS.gen.start_info = info; - } - + FS.gen.start_info = info; FS.gen.hiver = h; FS.gen.lowver = l; } diff --git a/src/codegen/mon-generator.cpp b/src/codegen/mon-generator.cpp index ea84195..1635516 100644 --- a/src/codegen/mon-generator.cpp +++ b/src/codegen/mon-generator.cpp @@ -1,3 +1,5 @@ +#include +#include #include "mon-generator.h" #include "helpers/formatter.h" @@ -6,7 +8,8 @@ uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, { if (aset.gen.start_info.size() > 0) { - wr.Append(aset.gen.start_info); + // replace all '\n' on "\n //" for c code comment text + wr.Append("// " + std::regex_replace(aset.gen.start_info, std::regex("\n"), "\n// ")); } wr.Append("#pragma once"); @@ -88,7 +91,7 @@ uint32_t MonGenerator::FillSource(FileWriter& wr, std::vector& sigs, { if (aset.gen.start_info.size() > 0) { - wr.Append(aset.gen.start_info); + wr.Append("// " + std::regex_replace(aset.gen.start_info, std::regex("\n"), "\n// ")); } wr.Append("#include \"%s\"", aset.file.fmon_h.fname.c_str()); diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index 4856271..b0a797d 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -1,7 +1,11 @@ #include "dbcscanner.h" -#include #include #include +#include +#include +#include +#include +#include #include "../helpers/formatter.h" MessageDescriptor_t* find_message(vector msgs, uint32_t ID) @@ -67,10 +71,8 @@ void DbcScanner::ParseMessageInfo(istream& readstrm) MessageDescriptor_t* pMsg = nullptr; - while (readstrm.eof() == false) + while (std::getline(readstrm, sline)) { - std::getline(readstrm, sline); - sline = str_trim(sline); FindVersion(sline); @@ -164,10 +166,8 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) AttributeDescriptor_t attr; - while (!readstrm.eof()) + while (std::getline(readstrm, sline)) { - std::getline(readstrm, sline); - sline = str_trim(sline); if (lparser.ParseCommentLine(&cmmnt, sline)) @@ -338,30 +338,63 @@ void DbcScanner::SetDefualtMessage(MessageDescriptor_t* message) } -void DbcScanner::FindVersion(const std::string& instr) +/// @brief Parses the line to extract a string and two unsigned integers. +/// @param line The input line to parse. +/// @param str The extracted string. +/// @param num1 The first extracted unsigned integer. +/// @param num2 The second extracted unsigned integer. +/// @return The number of successfully matched parts (0 if the pattern did not match). +static bool ParseVersionLine(const std::string& line, std::string& str, uint32_t& num1, uint32_t& num2) { - #define VERSION_DBC_STRING "VERSION" + std::regex pattern("([a-zA-Z]+)\\s*\"?(\\d+)\\D+(\\d+)\"?"); + std::smatch matches; + + // try to match the regex pattern to the input line + if (std::regex_match(line, matches, pattern)) + { + if (matches.size() == 4) + { + // 1 for the whole match and 3 for the capture groups + str = matches[1].str(); + num1 = std::stoul(matches[2].str()); + num2 = std::stoul(matches[3].str()); + // successfully matched all three parts + return true; + } + } - static constexpr char* versionAttr = (char*)VERSION_DBC_STRING; - // sizeof on string literal returns size with null termination - static constexpr size_t VER_MIN_LENGTH = (sizeof(VERSION_DBC_STRING) - 1); - static_assert(VER_MIN_LENGTH == 7u, "Please check the dbc version string marker"); + // pattern did not match or some parts were not matched + return false; +} - uint32_t h = 0, l = 0; - char marker[VER_MIN_LENGTH + 1u]; +void DbcScanner::FindVersion(const std::string& line) +{ + std::istringstream stream(line); + std::string versionStr; + uint32_t num1, num2; - if (instr.size() < VER_MIN_LENGTH) + if (ParseVersionLine(line, versionStr, num1, num2) == false) { + // pattern did not match or not all parts were successfully parsed return; } - // try to find dbc version marker which looks like: VERSION "x.x" - auto ret = std::sscanf(instr.c_str(), "%8s \"%u.%u\"", marker, &h, &l); + // check if the string is composed only of alphabetic characters + if (!std::all_of(versionStr.begin(), versionStr.end(), [](char c) { return std::isalpha(c); })) + { + // the string part is not purely alphabetic + return; + } + + // convert the extracted string to lowercase for case-insensitive comparison + std::string lowerStr = versionStr; + std::transform(lowerStr.begin(), lowerStr.end(), lowerStr.begin(), ::tolower); - if ((ret == 3) && (std::strcmp(marker, versionAttr) == 0)) + // compare the lowercase string with "version" + if (lowerStr == "version") { // versions have been found, save numeric values - dblist.ver.hi = h; - dblist.ver.low = l; + dblist.ver.hi = num1; + dblist.ver.low = num2; } } diff --git a/src/parser/dbcscanner.h b/src/parser/dbcscanner.h index 7abff93..146ba89 100644 --- a/src/parser/dbcscanner.h +++ b/src/parser/dbcscanner.h @@ -25,7 +25,7 @@ class DbcScanner { void ParseOtherInfo(istream& instrm); void AddMessage(MessageDescriptor_t* message); void SetDefualtMessage(MessageDescriptor_t* message); - void FindVersion(const std::string& instr); + void FindVersion(const std::string& line); private: diff --git a/test/gencode/butl/bcm_testdb-binutil.c b/test/gencode/butl/bcm_testdb-binutil.c index fc430fc..dfd9b2f 100644 --- a/test/gencode/butl/bcm_testdb-binutil.c +++ b/test/gencode/butl/bcm_testdb-binutil.c @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #include "bcm_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/bcm_testdb-binutil.h b/test/gencode/butl/bcm_testdb-binutil.h index c9d9b31..725c8e8 100644 --- a/test/gencode/butl/bcm_testdb-binutil.h +++ b/test/gencode/butl/bcm_testdb-binutil.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once #ifdef __cplusplus diff --git a/test/gencode/butl/bms_testdb-binutil.c b/test/gencode/butl/bms_testdb-binutil.c index 23f3ba8..1a022b5 100644 --- a/test/gencode/butl/bms_testdb-binutil.c +++ b/test/gencode/butl/bms_testdb-binutil.c @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #include "bms_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/bms_testdb-binutil.h b/test/gencode/butl/bms_testdb-binutil.h index db8574c..6edcd26 100644 --- a/test/gencode/butl/bms_testdb-binutil.h +++ b/test/gencode/butl/bms_testdb-binutil.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once #ifdef __cplusplus diff --git a/test/gencode/butl/eps_testdb-binutil.c b/test/gencode/butl/eps_testdb-binutil.c index d9713a1..ebcdccd 100644 --- a/test/gencode/butl/eps_testdb-binutil.c +++ b/test/gencode/butl/eps_testdb-binutil.c @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #include "eps_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/eps_testdb-binutil.h b/test/gencode/butl/eps_testdb-binutil.h index c77b52a..ea893d8 100644 --- a/test/gencode/butl/eps_testdb-binutil.h +++ b/test/gencode/butl/eps_testdb-binutil.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once #ifdef __cplusplus diff --git a/test/gencode/butl/esp_testdb-binutil.c b/test/gencode/butl/esp_testdb-binutil.c index 93dd31b..b52a369 100644 --- a/test/gencode/butl/esp_testdb-binutil.c +++ b/test/gencode/butl/esp_testdb-binutil.c @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #include "esp_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/esp_testdb-binutil.h b/test/gencode/butl/esp_testdb-binutil.h index 13b8c68..e763f7c 100644 --- a/test/gencode/butl/esp_testdb-binutil.h +++ b/test/gencode/butl/esp_testdb-binutil.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once #ifdef __cplusplus diff --git a/test/gencode/conf/testdb-config.h b/test/gencode/conf/testdb-config.h index cf92cef..fd90f73 100644 --- a/test/gencode/conf/testdb-config.h +++ b/test/gencode/conf/testdb-config.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once /* include common dbccode configurations */ diff --git a/test/gencode/lib/testdb-fmon.h b/test/gencode/lib/testdb-fmon.h index 3b4e4e3..cd60860 100644 --- a/test/gencode/lib/testdb-fmon.h +++ b/test/gencode/lib/testdb-fmon.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once #ifdef __cplusplus diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index a79a682..dbe7c59 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #include "testdb.h" diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index 7ea9a08..f7d461d 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #pragma once #ifdef __cplusplus diff --git a/test/gencode/usr/testdb-fmon.c b/test/gencode/usr/testdb-fmon.c index ecf5b20..f4bf9da 100644 --- a/test/gencode/usr/testdb-fmon.c +++ b/test/gencode/usr/testdb-fmon.c @@ -1,3 +1,6 @@ +// DBC filename : testdb.dbc +// Generator version: v3.1 +// Generation time : 2024.06.30 12:22:02 #include "testdb-fmon.h" #ifdef TESTDB_USE_DIAG_MONITORS From 26945d4bd6cced8497742d9d30baff1e7f2aaf0b Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 30 Jun 2024 14:42:35 +0300 Subject: [PATCH 178/181] Enhanced flexibility in generating output All files have initial information comment block --- docs/RELEASES.md | 5 +- src/app.cpp | 70 ++++++++++++++++++++++---- src/codegen/c-main-generator.cpp | 26 +++------- src/codegen/c-util-generator.cpp | 14 ++---- src/codegen/fs-creator.cpp | 17 ++++--- src/codegen/fs-creator.h | 13 +++-- src/codegen/mon-generator.cpp | 15 ++---- src/options-parser.cpp | 8 +++ src/options-parser.h | 6 +++ test/gencode/butl/bcm_testdb-binutil.c | 5 +- test/gencode/butl/bcm_testdb-binutil.h | 5 +- test/gencode/butl/bms_testdb-binutil.c | 5 +- test/gencode/butl/bms_testdb-binutil.h | 5 +- test/gencode/butl/eps_testdb-binutil.c | 5 +- test/gencode/butl/eps_testdb-binutil.h | 5 +- test/gencode/butl/esp_testdb-binutil.c | 5 +- test/gencode/butl/esp_testdb-binutil.h | 5 +- test/gencode/conf/dbccodeconf.h | 1 + test/gencode/conf/testdb-config.h | 5 +- test/gencode/inc/canmonitorutil.h | 1 + test/gencode/lib/testdb-fmon.h | 5 +- test/gencode/lib/testdb.c | 5 +- test/gencode/lib/testdb.h | 5 +- test/gencode/usr/testdb-fmon.c | 5 +- 24 files changed, 143 insertions(+), 98 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 7e84260..0d360e0 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -12,7 +12,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Minor type cast improvements in the sign extension function (\_\_ext_sig\_\_) - (INFR) Test generation script takes one argument: release/debug to specify particular binary call - istream handling improved in dbcscanner -- The head information with: coderdbc version, dbc file name, generation date added ([issue #28](https://github.com/astand/c-coderdbc/issues/28)) +- The head information with: coderdbc version, dbc file name ([issue #28](https://github.com/astand/c-coderdbc/issues/28)) +- General source file (not driver related) have only coderdbc version and date if enabled (see next chages) +- The generation date can be added to head information with '-gendate' argument +- The final output directory path is extended by the driver name when '-driverdir' argument is passed ### Fixed - Head part info conversion to source code comments in mon-generator module diff --git a/src/app.cpp b/src/app.cpp index 00e62c6..4810d9b 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -28,6 +28,36 @@ std::string ExtractFileName(const std::string& fullfilepath) return filename; } +/// @brief Combines a directory path and a folder name while handling directory separators +/// @param path The initial directory path +/// @param folderName The folder name to append +/// @return The combined path as a string +std::string CombinePath(const std::string& path, const std::string& folderName) +{ + // check if path ends with '/' or '\\' + bool pathEndsWithSeparator = !path.empty() && (path.back() == '/' || path.back() == '\\'); + + // check if folderName starts with '/' or '\\' + bool folderStartsWithSeparator = !folderName.empty() && (folderName.front() == '/' || folderName.front() == '\\'); + + // combine path and folderName based on separators + if (pathEndsWithSeparator && folderStartsWithSeparator) + { + // both have separators, remove one from folderName + return path + folderName.substr(1); + } + else if (!pathEndsWithSeparator && !folderStartsWithSeparator) + { + // neither has a separator, add one + return path + '/' + folderName; + } + else + { + // exactly one has a separator, just concatenate + return path + folderName; + } +} + void CoderApp::Run() { std::cout << "coderdbc v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << std::endl << std::endl; @@ -79,20 +109,31 @@ void CoderApp::GenerateCode() std::time_t now = std::time(nullptr); // convert to local time std::tm* loctime = std::localtime(&now); - // prepare string for source files head part - std::stringstream srcinfo; - srcinfo << "DBC filename : " << filename << "\n"; - srcinfo << "Generator version: v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN; + // create driver related comment block + std::stringstream driversrcinfo; + driversrcinfo << "// DBC filename : " << filename << "\n"; + // create common comment block + std::stringstream commonsrcinfo; + commonsrcinfo << "// Generator version : v" << CODEGEN_LIB_VERSION_MAJ << "." << CODEGEN_LIB_VERSION_MIN << "\n"; + + if (loctime && Params.add_gen_date) + { + // put the date and time inside common comment block + commonsrcinfo << "// Generation time : " << std::put_time(loctime, "%Y.%m.%d %H:%M:%S") << "\n"; + } - if (loctime) + std::string finalpath = Params.outdir.first; + + if (Params.is_driver_dir) { - // put the date and time into source file header - srcinfo << std::endl << "Generation time : " << std::put_time(loctime, "%Y.%m.%d %H:%M:%S"); + // append the folder name to the path + finalpath = CombinePath(Params.outdir.first, Params.drvname.first); } // create main destination directory - fscreator.Configure(Params.drvname.first, Params.outdir.first, - srcinfo.str(), + fscreator.Configure(Params.drvname.first, finalpath, + commonsrcinfo.str(), + driversrcinfo.str(), scanner.dblist.ver.hi, scanner.dblist.ver.low); @@ -231,20 +272,29 @@ void CoderApp::PrintHelp() std::cout << std::endl; std::cout << "optional parameters:" << std::endl; std::cout << " -nodeutils\t will generate specific pairs of binutils drivers for each node" << std::endl; + std::cout << std::endl; std::cout << " -rw\t\t by default each new generation with previously used params" << std::endl; std::cout << " \t\t will create new sud-directory with source files (000, 001, ... etc)" << std::endl; std::cout << " \t\t '-rw' option enables rewriting: all source files previously generated" << std::endl; std::cout << " \t\t will be replaced by new ones" << std::endl; + std::cout << std::endl; std::cout << " -noconfig:\t no {drivername}-config and dbccodeconfig generation" << std::endl; std::cout << " -noinc:\t no canmonitorutil.h generation" << std::endl; std::cout << " -nofmon:\t no ***-fmon.c generation" << std::endl; std::cout << std::endl; + std::cout << " -driverdir\t the output path (-out) will be appended by driver name" << std::endl; + std::cout << " -gendate\t the generation date will be included in the header comment section of the source file." << + std::endl; + std::cout << std::endl; std::cout << "examples:" << std::endl; std::cout << std::endl; std::cout << - "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" << std::endl; + "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw -driverdir -gendate" + << std::endl; + std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils -rw" + << std::endl; std::cout << "./dbccoder -dbc /home/user/docs/driveshaft.dbc -out /home/user/docs/gen/ -drvname drivedb -nodeutils" << std::endl; diff --git a/src/codegen/c-main-generator.cpp b/src/codegen/c-main-generator.cpp index dd3eed8..dc9c5ae 100644 --- a/src/codegen/c-main-generator.cpp +++ b/src/codegen/c-main-generator.cpp @@ -83,14 +83,8 @@ void CiMainGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd void CiMainGenerator::Gen_MainHeader() { std::set passed_sigs; - - // write comment start text - if (fdesc->gen.start_info.size() > 0) - { - // replace all '\n' on "\n //" for c code comment text - fwriter.Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); - } - + fwriter.AppendText(fdesc->gen.start_common_info); + fwriter.AppendText(fdesc->gen.start_driver_info); fwriter.Append("#pragma once"); fwriter.Append(); fwriter.Append("#ifdef __cplusplus\nextern \"C\" {\n#endif"); @@ -336,12 +330,9 @@ void CiMainGenerator::Gen_MainHeader() void CiMainGenerator::Gen_MainSource() { - if (fdesc->gen.start_info.size() > 0) - { - // replace all '\n' on "\n //" for c code comment text - fwriter.Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); - } + fwriter.AppendText(fdesc->gen.start_common_info); + fwriter.AppendText(fdesc->gen.start_driver_info); // include main header file fwriter.Append("#include \"%s\"", fdesc->file.core_h.fname.c_str()); fwriter.Append(2); @@ -443,11 +434,8 @@ void CiMainGenerator::Gen_MainSource() void CiMainGenerator::Gen_ConfigHeader() { - if (fdesc->gen.start_info.size() > 0) - { - // replace all '\n' on "\n //" for c code comment text - fwriter.Append("// " + std::regex_replace(fdesc->gen.start_info, std::regex("\n"), "\n// ")); - } + fwriter.AppendText(fdesc->gen.start_common_info); + fwriter.AppendText(fdesc->gen.start_driver_info); ConfigGenerator confgen; confgen.FillHeader(fwriter, fdesc->gen); @@ -471,6 +459,7 @@ void CiMainGenerator::Gen_FMonSource() void CiMainGenerator::Gen_CanMonUtil() { + fwriter.AppendText(fdesc->gen.start_common_info); fwriter.Append("#pragma once"); fwriter.Append(""); fwriter.Append("#include "); @@ -530,6 +519,7 @@ void CiMainGenerator::Gen_CanMonUtil() void CiMainGenerator::Gen_DbcCodeConf() { + fwriter.AppendText(fdesc->gen.start_common_info); fwriter.Append("#pragma once"); fwriter.Append(""); fwriter.Append("#include "); diff --git a/src/codegen/c-util-generator.cpp b/src/codegen/c-util-generator.cpp index 8d3c2c3..9db35ab 100644 --- a/src/codegen/c-util-generator.cpp +++ b/src/codegen/c-util-generator.cpp @@ -101,12 +101,8 @@ void CiUtilGenerator::Generate(DbcMessageList_t& dlist, const AppSettings_t& fsd void CiUtilGenerator::PrintHeader() { tof.Flush(); - - if (gdesc->start_info.size() > 0) - { - tof.Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); - } - + tof.AppendText(gdesc->start_common_info); + tof.AppendText(gdesc->start_driver_info); tof.Append("#pragma once"); tof.Append(); @@ -197,10 +193,8 @@ void CiUtilGenerator::PrintHeader() void CiUtilGenerator::PrintSource() { - if (gdesc->start_info.size() > 0) - { - tof.Append("// " + std::regex_replace(gdesc->start_info, std::regex("\n"), "\n// ")); - } + tof.AppendText(gdesc->start_common_info); + tof.AppendText(gdesc->start_driver_info); tof.Append("#include \"%s\"", fdesc->util_h.fname.c_str()); tof.Append(); diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index faf36e7..944bce9 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -18,15 +18,19 @@ FsCreator::FsCreator() } -void FsCreator::Configure(const std::string& drvname, const std::string& outpath, - const std::string& info, uint32_t h, uint32_t l) +void FsCreator::Configure(const std::string& drvname, + const std::string& outpath, + const std::string& commoninfo, + const std::string& driverinfo, + uint32_t highVer, + uint32_t lowVer) { FS.file.libdir = outpath + kLibDir; FS.file.usrdir = outpath + kUsrDir; FS.file.incdir = outpath + kIncDir; FS.file.confdir = outpath + kConfDir; FS.file.utildir = outpath + kUtilDir; -// directory valid and exists, set all the values + // directory valid and exists, set all the values FS.gen.DrvName_orig = drvname; FS.gen.DRVNAME = str_toupper(drvname); FS.gen.drvname = str_tolower(drvname); @@ -83,9 +87,10 @@ void FsCreator::Configure(const std::string& drvname, const std::string& outpath FS.gen.verlow_def = _tmpb; // load start info to fdescriptor - FS.gen.start_info = info; - FS.gen.hiver = h; - FS.gen.lowver = l; + FS.gen.start_driver_info = driverinfo; + FS.gen.start_common_info = commoninfo; + FS.gen.hiver = highVer; + FS.gen.lowver = lowVer; } bool FsCreator::PrepareDirectory(bool rw) diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 4bf649f..5ebb59e 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -43,8 +43,10 @@ typedef struct std::string verhigh_def; std::string verlow_def; - // inforamtion to be placed at the start of each source file - std::string start_info; + // text comment to be placed at the beggining of the driver's related source files + std::string start_driver_info; + // text comment to be placed at the beggining of each source files + std::string start_common_info; uint32_t hiver{0}; uint32_t lowver{0}; @@ -69,7 +71,12 @@ class FsCreator { public: FsCreator(); - void Configure(const std::string& drvname, const std::string& outpath, const std::string& info, uint32_t h, uint32_t l); + void Configure(const std::string& drvname, + const std::string& outpath, + const std::string& commoninfo, + const std::string& driverinfo, + uint32_t highVer, + uint32_t lowVer); bool PrepareDirectory(bool rw); std::string CreateSubDir(std::string basepath, std::string subdir, bool rm = true); diff --git a/src/codegen/mon-generator.cpp b/src/codegen/mon-generator.cpp index 1635516..01fcbc8 100644 --- a/src/codegen/mon-generator.cpp +++ b/src/codegen/mon-generator.cpp @@ -6,12 +6,8 @@ uint32_t MonGenerator::FillHeader(FileWriter& wr, std::vector& sigs, const AppSettings_t& aset) { - if (aset.gen.start_info.size() > 0) - { - // replace all '\n' on "\n //" for c code comment text - wr.Append("// " + std::regex_replace(aset.gen.start_info, std::regex("\n"), "\n// ")); - } - + wr.AppendText(aset.gen.start_common_info); + wr.AppendText(aset.gen.start_driver_info); wr.Append("#pragma once"); wr.Append(); @@ -89,11 +85,8 @@ separated .c file. If it won't be done the linkage error will happen\n*/"); uint32_t MonGenerator::FillSource(FileWriter& wr, std::vector& sigs, const AppSettings_t& aset) { - if (aset.gen.start_info.size() > 0) - { - wr.Append("// " + std::regex_replace(aset.gen.start_info, std::regex("\n"), "\n// ")); - } - + wr.AppendText(aset.gen.start_common_info); + wr.AppendText(aset.gen.start_driver_info); wr.Append("#include \"%s\"", aset.file.fmon_h.fname.c_str()); wr.Append(); // put diagmonitor ifdef selection for including @drv-fmon header diff --git a/src/options-parser.cpp b/src/options-parser.cpp index 3d675bc..ee77391 100644 --- a/src/options-parser.cpp +++ b/src/options-parser.cpp @@ -78,6 +78,14 @@ OptionsParser::GenOptions OptionsParser::GetOptions(int argc, char** argv) { retpairs.is_nofmon = true; } + else if (temppairs[i].first.compare("-driverdir") == 0) + { + retpairs.is_driver_dir = true; + } + else if (temppairs[i].first.compare("-gendate") == 0) + { + retpairs.add_gen_date = true; + } } return retpairs; diff --git a/src/options-parser.h b/src/options-parser.h index a27af2b..d2b1c8d 100644 --- a/src/options-parser.h +++ b/src/options-parser.h @@ -28,6 +28,12 @@ class OptionsParser { /// @brief rewrite previously generated files or generate to next subdirectory bool is_rewrite{false}; + /// @brief add additional directory named as dbc driver inside generation output directory + bool is_driver_dir{false}; + + /// @brief add generation date at the beggining of the source file + bool add_gen_date{false}; + /// @brief generate specific utility drivers for each ECU defined in the matrix bool is_nodeutils{false}; diff --git a/test/gencode/butl/bcm_testdb-binutil.c b/test/gencode/butl/bcm_testdb-binutil.c index dfd9b2f..1a02a37 100644 --- a/test/gencode/butl/bcm_testdb-binutil.c +++ b/test/gencode/butl/bcm_testdb-binutil.c @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #include "bcm_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/bcm_testdb-binutil.h b/test/gencode/butl/bcm_testdb-binutil.h index 725c8e8..6d3ddf6 100644 --- a/test/gencode/butl/bcm_testdb-binutil.h +++ b/test/gencode/butl/bcm_testdb-binutil.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once #ifdef __cplusplus diff --git a/test/gencode/butl/bms_testdb-binutil.c b/test/gencode/butl/bms_testdb-binutil.c index 1a022b5..fdc0c1d 100644 --- a/test/gencode/butl/bms_testdb-binutil.c +++ b/test/gencode/butl/bms_testdb-binutil.c @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #include "bms_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/bms_testdb-binutil.h b/test/gencode/butl/bms_testdb-binutil.h index 6edcd26..9953e12 100644 --- a/test/gencode/butl/bms_testdb-binutil.h +++ b/test/gencode/butl/bms_testdb-binutil.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once #ifdef __cplusplus diff --git a/test/gencode/butl/eps_testdb-binutil.c b/test/gencode/butl/eps_testdb-binutil.c index ebcdccd..407332c 100644 --- a/test/gencode/butl/eps_testdb-binutil.c +++ b/test/gencode/butl/eps_testdb-binutil.c @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #include "eps_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/eps_testdb-binutil.h b/test/gencode/butl/eps_testdb-binutil.h index ea893d8..78993de 100644 --- a/test/gencode/butl/eps_testdb-binutil.h +++ b/test/gencode/butl/eps_testdb-binutil.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once #ifdef __cplusplus diff --git a/test/gencode/butl/esp_testdb-binutil.c b/test/gencode/butl/esp_testdb-binutil.c index b52a369..9effb3a 100644 --- a/test/gencode/butl/esp_testdb-binutil.c +++ b/test/gencode/butl/esp_testdb-binutil.c @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #include "esp_testdb-binutil.h" // DBC file version diff --git a/test/gencode/butl/esp_testdb-binutil.h b/test/gencode/butl/esp_testdb-binutil.h index e763f7c..b0adcc3 100644 --- a/test/gencode/butl/esp_testdb-binutil.h +++ b/test/gencode/butl/esp_testdb-binutil.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once #ifdef __cplusplus diff --git a/test/gencode/conf/dbccodeconf.h b/test/gencode/conf/dbccodeconf.h index 9dc616c..e1c7eff 100644 --- a/test/gencode/conf/dbccodeconf.h +++ b/test/gencode/conf/dbccodeconf.h @@ -1,3 +1,4 @@ +// Generator version : v3.1 #pragma once #include diff --git a/test/gencode/conf/testdb-config.h b/test/gencode/conf/testdb-config.h index fd90f73..7809c80 100644 --- a/test/gencode/conf/testdb-config.h +++ b/test/gencode/conf/testdb-config.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once /* include common dbccode configurations */ diff --git a/test/gencode/inc/canmonitorutil.h b/test/gencode/inc/canmonitorutil.h index b93dd75..2289caa 100644 --- a/test/gencode/inc/canmonitorutil.h +++ b/test/gencode/inc/canmonitorutil.h @@ -1,3 +1,4 @@ +// Generator version : v3.1 #pragma once #include diff --git a/test/gencode/lib/testdb-fmon.h b/test/gencode/lib/testdb-fmon.h index cd60860..65c7b4e 100644 --- a/test/gencode/lib/testdb-fmon.h +++ b/test/gencode/lib/testdb-fmon.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once #ifdef __cplusplus diff --git a/test/gencode/lib/testdb.c b/test/gencode/lib/testdb.c index dbe7c59..3c1c00a 100644 --- a/test/gencode/lib/testdb.c +++ b/test/gencode/lib/testdb.c @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #include "testdb.h" diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index f7d461d..e79f58e 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #pragma once #ifdef __cplusplus diff --git a/test/gencode/usr/testdb-fmon.c b/test/gencode/usr/testdb-fmon.c index f4bf9da..fca6415 100644 --- a/test/gencode/usr/testdb-fmon.c +++ b/test/gencode/usr/testdb-fmon.c @@ -1,6 +1,5 @@ -// DBC filename : testdb.dbc -// Generator version: v3.1 -// Generation time : 2024.06.30 12:22:02 +// Generator version : v3.1 +// DBC filename : testdb.dbc #include "testdb-fmon.h" #ifdef TESTDB_USE_DIAG_MONITORS From 546e76aefb19669f8a861e279c9bfed06ab2ae72 Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 30 Jun 2024 15:58:04 +0300 Subject: [PATCH 179/181] Fixed missed floating signals comment --- docs/RELEASES.md | 1 + src/parser/dbcscanner.cpp | 2 +- test/gencode/lib/testdb.h | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index 0d360e0..ce0af52 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - Head part info conversion to source code comments in mon-generator module - FindVersion function improved +- Missing comments from dbc for signals based on real data types (floating-point variables, denoted by '_ro' and '_phys'). ## [v3.0] - 2023-10-09 diff --git a/src/parser/dbcscanner.cpp b/src/parser/dbcscanner.cpp index b0a797d..2757b35 100644 --- a/src/parser/dbcscanner.cpp +++ b/src/parser/dbcscanner.cpp @@ -187,7 +187,7 @@ void DbcScanner::ParseOtherInfo(istream& readstrm) { for (size_t i = 0; i < msg->Signals.size(); i++) { - if (cmmnt.SigName == msg->Signals[i].Name) + if ((cmmnt.SigName == msg->Signals[i].Name) || ((cmmnt.SigName + "_ro") == msg->Signals[i].Name)) { SignalDescriptor_t& sig = msg->Signals[i]; // signal has been found, update commnet text diff --git a/test/gencode/lib/testdb.h b/test/gencode/lib/testdb.h index e79f58e..a9fa5dd 100644 --- a/test/gencode/lib/testdb.h +++ b/test/gencode/lib/testdb.h @@ -344,6 +344,7 @@ typedef struct // uint8_t CS : 4; // Bits= 4 + // Test floating point value. uint16_t Accel_ro; // Bits=12 Offset= -100.0 Factor= 0.1 Unit:'m/s' #ifdef TESTDB_USE_SIGFLOAT @@ -404,6 +405,7 @@ typedef struct // uint8_t CS; // Bits= 4 + // Test floating point value. uint16_t Accel_ro; // Bits=12 Offset= -100.0 Factor= 0.1 Unit:'m/s' #ifdef TESTDB_USE_SIGFLOAT From ed4993093563c46e03810169a39c45e33b95e0fb Mon Sep 17 00:00:00 2001 From: astand Date: Sun, 30 Jun 2024 16:01:36 +0300 Subject: [PATCH 180/181] Release file updated --- docs/RELEASES.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index ce0af52..d80b798 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] + +## [v3.1] - 2024-06-30 + ### Added - CAN FD frames with max DLC (64 bytes) are supported @@ -230,7 +233,8 @@ network node defined in DBC - Fixed some warnings -[Unreleased]: https://github.com/astand/c-coderdbc/compare/v3.0...HEAD +[Unreleased]: https://github.com/astand/c-coderdbc/compare/v3.1...HEAD +[v3.1]: https://github.com/astand/c-coderdbc/compare/v3.0...v3.1 [v3.0]: https://github.com/astand/c-coderdbc/compare/v2.9...v3.0 [v2.9]: https://github.com/astand/c-coderdbc/compare/v2.8...v2.9 [v2.8]: https://github.com/astand/c-coderdbc/compare/v2.7...v2.8 From 7627fde2da9dc679b83732e4f47d41f6b5b2cda6 Mon Sep 17 00:00:00 2001 From: astand Date: Wed, 31 Jul 2024 10:14:17 +0300 Subject: [PATCH 181/181] Fixed -rw option handling --- docs/RELEASES.md | 3 ++ src/app.cpp | 13 +++++- src/codegen/fs-creator.cpp | 91 +++++++++++++++++++++----------------- src/codegen/fs-creator.h | 3 ++ 4 files changed, 67 insertions(+), 43 deletions(-) diff --git a/docs/RELEASES.md b/docs/RELEASES.md index d80b798..f7802aa 100644 --- a/docs/RELEASES.md +++ b/docs/RELEASES.md @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- Issue with '-rw' key handling. Empty sequence folders. ## [v3.1] - 2024-06-30 diff --git a/src/app.cpp b/src/app.cpp index 4810d9b..284719d 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -122,12 +122,21 @@ void CoderApp::GenerateCode() commonsrcinfo << "// Generation time : " << std::put_time(loctime, "%Y.%m.%d %H:%M:%S") << "\n"; } - std::string finalpath = Params.outdir.first; + std::string wholedrvpath = Params.outdir.first; if (Params.is_driver_dir) { // append the folder name to the path - finalpath = CombinePath(Params.outdir.first, Params.drvname.first); + wholedrvpath = CombinePath(Params.outdir.first, Params.drvname.first); + } + + std::string finalpath; + + if (fscreator.GetOutputPath(wholedrvpath, Params.is_rewrite, finalpath) == false) + { + // something wrong with parameters + std::cerr << "Output directory format problem, check parameters" << std::endl; + exit(1); } // create main destination directory diff --git a/src/codegen/fs-creator.cpp b/src/codegen/fs-creator.cpp index 944bce9..b8988bd 100644 --- a/src/codegen/fs-creator.cpp +++ b/src/codegen/fs-creator.cpp @@ -1,5 +1,9 @@ #include #include +#include +#include +#include +#include #include "fs-creator.h" #include "helpers/formatter.h" @@ -93,6 +97,46 @@ void FsCreator::Configure(const std::string& drvname, FS.gen.lowver = lowVer; } +bool FsCreator::GetOutputPath(std::string& path, bool rw, std::string& finalpath) +{ + if (!path.empty() && path.back() == '/') + { + path.pop_back(); + } + + // check if the path is a proper directory + if (!std::filesystem::is_directory(path)) + { + return false; + } + + if (rw) + { + // if rw is true, copy path to finalpath and return true + finalpath = path; + return true; + } + else + { + // if rw is false, find a unique directory path + for (int dirnum = 0; dirnum < 1000; ++dirnum) + { + std::ostringstream oss; + oss << path << "/" << std::setw(3) << std::setfill('0') << dirnum; + std::string candidate = oss.str(); + + if (!std::filesystem::exists(candidate)) + { + finalpath = candidate; + return true; + } + } + + // if no unique path found, return false + return false; + } +} + bool FsCreator::PrepareDirectory(bool rw) { bool ret = false; @@ -103,50 +147,15 @@ bool FsCreator::PrepareDirectory(bool rw) std::string work_dir_path; const auto& basepath = FS.file.core_h.dir; - if (rw) - { - work_dir_path = basepath; - ret = true; + work_dir_path = basepath; + ret = true; - // for this case check only if directory exists - if (stat(work_dir_path.c_str(), &info) != 0) - { - if (!std::filesystem::create_directory(work_dir_path)) - { - ret = false; - } - } - } - else + // for this case check only if directory exists + if (stat(work_dir_path.c_str(), &info) != 0) { - std::string separator = basepath.back() == '/' ? "" : "/"; - - for (int32_t dirnum = 0; dirnum < 1000; dirnum++) + if (!std::filesystem::create_directory(work_dir_path)) { - snprintf(_tmpb, kTmpLen, "%03d", dirnum); - work_dir_path = basepath + separator + _tmpb; - - if (stat(work_dir_path.c_str(), &info) != 0) - { - if (std::filesystem::create_directory(work_dir_path)) - { - ret = true; - break; - } - } - else if (info.st_mode & S_IFDIR) - { - // directory exists, try next num - continue; - } - else - { - if (std::filesystem::create_directory(work_dir_path) != 0) - { - ret = false; - break; - } - } + ret = false; } } diff --git a/src/codegen/fs-creator.h b/src/codegen/fs-creator.h index 5ebb59e..2174f6a 100644 --- a/src/codegen/fs-creator.h +++ b/src/codegen/fs-creator.h @@ -77,6 +77,9 @@ class FsCreator { const std::string& driverinfo, uint32_t highVer, uint32_t lowVer); + + bool GetOutputPath(std::string& path, bool rw, std::string& finalpath); + bool PrepareDirectory(bool rw); std::string CreateSubDir(std::string basepath, std::string subdir, bool rm = true);