Skip to content

Commit

Permalink
Sort bits
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
  • Loading branch information
RRozak committed Jan 21, 2025
1 parent a73aec2 commit e486aa4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/VlcPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class VlcPoint final {
// KEY ACCESSORS
string filename() const { return keyExtract(VL_CIK_FILENAME); }
string comment() const { return keyExtract(VL_CIK_COMMENT); }
string commentStripped() const { return comment().substr(0, comment().find("=")); }
string hier() const { return keyExtract(VL_CIK_HIER); }
string type() const { return keyExtract(VL_CIK_TYPE); }
string thresh() const { return keyExtract(VL_CIK_THRESH); } // string as maybe ""
Expand Down
7 changes: 6 additions & 1 deletion src/VlcSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ class VlcPoint;

class VlcSourceCount final {
// TYPES
using PointsSet = std::set<VlcPoint*>;
struct PointCmp {
bool operator()(const VlcPoint* a, const VlcPoint* b) const {
return a->commentStripped() < b->commentStripped();
}
};
using PointsSet = std::set<VlcPoint*, PointCmp>;

// MEMBERS
const int m_lineno; ///< Line number
Expand Down
2 changes: 1 addition & 1 deletion src/VlcTop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void VlcTop::writeInfo(const string& filename) {
for (const auto& point : sc.points()) {
os << "BRDA:" << sc.lineno() << ",";
os << point_num << ",";
const string cmt = point->comment().substr(0, point->comment().find("="));
const string cmt = point->commentStripped();

if (cmt.rfind("toggle_", 0) != 0) {
std::string typeStr = cmt.substr(0, cmt.find("_"));
Expand Down

0 comments on commit e486aa4

Please sign in to comment.