NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

User:DVT/UserDocumentation/DVT Control Panel

From Texas Instruments Wiki
Jump to: navigation, search

Solution Control Panel[edit]

Solution Control Panel is a highly customizable Run Time / Configuration tool for DVT solution providers to hide the complexity of solution from the end users and facilitates configuration tasks that are required by the solution usually before any data can be analyzed / visualized as well as while Solution is running.

Solution Control Panel, consist of the following GUI components:

  • A Tool Bar contribution for selecting a solution and launching the Control panel
  • A Tool Bar contribution to Open the views
  • And a Control Panel View

What’s shown in control panel toolbar and the Solution Control Panel view are all populated using configuration file(s) with “.cp.xml” extension that are found under the Solution Search directory on eclipse startup.

Since with these .cp.xml files, we will generate proper GUI controls dynamically, we might think of the control panel xml files, as a GUI generator as well.

Control Panel Toolbar[edit]

Control Panel Toolbar
Open Views Toolbar

The choices in Control Panel Toolbar's drop down menu is populated with the Solution commands that are found in the .cp.xml files.

Right after user selects one of these presented solution names, the corresponding solution will be loaded into memory (and the previously loaded solution by the control panel view will be closed)

The Control Panel View automatically gets opened as soon as a selection is made.

Open Views Toolbar[edit]

This historically belonged to DVT.UI plugin but today is part of solution control panel. User can open the data views that belong to a solution using this contribution. Also contributed to the main menu/Window.

The list is populated as solution get loaded with the solution name on the top and any data views or categories defined for data views as submenus of the view.

Note that internally if the solution is loaded more than once into memory, the solution name gets appended with a number at the end to differentiate between the loaded solutions.

Control Panel View a.k.a Solution Control Panel[edit]

Generic Control Panel View
SoC Analyzer Control Panel

With control panel view, you can collect necessary information from user to configure the solution and/or perform different operation on the solution before or while the solution is running.


Control Panel View can be opened (/brought in focus) by pressing the control panel icon on toolbar.


DVT provides a generic Control Panel View (Solution Control Panel) that gets constructed using the .cp.xml files found under solution search path but advanced users might provide their own control panel view implementation that can still be hooked up to the same .cp.xml configuration files using ControlPanelView command. An example usage of this can be found in SoC Analyzer solution.


Generic Control Panel View has three sections:

  • Properties section located on the right side of the view
  • A checkbox tree with do/undo capability in the upper left section of the view
  • Buttons which are shown when at least one button is defined in the lower left section of the view

The contents of all these sections get populated by what's defined in .cp.xml file.


Get Commands construct the properties sections. ActionNodes define the actions on the left section of the view. The checkbox tree nesting corresponds to how the action nodes are nested in the xml file (or how the directories containing the .cp.xml files are nested) and if an ActionNode is of type Button it'll show up in the Buttons area.

Solution Search Path[edit]

Solution Search Path in Standalone DVT
Solution Search Path in CCS

The Default Solution Search directory for standalone DVT is under:

  <dvt_install_dir>\dvt\platform

And for CCS is under

  <ccs_install_dir>\ccsv4\dvt\platform

Solution Search Path value can be changed to a different directory in DVT preferences page. The preference is called Solution Search Path and after changing its value you’d need to restart DVT/eclipse.

Also note that in general with eclipse preferences page, when switching or cleaning eclipse' workspace, the previously saved preferences will be replaced by their default values.

Configuring Control Panel (Tutorial)[edit]

Add your Solution Name to Toolbar[edit]

  • Create a directory with a name that resembles the solution you are providing, this name will show up in the toolbar, Example: “TraceVisualization”
  • Create an empty file with “.cp.xml” extension in that directory
  • Edit the “.cp.xml” file to add a root-node, called <ControlPanel />:

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel />

  • Restart DVT and you should see the directory name listed under [Select Solution] list box on toolbar

Add an action to Load the Solution when the Solution Name is selected[edit]

  • First create a <Node /> as a Child of <ControlPanel /> node and set it’s name attribute to a user readable comment (this currently doesn’t show up in DVT anywhere)

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel>

  <Node name="Configure Solution" />         

</ControlPanel>

  • Add a <Solution /> node under this node, and set it’s name attribute to the solution file name, you’d like to be loaded when user picks the parent directory name from the Toolbar’s listbox:

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel>

  <Node name="Configure Solution">
    <Solution name="TraceThreadExecution.sol"/>
  </Node>

</ControlPanel>

  • Open Solution Control Panel view by clicking on launch button( )on toolbar

Configure what’s shown in Properties pane where you’d like user to fill in some required values by solution[edit]

  • Under the same node in xml (Configure Solution Node), add <Get /> commands for each parameter you’d like to collect from user
  • Set the name attribute of <Get /> to a userDefined name that will be used later as a variable,
  • Set the display attribute of <Get /> to what you’d like to be displayed in Properties’ pane, “Property” Column
  • Set the type to the editor type that needs to be used in the “Value” Column. Supported types are:
    • text
    • file
    • checkbox
    • listbox:item1,item2,item3,…
    • Example (for the above screenshot):

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel>

  <Node name="Configure Solution">
     <Solution name="TraceThreadExecution.sol"/>
     <Get name="traceLog" 
         display="1-Trace Log File (*.csv)"  
         type="file" />
     <Get name="coff" 
         display="2-Symbol File (*.out)"  
         type="file" />
     <Get name="timestampFilter" 
         display="3-Timestamp Filter"  
         type="text" />
  </Node>

</ControlPanel>

  • Now by using <Set /> commands, you can assign a DataProcessor’s property (or a view’s property) to the values collected from user. Example:

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel>

  <Node name="Configure Solution">
     <Solution name="TraceThreadExecution.sol"/>
     <Get name="traceLog" 
         display="1-Trace Log File (*.csv)"  
         type="file" />
     <Get name="coff" 
         display="2-Symbol File (*.out)"  
         type="file" />
     <Get name="timestampFilter" 
         display="3-Timestamp Filter"  
         type="text" />
     <Set dpName="TextFileReader" 
         name="File Name" 
         value="traceLog" />
     <Set dpName="Tap" 
         name="Filter" 
         value="timestampFilter" />
  </Node>

</ControlPanel>

  • For <Set /> commands, dpname attribute should be set to the DataProcessor’s name that you’d like to set it’s value, name attribute should be set to property name of the DataProcessor, and value can be set to a variable name created by <Get />, it may also be a String constant or a combination of variables and constant (see the appendix for list of commands)

Configure what’s shown in CheckBox pane where you can add action buttons to perform an operation once user clicks on them[edit]

  • For each button you’d like to create you’ll need to add an < ActionNode /> node under “Configure Solution” node.
  • The name attribute of ActionNode will be displayed on the Checkbox tree.
  • Example:

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel>

  <Node name="Configure Solution">
     <Solution name="TraceThreadExecution.sol"/>
     <Get name="traceLog" 
         display="1-Trace Log File (*.csv)"  
         type="file" />
     <Get name="coff" 
         display="2-Symbol File (*.out)"  
         type="file" />
     <Get name="timestampFilter" 
         display="3-Timestamp Filter"  
         type="text" />
     <Set dpName="TextFileReader" 
         name="File Name" 
         value="traceLog" />
    <Set dpName="Tap" 
         name="Filter" 
         value="timestampFilter" />
    <ActionNode name="Load Symbols" >      
         <SymbolAccess symbolfile="coff" 
                        unload="yes" />
    </ActionNode>       
 
     <ActionNode name="Clear Graphs" >
        <SetViewProperty viewName="Exec Graph (Symbol)" name="Number of categories" value="'0'"/>   
        <SetViewProperty viewName="Exec Graph (ID)" name="Number of categories" value="'0'"/>          
    </ActionNode>
  </Node>

</ControlPanel>

Where two checkboxes will be added to the checkbox tree, first one called “Load Symbols” to load a symbol file (using SymbolAccess command) and the second one sets a number of view properties to a constant value.


The control panel view with this .cp.xml file will look like this:

ControlPanelView.jpg


  • ActionNodes may be nested to create a tree and checking/unchecking the parent node will affect the children nodes
  • Any number of commands may be used under ActionNode (and Nodes), please see next section for the list of all available commands


Configure what’s shown in buttons pane where you can add action buttons[edit]

  • For each button you’d like to create you’ll need to add an < ActionNode /> node under “Configure Solution” node with a non-empty button attribute.
  • The name attribute of ActionNode will be displayed on button and as it toolstip.
  • For the button attribute, if an image file is found in the icons directory of com.ti.dvt.solutioncontrol plugin's, it'll be shown as an icon, otherwise it acts as an indicator that this is a button node and not a checkbox tree node.
  • Example:

<?xml version="1.0" encoding="UTF-8"?> <ControlPanel>

  <Node name="Configure Solution">
     <Solution name="TraceThreadExecution.sol"/>
     <Get name="traceLog" 
         display="1-Trace Log File (*.csv)"  
         type="file" />
     <Get name="coff" 
         display="2-Symbol File (*.out)"  
         type="file" />
     <Get name="timestampFilter" 
         display="3-Timestamp Filter"  
         type="text" />
     <Set dpName="TextFileReader" 
         name="File Name" 
         value="traceLog" />
    <Set dpName="Tap" 
         name="Filter" 
         value="timestampFilter" />
     <ActionNode name="Start" button="start.gif">

<ScheduleJobs /> <StartDP />

     </ActionNode> 
     <ActionNode name="Stop" button="stop.gif">
     	<StopDP />
     	<ResetJobs />
     </ActionNode>
     
     <ActionNode name="Reset" button="reset.gif">
       <StopDP />
     	<ResetJobs />
     	<ResetDP />
     </ActionNode>      
  </Node>

</ControlPanel>

Where three buttons to start/stop and reset solution will be added


The control panel view with this .cp.xml file will look like this:

ControlPanelViewButtons.jpg

Control Panel Variables[edit]

Internally Control Panel makes use of an name-value pair store, and the values enterred by user through the property sheet of control panel, as well as a set of pre-defined varibles, are maintained in this variable store that can be referenced later on as part of commands.

Constant Values[edit]

Constant values are defined by surrounding them in single quotes. For example here we are setting the Mode property of HTTPDataSource to file.

<Set dpName="HTTPDataSource" name="Mode" value="'file'"/>

User Defined Variables[edit]

Users can define new variables using a Get command. For example here we are defining traceLog variable: <Get name="traceLog" display="1-Trace Log File (*.csv)" />

Using a ReadProperty command you can also add/define new user variables, where a number properties and their corresponding values can be read/added to the variable store.

Reserved Variables[edit]

The values of these variables are assigned by control panel when solution gets loaded automatically.

  • SolutionDir : Absolution path to DVT solution directory for the currently loaded solution by control panel.

Referencing Variables[edit]

Variables are referenced simply by their names, here we are referencing traceLog variable in a Set commannd, where we assign its value to a DataProcessor property:

<Set dpName="TextFileReader"

    name="File Name" 
    value="traceLog" />

When referencing variables, the vairable name can be concatenated to any static textual string in any order. For example here we are concatenating the value of Session variable (which is a directory name) with a constant string '\bioslog.bin':


<Set dpName="HTTPDataSource" name="Input File Name" value="Session'\bioslog.bin'"/>

Control Panel XML Commands[edit]

Get[edit]

Syntax
<Get name=”variablename” display=”displaystring” type=”editortype” />
Description
Display a variable in Properties Pane of Control Panel to gather required parameters from user
Attributes
name
variable name used for the values collected from user display string shown in Property Column of Control Panel’s property pane
type
type of cell editor to be used to collect information from user in Value Column of Control Panel’s property pane. Can be any of the followings:
  • text – for a text box (default – this could be used for String or Number)
  • file – file editor (relative to solution), file:absolute (use absolute path) file:relative (use relative path)
  • checkbox – checkbox editor
  • listbox:item1,item2,… – a listbox with item1,item2,… as its options
Example

<Get name="traceLog"

    display="1-Trace Log File (*.csv)"  
    type="file" />

Get command also define the set of properties to be shown in the property sheet of Control Panel view, where user may enter/assign values and define new variable.

Implementation Note: Internally Control Panel makes use of an name-value store, and the values enterred by user through the property sheet of control panel, will be maintained in this variable store and can be referenced later on in other commands.

ResetDP[edit]

Syntax
<ResetDP name=”dpname” />
Description
Call reset on a DP, if no name specified, resets all DPs, otherwise only resets the given dp.
Attributes
name
optional, if a name specified, reset the given dp.
Example

<ResetDP />

Set[edit]

Syntax
<Set dpName=”dpName” name=”dpPropertyName” value=”value” />
Description
Sets the value of a Data Processor’s property
Attributes
dpName
the name of DataProcessor as shown in Graphical Solution Builder
name
the property name of DataProcessor you’d like to set
value
can be variable name (same as the one used in <Get />) or a constant String. Constant Strings has to be surrounded by single quotes. A combination of variable and constant maybe used as a concatenated String: (variableName’constantString’)
Example

<Set dpName="TextFileReader"

    name="File Name" 
    value="traceLog" />

SetViewProperty[edit]

Syntax
<SetViewProperty viewName=”viewName” name=”viewPropertyName” value=”value” />
Description
Sets the value of a Views’s property
Attributes
viewName
the name of View as shown in Graphical Solution Builder / title of view
name
the property name of View you’d like to set. For nested Property names, use “:” specifying the property name from root node of the tree to leaf
value
can be variable name (same as the one used in <Get />) or a constant String. Constant Strings has to be surrounded by single quotes. A combination of variable and constant maybe used as a concatenated String: (variableName’constantString’)
Example

<SetViewProperty

  viewName="Exec Graph (Symbol)" 
  name="Number of categories" 
  value="'0'"/>   

Solution[edit]

Syntax
<Solution name=”solutionname” force="true/false" />
Description
Loads a solution
Attributes
name
The solution filename relative to the current .cp.xml file. (Solution file extension is .sol)
force
optional, default false, closes the solution before reopening it
Example

<Solution name="NokiaTrace2.sol" />

CloseSolution[edit]

Syntax
<CloseSolution />
Description
Closes a solution
Example

<CloseSolution />


StartDP[edit]

Syntax
<StartDP name=”dpname” />
Description
If no name specified, starts all DPs, otherwise only starts the given dp.
Attributes
name
optional, if a name specified, starts the given dp.
Example

<StartDP />

StopDP[edit]

Syntax
<StopDP name=”dpname” />
Description
If no name specified, Stops all DPs, otherwise only stops the given dp.
Attributes
name
optional, if a name specified, starts the given dp.
Example

<StopDP/>

SymbolAccess[edit]

Syntax
<SymbolAccess symbolfile=”filename” unload=”yes/no” />
Description
Loads a symbol file
Attributes
symbolfile
the symbol file to load
unload
optional, default yes(true), unloads all loaded symbol files before loading the specified symbol file
Example

<SymbolAccess symbolfile="c:/bigtime.out" />

View[edit]

Syntax
<View name=”viewname” />
Description
Opens a view if it is closed or brings it to focus (and un-checking the checkbox, closes the view)
Attributes
name
either the title of the view as shown in Graphical Solution Builder or the complete eclipse view id
Example

<View name="Exec Graph (Symbol)" /> <View name= "com.ti.ccstudio.emifconfig.views.EMIFConfigView" />

CreateDP[edit]

CreateView[edit]

FilterView[edit]

ResetViewProperty[edit]

CloneView[edit]

Syntax
<CloneView from=”source view name/type” name=”name for the cloned view” />
Description
Create a new view as an exact copy of the source view, including its properties, and connect the newly created view to the same buffer as the source view
Attributes
from
the source view we are copying
name
the name of newly created view
Example

<CloneView from="Running Task"

    name="'BIOS Running Task'"/>

Connect[edit]

Syntax
< Connect sourceDPName="sourceDPName" [sourceDPClass="sourceDPClassName"] sourceChannel="sourceChannelNumber" destinationDPName="destinationDPName" [destinationDPClass="destinationDPClassName"] destinationChannel="destinationChannelNumber" />
Description
Connnects the numberred output channel of the sourceDP (referenced by DPname or classname), to the numberred input channel of the destinationDP (referenced by DPname or classname)

ConnectView[edit]

HTTP[edit]

Syntax
<HTTP URL="url string" name="a comment" />
Description
Sends an HTTP request to the http server
Attributes
name
(optional), an informational message logged in the eclipse' Error Log View, to indicate success of the operation
URL
URL string of the server whic may contain userdefined variable that will be expanded before sending the request to the server.
Example

<HTTP name="Setting Track Logs"

     URL="'http://'Target IP Address'/settrackaddrs.cgi?addr1=0x20000040&addr2=0x20000044'" />                      

<HTTP name="Flushing selected logs"

     URL="'http://'Target IP Address'/logflush.cgi?logMask='Flush Mask" />

<HTTP name="Enabling selected logs"

     URL="'http://'Target IP Address'/enableLogging.cgi?logMask='Log Mask" />

Java (JavaScript)[edit]

Syntax
<Java statement=”single_line_statement” result="result" > [Statements] </Java>
Description
To be able to perform more opperations than what the xml commands provide, advanced users may specify any advanced operation using Javascript. The variables get expanded (using the values from Control Panel Variable Store) before executing the code. And optionally the result from the operation, may be saved in Control Panel Varible Store using the "result" attribute.
Attributes
statement
Optional - may also have the statements inside Java tags instead of as an attribute
result
Optional - If specified the result of Java snippet will be added/stored in the Variable store with the given name.
Example

<Java>

<![CDATA['
  temp = Packages.com.ti.dvt.emifconfig.EMIFRegisters.toXMLString("http://'Target IP Address'/readword.cgi?addr=%ADDRESS%","DM643x");      	
  fw = new java.io.FileWriter("'SolutionDir'\'Session'\emif.xml");
  fw.write(temp);
  fw.close();      	
']]>

</Java>

<Java result="CPU Speed">

<![CDATA['
  urlConnection = new Packages.java.net.URL("http://'Target IP Address'/getcpuspeed.cgi").openConnection();
  urlConnection.connect();
  httpURLInputStream = urlConnection.getInputStream();
  isr = new Packages.java.io.BufferedInputStream(httpURLInputStream);
  bb = Packages.java.nio.ByteBuffer.allocateDirect(4);
  bb.order(Packages.java.nio.ByteOrder.nativeOrder());
  for (i=0; i<4; i++)
       bb.put(new Packages.java.lang.Integer(isr.read()).byteValue());               
  isr.close();
  bb.rewind();
  bb.getInt() / 1000.0;
']]>

</Java>

ReadProperty[edit]

Syntax
<ReadProperty filename=”properties_filename” />
Description
Reads all the properties defined in the properties file in to the memory and adds them in the variable store.
Attributes
filename
the absolute filename where the properties file to read is located.
Example

<ReadProperty filename="SolutionDir'\'Session'\CPUSpeed.properties'" />

Sample properties file
CPUSpeed.properties

#
#Wed Jul 11 14:26:59 EDT 2007
CPU\ Speed=594.0

WriteProperty[edit]

Syntax
<WriteProperty name="variable_name" filename=”properties_filename” />
Description
Looks up the variable_name in the Control Panel Variable Store, and serializes(/writes) the property to the file using java properties serialization format.
Attributes
name
the variable name to serialize
filename
the absolute filename where the properties file to read is located.
Example

  <WriteProperty name="CPU Speed" filename="SolutionDir'\'Session'\CPUSpeed.properties'" />

Sample properties file
CPUSpeed.properties

#
#Wed Jul 11 14:26:59 EDT 2007
CPU\ Speed=594.0

Cmd (System Command)[edit]

Syntax
<CMD cmd=”system command string” verify=”verification string” />
Description
Runs a system command
Attributes
cmd
the command string, note you can use variables in the string using the string replacement notation
verify
optional, if specified, will prompt user to confirm before running the command
Example

<CMD cmd="'xcopy /Y /E /R /Q "'SolutionDir'_factory" "'SolutionDir'"'"

    verify="'Are you sure you want to replace your settings with factory settings?'"/>

ScheduleJobs[edit]

Syntax
<ScheduleJobs />
Description
Schedule DataSource jobs to start, showing them in eclipse progress bar.

ResetJobs[edit]

Syntax
<ResetJobs />
Description
Reset the DataSource jobs, removing them from eclipse' progress bar

ControlPanelView[edit]

Syntax
<ControlPanelView name=”view_id” />
Description
Enables hooking a customized control panel view to be shown instead of the generic control panel view
Attributes
name
The eclipse view id that we'd like to be opened.
Example

 <ControlPanelView name="com.ti.dvt.c64lc.controlpanel.views.C64lcControlPanel" />

ActionNode[edit]

Syntax
<ActionNode name="name" button="buttonIcon" condition="condition string" logError="error to be reported when condition is not met" />
Example

<ActionNode

  name="Start" 
  button="start.gif" 
  condition="'(new String("'Session'")).equals("sessions\");'" 
  logError="'Session cannot be null. Please pick a value from the sessions combo box.'" >
     	<ResetDP />
     	<SetViewProperty viewName="Running Task" name="Number of categories" value="'0'"/>      

<Set dpName="HTTPDataSource" name="Mode" value="'file'"/> <Set dpName="HTTPDataSource" name="Input File Name" value="Session'\bioslog.bin'"/> <Set dpName="RTALiteDecoder" name="Coff File Name" value="Symbol File"/>

       <Set dpName="EMIFTranslator" name="XMLconfig File" value="Session'\emif.xml'"/>

<ReadProperty filename="SolutionDir'\'Session'\CPUSpeed.properties'" />

       <Set dpName="RTALiteDecoder" name="Cpu Speed" value="CPU Speed" />

<ScheduleJobs /> <StartDP />

</ActionNode>