Line data Source code
1 : #include "wibmod/WIB1/WIB.hh"
2 :
3 0 : std::vector<uint32_t> WIB::CaptureHistory(std::string const & address){
4 0 : std::vector<uint32_t> ret;
5 0 : uint32_t val;
6 0 : while( (val = Read(address)) & 0x1){
7 0 : ret.push_back(val);
8 : }
9 0 : return ret;
10 0 : }
11 :
12 0 : std::vector<uint128_t> WIB::CaptureHistory(std::string const & address,size_t wordCount){
13 0 : std::vector<uint128_t> ret;
14 0 : bool capture = true;
15 0 : uint16_t addr = GetItem(address)->address;
16 0 : while(capture){
17 0 : uint128_t val = 0;
18 : //Read address last since it causes the incr.
19 0 : for(size_t offset = wordCount;offset > 0;offset--){
20 0 : val |= uint128_t(Read(addr+(offset-1)) << 32*(offset-1));
21 : }
22 0 : ret.push_back(val);
23 0 : if(!(val & 0x1)){
24 : break;
25 : }
26 : }
27 0 : return ret;
28 0 : }
|