<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>XJTAG Blog &#187; XJEase</title>
	<atom:link href="http://blog.xjtag.com/category/xjease/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xjtag.com</link>
	<description>XJTAG boundary scan solutions for the whole product lifecycle</description>
	<lastBuildDate>Mon, 09 Jan 2012 08:00:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Create your own links to Layout Viewer from XJEase</title>
		<link>http://blog.xjtag.com/2012/01/create-your-own-links-to-layout-viewer-from-xjease/</link>
		<comments>http://blog.xjtag.com/2012/01/create-your-own-links-to-layout-viewer-from-xjease/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 08:00:20 +0000</pubDate>
		<dc:creator>Matthew Burton</dc:creator>
				<category><![CDATA[XJDeveloper]]></category>
		<category><![CDATA[XJEase]]></category>
		<category><![CDATA[XJRunner]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Layout Viewer]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=851</guid>
		<description><![CDATA[From version 2.6.2 onwards XJEase supports the printing of device, pin and net links which launch and get highlighted in Layout Viewer from XJRunner and XJDeveloper (provided there is an ODB++ netlist available for the board). In XJDeveloper the links also have the ability to open in the Netlist Explorer. Example XJEase code: STRING pin [...]]]></description>
			<content:encoded><![CDATA[<p>From version 2.6.2 onwards XJEase supports the printing of device, pin and net links which launch and get highlighted in Layout Viewer from XJRunner and XJDeveloper (provided there is an ODB++ netlist available for the board). <span id="more-851"></span>In XJDeveloper the links also have the ability to open in the Netlist Explorer.</p>
<p>Example XJEase code:</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; font-family: 'Courier New', courier, monospace; background-color: #f4f4f4; text-align: left; border: silver 1px solid; padding: 4px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; line-height: 12pt; font-family: 'Courier New', courier, monospace; background-color: #f4f4f4; text-align: left; border-style: none; padding: 0px;">
<pre><tt><span style="color: #009900;">STRING</span> pin <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <span style="color: #ff0000;">"XJDemo.IC5.2"</span><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">PRINT_DEVICE_LINK</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"This is a link to XJDemo.IC5\n"</span><span style="color: #990000;">,</span> <span style="color: #ff0000;">"XJDemo.IC5"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"DATA[0]'s "</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span> <strong><span style="color: #0000ff;">PRINT_NET_LINK</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"net\n"</span><span style="color: #990000;">,</span> <strong><span style="color: #0000ff;">GET_NET_FROM_PIN</span></strong><span style="color: #990000;">(</span>DATA<span style="color: #990000;">[</span><span style="color: #993399;">0</span><span style="color: #990000;">]</span><span style="color: #990000;">)</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"IC5.2's "</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span> <strong><span style="color: #0000ff;">PRINT_PIN_LINK</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"pin\n"</span><span style="color: #990000;">,</span> pin<span style="color: #990000;">)</span><span style="color: #990000;">;</span></tt></pre>
</pre>
</div>
<p>Output:<br />
<span style="color: blue; text-decoration: underline;">This is a link to XJDemo.IC5</span><br />
DATA[0]&#8216;s <span style="color: blue; text-decoration: underline;">net</span><br />
IC5.2&#8242;s <span style="color: blue; text-decoration: underline;">pin</span></p>
<p>There are many variations to the functions shown above, and full documentation and examples can be found in the XJEase help file. The SRAM memory tests in the latest release of the XJEase Library also make full use of the links.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2012/01/create-your-own-links-to-layout-viewer-from-xjease/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Safe bitstream</title>
		<link>http://blog.xjtag.com/2011/07/the-safe-bitstream/</link>
		<comments>http://blog.xjtag.com/2011/07/the-safe-bitstream/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 07:00:57 +0000</pubDate>
		<dc:creator>Bob Storey</dc:creator>
				<category><![CDATA[XJEase]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=740</guid>
		<description><![CDATA[The Safe bitstream gets mentioned occasionally in our documentation and warning/error messages and this blog post attempts to shed some light on what it is and what it&#8217;s used for. What is the Safe bitstream? The Safe bitstream is the default binary data that is shifted into the JTAG devices. The aim of the safe [...]]]></description>
			<content:encoded><![CDATA[<p>The Safe bitstream gets mentioned occasionally in our documentation and warning/error messages and this blog post attempts to shed some light on what it is and what it&#8217;s used for.<span id="more-740"></span></p>
<h3>What is the Safe bitstream?</h3>
<p>The Safe bitstream is the default binary data that is shifted into the JTAG devices.  The aim of the safe bitstream is to disable as much of the board as possible. This means that in general, logic devices that have a chip enable pin will be disabled, and pins on the JTAG devices will be setup as input pins wherever possible.</p>
<h3>How is it generated?</h3>
<p>The Safe bitstream is generated automatically by XJEase, and derives first of all from the BSDL files in the project.  Part of the description of the boundary scan register includes the values needed to disable pins, and what the resulting disabled value will be, so the starting point for the Safe bitstream is one which disables all possible outputs. This starting point is then modified to take account of any constant pins or disable values where signals need to be driven in order to keep other parts of the circuit disabled. For example, the nOE pin on a RAM device would be set to be driven high (by the disable values in the device busses) to stop the data bus becoming active.</p>
<p>In addition to this, XJTAG&#8217;s safe bitstream will drive pins which need to be driven in order to prevent logic devices outputting, e.g the enable pin on a buffer chip.</p>
<h3>When is it used?</h3>
<p>The Safe bitstream is automatically applied on two occasions:</p>
<ol>
<li>Before the first test that accesses the boundary scan registers.</li>
<li>At both the beginning and end of the Connection Test.</li>
</ol>
<p>The user can also cause the Safe bitstream to be applied at any time during device testing by using the in-built <span style="color: #0000ff;">SAFE</span> statement.</p>
<address><strong>Note:</strong> If you have a standard setup where Checkchain is the  first function in your test list this would mean that the Safe bitstream would be applied after Checkchain and before the next function,  because the Checkchain function does not use the boundary scan  registers.</address>
<h3>Warnings and Errors</h3>
<p>The most common problem to see relating to the Safe bitstream is a Warning that two conflicting disable values have been set on the same net.  In this case XJEase will pick one of the two values.  The warning message states which value has been chosen.  As with all warnings the project can be run with the warning present but it is best practice to resolve these Safe bitstream conflicts so that the disable values for a net are uniform. It is not safe to rely on the same value always being chosen &#8211; updates to XJTAG or modifications to the project may cause it to change.</p>
<p>Calculating the Safe bitstream can also cause an error when you try to run the project (typically at the start, when the safe bitstream is calculated) and testing will stop at this point. The most common cause for the errors is a mistake when defining logic devices in the circuit, causing XJTAG to default the net to a value which is unreachable.  If this happens then the error message will list the pins involved in the error and the values they are being set to, so that you can track down the source of the error.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2011/07/the-safe-bitstream/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logic in XJTAG &#8211; capabilities and limitations</title>
		<link>http://blog.xjtag.com/2010/08/logic-in-xjtag-capabilities-and-limitations/</link>
		<comments>http://blog.xjtag.com/2010/08/logic-in-xjtag-capabilities-and-limitations/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 07:00:56 +0000</pubDate>
		<dc:creator>Bob Storey</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[XJDeveloper]]></category>
		<category><![CDATA[XJEase]]></category>
		<category><![CDATA[Connection Test]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=574</guid>
		<description><![CDATA[We see a lot of logic components used on boards that come through our office. Most often we see buffers, bus transceivers and devices of that nature, but also plenty of the usual discrete logic chips &#8211; simple gates, decoders, encoders etc. We decided a long time ago that XJTAG should support &#8220;simple&#8221; logic devices [...]]]></description>
			<content:encoded><![CDATA[<p>We see a lot of logic components used on boards that come through our office. Most often we see buffers, bus transceivers and devices of that nature, but also plenty of the usual discrete logic chips &#8211; simple gates, decoders, encoders etc.<span id="more-574"></span></p>
<p>We decided a long time ago that XJTAG should support &#8220;simple&#8221; logic devices in such a way that the logic is handled transparently when it comes to XJEase code, thus allowing the Test Device code to remain device-centric. We also decided that the built-in connection test had to support logic devices to the same extent. The work was on-going behind the scenes here at XJTAG for some time, and is a major part of the version 2.4 release.</p>
<p>So, in previous versions of XJEase if you had a memory chip with a data bus which was accessed through a buffer, you had to modify the chip&#8217;s device file so that the data bus pins were actually the buffer inputs rather than the chip&#8217;s own data pins. This will still work&#8230; but it&#8217;s no longer necessary &#8211; XJTAG will now realise (for example) that if you want to write to a particular pin on that data bus then it means setting the appropriate buffer direction, enable and input pins, and that if you later want to read the pin, XJTAG will stop driving the buffer, change the buffer&#8217;s direction and then read the value through from the memory.</p>
<h2>Limitations</h2>
<h3>No Logic with State</h3>
<p>XJTAG  version 2.4 does not support logic with state.  This does not only apply to individual gates &#8211; we also do not support the situation where blocks are combined to store state, for example constructing a flip-flop from NAND gates. XJTAG will attempt to spot such situations and object to them&#8230; but if you manage to be more cunning than our compile-time state detection algorithms it still won&#8217;t work correctly at runtime!</p>
<h3>Wind-up of logic blocks</h3>
<p>When you make <span style="color: #0000ff;">SET </span>statements in XJEase you are asking XJTAG to put the circuit in a state and leave it that way until told to do otherwise.  And with logic that gets complicated. For example, imagine a logic device with 2 outputs and a truth table set up such that they can&#8217;t both output a 1 (ie valid output states are 00, 01, 10 only). The user makes a <span style="color: #0000ff;">SET</span> statement that sets the first one high. Fine so far. But then later the user <span style="color: #0000ff;">SET</span>s the 2nd one high. Now we have a dilemma. Should we refuse? Or should we set the first one back low in order to comply with the 2nd request? The problem would be worse if there were 3 outputs and any two could be high &#8211; which one should we set back low in order to set the 3rd one high?</p>
<p>Because we can&#8217;t know what the user actually wants, we will stop and show an error if this situation arises. In general that&#8217;s easy for you to get around because having <span style="color: #0000ff;">SET </span>a value on a pin, you can always <span style="color: #0000ff;">SET </span>a different value on it &#8211; so you can <span style="color: #0000ff;">SET </span>the first pin back low once you&#8217;re done with it (or as you <span style="color: #0000ff;">SET </span>the 2nd one high)</p>
<p>If the situation gets far too complicated for you to work out what is causing the conflict, which may mean the <span style="color: #0000ff;">SET</span> causing the problem was made in some other test a long way from where you are, then we do have a (slightly drastic) get-out, which is to make a  <span style="color: #0000ff;">SAFE</span><span style="color: #0000ff;">;</span> statement in your code. This resets all pins (and logic blocks) in the circuit to their default state.</p>
<p>We hope that the new logic features in XJTAG are useful to you &#8211; please give us feedback if you feel you have a situation that we should support and don&#8217;t, or if you have further suggestions as to how we can improve the products.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2010/08/logic-in-xjtag-capabilities-and-limitations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using XJEase functions in XJRunner tests</title>
		<link>http://blog.xjtag.com/2009/12/using-xjease-functions-in-xjrunner-tests/</link>
		<comments>http://blog.xjtag.com/2009/12/using-xjease-functions-in-xjrunner-tests/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 08:00:32 +0000</pubDate>
		<dc:creator>John Barton</dc:creator>
				<category><![CDATA[XJDeveloper]]></category>
		<category><![CDATA[XJEase]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=476</guid>
		<description><![CDATA[A frequent question from customers is, “Why is my new XJEase test function not listed when I create an XJRunner test?” XJEase Functions For a function to be eligible to be made available to XJRunner it must be in the main project (.xje) file or a device file, or in a code file specified either [...]]]></description>
			<content:encoded><![CDATA[<p>A frequent question from customers is, “Why is my new XJEase test function not listed when I create an XJRunner test?”</p>
<h4>XJEase Functions</h4>
<p>For a function to be eligible to be made available to XJRunner it must be in the main project (.xje) file or a device file, or in a code file specified either in the main project (in the Circuit Code Files Screen) or from within a test device file (in the Test Device Files Screen<a href="testdevicefilesscreen.html">)</a>.<br />
<span id="more-476"></span><br />
Not all functions can be used by XJRunner. In order for an XJEase function to be available it must take no input variables and must return a single integer to indicate pass (value 0) or fail (value 1 or any non-zero value).</p>
<p>i.e. it must be in the format:</p>
<div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; height: 52px; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 34.09%; font-family: 'Courier New',courier,monospace; direction: ltr; height: 18px; color: black; font-size: 8pt;">
<pre><tt>FunctionName <span style="color: #990000;">(</span><span style="color: #990000;">)</span> <span style="color: #990000;">(</span><span style="color: #009900;">INT</span> result<span style="color: #990000;">)</span></tt></pre>
</pre>
</div>
<h4>CONNTEST</h4>
<p>There is always one preset item in the available tests &#8211; this is the global function <span style="color: #0000ff;">CONNTEST.</span><span style="color: #000000;"> This runs the automatic connection test.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2009/12/using-xjease-functions-in-xjrunner-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating XJTAG with other Test Systems &#8211; System calls from XJEase</title>
		<link>http://blog.xjtag.com/2009/11/integrating-xjtag-with-other-test-systems-system-calls-from-xjease/</link>
		<comments>http://blog.xjtag.com/2009/11/integrating-xjtag-with-other-test-systems-system-calls-from-xjease/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 08:00:38 +0000</pubDate>
		<dc:creator>John Barton</dc:creator>
				<category><![CDATA[XJEase]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=464</guid>
		<description><![CDATA[This series of posts covers how you can integrate XJTAG into your overall test system. This entry focuses on executing programs from within XJEase. The XJEase keyword SYSTEM is used to execute a system command or program. It accepts the command in the form of a string and returns the exit code from the program. [...]]]></description>
			<content:encoded><![CDATA[<p>This series of posts covers how you can integrate XJTAG into your overall test system. This entry focuses on executing programs from within XJEase.</p>
<p>The XJEase keyword <span style="color: #0000ff;">SYSTEM</span> is used to execute a system command or program.<span id="more-464"></span> It accepts the command in the form of a string and returns the exit code from the program. This is a 32 bit unsigned value in Windows. It can be used execute any program which contains additional tests and then check for success or failure by examining the return code.</p>
<p>All commands are executed using the Windows Command Processor, cmd.exe. If the Command Processor is unable to start the specified command line for any reason it returns an exit code of 1.</p>
<h4>Syntax</h4>
<div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;">
<pre><tt><strong><span style="color: #0000ff;">SYSTEM</span></strong><span style="color: #990000;">(</span> <span style="color: #009900;">STRING</span> command <span style="color: #990000;">)</span> <span style="color: #990000;">(</span> INTEGER result <span style="color: #990000;">)</span><span style="color: #990000;">;</span></tt></pre>
</pre>
</div>
<h4>Example</h4>
<p>An example of using this is to perhaps run an external program that measures a frequency. In the example below the &#8220;MeasureFrequency&#8221; program is assumed to return 0 as its exit code if the frequency is between the two values passed in or non-zero if it falls outside.</p>
<div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;">
<pre><tt><span style="color: #009900;">INT</span> result<span style="color: #990000;">;</span>

<strong><span style="color: #0000ff;">SET</span></strong> TXEN <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <span style="color: #993399;">1</span><span style="color: #990000;">;</span>  <em><span style="color: #9a1900;">//</span></em><em><span style="color: #9a1900;"> Enable transmitter</span></em>

<strong><span style="color: #000000;">SYSTEM("MeasureFrequency.exe 900000 1100000")(result)</span></strong><span style="color: #990000;">;</span>

<strong><span style="color: #0000ff;">SET</span></strong> TXEN <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <span style="color: #993399;">0</span><span style="color: #990000;">;</span>  <em><span style="color: #9a1900;">//</span></em><em><span style="color: #9a1900;"> Disable transmitter</span></em>

<strong><span style="color: #0000ff;">IF</span></strong> result <span style="color: #990000;">&gt;</span> <span style="color: #993399;">0</span> <strong><span style="color: #0000ff;">THEN</span></strong>
    <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"Incorrect frequency detected\n"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
    <strong><span style="color: #0000ff;">EXIT</span></strong><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">END</span></strong></tt></pre>
</pre>
</div>
<p>By using <span style="color: #0000ff;">SYSTEM</span> calls you can therefore run other tests from within XJEase, which can help to integrate all your tests together.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2009/11/integrating-xjtag-with-other-test-systems-system-calls-from-xjease/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Collecting user input from XJEase</title>
		<link>http://blog.xjtag.com/2009/10/collecting-user-input-from-xjease/</link>
		<comments>http://blog.xjtag.com/2009/10/collecting-user-input-from-xjease/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 12:22:06 +0000</pubDate>
		<dc:creator>John Hall</dc:creator>
				<category><![CDATA[XJEase]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=361</guid>
		<description><![CDATA[A customer recently asked how to read some input from the user in XJEase. The next major release of XJTAG (probably numbered 2.4) will contain a new XJEase function INPUTBOX that makes doing this much simpler. In the meantime, I thought I might outline some code that accomplishes the same thing in the current version. [...]]]></description>
			<content:encoded><![CDATA[<p>A customer recently asked how to read some input from the user in XJEase. The next major release of XJTAG (probably numbered 2.4) will contain a new XJEase function <span style="color: #0000ff">INPUTBOX</span> that makes doing this much simpler. In the meantime, I thought I might outline some code that accomplishes the same thing in the current version.</p>
<p><span id="more-361"></span>The core of the code is a loop that simply calls the <span style="color: #0000ff">WAITKEY </span>function to read a character of input at a time, until a carriage return is read. As each character is read it is appended to a string that will be returned and also printed to the screen.</p>
<div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;">
<pre><tt><span style="color: #009900">STRING</span> text<span style="color: #990000">;</span>
<span style="color: #009900">INT</span> key<span style="color: #990000">;</span>
<strong><span style="color: #0000ff">DO</span></strong>
    key <span style="color: #990000">:</span><span style="color: #990000">=</span> <strong><span style="color: #0000ff">WAITKEY</span></strong><span style="color: #990000">(</span><span style="color: #990000">)</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">WHILE</span></strong> key <span style="color: #990000">:</span><span style="color: #990000">=</span> <strong><span style="color: #0000ff">ASC</span></strong><span style="color: #990000">(</span><span style="color: #ff0000">"\n"</span><span style="color: #990000">)</span> <span style="color: #990000">&amp;</span><span style="color: #990000">&amp;</span> key <span style="color: #990000">!</span><span style="color: #990000">=</span> <strong><span style="color: #0000ff">ASC</span></strong><span style="color: #990000">(</span><span style="color: #ff0000">"\r"</span><span style="color: #990000">)</span><span style="color: #990000">;</span>
    <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900"> ignore any control characters (ASCII value less than 0x20)</span></em>
    <strong><span style="color: #0000ff">IF</span></strong> key <span style="color: #990000">&gt;</span><span style="color: #990000">=</span> <span style="color: #993399">0x20</span> <strong><span style="color: #0000ff">THEN</span></strong>
        <strong><span style="color: #0000ff">PRINT</span></strong><span style="color: #990000">(</span><strong><span style="color: #0000ff">CHAR</span></strong><span style="color: #990000">(</span>key<span style="color: #990000">)</span><span style="color: #990000">)</span><span style="color: #990000">;</span>
        text <span style="color: #990000">:</span><span style="color: #990000">=</span> text <span style="color: #990000">+</span> <strong><span style="color: #0000ff">CHAR</span></strong><span style="color: #990000">(</span>key<span style="color: #990000">)</span><span style="color: #990000">;</span>
    <strong><span style="color: #0000ff">END</span></strong><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">END</span></strong><span style="color: #990000">;</span></tt></pre>
</pre>
</div>
<p>This works reasonably well until the user makes a mistake and wants to backspace. Handling backspace requires us to print the backspace character and remove the last character from the string that we&#8217;re building. We can also check the current length of the input string and not allow the user to backspace beyond its start.</p>
<div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;">
<pre><tt><strong><span style="color: #000000;">INPUTBOX(STRING prompt, STRING title, STRING default)(STRING input)</span></strong>
    <span style="color: #009900;">STRING</span> text <span style="color: #990000;">:</span><span style="color: #990000;">=</span> default<span style="color: #990000;">;</span>
    <span style="color: #009900;">INT</span> key<span style="color: #990000;">;</span>
    <span style="color: #009900;">INT</span> width<span style="color: #990000;">;</span>

    <strong><span style="color: #0000ff;">ALERT</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>

    <strong><span style="color: #0000ff;">IF</span></strong> title <span style="color: #990000;">!</span><span style="color: #990000;">=</span> <span style="color: #ff0000;">""</span> <strong><span style="color: #0000ff;">THEN</span></strong>
        <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span>title<span style="color: #990000;">,</span> <span style="color: #ff0000;">"\n"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
    <strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span>
    <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span>prompt<span style="color: #990000;">)</span><span style="color: #990000;">;</span>

    <strong><span style="color: #0000ff;">DO</span></strong>
        key <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <strong><span style="color: #0000ff;">WAITKEY</span></strong><span style="color: #990000;">(</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
    <strong><span style="color: #0000ff;">WHILE</span></strong> key <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <strong><span style="color: #0000ff;">ASC</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"\n"</span><span style="color: #990000;">)</span> <span style="color: #990000;">&amp;</span><span style="color: #990000;">&amp;</span> key <span style="color: #990000;">!</span><span style="color: #990000;">=</span> <strong><span style="color: #0000ff;">ASC</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"\r"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
        <strong><span style="color: #0000ff;">IF</span></strong> key <span style="color: #990000;">=</span> <strong><span style="color: #0000ff;">ASC</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"\b"</span><span style="color: #990000;">)</span> <strong><span style="color: #0000ff;">THEN</span></strong>
            width <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <strong><span style="color: #0000ff;">WIDTHOF</span></strong><span style="color: #990000;">(</span>text<span style="color: #990000;">)</span><span style="color: #990000;">;</span>
            <strong><span style="color: #0000ff;">IF</span></strong> width <span style="color: #990000;">&gt;</span> <span style="color: #993399;">0</span> <strong><span style="color: #0000ff;">THEN</span></strong>
                <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"\b"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
                <strong><span style="color: #0000ff;">IF</span></strong> width <span style="color: #990000;">=</span> <span style="color: #993399;">1</span> <strong><span style="color: #0000ff;">THEN</span></strong>
                    text <span style="color: #990000;">:</span><span style="color: #990000;">=</span> <span style="color: #ff0000;">""</span><span style="color: #990000;">;</span>
                <strong><span style="color: #0000ff;">ELSE</span></strong>
                    text <span style="color: #990000;">:</span><span style="color: #990000;">=</span> text<span style="color: #990000;">[</span>width<span style="color: #990000;">-</span><span style="color: #993399;">2</span><span style="color: #990000;">.</span><span style="color: #990000;">.</span><span style="color: #993399;">0</span><span style="color: #990000;">]</span><span style="color: #990000;">;</span>
                <strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span>
            <strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span>
        <strong><span style="color: #0000ff;">ELSIF</span></strong> key <span style="color: #990000;">&gt;</span><span style="color: #990000;">=</span> <span style="color: #993399;">0x20</span> <strong><span style="color: #0000ff;">THEN</span></strong>
            <em><span style="color: #9a1900;">//</span></em><em><span style="color: #9a1900;"> ignore any control characters (ASCII value less than 0x20)</span></em>
            <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><strong><span style="color: #0000ff;">CHAR</span></strong><span style="color: #990000;">(</span>key<span style="color: #990000;">)</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
            text <span style="color: #990000;">:</span><span style="color: #990000;">=</span> text <span style="color: #990000;">+</span> <strong><span style="color: #0000ff;">CHAR</span></strong><span style="color: #990000;">(</span>key<span style="color: #990000;">)</span><span style="color: #990000;">;</span>
        <strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span>
    <strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span>

    <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"\n"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
    input <span style="color: #990000;">:</span><span style="color: #990000;">=</span> text<span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span>

<strong><span style="color: #000000;">GetInput()()</span></strong>
    <span style="color: #009900;">STRING</span> input<span style="color: #990000;">;</span>
    input <span style="color: #990000;">:</span><span style="color: #990000;">=</span> INPUTBOX<span style="color: #990000;">(</span><span style="color: #ff0000;">"Please enter some input and press Enter:"</span><span style="color: #990000;">,</span> <span style="color: #ff0000;">"Input"</span><span style="color: #990000;">,</span> <span style="color: #ff0000;">""</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
    <strong><span style="color: #0000ff;">PRINT</span></strong><span style="color: #990000;">(</span><span style="color: #ff0000;">"\nGot \""</span><span style="color: #990000;">,</span> input<span style="color: #990000;">,</span> <span style="color: #ff0000;">"\"\n"</span><span style="color: #990000;">)</span><span style="color: #990000;">;</span>
<strong><span style="color: #0000ff;">END</span></strong><span style="color: #990000;">;</span></tt></pre>
</pre>
</div>
<p>The full function appears below, plus an example of its use. It is named INPUTBOX and has the same signature as the upcoming XJEase built-in function, which means once the new version of XJTAG arrives, this function can be deleted and the code will then continue to work. The 3 arguments are the prompt to display, a title and a string that is presented as the default (can be left as an empty string). Note that the example below simply prints the title out, whereas the real INPUTBOX will create a proper dialog box.Note also the use of the <span style="color: #0000ff">ALERT </span>function. If you have more than one XJLink attached in XJRunner, then the output from each is displayed in its own tab; the <span style="color: #0000ff">ALERT </span>function causes the application to draw attention to any tab that requires attention. In XJDeveloper or in XJRunner with just one XJLink attached, then the function has no effect.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2009/10/collecting-user-input-from-xjease/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XJEase: The SET Statement</title>
		<link>http://blog.xjtag.com/2009/09/xjease-the-set-statement/</link>
		<comments>http://blog.xjtag.com/2009/09/xjease-the-set-statement/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 07:00:21 +0000</pubDate>
		<dc:creator>Dominic Plunkett</dc:creator>
				<category><![CDATA[XJEase]]></category>

		<guid isPermaLink="false">http://blog.xjtag.com/?p=239</guid>
		<description><![CDATA[In XJEASE the SET statement is the command to access pins via a JTAG device. XJEase works out via the BSDL files and netlist how to access a pin on a non JTAG device from a JTAG device. The SET statement can perform both reading and writing of the pins. So: SET nCE := 1; [...]]]></description>
			<content:encoded><![CDATA[<p>In XJEASE the <tt><strong><span style="color: #0000ff">SET</span></strong></tt> statement is the command to access pins via a JTAG device. XJEase works out via the BSDL files and netlist how to access a pin on a non JTAG device from a JTAG device.</p>
<p><span id="more-239"></span>
<p>The SET statement can perform both reading and writing of the pins. So:</p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> nCE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">;</span>          <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">set the nCE pin to a logic 1</span></em>
<strong><span style="color: #0000ff">SET</span></strong> DATA <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0xAA</span><span style="color: #990000">;</span>      <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">set the data bus ( DATA ) to the HEX value 0xAA</span></em>
<strong><span style="color: #0000ff">SET</span></strong> readvalue <span style="color: #990000">:</span><span style="color: #990000">=</span> DATA<span style="color: #990000">;</span> <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">read the current value on the DATA bus into readvalue</span></em></tt></pre>
</pre>
</div>
<p>
  <br />Any signals which aren&#8217;t changed on a SET statement remain in the same state. All <tt><strong><span style="color: #0000ff">SET</span></strong></tt> statements take one JTAG scan except if you are changing the direction of a bus from writing to reading:</p>
<p></p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> DATA <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0xAA</span><span style="color: #990000">;</span>      <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">write takes one JTAG scan </span></em>
<strong><span style="color: #0000ff">SET</span></strong> readValue <span style="color: #990000">:</span><span style="color: #990000">=</span> DATA<span style="color: #990000">;</span> <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">read statement after write takes 2 scans </span></em></tt></pre>
</pre>
</div>
<p>
  <br />You can set a bus to be tristate by doing the following:</p>
<p></p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> DATA <span style="color: #990000">:</span><span style="color: #990000">=</span> <strong><span style="color: #0000ff">I</span></strong><span style="color: #990000">;</span> <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900"> sets the data bus into read mode</span></em></tt></pre>
</pre>
</div>
<p>
  </p>
<p>
  </p>
<h2>Optimisations</h2>
<p>Once a pin is in a state, setting it again is optimised away. So the following code only takes one JTAG scan:</p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span><span style="color: #993399">0</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span><span style="color: #993399">0</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span><span style="color: #993399">0</span><span style="color: #990000">;</span></em></tt></pre>
</pre>
</div>
<p>
  <br />You can combine accesses so that they all happen on the same JTAG scan by using a comma:</p>
<p></p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">,</span> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">,</span> DATA <span style="color: #990000">:</span><span style="color: #990000">=</span><strong><span style="color: #0000ff">I</span></strong> <span style="color: #990000">;        </span><em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900"> All happen on the same JTAG scan</span></em>
<strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">,</span> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">,</span> readvalue <span style="color: #990000">:</span><span style="color: #990000">=</span> DATA<span style="color: #990000">;</span><em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900"> All happen on the same JTAG scan</em></tt></pre>
</pre>
</div>
<p>
  </p>
<p>In the example above all the access happen on the same JTAG scan. There is however a difference in timing between the reading and writing. “readvalue <span style="color: #990000">:</span><span style="color: #990000">=</span> DATA<span style="color: #990000">;”</span> happens first during the &quot;Capture&quot; State in the JTAG state machine. The actual outputting of nCS happens later. This delay is the delay of scanning the JTAG chain and moving the JTAG state machine to the &quot;Update&quot; state. This on a device with 300 bits in the scan chain and running at 10MHz will be about 30μs.</p>
<p>
  </p>
<p>
  </p>
<h2>The Write-to-Write time</h2>
<p>Providing the JTAG chain speed isn&#8217;t restricted due to lack of data then the write-to-write time is just over 30μs (it is a slightly longer path through the JTAG state machine):</p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">; </span><em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">t =0 </span></em>
<strong><span style="color: #0000ff">SET</span></strong> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">; </span><em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900">t = 31us </span></em></tt></pre>
</pre>
</div>
<p>
  </p>
<p>
  </p>
<h2>The Write-to-Read time</h2>
<p>The time between writing to one pin and reading another on the following scan is much faster as the time between the &quot;Update&quot; (write) and the &quot;Capture&quot; (Read) is only a few JTAG cycles around the state machine (about 0.3μs in our example). But as explained earlier &#8211; if the pin/bus being read is the one which was just written it will take a further complete scan to read the data.</p>
<p>So for SRAM based devices you could have the following read cycle:</p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> nWE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">;</span> <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900"> not always needed</span></em>
<strong><span style="color: #0000ff">SET</span></strong> DATA <span style="color: #990000">:</span><span style="color: #990000">=</span> <strong><span style="color: #0000ff">I</span></strong><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> ADDRESS <span style="color: #990000">:</span><span style="color: #990000">=</span> Address_To_Read_From<span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> Readvalue <span style="color: #990000">:</span><span style="color: #990000">=</span> DATA<span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> nWE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">;</span>  <em><span style="color: #9a1900">//</span></em><em><span style="color: #9a1900"> not always needed</span></em></tt></pre>
</pre>
</div>
<p>
  <br />The above takes a large number of JTAG scans. You can make it much quicker by combining SET statements:</p>
<p></p>
<div style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4; text-align: left">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none">
<pre><tt><strong><span style="color: #0000ff">SET</span></strong> nWE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> DATA <span style="color: #990000">:</span><span style="color: #990000">=</span> <strong><span style="color: #0000ff">I</span></strong><span style="color: #990000">,</span> ADDRESS <span style="color: #990000">:</span><span style="color: #990000">=</span> Address_To_Read_From<span style="color: #990000">,</span> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">,</span> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span>
<strong><span style="color: #0000ff">SET</span></strong> Readvalue <span style="color: #990000">:</span><span style="color: #990000">=</span> DATA<span style="color: #990000">,</span> nOE <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span> <span style="color: #990000">,</span> nCS <span style="color: #990000">:</span><span style="color: #990000">=</span> <span style="color: #993399">1</span><span style="color: #990000">,</span> nWE <span style="color: #990000">:</span><span style="color: #990000">=</span><span style="color: #993399">1</span><span style="color: #990000">;</span> </tt></pre>
</pre>
</div>
<p>
  <br />If you can be sure nWE is logic 1 before starting then the first <tt><strong><span style="color: #0000ff">SET</span></strong></tt> can be removed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xjtag.com/2009/09/xjease-the-set-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

