Difference between revisions of "MotoHawk:Blocks:Target Definition"

From MotoHawk
Jump to navigationJump to search
(Created page with " =Target Definition= Place this MotoHawkâ„¢ block somewhere in each MotoHawk code-generation model, typically on the top level, to select the type of ECU being used, and ...")
 
(Target Definition)
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
 
=Target Definition=
 
=Target Definition=
  
Place this MotoHawkâ„¢ block somewhere in each MotoHawk code-generation model, typically on the top level, to select the type of ECU being used, and assign certain operating parameters, or, instead, to create a MotoHawk component.
+
Place this MotoHawk™ block somewhere in each MotoHawk code-generation model, typically at the top level, to select the type of module to be used by the model. The block allows key operating parameters to be defined for use by the module including the stack sizes used by [[Task_Scheduling|ControlCore's Tasking]] Kernel.
  
The [../MotoHawk_topics/_auto/CrossReference.xhtml target] selected within this block selects destination hardware.
+
This block is also used to create a MotoHawk component.
 +
 
 +
The target selected within this block selects destination hardware.
 +
 
 +
== Module Cross Reference ==
 +
The Module Cross Reference Chart provides cross reference between the MCS modules and part numbers.  You can click on a specific ECU target to see available IO and functionality supported in MotoHawk software.
 +
 
 +
[http://mcs.woodward.com/content/motohawk/Documentation/CurrentVersion/HTML/MotoHawk_topics/_auto/CrossReference.html Target Cross Reference]
  
 
==Block ID==
 
==Block ID==
Line 26: Line 33:
 
===Stack and Heap Allocations===
 
===Stack and Heap Allocations===
  
'''What is Stack?'''  Each task within the application has an area of memory associated with it from which automatic variables within functions are allocated. As the application progresses through each function call (which itself makes further function calls), each local variable within that function reserves an area of stack to hold its value. The maximum stack needed for the task is theoretically the sum of the stack allocations made at the deepest level in the function call tree. There are some useful metrics taken by the ControlCore™ operating system and can be monitored under the folder: System | Memory | [TASK_NAME]TaskStackMinBytesFree, where TASK_NAME is usually FGND, BGND, ApplicationInterrupt, etc.<br /><br />'''<font color="red"><font size="larger">It is the application designer's responsibility to ensure adequate stack allocation. </font></font>'''<br /> The operation of the software is not deterministic when there is inadequate stack and the software may suffer from unexpected resets due to the CPU Operating Properly watchdog intervention. The [ApplicationMonitorDefinition.html application monitor] may be used as a debugging aid to a module experiencing inadequate stack allocation.<br /><br />'''How does ControlCore™ determine stack depth?'''  The tasking kernel fills each task stack with a predetermined pattern during stack creation. It then periodically counts (while idle) the number of bytes, starting from the end of the stack, that still contain the prestored pattern. As stack is used the prestored value is overwritten and thus the count is representative of the minimum bytes free metric. <br /><br />'''Note:''' It is possible that a non-zero minimum bytes free metric is provided by ControlCore™, but the stack allocation is still too small. There is a rare possibility that a function call allocates past the end of the stack, corrupts the data beyond the end of the stack, and yet some small block at very end of the stack still has the known pattern present. <br /><br />Before determining the "proper" stack allocations, Woodward recommends a very large stack allocation be made (due to memory constraints this may need to be done one task at a time). The application should be run such that all alternate code paths of the application have executed, and a margin of safety applied to the experimentally determined maximum stack depth. <br /><br />'''What is Heap?'''  Heap is a global area of memory from which dynamic allocations of memory may be made. Unlike stack, areas of heap are reserved (allocated and freed) in a manner which is not necessarily synchronous to the function calls made by the application. The pattern of allocation and size of blocks is not known until run time. The ControlCore™ operating system has a metric for heap usage which can be monitored from the same location as the stack metrics described above.
+
'''What is Stack?'''  Each task within the application has an area of memory associated with it from which automatic variables within functions are allocated. As the application progresses through each function call (which itself makes further function calls), each local variable within that function reserves an area of stack to hold its value. The maximum stack needed for the task is theoretically the sum of the stack allocations made at the deepest level in the function call tree. There are some useful metrics taken by the ControlCore™ operating system and can be monitored under the folder: System | Memory | [TASK_NAME]TaskStackMinBytesFree, where TASK_NAME is usually FGND, BGND, ApplicationInterrupt, etc.<br /><br />'''<font color="red"><font size="larger">It is the application designer's responsibility to ensure adequate stack allocation. </font></font>'''<br /> The operation of the software is not deterministic when there is inadequate stack and the software may suffer from unexpected resets due to the CPU Operating Properly watchdog intervention. The [ApplicationMonitorDefinition.html application monitor] may be used as a debugging aid to a module experiencing inadequate stack allocation.<br /><br />'''How does ControlCore™ determine stack depth?'''  The tasking kernel fills each task stack with a predetermined pattern during stack creation. It then periodically counts (while idle) the number of bytes, starting from the end of the stack, that still contain the prestored pattern. As stack is used the prestored value is overwritten and thus the count is representative of the minimum bytes free metric. <br /><br />'''Note:''' It is possible that a non-zero minimum bytes free metric is provided by ControlCore™, but the stack allocation is still too small. In this case, there is a possibility that a function call allocates past the end of the stack, corrupting the data beyond the end of the stack, and yet some small block at the very end of the stack still has the known pattern present. <br /><br />Before determining the "proper" stack allocations, Woodward recommends a very large stack allocation be made (due to memory constraints this may need to be done one task at a time). The application should be run such that all alternate code paths of the application have executed, and a margin of safety applied to the experimentally determined maximum stack depth. <br /><br />'''What is Heap?'''  Heap is a global area of memory from which dynamic allocations of memory may be made. Unlike stack, areas of heap are reserved (allocated and freed) in a manner which is not necessarily synchronous to the function calls made by the application. The pattern of allocation and size of blocks is not known until run time. The ControlCore™ operating system has a metric for heap usage which can be monitored from the same location as the stack metrics described above.
  
 
==Block Parameters==
 
==Block Parameters==
{| class="wikitable" style="width: 80%"
+
 
! style="width: 20%" | Parameter Field
+
{| class="TableMHStyle"
! style="width: 20%" | Values
+
! class="TableHeaderTDStyle" style="width: 172px" | Parameter Field
! style="width: 60%" | Comments/Description
+
! class="TableHeaderTDStyle" style="width: 158px" | Values
 +
! class="TableHeaderTDStyle" style="width: 299px" | Comments/Description
 
|- id="target"
 
|- id="target"
| |
+
| class="TableTDStyle" style="width: 172px" valign="top" |
[CrossReference.xhtml Target]
+
[../MotoHawk_topics/_auto/CrossReference.xhtml Target]
| | Drop-down list
+
| class="TableTDStyle" style="width: 158px" valign="top" | Drop-down list
| | Pick Target ECU for model.
+
| class="TableTDStyle" style="width: 299px" valign="top" | Pick Target ECU for model.
 
|- id="layout"
 
|- id="layout"
| | Memory Layout
+
| class="TableTDStyle" style="width: 172px" valign="top" | Memory Layout
| | DEV, PROD, DEV+PROD
+
| class="TableTDStyle" style="width: 158px" valign="top" | DEV, PROD, DEV+PROD
| | Select intended ECU memory usage  - some ECUs have development (DEV) versions with additional memory configuration, as differing from the intended production usage (PROD).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Select intended ECU memory usage  - some ECUs have development (DEV) versions with additional memory configuration, as differing from the intended production usage (PROD).
 
|-
 
|-
| | Floating Point Type
+
| class="TableTDStyle" style="width: 172px" valign="top" | Floating Point Type
| | single(32), double(64), disabled
+
| class="TableTDStyle" style="width: 158px" valign="top" | single(32), double(64), disabled
| | Select the memory usage for floating point values storage
+
| class="TableTDStyle" style="width: 299px" valign="top" | Select the memory usage for floating point values storage
 
|-
 
|-
| | Build Directory (absolute, relative to model, or current directory if empty)
+
| class="TableTDStyle" style="width: 172px" valign="top" | Build Directory (absolute, relative to model, or current directory if empty)
| | Text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Text, single-quote enclosed
| | (Optional) Specify the local directory for build file(s).  If empty, the current directory will be used. If specified, it may be an absolute path, or be relative to the current model location by starting with "."
+
| class="TableTDStyle" style="width: 299px" valign="top" | (Optional) Specify the local directory for build file(s).  If empty, the current directory will be used. If specified, it may be an absolute path, or be relative to the current model location by starting with "."
 
|- id="layout0"
 
|- id="layout0"
| | Component Directory (absolute, relative to model, or current directory if empty)
+
| class="TableTDStyle" style="width: 172px" valign="top" | Component Directory (absolute, relative to model, or current directory if empty)
| | Text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Text, single-quote enclosed
| | (Optional) Specify the local directory for component file(s).  If empty, the current directory will be used. If specified, it may be an absolute path, or be relative to the current model location by starting with "."
+
| class="TableTDStyle" style="width: 299px" valign="top" | (Optional) Specify the local directory for component file(s).  If empty, the current directory will be used. If specified, it may be an absolute path, or be relative to the current model location by starting with "."
 
|-
 
|-
 
| class="TableTDStyle" colspan="3" valign="top" | '''ECU-Related''' (when Target selection is an ECU)
 
| class="TableTDStyle" colspan="3" valign="top" | '''ECU-Related''' (when Target selection is an ECU)
 
|- id="fgnd_stack_size"
 
|- id="fgnd_stack_size"
| | Foreground Stack Size (Time-Based)
+
| class="TableTDStyle" style="width: 172px" valign="top" | Foreground Stack Size (Time-Based)
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Used for temporary variables in foreground periodic events. On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Used for temporary variables in foreground periodic events. On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="fgnd_angle_stack_size"
 
|- id="fgnd_angle_stack_size"
| | Foreground Stack Size (Angle-Based)
+
| class="TableTDStyle" style="width: 172px" valign="top" | Foreground Stack Size (Angle-Based)
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Used for temporary variables in foreground angle events (Hires, _30 ...). On 5xx targets must be a multiple of 8 bytes and have a minimum of 512 bytes or be 0 bytes. On S12 or 55xx targets any positive integer will work. Note: if this is 0 all angle based variables go into the periodic foreground stack. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Used for temporary variables in foreground angle events (Hires, _30 ...). On 5xx targets must be a multiple of 8 bytes and have a minimum of 512 bytes or be 0 bytes. On S12 or 55xx targets any positive integer will work. Note: if this is 0 all angle based variables go into the periodic foreground stack. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="bgnd_stack_size"
 
|- id="bgnd_stack_size"
| | Background Stack Size
+
| class="TableTDStyle" style="width: 172px" valign="top" | Background Stack Size
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Used for temporary variables in background periodic events. On 5xx targets must be a multiple of 8 bytes with a minimum of 1024 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Used for temporary variables in background periodic events. On 5xx targets must be a multiple of 8 bytes with a minimum of 1024 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="idle_stack_size"
 
|- id="idle_stack_size"
| | Idle Stack Size
+
| class="TableTDStyle" style="width: 172px" valign="top" | Idle Stack Size
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Used for temporary variables in idle events. On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Used for temporary variables in idle events. On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="irq_stack_size"
 
|- id="irq_stack_size"
| | Interrupt Stack Size
+
| class="TableTDStyle" style="width: 172px" valign="top" | Interrupt Stack Size
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Used for temporary variables during an interrupt (CAN message, crank tooth) . On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Used for temporary variables during an interrupt (CAN message, crank tooth) . On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="application_interrupt_stack_size"
 
|- id="application_interrupt_stack_size"
| | Application Interrupt Stack Size
+
| class="TableTDStyle" style="width: 172px" valign="top" | Application Interrupt Stack Size
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Sets the stack size for application driven interrupts. Only available on S12 and 55xx targets. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Sets the stack size for application driven interrupts. Only available on S12 and 55xx targets. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="shutdown_stack_size"
 
|- id="shutdown_stack_size"
| | Shutdown Stack Size
+
| class="TableTDStyle" style="width: 172px" valign="top" | Shutdown Stack Size
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Sets the stack for the shutdown tasks. Only available on S12 and 55xx targets. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Sets the stack for the shutdown tasks. Only available on S12 and 55xx targets. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="heap_size"
 
|- id="heap_size"
| | Heap Size
+
| class="TableTDStyle" style="width: 172px" valign="top" | Heap Size
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| | Generally used for resource (PWM) and queue overflows. For GCC on 5xx targets Heap must be a multiple of 128 bytes, and must be at least 1024 bytes. For GHS on 5xx targets Heap must be a multiple of 2048 bytes, and must be at least 2048 bytes. For the S12 or 55xx targets using CodeWarrior or GHS any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Generally used for resource (PWM) and queue overflows. For GCC on 5xx targets Heap must be a multiple of 128 bytes, and must be at least 1024 bytes. For GHS on 5xx targets Heap must be a multiple of 2048 bytes, and must be at least 2048 bytes. For the S12 or 55xx targets using CodeWarrior or GHS any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
 
|- id="dll_name"
 
|- id="dll_name"
| | DLL Filename
+
| class="TableTDStyle" style="width: 172px" valign="top" | DLL Filename
| | Text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Text, single-quote enclosed
| | (Optional) Specify the name for .dll file(s) - if unspecified, the model name is used. Do not include the file extension (.dll) in the entry.
+
| class="TableTDStyle" style="width: 299px" valign="top" | (Optional) Specify the name for .dll file(s) - if unspecified, the model name is used. Do not include the file extension (.dll) in the entry.
 
|- id="srz_name"
 
|- id="srz_name"
| | SRZ Filename
+
| class="TableTDStyle" style="width: 172px" valign="top" | SRZ Filename
| | Text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Text, single-quote enclosed
| | (Optional) Specify the name for .srz file(s) - if unspecified, the model name is used. Do not include the file extension (.srz) in the entry.
+
| class="TableTDStyle" style="width: 299px" valign="top" | (Optional) Specify the name for .srz file(s) - if unspecified, the model name is used. Do not include the file extension (.srz) in the entry.
 
|-
 
|-
 
| class="TableTDStyle" colspan="3" valign="top" | '''S12 and 55xx Target Specific''' (when Target selection has a S12 or 55xx processor)
 
| class="TableTDStyle" colspan="3" valign="top" | '''S12 and 55xx Target Specific''' (when Target selection has a S12 or 55xx processor)
 
|- id="foreground_stack_margin"
 
|- id="foreground_stack_margin"
| | Foreground Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Foreground Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the periodic foreground stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the periodic foreground stack.
 
|- id="foreground_angle_stack_margin"
 
|- id="foreground_angle_stack_margin"
| | Foreground Angle Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Foreground Angle Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the angle based foreground stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the angle based foreground stack.
 
|- id="background_stack_margin"
 
|- id="background_stack_margin"
| | Background Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Background Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the background stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the background stack.
 
|- id="idle_stack_margin"
 
|- id="idle_stack_margin"
| | Idle Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Idle Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the idle stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the idle stack.
 
|- id="interrupt_stack_margin"
 
|- id="interrupt_stack_margin"
| | Interrupt Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Interrupt Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the interrupt stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the interrupt stack.
 
|- id="application_interrupt_stack_margin"
 
|- id="application_interrupt_stack_margin"
| | Application Interrupt Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Application Interrupt Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the application interrupt stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the application interrupt stack.
 
|- id="shutdown_stack_margin"
 
|- id="shutdown_stack_margin"
| | Shutdown Stack Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Shutdown Stack Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the shutdown stack.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the shutdown stack.
 
|- id="heap_margin"
 
|- id="heap_margin"
| | Heap Margin [bytes]
+
| class="TableTDStyle" style="width: 172px" valign="top" | Heap Margin [bytes]
| | Numeric
+
| class="TableTDStyle" style="width: 158px" valign="top" | Numeric
| |
+
| class="TableTDStyle" style="width: 299px" valign="top" |
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the heap.
 
This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the heap.
 
|-
 
|-
 
| class="TableTDStyle" colspan="3" valign="top" | '''Component-Related''' (when Target selection is "Component")
 
| class="TableTDStyle" colspan="3" valign="top" | '''Component-Related''' (when Target selection is "Component")
 
|-
 
|-
| | Component Name
+
| class="TableTDStyle" style="width: 172px" valign="top" | Component Name
| | Alpha-numeric text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Alpha-numeric text, single-quote enclosed
| | Name for Component block. No special characters, such as spaces, dashes, commas (underscore allowed)
+
| class="TableTDStyle" style="width: 299px" valign="top" | Name for Component block. No special characters, such as spaces, dashes, commas (underscore allowed)
 
|-
 
|-
| | Component Image
+
| class="TableTDStyle" style="width: 172px" valign="top" | Component Image
| | Alpha-numeric text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Alpha-numeric text, single-quote enclosed
| | Source file for image that appears in component block (file must be placed in component folder).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Source file for image that appears in component block (file must be placed in component folder).
 
|-
 
|-
| | Security Level
+
| class="TableTDStyle" style="width: 172px" valign="top" | Security Level
| |
+
| class="TableTDStyle" style="width: 158px" valign="top" |
| | Select type of security for Component access.
+
| class="TableTDStyle" style="width: 299px" valign="top" | Select type of security for Component access.
 
|-
 
|-
| |
+
| class="TableTDStyle" style="width: 172px" valign="top" |
| | No Encryption
+
| class="TableTDStyle" style="width: 158px" valign="top" | No Encryption
| | No encryption applied
+
| class="TableTDStyle" style="width: 299px" valign="top" | No encryption applied
 
|-
 
|-
| |
+
| class="TableTDStyle" style="width: 172px" valign="top" |
| | Encrypt Embedded Build - Allow Simulation
+
| class="TableTDStyle" style="width: 158px" valign="top" | Encrypt Embedded Build - Allow Simulation
| | Access to build prevented (without passphrase), simulation allowed
+
| class="TableTDStyle" style="width: 299px" valign="top" | Access to build prevented (without passphrase), simulation allowed
 
|-
 
|-
| |
+
| class="TableTDStyle" style="width: 172px" valign="top" |
| | Encrypt Entire Package
+
| class="TableTDStyle" style="width: 158px" valign="top" | Encrypt Entire Package
| | Passphrase required for simulation and use
+
| class="TableTDStyle" style="width: 299px" valign="top" | Passphrase required for simulation and use
 
|-
 
|-
| | Build Passphrase
+
| class="TableTDStyle" style="width: 172px" valign="top" | Build Passphrase
| | Alpha-numeric text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Alpha-numeric text, single-quote enclosed
| | Passphrase required for access to component build (for simulation)
+
| class="TableTDStyle" style="width: 299px" valign="top" | Passphrase required for access to component build (for simulation)
 
|-
 
|-
| | Wrapper Passphrase
+
| class="TableTDStyle" style="width: 172px" valign="top" | Wrapper Passphrase
| | Alpha-numeric text, single-quote enclosed
+
| class="TableTDStyle" style="width: 158px" valign="top" | Alpha-numeric text, single-quote enclosed
| | Passphrase required for access to component (for any use).
+
| class="TableTDStyle" style="width: 299px" valign="top" | Passphrase required for access to component (for any use).
 
|- id="comp_dir"
 
|- id="comp_dir"
| | Allow multiple instances of the component (less efficient)
+
| class="TableTDStyle" style="width: 172px" valign="top" | Allow multiple instances of the component (less efficient)
| | Check box (enable)
+
| class="TableTDStyle" style="width: 158px" valign="top" | Check box (enable)
| | Enable use of multiple component instances in a single model.
+
| class="TableTDStyle" style="width: 299px" valign="top" | Enable use of multiple component instances in a single model.
 
|}
 
|}
 +
 +
</div>

Latest revision as of 14:04, 3 April 2013

Target Definition

Place this MotoHawk™ block somewhere in each MotoHawk code-generation model, typically at the top level, to select the type of module to be used by the model. The block allows key operating parameters to be defined for use by the module including the stack sizes used by ControlCore's Tasking Kernel.

This block is also used to create a MotoHawk component.

The target selected within this block selects destination hardware.

Module Cross Reference

The Module Cross Reference Chart provides cross reference between the MCS modules and part numbers. You can click on a specific ECU target to see available IO and functionality supported in MotoHawk software.

Target Cross Reference

Block ID

motohawk_target_def

Library

MotoHawk_lib

Description

Target Definition.PNG

The Target Definition block is placed initially by default; it is good practice to select the required target ECU, as a first step, if different than the one initially displayed. This is required in order to specify the type of ECU to be programmed, and predetermines the availability of appropriate parameters in certain blocks (double-click on a block to edit the parameters).

The [../MotoHawk_topics/_auto/CrossReference.xhtml target cross reference] assists selection of Target based on hardware.

If "Component" is selected as the Target type, the model and contained components and implied algorithms are stored as a usable model subsystem analogous to a program function or subroutine. The component can be placed in a model; it is pre-compiled and thus takes less build time and space. Use of components is most strategically advantageous when a larger model requires extravagant compilation times; in this case portions of the model might be sectioned off and complied as component pieces. Components can be encrypted and passphrase protected for security purposes.

Stack and Heap Allocations

What is Stack? Each task within the application has an area of memory associated with it from which automatic variables within functions are allocated. As the application progresses through each function call (which itself makes further function calls), each local variable within that function reserves an area of stack to hold its value. The maximum stack needed for the task is theoretically the sum of the stack allocations made at the deepest level in the function call tree. There are some useful metrics taken by the ControlCore™ operating system and can be monitored under the folder: System | Memory | [TASK_NAME]TaskStackMinBytesFree, where TASK_NAME is usually FGND, BGND, ApplicationInterrupt, etc.

It is the application designer's responsibility to ensure adequate stack allocation.
The operation of the software is not deterministic when there is inadequate stack and the software may suffer from unexpected resets due to the CPU Operating Properly watchdog intervention. The [ApplicationMonitorDefinition.html application monitor] may be used as a debugging aid to a module experiencing inadequate stack allocation.

How does ControlCore™ determine stack depth? The tasking kernel fills each task stack with a predetermined pattern during stack creation. It then periodically counts (while idle) the number of bytes, starting from the end of the stack, that still contain the prestored pattern. As stack is used the prestored value is overwritten and thus the count is representative of the minimum bytes free metric.

Note: It is possible that a non-zero minimum bytes free metric is provided by ControlCore™, but the stack allocation is still too small. In this case, there is a possibility that a function call allocates past the end of the stack, corrupting the data beyond the end of the stack, and yet some small block at the very end of the stack still has the known pattern present.

Before determining the "proper" stack allocations, Woodward recommends a very large stack allocation be made (due to memory constraints this may need to be done one task at a time). The application should be run such that all alternate code paths of the application have executed, and a margin of safety applied to the experimentally determined maximum stack depth.

What is Heap? Heap is a global area of memory from which dynamic allocations of memory may be made. Unlike stack, areas of heap are reserved (allocated and freed) in a manner which is not necessarily synchronous to the function calls made by the application. The pattern of allocation and size of blocks is not known until run time. The ControlCore™ operating system has a metric for heap usage which can be monitored from the same location as the stack metrics described above.

Block Parameters

Parameter Field Values Comments/Description

[../MotoHawk_topics/_auto/CrossReference.xhtml Target]

Drop-down list Pick Target ECU for model.
Memory Layout DEV, PROD, DEV+PROD Select intended ECU memory usage - some ECUs have development (DEV) versions with additional memory configuration, as differing from the intended production usage (PROD).
Floating Point Type single(32), double(64), disabled Select the memory usage for floating point values storage
Build Directory (absolute, relative to model, or current directory if empty) Text, single-quote enclosed (Optional) Specify the local directory for build file(s). If empty, the current directory will be used. If specified, it may be an absolute path, or be relative to the current model location by starting with "."
Component Directory (absolute, relative to model, or current directory if empty) Text, single-quote enclosed (Optional) Specify the local directory for component file(s). If empty, the current directory will be used. If specified, it may be an absolute path, or be relative to the current model location by starting with "."
ECU-Related (when Target selection is an ECU)
Foreground Stack Size (Time-Based) Numeric Used for temporary variables in foreground periodic events. On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
Foreground Stack Size (Angle-Based) Numeric Used for temporary variables in foreground angle events (Hires, _30 ...). On 5xx targets must be a multiple of 8 bytes and have a minimum of 512 bytes or be 0 bytes. On S12 or 55xx targets any positive integer will work. Note: if this is 0 all angle based variables go into the periodic foreground stack. Run-time stack usage can be monitored in MotoTune (System | Memory).
Background Stack Size Numeric Used for temporary variables in background periodic events. On 5xx targets must be a multiple of 8 bytes with a minimum of 1024 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
Idle Stack Size Numeric Used for temporary variables in idle events. On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
Interrupt Stack Size Numeric Used for temporary variables during an interrupt (CAN message, crank tooth) . On 5xx targets must be a multiple of 8 bytes with a minimum of 512 bytes. On S12 or 55xx targets any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
Application Interrupt Stack Size Numeric Sets the stack size for application driven interrupts. Only available on S12 and 55xx targets. Run-time stack usage can be monitored in MotoTune (System | Memory).
Shutdown Stack Size Numeric Sets the stack for the shutdown tasks. Only available on S12 and 55xx targets. Run-time stack usage can be monitored in MotoTune (System | Memory).
Heap Size Numeric Generally used for resource (PWM) and queue overflows. For GCC on 5xx targets Heap must be a multiple of 128 bytes, and must be at least 1024 bytes. For GHS on 5xx targets Heap must be a multiple of 2048 bytes, and must be at least 2048 bytes. For the S12 or 55xx targets using CodeWarrior or GHS any positive integer will work. Run-time stack usage can be monitored in MotoTune (System | Memory).
DLL Filename Text, single-quote enclosed (Optional) Specify the name for .dll file(s) - if unspecified, the model name is used. Do not include the file extension (.dll) in the entry.
SRZ Filename Text, single-quote enclosed (Optional) Specify the name for .srz file(s) - if unspecified, the model name is used. Do not include the file extension (.srz) in the entry.
S12 and 55xx Target Specific (when Target selection has a S12 or 55xx processor)
Foreground Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the periodic foreground stack.

Foreground Angle Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the angle based foreground stack.

Background Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the background stack.

Idle Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the idle stack.

Interrupt Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the interrupt stack.

Application Interrupt Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the application interrupt stack.

Shutdown Stack Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the shutdown stack.

Heap Margin [bytes] Numeric

This triggers the [./ApplicationMonitorDefinition2ndGeneration.html Application Monitor Definition 2nd Generation] when less than this number of bytes are free in the heap.

Component-Related (when Target selection is "Component")
Component Name Alpha-numeric text, single-quote enclosed Name for Component block. No special characters, such as spaces, dashes, commas (underscore allowed)
Component Image Alpha-numeric text, single-quote enclosed Source file for image that appears in component block (file must be placed in component folder).
Security Level Select type of security for Component access.
No Encryption No encryption applied
Encrypt Embedded Build - Allow Simulation Access to build prevented (without passphrase), simulation allowed
Encrypt Entire Package Passphrase required for simulation and use
Build Passphrase Alpha-numeric text, single-quote enclosed Passphrase required for access to component build (for simulation)
Wrapper Passphrase Alpha-numeric text, single-quote enclosed Passphrase required for access to component (for any use).
Allow multiple instances of the component (less efficient) Check box (enable) Enable use of multiple component instances in a single model.