djmoore Posted May 17 Report Share Posted May 17 Scott Peimann and I were working with uvm-systemc-1.0-beta5 examples,(UBUS) and observed a possible issue. The code only works if an address is within the slave[0] with slave[0-3] defined. File: uvm-systemc-1.0-beta5\examples\uvmsc\integrated\ubus\vip\ubus_bus_monitor.cpp Area of concern: void ubus_bus_monitor::check_which_slave() Original Code: std::string slave_name; bool slave_found = false; slave_addr_map_it it = slave_addr_map.begin(); slave_name = it->first; if(!slave_name.empty()) { do { if ( (slave_addr_map[slave_name]->get_min_addr() <= trans_collected.addr) && (trans_collected.addr <= slave_addr_map[slave_name]->get_max_addr() ) ) { trans_collected.slave = slave_name; slave_found = true; } if (slave_found) break; it++; } while (it != slave_addr_map.end()); assert(slave_found); } else { std::ostringstream msg; msg << "Master attempted a transfer at illegal address 0x" << std::hex << trans_collected.addr.to_uint64(); UVM_ERROR(get_type_name(), msg.str()); } Suggested Code: bool slave_found = false; auto trans_addr = trans_collected.addr; for (auto const &[name, slave]: slave_addr_map) { if ((slave->get_min_addr() <= trans_addr) and (trans_addr <= slave->get_max_addr())) { slave_found = true; break; } } if (not slave_found) { std::ostringstream msg; msg << "Master attempted a transfer at illegal address 0x" << std::hex << trans_collected.addr.to_uint64(); UVM_ERROR(get_type_name(), msg.str()); } Quote Link to comment Share on other sites More sharing options...
Bas Arts Posted May 22 Report Share Posted May 22 Thanks! I have filed an issue in our Github tracker: UBUS does not work at all memory locations · Issue #312 · OSCI-WG/uvm-systemc (github.com) (depending on whether your company is Accellera member, you might or might not have access). -- Bas Quote Link to comment Share on other sites More sharing options...
djmoore Posted May 24 Author Report Share Posted May 24 I am not with a company that is a member. Thanks for you help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.