Changeset 320 for soft/giet_vm/giet_drivers/tim_driver.c
- Timestamp:
- Jun 10, 2014, 12:33:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_drivers/tim_driver.c
r295 r320 19 19 // 20 20 // The NB_PROCS_MAX and NB_TIM_CHANNELS values must be defined in hard_config.h file. 21 // ///////////////////////////////////////////////////////////////////////////////////21 // 22 22 // The virtual base address of the segment associated to a channel is: 23 // 24 // seg_tim_base + cluster_xy * vseg_cluster_increment + TIMER_SPAN * timer_id 25 // 26 // The seg_tim_base and vseg_cluster_increment values must be defined 27 // in the giet_vsegs.ld file. 23 // SEG_TIM_BASE + cluster_xy * VSEG_CLUSTER_INCREMENT + TIMER_SPAN * timer_id 24 // 25 // The SEG_TIM_BASE and VSEG_CLUSTER_INCREMENT must be defined in hard_config.h. 28 26 ///////////////////////////////////////////////////////////////////////////////////// 29 27 … … 33 31 #include <tty_driver.h> 34 32 #include <utils.h> 33 34 #if !defined(SEG_TIM_BASE) 35 # error: You must define SEG_TIM_BASE in the hard_config.h file 36 #endif 37 38 #if !defined(VSEG_CLUSTER_INCREMENT) 39 # error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file 40 #endif 35 41 36 42 #if !defined(X_SIZE) … … 92 98 } 93 99 94 unsigned int* timer_address = (unsigned int *) ( (unsigned int)&seg_tim_base +95 (cluster_xy * (unsigned int)&vseg_cluster_increment));100 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 101 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 96 102 97 103 timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = period; … … 123 129 } 124 130 125 unsigned int* timer_address = (unsigned int *) ( (unsigned int)&seg_tim_base +126 (cluster_xy * (unsigned int)&vseg_cluster_increment));131 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 132 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 127 133 128 134 timer_address[local_id * TIMER_SPAN + TIMER_MODE] = 0; … … 155 161 } 156 162 157 unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_tim_base +158 (cluster_xy * (unsigned int)&vseg_cluster_increment));163 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 164 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 159 165 160 166 timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 0; … … 189 195 190 196 // We suppose that the TIMER_MODE register value is 0x3 191 unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_tim_base +192 (cluster_xy * (unsigned int)&vseg_cluster_increment));197 unsigned int* timer_address = (unsigned int *) ( SEG_TIM_BASE + 198 (cluster_xy * VSEG_CLUSTER_INCREMENT) ); 193 199 194 200 unsigned int period = timer_address[local_id * TIMER_SPAN + TIMER_PERIOD];
Note: See TracChangeset
for help on using the changeset viewer.