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:
Matthias Jung
2015-07-29 22:54:15 +02:00
parent 05d0536ff0
commit 4767ae2267
2 changed files with 8 additions and 3 deletions

View File

@@ -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;
}
}

View File

@@ -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