<?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/tag/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, 06 Sep 2010 07:00:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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 in [...]]]></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>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.
The [...]]]></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>
