Test software: Added DataSet management trim and info commands and scripts for deallo...
authorTerry Barnaby <terry.barnaby@beam.beam.ltd.uk>
Sat, 13 Jun 2020 05:07:33 +0000 (06:07 +0100)
committerTerry Barnaby <terry.barnaby@beam.beam.ltd.uk>
Sat, 13 Jun 2020 05:07:33 +0000 (06:07 +0100)
docsrc/DuneNvmeStorageDesign.odt
docsrc/DuneNvmeStorageManual.odt
sim/testbench/test020-write.sav
test/BeamLibBasic.h
test/NvmeAccess.cpp
test/NvmeAccess.h
test/test_deallocate.sh
test/test_nvme.cpp

index 5275a61d9ad49b16e6053be5cef5cb0d7e37830d..ad308456dad8ea6eeb8c55270c0910439241a424 100644 (file)
Binary files a/docsrc/DuneNvmeStorageDesign.odt and b/docsrc/DuneNvmeStorageDesign.odt differ
index e4237fb2c294bcf40d578ec12e7684dd0699a840..a90c388c3aaa35cbe5cdaeb6421d6df6d159c19a 100644 (file)
Binary files a/docsrc/DuneNvmeStorageManual.odt and b/docsrc/DuneNvmeStorageManual.odt differ
index e2be4b6958b1351270f8a0b5cf8f7b2ca30c0f98..522ddc81910974d9f57517659b9543982b7f0a9c 100644 (file)
@@ -1,15 +1,15 @@
 [*]
 [*] GTKWave Analyzer v3.3.105 (w)1999-2020 BSI
-[*] Tue Jun  9 05:42:23 2020
+[*] Wed Jun 10 15:11:03 2020
 [*]
-[dumpfile] "/src/dune/FpgaPlay/test034-nvme-t6/sim/simu/test.ghw"
-[dumpfile_mtime] "Tue Jun  9 05:36:16 2020"
-[dumpfile_size] 4279320
-[savefile] "/src/dune/FpgaPlay/test034-nvme-t6/sim/testbench/test020-write.sav"
-[timestart] 3152700000
+[dumpfile] "/src/dune/FpgaPlay/test035-nvme-t1/sim/simu/test.ghw"
+[dumpfile_mtime] "Wed Jun 10 10:14:59 2020"
+[dumpfile_size] 2856901
+[savefile] "/src/dune/FpgaPlay/test035-nvme-t1/sim/testbench/test020-write.sav"
+[timestart] 0
 [size] 1920 1171
 [pos] -1 -1
-*-26.418455 3299700000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
+*-26.418455 276200000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
 [treeopen] top.
 [treeopen] top.test.
 [treeopen] top.test.axil.
@@ -41,7 +41,7 @@
 [treeopen] top.test.nvmestorage0.nvmestorageunit0.streamswitch0.streamout.[0].
 [treeopen] top.test.testdata0.
 [sst_width] 323
-[signals_width] 737
+[signals_width] 678
 [sst_expanded] 1
 [sst_vpaned_height] 768
 @28
@@ -94,12 +94,6 @@ top.test.nvmestorage0.dropcount
 top.test.nvmestorage0.nvmestorageunit0.reset_local_counter
 @28
 top.test.nvmestorage0.nvmestorageunit0.reset_local_active
-@22
-#{top.test.nvmestorage0.nvmestorageunit0.regaddress[7:0]} top.test.nvmestorage0.nvmestorageunit0.regaddress[5] top.test.nvmestorage0.nvmestorageunit0.regaddress[4] top.test.nvmestorage0.nvmestorageunit0.regaddress[3] top.test.nvmestorage0.nvmestorageunit0.regaddress[2] top.test.nvmestorage0.nvmestorageunit0.regaddress[1] top.test.nvmestorage0.nvmestorageunit0.regaddress[0]
-#{top.test.nvmestorage0.nvmestorageunit0.regdatain[31:0]} top.test.nvmestorage0.nvmestorageunit0.regdatain[31] top.test.nvmestorage0.nvmestorageunit0.regdatain[30] top.test.nvmestorage0.nvmestorageunit0.regdatain[29] top.test.nvmestorage0.nvmestorageunit0.regdatain[28] top.test.nvmestorage0.nvmestorageunit0.regdatain[27] top.test.nvmestorage0.nvmestorageunit0.regdatain[26] top.test.nvmestorage0.nvmestorageunit0.regdatain[25] top.test.nvmestorage0.nvmestorageunit0.regdatain[24] top.test.nvmestorage0.nvmestorageunit0.regdatain[23] top.test.nvmestorage0.nvmestorageunit0.regdatain[22] top.test.nvmestorage0.nvmestorageunit0.regdatain[21] top.test.nvmestorage0.nvmestorageunit0.regdatain[20] top.test.nvmestorage0.nvmestorageunit0.regdatain[19] top.test.nvmestorage0.nvmestorageunit0.regdatain[18] top.test.nvmestorage0.nvmestorageunit0.regdatain[17] top.test.nvmestorage0.nvmestorageunit0.regdatain[16] top.test.nvmestorage0.nvmestorageunit0.regdatain[15] top.test.nvmestorage0.nvmestorageunit0.regdatain[14] top.test.nvmestorage0.nvmestorageunit0.regdatain[13] top.test.nvmestorage0.nvmestorageunit0.regdatain[12] top.test.nvmestorage0.nvmestorageunit0.regdatain[11] top.test.nvmestorage0.nvmestorageunit0.regdatain[10] top.test.nvmestorage0.nvmestorageunit0.regdatain[9] top.test.nvmestorage0.nvmestorageunit0.regdatain[8] top.test.nvmestorage0.nvmestorageunit0.regdatain[7] top.test.nvmestorage0.nvmestorageunit0.regdatain[6] top.test.nvmestorage0.nvmestorageunit0.regdatain[5] top.test.nvmestorage0.nvmestorageunit0.regdatain[4] top.test.nvmestorage0.nvmestorageunit0.regdatain[3] top.test.nvmestorage0.nvmestorageunit0.regdatain[2] top.test.nvmestorage0.nvmestorageunit0.regdatain[1] top.test.nvmestorage0.nvmestorageunit0.regdatain[0]
-#{top.test.nvmestorage0.nvmestorageunit0.reg_control[31:0]} top.test.nvmestorage0.nvmestorageunit0.reg_control[31] top.test.nvmestorage0.nvmestorageunit0.reg_control[30] top.test.nvmestorage0.nvmestorageunit0.reg_control[29] top.test.nvmestorage0.nvmestorageunit0.reg_control[28] top.test.nvmestorage0.nvmestorageunit0.reg_control[27] top.test.nvmestorage0.nvmestorageunit0.reg_control[26] top.test.nvmestorage0.nvmestorageunit0.reg_control[25] top.test.nvmestorage0.nvmestorageunit0.reg_control[24] top.test.nvmestorage0.nvmestorageunit0.reg_control[23] top.test.nvmestorage0.nvmestorageunit0.reg_control[22] top.test.nvmestorage0.nvmestorageunit0.reg_control[21] top.test.nvmestorage0.nvmestorageunit0.reg_control[20] top.test.nvmestorage0.nvmestorageunit0.reg_control[19] top.test.nvmestorage0.nvmestorageunit0.reg_control[18] top.test.nvmestorage0.nvmestorageunit0.reg_control[17] top.test.nvmestorage0.nvmestorageunit0.reg_control[16] top.test.nvmestorage0.nvmestorageunit0.reg_control[15] top.test.nvmestorage0.nvmestorageunit0.reg_control[14] top.test.nvmestorage0.nvmestorageunit0.reg_control[13] top.test.nvmestorage0.nvmestorageunit0.reg_control[12] top.test.nvmestorage0.nvmestorageunit0.reg_control[11] top.test.nvmestorage0.nvmestorageunit0.reg_control[10] top.test.nvmestorage0.nvmestorageunit0.reg_control[9] top.test.nvmestorage0.nvmestorageunit0.reg_control[8] top.test.nvmestorage0.nvmestorageunit0.reg_control[7] top.test.nvmestorage0.nvmestorageunit0.reg_control[6] top.test.nvmestorage0.nvmestorageunit0.reg_control[5] top.test.nvmestorage0.nvmestorageunit0.reg_control[4] top.test.nvmestorage0.nvmestorageunit0.reg_control[3] top.test.nvmestorage0.nvmestorageunit0.reg_control[2] top.test.nvmestorage0.nvmestorageunit0.reg_control[1] top.test.nvmestorage0.nvmestorageunit0.reg_control[0]
-#{top.test.nvmestorage0.nvmestorageunit0.reg_status[31:0]} top.test.nvmestorage0.nvmestorageunit0.reg_status[31] top.test.nvmestorage0.nvmestorageunit0.reg_status[30] top.test.nvmestorage0.nvmestorageunit0.reg_status[29] top.test.nvmestorage0.nvmestorageunit0.reg_status[28] top.test.nvmestorage0.nvmestorageunit0.reg_status[27] top.test.nvmestorage0.nvmestorageunit0.reg_status[26] top.test.nvmestorage0.nvmestorageunit0.reg_status[25] top.test.nvmestorage0.nvmestorageunit0.reg_status[24] top.test.nvmestorage0.nvmestorageunit0.reg_status[23] top.test.nvmestorage0.nvmestorageunit0.reg_status[22] top.test.nvmestorage0.nvmestorageunit0.reg_status[21] top.test.nvmestorage0.nvmestorageunit0.reg_status[20] top.test.nvmestorage0.nvmestorageunit0.reg_status[19] top.test.nvmestorage0.nvmestorageunit0.reg_status[18] top.test.nvmestorage0.nvmestorageunit0.reg_status[17] top.test.nvmestorage0.nvmestorageunit0.reg_status[16] top.test.nvmestorage0.nvmestorageunit0.reg_status[15] top.test.nvmestorage0.nvmestorageunit0.reg_status[14] top.test.nvmestorage0.nvmestorageunit0.reg_status[13] top.test.nvmestorage0.nvmestorageunit0.reg_status[12] top.test.nvmestorage0.nvmestorageunit0.reg_status[11] top.test.nvmestorage0.nvmestorageunit0.reg_status[10] top.test.nvmestorage0.nvmestorageunit0.reg_status[9] top.test.nvmestorage0.nvmestorageunit0.reg_status[8] top.test.nvmestorage0.nvmestorageunit0.reg_status[7] top.test.nvmestorage0.nvmestorageunit0.reg_status[6] top.test.nvmestorage0.nvmestorageunit0.reg_status[5] top.test.nvmestorage0.nvmestorageunit0.reg_status[4] top.test.nvmestorage0.nvmestorageunit0.reg_status[3] top.test.nvmestorage0.nvmestorageunit0.reg_status[2] top.test.nvmestorage0.nvmestorageunit0.reg_status[1] top.test.nvmestorage0.nvmestorageunit0.reg_status[0]
-@28
 top.test.axil.toslave.arvalid
 top.test.axil.tomaster.arready
 top.test.axil.tomaster.awready
@@ -109,6 +103,16 @@ top.test.axil.toslave.rready
 top.test.axil.tomaster.rvalid
 @22
 #{top.test.axil.tomaster.rdata[31:0]} top.test.axil.tomaster.rdata[31] top.test.axil.tomaster.rdata[30] top.test.axil.tomaster.rdata[29] top.test.axil.tomaster.rdata[28] top.test.axil.tomaster.rdata[27] top.test.axil.tomaster.rdata[26] top.test.axil.tomaster.rdata[25] top.test.axil.tomaster.rdata[24] top.test.axil.tomaster.rdata[23] top.test.axil.tomaster.rdata[22] top.test.axil.tomaster.rdata[21] top.test.axil.tomaster.rdata[20] top.test.axil.tomaster.rdata[19] top.test.axil.tomaster.rdata[18] top.test.axil.tomaster.rdata[17] top.test.axil.tomaster.rdata[16] top.test.axil.tomaster.rdata[15] top.test.axil.tomaster.rdata[14] top.test.axil.tomaster.rdata[13] top.test.axil.tomaster.rdata[12] top.test.axil.tomaster.rdata[11] top.test.axil.tomaster.rdata[10] top.test.axil.tomaster.rdata[9] top.test.axil.tomaster.rdata[8] top.test.axil.tomaster.rdata[7] top.test.axil.tomaster.rdata[6] top.test.axil.tomaster.rdata[5] top.test.axil.tomaster.rdata[4] top.test.axil.tomaster.rdata[3] top.test.axil.tomaster.rdata[2] top.test.axil.tomaster.rdata[1] top.test.axil.tomaster.rdata[0]
+#{top.test.nvmestorage0.nvmestorageunit0.regaddress[7:0]} top.test.nvmestorage0.nvmestorageunit0.regaddress[5] top.test.nvmestorage0.nvmestorageunit0.regaddress[4] top.test.nvmestorage0.nvmestorageunit0.regaddress[3] top.test.nvmestorage0.nvmestorageunit0.regaddress[2] top.test.nvmestorage0.nvmestorageunit0.regaddress[1] top.test.nvmestorage0.nvmestorageunit0.regaddress[0]
+#{top.test.nvmestorage0.nvmestorageunit0.regdatain[31:0]} top.test.nvmestorage0.nvmestorageunit0.regdatain[31] top.test.nvmestorage0.nvmestorageunit0.regdatain[30] top.test.nvmestorage0.nvmestorageunit0.regdatain[29] top.test.nvmestorage0.nvmestorageunit0.regdatain[28] top.test.nvmestorage0.nvmestorageunit0.regdatain[27] top.test.nvmestorage0.nvmestorageunit0.regdatain[26] top.test.nvmestorage0.nvmestorageunit0.regdatain[25] top.test.nvmestorage0.nvmestorageunit0.regdatain[24] top.test.nvmestorage0.nvmestorageunit0.regdatain[23] top.test.nvmestorage0.nvmestorageunit0.regdatain[22] top.test.nvmestorage0.nvmestorageunit0.regdatain[21] top.test.nvmestorage0.nvmestorageunit0.regdatain[20] top.test.nvmestorage0.nvmestorageunit0.regdatain[19] top.test.nvmestorage0.nvmestorageunit0.regdatain[18] top.test.nvmestorage0.nvmestorageunit0.regdatain[17] top.test.nvmestorage0.nvmestorageunit0.regdatain[16] top.test.nvmestorage0.nvmestorageunit0.regdatain[15] top.test.nvmestorage0.nvmestorageunit0.regdatain[14] top.test.nvmestorage0.nvmestorageunit0.regdatain[13] top.test.nvmestorage0.nvmestorageunit0.regdatain[12] top.test.nvmestorage0.nvmestorageunit0.regdatain[11] top.test.nvmestorage0.nvmestorageunit0.regdatain[10] top.test.nvmestorage0.nvmestorageunit0.regdatain[9] top.test.nvmestorage0.nvmestorageunit0.regdatain[8] top.test.nvmestorage0.nvmestorageunit0.regdatain[7] top.test.nvmestorage0.nvmestorageunit0.regdatain[6] top.test.nvmestorage0.nvmestorageunit0.regdatain[5] top.test.nvmestorage0.nvmestorageunit0.regdatain[4] top.test.nvmestorage0.nvmestorageunit0.regdatain[3] top.test.nvmestorage0.nvmestorageunit0.regdatain[2] top.test.nvmestorage0.nvmestorageunit0.regdatain[1] top.test.nvmestorage0.nvmestorageunit0.regdatain[0]
+#{top.test.nvmestorage0.nvmestorageunit0.regaddress1[5:0]} top.test.nvmestorage0.nvmestorageunit0.regaddress1[5] top.test.nvmestorage0.nvmestorageunit0.regaddress1[4] top.test.nvmestorage0.nvmestorageunit0.regaddress1[3] top.test.nvmestorage0.nvmestorageunit0.regaddress1[2] top.test.nvmestorage0.nvmestorageunit0.regaddress1[1] top.test.nvmestorage0.nvmestorageunit0.regaddress1[0]
+@29
+top.test.nvmestorage0.nvmestorageunit0.regwrite1
+@22
+#{top.test.nvmestorage0.nvmestorageunit0.regdatain1[31:0]} top.test.nvmestorage0.nvmestorageunit0.regdatain1[31] top.test.nvmestorage0.nvmestorageunit0.regdatain1[30] top.test.nvmestorage0.nvmestorageunit0.regdatain1[29] top.test.nvmestorage0.nvmestorageunit0.regdatain1[28] top.test.nvmestorage0.nvmestorageunit0.regdatain1[27] top.test.nvmestorage0.nvmestorageunit0.regdatain1[26] top.test.nvmestorage0.nvmestorageunit0.regdatain1[25] top.test.nvmestorage0.nvmestorageunit0.regdatain1[24] top.test.nvmestorage0.nvmestorageunit0.regdatain1[23] top.test.nvmestorage0.nvmestorageunit0.regdatain1[22] top.test.nvmestorage0.nvmestorageunit0.regdatain1[21] top.test.nvmestorage0.nvmestorageunit0.regdatain1[20] top.test.nvmestorage0.nvmestorageunit0.regdatain1[19] top.test.nvmestorage0.nvmestorageunit0.regdatain1[18] top.test.nvmestorage0.nvmestorageunit0.regdatain1[17] top.test.nvmestorage0.nvmestorageunit0.regdatain1[16] top.test.nvmestorage0.nvmestorageunit0.regdatain1[15] top.test.nvmestorage0.nvmestorageunit0.regdatain1[14] top.test.nvmestorage0.nvmestorageunit0.regdatain1[13] top.test.nvmestorage0.nvmestorageunit0.regdatain1[12] top.test.nvmestorage0.nvmestorageunit0.regdatain1[11] top.test.nvmestorage0.nvmestorageunit0.regdatain1[10] top.test.nvmestorage0.nvmestorageunit0.regdatain1[9] top.test.nvmestorage0.nvmestorageunit0.regdatain1[8] top.test.nvmestorage0.nvmestorageunit0.regdatain1[7] top.test.nvmestorage0.nvmestorageunit0.regdatain1[6] top.test.nvmestorage0.nvmestorageunit0.regdatain1[5] top.test.nvmestorage0.nvmestorageunit0.regdatain1[4] top.test.nvmestorage0.nvmestorageunit0.regdatain1[3] top.test.nvmestorage0.nvmestorageunit0.regdatain1[2] top.test.nvmestorage0.nvmestorageunit0.regdatain1[1] top.test.nvmestorage0.nvmestorageunit0.regdatain1[0]
+#{top.test.nvmestorage0.regdataout0[31:0]} top.test.nvmestorage0.regdataout0[31] top.test.nvmestorage0.regdataout0[30] top.test.nvmestorage0.regdataout0[29] top.test.nvmestorage0.regdataout0[28] top.test.nvmestorage0.regdataout0[27] top.test.nvmestorage0.regdataout0[26] top.test.nvmestorage0.regdataout0[25] top.test.nvmestorage0.regdataout0[24] top.test.nvmestorage0.regdataout0[23] top.test.nvmestorage0.regdataout0[22] top.test.nvmestorage0.regdataout0[21] top.test.nvmestorage0.regdataout0[20] top.test.nvmestorage0.regdataout0[19] top.test.nvmestorage0.regdataout0[18] top.test.nvmestorage0.regdataout0[17] top.test.nvmestorage0.regdataout0[16] top.test.nvmestorage0.regdataout0[15] top.test.nvmestorage0.regdataout0[14] top.test.nvmestorage0.regdataout0[13] top.test.nvmestorage0.regdataout0[12] top.test.nvmestorage0.regdataout0[11] top.test.nvmestorage0.regdataout0[10] top.test.nvmestorage0.regdataout0[9] top.test.nvmestorage0.regdataout0[8] top.test.nvmestorage0.regdataout0[7] top.test.nvmestorage0.regdataout0[6] top.test.nvmestorage0.regdataout0[5] top.test.nvmestorage0.regdataout0[4] top.test.nvmestorage0.regdataout0[3] top.test.nvmestorage0.regdataout0[2] top.test.nvmestorage0.regdataout0[1] top.test.nvmestorage0.regdataout0[0]
+#{top.test.nvmestorage0.nvmestorageunit0.reg_control[31:0]} top.test.nvmestorage0.nvmestorageunit0.reg_control[31] top.test.nvmestorage0.nvmestorageunit0.reg_control[30] top.test.nvmestorage0.nvmestorageunit0.reg_control[29] top.test.nvmestorage0.nvmestorageunit0.reg_control[28] top.test.nvmestorage0.nvmestorageunit0.reg_control[27] top.test.nvmestorage0.nvmestorageunit0.reg_control[26] top.test.nvmestorage0.nvmestorageunit0.reg_control[25] top.test.nvmestorage0.nvmestorageunit0.reg_control[24] top.test.nvmestorage0.nvmestorageunit0.reg_control[23] top.test.nvmestorage0.nvmestorageunit0.reg_control[22] top.test.nvmestorage0.nvmestorageunit0.reg_control[21] top.test.nvmestorage0.nvmestorageunit0.reg_control[20] top.test.nvmestorage0.nvmestorageunit0.reg_control[19] top.test.nvmestorage0.nvmestorageunit0.reg_control[18] top.test.nvmestorage0.nvmestorageunit0.reg_control[17] top.test.nvmestorage0.nvmestorageunit0.reg_control[16] top.test.nvmestorage0.nvmestorageunit0.reg_control[15] top.test.nvmestorage0.nvmestorageunit0.reg_control[14] top.test.nvmestorage0.nvmestorageunit0.reg_control[13] top.test.nvmestorage0.nvmestorageunit0.reg_control[12] top.test.nvmestorage0.nvmestorageunit0.reg_control[11] top.test.nvmestorage0.nvmestorageunit0.reg_control[10] top.test.nvmestorage0.nvmestorageunit0.reg_control[9] top.test.nvmestorage0.nvmestorageunit0.reg_control[8] top.test.nvmestorage0.nvmestorageunit0.reg_control[7] top.test.nvmestorage0.nvmestorageunit0.reg_control[6] top.test.nvmestorage0.nvmestorageunit0.reg_control[5] top.test.nvmestorage0.nvmestorageunit0.reg_control[4] top.test.nvmestorage0.nvmestorageunit0.reg_control[3] top.test.nvmestorage0.nvmestorageunit0.reg_control[2] top.test.nvmestorage0.nvmestorageunit0.reg_control[1] top.test.nvmestorage0.nvmestorageunit0.reg_control[0]
+#{top.test.nvmestorage0.nvmestorageunit0.reg_status[31:0]} top.test.nvmestorage0.nvmestorageunit0.reg_status[31] top.test.nvmestorage0.nvmestorageunit0.reg_status[30] top.test.nvmestorage0.nvmestorageunit0.reg_status[29] top.test.nvmestorage0.nvmestorageunit0.reg_status[28] top.test.nvmestorage0.nvmestorageunit0.reg_status[27] top.test.nvmestorage0.nvmestorageunit0.reg_status[26] top.test.nvmestorage0.nvmestorageunit0.reg_status[25] top.test.nvmestorage0.nvmestorageunit0.reg_status[24] top.test.nvmestorage0.nvmestorageunit0.reg_status[23] top.test.nvmestorage0.nvmestorageunit0.reg_status[22] top.test.nvmestorage0.nvmestorageunit0.reg_status[21] top.test.nvmestorage0.nvmestorageunit0.reg_status[20] top.test.nvmestorage0.nvmestorageunit0.reg_status[19] top.test.nvmestorage0.nvmestorageunit0.reg_status[18] top.test.nvmestorage0.nvmestorageunit0.reg_status[17] top.test.nvmestorage0.nvmestorageunit0.reg_status[16] top.test.nvmestorage0.nvmestorageunit0.reg_status[15] top.test.nvmestorage0.nvmestorageunit0.reg_status[14] top.test.nvmestorage0.nvmestorageunit0.reg_status[13] top.test.nvmestorage0.nvmestorageunit0.reg_status[12] top.test.nvmestorage0.nvmestorageunit0.reg_status[11] top.test.nvmestorage0.nvmestorageunit0.reg_status[10] top.test.nvmestorage0.nvmestorageunit0.reg_status[9] top.test.nvmestorage0.nvmestorageunit0.reg_status[8] top.test.nvmestorage0.nvmestorageunit0.reg_status[7] top.test.nvmestorage0.nvmestorageunit0.reg_status[6] top.test.nvmestorage0.nvmestorageunit0.reg_status[5] top.test.nvmestorage0.nvmestorageunit0.reg_status[4] top.test.nvmestorage0.nvmestorageunit0.reg_status[3] top.test.nvmestorage0.nvmestorageunit0.reg_status[2] top.test.nvmestorage0.nvmestorageunit0.reg_status[1] top.test.nvmestorage0.nvmestorageunit0.reg_status[0]
 @1000200
 -Registers
 @800200
index d93334add73b60b7a708452df09bf367d56ad8e9..87be43bc36920f29ac77554b2b4d083c695bb1fe 100644 (file)
 #define        dl4hd32(data, nWords)
 #endif
 
+#if LDEBUG5
+#define        dl5printf(fmt, a...)    tprintf(fmt, ##a)
+#define        dl5hd32(data, nWords)   bhd32(data, nWords)
+#else
+#define        dl5printf(fmt, a...)
+#define        dl5hd32(data, nWords)
+#endif
+
 typedef bool           Bool;
 typedef uint8_t                BUInt8;
 typedef uint32_t       BUInt32;
index 90d7044c2ee3d5660f81c6d626028c77ffb8d710..3b258c03bb111de83ed424b4636bb4806d4d051a 100644 (file)
@@ -45,7 +45,8 @@
 #define        LDEBUG1         0               // High level debug
 #define        LDEBUG2         0               // Debug host to NVMe queued requests
 #define        LDEBUG3         0               // Debug NVMe to host queued requests (bus master)
-#define        LDEBUG4         0               // Xlinux PCIe DMA IP register debug
+#define        LDEBUG4         0               // Debug NVMe to host queued requests (bus master) detailed
+#define        LDEBUG5         0               // Xlinux PCIe DMA IP register debug
 
 #include <NvmeAccess.h>
 
@@ -238,14 +239,14 @@ void NvmeAccess::start(){
 }
 
 // Send a queued request to the Nvme
-int NvmeAccess::nvmeRequest(Bool wait, int queue, int opcode, BUInt32 address, BUInt32 arg10, BUInt32 arg11, BUInt32 arg12){
+int NvmeAccess::nvmeRequest(Bool wait, int queue, int opcode, BUInt nameSpace, BUInt32 address, BUInt32 arg10, BUInt32 arg11, BUInt32 arg12){
        int     e;
        BUInt32 cmd[16];
        BUInt32 nvmeAddress;
 
        memset(cmd, 0, 64);
        cmd[0] = (0x01 << 24) | ((++oqueueAdminId & 0xFF) << 16) | opcode;      // This includes the hosts stream number
-       cmd[1] = queue ? 1:0;   // Namespace
+       cmd[1] = nameSpace;     // Namespace
        cmd[2] = 0;             // Reserved
        cmd[3] = 0;
        cmd[4] = 0x00;          // Metadata
@@ -332,14 +333,14 @@ int NvmeAccess::nvmeProcess(){
        // This reads packets from the NVMe and processes them. The packets have a special requester header produced by the Xilinx PCIe DMA IP.
        // Responces have the special completer header added for the Xilinx PCIe DMA IP.
        while(1){
-               dl3printf("NvmeAccess::nvmeProcess: loop\n");
+               dl4printf("NvmeAccess::nvmeProcess: loop\n");
 
                // Read the packet from the Nvme. Coupdl be a request or a reply
                if((nt = read(ohostRecvFd, obufRx, 4096)) < 0){
                        return 1;
                }
 
-               dl3printf("NvmeAccess::nvmeProcess: awoken with: %d bytes\n", nt);
+               dl4printf("NvmeAccess::nvmeProcess: awoken with: %d bytes\n", nt);
                //dl3hd32(obufRx, nt / 4);
                //printf("NvmeAccess::nvmeProcess: awoken with: %d bytes\n", nt);
                //bhd32(obufRx, nt / 4);
@@ -356,8 +357,8 @@ int NvmeAccess::nvmeProcess(){
                        memcpy(&request, obufRx, sizeof(request));
                }
                
-               dl3printf("NvmeAccess::nvmeProcess: recvNum: %d Req: %d nWords: %d address: 0x%8.8x\n", nt, request.request, request.numWords, request.address);
-               dl3hd32(&request, nt / 4);
+               dl4printf("NvmeAccess::nvmeProcess: recvNum: %d Req: %d nWords: %d address: 0x%8.8x\n", nt, request.request, request.numWords, request.address);
+               dl4hd32(&request, nt / 4);
                //dumpStatus();
 
                if(request.request == 0){
@@ -370,6 +371,9 @@ int NvmeAccess::nvmeProcess(){
                        else if((request.address & 0x00FF0000) == 0x00010000){
                                data = oqueueDataMem;
                        }
+                       else if((request.address & 0x00FF0000) == 0x00E00000){
+                               data = odataBlockMem;
+                       }
                        else if((request.address & 0x00FF0000) == 0x00800000){
                                data = odataBlockMem;
                        }
@@ -394,8 +398,8 @@ int NvmeAccess::nvmeProcess(){
                                reply.tag = request.tag;
                                memcpy(reply.data, &data[(request.address & 0x0000FFFF) / 4], nWords * 4);
 
-                               dl3printf("NvmeAccess::nvmeProcess: ReadData block from: 0x%8.8x nWords: %d\n", request.address, nWords);
-                               dl3hd32(&reply, (3 + nWords));
+                               dl4printf("NvmeAccess::nvmeProcess: ReadData block from: 0x%8.8x nWords: %d\n", request.address, nWords);
+                               dl4hd32(&reply, (3 + nWords));
                                if(packetSend(reply)){
                                        printf("NvmeAccess::nvmeProcess: packet send error\n");
                                        exit(1);
@@ -412,7 +416,7 @@ int NvmeAccess::nvmeProcess(){
                        
                        if((request.address & 0x00FF0000) == 0x00100000){
                                status = request.data[3] >> 17;
-                               dl3printf("NvmeAccess::nvmeProcess: NvmeReply: Queue: %d QueueHeadPointer: %d Status: 0x%4.4x Command: 0x%x\n", request.data[2] >> 16, request.data[2] & 0xFFFF, request.data[3] >> 17, request.data[3] & 0xFFFF);
+                               dl4printf("NvmeAccess::nvmeProcess: NvmeReply: Queue: %d QueueHeadPointer: %d Status: 0x%4.4x Command: 0x%x\n", request.data[2] >> 16, request.data[2] & 0xFFFF, request.data[3] >> 17, request.data[3] & 0xFFFF);
                                //printf("NvmeAccess::nvmeProcess: NvmeReply: Queue: %d QueueHeadPointer: %d Status: 0x%4.4x Command: 0x%x\n", request.data[2] >> 16, request.data[2] & 0xFFFF, request.data[3] >> 17, request.data[3] & 0xFFFF);
                                //bhd32(&request, nt / 4);
 
@@ -433,7 +437,7 @@ int NvmeAccess::nvmeProcess(){
                        }
                        else if((request.address & 0x00FF0000) == 0x00110000){
                                status = request.data[3] >> 17;
-                               dl3printf("NvmeAccess::nvmeProcess: IoCompletion: Queue: %d QueueHeadPointer: %d Status: 0x%4.4x Command: 0x%x\n", request.data[2] >> 16, request.data[2] & 0xFFFF, request.data[3] >> 17, request.data[3] & 0xFFFF);
+                               dl4printf("NvmeAccess::nvmeProcess: IoCompletion: Queue: %d QueueHeadPointer: %d Status: 0x%4.4x Command: 0x%x\n", request.data[2] >> 16, request.data[2] & 0xFFFF, request.data[3] >> 17, request.data[3] & 0xFFFF);
                                //printf("NvmeAccess::nvmeProcess: IoCompletion: Queue: %d QueueHeadPointer: %d Status: 0x%4.4x Command: 0x%x\n", request.data[2] >> 16, request.data[2] & 0xFFFF, request.data[3] >> 17, request.data[3] & 0xFFFF);
 
                                // Write to completion queue doorbell
@@ -451,16 +455,16 @@ int NvmeAccess::nvmeProcess(){
                                oqueueReplySem.set();
                        }
                        else if((request.address & 0x00FF0000) == 0x000800000){
-                               dl3printf("NvmeAccess::nvmeProcess: IoBlockWrite: address: %8.8x nWords: %d\n", (request.address & 0x0FFFFFFF), request.numWords);
+                               dl4printf("NvmeAccess::nvmeProcess: IoBlockWrite: address: %8.8x nWords: %d\n", (request.address & 0x0FFFFFFF), request.numWords);
                                //printf("NvmeAccess::nvmeProcess: IoBlockWrite: address: %8.8x nWords: %d\n", (request.address & 0x0FFFFFFF), request.numWords);
 
                                memcpy(&odataBlockMem[(request.address & 0x0000FFFF) / 4], request.data, request.numWords * 4);
                        }
                        else if((request.address & 0x00F00000) == 0x00E00000){
-                               dl3printf("NvmeAccess::nvmeProcess: Write: address: %8.8x nWords: %d\n", (request.address & 0x0FFFFFFF), nWords);
+                               dl4printf("NvmeAccess::nvmeProcess: Write: address: %8.8x nWords: %d\n", (request.address & 0x0FFFFFFF), nWords);
 
                                memcpy(&odataBlockMem[(request.address & 0x00000FFF) / 4], request.data, request.numWords * 4);
-                               bhd32(odataBlockMem, request.numWords);
+                               dl4hd32(odataBlockMem, request.numWords);
                        }
                        else if((request.address & 0x00F00000) == 0x00F00000){
                                dl3printf("NvmeAccess::nvmeProcess: Write: address: %8.8x nWords: %d\n", (request.address & 0x0FFFFFFF), nWords);
@@ -474,7 +478,7 @@ int NvmeAccess::nvmeProcess(){
                        }
                        
                        if(status){
-                               printf("NvmeAccess::nvmeProcess: Queue Command returned error: status: %4.4x\n", status);
+                               printf("NvmeAccess::nvmeProcess: Queued Command returned error: status: %4.4x\n", status);
                                bhd32(&request, nt / 4);
                        }
                }
@@ -538,7 +542,7 @@ int NvmeAccess::pcieWrite(BUInt8 request, BUInt32 address, BUInt32 num, BUInt32*
        dl2printf("Send packet\n");
        dl2hd32(&txPacket, 4 + num);
 
-#if LDEBUG4
+#if LDEBUG5
        dumpDmaRegs(0, 0);
        dumpDmaRegs(1, 0);
 #endif
@@ -582,7 +586,7 @@ int NvmeAccess::pcieRead(BUInt8 request, BUInt32 address, BUInt32 num, BUInt32*
        dl2printf("NvmeAccess::pcieRead: Send packet\n");
        dl2hd32(&txPacket, 4);
 
-#if LDEBUG4
+#if LDEBUG5
        dumpDmaRegs(0, 0);
        dumpDmaRegs(1, 0);
 #endif
@@ -595,7 +599,7 @@ int NvmeAccess::pcieRead(BUInt8 request, BUInt32 address, BUInt32 num, BUInt32*
 
        dl2printf("Recv data\n");
        
-#if LDEBUG4
+#if LDEBUG5
        usleep(100000);
        dumpDmaRegs(0, 0);
        dumpDmaRegs(1, 0);
index 105c79607563a5f20468521d6c4193f508e46644..43c395d43bd0e3189b07c508343f9e3c6b7afaf8 100644 (file)
@@ -81,6 +81,9 @@ const BUInt   RegReadStatus           = 0x084;        ///< The read data status register
 const BUInt    RegReadBlock            = 0x088;        ///< The read data starting block register
 const BUInt    RegReadNumBlocks        = 0x08C;        ///< The read data number of blocks register
 
+const BUInt    NvmeRegCapLow           = 0x000;        ///< NVMe capabilities low register
+const BUInt    NvmeRegCapHigh          = 0x004;        ///< NVMe capabilities high register
+
 class NvmeRequestPacket {
 public:
                        NvmeRequestPacket(){
@@ -145,7 +148,7 @@ public:
        void            start();                                                        ///< Start NVMe request processing thread
 
        // Send a queued request to the NVMe
-       int             nvmeRequest(Bool wait, int queue, int opcode, BUInt32 address, BUInt32 arg10, BUInt32 arg11 = 0, BUInt32 arg12 = 0);
+       int             nvmeRequest(Bool wait, int queue, int opcode, BUInt nameSpace, BUInt32 address, BUInt32 arg10, BUInt32 arg11 = 0, BUInt32 arg12 = 0);
        
        // NVMe process received requests thread
        int             nvmeProcess();
index 74629ff5200e49e822b970580c93a2ac27dc3926..86d2fc925657fdf4629da9c2d59c5943d752a0c1 100644 (file)
@@ -17,7 +17,9 @@ echo "Test for NVMe drive deallocate time. Total drive blocks: ${driveAllBlocks}
 testCapture(){
        #echo "Simple capture of available space"
 
-       IFS=, r1=(`./test_nvme -m -nr -d 2 -s $1 -n ${captureBlocks} capture`)
+       r=`./test_nvme -m -nr -d 2 -s $1 -n ${captureBlocks} capture`
+       echo $r
+       IFS=, r1=($r)
        
        #echo "Capture: ${r1[*]}"
        echo ${r1[2]}
@@ -32,9 +34,89 @@ compareRate(){
        fi
 }
 
+trimAll(){
+       echo "Trim all blocks (well 800 MBytes)"
+       start=0
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} trim
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim
+
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim
+}
+
+trimAll1(){
+       echo "Trim all blocks (well 800 MBytes)"
+       start=0
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} trim1
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim1
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim1
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim1
+
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim1
+}
+
+fillAll(){
+       echo "Allocate most of the drives blocks initially"
+       start=0
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} capture
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} capture
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} capture
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} capture
+}
+
 test1(){
-       # Initiallity allocate most of the drives blocks for worst case
-       echo "Allocate most of the drives blocks to start"
+       delay=140
+
+       # Initially allocate half of the drives blocks
+       echo "Allocate half of the drives blocks initially"
+       start=0
+       ./test_nvme -d 2 -s ${start} -n ${captureBlocks} capture
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} capture
+
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim
+       start=`expr ${start} + ${captureBlocks}`
+       ./test_nvme -nr -d 2 -s ${start} -n ${captureBlocks} trim
+       
+       while true; do
+               echo
+               echo "Test cycle with deallocate delay set to: $delay"
+               #echo "Deallocate at 0"
+               ./test_nvme -nr -d 2 -s 0 -n ${captureBlocks} trim
+               sleep $delay
+
+               ./test_nvme -nr -d 2 -s 0 -n ${captureBlocks} capture
+
+               echo
+               #echo "Deallocate at ${captureBlocks}"
+               ./test_nvme -nr -d 2 -s ${captureBlocks} -n ${captureBlocks} trim
+               sleep $delay
+
+               ./test_nvme -nr -d 2 -s ${captureBlocks} -n ${captureBlocks} capture
+
+               #delay=`expr $delay + $delay / 3`
+               #delay=`expr $delay + $delay / 3`
+       done
+}
+
+test2(){
+       delay=280
+
+       # Initially allocate most of the drives blocks for worst case
+       echo "Allocate most of the drives blocks initially"
        start=0
        ./test_nvme -d 2 -s ${start} -n ${captureBlocks} capture
        start=`expr ${start} + ${captureBlocks}`
@@ -47,38 +129,54 @@ test1(){
        while true; do
                echo
                echo "Test cycle with deallocate delay set to: $delay"
-               echo "Deallocate at 0"
+               #echo "Deallocate at 0"
                ./test_nvme -nr -d 2 -s 0 -n ${captureBlocks} trim
                sleep $delay
 
-               echo "Run Capture at block: 0"
-               rate=`testCapture 0`
-               echo "Rate: $rate"
-               if compareRate $rate; then
-                       echo "Error rate was ${rate}"
-                       #return 1;
-               fi
-               
+               ./test_nvme -nr -d 2 -s 0 -n ${captureBlocks} capture
 
                echo
-               echo "Deallocate at ${captureBlocks}"
+               #echo "Deallocate at ${captureBlocks}"
                ./test_nvme -nr -d 2 -s ${captureBlocks} -n ${captureBlocks} trim
                sleep $delay
 
-               echo "Run Capture at block: ${captureBlocks}"
-               rate=`testCapture ${captureBlocks}`
-               echo "Rate: $rate"
-               if compareRate $rate; then
-                       echo "Error Rate was ${rate}"
-                       #return 1;
-               fi;
+               ./test_nvme -nr -d 2 -s ${captureBlocks} -n ${captureBlocks} capture
 
-               delay=`expr $delay + 10`
+               delay=`expr $delay + $delay / 3`
        done
 }
 
+test3(){
+       delay=120
+       ./test_nvme -d 2 -s 0 -n 100 capture
+       
+       while true; do
+               echo
+               echo "Test cycle with deallocate delay set to: $delay"
+               #echo "Deallocate at 0"
+               #./test_nvme -nr -d 2 -s 0 -n ${captureBlocks} trim
+               #sleep $delay
+
+               ./test_nvme -nr -d 2 -s 0 -n ${captureBlocks} capture
+
+               echo
+               #echo "Deallocate at ${captureBlocks}"
+               #./test_nvme -nr -d 2 -s ${captureBlocks} -n ${captureBlocks} trim
+               ##sleep $delay
+
+               ./test_nvme -nr -d 2 -s ${captureBlocks} -n ${captureBlocks} capture
+
+               #delay=`expr $delay + $delay / 3`
+       done
+}
 
 #captureBlocks=100
-test1
+
+#trimAll
+#trimAll1
+#fillAll
+#test1
+test2
+#test3
 
 exit 0
index 40e837c64c59933760d8f92ea72c9c15b65db900..9d57c22e3884dea0e0e2dd57cb81567bde3ea4e6 100644 (file)
@@ -48,6 +48,7 @@
 #include <stdio.h>
 #include <getopt.h>
 #include <stdarg.h>
+#include <math.h>
 
 #define VERSION                "1.0.0"
 
@@ -75,7 +76,10 @@ public:
        int             nvmeCaptureAndRead();                   ///< Capture FPGA datastream writing to Nvme
        int             nvmeWrite();                            ///< Write blocks to Nvme
        int             nvmeTrim();                             ///< Trim blocks on Nvme
+       int             nvmeTrim1();                            ///< Trim blocks on Nvme using Write0 command
        int             nvmeRegs();                             ///< Print register contents
+       int             nvmeInfoDevice(int device);             ///< Print NVMe device info for a particular device
+       int             nvmeInfo();                             ///< Print NVMe device info
 
        // Basic/Raw test functions
        int             test1();                                ///< Run test1
@@ -320,36 +324,36 @@ int Control::nvmeConfigure(){
                if(UseQueueEngine){
                        // Create an IO queue
                        uprintf("Create IO queue 1 for replies\n");
-                       nvmeRequest(1, 0, 0x05, 0x02110000, cmd0 | 1, 0x00000001);
+                       nvmeRequest(1, 0, 0x05, 0, 0x02110000, cmd0 | 1, 0x00000001);
 
                        // Create an IO queue
                        uprintf("Create IO queue 1 for requests\n");
-                       nvmeRequest(1, 0, 0x01, 0x02010000, cmd0 | 1, 0x00010001);
+                       nvmeRequest(1, 0, 0x01, 0, 0x02010000, cmd0 | 1, 0x00010001);
 
                        // Create an IO queue
                        uprintf("Create IO queue 2 for replies\n");
-                       nvmeRequest(1, 0, 0x05, 0x02120000, cmd0 | 2, 0x00000001);
+                       nvmeRequest(1, 0, 0x05, 0, 0x02120000, cmd0 | 2, 0x00000001);
 
                        // Create an IO queue
                        uprintf("Create IO queue 2 for requests\n");
-                       nvmeRequest(1, 0, 0x01, 0x02020000, cmd0 | 2, 0x00020001);
+                       nvmeRequest(1, 0, 0x01, 0, 0x02020000, cmd0 | 2, 0x00020001);
                }
                else {
                        // Create an IO queue
                        uprintf("Create IO queue 1 for replies\n");
-                       nvmeRequest(1, 0, 0x05, 0x01110000, cmd0 | 1, 0x00000001);
+                       nvmeRequest(1, 0, 0x05, 0, 0x01110000, cmd0 | 1, 0x00000001);
 
                        // Create an IO queue
                        uprintf("Create IO queue 1 for requests\n");
-                       nvmeRequest(1, 0, 0x01, 0x01010000, cmd0 | 1, 0x00010001);
+                       nvmeRequest(1, 0, 0x01, 0, 0x01010000, cmd0 | 1, 0x00010001);
 
                        // Create an IO queue
                        uprintf("Create IO queue 2 for replies\n");
-                       nvmeRequest(1, 0, 0x05, 0x01120000, cmd0 | 2, 0x00000001);
+                       nvmeRequest(1, 0, 0x05, 0, 0x01120000, cmd0 | 2, 0x00000001);
 
                        // Create an IO queue
                        uprintf("Create IO queue 2 for requests\n");
-                       nvmeRequest(1, 0, 0x01, 0x01020000, cmd0 | 2, 0x00020001);
+                       nvmeRequest(1, 0, 0x01, 0, 0x01020000, cmd0 | 2, 0x00020001);
                }
        }
        // Make sure all is settled
@@ -817,13 +821,13 @@ int Control::nvmeWrite(){
                                odataBlockMem[a] = data++;
 
                        setNvme(0);
-                       nvmeRequest(1, 1, 0x01, 0x01800000, (ostartBlock + block) * numBlocks, 0x00000000, numBlocks-1);        // Perform write
+                       nvmeRequest(1, 1, 0x01, 1, 0x01800000, (ostartBlock + block) * numBlocks, 0x00000000, numBlocks-1);     // Perform write
 
                        for(a = 0; a < BlockSize/4; a++)
                                odataBlockMem[a] = data++;
 
                        setNvme(1);
-                       nvmeRequest(1, 1, 0x01, 0x01800000, (ostartBlock + block) * numBlocks, 0x00000000, numBlocks-1);        // Perform write
+                       nvmeRequest(1, 1, 0x01, 1, 0x01800000, (ostartBlock + block) * numBlocks, 0x00000000, numBlocks-1);     // Perform write
 
                        setNvme(2);
                }
@@ -833,7 +837,7 @@ int Control::nvmeWrite(){
                        for(a = 0; a < BlockSize/4; a++)
                                odataBlockMem[a] = data++;
 
-                       nvmeRequest(1, 1, 0x01, 0x01800000, (ostartBlock + block) * numBlocks, 0x00000000, numBlocks-1);        // Perform write
+                       nvmeRequest(1, 1, 0x01, 1, 0x01800000, (ostartBlock + block) * numBlocks, 0x00000000, numBlocks-1);     // Perform write
                }
        }
 
@@ -842,34 +846,79 @@ int Control::nvmeWrite(){
 
 int Control::nvmeTrim(){
        int     e = 0;
+
+       printf("NvmeTrim: nvme: %u startBlock: %u numBlocks: %u\n", onvmeNum, ostartBlock, onumBlocks);
+       
+       if(e = nvmeInit())
+               return e;
+       
+       // Note this 
+       if(onvmeNum == 2){
+               memset(odataBlockMem, 0, sizeof(odataBlockMem));
+               odataBlockMem[0] = ((8 * 8) << 24) | 0x0634;    // Optimisation parameters
+               odataBlockMem[1] = (onumBlocks / 2) * 8;
+               odataBlockMem[2] = (ostartBlock / 2) * 8;
+               odataBlockMem[3] = 0;
+                       
+               setNvme(0);
+               nvmeRequest(1, 1, 0x09, 1, 0x01E00000, 0, 0x06);        // Perform data set deallocate and optimise
+               setNvme(1);
+               nvmeRequest(1, 1, 0x09, 1, 0x01E00000, 0, 0x06);        // Perform data set deallocate and optimise
+               setNvme(2);
+       }
+       else {
+               memset(odataBlockMem, 0, sizeof(odataBlockMem));
+               odataBlockMem[0] = ((8 * 8) << 24) | 0x0634;    // Optimisation parameters
+               odataBlockMem[1] = onumBlocks * 8;
+               odataBlockMem[2] = ostartBlock * 8;
+               odataBlockMem[3] = 0;
+                       
+               nvmeRequest(1, 1, 0x09, 1, 0x01E00000, 0, 0x06);        // Perform data set deallocate and optimise
+       }
+       
+       return 0;
+}
+
+int Control::nvmeTrim1(){
+       int     e = 0;
+       BUInt32 b;
        BUInt32 block;
        BUInt   trimBlocks = 32768;
 
-       printf("NvmeTrim: nvme: %u startBlock: %u numBlocks: %u\n", onvmeNum, ostartBlock, onumBlocks);
+       printf("NvmeTrim1: nvme: %u startBlock: %u numBlocks: %u\n", onvmeNum, ostartBlock, onumBlocks);
        
        if(e = nvmeInit())
                return e;
        
        // Note this 
        if(onvmeNum == 2){
-               for(block = 0; block < onumBlocks/2; block += (trimBlocks/8)){
-                       if((block + (trimBlocks/8)) > onumBlocks/2){
-                               trimBlocks = 8 * (onumBlocks/2 - block);
+               for(b = 0; b < onumBlocks/2; b += (trimBlocks/8)){
+                       if((b + (trimBlocks/8)) > onumBlocks/2){
+                               trimBlocks = 8 * (onumBlocks/2 - b);
                        }
+                       block = ostartBlock/2 + b;
                        
+                       // Perform trim of 32k 512 Byte blocks
                        setNvme(0);
-                       nvmeRequest(1, 1, 0x08, 0x00000000, block * 8, 0x00000000, (1 << 25) | trimBlocks-1);   // Perform trim of 32k 512 Byte blocks
+                       if(e = nvmeRequest(1, 1, 0x08, 1, 0x00000000, block * 8, 0x00000000, (1 << 25) | trimBlocks-1))
+                               return e;
+
                        setNvme(1);
-                       nvmeRequest(1, 1, 0x08, 0x00000000, block * 8, 0x00000000, (1 << 25) | trimBlocks-1);   // Perform trim of 32k 512 Byte blocks
+                       if(e = nvmeRequest(1, 1, 0x08, 1, 0x00000000, block * 8, 0x00000000, (1 << 25) | trimBlocks-1))
+                               return e;
                }
                setNvme(2);
        }
        else {
-               for(block = 0; block < onumBlocks; block += (trimBlocks/8)){
-                       if((block + (trimBlocks/8)) > onumBlocks){
-                               trimBlocks = 8 * (onumBlocks - block);
+               for(b = 0; b < onumBlocks; b += (trimBlocks/8)){
+                       if((b + (trimBlocks/8)) > onumBlocks){
+                               trimBlocks = 8 * (onumBlocks - b);
                        }
-                       nvmeRequest(1, 1, 0x08, 0x00000000, block * 8, 0x00000000, (1 << 25) | trimBlocks-1);   // Perform trim of 32k 512 Byte blocks
+                       block = ostartBlock + b;
+                       
+                       // Perform trim of 32k 512 Byte blocks
+                       if(e = nvmeRequest(1, 1, 0x08, 1, 0x00000000, block * 8, 0x00000000, (1 << 25) | trimBlocks-1))
+                               return e;
                }
        }
        
@@ -910,6 +959,82 @@ int Control::nvmeRegs(){
        return 0;
 }
 
+BUInt8 get8(void* data, BUInt address){
+       BUInt8* p = (BUInt8*)data;
+       
+       return *(p + address);
+}
+
+BUInt32 get32(void* data, BUInt address){
+       char*   p = (char*)data;
+       
+       return *((BUInt32*)(p + address));
+}
+
+BUInt64 get64(void* data, BUInt address){
+       char*   p = (char*)data;
+       
+       return *((BUInt64*)(p + address));
+}
+
+int Control::nvmeInfoDevice(int device){
+       BUInt32         v1;
+       BUInt32         v2;
+       BUInt32*        p32;
+       BUInt64*        p64;
+       
+       setNvme(device);
+       printf("Nvme device:        %d\n", device);
+
+       readNvmeReg32(NvmeRegCapLow, v1);
+       readNvmeReg32(NvmeRegCapHigh, v2);
+       
+       printf("Capabilitieslow:      0x%8.8x\n", v1);
+       printf("CapabilitiesHigh:     0x%8.8x\n", v2);
+       printf("Doorbell stride:      %u\n", BUInt(pow(2, 2 + (v2 & 0x0F))));
+       printf("MaxPageSize:          %u\n", BUInt(pow(2, (12 + ((v2 >> 20) & 0x0F)))));
+       
+       nvmeRequest(1, 0, 0x06, 1, 0x01E00000, 0x00000000);     // Namespace info
+       //bhd32(odataBlockMem, 64);
+
+       printf("NamespaceSize:        %lu\n", get64(odataBlockMem, 0));
+       printf("NamespaceCapacity:    %lu\n", get64(odataBlockMem, 8));
+       printf("NamespaceAllocated:   %lu\n", get64(odataBlockMem, 16));
+       printf("NamespaceLbaFormat:   %u\n", get8(odataBlockMem, 26));
+       printf("NamespaceLbaFormat0  :0x%8.8x\n", get32(odataBlockMem, 128));
+       printf("NamespaceLbaSize0:    %u\n", BUInt(pow(2, ((get32(odataBlockMem, 128) >> 16) & 0xFF))));
+       printf("NamespaceLbaFormat1:  0x%8.8x\n", get32(odataBlockMem, 132));
+       printf("NamespaceLbaSize1:    %u\n", BUInt(pow(2, ((get32(odataBlockMem, 132) >> 16) & 0xFF))));
+       printf("NamespaceLbaFormat2:  0x%8.8x\n", get32(odataBlockMem, 136));
+       printf("NamespaceLbaSize2:    %u\n", BUInt(pow(2, ((get32(odataBlockMem, 136) >> 16) & 0xFF))));
+       printf("NamespaceLbaFormat3:  0x%8.8x\n", get32(odataBlockMem, 140));
+       printf("NamespaceLbaSize3:    %u\n", BUInt(pow(2, ((get32(odataBlockMem, 140) >> 16) & 0xFF))));
+
+       return 0;       
+}
+
+int Control::nvmeInfo(){
+       int     e = 0;
+       BUInt   n = 0;
+       BUInt32 v;
+
+       printf("NvmeInfo\n");
+       
+       if(e = nvmeInit())
+               return e;
+       
+       if(onvmeNum == 2){
+               nvmeInfoDevice(0);
+               nvmeInfoDevice(1);
+       }
+       else {
+               nvmeInfoDevice(onvmeNum);
+       }
+
+       return 0;
+}
+
+
 
 int Control::test1(){
        BUInt32 data[8];
@@ -952,8 +1077,8 @@ int Control::test3(){
                return e;
 
        printf("Get info\n");
-       //nvmeRequest(0, 0, 0x06, 0x01E00000, 0x00000000);              // Namespace info
-       nvmeRequest(0, 0, 0x06, 0x01E00000, 0x00000001);                // Controller info
+       //nvmeRequest(0, 0, 0x06, 1, 0x01E00000, 0x00000000);           // Namespace info
+       nvmeRequest(0, 0, 0x06, 0, 0x01E00000, 0x00000001);             // Controller info
        printf("\n");
        sleep(1);
 
@@ -978,7 +1103,7 @@ int Control::test4(){
        numBlocks = 1;
 #endif
 
-       nvmeRequest(1, 1, 0x02, 0x01800000, block, 0x00000000, numBlocks-1);    // Perform read
+       nvmeRequest(1, 1, 0x02, 1, 0x01800000, block, 0x00000000, numBlocks-1); // Perform read
 
        printf("DataBlock0:\n");
        bhd32a(odataBlockMem, numBlocks*512/4);
@@ -992,7 +1117,7 @@ int Control::test5(){
        BUInt32 r;
        int     numBlocks = 8;
        
-       printf("Test5: Write block: Single NVme\n");
+       printf("Test5: Write block: Single Nvme\n");
        
        if(e = nvmeInit())
                return e;
@@ -1003,7 +1128,7 @@ int Control::test5(){
        for(a = 0; a < 8192; a++)
                odataBlockMem[a] = ((r & 0xFF) << 24) + a;
 
-       nvmeRequest(1, 1, 0x01, 0x01800000, 0x00000000, 0x00000000, numBlocks-1);       // Perform write
+       nvmeRequest(1, 1, 0x01, 1, 0x01800000, 0x00000000, 0x00000000, numBlocks-1);    // Perform write
 
        return 0;
 }
@@ -1075,7 +1200,7 @@ int Control::test7(){
        for(n = 0; n < numBlocks; n++){
                printf("Test Block: %u\n", n);
                memset(odataBlockMem, 0x01, sizeof(odataBlockMem));
-               nvmeRequest(1, 1, 0x02, 0x01800000, n * 8, 0x00000000, 7);      // Perform read
+               nvmeRequest(1, 1, 0x02, 1, 0x01800000, n * 8, 0x00000000, 7);   // Perform read
 
                for(a = 0; a < 4096 / 4; a++, v++){
                        if(odataBlockMem[a] != v){
@@ -1103,7 +1228,7 @@ int Control::test8(){
                return e;
 
        for(block = 0; block < numBlocks; block += (maxBlocks/8)){
-               nvmeRequest(1, 1, 0x08, 0x00000000, block * 8, 0x00000000, (1 << 25) | maxBlocks-1);    // Perform trim of 32k 512 Byte blocks
+               nvmeRequest(1, 1, 0x08, 1, 0x00000000, block * 8, 0x00000000, (1 << 25) | maxBlocks-1); // Perform trim of 32k 512 Byte blocks
        }
 
 
@@ -1194,28 +1319,28 @@ int Control::test_misc(){
                return e;
 
        printf("Get info\n");
-       nvmeRequest(0, 0, 0x06, 0x01F00000, 0x00000001);
+       nvmeRequest(0, 0, 0x06, 0, 0x01F00000, 0x00000001);
        sleep(1);
 
        printf("\nGet namespace list\n");
-       nvmeRequest(0, 0, 0x06, 0x01F00000, 0x00000002);
+       nvmeRequest(0, 0, 0x06, 0, 0x01F00000, 0x00000002);
        sleep(1);
 
        printf("\nSet asynchonous feature\n");
-       nvmeRequest(0, 0, 0x09, 0x01F00000, 0x0000000b, 0xFFFFFFFF);
+       nvmeRequest(0, 0, 0x09, 0, 0x01F00000, 0x0000000b, 0xFFFFFFFF);
        sleep(1);
 
        printf("\nGet asynchonous feature\n");
-       nvmeRequest(0, 0, 0x0A, 0x01F00000, 0x0000000b);
+       nvmeRequest(0, 0, 0x0A, 0, 0x01F00000, 0x0000000b);
        sleep(1);
 
 
        printf("\nGet log page\n");
-       nvmeRequest(0, 0, 0x02, 0x01F00000, 0x00100001, 0x00000000, 0);
+       nvmeRequest(0, 0, 0x02, 0, 0x01F00000, 0x00100001, 0x00000000, 0);
        sleep(1);
 
        printf("\nGet asynchonous event\n");
-       nvmeRequest(0, 0, 0x0C, 0x00000000, 0x00000000, 0x00000000, 0);
+       nvmeRequest(0, 0, 0x0C, 0, 0x00000000, 0x00000000, 0x00000000, 0);
        sleep(1);
 
        return 0;
@@ -1393,6 +1518,9 @@ int main(int argc, char** argv){
                printf("captureAndRead: Perform data input from FPGA TestData source into Nvme's and read data.\n");
                printf("write: Write data to Nvme's\n");
                printf("trim: Trim/deallocate blocks on Nvme's\n");
+               printf("trim1: Trim/deallocate blocks on Nvme's using Write0 command\n");
+               printf("regs: Display NvmeStorage register values\n");
+               printf("info: Display some info on the NVMe drives\n");
                printf("test*: Collection of misc programmed tests. See source code.\n");
        }
        else {
@@ -1425,9 +1553,15 @@ int main(int argc, char** argv){
                else if(!strcmp(test, "trim")){
                        err = control.nvmeTrim();
                }
+               else if(!strcmp(test, "trim1")){
+                       err = control.nvmeTrim1();
+               }
                else if(!strcmp(test, "regs")){
                        err = control.nvmeRegs();
                }
+               else if(!strcmp(test, "info")){
+                       err = control.nvmeInfo();
+               }
                
                // Basic programed tests
                else if(!strcmp(test, "test1")){