From 99c165c078222c789d5fc90a79c756c8fffdafea Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Wed, 3 Feb 2016 16:48:45 +0100 Subject: Add python wrap for pcilib --- pcitool/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcitool') diff --git a/pcitool/cli.c b/pcitool/cli.c index 4d5d3d5..8350d24 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1385,7 +1385,7 @@ int ReadData(pcilib_t *handle, ACCESS_MODE mode, FLAGS flags, pcilib_dma_engine_ int ReadRegister(pcilib_t *handle, const pcilib_model_description_t *model_info, const char *bank, const char *reg, const char *view, const char *unit, const char *attr) { int i; int err; - const char *format; + const char *format; pcilib_register_bank_t bank_id; pcilib_register_bank_addr_t bank_addr = 0; -- cgit v1.2.3 From dce856c1a16098fe7a1df2338df60073261da94a Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Tue, 9 Feb 2016 17:32:11 +0100 Subject: Add write_register python wrap. Add no_set_check attribute to pcilib_view_t type --- pcitool/cli.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pcitool') diff --git a/pcitool/cli.c b/pcitool/cli.c index 8350d24..cb87dcb 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1702,10 +1702,12 @@ int WriteRegister(pcilib_t *handle, const pcilib_model_description_t *model_info if ((model_info->registers[regid].mode&PCILIB_REGISTER_RW) == PCILIB_REGISTER_RW) { const char *format = (val.format?val.format:"%u"); + err = pcilib_read_register(handle, bank, reg, &verify); if (err) Error("Error reading back register %s for verification\n", reg); - - if (verify != value) { + + if (!((model_info->registers[regid].mode&PCILIB_REGISTER_NO_CHK) == PCILIB_REGISTER_NO_CHK) && + verify != value) { Error("Failed to write register %s: %lu is written and %lu is read back", reg, value, verify); } else { printf("%s = ", reg); -- cgit v1.2.3 From d7fc669bf0dbe37f46d2efec4940feb8504017c2 Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Thu, 11 Feb 2016 14:24:01 +0100 Subject: Change no_set_check parameter name. Move Python wrap to separate directory. --- pcitool/cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcitool') diff --git a/pcitool/cli.c b/pcitool/cli.c index cb87dcb..3e69aac 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1706,7 +1706,7 @@ int WriteRegister(pcilib_t *handle, const pcilib_model_description_t *model_info err = pcilib_read_register(handle, bank, reg, &verify); if (err) Error("Error reading back register %s for verification\n", reg); - if (!((model_info->registers[regid].mode&PCILIB_REGISTER_NO_CHK) == PCILIB_REGISTER_NO_CHK) && + if (!((model_info->registers[regid].mode&PCILIB_REGISTER_INCONSISTENT) == PCILIB_REGISTER_INCONSISTENT) && verify != value) { Error("Failed to write register %s: %lu is written and %lu is read back", reg, value, verify); } else { -- cgit v1.2.3 From 55eab7196d0104c71e40136b3b22e9501d234e17 Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Fri, 12 Feb 2016 14:43:20 +0100 Subject: 1. Cmakelists - move copy xml folder command to root file 2. - Move set python paths code to python module init funtction - pci.c move python module init block code after checking model to get paths before it runs. - Fix set python path code to work with PYTHONPATH - Update pci run script to work with PYTHONPATH - Fix python finalize code 3. Change pcilib_script_s interacting method. Now it stores in hash. 4. Change names of some fucntions to more unified ones 5. Remove old unused function pcilib_xml_create_script_or_transform_view 6. cli - disable reading register after set if write_verification flag is off 7. Remove uninformative error messages fro Python wrap. 8. - Server.py - add read/write property/register command handling - Add help message - Correcting paths --- pcitool/cli.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'pcitool') diff --git a/pcitool/cli.c b/pcitool/cli.c index 3e69aac..3676a56 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1703,17 +1703,21 @@ int WriteRegister(pcilib_t *handle, const pcilib_model_description_t *model_info const char *format = (val.format?val.format:"%u"); - err = pcilib_read_register(handle, bank, reg, &verify); - if (err) Error("Error reading back register %s for verification\n", reg); - - if (!((model_info->registers[regid].mode&PCILIB_REGISTER_INCONSISTENT) == PCILIB_REGISTER_INCONSISTENT) && - verify != value) { - Error("Failed to write register %s: %lu is written and %lu is read back", reg, value, verify); - } else { - printf("%s = ", reg); - printf(format, verify); - printf("\n"); - } + if(!((model_info->registers[regid].mode&PCILIB_REGISTER_INCONSISTENT) == PCILIB_REGISTER_INCONSISTENT)) + { + err = pcilib_read_register(handle, bank, reg, &verify); + if (err) Error("Error reading back register %s for verification\n", reg); + + if ( verify != value) { + Error("Failed to write register %s: %lu is written and %lu is read back", reg, value, verify); + } else { + printf("%s = ", reg); + printf(format, verify); + printf("\n"); + } + } + else + printf("%s is written\n ", reg); } else { printf("%s is written\n ", reg); } -- cgit v1.2.3 From 1b3342649294c6ce99aeb82664a29eac47687ee5 Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Fri, 12 Feb 2016 17:50:57 +0100 Subject: Move python module init code to transfom view constructor Update python logger and python exeption messages Change serialization method in create_pcilib_instance set_pcilib functions --- pcitool/cli.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'pcitool') diff --git a/pcitool/cli.c b/pcitool/cli.c index 3676a56..0b0c98d 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -1716,8 +1716,6 @@ int WriteRegister(pcilib_t *handle, const pcilib_model_description_t *model_info printf("\n"); } } - else - printf("%s is written\n ", reg); } else { printf("%s is written\n ", reg); } -- cgit v1.2.3