Open ahmed-shafik opened 10 years ago
I used gdb and get below (_n=18446744073709547290) after statement
return size_type(this->_M_impl._M_finish - this->_M_impl._M_start)
although in normal state the (n=2048). Do you know why ?
DRAMSim::Rank::Rank (this=0x6534e0, dramsimlog=...) at Rank.cpp:48
48 bankStates(NUM_BANKS, BankState(dramsimlog))
(gdb)
DRAMSim::SimulatorObject::SimulatorObject (this=0x6534e0) at SimulatorObject.h:50
50 class SimulatorObject
(gdb)
std::vector<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::vector (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:247
247 : _Base() { }
(gdb)
std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_base (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:126
126 : _M_impl() { }
(gdb)
std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_impl::_Vector_impl (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:88
88 : _Tp_alloc_type(), _M_start(0), _M_finish(0), _M_end_of_storage(0)
(gdb)
std::allocatorDRAMSim::BusPacket*::allocator (this=0x653538) at /usr/include/c++/4.7/bits/allocator.h:104
104 allocator() throw() { }
(gdb)
gnu_cxx::new_allocatorDRAMSim::BusPacket::new_allocator (this=0x653538) at /usr/include/c++/4.7/ext/new_allocator.h:69
69 new_allocator() _GLIBCXX_USE_NOEXCEPT { }
(gdb)
std::_Vector_base<DRAMSim::BusPacket, std::allocator<DRAMSim::BusPacket> >::_Vector_impl::_Vector_impl (this=0x653538) at /usr/include/c++/4.7/bits/stl_vector.h:89
89 { }
(gdb)
std::allocator
std::uninitialized_fill_n_a<unsigned int*, unsigned long, unsigned int, unsigned int> (first=0x0, n=0, __x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:336 336 { std::uninitialized_fill_n(first, n, x); } (gdb) std::uninitialized_fill_n<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, __x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:225 225 std::uninitialized_fill_n<is_trivial(_ValueType)>::
(gdb)
std::uninitialized_fill_n
std::fill_n_a<unsigned int*, unsigned long, unsigned int> (first=0x0, n=0, value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:742
742 const _Tp tmp = value;
(gdb)
743 for (decltype(n + 0) niter = n;
(gdb)
746 return first;
(gdb)
747 }
(gdb)
std::fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, __value=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_algobase.h:781
781 }
(gdb)
std::uninitialized_fill_n<unsigned int, unsigned long, unsigned int> (first=0x0, n=0, x=@0x7fffffffdefc: 0) at /usr/include/c++/4.7/bits/stl_uninitialized.h:227
227 }
(gdb)
std::vector<unsigned int, std::allocator
std::uninitialized_fill_n
(gdb) std::addressofDRAMSim::Bank (r=...) at /usr/include/c++/4.7/bits/move.h:50
50 (&const_cast<char&>(reinterpret_cast<const volatile char&>(r)));
(gdb)
51 }
(gdb)
std::_Construct<DRAMSim::Bank, DRAMSim::Bank> (p=0x6535d0, value=...) at /usr/include/c++/4.7/bits/stl_construct.h:85
85 ::new(static_cast<void*>(__p)) _T1(value);
(gdb)
operator new (p=0x6535d0) at /usr/include/c++/4.7/new:112
112 { return p; }
(gdb)
DRAMSim::Bank::Bank (this=0x6535d0) at Bank.h:54
54 class Bank
(gdb)
std::vector<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::vector (this=0x653620, x=...) at /usr/include/c++/4.7/bits/stl_vector.h:309
309 _Alloc_traits::_S_select_on_copy(__x._M_get_Tp_allocator()))
(gdb)
std::_Vector_base<DRAMSim::Bank::_DataStruct, std::allocator<DRAMSim::Bank::_DataStruct> >::_M_get_Tp_allocator (this=0x7fffffffdf50)
at /usr/include/c++/4.7/bits/stl_vector.h:119
119 { return _static_cast
Dears,
I get the below error while creating a new rank object because of adding new bankstates (nextWrite_H & nextRead_H) in BankState.h and BankState.cpp. Do you know why?
class BankState { ostream &dramsim_log; public: //Fields CurrentBankState currentBankState; unsigned openRowAddress; uint64_t nextRead; uint64_t nextWrite; uint64_t nextRead_H; uint64_t nextWrite_H; uint64_t nextActivate; uint64_t nextPrecharge; uint64_t nextPowerUp;
}; }
//All banks start precharged BankState::BankState(ostream &dramsimlog): dramsim_log(dramsimlog), currentBankState(Idle), openRowAddress(0), nextRead(0), nextRead_H(0), nextWrite(0), nextWrite_H(0), nextActivate(0), nextPrecharge(0), nextPowerUp(0), lastCommand(READ), stateChangeCountdown(0) {}
Rank *r = new Rank(dramsim_log); terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped)