tqchen commented on a change in pull request #4274: [µTVM] Enable AutoTVM for 
ARM STM32F746XX Boards
URL: https://github.com/apache/incubator-tvm/pull/4274#discussion_r343926911
 
 

 ##########
 File path: src/runtime/micro/device/arm/stm32f746xx/utvm_timer.c
 ##########
 @@ -0,0 +1,102 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "utvm_runtime.h"
+
+// There are two implementations of cycle counters on the STM32F7X: SysTick and
+// CYCCNT.  SysTick is preferred, as it gives better error handling, but the
+// counter is only 24 bits wide.  If a larger timer is needed, use the CYCCNT
+// implementation, which has a 32-bit counter.
+#define USE_SYSTICK
+
+#ifdef USE_SYSTICK
+
+#define SYST_CSR    (*((volatile unsigned long *) 0xE000E010))
+#define SYST_RVR    (*((volatile unsigned long *) 0xE000E014))
+#define SYST_CVR    (*((volatile unsigned long *) 0xE000E018))
+#define SYST_CALIB  (*((volatile unsigned long *) 0xE000E01C))
+
+#define SYST_CSR_ENABLE     0
+#define SYST_CSR_TICKINT    1
+#define SYST_CSR_CLKSOURCE  2
+#define SYST_COUNTFLAG      16
+
+#define SYST_CALIB_NOREF  31
+#define SYST_CALIB_SKEW   30
+
+unsigned long start_time = 0;
+unsigned long stop_time = 0;
+
+int32_t UTVMTimerStart() {
+    SYST_CSR = (1 << SYST_CSR_ENABLE) | (1 << SYST_CSR_CLKSOURCE);
 
 Review comment:
   indent(2 space)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to