diff options
author | Luca Barbieri <luca@luca-barbieri.com> | 2010-03-28 19:15:29 +0200 |
---|---|---|
committer | Luca Barbieri <luca@luca-barbieri.com> | 2010-03-28 19:15:29 +0200 |
commit | 7730f2e4401b36d9d46e7612ec87970b523b874f (patch) | |
tree | 51331ed49e668519acf700230e060c2437060bd4 | |
parent | 48d962a103328f2c7c17c136f30eeca24497d900 (diff) |
add channels, remove fifos
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | channels.cpp | 20 | ||||
-rw-r--r-- | fifos.cpp | 19 |
3 files changed, 21 insertions, 20 deletions
@@ -1,6 +1,6 @@ CXXFLAGS = -g -O0 -Wall -fmessage-length=0 -fno-inline-functions -fno-inline LIBS = -lpciaccess -TARGETS = nvexec_raw ramfc fifos ramht pgraph peek poke dump dump-nonzero +TARGETS = nvexec_raw ramfc channels ramht pgraph peek poke dump dump-nonzero all: $(TARGETS) diff --git a/channels.cpp b/channels.cpp new file mode 100644 index 0000000..4757ace --- /dev/null +++ b/channels.cpp @@ -0,0 +1,20 @@ +#include "nvlib.h" +using namespace std; + +int main(int argc, char** argv) +{ + std::auto_ptr<nv_device> dev; + dev.reset(nv_device::open_default()); + + for(unsigned i = 0; i < dev->channels; ++i) { + if(i) + printf("\n"); + printf("Channel %i\n", i); + printf(" enabled = %i\n", dev->is_channel_enabled(i)); + printf(" dma = %08x\n", dev->ramfc->fc[i]->rd32(dev->ramfc->fc_fifo) << 4); + printf(" get = %08x\n", dev->users->user[i]->rd_get()); + printf(" put = %08x\n", dev->users->user[i]->rd_get()); + } + return 0; +} + diff --git a/fifos.cpp b/fifos.cpp deleted file mode 100644 index 05ae2d0..0000000 --- a/fifos.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "nvlib.h" -using namespace std; - -int main(int argc, char** argv) -{ - std::auto_ptr<nv_device> dev; - dev.reset(nv_device::open_default()); - - for(unsigned i = 0; i < dev->channels; ++i) { - cout << "Channel " << i << endl; - uint32_t instance = dev->ramfc->fc[i]->rd32(dev->ramfc->fc_fifo) << 4; - cout << hex << dev->ramin->rd32(instance + 0) << endl; - cout << hex << dev->ramin->rd32(instance + 4) << endl; - cout << hex << dev->ramin->rd32(instance + 8) << endl; - cout << hex << dev->ramin->rd32(instance + 12) << endl; - } - return 0; -} - |