<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Code Warrior Test Automation using TCL. CW 3.2.1 for StarCore DSPs in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160479#M2671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;# 1. Read the values of C-pointer-variables 'inPtr' and 'outPtr' into tcl_inPtr and tcl_outPtr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;This can be done using commands:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;set tcl_inPtr [evaluate ptrIn]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;set tcl_outPtr [evaluate outPtr]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;# 2. Using the values of the pointer we have to fill in the&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test pattern from '$in_testvector($i)' to the memory&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; area pointed by '$tcl_inPtr'&lt;BR /&gt;I would try the following here:&lt;/P&gt;&lt;P&gt;set offset [evaluate #x $tcl_inPtr+$i*4]&lt;/P&gt;&lt;P&gt;change m:$offset %x $in_testvector($i)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# 3. Using the values of the pointer we have to read in the&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test results from&amp;nbsp; the memory area pointed by&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$tcl_outPtr' to 'out_testresults($i)'&lt;BR /&gt;I would try the following here:&lt;/P&gt;&lt;P&gt;set offset_out [evaluate #x $tcl_outPtr+$i*4]&lt;/P&gt;&lt;P&gt;display m:$offset_out %x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Mar 2009 17:56:05 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2009-03-11T17:56:05Z</dc:date>
    <item>
      <title>Code Warrior Test Automation using TCL. CW 3.2.1 for StarCore DSPs</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160478#M2670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are trying to automate tesing for a project using TCL for automation. We have got this far and can't proceed any furthur without support. Please help us out, the help needed is also in the TCL code it self.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
###############################
# Open the Project
##############################################################
#proj -o ./test_project.mcp
###############################
# Build the Project
##############################################################
#make ./test_project.mcp
###############################
# Launch the Debugger.
##############################################################
#debug ./test_project.mcp
set t_infile&amp;nbsp; [open ./function_under_test_D3_D3_P3.in r]
###############################
# Read the test vector from the file
##############################################################
for {set i 0 } {$i &amp;lt; 962} {incr i 1} {
&amp;nbsp;&amp;nbsp; gets $t_infile line
&amp;nbsp;&amp;nbsp; set in_testvector(i) $line
}
###############################
# Close in file. Reading done.
##############################################################
close $t_infile
###############################
# Put Break point to fill Test vector
##############################################################
bp inputFunction
###############################
# Put Break point to extract Test results
##############################################################
bp outputFunction
###############################
# Run till first break point.
##############################################################
#go
###############################
# Go one step to get the variables in scope.
##############################################################
step
##############################################################
#
# Help Needed here for the following:
# ===================================
# 1. Read the values of C-pointer-variables 'inPtr' and 'outPtr'
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into tcl_inPtr and tcl_outPtr
# 2. Using the values of the pointer we have to fill in the
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test pattern from '$in_testvector($i)' to the memory
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; area pointed by '$tcl_inPtr'
# 3. Using the values of the pointer we have to read in the
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test results from&amp;nbsp; the memory area pointed by
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$tcl_outPtr' to 'out_testresults($i)'
#
# void *inPtr; void *outPtr;
# long in[100], out[100];
#
# main (void)
# {
#&amp;nbsp;&amp;nbsp;&amp;nbsp; inPtr = &amp;amp;in[0];
#&amp;nbsp;&amp;nbsp;&amp;nbsp; outPtr = &amp;amp;out[0];
#
#&amp;nbsp;&amp;nbsp;&amp;nbsp; /* break point Load the in variable with our test vector */
#
#&amp;nbsp;&amp;nbsp;&amp;nbsp; function_under_test();
#
#&amp;nbsp;&amp;nbsp;&amp;nbsp; /* break point Here will read the out variable */
#
# }
#
################################################################

###############################
# Read the Value of inPtr (C vairable)
# try to assign the test vector from in_testvector in to memory
# pointed by $tcl_inPtr
################################################################
# From Pg 65 of IDE 5.7 Windows® Automation Guide
# var [v:]&amp;lt;var&amp;gt; [-np] [-s|-ns] [%&amp;lt;conv&amp;gt;]
set tcl_inPtr&amp;nbsp; [var inPtr -np %x];&amp;nbsp; # &amp;lt;------- this line prints out the value of the inPtr and script breaks.
# From Pg 24 of IDE 5.7 Windows® Automation Guide
# change [&amp;lt;ms&amp;gt;:]&amp;lt;addr&amp;gt; [&amp;lt;count&amp;gt;][&amp;lt;width&amp;gt;] [-s|-ns] [%&amp;lt;conv&amp;gt;] &amp;lt;value&amp;gt;
for {set i 0 } {$i &amp;lt; 962} {incr i 1} { change $tcl_inPtr($i) 1 32 %x $in_testvector($i) }

###############################
# Read the Value of outPtr (C vairable)
##############################################################
set tcl_outPtr [var outPtr -np %x];


set t_outfile [open ./function_under_test_D3_D3_P3.ac w]
# Dump $out_testresults($i) to out file.
close $t_outfile&lt;/PRE&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by Ravi Kashi on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-03-10&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;06:58 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:05:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160478#M2670</guid>
      <dc:creator>RaviKashi</dc:creator>
      <dc:date>2020-10-29T09:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Code Warrior Test Automation using TCL. CW 3.2.1 for StarCore DSPs</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160479#M2671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size="2"&gt;# 1. Read the values of C-pointer-variables 'inPtr' and 'outPtr' into tcl_inPtr and tcl_outPtr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;This can be done using commands:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;set tcl_inPtr [evaluate ptrIn]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;set tcl_outPtr [evaluate outPtr]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;# 2. Using the values of the pointer we have to fill in the&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test pattern from '$in_testvector($i)' to the memory&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; area pointed by '$tcl_inPtr'&lt;BR /&gt;I would try the following here:&lt;/P&gt;&lt;P&gt;set offset [evaluate #x $tcl_inPtr+$i*4]&lt;/P&gt;&lt;P&gt;change m:$offset %x $in_testvector($i)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# 3. Using the values of the pointer we have to read in the&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test results from&amp;nbsp; the memory area pointed by&lt;BR /&gt;#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$tcl_outPtr' to 'out_testresults($i)'&lt;BR /&gt;I would try the following here:&lt;/P&gt;&lt;P&gt;set offset_out [evaluate #x $tcl_outPtr+$i*4]&lt;/P&gt;&lt;P&gt;display m:$offset_out %x&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2009 17:56:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160479#M2671</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2009-03-11T17:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: Code Warrior Test Automation using TCL. CW 3.2.1 for StarCore DSPs</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160480#M2672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello CrasyCat,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks for the help! We are now able to achieve what we wanted. I had also raised a Service request per our local support executive. I received similar suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May be I will try the forum first when I need support next time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Mar 2009 17:25:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Code-Warrior-Test-Automation-using-TCL-CW-3-2-1-for-StarCore/m-p/160480#M2672</guid>
      <dc:creator>RaviKashi</dc:creator>
      <dc:date>2009-03-16T17:25:37Z</dc:date>
    </item>
  </channel>
</rss>

