20 #ifndef __simpleAddressMap_h__
21 #define __simpleAddressMap_h__
34 typedef std::map<sc_dt::uint64, unsigned int>
mapType;
56 std::cout<<
"Address check successful."<<std::endl;
67 std::cout<<
"SimpleAddressMap: printing the sorted MAP:"<<std::endl;
71 printf(
"key: %x value: %i \n", (
unsigned int) ((pos->first+1)>>1)-1, pos->second);
73 printf(
"key: %x value: %i \n", (
unsigned int) (pos->first>>1)-1, pos->second);
90 if((lbound->second == 255) | (lbound==
m_addressMap.end())){
91 SC_REPORT_ERROR(
"SimpleAddressMap",
"Address does not match any registered address range.");
94 return lbound->second;
107 SC_REPORT_ERROR(
"SimpleAddressMap",
"get_max() called on empty address map.");
119 SC_REPORT_ERROR(
"SimpleAddressMap",
"get_min() called on empty address map.");
131 if(baseAddress_>highAddress_)
132 SC_REPORT_ERROR(
"SimpleAddressMap",
"Base address must be lower than high address.");
134 SC_REPORT_ERROR(
"SimpleAddressMap",
"Only ;-) 255 targets can be handled.");
135 m_addressMap.insert(mapType::value_type(((baseAddress_+1)<<1)-1, 255 ));
136 m_addressMap.insert(mapType::value_type( (highAddress_+1)<<1 ,portNumber_));