[Cryptech-Commits] [sw/stm32] branch master updated: Make fmc-test less chatty.

git at cryptech.is git at cryptech.is
Thu Sep 21 21:09:38 UTC 2017


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/stm32.

The following commit(s) were added to refs/heads/master by this push:
     new 7b80c54  Make fmc-test less chatty.
7b80c54 is described below

commit 7b80c545ac7e4abb820729ff8932cf681a2333bd
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Thu Sep 21 09:29:03 2017 -0400

    Make fmc-test less chatty.
---
 projects/board-test/fmc-test.c | 57 +++++++++++++++++++++++++-----------------
 1 file changed, 34 insertions(+), 23 deletions(-)

diff --git a/projects/board-test/fmc-test.c b/projects/board-test/fmc-test.c
index c6a37e6..ed5891a 100644
--- a/projects/board-test/fmc-test.c
+++ b/projects/board-test/fmc-test.c
@@ -4,8 +4,7 @@
 
 /*
  This requires a special bitstream with a special test register.
- See core/platform/novena/fmc/rtl/novena_fmc_top.v, sections marked
- `ifdef test:
+ See core/platform/alpha/rtl/alpha_fmc_test.v:
    //----------------------------------------------------------------
    // Dummy Register
    //
@@ -76,6 +75,7 @@ int test_fpga_address_bus(void);
 // Defines
 //------------------------------------------------------------------------------
 #define TEST_NUM_ROUNDS		100000
+#define VERBOSE			0
 
 
 //------------------------------------------------------------------------------
@@ -85,6 +85,7 @@ int main(void)
   int i;
   
   stm_init();
+  uart_set_default(STM_UART_MGMT);
 
   uart_send_string("Keep calm for FPGA bitstream loading...\r\n");
 
@@ -117,11 +118,15 @@ int main(void)
       // test address bus
       addr_test_ok = test_fpga_address_bus();
 
-      uart_send_string("Data: ");
-      uart_send_integer(data_test_ok, 6);
-      uart_send_string(", addr: ");
-      uart_send_integer(addr_test_ok, 6);
-      uart_send_string("\r\n");
+      if (VERBOSE ||
+          (data_test_ok != TEST_NUM_ROUNDS ||
+           addr_test_ok != TEST_NUM_ROUNDS)) {
+        uart_send_string("Data: ");
+        uart_send_integer(data_test_ok, 6);
+        uart_send_string(", addr: ");
+        uart_send_integer(addr_test_ok, 6);
+        uart_send_string("\r\n");
+      }
 
       if (data_test_ok == TEST_NUM_ROUNDS &&
 	  addr_test_ok == TEST_NUM_ROUNDS) {
@@ -140,8 +145,9 @@ int main(void)
       uart_send_integer(successful_runs, 0);
       uart_send_string(", fail ");
       uart_send_integer(failed_runs, 0);
-      uart_send_string("\r\n\r\n");
-
+      uart_send_string("\r\n");
+      if (VERBOSE)
+        uart_send_string("\r\n");
       HAL_Delay(sleep);
     }
 
@@ -194,13 +200,16 @@ int test_fpga_data_bus(void)
   data_diff = buf;
   data_diff ^= rnd;
 
-  uart_send_string("Sample of data bus test data: expected ");
-  uart_send_binary(rnd, 32);
-  uart_send_string(", got ");
-  uart_send_binary(buf, 32);
-  uart_send_string(", diff ");
-  uart_send_binary(data_diff, 32);
-  uart_send_string("\r\n");
+  if (VERBOSE || data_diff) {
+      uart_send_string("Sample of data bus test data: expected ");
+      uart_send_binary(rnd, 32);
+      uart_send_string(", got ");
+      uart_send_binary(buf, 32);
+      uart_send_string(", diff ");
+      uart_send_binary(data_diff, 32);
+      uart_send_string("\r\n");
+  }
+
   // return number of successful tests
   return c;
 }
@@ -263,13 +272,15 @@ int test_fpga_address_bus(void)
   addr_diff = buf;
   addr_diff ^= rnd;
 
-  uart_send_string("Sample of addr bus test data: expected ");
-  uart_send_binary(rnd, 32);
-  uart_send_string(", got ");
-  uart_send_binary(buf, 32);
-  uart_send_string(", diff ");
-  uart_send_binary(addr_diff, 32);
-  uart_send_string("\r\n");
+  if (VERBOSE || addr_diff) {
+      uart_send_string("Sample of addr bus test data: expected ");
+      uart_send_binary(rnd, 32);
+      uart_send_string(", got ");
+      uart_send_binary(buf, 32);
+      uart_send_string(", diff ");
+      uart_send_binary(addr_diff, 32);
+      uart_send_string("\r\n");
+  }
 
   return c;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list