Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanups #913

Draft
wants to merge 59 commits into
base: master_devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b6f8817
update mlxconfig and tools_layouts to match mft lts 4.26.1
tomer540 Nov 13, 2023
708fcda
mlxdpa: update copyright headers
Jan 4, 2024
5c09c98
common: personalize common routines' naming
Jan 7, 2024
14ede9b
flint: explicitly link with pthread
Jan 7, 2024
38ad13c
autotools: fix std::regex compatibility check for cross-compilation
thillux Nov 11, 2023
17e9b84
mtcr_ul: fallback to linux pci.h if sys pci.h isn't available
tk154 Jan 4, 2024
1badd22
update mstflint version for 4.27.0 release
Jan 23, 2024
0c3c5e2
mlxfwreset | Adding mst restart after reset with sync 1.
itayav17 Jan 9, 2024
e385cfc
mlxfwreset | FR #3657606: Identify that we are in Controller mode and…
itayav17 Jan 16, 2024
7ee4b1a
mlxfwreset | remove unsupported switches that doesn't support MRSR-1
itayav17 Jan 16, 2024
cb053c6
porting "support FILE_DEVICE_ID TLV in NVconfig"
tomer540 Jan 23, 2024
086501c
[mlxlink] - update amber collect to version 2.8
lgofman Jan 23, 2024
8c29205
[mlxlink] - update the compliance speeds
lgofman Jan 23, 2024
cc8d6b0
[mlxlink] - Product Technology - changed to be read from SLTP instead…
lgofman Jan 23, 2024
8b5b15b
[auto-gen] updating auto-gen code for Nic & Switch PRMs in addition t…
HarelKarni Jan 23, 2024
fd1e3d6
[adb_parser] port from mft_4.27.0
alonStr Jan 23, 2024
4c93846
[resourcetools] port from mft_4.27.0
alonStr Jan 23, 2024
c822114
[mlxlink] Fixing NDR modulation config in prbs testmode
lgofman Jan 23, 2024
a6b1606
[mlxlink] - fixing mlxlink infra
lgofman Jan 23, 2024
fa615ce
Update mlxlink_ui.cpp
lgofman Jan 24, 2024
f26027b
[mlxlink] [Patch-2] Adding support for plane
lgofman Jan 24, 2024
9b81d83
[degradation][flint] rsa cmd fails when trying to sign the image usin…
ashargorodsk Jan 23, 2024
7087173
[BF3] flint tool failed to query bf3 device from host after disable F…
ashargorodsk Jan 23, 2024
e6b9892
[ArcusE][Flint] flint cannot open ArcusE device
ashargorodsk Jan 23, 2024
b7e0a1b
[Umbriel][mflash] support new JEDEC ids for canoe board
ashargorodsk Jan 23, 2024
488362d
doesn't support burning FS5 images in Q3 device
ashargorodsk Nov 13, 2023
4c9608e
production burn fails and shows that the FW type is unknown
ashargorodsk Nov 16, 2023
8aad9bf
[Gilboa] generating CX8 image failed - Invalid device-type 4131
ashargorodsk Jan 23, 2024
ebbdbb9
[mic][flint] configure root node in ini file and flint support for ne…
ashargorodsk Jan 23, 2024
6a2518d
support new flash WP MCC error
ashargorodsk Nov 29, 2023
bb8d11f
Failed to dump configuration on new image format
ashargorodsk Dec 26, 2023
4b20b80
syndrome 0x8f333 on libc signed app
ashargorodsk Dec 25, 2023
8182afa
Failed to burn VPD with new flash layout
ashargorodsk Dec 27, 2023
3fae340
[Pre sil][Sunbird][flint] Sign fw image - extract fw image for encaps…
ashargorodsk Jan 23, 2024
1804fd9
[flint] new FW_DEBUG_DUMP section type
ashargorodsk Jan 23, 2024
b2fdede
set_signed_fw_components broken for QM3 image with dtoc section at ne…
ashargorodsk Jan 8, 2024
1d111b1
DTOC appears after 2 FW burns instaed of 1 burn on secured board of C…
ashargorodsk Jan 16, 2024
cfaf2c5
[flint] Secure-host failure message changed to general FW failure ins…
ashargorodsk Jan 23, 2024
2c8566a
[mlxlink] - mlxlink failed with '-E- Showing PDDR raised'
lgofman Jan 24, 2024
c31a647
[mlxlink] Fixing error message and help menu issues
lgofman Jan 23, 2024
3af4e8c
Update mlxlink_err_inj_commander.cpp
lgofman Jan 24, 2024
54502d8
[mlxlink][XDR] Supiporting the new SL* for new genaration
lgofman Jan 23, 2024
32426d0
Update mlxlink_commander.h
lgofman Jan 24, 2024
219099f
Update mlxlink_commander.cpp
lgofman Jan 24, 2024
1968894
Update mlxlink_maps.h
lgofman Jan 24, 2024
743538c
coverity fixes.
shellysela219 Jan 25, 2024
523b141
[mlxlink][BW00] Fixing port access for BW
boded Jan 25, 2024
e419373
Update mlxlink_commander.cpp beautify format
boded Jan 25, 2024
51573d7
mlxdpa: elfio: Include <cstdint> when necessary to have definition fo…
trofi Jan 5, 2024
a1d9f28
Ignore built .la files
tzafrir-mellanox Jan 29, 2024
35de57a
Remove duplicate definition of VERSION
tzafrir-mellanox Jan 29, 2024
710a014
minixz: Mark implicit fallthrough
tzafrir-mellanox Jan 29, 2024
016e272
mlxfwops: Auto fallthrough
tzafrir-mellanox Jan 29, 2024
c288b4d
tools_crypto: Ignore deprecation warnings about openssl1
tzafrir-mellanox Jan 29, 2024
2e24d41
Ignore deprecation warnings about openssl1
tzafrir-mellanox Jan 29, 2024
2d8c5ac
Remove unused variables
tzafrir-mellanox Jan 29, 2024
bbfd4b0
mlxfwops: Constify exceptions
tzafrir-mellanox Jan 29, 2024
b58f494
mlxfwops: Ignore warnings about unused parameters
tzafrir-mellanox Jan 29, 2024
800c50c
mlxfwops: ignore strncpy warnings
tzafrir-mellanox Jan 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.a
*.o
*.la
*.lo
*.so
.deps/
Expand Down
2 changes: 1 addition & 1 deletion adb_parser/adb_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <vector>
#include <stdio.h>
#include <string>
#include "common/algorithm.h"
#include "common/tools_algorithm.h"
#include "adb_db.h"

#define CHECK_FIELD(field, node_w) \
Expand Down
25 changes: 25 additions & 0 deletions adb_parser/adb_exceptionHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,28 @@ void ExceptionHolder::insertNewException(const string exceptionType, string exce
ExceptionHolder::adbExceptionMap[exceptionType].push_back(exceptionTxt);
ExceptionHolder::exceptionCounter += 1;
}

/**
* Function: Adb::printAdbExceptionMap
* This function will pring the content of the Adb Exception Map
**/
string ExceptionHolder::printAdbExceptionMap()
{
string errorStr = "";
vector<string> fatals = ExceptionHolder::adbExceptionMap[ExceptionHolder::FATAL_EXCEPTION];
for (vector<string>::iterator it = fatals.begin(); it != fatals.end(); ++it)
{
errorStr += "-" + ExceptionHolder::FATAL_EXCEPTION + "- " + *it + ";";
}
vector<string> errors = ExceptionHolder::adbExceptionMap[ExceptionHolder::ERROR_EXCEPTION];
for (vector<string>::iterator it = errors.begin(); it != errors.end(); ++it)
{
errorStr += "-" + ExceptionHolder::ERROR_EXCEPTION + "- " + *it + ";";
}
vector<string> warnings = ExceptionHolder::adbExceptionMap[ExceptionHolder::WARN_EXCEPTION];
for (vector<string>::iterator it = warnings.begin(); it != warnings.end(); ++it)
{
errorStr += "-" + ExceptionHolder::WARN_EXCEPTION + "- " + "- " + *it + ";";
}
return errorStr;
}
1 change: 1 addition & 0 deletions adb_parser/adb_exceptionHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class ExceptionHolder
static void insertNewException(const string exceptionType, string exceptionTxt);
static ExceptionsMap getAdbExceptionsMap();
static int getNumberOfExceptions();
static string printAdbExceptionMap();

public:
// VARIABLES
Expand Down
77 changes: 59 additions & 18 deletions adb_parser/adb_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#include <list>

#include "common/algorithm.h"
#include "common/tools_algorithm.h"
#include "common/tools_regex.h"

// Constants
Expand Down Expand Up @@ -78,7 +78,10 @@ AdbInstance::AdbInstance(AdbField* i_fieldDesc,
map<string, string> vars,
bool bigEndianArr,
bool isExprEval,
unsigned char adabe_version) :
unsigned char adabe_version,
bool optimize_time,
bool stop_on_partition,
PartitionTree* next_partition_tree) :
fieldDesc(i_fieldDesc),
nodeDesc(i_nodeDesc),
parent(i_parent),
Expand All @@ -89,6 +92,11 @@ AdbInstance::AdbInstance(AdbField* i_fieldDesc,
// Re-initializations due to packing efficiency
string array_name_suffix{fieldDesc->isArray() ? "[" + to_string(arrIdx + fieldDesc->lowBound) + "]" : ""};
layout_item_name = i_fieldDesc->name + array_name_suffix;
if (optimize_time)
{
full_path = parent ? parent->full_path + "." + layout_item_name : layout_item_name;
}


// TODO: the whole block below looks unnecesarry
if (fieldDesc->offset == 0xffffffff)
Expand All @@ -103,12 +111,20 @@ AdbInstance::AdbInstance(AdbField* i_fieldDesc,
}
}

init_props(adabe_version);
if (stop_on_partition)
{
partition_tree = next_partition_tree;
}

if (isExprEval)
{
initInstOps(false);
eval_expressions(vars);
if (!stop_on_partition)
{
init_props(adabe_version);

initInstOps();
eval_expressions(vars);
}
}
}

Expand All @@ -117,16 +133,17 @@ void AdbInstance::initInstOps(bool is_root)
AttrsMap& attrs_map = is_root ? nodeDesc->attrs : fieldDesc->attrs;
inst_ops_props = new InstOpsProperties(attrs_map);

auto found_it = getInstanceAttrIterator("condition");
if (found_it != inst_ops_props->instAttrsMap.end() && parent->getInstanceAttr("is_conditional") == "1")
string value;
auto found = getInstanceAttr("condition", value);
if (found && parent->getInstanceAttr("is_conditional") == "1")
{
inst_ops_props->condition.setCondition(found_it->second);
inst_ops_props->condition.setCondition(value);
}

found_it = getInstanceAttrIterator("size_condition");
if (found_it != inst_ops_props->instAttrsMap.end())
found = getInstanceAttr("size_condition", value);
if (found)
{
string cond_size = found_it->second;
string cond_size = value;
if (cond_size.substr(0, 10) == "$(parent).")
{
cond_size.erase(0, 10);
Expand Down Expand Up @@ -171,6 +188,11 @@ u_int32_t AdbInstance::calcArrOffset(bool bigEndianArr)
return o_offset;
}

bool AdbInstance::stop_on_partition() const
{
return partition_tree != nullptr;
}

void AdbInstance::eval_expressions(AttrsMap& parent_vars)
{
static mstflint::common::regex::regex EXP_REGEX(EXP_PATTERN);
Expand Down Expand Up @@ -402,6 +424,10 @@ bool AdbInstance::isPartOfArray()
**/
string AdbInstance::fullName(size_t skipLevel)
{
if (full_path.size() > 0)
{
return full_path;
}
list<string> fnList;
AdbInstance* p = parent;

Expand Down Expand Up @@ -562,19 +588,19 @@ void AdbInstance::set_is_diff(bool val)
}

/**
* Function: AdbInstance::fullName
* Function: AdbInstance::dwordAddr
**/
u_int32_t AdbInstance::dwordAddr()
u_int32_t AdbInstance::dwordAddr(uint8_t alignment)
{
return (offset >> 5) << 2;
return (offset / alignment) << 2;
}

/**
* Function: AdbInstance::fullName
* Function: AdbInstance::startBit
**/
u_int32_t AdbInstance::startBit()
u_int32_t AdbInstance::startBit(uint8_t alignment)
{
return offset % 32;
return offset % alignment;
}

/**
Expand Down Expand Up @@ -660,6 +686,19 @@ vector<AdbInstance*> AdbInstance::findChild(const string& childName, bool isCase
return childList;
}

/**
* Function: AdbInstance::get_root
**/
AdbInstance* AdbInstance::get_root()
{
auto current_layout_item = this;
while (current_layout_item->parent)
{
current_layout_item = current_layout_item->parent;
}
return current_layout_item;
}

/**
* Function: AdbInstance::getAttr
**/
Expand Down Expand Up @@ -800,7 +839,9 @@ AttrsMap AdbInstance::getVarsMap()
**/
bool AdbInstance::isEnumExists()
{
return inst_ops_props ? inst_ops_props->instAttrsMap.contains("enum") : fieldDesc->attrs.count("enum");
return inst_ops_props ? inst_ops_props->instAttrsMap.contains("enum") :
fieldDesc ? fieldDesc->attrs.count("enum") :
false;
}

/**
Expand Down
22 changes: 19 additions & 3 deletions adb_parser/adb_instance.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ using namespace xmlCreator;
typedef map<string, string> AttrsMap;
class AdbField;
class AdbNode;
struct PartitionTree;
class LayoutItemAttrsMap
{
public:
Expand Down Expand Up @@ -144,6 +145,13 @@ class AdbInstance
}
};

struct LayoutPartitionProps
{
PartitionTree* partition_tree;

LayoutPartitionProps(PartitionTree* tree);
};

public:
// Methods
AdbInstance() = default;
Expand All @@ -154,10 +162,15 @@ class AdbInstance
map<string, string> vars,
bool bigEndianArr,
bool isExprEval,
unsigned char adabe_version = 1);
unsigned char adabe_version = 1,
bool optimize_time = false,
bool stop_on_partition = false,
PartitionTree* next_partition_tree = nullptr);

~AdbInstance();
void init_props(unsigned char adabe_version);
u_int32_t calcArrOffset(bool bigEndianArr);
bool stop_on_partition() const;
void eval_expressions(AttrsMap& i_vars);
static string evalExpr(string expr, AttrsMap* vars);
const string& get_field_name();
Expand All @@ -174,9 +187,9 @@ class AdbInstance
bool is_wo() const;
bool is_diff() const;
void set_is_diff(bool val);
u_int32_t dwordAddr();
u_int32_t startBit();
bool isEnumExists();
u_int32_t dwordAddr(uint8_t alignment = 32);
u_int32_t startBit(uint8_t alignment = 32);
bool enumToInt(const string& name, u_int64_t& val); // false means no enum value found
bool intToEnum(u_int64_t val, string& valName); // false means no enum name found
map<string, u_int64_t> getEnumMap();
Expand All @@ -189,6 +202,7 @@ class AdbInstance
// DB like access methods
AdbInstance* getChildByPath(const string& path, bool isCaseSensitive = true);
vector<AdbInstance*> findChild(const string& name, bool isCaseSensitive = true, bool by_inst_name = false);
AdbInstance* get_root();
string getInstanceAttr(const string& attrName) const;
bool getInstanceAttr(const string& attrName, string& value);
LayoutItemAttrsMap::iterator getInstanceAttrIterator(const string& attrName);
Expand All @@ -210,6 +224,7 @@ class AdbInstance

// Members
string layout_item_name{}; // instance name
string full_path{};
vector<AdbInstance*> subItems{};
AdbField* fieldDesc{nullptr};
AdbNode* nodeDesc{nullptr};
Expand All @@ -221,6 +236,7 @@ class AdbInstance
u_int32_t size{0}; // in bits
u_int32_t maxLeafSize{0}; // in bits for DS alignment check
InstancePropertiesMask inst_props{};
PartitionTree* partition_tree{nullptr};
};

#endif
Loading