Added amount structure to the xmlAddress decoder
With this structure it is possible to get e.g. the number of bytes from the mapping configuration.
This commit is contained in:
@@ -79,6 +79,8 @@ xmlAddressDecoder::xmlAddressDecoder(XMLElement* addressmap)
|
||||
|
||||
shifts[child->Name()] = from;
|
||||
masks[child->Name()] = pow(2.0, to + 1.0) - pow(2.0, from + 0.0);
|
||||
amount[child->Name()] = pow(2.0, to - from + 1.0);
|
||||
//std::cout << child->Name() << " XXXX " << pow(2.0, to - from + 1.0) <<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ struct DecodedAddress
|
||||
class xmlAddressDecoder
|
||||
{
|
||||
|
||||
public:
|
||||
public:
|
||||
|
||||
static tinyxml2::XMLElement* addressmapping;
|
||||
static tinyxml2::XMLElement* addressmapping;
|
||||
static inline xmlAddressDecoder& getInstance()
|
||||
{
|
||||
static xmlAddressDecoder decoder(xmlAddressDecoder::addressmapping);
|
||||
@@ -83,12 +83,15 @@ static tinyxml2::XMLElement* addressmapping;
|
||||
|
||||
|
||||
void print();
|
||||
private:
|
||||
private:
|
||||
xmlAddressDecoder(std::string URI);
|
||||
xmlAddressDecoder(tinyxml2::XMLElement* addressMap);
|
||||
|
||||
std::map<std::string, sc_dt::uint64> masks;
|
||||
std::map<std::string, unsigned int> shifts;
|
||||
|
||||
public:
|
||||
std::map<std::string, unsigned int> amount;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user