<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2065005632409402161</id><updated>2024-09-01T20:22:34.173-07:00</updated><category term="AMBA"/><category term="DESIGN"/><category term="VERILOG"/><category term="AHB"/><category term="AIRTHMATICS"/><category term="AWK"/><category term="C"/><category term="CODE COVERAGE"/><category term="DOCUMENTATION"/><category term="FIFO"/><category term="FUNCTIONAL COVERAGE"/><category term="Introduction"/><category term="LINTING"/><category term="PERL"/><category term="SystemVerilog"/><category term="UNIX"/><category term="VHDL"/><title type='text'>Chip Guru</title><subtitle type='html'>Please visit chipguru.in</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chipguru.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-3157928058759854009</id><published>2013-03-12T09:44:00.002-07:00</published><updated>2013-03-12T09:44:30.365-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AHB"/><title type='text'>AHB </title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Must a read after a write to the same
address return the newly written data?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Scenario&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When there is an AHB write followed by
a read from the same address, should the read return the old or the new data
when the read address phase is in same cycle of the write data phase?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The answer to this question is
dependent on the design of the slave.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A simple slave will not be buffering
any data, so the returned read data will be the latest. A more complex slave
could implement buffering for write data (if allowed by HPROT[2]) and so it
could &quot;snoop&quot; the write buffer contents before returning read data,
or it might just return the previously stored data regardless of what might be
buffered.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;In conclusion, all the AHB
specification requires is that data is returned.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What system support is required if a
slave can be powered down or have its clock stopped?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;If a slave access is attempted while
that slave is in a power down state or has had its clock stopped, you must
ensure that an access will cause the power/clock to be restored, or else
configure the AHB decoder up to redirect any such accesses to the dummy slave
so that the system does not hang forever when an access to the device is made
when it is disabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Redirecting the access in this way will
ensure that random &quot;IDLE&quot; addresses are treated with the HREADY high
and HRESP=OKAY default response, but real accesses (NONSEQ or SEQ) will be
detected with an ERROR response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When can Early Burst Termination occur
?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Bursts can be early terminated either
as a result of the Arbiter removing the HGRANT to a master part way through a
burst, or after a slave returns a non-OKAY response to any beat of a burst.
Note however that a master cannot decide to terminate a defined length burst
unless prompted to do so by the Arbiter or Slave responses.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;All AHB Masters, Slaves and Arbiters
must be designed to support Early Burst Termination.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can HTRANS change whilst HREADY is low?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;In general, an AHB master should not
change control signals whilst HREADY is low. However it is allowable to change
HTRANS in the following conditions:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;HTRANS=IDLE&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
     The AHB master is performing internal operations and has not yet committed
     to a bus transfer. However during the AHB wait states (HREADY low) the
     master may determine that a bus transfer is required and change HTRANS on
     the next cycle to NONSEQ.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;HTRANS=BUSY&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
     HTRANS is being used to give the master time to complete internal
     operations, which may be entirely independent of HREADY (i.e. wait states
     on the AHB). Therefore HTRANS can change on the next cycle to any legal
     value, i.e. SEQ if the burst is to continue, IDLE if the burst has
     completed, NONSEQ if a separate burst is to begin.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;HRESP=SPLIT/RETRY&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
     As stated in the AHB specification, a master must assert IDLE on
     HTRANS&amp;nbsp; during the second cycle of the two-cycle SPLIT or RETRY slave
     response so HTRANS will change value from the first cycle to the second
     cycle of the response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;HRESP=ERROR&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;&lt;br /&gt;
     The master is permitted to change HTRANS in reaction to an ERROR response
     in the same way as in reaction to a SPLIT/RETRY response and cancel any
     further beats in the current burst (even if HBURST is indicating a
     defined-length burst). In this case HTRANS changes to IDLE on the second
     cycle of the response. Alternatively, the master is permitted to continue
     with the current transfers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a BUSY transfer occur at the end of
a burst?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A BUSY transfer can only occur at the
end of an undefined length burst (INCR). A BUSY transfer cannot occur at the
end of a fixed length burst (SINGLE, INCR4, WRAP4, INCR8, WRAP8, INCR16,
WRAP16).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a master change the address/control
signals during a waited transfer?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. If the address/control signals are
indicating an IDLE transfer then the master can change to a real transfer
(NONSEQ) when HREADY is low.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;However, if a master is indicating a
real transfer (NONSEQ or SEQ) then it cannot cancel this during a waited
transfer unless it receives a SPLIT, RETRY or ERROR response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can an AHB master be connected directly
to an AHB slave?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Any slave which does not use SPLIT
responses can be connected directly to an AHB master. If the slave does use
SPLIT responses then a simplified version of the arbiter is also required.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;If an AHB master is connected directly
to an AHB slave it is important to ensure that the slave drives HREADY high
during reset and that the select signal HSEL for the slave is tied permanently
high.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Do all slaves have to support the BUSY
transfer type?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. All slaves must support the BUSY
transfer type to ensure they are compatible with any bus master.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Does the address have to be aligned,
even for IDLE transfers?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. The address should be aligned
according to the transfer size (HSIZE) even for IDLE transfers. This will
prevent spurious warnings from bus monitors used during simulation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;How many masters can there be in an AHB
system?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The AHB specification caters for up to
16 masters. However, allowing for a dummy bus master means the maximum number
of real bus masters is actually 15. By convention bus master number 0 is
allocated to the dummy bus master.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Is HREADY an input or an output from
slaves?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;An AHB slave must have the HREADY
signal as both an input and an output.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;HREADY is required as an output from a
slave so that the slave can extend the data phase of a transfer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;HREADY is also required as an input so
that the slave can determine when the previously selected slave has completed
its final transfer and the first data phase transfer for this slave is about to
commence.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Each AHB Slave should have an HREADY
output signal (conventionally named HREADYOUT) which is connected to the
Slave-to-Master Multiplexer. The output of this multiplexer is the global
HREADY signal which is routed to all masters on the AHB and is also fed back to
all slaves as the HREADY input.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Is a default slave really necessary?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;If the entire 4 gigabyte address space
is defined then a default slave is not required. If, however, there are
undefined areas in the memory map then it is important to ensure that a
spurious access to a non-existent address location will not lock up the system.
The functionality of the default slave is extremely simple and it will often
make sense to implement this within the decoder.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Is a dummy master really necessary?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A dummy master is necessary in any
system which has a slave that can give SPLIT transfer responses. The dummy
master is required so that something can be granted the bus if all the other
masters have received a SPLIT response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;No logic is required for the dummy
master and it can be implemented by simply tying off the inputs to the master
address/control multiplexer for the dummy master position. The requirements for
a dummy master are that HTRANS is driven to IDLE, HLOCK is driven low, and all
other master outputs are driven to legal values.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Is it legal for a master to change
HADDR when a transfer is extended?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;If a master is indicating that it wants
to do a NONSEQ, SEQ or BUSY transfer then it cannot change the address during
an extended transfer (when HREADY is low) unless it receives an ERROR, RETRY or
SPLIT response. If the master is indicating that it wants to do an IDLE
transfer then it may change the address.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Is it specified that HPROT, HSIZE and
HWRITE remain constant throughout a burst?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes, the control signals must remain
constant throughout the duration of a burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The specification recommends that only
16 wait states are used. What should you do if more than 16 cycles are needed?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;For some slaves it is acceptable to
insert more than 16 wait states. For example, a serial boot ROM which is only
ever accessed at initial power up could insert a larger number of wait states
and it would not affect the calculation of the system performance and latency
once system power up has been completed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;For other slaves a number of options
exist. A SPLIT or RETRY response could be used to indicate that the slave is
not yet able to perform the requested data transfer, or the slave could be
accessed either in response to interrupts or after polling a status register,
in either case indicating that the slave is now able to respond in an
acceptable number of cycles.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What are the different bursts used for?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Typically a master would use wrapping
bursts for cache line fills where the master wants to access the data it
requires first and then it completes the burst to fetch the remaining data it
requires for the cache line fill. Incrementing bursts are used by masters, such
as DMA controllers, that are filling a buffer in memory which may not be
aligned to a particular address boundary.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What default state should be used for
the HREADY and HRESP outputs from a slave?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;It is recommended that the default
value for HREADY is high and the default value for HRESP is OKAY. This
combination ensures that the slave will respond correctly to IDLE transfers to
the slave, even if the slave is in some form of power saving mode.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What is the difference between a dummy
bus master and a default bus master?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;br /&gt;
Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The term default bus master is used to
describe the master that is granted when none of the masters in the system are
requesting access to the bus. Usually the bus master which is most likely to
request the bus is made the default master.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The dummy bus master is a master which
only performs IDLE transfers. It is required in a system so the arbiter can
grant a master which is guaranteed not to perform any real transfers. The two
cases when the arbiter would need to do this are when a SPLIT response is given
to a locked transfer and when a SPLIT response is given and all other masters
have already been SPLIT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What is the recommended default value
for HPROT?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Many bus masters will not be able to
generate accurate protection information and for these bus masters it is
recommended that the HPROT encoding shows, Non-cacheable, Non-bufferable,
Privileged, Data Accesses which corresponds to HPROT[3:0] = 4&#39;b0011.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What is the state of the AHB signals
during reset?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The specification states that during
reset the bus signals should be at valid levels. This simply means that the
signals should be logic &#39;0&#39; or &#39;1&#39;, but not Hi-Z. The actual logic levels
driven are left up to the designer. HTRANS is the only signal specified during
reset, with a mandatory value of IDLE.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;It is important that HREADY is high
during reset. If all slaves in the system drive HREADY high during reset then
this will ensure that this is the case. However, if slaves are used which do
not drive HREADY high during reset it should be ensured that a slave which does
drive HREADY high is selected at reset.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What sequences of transfers types
(HTRANS) can occur on the bus?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The following examples show some of the
sequences of HTRANS that can occur on the bus:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A large burst of four transfers
followed by an IDLE.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - S - S - S - I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A large burst of four transfers which
includes BUSY transfers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - S - B - S - B - S - I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A burst of four transfers followed by
another burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - S - S - S - N - S - S - S - I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A single transfer followed by a burst
of four transfers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - N - S - S - S - I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A single transfer followed by an IDLE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;An undefined length burst which
concludes with a BUSY transfer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - B - S - B - S - B - I&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;An undefined length burst which
concludes with a BUSY transfer and is followed immediately by another burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;N - B - S - B - S - B - N – S&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When a master rebuilds a burst which
has been terminated early are there any limitations on how it rebuilds the
burst?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The only limitation is that the master
uses legal burst combinations to rebuild the burst. For example, if a master
was performing an 8 beat burst, but had only completed 3 transfers before
losing control of the bus, then the remaining 5 transfers could be performed
either by using a 1 beat SINGLE burst followed by a 4 beat INCR4 burst, or it
could be performed using a 5 beat undefined length INCR burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;For simplicity it is recommended that
masters use INCR bursts to rebuild the remaining transfers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;How does the AHB handle LOCKed SPLITs?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When a transfer is SPLIT the arbiter
degrants and removes the SPLIT master out of the arbitration until the slave
indicates that the transfer can complete. When an access is LOCKed the access
cannot be interrupted by an access from another master.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The only possible way that an AHB
system can handle these two requirements simultaneously is to grant a
&quot;dummy master&quot; when the LOCKed access is SPLIT. The dummy master will
only perform IDLE transactions, which are allowable during a locked transfer.
To grant any other master would violate the LOCK protocol, for the arbiter to
ignore the SPLIT would violate the SPLIT protocol - the dummy master is the
only option.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The dummy master is also used when all
masters are have received a SPLIT response (the dummy master cannot receive a
SPLIT response).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;It is recommended that the designer of
the split-capable slave(s) makes sure that the slave monitors its HMASTLOCK
input so that it doesn&#39;t return a SPLIT on a LOCKed transfer, as this serves no
purpose.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;How many clock cycles should the reset
signal in an AMBA system be asserted for?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;It is recommended that master and slave
components should clearly state if they have a reset requirement greater than 1
or 2 cycles. It is also recommended that the system design should hold reset
asserted for at least 16 cycles, unless it is known that a master or slave
component has a longer reset requirement.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Is it legal for an AHB wrapping burst
to be aligned with respect to the total number bytes in the burst, such that it
does not wrap?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes, this behavior is compliant with
the AHB protocol.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Consider a four-beat wrapping burst of
word (4-byte) transfers (which will wrap at 16-byte boundaries).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;If the start address of the transfer is
0x30, then the burst consists of four transfers to addresses 0x30, 0x34, 0x38,
and 0x3C.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Again, although HBURST is set to WRAP4,
the burst will not actually wrap, which is allowed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When should a master assert and deassert
the HLOCK signal for a locked transfer?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The HLOCK signal must be asserted at
least one cycle before the start of the address phase of a locked transfer.
This is required so that the arbiter can sample the HLOCK signal as high at the
start of the address phase.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The master should deassert the HLOCK
signal when the address phase of the last transfer in the locked sequence has
started.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When should a master deassert its
HBUSREQ signal?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;For an undefined length burst (INCR) a
master must keep its HBUSREQ signal asserted until it has started the address
phase of the last transfer in the burst. This will mean that if the penultimate
transfer in the burst is zero wait state then the master may be granted the bus
for an additional transfer at the end of an undefined length burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;For a defined length burst the master
can deassert the HBUSREQ signal once the master has been granted the bus for
the first transfer. This can be done because the arbiter is able to count the
transfers in the burst and keep the master granted until the burst completes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;However it is not a mandatory
requirement for an Arbiter to allow a burst to complete, so the master will
have to re-assert HBUSREQ if the Arbiter removes HGRANT before the burst has
been completed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When will the arbiter grant another
master after a locked transfer?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The arbiter will always grant the
master an extra transfer at the end of a locked sequence, so the master is
guaranteed to perform one transfer with the HMASTLOCK signal low at the end of the
locked sequence. This coincides with the data phase of the last transfer in the
locked sequence.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;During this time the arbiter can change
the HGRANT signals to a new bus master, but if the data phase of the last
locked transfer receives either a SPLIT or RETRY response then the arbiter will
drive the HGRANT signals to ensure that either the master performing the locked
sequence remains granted on the bus for a RETRY response, or the Dummy master
is granted the bus for the SPLIT response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a master deassert HLOCK during a
burst?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The AHB specification requires that all
address phase timed control signals (other than HADDR and HTRANS) remain
constant for the duration of a burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Although HLOCK is not an address phase
timed signal, it does directly control the HMASTLOCK signal which is address
phase timed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Therefore HLOCK must remain high for
the duration of a burst, and can only be deasserted such that the following
HMASTLOCK signal changes after the final address phase of the burst.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a master perform transfers other
than IDLE when the bus was granted to it, but not requested by the master?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. A master can perform transfers
other than IDLE when it had not requested the bus. Please note that in this
case it is still recommended that the master asserts its request signal so that
the arbiter does not change ownership of the bus to a lower priority master
while the transfers are in progress.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;If a master is currently granted the
bus by default, how many cycles before starting an non-IDLE transfer does it
have to assert HBUSREQ?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;None. It can start a non IDLE transfer
immediately.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What is the relationship between the
HLOCK signal and the HMASTLOCK signal?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;At the start of the address phase of
every transfer the arbiter will sample the HLOCK signal of the master that is
about to start driving the address bus and if HLOCK is asserted at this point
then HMASTLOCK will be asserted by the arbiter for the duration of the address
phase of the transfer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When can the HGRANT signal change?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The HGRANT signal can change in any
cycle and the following cases are possible:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-top: 0cm;&quot; type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;It is possible that the HGRANT signal may be asserted and then
     removed&amp;nbsp; before the current transfer completes. This is acceptable
     because the HGRANT signal is only sampled by masters when HREADY is high.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;A master can be granted the bus without requesting it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;The above point also means that it is possible to be granted the
     bus in the same cycle that it is requested. This can occur if the master
     is coincidentally granted the bus in the same cycle that it requests it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Why is HADDR sometimes shown as an
input to the arbiter?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The address bus, HADDR, is not required
as an input to the arbiter but in some system designs it may be useful to use
the address bus to determine a good point to change over between bus masters.
For example, the arbiter could be designed to change bus ownership when a burst
of transfers reaches a quad word boundary.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can an arbiter be designed to always
allow bursts to complete?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;A SPLIT, RETRY or ERROR response from a
slave can always cause a burst to be early terminated. This is outwith the
control of the Arbiter and so must be supported.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Undefined length INCR bursts cannot
have their end point predicted, so there is no efficient way that an Arbiter
design can allow the burst to complete before granting another master. INCR
bursts must be arbitrated on a cycle by cycle basis.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Defined length INCRx and WRAPx bursts
can have their beats counted, and so allowed to complete by the Arbiter.
However because of the AHB arbitration synchronous timing, there is no way to
avoid possibly terminating a burst immediately after the first transfer of the
burst has been indicated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The Arbiter only knows that a defined
length burst is in progress by sampling the HBURST bus. However the first point
at which HBURST can be sampled is after the first clock cycle of the first
burst beat, by which time the Arbiter may already have decided to grant another
master and will have changed the HGRANT outputs accordingly. Only a
combinatorial path from HBURST to HGRANT would allow the burst to be detected
in time to avoid early termination in this scenario, but combinatorial paths in
the AHB bus are not allowed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Why is there a 1KB restriction in AHB?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 2.4pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The 1KB restriction you refer to is not a
restriction on maximum slave size but a constraint within AHB that says that a
burst must not cross a 1KB boundary. The limit is designed to prevent bursts
crossing from one device to another and to give a reasonable trade-off between
burst size and efficiency. In practise, this means that a master must ALWAYS
break a burst that would otherwise cross the 1KB boundary and restart it with a
non-sequential transfer, thus:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Address: 0x3F0 0x3F4 0x3F8 0x3FC 0x400
0x404 0x408&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 2.4pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Transfer: NSEQ SEQ SEQ SEQ NSEQ SEQ SEQ&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What&#39;s
the difference between retry and split in AHB?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The SPLIT and RETRY responses provide a
mechanism for slaves to release the bus when they are unable to supply data for
a transfer immediately. Both mechanisms allow the transfer to finish on the bus
and therefore allow a higher-priority master to get access to the bus.&lt;br /&gt;
&lt;br /&gt;
When a master initiates a transaction on the AMBA bus, if the target detects
that the transfer will take a large number of cycles to perform, it can issue a
SPLIT signal. What happens now is that the arbiter can grant the bus to other
masters even before the SPLIT transaction is complete. The master to which the
SPLIT has been issued has to then wait and complete the entire transaction.&lt;br /&gt;
&lt;br /&gt;
During the address phase of a transfer the arbiter generates a tag, or bus
master number, on HMASTER[3:0] which identifies the master that is performing
the transfer. Any slave issuing a SPLIT response must be capable of indicating
that it can complete the transfer, and it does this by making a note of the
master number on the HMASTER[3:0] signals.&lt;br /&gt;
&lt;br /&gt;
Later, when the slave can complete the transfer, it asserts the appropriate
bit, according to the master number, on the HSPLITx[15:0] signals from the
slave to the arbiter. The arbiter then uses this information to unmask the
request signal from the master and in due course the master will be granted
access to the bus to retry the transfer. The arbiter samples the HSPLITx bus
every cycle and therefore the slave only needs to assert the appropriate bit
for a single cycle in order for the arbiter to recognize it.&lt;br /&gt;
&lt;br /&gt;
The basic stages of a SPLIT transaction are:&lt;br /&gt;
1. The master starts the transfer in an identical way to any other transfer and&lt;br /&gt;
issues address and control information&lt;br /&gt;
2. If the slave is able to provide data immediately it may do so. If the slave&lt;br /&gt;
decides that it may take a number of cycles to obtain the data it gives a SPLIT&lt;br /&gt;
transfer response. During every transfer the arbiter broadcasts a number, or&lt;br /&gt;
tag, showing which master is using the bus. The slave must record this number,&lt;br /&gt;
to use it to restart the transfer at a later time.&lt;br /&gt;
3. The arbiter grants other masters use of the bus and the action of the SPLIT&lt;br /&gt;
response allows bus master handover to occur. If all other masters have also&lt;br /&gt;
received a SPLIT response then the default master is granted.&lt;br /&gt;
4. When the slave is ready to complete the transfer it asserts the appropriate
bit of&lt;br /&gt;
the HSPLITx bus to the arbiter to indicate which master should be regranted&lt;br /&gt;
access to the bus.&lt;br /&gt;
5. The arbiter observes the HSPLITx signals on every cycle, and when any bit of&lt;br /&gt;
HSPLITx is asserted the arbiter restores the priority of the appropriate
master.&lt;br /&gt;
6. Eventually the arbiter will grant the master so it can re-attempt the
transfer. This&lt;br /&gt;
may not occur immediately if a higher priority master is using the bus.&lt;br /&gt;
7. When the transfer eventually takes place the slave finishes with an OKAY&lt;br /&gt;
transfer response.&lt;br /&gt;
&lt;br /&gt;
For a SPLIT transfer the arbiter will adjust the priority scheme so that any
other&lt;br /&gt;
master requesting the bus will get access, even if it is a lower priority. In
order&lt;br /&gt;
for a SPLIT transfer to complete the arbiter must be informed when the slave
has&lt;br /&gt;
the data available.&lt;br /&gt;
&lt;br /&gt;
For RETRY the arbiter will continue to use the normal priority scheme and&lt;br /&gt;
therefore only masters having a higher priority will gain access to the bus.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What value should be used for HTRANS
when an AHB master gets a RETRY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;response from a slave in the middle of
burst?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Whenever a transfer is restarted it
must use HTRANS set to NONSEQ and it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;may also be necessary to adjust the
HBURST information (usually just to&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;indicate INCR).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;What address should be on the bus
during the IDLE cycle after a SPLIT or&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;RETRY?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;It does not matter what address is
driven onto the bus during this cycle.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The slave selected by the driven
address should not take any action and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;must respond with a zero wait state
OKAY response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;In many cases it will be simpler for
the master to leave the address&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;unaltered during this cycle, so that it
remains at the address of the next&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;transfer that the master wishes to
perform and only in the following cycle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;does the master return the address to
that of the transfer that must be&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;repeated because of the SPLIT or RETRY
response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;In some designs it may be possible for
the master to return the address to&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;that required to repeat the previous
transfer during the IDLE cycle and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;this behaviour is also perfectly
acceptable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Do all masters have to support SPLIT
and RETRY?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. All masters must support SPLIT and
RETRY responses to ensure they are&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;compatible with any bus slave. A master
will handle both SPLIT and RETRY&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;responses in an identical manner.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a SPLIT or RETRY response be given
at any point during a burst?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. A SPLIT, RETRY or ERROR response
can be given by a slave to any&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;transfer during a burst. The slave is
not restricted to only giving these&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;responses to the first transfer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Will a master always lose the bus after
a SPLIT response?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Yes. A slave must not assert the
relevant bit of the HSPLIT bus in the same&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;cycle that it gives the SPLIT response
and therefore the master will always&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;lose the bus.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a slave assert HSPLITx in the same
cycle that it gives a SPLIT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;response?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;No. The specification requires that HSPLITx
can only be asserted after the&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;slave has given a SPLIT response.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Do all slaves have to support the SPLIT
and RETRY responses?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;No. A slave is only required to support
the response types that it needs to&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;use. For example, a simple on-chip
memory block which can respond to all&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;transfers in just a few wait states
does not need to use either the SPLIT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;or RETRY responses.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Can a slave use both SPLIT and RETRY
responses?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Normally a slave will not use both the
SPLIT and RETRY responses. The SPLIT&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;response should be used by any slave
that may be accessed by many different&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;masters at the same time. The RETRY
response is intended to be used by&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;peripherals that are only accessed by
one bus master.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Explain Lock Transfer in AHB ?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;br /&gt;
Answer&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;LOCK tells the arbiter to keep the
current master granted, SPLIT tells the arbiter to grant another master, so the
only possible action the arbiter can take for these contradictory requests is
to grant the dummy master that must exist in any system with SPLIT capable
slaves.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;The dummy master will only perform IDLE
transfers (i.e. no data transfers), so cannot corrupt the LOCKed sequence that
is ongoing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;When the original slave is able to
complete the SPLIT transfer, it will signal this to the arbiter on HSPLIT and
the arbiter can then re-grant the original master, and the LOCKed sequence can
then continue.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;However as the slave has an HMASTLOCK
input telling it that the current transfer is part of a LOCKed sequence, it
should know that there is no system advantage in returning a SPLIT.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;So yes, a slave can return a SPLIT
response to a LOCKed transfer, and the arbiter must then grant the dummy
master, but the slave should use the HMASTLOCK input to see that a SPLIT
response is not useful at this time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Explain Wrap Boundary Calculation in
AHB ? WRAP4,WRAP8,WRAP16 ?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Wrap boundary depends on both Hsize and
the No of beats(4 ,8,16)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt; text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&quot;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;For wrapping bursts, if the start address of the transfer is not aligned
to the total number of bytes in the burst (size x beats) then the address of
the transfers in the burst will wrap when the boundary is reached&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&quot;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Case1: Start Address is 0x4,Wrap4,Hsize
is 2.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0100 - beat1 - 0x4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1000 - beat2 - 0x8&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1100 - beat3 - 0xc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0000 - beat4 - 0x0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Here as Hsize is 2,it means 4 bytes are
to be transfered. As it is Wrap4 no of beats are 4. Total no of bytes is
16(beats*Hsize in bytes). Therefore 4bit alignment is to be done.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;In beat3 the address is 0000 1100.Now
as Hsize is 2,address shld be incremented by 4.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; 0000 1100&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;+0000 0100&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;---------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; 0001 0000 ( it is crossing the
address boundary(4 bits) )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;So we are aligning it to 0000
0000.-beat4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Case2: Start Address is 0x4,Wrap4,Hsize
is 1.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0100 - beat1 - 0x4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0110 - beat2 - 0x6&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0000 - beat3 - 0x0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0010 - beat4 - 0x2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Here as Hsize is 1,it means 2bytes are
to be transfered. As it is Wrap4 no of beats are 4. Total no of bytes is
8(beats*Hsize in bytes).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Therefore 3 bit alignment is to be
done. In beat2 the address is 0000 0110. Now as Hsize is 1,address shlould be
incremented by 2.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; 0000 0&lt;b&gt;110&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;+0000 0010&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;--------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1&lt;b&gt;000&lt;/b&gt;&amp;nbsp; ( it is crossing
the address boundary(3 bits).)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;So we are aligning it to 0000
0000.-beat3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 8.0pt; mso-bidi-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;; mso-fareast-language: EN-IN;&quot;&gt;Case3: Start Address is 0x4,Wrap8,Hsize
is 1.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0100 - beat1 - 0x4&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0110 - beat2 - 0x6&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1000 - beat3 - 0x8&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1010 - beat4 - 0xa&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1100 - beat5 - 0xc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 1110 - beat6 - 0xe&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0000 - beat7 - 0x0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0000 0010 - beat8 - 0x2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Here as Hsize is 1,it means 2 bytes are
to be transfered.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;As it is Wrap8 no of beats are 8.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Total no of bytes is 16 (beats*Hsize in
bytes).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Therefore 4bit alignment is to be done.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;In beat6 the address is 0000 1110.Now
as Hsize is 1,address shld be incremented by 2.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; 0000 1110&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;+0000 0010&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;---------------&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;0001 0000 ( it is crossing the address
boundary(4 bits)).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;So we are aligning it to 0000
0000.-beat7&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Another Wrap Boundry Calculation :&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;1) convert hex addr to decimal - 0x38 =
56 (dec)&lt;br /&gt;
2) as its a word transfer (4 bytes) and WRAP 4 so 4 x 4 = 16&lt;br /&gt;
3) 56 / 16 = 3.5&lt;br /&gt;
4) take the whole number from previous calculation as 3&lt;br /&gt;
5) now 3 x 16 = 48 ( dec )&lt;br /&gt;
6) your roll over addr is 48 (dec ) = 0x30 (hex) !!!&lt;br /&gt;
&lt;br /&gt;
so the address goes as 38 - 3c - 30 and 34&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Exaplain Wrap Beat Calulation in AHB ?&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Answer&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;Following Tasks will Give Information
About Wrap Boundary Beat Location Calculation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;//-------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;// wrap4_beat_info()&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;//-------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;task&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;wrap4_beat_info
(logic [2:0] hburst,logic [31:0] haddr,logic [2:0] hsize);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; if(hsize==3&#39;b010
&amp;amp;&amp;amp; hburst==`AHB_WRAP4 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;&amp;nbsp;begin&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp;&amp;nbsp; if(haddr[3:2]==2&#39;b00) wrap4_boundry_location=0 ; // No Wrap&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[3:2]==2&#39;b01) wrap4_boundry_location=3 ; // Wrap at 3rd Beat&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[3:2]==2&#39;b10) wrap4_boundry_location=2 ; // Wrap at 2nd Beat&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[3:2]==2&#39;b11) wrap4_boundry_location=1 ; // Wrap at 1st Beat&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;b&gt;end&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;endtask&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;: wrap4_at_info&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;//--------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;// wrap8_beat_info()&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;//--------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;task&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;wrap8_beat_info
(logic[2:0] hburst,logic[31:0] haddr,logic[2:0] hsize);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; if(hsize==3&#39;b010
&amp;amp;&amp;amp; hburst==`AHB_WRAP8 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;b&gt;begin&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp;&amp;nbsp; if(haddr[5:3]==3&#39;b000) wrap8_boundry_location=0 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[5:3]==3&#39;b001) wrap8_boundry_location=7 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[5:3]==3&#39;b010) wrap8_boundry_location=6 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else if(haddr[5:3]==3&#39;b011)
wrap8_boundry_location=5 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[5:3]==3&#39;b100) wrap8_boundry_location=4 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[5:3]==3&#39;b101) wrap8_boundry_location=3 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[5:3]==3&#39;b110) wrap8_boundry_location=2 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else if(haddr[5:3]==3&#39;b110)
wrap8_boundry_location=1 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;end&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;endtask&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;: wrap8_beat_info&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;//---------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;// wrap16_at_info()&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;//---------------------------------------------------------&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;task&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;wrap16_beat_info (logic[2:0] hburst, logic[31:0] haddr,logic[2:0]
hsize);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; if(hsize==3&#39;b010
&amp;amp;&amp;amp; hburst==`AHB_WRAP16 )&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;b&gt;begin&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(haddr[7:4]==4&#39;b0000) wrap8_boundry_location=0
&amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0001) wrap8_boundry_location=15 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0010) wrap8_boundry_location=14 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0011) wrap8_boundry_location=13 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0100) wrap8_boundry_location=12 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0101) wrap8_boundry_location=11 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0110) wrap8_boundry_location=10 ;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b0111) wrap8_boundry_location=9 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1000) wrap8_boundry_location=8 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1001) wrap8_boundry_location=7 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1010) wrap8_boundry_location=6 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1011) wrap8_boundry_location=5 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1100) wrap8_boundry_location=4 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1101) wrap8_boundry_location=3 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1110) wrap8_boundry_location=2 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp; &amp;nbsp; else
if(haddr[7:4]==4&#39;b1111) wrap8_boundry_location=1 &amp;nbsp;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;b&gt;end&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 0.0001pt;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;endtask&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: 8pt;&quot;&gt;&amp;nbsp;: wrap16_beat_info&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/3157928058759854009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/3157928058759854009'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2013/03/ahb.html' title='AHB '/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-8014390559434759464</id><published>2013-02-15T21:13:00.002-08:00</published><updated>2013-02-15T21:13:28.770-08:00</updated><title type='text'>TKTCL</title><content type='html'>Comming soon</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/8014390559434759464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/8014390559434759464'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2013/02/tktcl.html' title='TKTCL'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-2653688074600490274</id><published>2011-07-14T11:53:00.000-07:00</published><updated>2013-02-16T06:43:54.256-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DESIGN"/><title type='text'>DIVIDE BY 3 COUNTER</title><content type='html'>&lt;pre class=&quot;cpp&quot; name=&quot;code&quot;&gt;module div_by_3(clk,reset,clk_3);
input    clk      ;
input    reset    ;
output   clk_3    ;

wire       Da     ;
reg        Qa     ;
reg        Qb     ;
reg        Qc     ;

  assign Da   =~Qa &amp;amp;&amp;amp; ~Qb  ;
  assign clk_3= Qb ||  Qc  ;

  always@(posedge clk or negedge reset ) begin
    if(~reset)begin
     Qa&amp;lt;=1&#39;b0 ;
    end
    else begin
     Qa&amp;lt;=Da   ;
    end
  end

  always@(posedge clk or negedge reset ) begin
    if(~reset)begin
     Qb&amp;lt;=1&#39;b0 ;
    end
    else begin
     Qb&amp;lt;=Qa   ;
    end
  end
  
  always@(negedge clk or negedge reset ) begin
    if(~reset)begin
     Qc&amp;lt;=1&#39;b0 ;
    end
     else begin
     Qc&amp;lt;=Qb   ;
    end
  end
endmodule
&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/2653688074600490274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/2653688074600490274'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2011/07/divide-by-3-counter.html' title='DIVIDE BY 3 COUNTER'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-4077991699813352095</id><published>2011-07-04T09:43:00.000-07:00</published><updated>2011-07-04T09:51:37.622-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DESIGN"/><title type='text'>Setup and Hold Time</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Following the Analogy for Explaining Setup and Holdtime :-&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;If the train leaves at 8:00 and you live 20 minutes away from the station, when should you leave your house?&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333; font-family: Verdana, sans-serif;&quot;&gt;At 7:40 (“&lt;b&gt;setup time” is 20 minutes&lt;/b&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; If you leave after 7:40, you will miss the train. If you leave before 7:40, you should have enough time to get to the station before it leaves.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; Your friend needs help boarding the train and the train allows only 5 minutes for boarding.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;How long should you stay after you have arrived?&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;At least five minutes (&lt;b&gt;“hold time” is 5 minutes&lt;/b&gt;) or 8:05 at the earliest.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt; Without your help for the full 5 minutes, your friend&amp;nbsp;is not able to board and will miss the train.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4077991699813352095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4077991699813352095'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2011/07/setup-and-holdtime.html' title='Setup and Hold Time'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-865914068412309713</id><published>2011-06-29T11:09:00.000-07:00</published><updated>2013-02-13T10:54:01.541-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AHB"/><title type='text'>AHB FAQ</title><content type='html'>&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Must a read after a write to the same address return the newly written data?&lt;/span&gt;
&lt;a href=&quot;javascript:toggle();&quot; id=&quot;displayText&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;See&lt;/span&gt;&lt;/a&gt; 
&lt;br/&gt;
&lt;div id=&quot;toggleText&quot; style=&quot;display: none;&quot;&gt;
&lt;b&gt;Scenario&lt;/b&gt;&lt;br/&gt;
When there is an AHB write followed by a read from the same address, should the read return the old or the new data when the read address phase is in same cycle of the write data phase?&lt;br/&gt;
&lt;b&gt;Answer&lt;/b&gt;&lt;br/&gt;
The answer to this question is dependent on the design of the slave.
A simple slave will not be buffering any data, so the returned read data will be the latest. A more complex slave could implement buffering for write data (if allowed by HPROT[2]) and so it could &quot;snoop&quot; the write buffer contents before returning read data, or it might just return the previously stored data regardless of what might be buffered.
In conclusion, all the AHB specification requires is that data is returned.

&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/865914068412309713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/865914068412309713'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2011/06/ahb-faq.html' title='AHB FAQ'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-8245844574012204167</id><published>2009-12-01T03:17:00.000-08:00</published><updated>2011-07-01T12:05:17.069-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AMBA"/><title type='text'>Write Data Interleaving in AXI</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Write data interleave happen when two AXI bus masters generate sequence of write data to the same slave, but the write data doesn&#39;t arrive every clock cycle. In this case, instead of waiting for one sequence to complete before the other sequence start, the AXI infrastructure can interleave the write data sequences together to avoid wasting idle cycles on the bus.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/8245844574012204167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/8245844574012204167'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/12/write-data-interleaving-in-axi.html' title='Write Data Interleaving in AXI'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-5032262633717304483</id><published>2009-12-01T03:02:00.001-08:00</published><updated>2009-12-01T03:08:33.219-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AMBA"/><title type='text'>Diffrence between AXI and AHB Bus</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;AXI, the third generation of AMBA interface defined in the AMBA 3 specification, is targeted at high performance, high clock frequency system designs and includes features which make it very suitable for high speed sub-micron interconnect:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;Seprate Channels for Read Data,Read Address,Write Data,Write Address and Write Response Channel.In Burst Transfer Only Start Address is issued .support for unaligned data transfers using byte strobes,issuing of multiple outstanding addresses . Easy addition of Register Slice to provide timing close .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;While AHB is single clock edge protocol . First should be Address phase and then data phase should come .It supportSplit and Retry Commands , there can be Serveral Bus Masters .It also support Busrt Transfer however bus requere all the address on address lines .&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/5032262633717304483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/5032262633717304483'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/12/diffrence-between-axi-and-ahb-bus.html' title='Diffrence between AXI and AHB Bus'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-2509169509410560432</id><published>2009-12-01T02:56:00.000-08:00</published><updated>2009-12-01T03:11:16.487-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AMBA"/><title type='text'>Out of Order in AXI</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;In AXI, a transfer is not completed until the bus master receive the response from the read data channel or write response channel. Also after a bus master issue a transfer, it can issue another transfer without waiting for the first one to complete. If the order of the responses coming back from the slaves arrived in different order from the order that the transfers were issued, we can call it out of order completion.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/2509169509410560432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/2509169509410560432'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/12/out-of-order-in-axi.html' title='Out of Order in AXI'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-4366209024586085756</id><published>2009-11-30T03:24:00.001-08:00</published><updated>2009-12-09T09:17:41.616-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FUNCTIONAL COVERAGE"/><title type='text'>Functional Coverage</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Arial, Helvetica; font-size: 12px; line-height: 18px; &quot;&gt;&lt;span style=&quot;font-weight: bold; &quot;&gt;Functional Coverage&lt;/span&gt; From its name it checks the Functionality of your Design unit. PSL &amp;amp; SV are used for Functional Coverage , They provide Assertions and Covergroups for that.&lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4366209024586085756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4366209024586085756'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/11/functional-coverage.html' title='Functional Coverage'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-3613423708820730464</id><published>2009-10-06T23:36:00.000-07:00</published><updated>2009-12-01T03:10:54.512-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AMBA"/><title type='text'>Scenario&#39;s for SPLIT and RETRY</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;In AMBA 2.0 Slave will issue SPLIT and RETRY Response on HRESP Output in following Scenario :&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;When the command or data Buffer is full or filled enough, and slave will analyse it will take more cycle to finish then slave has to Stop the master , so slave will issue SPLIT or RETRY Command .&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;SPLIT and RETRY Can be issued as per System Architecture.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;If you have any question regarding then please contact me on shobhitkapoor@gmail.com&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/3613423708820730464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/3613423708820730464'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/10/conditions-of-split-and-retry.html' title='Scenario&#39;s for SPLIT and RETRY'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-830686702019133045</id><published>2009-10-06T23:04:00.000-07:00</published><updated>2009-11-10T22:02:24.666-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VERILOG"/><title type='text'>String tasks in verilog</title><content type='html'>Note : If you are planning to use these Tasks with SystemVerilog then Please change byte to byte1 &amp;amp; char to char1 because both are keywords in system verilog .&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Calculate the length(length) of string(str) in verilog .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Usage : strlen(str, length); &lt;/span&gt;&lt;br /&gt;[sourcecode language=&#39;python&#39;]&lt;br /&gt;// get the number of char in the string&lt;br /&gt;task strlen;&lt;br /&gt;input [1024*8-1:0]  str;&lt;br /&gt;output [10:0]   length;&lt;br /&gt;reg [7:0]   byte;&lt;br /&gt;reg    yes;&lt;br /&gt;reg [10:0]   i;&lt;br /&gt;begin&lt;br /&gt;length = 0;&lt;br /&gt;i = 0;&lt;br /&gt;get_byte(str, i, byte);&lt;br /&gt;ischar(byte, yes);&lt;br /&gt;while(yes&amp;amp;&amp;amp;(i&lt;1024)) i =&quot; i&quot; length =&quot; i;&quot; style=&quot;font-weight:bold;&quot;&gt;Calculate the length(length) of string(str) in verilog .&lt;br /&gt;[/sourcecode]&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Usage : strclr(str); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;// clear string&lt;br /&gt;task strclr;&lt;br /&gt;output [1024*8-1:0]  str;&lt;br /&gt;reg [10:0]   i;&lt;br /&gt;begin&lt;br /&gt;for(i = 0; i&lt;1024; i =&quot; i&quot; style=&quot;font-weight:bold;&quot;&gt;Copy the first numbers(length) of input string(str_in) to output string(str_out)  in verilog.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Usage : strcpy(str_out, str_in, length); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;// copy part of input string to output string&lt;br /&gt;task strcpy;&lt;br /&gt;output [1024*8-1:0]  str_out;&lt;br /&gt;input [1024*8-1:0]  str_in;&lt;br /&gt;input [9:0]   length;&lt;br /&gt;reg [10:0]   str_length;&lt;br /&gt;reg [10:0]   i;&lt;br /&gt;reg [7:0]   byte;&lt;br /&gt;reg [10:0]   diff;&lt;br /&gt;begin&lt;br /&gt;strclr(str_out);&lt;br /&gt;strlen(str_in, str_length);&lt;br /&gt;&lt;br /&gt;if(length &gt; str_length)&lt;br /&gt;diff = 0;&lt;br /&gt;else&lt;br /&gt;diff = str_length - length;&lt;br /&gt;&lt;br /&gt;for(i = str_length; i &gt; diff; i = i - 1)&lt;br /&gt;begin&lt;br /&gt;get_byte(str_in, i-1, byte);&lt;br /&gt;put_byte(str_out, i-1-diff, byte);&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;endtask&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Cascade two input strings(str_1, str_2) to one output string(str_out)in verilog &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Usage : strcat2(str_out, str_1, str_2); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;// cascade two strings&lt;br /&gt;task strcat2;&lt;br /&gt;output [1024*8-1:0]  str_out;&lt;br /&gt;input [1024*8-1:0]  str_1;&lt;br /&gt;input [1024*8-1:0]  str_2;&lt;br /&gt;reg [10:0]   str_1_length;&lt;br /&gt;reg [10:0]   str_2_length;&lt;br /&gt;reg [10:0]   str_3_length;&lt;br /&gt;reg [10:0]   length;&lt;br /&gt;reg [9:0]   index;&lt;br /&gt;reg [7:0]   byte;&lt;br /&gt;begin&lt;br /&gt;strclr(str_out);&lt;br /&gt;strlen(str_1, str_1_length);&lt;br /&gt;strlen(str_2, str_2_length);&lt;br /&gt;str_3_length = str_1_length + str_2_length;&lt;br /&gt;if( str_3_length &gt; 1024 )&lt;br /&gt;begin&lt;br /&gt;$display(&quot;The length of cascade string is larger than 1024&quot;);&lt;br /&gt;$display(&quot;%s&quot;, str_1);&lt;br /&gt;$display(&quot;%s&quot;, str_2);&lt;br /&gt;end&lt;br /&gt;else&lt;br /&gt;begin&lt;br /&gt;for(length = str_1_length; length &gt; 0; length = length -1)&lt;br /&gt;begin&lt;br /&gt; index = length - 1;&lt;br /&gt; get_byte(str_1, index, byte);&lt;br /&gt; put_byte(str_out, index+str_2_length, byte);&lt;br /&gt;end&lt;br /&gt;for(length = str_2_length; length &gt; 0; length = length -1)&lt;br /&gt;begin&lt;br /&gt; index = length - 1;&lt;br /&gt; get_byte(str_2, index, byte);&lt;br /&gt; put_byte(str_out, index, byte);&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;endtask&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;cascade three input strings(str_1, str_2, str_3) to one output string(str_out)in verilog &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Usage : strcat2(str_out, str_1, str_2, str_3 ); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//Author : Jarod, jarod@benz.ee.nthu.edu.tw</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/830686702019133045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/830686702019133045'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/10/string-manupulation-tasks.html' title='String tasks in verilog'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-4383261883887095193</id><published>2009-07-23T05:15:00.000-07:00</published><updated>2009-11-10T22:37:39.082-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="UNIX"/><title type='text'>Delete a file of certain date in Unix</title><content type='html'>&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;Following is the Simplest method of Deleting a file of particular date/month , just three lines of code will delete all the files of particular month (date )&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot; ;font-family:arial;font-size:100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:13px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;pre&gt;&lt;pre face=&quot;consolas,&#39;Courier New&#39;,courier,monospace&quot; size=&quot;12px&quot; color=&quot;#ffffff&quot; style=&quot; margin: 0em; width: 100%;  background-&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;#!/bin/sh&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 100%; color: rgb(255, 255, 255); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#0000FF;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;ls -ltr | &lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;grep&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt; &#39;10 May&#39; | awk -F &#39;(&lt;/span&gt;&lt;span style=&quot;color:#0000ff;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;$10)&#39; &gt; tmp&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 100%; background-color: rgb(255, 255, 255); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;xarg rm &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; width: 100%; background-color: rgb(255, 255, 255); &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;courier new&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;rm -f tmp&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;arial&#39;;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;User can change a date or month according to his/her need &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;for any comment/errors please contact me on &lt;a href=&quot;http://www.blogger.com/shobhitkapoor@gmail.com&quot; style=&quot;text-decoration: none;&quot;&gt;shobhitkapoor@gmail.com&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4383261883887095193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4383261883887095193'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/07/delete-file-of-certain-date-in-unix.html' title='Delete a file of certain date in Unix'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-3918501305333014854</id><published>2009-06-11T23:03:00.000-07:00</published><updated>2015-07-17T04:16:35.321-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="PERL"/><title type='text'>PERL ONE LINERS</title><content type='html'>&lt;pre class=&quot;cpp&quot; name=&quot;code&quot;&gt;Just enough perl to do most everything! Tom Christianson (spelling?)
once posted a canonical list of one line perl programs to do many common
command-line tasks.
It included:
# run contents of &quot;my_file&quot; as a program
perl my_file

# run debugger &quot;stand-alone&quot;
perl -d -e 42

# run program, but with warnings
perl -w my_file

# run program under debugger
perl -d my_file

# just check syntax, with warnings
perl -wc my_file

# useful at end of &quot;find foo -print&quot;
perl -nle unlink

# simplest one-liner program
perl -e &#39;print &quot;hello world!\n&quot;&#39;

# add first and penultimate columns
perl -lane &#39;print $F[0] + $F[-2]&#39;

# just lines 15 to 17
perl -ne &#39;print if 15 .. 17&#39; *.pod

# in-place edit of *.c files changing all foo to bar
perl -p -i.bak -e &#39;s/\bfoo\b/bar/g&#39; *.c

# command-line that prints the first 50 lines (cheaply)
perl -pe &#39;exit if $. &amp;gt; 50&#39; f1 f2 f3 ...

# delete first 10 lines
perl -i.old -ne &#39;print unless 1 .. 10&#39; foo.txt

# change all the isolated oldvar occurrences to newvar
perl -i.old -pe &#39;s{\boldvar\b}{newvar}g&#39; *.[chy]

# command-line that reverses the whole file by lines
perl -e &#39;print reverse &amp;lt;&amp;gt;&#39; file1 file2 file3 ....

# find palindromes
perl -lne &#39;print if $_ eq reverse&#39; /usr/dict/words

# command-line that reverse all the bytes in a file
perl -0777e &#39;print scalar reverse &amp;lt;&amp;gt;&#39; f1 f2 f3 ...

# command-line that reverses the whole file by paragraphs
perl -00 -e &#39;print reverse &amp;lt;&amp;gt;&#39; file1 file2 file3 ....

# increment all numbers found in these files
perl i.tiny -pe &#39;s/(\d+)/ 1 + $1 /ge&#39; file1 file2 ....

# command-line that shows each line with its characters backwards
perl -nle &#39;print scalar reverse $_&#39; file1 file2 file3 ....

# delete all but lines beween START and END
perl -i.old -ne &#39;print unless /^START$/ .. /^END$/&#39; foo.txt

# binary edit (careful!)
perl -i.bak -pe &#39;s/Mozilla/Slopoke/g&#39; /usr/local/bin/netscape

# look for dup words
perl -0777 -ne &#39;print &quot;$.: doubled $_\n&quot; while /\b(\w+)\b\s+\b\1\b/gi&#39;
# command-line that prints the last 50 lines (expensively)
perl -e &#39;lines = &amp;lt;&amp;gt;; print @@lines[ $#lines .. $#lines-50&#39; f1 f2 f3 ...
&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/3918501305333014854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/3918501305333014854'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/06/perl-one-liners.html' title='PERL ONE LINERS'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-1972220062455262424</id><published>2009-06-11T22:56:00.000-07:00</published><updated>2013-02-16T06:46:04.371-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWK"/><title type='text'>AWK One Liners</title><content type='html'>&lt;pre class=&quot;ruby&quot; name=&quot;code&quot;&gt;FILE SPACING:

 # double space a file

 awk &#39;1;{print &quot;&quot;}&#39;

 awk &#39;BEGIN{ORS=&quot;\n\n&quot;};1&#39;

 # double space a file which already has blank lines in it. Output file

 # should contain no more than one blank line between lines of text.

 # NOTE: On Unix systems, DOS lines which have only CRLF (\r\n) are

 # often treated as non-blank, and thus &#39;NF&#39; alone will return TRUE.

 awk &#39;NF{print $0 &quot;\n&quot;}&#39;

 # triple space a file

 awk &#39;1;{print &quot;\n&quot;}&#39;

NUMBERING AND CALCULATIONS:

 # precede each line by its line number FOR THAT FILE (left alignment).

 # Using a tab (\t) instead of space will preserve margins.

 awk &#39;{print FNR &quot;\t&quot; $0}&#39; files*

 # precede each line by its line number FOR ALL FILES TOGETHER, with tab.

 awk &#39;{print NR &quot;\t&quot; $0}&#39; files*

 # number each line of a file (number on left, right-aligned)

 # Double the percent signs if typing from the DOS command prompt.

 awk &#39;{printf(&quot;%5d : %s\n&quot;, NR,$0)}&#39; 

 # number each line of file, but only print numbers if line is not blank

 # Remember caveats about Unix treatment of \r (mentioned above)

 awk &#39;NF{$0=++a &quot; :&quot; $0};1&#39;

 awk &#39;{print (NF? ++a &quot; :&quot; :&quot;&quot;) $0}&#39;

 # count lines (emulates &quot;wc -l&quot;)

 awk &#39;END{print NR}&#39;

 # print the sums of the fields of every line

 awk &#39;{s=0; for (i=1; i&amp;lt;=NF; i++) s=s+$i; print s}&#39;

 # add all fields in all lines and print the sum

 awk &#39;{for (i=1; i&amp;lt;=NF; i++) s=s+$i}; END{print s}&#39;

 # print every line after replacing each field with its absolute value

 awk &#39;{for (i=1; i&amp;lt;=NF; i++) if ($i &amp;lt; i =&quot; -$i;&quot;&amp;gt;

 awk &#39;{for (i=1; i&amp;lt;=NF; i++) $i = ($i &amp;lt;&amp;gt;

 # print the total number of fields (&quot;words&quot;) in all lines

 awk &#39;{ total = total + NF }; END {print total}&#39; file

 # print the total number of lines that contain &quot;Beth&quot;

 awk &#39;/Beth/{n++}; END {print n+0}&#39; file

 # print the largest first field and the line that contains it

 # Intended for finding the longest string in field #1

 awk &#39;$1 &amp;gt; max {max=$1; maxline=$0}; END{ print max, maxline}&#39;

 # print the number of fields in each line, followed by the line

 awk &#39;{ print NF &quot;:&quot; $0 } &#39;

 # print the last field of each line

 awk &#39;{ print $NF }&#39;

 # print the last field of the last line

 awk &#39;{ field = $NF }; END{ print field }&#39;

 # print every line with more than 4 fields

 awk &#39;NF &amp;gt; 4&#39;

 # print every line where the value of the last field is &amp;gt; 4

 awk &#39;$NF &amp;gt; 4&#39;

STRING CREATION:

 # create a string of a specific length (e.g., generate 513 spaces)

 awk &#39;BEGIN{while (a++&lt;513 s=&quot;s&quot;&gt;

 # insert a string of specific length at a certain character position

 # Example: insert 49 spaces after column #6 of each input line.

 gawk --re-interval &#39;BEGIN{while(a++&lt;49 s=&quot;s&quot;&gt;


ARRAY CREATION:

 # These next 2 entries are not one-line scripts, but the technique

 # is so handy that it merits inclusion here.

 # create an array named &quot;month&quot;, indexed by numbers, so that month[1]

 # is &#39;Jan&#39;, month[2] is &#39;Feb&#39;, month[3] is &#39;Mar&#39; and so on.

 split(&quot;Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec&quot;, month, &quot; &quot;)

 # create an array named &quot;mdigit&quot;, indexed by strings, so that

 # mdigit[&quot;Jan&quot;] is 1, mdigit[&quot;Feb&quot;] is 2, etc. Requires &quot;month&quot; array

 for (i=1; i&amp;lt;=12; i++) mdigit[month[i]] = i


TEXT CONVERSION AND SUBSTITUTION:

 # IN UNIX ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format

 awk &#39;{sub(/\r$/,&quot;&quot;)};1&#39;   # assumes EACH line ends with Ctrl-M

 # IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format

 awk &#39;{sub(/$/,&quot;\r&quot;)};1&#39;

 # IN DOS ENVIRONMENT: convert Unix newlines (LF) to DOS format

 awk 1

 # IN DOS ENVIRONMENT: convert DOS newlines (CR/LF) to Unix format

 # Cannot be done with DOS versions of awk, other than gawk:

 gawk -v BINMODE=&quot;w&quot; &#39;1&#39; infile &amp;gt;outfile

 # Use &quot;tr&quot; instead.

 tr -d \r outfile            # GNU tr version 1.22 or higher

 # delete leading whitespace (spaces, tabs) from front of each line

 # aligns all text flush left

 awk &#39;{sub(/^[ \t]+/, &quot;&quot;)};1&#39;

 # delete trailing whitespace (spaces, tabs) from end of each line

 awk &#39;{sub(/[ \t]+$/, &quot;&quot;)};1&#39;

 # delete BOTH leading and trailing whitespace from each line

 awk &#39;{gsub(/^[ \t]+|[ \t]+$/,&quot;&quot;)};1&#39;

 awk &#39;{$1=$1};1&#39;           # also removes extra space between fields

 # insert 5 blank spaces at beginning of each line (make page offset)

 awk &#39;{sub(/^/, &quot;     &quot;)};1&#39;

 # align all text flush right on a 79-column width

 awk &#39;{printf &quot;%79s\n&quot;, $0}&#39; file*

 # center all text on a 79-character width

 awk &#39;{l=length();s=int((79-l)/2); printf &quot;%&quot;(s+l)&quot;s\n&quot;,$0}&#39; file*

 # substitute (find and replace) &quot;foo&quot; with &quot;bar&quot; on each line

 awk &#39;{sub(/foo/,&quot;bar&quot;)}; 1&#39;           # replace only 1st instance

 gawk &#39;{$0=gensub(/foo/,&quot;bar&quot;,4)}; 1&#39;  # replace only 4th instance

 awk &#39;{gsub(/foo/,&quot;bar&quot;)}; 1&#39;          # replace ALL instances in a line

 # substitute &quot;foo&quot; with &quot;bar&quot; ONLY for lines which contain &quot;baz&quot;

 awk &#39;/baz/{gsub(/foo/, &quot;bar&quot;)}; 1&#39;

 # substitute &quot;foo&quot; with &quot;bar&quot; EXCEPT for lines which contain &quot;baz&quot;

 awk &#39;!/baz/{gsub(/foo/, &quot;bar&quot;)}; 1&#39;
&lt;hr /&gt;
 # change &quot;scarlet&quot; or &quot;ruby&quot; or &quot;puce&quot; to &quot;red&quot;
 awk &#39;{gsub(/scarlet|ruby|puce/, &quot;red&quot;)}; 1&#39;
&lt;hr /&gt;
 # reverse order of lines (emulates &quot;tac&quot;)
 awk &#39;{a[i++]=$0} END {for (j=i-1; j&amp;gt;=0;) print a[j--] }&#39; file*
&lt;hr /&gt;
 # if a line ends with a backslash, append the next line to it (fails if
 # there are multiple lines ending with backslash...)
 awk &#39;/\\$/ {sub(/\\$/,&quot;&quot;); getline t; print $0 t; next}; 1&#39; file*
&lt;hr /&gt;
 # print and sort the login names of all users
 awk -F &quot;:&quot; &#39;{print $1 | &quot;sort&quot; }&#39; /etc/passwd
&lt;hr /&gt;
 # print the first 2 fields, in opposite order, of every line
 awk &#39;{print $2, $1}&#39; file
&lt;hr /&gt;
 # switch the first 2 fields of every line
 awk &#39;{temp = $1; $1 = $2; $2 = temp}&#39; file
&lt;hr /&gt;
 # print every line, deleting the second field of that line
 awk &#39;{ $2 = &quot;&quot;; print }&#39;
&lt;hr /&gt;
 # print in reverse order the fields of every line
 awk &#39;{for (i=NF; i&amp;gt;0; i--) printf(&quot;%s &quot;,$i);print &quot;&quot;}&#39; file
&lt;hr /&gt;
 # concatenate every 5 lines of input, using a comma separator
 # between fields
 awk &#39;ORS=NR%5?&quot;,&quot;:&quot;\n&quot;&#39; file
&lt;hr /&gt;
SELECTIVE PRINTING OF CERTAIN LINES:
 # print first 10 lines of file (emulates behavior of &quot;head&quot;)
 awk &#39;NR &amp;lt;&amp;gt;
&lt;hr /&gt;
 # print first line of file (emulates &quot;head -1&quot;)
 awk &#39;NR&amp;gt;1{exit};1&#39;
&lt;hr /&gt;
 # print the last 2 lines of a file (emulates &quot;tail -2&quot;)
 awk &#39;{y=x &quot;\n&quot; $0; x=$0};END{print y}&#39;
&lt;hr /&gt;
 # print the last line of a file (emulates &quot;tail -1&quot;)
 awk &#39;END{print}&#39;
&lt;hr /&gt;
 # print only lines which match regular expression (emulates &quot;grep&quot;)
 awk &#39;/regex/&#39;
 # print only lines which do NOT match regex (emulates &quot;grep -v&quot;)
 awk &#39;!/regex/&#39;
&lt;hr /&gt;
 # print any line where field #5 is equal to &quot;abc123&quot;
 awk &#39;$5 == &quot;abc123&quot;&#39;
&lt;hr /&gt;
 # print only those lines where field #5 is NOT equal to &quot;abc123&quot;
 # This will also print lines which have less than 5 fields.
 awk &#39;$5 != &quot;abc123&quot;&#39;
 awk &#39;!($5 == &quot;abc123&quot;)&#39;
&lt;hr /&gt;
 # matching a field against a regular expression
 awk &#39;$7  ~ /^[a-f]/&#39;    # print line if field #7 matches regex
 awk &#39;$7 !~ /^[a-f]/&#39;    # print line if field #7 does NOT match regex
&lt;hr /&gt;
 # print the line immediately before a regex, but not the line
 # containing the regex
 awk &#39;/regex/{print x};{x=$0}&#39;
 awk &#39;/regex/{print (NR==1 ? &quot;match on line 1&quot; : x)};{x=$0}&#39;
&lt;hr /&gt;
 # print the line immediately after a regex, but not the line
 # containing the regex
 awk &#39;/regex/{getline;print}&#39;
 # grep for AAA and BBB and CCC (in any order on the same line)
 awk &#39;/AAA/ &amp;amp;&amp;amp; /BBB/ &amp;amp;&amp;amp; /CCC/&#39;
 # grep for AAA and BBB and CCC (in that order)
 awk &#39;/AAA.*BBB.*CCC/&#39;
&lt;hr /&gt;
 # print only lines of 65 characters or longer
 awk &#39;length &amp;gt; 64&#39;
&lt;hr /&gt;
 # print only lines of less than 65 characters
 awk &#39;length &amp;lt;&amp;gt;
&lt;hr /&gt;
 # print section of file from regular expression to end of file
 awk &#39;/regex/,0&#39;
 awk &#39;/regex/,EOF&#39;
&lt;hr /&gt;
 # print section of file based on line numbers (lines 8-12, inclusive)
 awk &#39;NR==8,NR==12&#39;
&lt;hr /&gt;
 # print line number 52
 awk &#39;NR==52&#39;
 awk &#39;NR==52 {print;exit}&#39;          # more efficient on large files
&lt;hr /&gt;
 # print section of file between two regular expressions (inclusive)
 awk &#39;/Iowa/,/Montana/&#39;             # case sensitive
&lt;hr /&gt;
SELECTIVE DELETION OF CERTAIN LINES:
 # delete ALL blank lines from a file (same as &quot;grep &#39;.&#39; &quot;)
 awk NF
 awk &#39;/./&#39;
&lt;hr /&gt;
 # remove duplicate, consecutive lines (emulates &quot;uniq&quot;)
 awk &#39;a !~ $0; {a=$0}&#39;
&lt;hr /&gt;
 # remove duplicate, nonconsecutive lines
 awk &#39;!a[$0]++&#39;                     # most concise script
 awk &#39;!($0 in a){a[$0];print}&#39;      # most efficient script
&lt;!--49--&gt;&lt;!--513--&gt;&lt;/49&gt;&lt;/513&gt;&lt;/pre&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/1972220062455262424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/1972220062455262424'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/06/awk-one-liners.html' title='AWK One Liners'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-4032385487723319086</id><published>2009-06-11T22:55:00.000-07:00</published><updated>2009-06-11T22:56:29.307-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VHDL"/><title type='text'>Learn VHDL in  One Day</title><content type='html'>Learn VHDL in One Day is simple tutorial for quick Learning of VHDL&lt;br /&gt;&lt;br /&gt;Comming Soon</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4032385487723319086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4032385487723319086'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/06/learn-vhdl-in-one-day.html' title='Learn VHDL in  One Day'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-1541595290681438475</id><published>2009-06-11T22:54:00.000-07:00</published><updated>2009-10-06T23:49:09.819-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="SystemVerilog"/><title type='text'>SystemVerilog in One Day</title><content type='html'>This is Simple tutorial of learning SystemVerilog in one Day&lt;br /&gt;&lt;br /&gt;Comming soon...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/1541595290681438475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/1541595290681438475'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/06/learn-systemverilog-in-one-day.html' title='SystemVerilog in One Day'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-4161806746603444108</id><published>2009-06-11T22:52:00.000-07:00</published><updated>2009-06-11T22:53:14.357-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VERILOG"/><title type='text'>Learn Verilog in One Day</title><content type='html'>This is very simple and Easy Tutorial for Verilog Learn , With the help of this tutorial anyone can understand basics of verilog .&lt;br /&gt;&lt;br /&gt;Comming Soon ....</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4161806746603444108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4161806746603444108'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/06/learn-verilog-in-one-day.html' title='Learn Verilog in One Day'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-7622269919583628557</id><published>2009-06-11T22:49:00.000-07:00</published><updated>2009-06-11T22:51:46.245-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C"/><title type='text'>Learn C  in  One Day</title><content type='html'>Usally this website is Only for Chip Designers , And Mostly all the Chip Designers are not good in C Language , But If you Really have to learn C in a nutshell then this is very simple Tutorial .&lt;br /&gt;&lt;br /&gt;Coming Soon...</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/7622269919583628557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/7622269919583628557'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/06/learn-c-in-one-day.html' title='Learn C  in  One Day'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-7967683165354040742</id><published>2009-05-11T23:54:00.000-07:00</published><updated>2009-12-01T03:16:11.586-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DOCUMENTATION"/><title type='text'>Create a table of contents in Microsoft Word</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;The easiest way to create a table of contents is to use the built-in outline-level (outline level: Paragraph formatting you can use to assign a hierarchical level (Level 1 through Level 9) to paragraphs in your document. For example, after you assign outline levels, you can work with the document in outline view or in the Document Map.) formats or heading styles (heading style: Formatting applied to a heading. Microsoft Word has nine different built-in styles: Heading 1 through Heading 9.). If you are already using outline-level formats or built-in heading styles, follow these steps:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;   1. Click where you want to insert the table of contents.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;   2. On the Insert menu, point to Reference, and click Index and Tables.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;   3. Click the Table of Contents tab.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;   4. To use one of the available designs, click a design in the Formats box.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;  &gt;   5. Select any other table of contents options you want.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/7967683165354040742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/7967683165354040742'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2009/05/create-table-of-contents.html' title='Create a table of contents in Microsoft Word'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-5923010113551774997</id><published>2008-06-26T04:04:00.001-07:00</published><updated>2011-06-30T10:51:45.719-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AMBA"/><title type='text'>ARM AMBA 2.0 AHB Split and Retry</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;What is the diffrence between split and retry ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Both the Split and Retry responses are used by slaves which require a large number of cycles to complete a transfer. These responses allow a data phase transfer to appear completed to avoid stalling the bus, but at the same time indicate that the transfer should be re-attempted when the master is next granted the bus.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;The difference between them is that a SPLIT response tells the Arbiter to give priority to all other masters until the SPLIT transfer can be completed (effectively ignoring all further requests from this master until the SPLIT slave indicates it can complete the SPLIT transfer), whereas the RETRY response only tells the Arbiter to give priority to higher priority masters.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;A SPLIT response is more complicated to implement than a RETRY, but has the advantage that it allows the maximum efficiency to be made of the bus bandwidth.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;The master behaviour is identical to both SPLIT and RETRY responses, the master has to cancel the next access and re-attempt the current failed access.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Do all slaves have to support the SPLIT and RETRY responses ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;No. A slave is only required to support the response types that it needs to use. For example, a simple on-chip memory block which can respond to all transfers in just a few wait states does not need to use either the SPLIT or RETRY responses.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Do all masters have to support SPLIT and RETRY ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Yes. All masters must support SPLIT and RETRY responses to ensure they are compatible with any bus slave. A master will handle both SPLIT and RETRY responses in an identical manner.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Note that if the system is based on AHB-Lite, SPLIT and RETRY responses are not supported. AHB-lite is a single master solution, so SPLIT and RETRY responses would have no meaning.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Can a SPLIT or RETRY response be given at any point during a burst ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Yes. A SPLIT, RETRY or ERROR response can be given by a slave to any transfer during a burst. The slave is not restricted to only giving these responses to the first transfer.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Can a slave assert HSPLITx in the same cycle that it gives a SPLIT response ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;No. The specification requires that HSPLITx can only be asserted after the slave has given a SPLIT response.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: normal; &quot;&gt;&lt;p style=&quot;margin-top: 0.8em; margin-bottom: 0.2em; &quot;&gt;The 1KB restriction you refer to is not a restriction on maximum slave size but a constraint within AHB that says that a burst must not cross a 1KB boundary. The limit is designed to prevent bursts crossing from one device to another and to give a reasonable trade-off between burst size and efficiency. In practise, this means that a master must ALWAYS break a burst that would otherwise cross the 1KB boundary and restart it with a non-sequential transfer, thus:&lt;/p&gt;&lt;p style=&quot;margin-top: 0.8em; margin-bottom: 0.2em; &quot;&gt;Address: 0x3F0 0x3F4 0x3F8 0x3FC 0x400 0x404 0x408&lt;br /&gt;Transfer: NSEQ SEQ    SEQ   SEQ    NSEQ  SEQ   SEQ&lt;/p&gt;&lt;p style=&quot;margin-top: 0.8em; margin-bottom: 0.2em; &quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Can a slave use both SPLIT and RETRY responses ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Normally a slave will not use both the SPLIT and RETRY responses. The SPLIT response should be used by any slave that may be accessed by many different masters at the same time. The RETRY response is intended to be used by peripherals that are only accessed by one bus master.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;What address should be on the bus during the IDLE cycle after a SPLIT or RETRY ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;It does not matter what address is driven onto the bus during this cycle. The slave selected by the driven address should not take any action and must respond with a zero wait state OKAY response.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;In many cases it will be simpler for the master to leave the address unaltered during this cycle, so that it remains at the address of the next transfer that the master wishes to perform and only in the following cycle does the master return the address to that of the transfer that must be repeated because of the SPLIT or RETRY response.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;In some designs it may be possible for the master to return the address to that required to repeat the previous transfer during the IDLE cycle and this behaviour is also perfectly acceptable.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;What value should be used for HTRANS when an AHB master gets a RETRY response from a slave in the middle of burst ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Whenever a transfer is restarted it must use HTRANS set to NONSEQ and it may also be necessary to adjust the HBURST information (usually just to indicate INCR).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Will a master always lose the bus after a SPLIT response ?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;Times New Roman&#39;;font-size:16px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;;font-family:Verdana;font-size:13px;&quot;&gt;Yes. A slave must not assert the relevant bit of the HSPLIT bus in the same cycle that it gives the SPLIT response and therefore the master will always lose the bus.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/5923010113551774997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/5923010113551774997'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2008/06/split-and-retry.html' title='ARM AMBA 2.0 AHB Split and Retry'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-4350100684280902221</id><published>2008-06-25T22:01:00.002-07:00</published><updated>2008-06-25T22:02:58.110-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AIRTHMATICS"/><title type='text'>Multiply and Divide Tricks</title><content type='html'>// Binary Multiplication Algorithm&lt;br /&gt;// Simple Multiplication Hardware&lt;br /&gt;// Streamlined Multiplication Hardware&lt;br /&gt;// Booth Recoding for Higher-Radix and Signed Multiplication&lt;br /&gt;// Binary Division Algorithm&lt;br /&gt;// Division Hardware (Simple and Streamlined)&lt;br /&gt;// &quot;Real&quot; Arithmetic Circuits&lt;br /&gt;/// References&lt;br /&gt;/// Binary Multiplication Algorithm&lt;br /&gt;// :PH: 4.6&lt;br /&gt;/// Long Hand Procedure Review&lt;br /&gt;//&lt;br /&gt;// Multiply 5 times 12 in binary:&lt;br /&gt;//&lt;br /&gt;// 0101 Multiplicand&lt;br /&gt;// 1100 Multiplier&lt;br /&gt;// &quot;&quot;&quot;&quot;&lt;br /&gt;// 0000&lt;br /&gt;// 0000&lt;br /&gt;// 0101&lt;br /&gt;// 0101&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 0111100 Product&lt;br /&gt;////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;/// Simple Multiplication Hardware&lt;br /&gt;// :PH: 4.6&lt;br /&gt;/// Simple Multipliers&lt;br /&gt;//&lt;br /&gt;// Designed to show basic techniques, but are inefficient.&lt;br /&gt;// Following sections show improved multipliers.&lt;br /&gt;/// Multipliers in this section:&lt;br /&gt;//&lt;br /&gt;// Simple Unsigned Combinational Multiplier&lt;br /&gt;// See :PH: Figure 4.25&lt;br /&gt;// Multiplies using combinational logic only.&lt;br /&gt;// Cost of n-bit multiplier: proportional to n^2.&lt;br /&gt;// Speed of n-bit multiplier: time needed for n additions:&lt;br /&gt;// Proportional to n.&lt;br /&gt;//&lt;br /&gt;// Simple Unsigned Multiplier&lt;br /&gt;// Unlike combinational multiplier, uses a clock.&lt;br /&gt;// Cost of n-bit multiplier:&lt;br /&gt;// Proportional to n.&lt;br /&gt;// Includes 5n bits of register storage.&lt;br /&gt;// Speed of n-bit multiplier:&lt;br /&gt;// Product in n clocks.&lt;br /&gt;// Clock period includes 2n-bit add.&lt;br /&gt;// Uses more hardware than streamlined multipliers in next section.&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Simple Unsigned Combinational Multiplier&lt;br /&gt;// Based on :PH: Figure 4.25&lt;br /&gt;//&lt;br /&gt;// This is a straightforward coding of the longhand multiplication&lt;br /&gt;// technique.&lt;br /&gt;module simple_combinational_mult(product,multiplier,multiplicand); //P&lt;br /&gt;input [15:0] multiplier, multiplicand;&lt;br /&gt;output product;&lt;br /&gt;reg [31:0] product;&lt;br /&gt;integer i;&lt;br /&gt;always @( multiplier or multiplicand )&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;product = 0;&lt;br /&gt;&lt;br /&gt;for(i=0; i&lt;16; i=i+1)&lt;br /&gt;if( multiplier[i] == 1&#39;b1 ) product = product + ( multiplicand &lt;&lt; i );&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;endmodule&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Simple Unsigned Multiplier&lt;br /&gt;//&lt;br /&gt;// Sequential multiplier. Handshaking signals are added to command&lt;br /&gt;// multiplier to start and to indicate when finished. Registers are&lt;br /&gt;// provided for shifted versions of the multiplier and multiplicand.&lt;br /&gt;module simple_mult(product,ready,multiplier,multiplicand,start,clk); //P&lt;br /&gt;input [15:0] multiplier, multiplicand;&lt;br /&gt;input start, clk;&lt;br /&gt;output product;&lt;br /&gt;output ready;&lt;br /&gt;reg [31:0] product;&lt;br /&gt;reg [15:0] multiplier_copy;&lt;br /&gt;reg [31:0] multiplicand_copy;&lt;br /&gt;&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 16;&lt;br /&gt;product = 0;&lt;br /&gt;multiplicand_copy = { 16&#39;d0, multiplicand };&lt;br /&gt;multiplier_copy = multiplier;&lt;br /&gt;&lt;br /&gt;end else if( bit ) begin&lt;br /&gt;if( multiplier_copy[0] == 1&#39;b1 ) product = product + multiplicand_copy;&lt;br /&gt;multiplier_copy = multiplier_copy &gt;&gt; 1;&lt;br /&gt;multiplicand_copy = multiplicand_copy &lt;&lt; 1;&lt;br /&gt;bit = bit - 1;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;/// Streamlined Multiplication Hardware&lt;br /&gt;// :PH: 4.6&lt;br /&gt;/// Streamlined Multipliers&lt;br /&gt;//&lt;br /&gt;// Uses less hardware than simple multiplier.&lt;br /&gt;// Much slower than &quot;real&quot; multipliers.&lt;br /&gt;/// Multipliers in this section:&lt;br /&gt;//&lt;br /&gt;// Streamlined Unsigned Multiplier&lt;br /&gt;// See :PH: Figure 4.31&lt;br /&gt;// Less register storage than simple multiplier.&lt;br /&gt;// Cost of n-bit multiplier:&lt;br /&gt;// Proportional to n.&lt;br /&gt;// Includes 2n bits of register storage.&lt;br /&gt;// Speed of n-bit multiplier: (Same as simple.)&lt;br /&gt;// Product in n clocks.&lt;br /&gt;// Clock period includes a 2n-bit add.&lt;br /&gt;//&lt;br /&gt;// Streamlined Signed Multiplier&lt;br /&gt;// Like previous multiplier, but handles signed numbers.&lt;br /&gt;// A better signed multiplier covered later (using Booth recoding).&lt;br /&gt;// Cost of n-bit multiplier:&lt;br /&gt;// Proportional to n.&lt;br /&gt;// Includes 3n bits of register storage.&lt;br /&gt;// Speed of n-bit multiplier:&lt;br /&gt;// Product in n clocks.&lt;br /&gt;// Clock period includes 2n-bit add.&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Streamlined Unsigned Multiplier&lt;br /&gt;// Based on :PH: Figure 4.31&lt;br /&gt;//&lt;br /&gt;// Improvements:&lt;br /&gt;//&lt;br /&gt;// The product register also holds the multiplier.&lt;br /&gt;// Only the product register is shifted.&lt;br /&gt;// A register is not needed to hold the multiplicand.&lt;br /&gt;// Wow, you save 2n bits! (To multiply n-bit numbers.)&lt;br /&gt;module streamlined_mult(product,ready,multiplier,multiplicand,start,clk);&lt;br /&gt;input [15:0] multiplier, multiplicand;&lt;br /&gt;input start, clk;&lt;br /&gt;output product;&lt;br /&gt;output ready;&lt;br /&gt;reg [31:0] product;&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 16;&lt;br /&gt;product = { 16&#39;d0, multiplier };&lt;br /&gt;&lt;br /&gt;end else if( bit ) begin:A&lt;br /&gt;&lt;br /&gt;reg lsb;&lt;br /&gt;lsb = product[0];&lt;br /&gt;product = product &gt;&gt; 1;&lt;br /&gt;bit = bit - 1;&lt;br /&gt;if( lsb ) product[31:15] = product[30:15] + multiplicand;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Streamlined Signed Multiplier&lt;br /&gt;//&lt;br /&gt;// Multiplies absolute value of multiplier and multiplicand.&lt;br /&gt;// Negates product if multiplier and multiplicand differ in sign.&lt;br /&gt;// Otherwise similar to streamlined unsigned multiplier.&lt;br /&gt;module streamlined_signed_mult(product,ready,multiplier,multiplicand,&lt;br /&gt;start,clk);&lt;br /&gt;input [15:0] multiplier, multiplicand;&lt;br /&gt;input start, clk;&lt;br /&gt;output product;&lt;br /&gt;output ready;&lt;br /&gt;reg [31:0] product;&lt;br /&gt;reg [15:0] abs_multiplicand;&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 16;&lt;br /&gt;product = { 16&#39;d0, multiplier[15] ? -multiplier : multiplier };&lt;br /&gt;abs_multiplicand = multiplicand[15] ? -multiplicand : multiplicand;&lt;br /&gt;&lt;br /&gt;end else if( bit ) begin:A&lt;br /&gt;&lt;br /&gt;reg lsb;&lt;br /&gt;lsb = product[0];&lt;br /&gt;product = product &gt;&gt; 1;&lt;br /&gt;bit = bit - 1;&lt;br /&gt;if( lsb ) product[31:15] = product[30:15] + abs_multiplicand;&lt;br /&gt;if( !bit &amp;amp;&amp;amp; multiplicand[15] ^ multiplier[15] ) product = -product;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;/// Booth Recoding for Higher-Radix and Signed Multiplication&lt;br /&gt;// :PH: 4.6 Only describes Radix-2 Booth Recoding&lt;br /&gt;/// Basic Idea&lt;br /&gt;//&lt;br /&gt;// Rather than repeatedly adding either 0 or 1 times multiplicand,&lt;br /&gt;// repeatedly add 0, 1, -1, 2, -2, etc. times the multiplicand.&lt;br /&gt;//&lt;br /&gt;/// Benefits&lt;br /&gt;//&lt;br /&gt;// Performs signed multiplication without having to first compute the&lt;br /&gt;// absolute value of the multiplier and multiplicand.&lt;br /&gt;//&lt;br /&gt;// Improved performance (when radix higher than 2).&lt;br /&gt;/// Multipliers Described Here&lt;br /&gt;//&lt;br /&gt;// Ordinary Radix-4 Unsigned Multiplier&lt;br /&gt;// Presented for pedagogical reasons, Booth multipliers better.&lt;br /&gt;// Twice as fast as earlier multipliers.&lt;br /&gt;// Uses more hardware than Booth multipliers below.&lt;br /&gt;//&lt;br /&gt;// Booth Recoding Radix-4 Multiplier&lt;br /&gt;// Multiplies signed numbers.&lt;br /&gt;// Twice as fast as earlier multipliers.&lt;br /&gt;//&lt;br /&gt;// Booth Recoding Radix-2 Multiplier&lt;br /&gt;// Multiplies signed numbers.&lt;br /&gt;// Uses about the same amount of hardware than earlier signed multiplier.&lt;br /&gt;/// Ordinary Radix-4 Multiplier Idea&lt;br /&gt;//&lt;br /&gt;// Review of Radix-2 Multiplication&lt;br /&gt;//&lt;br /&gt;// Multiply 5 times 12. Radix-2 multiplication (the usual way).&lt;br /&gt;//&lt;br /&gt;// 0101 Multiplicand&lt;br /&gt;// 1100 Multiplier&lt;br /&gt;// &quot;&quot;&quot;&quot;&lt;br /&gt;// 0000 0 x 0101&lt;br /&gt;// 0000 0 x 0101&lt;br /&gt;// 0101 1 x 0101&lt;br /&gt;// 0101 1 x 0101&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 0111100 Product&lt;br /&gt;//&lt;br /&gt;// Radix-4 Multiplication&lt;br /&gt;// Let &quot;a&quot; denote the multiplicand and b denote the multiplier.&lt;br /&gt;// Pre-compute 2a and 3a.&lt;br /&gt;// Examine multiplier two bits at a time (rather than one bit at a time).&lt;br /&gt;// Based on the value of those bits add 0, a, 2a, or 3a (shifted by&lt;br /&gt;// the appropriate amount).&lt;br /&gt;//&lt;br /&gt;// Uses n/2 additions to multiply two n-bit numbers.&lt;br /&gt;//&lt;br /&gt;// Two Radix-4 Multiplication Examples&lt;br /&gt;//&lt;br /&gt;// Multiply 5 times 12. Radix-4 multiplication (the faster way).&lt;br /&gt;//&lt;br /&gt;// Precompute: 2a: 01010, 3a: 01111&lt;br /&gt;//&lt;br /&gt;// 0101 Multiplicand&lt;br /&gt;// 1100 Multiplier&lt;br /&gt;// &quot;&quot;&quot;&quot;&lt;br /&gt;// 00000 00 x 0101&lt;br /&gt;// 01111 11 x 0101&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 0111100 Product&lt;br /&gt;//&lt;br /&gt;// Multiply 5 times 9. Radix-4 multiplication (the faster way).&lt;br /&gt;//&lt;br /&gt;// 0101 Multiplicand&lt;br /&gt;// 1001 Multiplier&lt;br /&gt;// &quot;&quot;&quot;&quot;&lt;br /&gt;// 00101 01 x 0101&lt;br /&gt;// 01010 10 x 0101&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 0101101 Product&lt;br /&gt;// Ordinary Radix-2^d Multiplier&lt;br /&gt;//&lt;br /&gt;// This is a generalization of the Radix-4 multiplier.&lt;br /&gt;//&lt;br /&gt;// Let &quot;a&quot; denote the multiplicand and b denote the multiplier.&lt;br /&gt;// Pre-compute 2a, 3a, 4a, 5a, ..., (2^d-1)a&lt;br /&gt;// Examine multiplier d bits at a time.&lt;br /&gt;// Let the value of those bits be v.&lt;br /&gt;// Add v shifted by the appropriate amount.&lt;br /&gt;//&lt;br /&gt;// Uses n/d additions to multiply two n-bit numbers.&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// A Radix-4 multiplier. Takes unsigned numbers.&lt;br /&gt;module imult_ord_radix_4(prod,ready,multiplicand,multiplier,start,clk);&lt;br /&gt;input [15:0] multiplicand, multiplier;&lt;br /&gt;input start, clk;&lt;br /&gt;output prod;&lt;br /&gt;output ready;&lt;br /&gt;reg [32:0] product;&lt;br /&gt;wire [31:0] prod = product[31:0];&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;reg [17:0] pp;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;wire [17:0] multiplicand_X_1 = {1&#39;b0,multiplicand};&lt;br /&gt;wire [17:0] multiplicand_X_2 = {multiplicand,1&#39;b0};&lt;br /&gt;wire [17:0] multiplicand_X_3 = multiplicand_X_2 + multiplicand_X_1;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 8;&lt;br /&gt;product = { 16&#39;d0, multiplier };&lt;br /&gt;&lt;br /&gt;end else if( bit ) begin&lt;br /&gt;case ( {product[1:0]} )&lt;br /&gt;2&#39;d0: pp = {2&#39;b0, product[31:16] };&lt;br /&gt;2&#39;d1: pp = {2&#39;b0, product[31:16] } + multiplicand_X_1;&lt;br /&gt;2&#39;d2: pp = {2&#39;b0, product[31:16] } + multiplicand_X_2;&lt;br /&gt;2&#39;d3: pp = {2&#39;b0, product[31:16] } + multiplicand_X_3;&lt;br /&gt;endcase&lt;br /&gt;product = { pp, product[15:2] };&lt;br /&gt;bit = bit - 1;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;/// Booth Recoding&lt;br /&gt;//&lt;br /&gt;// Goal: Reduce the number of pre-computed multiples of the multiplicand.&lt;br /&gt;// Bonus: Handles signed numbers.&lt;br /&gt;//&lt;br /&gt;// Idea: Use something like carries.&lt;br /&gt;//&lt;br /&gt;// Why It&#39;s Called Recoding&lt;br /&gt;// Numbers like 3 are recoded into 4-1, avoiding the need to deal with 3.&lt;br /&gt;//&lt;br /&gt;// Consider need to compute multiplicand_X_3 for radix-4 multiplier.&lt;br /&gt;// Instead:&lt;br /&gt;// Subtract multiplicand and add 4 times multiplicand.&lt;br /&gt;// The subtraction is done in the &quot;current&quot; step.&lt;br /&gt;// The addition is done in the &quot;next&quot; step.&lt;br /&gt;// Multiply 5 times 3. Booth radix-4 multiplication.&lt;br /&gt;//&lt;br /&gt;// 0101 Multiplicand&lt;br /&gt;// 0011 Multiplier&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 1111011 -1 x 0101 Multiplier bits 11 -&gt; -1 + 4 -&gt; -1 now, +1 next step&lt;br /&gt;// 00101 (00+1) x 0101 Multiplier bits 00 -&gt; 0 (now) + 1 (from last step)&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 0001111 Product&lt;br /&gt;// The table below indicates:&lt;br /&gt;//&lt;br /&gt;// MB: Multiplier bits value.&lt;br /&gt;// C: Carry bit (lostbit in modules) from previous step.&lt;br /&gt;// x: Amount to multiply multiplicand by.&lt;br /&gt;// c: Carry bit to next step.&lt;br /&gt;//&lt;br /&gt;// Radix-4 Booth Table&lt;br /&gt;//&lt;br /&gt;// MB C  x c&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 00 0  0 + 0 0&lt;br /&gt;// 00 1  1 + 0 0&lt;br /&gt;// 01 0  1 + 0 0&lt;br /&gt;// 01 1  2 + 0 0&lt;br /&gt;// 10 0  -2 + 4 1&lt;br /&gt;// 10 1  -1 + 4 1&lt;br /&gt;// 11 0  -1 + 4 1&lt;br /&gt;// 11 1  0 + 4 1&lt;br /&gt;//&lt;br /&gt;// For example above:&lt;br /&gt;// Step 1: MB -&gt; 11, C -&gt; 0, lookup reveals x -&gt; -1, c -&gt; 1&lt;br /&gt;// Step 2: MB -&gt; 00, C -&gt; 1, lookup reveals x -&gt; 1, c -&gt; 0&lt;br /&gt;//&lt;br /&gt;// Radix-2 Booth Table&lt;br /&gt;//&lt;br /&gt;// MB C  x c&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 0 0  0 + 0 0&lt;br /&gt;// 0 1  1 + 0 0&lt;br /&gt;// 1 0  -1 + 2 1&lt;br /&gt;// 1 1  0 + 2 1&lt;br /&gt;// Note:&lt;br /&gt;// The carry out is the same as the MSB of the multiplier bits examined.&lt;br /&gt;// That&#39;s intentional, so that no special storage or computation is need&lt;br /&gt;// for the carry.&lt;br /&gt;//&lt;br /&gt;// The carry out of the last step is not used.&lt;br /&gt;//&lt;br /&gt;// Construction of higher-radix tables is straightforward.&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// A Booth radix-4 multiplier. This takes signed numbers.&lt;br /&gt;module imult_Booth_radix_4(prod,ready,multiplicand,multiplier,start,clk); // P&lt;br /&gt;input [15:0] multiplicand, multiplier;&lt;br /&gt;input start, clk;&lt;br /&gt;output prod;&lt;br /&gt;output ready;&lt;br /&gt;reg [32:0] product;&lt;br /&gt;wire [31:0] prod = product[31:0];&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;reg lostbit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;wire [16:0] multsx = {multiplicand[15],multiplicand};&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 8;&lt;br /&gt;product = { 17&#39;d0, multiplier };&lt;br /&gt;lostbit = 0;&lt;br /&gt;&lt;br /&gt;end else if( bit ) begin:A&lt;br /&gt;case ( {product[1:0],lostbit} )&lt;br /&gt;3&#39;b001: product[32:16] = product[32:16] + multsx;&lt;br /&gt;3&#39;b010: product[32:16] = product[32:16] + multsx;&lt;br /&gt;3&#39;b011: product[32:16] = product[32:16] + 2 * multiplicand;&lt;br /&gt;3&#39;b100: product[32:16] = product[32:16] - 2 * multiplicand;&lt;br /&gt;3&#39;b101: product[32:16] = product[32:16] - multsx;&lt;br /&gt;3&#39;b110: product[32:16] = product[32:16] - multsx;&lt;br /&gt;endcase&lt;br /&gt;lostbit = product[1];&lt;br /&gt;product = { product[32], product[32], product[32:2] };&lt;br /&gt;bit = bit - 1;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Radix-2 Booth multiplier. Unlike signed multiplier, does not&lt;br /&gt;// require time or hardware for taking absolute value of operands.&lt;br /&gt;module imult_Booth(product,ready,multiplicand,multiplier,start,clk); // P&lt;br /&gt;input [15:0] multiplicand, multiplier;&lt;br /&gt;input start, clk;&lt;br /&gt;output product;&lt;br /&gt;output ready;&lt;br /&gt;reg [31:0] product;&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;reg lostbit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 16;&lt;br /&gt;product = { 16&#39;d0, multiplier };&lt;br /&gt;lostbit = 0;&lt;br /&gt;&lt;br /&gt;end else if( bit ) begin:A&lt;br /&gt;case ( {product[0],lostbit} )&lt;br /&gt;2&#39;b01: product[31:16] = product[31:16] + multiplicand;&lt;br /&gt;2&#39;b10: product[31:16] = product[31:16] - multiplicand;&lt;br /&gt;endcase&lt;br /&gt;lostbit = product[0];&lt;br /&gt;product = { product[31], product[31:1] };&lt;br /&gt;bit = bit - 1;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;/// Binary Division Algorithm&lt;br /&gt;// :PH: 4.7&lt;br /&gt;// Binary Version of Longhand Division Technique&lt;br /&gt;//&lt;br /&gt;// 11 divided by 3:&lt;br /&gt;//&lt;br /&gt;// 11 (1011) is dividend.&lt;br /&gt;// 3 (0011) is divider.&lt;br /&gt;//&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 1011&lt;br /&gt;// -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 0 Difference is negative: copy dividend and put 0 in quotient.&lt;br /&gt;// 1011&lt;br /&gt;// -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 00 Difference is negative: copy dividend and put 0 in quotient.&lt;br /&gt;// 1011&lt;br /&gt;// -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 001 Difference is positive: use difference and put 1 in quotient.&lt;br /&gt;// 0101&lt;br /&gt;// -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 0011 Difference is positive: use difference and put 1 in quotient.&lt;br /&gt;// 10 &lt;br /&gt;//&lt;br /&gt;// Quotient, 3 (0011); remainder 2 (10).&lt;br /&gt;////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;/// Division Hardware (Simple and Streamlined)&lt;br /&gt;// :PH: 4.7&lt;br /&gt;/// Division Hardware&lt;br /&gt;//&lt;br /&gt;// Simple Divider&lt;br /&gt;// See :PH: Figure 4.36&lt;br /&gt;// A straightforward translation of binary division algorithm into hardware.&lt;br /&gt;// Cost of n-bit divider:&lt;br /&gt;// Proportional to n.&lt;br /&gt;// Uses 5n bits of register storage.&lt;br /&gt;// Speed of n-bit divider:&lt;br /&gt;// Quotient in n clock cycles.&lt;br /&gt;//&lt;br /&gt;// Streamlined Divider&lt;br /&gt;// See :PH: Figure 4.41&lt;br /&gt;// Less storage needed.&lt;br /&gt;// Cost of n-bit divider:&lt;br /&gt;// Proportional to n.&lt;br /&gt;// Uses 2n bits of register storage.&lt;br /&gt;// Speed of n-bit divider:&lt;br /&gt;// Quotient in n clock cycles.&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Simple divider.&lt;br /&gt;// Based on :PH: Figure 4.36&lt;br /&gt;module simple_divider(quotient,remainder,ready,dividend,divider,start,clk);&lt;br /&gt;&lt;br /&gt;input [15:0] dividend,divider;&lt;br /&gt;input start, clk;&lt;br /&gt;output quotient,remainder;&lt;br /&gt;output ready;&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 1011  &lt;---- dividend_copy&lt;br /&gt;// -0011  &lt;---- divider_copy&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 0 Difference is negative: copy dividend and put 0 in quotient.&lt;br /&gt;// 1011  &lt;---- dividend_copy&lt;br /&gt;// -0011  &lt;---- divider_copy&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 00 Difference is negative: copy dividend and put 0 in quotient.&lt;br /&gt;// 1011  &lt;---- dividend_copy&lt;br /&gt;// -0011  &lt;---- divider_copy&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 001 Difference is positive: use difference and put 1 in quotient.&lt;br /&gt;// quotient (numbers above)&lt;br /&gt;reg [15:0] quotient;&lt;br /&gt;reg [31:0] dividend_copy, divider_copy, diff;&lt;br /&gt;wire [15:0] remainder = dividend_copy[15:0];&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 16;&lt;br /&gt;quotient = 0;&lt;br /&gt;dividend_copy = {16&#39;d0,dividend};&lt;br /&gt;divider_copy = {1&#39;b0,divider,15&#39;d0};&lt;br /&gt;end else begin&lt;br /&gt;diff = dividend_copy - divider_copy;&lt;br /&gt;quotient = quotient &lt;&lt; 1;&lt;br /&gt;if( !diff[31] ) begin&lt;br /&gt;dividend_copy = diff;&lt;br /&gt;quotient[0] = 1&#39;d1;&lt;br /&gt;end&lt;br /&gt;divider_copy = divider_copy &gt;&gt; 1;&lt;br /&gt;bit = bit - 1;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;// :Example:&lt;br /&gt;//&lt;br /&gt;// Streamlined divider.&lt;br /&gt;// Based on :PH: Figure 4.41&lt;br /&gt;//&lt;br /&gt;// Uses less register storage than simple divider.&lt;br /&gt;module streamlined_divider(quotient,remainder,ready,dividend,divider,start,clk);&lt;br /&gt;&lt;br /&gt;input [15:0] dividend,divider;&lt;br /&gt;input start, clk;&lt;br /&gt;output quotient,remainder;&lt;br /&gt;output ready;&lt;br /&gt;reg [31:0] qr;&lt;br /&gt;reg [16:0] diff;&lt;br /&gt;//&lt;br /&gt;// 0000 1011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 1011  0001 0110 &lt;- qr reg&lt;br /&gt;// -0011  -0011 &lt;- divider (never changes)&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 1011  0010 110o &lt;- qr reg&lt;br /&gt;// -0011  -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&lt;br /&gt;// 1011  0101 10oo &lt;- qr reg&lt;br /&gt;// -0011  -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 0010 1000 &lt;- qr reg before shift&lt;br /&gt;// 0101  0101 0ooi &lt;- after shift&lt;br /&gt;// -0011  -0011&lt;br /&gt;// &quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot; 0010 ooii&lt;br /&gt;// 10 &lt;br /&gt;//&lt;br /&gt;// Quotient, 3 (0011); remainder 2 (10).&lt;br /&gt;&lt;br /&gt;wire [15:0] remainder = qr[31:16];&lt;br /&gt;wire [15:0] quotient = qr[15:0];&lt;br /&gt;reg [4:0] bit;&lt;br /&gt;wire ready = !bit;&lt;br /&gt;&lt;br /&gt;initial bit = 0;&lt;br /&gt;always @( posedge clk )&lt;br /&gt;if( ready &amp;amp;&amp;amp; start ) begin&lt;br /&gt;bit = 16;&lt;br /&gt;qr = {16&#39;d0,dividend};&lt;br /&gt;end else begin&lt;br /&gt;diff = qr[31:15] - {1&#39;b0,divider};&lt;br /&gt;if( diff[16] )&lt;br /&gt;qr = {qr[30:0],1&#39;d0};&lt;br /&gt;else&lt;br /&gt;qr = {diff[15:0],qr[14:0],1&#39;d1};&lt;br /&gt;&lt;br /&gt;bit = bit - 1;&lt;br /&gt;end&lt;br /&gt;endmodule&lt;br /&gt;////////////////////////////////////////////////////////////////////////////////&lt;br /&gt;/// &quot;Real&quot; Arithmetic Circuits&lt;br /&gt;// :HP: Appendix A&lt;br /&gt;/// Adders&lt;br /&gt;//&lt;br /&gt;// Multiple-level CLA covered in class reasonably close to adders used&lt;br /&gt;// in processors.&lt;br /&gt;//&lt;br /&gt;// Other fast adder techniques also used. (See :PH: problems.)&lt;br /&gt;/// Multipliers&lt;br /&gt;//&lt;br /&gt;// The multiplication hardware presented above is much slower than&lt;br /&gt;// the hardware used in real processors.&lt;br /&gt;//&lt;br /&gt;// &quot;Real&quot; n-bit Multiplier Features&lt;br /&gt;//&lt;br /&gt;// Multiplication done in one or two cycles (assume one cycle).&lt;br /&gt;// Uses higher-radix (say 4) Booth recoding or something similar.&lt;br /&gt;// Enough adders are provided so that product computed in one cycle.&lt;br /&gt;// These adders can add n numbers quickly without the cost of n CLA&#39;s.&lt;br /&gt;// Cost may be something like 3/2 n ripple adders plus 1 CLA.&lt;br /&gt;// Delay through each adder is only a handful of gates.&lt;br /&gt;// Adders may be connected as a tree, so that number of adders&lt;br /&gt;// from input to output is proportional to log n (rather than n).&lt;br /&gt;/// Dividers&lt;br /&gt;//&lt;br /&gt;// The division hardware presented above is slower than hardware used&lt;br /&gt;// in real processors.&lt;br /&gt;//&lt;br /&gt;// Division trickier than multiplication because result of step i&lt;br /&gt;// needed for i+1. This precludes the tree structures used in&lt;br /&gt;// fast multipliers.&lt;br /&gt;//&lt;br /&gt;// FP Dividers in general-purpose processors typically take 10-20 cycles.&lt;br /&gt;//&lt;br /&gt;// Several division techniques used. Examples:&lt;br /&gt;// SRT: Sweeney, Robertson, Tocher&lt;br /&gt;// Newton Iteration&lt;br /&gt;// Goldschmidt&#39;s Algorithm&lt;br /&gt;x</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4350100684280902221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/4350100684280902221'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2008/06/multiply-and-divide-tricks.html' title='Multiply and Divide Tricks'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-5819597627080393325</id><published>2008-06-17T19:23:00.000-07:00</published><updated>2011-07-04T09:56:24.192-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DESIGN"/><title type='text'>﻿Floating Point Arithmatic</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;There are two possible methods that can be used for representing binary numbers in   A computer. They are the fixed point and floating point systems. In practice, in a fixed   Point system, binary numbers are expressed as fractions with the radix point positioned   Immediately right of the sign digit.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;For e.g. in a machine using 8-bit registers 1110.0 would be   represented as &lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;0.1110000 -1110 x 2 -4   by moving the radix point four places to the left.   Unfortunately there are problems associated with fixed point arithmetic. that if the sum of two 8-bit   numbers is &amp;gt; 127 or &amp;lt; -127 an additional bit is generated and an incorrect answer is obtained. Assuming   8-bit registers are being used in the machine, the range of the registers has been exceeded. The same   problem exists for the multiplication and division operations.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;If two 8-bit numbers are multiplied, one by the   other, then in many cases a double- length product will be formed and this would require a 16-bit register.   Similarly, for the division operations, a fractional quotient can only be formed if the divisor is greater than   the dividend.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;To overcome the range problems experienced with fixed point representation a floating point system can be   used. Numbers in this system are expressed in the following form:   n=m x 2e   Where m, the mantissa, is the fractional representation of n and e is the exponent.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana;&quot;&gt;When performing a   computation, a normalized form of the mantissa is used. Normalization is achieved by adjusting the   exponent so that the mantissa has a 1 in its most significant digit position. When this condition is satisfied:   0.5 &amp;lt;= m &amp;lt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt; &lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
+1492.9187= +.14929187 x 10 &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;+4 -.00034123 = -.34123000 x 10 -3   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Which have been normalized an alternative way of expressing these numbers would be&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;+. 14929187 x 10 &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;+4 =- +. 14929187e &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;+ 4 -.34123000 x 10 &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;-3 = -.34123000e - 3   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: verdana;&quot;&gt;Assuming that the bias constant to be added to the exponent is 16 and that the exponent part of the   numbers is positioned to the left of the fractional part, the two numbers would have the following form:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt; &lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;14929187 x 10+4 =-+20, &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;14929187 -.34123000 x 10 &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;-3 =-13, 34123000&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;The addition of the constant 16 to the exponent expresses in two decimal digits any exponent between 10   +15 and 10 -16 and consequently increases the range of numbers the machine can handle.&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt; &lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/5819597627080393325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/5819597627080393325'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2008/06/floating-point-arithmetic.html' title='﻿Floating Point Arithmatic'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-6451824891065608607</id><published>2008-06-17T09:40:00.000-07:00</published><updated>2009-10-06T23:48:24.093-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VERILOG"/><title type='text'>define vs parameter</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;there are two ways to define constants: the parameter, a constant that is local to a module and macro definitions, created using the `define compiler directive. A parameter, after it is declared, is referenced using the parameter name. A `define macro definition, after it is defined, is&lt;br /&gt;referenced using the macro name with a preceding ` (back-tic) character. It is easy to distinguish between parameters and macros in a design because macros have a `identifier_name while a parameter is just the identifier_name without back-tic.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;           &lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;Parameters must be defined within module boundaries  using the keyword parameter.&lt;br /&gt;A parameter is a constant that is local to a module that can optionally be redefined on an instance-byinstance basis. For parameterized modules, one or more parameter declarations typically precede the port declarations in a Verilog-1995 style model, such as the simple register model in Example 1.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;b&gt;module register (q, d, clk, rst_n);&lt;br /&gt;parameter SIZE=8;&lt;br /&gt;output [SIZE-1:0] q;&lt;br /&gt;input [SIZE-1:0] d;&lt;br /&gt;input clk, rst_n;&lt;br /&gt;reg [SIZE-1:0] q;&lt;br /&gt;always @(posedge clk or negedge rst_n)&lt;br /&gt;if (!rst_n) q &lt;= 0; else q &lt;= d;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;endmodule&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;The Verilog-2001[5] version of the same model can&lt;br /&gt;take advantage of both the ANSI-C style ports and module&lt;br /&gt;header parameter list, as shown in Example 2.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:arial;font-size:100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;module register2001&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt; #(parameter SIZE=8)&lt;br /&gt;(output reg [SIZE-1:0] q,&lt;br /&gt;input [SIZE-1:0] d,&lt;br /&gt;input clk, rst_n);&lt;br /&gt;always @(posedge clk, negedge rst_n)&lt;br /&gt;if (!rst_n) q &lt;= 0; else q &lt;= d; &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;endmodule&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;4. Parameters and Parameter Redefinition&lt;br /&gt;When instantiating modules with parameters, in&lt;br /&gt;Verilog-1995 there are two ways to change the parameters&lt;br /&gt;for some or all of the instantiated modules; parameter&lt;br /&gt;redefinition in the instantiation itself, or separate&lt;br /&gt;defparam statements.&lt;br /&gt;Verilog-2001 adds a third and superior method to&lt;br /&gt;change the parameters on instantiated modules by using&lt;br /&gt;named parameter passing in the instantiation itself (see&lt;br /&gt;section 7).&lt;br /&gt;5. Parameter redefinition using #&lt;br /&gt;Parameter redefinition during instantiation of a module&lt;br /&gt;uses the # character to indicate that the parameters of the&lt;br /&gt;instantiated module are to be redefined.&lt;br /&gt;In Example 3, two copies of the register from Example&lt;br /&gt;1 are instantiated into the two_regs1 module. The SIZE&lt;br /&gt;parameter for both instances is set to 16 by the #(16)&lt;br /&gt;parameter redefinition values on the same lines as the&lt;br /&gt;register instantiations themselves.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;b&gt;module two_regs1 (q, d, clk, rst_n);&lt;br /&gt;output [15:0] q;&lt;br /&gt;input [15:0] d;&lt;br /&gt;input clk, rst_n;&lt;br /&gt;wire [15:0] dx;&lt;br /&gt;register #(16) r1 (.q(q), .d(dx),&lt;br /&gt;.clk(clk), .rst_n(rst_n));&lt;br /&gt;register #(16) r2(.q(dx), .d(d),&lt;br /&gt;.clk(clk), .rst_n(rst_n));&lt;br /&gt;endmodule&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;`define Inclusion&lt;br /&gt;One popular technique to insure that a macro definition&lt;br /&gt;exists before its usage is to use an `ifdef, or the new&lt;br /&gt;Verilog-2001 `ifndef compiler directives to query for&lt;br /&gt;the existence of a macro definition followed by either a&lt;br /&gt;`define macro assignment or a `include of a file name&lt;br /&gt;that contains the require macro definition.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&lt;br /&gt;`ifdef CYCLE&lt;br /&gt;// do nothing (better to use `ifndef)&lt;br /&gt;`else&lt;br /&gt;`define CYCLE 100&lt;br /&gt;`endif&lt;br /&gt;`ifndef CYCLE&lt;br /&gt;`include &quot;definitions.vh&quot;&lt;br /&gt;`endif&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;The `undef compiler directive&lt;br /&gt;Verilog has the `undef compiler directive to remove a&lt;br /&gt;macro definition created with the `define compiler&lt;br /&gt;directive.&lt;br /&gt;Bergeron recommends avoiding the use of macro&lt;br /&gt;definitions[11]. I agree with this recommendation.&lt;br /&gt;Bergeron further recommends that all macro definitions&lt;br /&gt;should be removed using `undef when no longer&lt;br /&gt;needed[11]. I disagree with this recommendation. This&lt;br /&gt;seems to be overkill to correct a problem that rarely exists.&lt;br /&gt;Using the `define compiler directive to create global&lt;br /&gt;macros where appropriate is very useful. Losing sleep&lt;br /&gt;over the existence of global macro definitions and&lt;br /&gt;tracking all of the `undef&#39;s in a design is not a good use&lt;br /&gt;of time.&lt;br /&gt;For the rare occasion where it might make sense to&lt;br /&gt;redefine a macro, use `undef in the same file and at the&lt;br /&gt;end of the file where the `define macro was defined.&lt;br /&gt;Make sure that the last compiled macro definition is&lt;br /&gt;likely to be the macro that you might want to access from&lt;br /&gt;a testbench, because only one macro definition can exist&lt;br /&gt;during runtime debug.&lt;br /&gt;Again, using a `define-`undef pair should be&lt;br /&gt;considered the last resort to a problem that could probably&lt;br /&gt;be better handled using a better method.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt; &lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/6451824891065608607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/6451824891065608607'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2008/06/define-vs-parameter.html' title='define vs parameter'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-588992790346386155</id><published>2008-06-02T08:09:00.000-07:00</published><updated>2008-06-17T09:47:58.590-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="CODE COVERAGE"/><title type='text'>CODE COVERAGE</title><content type='html'>&lt;span style=&quot;font-family:verdana;font-size:130%;&quot;&gt;Code Coverage It is a process of validating or finding the quality of the test bench for RTL code for a particular design. This is a measurement which tells how good the design has been exercised with the test bench / test cases.&lt;br /&gt;Code coverage is applied to DUT (Design under Test) to check how thoroughly the HDL exercised by test suite. Code coverage points the portion of code which did not exercised, it also points the corner/edge cases, unused/dead code.&lt;br /&gt;There are varieties of tools available in the market for code coverage. Models (From Mentor Graphics) and ICC (From Cadence) are some examples of those.&lt;br /&gt;With out code coverage tools designer can only say the simulation output is the expected one or not. But he will not know whether he needs more test cases or not. With help of code coverage it is very easy to know how well the HDL code exercised. From the code coverage result it is easy to determine how more TCs needed for a complete test.&lt;br /&gt;Well, what are the things to be checked during code coverage? Or what are the types of code coverage? Following text describes the types of coverage which are applied together or separately. There will be a possibility to enable or disable any one particular type of the coverage during the process.&lt;br /&gt;Block coverage - When block coverage enabled the tool monitors all exercisable blocks in the HDL code. Block is a statement or sequence of statements that executes with no branches and delays. Assume there are 100 blocks in one design but only 75 blocks are exercised with test suite then the block coverage is 75%. So it is sure that the design needs more test cases to exercise the complete logic.&lt;br /&gt;Branch coverage- In a &#39;case&#39; or &#39;if-else&#39; there may be more the one branch in the design. Test case should exercise all branches for the completeness. Often some cases in a case statement of else part of &#39;if-else&#39; statement will be missed. Branch coverage will identify those errors. A snippet of code considered 100% covered with branch coverage when all the branches of code executed at least once. Some time it is referred as decision coverage. Branch coverage also applied to case statements, like the following:&lt;br /&gt;In this example, branch coverage will identify whether each of the three branches of the Case statement is taken.&lt;br /&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;case (z)&lt;br /&gt;1 : x=0;&lt;br /&gt;2 : x=10;&lt;br /&gt;3 : x=20;&lt;br /&gt;endcase&lt;/span&gt;&lt;br /&gt;Condition coverage - Some tools support this feature. This is an extension of branch coverage. Condition coverage breaks down branch conditions into the elements that make the result true or false. If there are any conditions in an ‘if’ statement are missed during executing then the tool will notify.&lt;br /&gt;Statement coverage - It count all executable statements in a code and makes ratio of unexecuted statement during the current simulation. Executable statements are those that have a definite action during runtime and do not include comments, compile directives or declarations. At end of this document there is a worked example for this type of coverage.&lt;br /&gt;Variable coverage - Multi bit variables are monitored in this coverage. It allow to track toggles, range and values on vector (more than one bit) variables&lt;br /&gt;FSM coverage - Finite state machine coverage, it helps to analyze variety of styles of state machine written in RTL.&lt;br /&gt;Expression coverage - Expression coverage brings statistics for all expressions in the HDL code. Expression can be continues or procedural assignments. It identifies the expressions which are not sufficiently exercised.&lt;br /&gt;Toggle coverage - A design includes various objects like bit, reg, wire, signals. These objects might or might not change during simulation run. Toggle coverage measures these signals&#39; activities. It is very useful in gate level testing. It also gives approximate power consumption of the circuit.&lt;br /&gt;Example for code coverage.&lt;br /&gt;There are two modules,&lt;br /&gt;mux.v - This is DUT, it is a 4 to 1 mux.&lt;br /&gt;tb_mux.v - Test bench for mux which generates test vectors for DUT. The quality of this test bech for DUT is going to be checked now. &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Verdana;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;module mux (sel_a,sel_b,data_4bit,out); &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;input sel_a; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;input sel_b; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;input [3:0] data_4bit; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;output out; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;reg out;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;always @ (sel_a or sel_b or data_4bit)begin case ({sel_a,sel_b}) 2&#39;b00 : out &lt;= data_4bit[0]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;2&#39;b00 : out &lt;= data_4bit[1]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;2&#39;b00 : out &lt;= data_4bit[2]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;2&#39;b00 : out &lt;= data_4bit[3]; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:courier new;font-size:130%;&quot;&gt;default : out &lt;= 1&#39;b0; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:verdana;font-size:130%;&quot;&gt;&lt;span style=&quot;font-family:courier new;&quot;&gt;endcaseendendmodule&lt;br /&gt;&lt;br /&gt;module tb_mux;&lt;br /&gt;reg sel_a;&lt;br /&gt;reg sel_b;&lt;br /&gt;reg [3:0]data_4bit;&lt;br /&gt;wire out;&lt;br /&gt;initial&lt;br /&gt;begin&lt;br /&gt;data_4bit = 4&#39;b1001;&lt;br /&gt;// input set 1&lt;br /&gt;sel_a = 1&#39;b0;&lt;br /&gt;sel_b = 1&#39;b0;&lt;br /&gt;// input set 2&lt;br /&gt;sel_a = 1&#39;b0;&lt;br /&gt;sel_b = 1&#39;b1;&lt;br /&gt;// input set 3&lt;br /&gt;sel_a = 1&#39;b1;&lt;br /&gt;sel_b = 1&#39;b1;&lt;br /&gt;// input set 4&lt;br /&gt;sel_a = 1&#39;b1;&lt;br /&gt;sel_b = 1&#39;b0;&lt;br /&gt;// input set 5&lt;br /&gt;sel_a = 1&#39;bx;&lt;br /&gt;sel_b = 1&#39;bx;&lt;br /&gt;end&lt;br /&gt;mux dut (.sel_a(sel_a),&lt;br /&gt;.sel_b(sel_b),&lt;br /&gt;.data_4bit(data_4bit),&lt;br /&gt;.out(out));&lt;br /&gt;Endmodule&lt;br /&gt;&lt;/span&gt;Since this example is just to get an idea about code coverage only statement coverage is enabled. Other coverage options can be enabled if it is needed.&lt;br /&gt;Run 1&lt;br /&gt;For the first run input set 1,2 and 3 are enabled 4 and 5 are disabled (disable in the sense comment the lines under the input set 4 and input set 5). For this run the code statement coverage is only 71.4%. How this is calculated&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Verdana;font-size:130%;&quot;&gt;&lt;br /&gt;Code Coverage runs one&lt;br /&gt;In the above figure, there are two status bars for two modules. tb_mux and dut. Measuring code coverage for test bench is not important. Only the DUT has to be checked thoroughly for it is functionality that is the job of TB. So in the above picture don’t worry about tb_mux. Our interested module is DUT and it shows 71.4%. The number of executable line in the DUT is 7. Current inputs from test bench exercises only 5 statements. So 5/7 * 100 = 74.1%&lt;br /&gt;&lt;br /&gt;Code Coverage run one Code&lt;br /&gt;Above figure shows the missing statements the case items 2&#39;b10 and default. It is clear that the design is not tested completely. So the test bench has to be improved.&lt;br /&gt;Run 2&lt;br /&gt;For the second run input set 1,2,3 and 4 are enabled, 5 is disabled. For this run the code statement coverage is 85.7%.&lt;br /&gt;Code Coverage run two&lt;br /&gt;Calculation for second run 6/7 * 100 = 85.7%. See the following diagram for more details&lt;br /&gt;Code Coverage run two Code&lt;br /&gt;Run 3&lt;br /&gt;For the third run all input sets 1 to 5 are enabled in the test bench. For this run the code statement coverage is 100%.&lt;br /&gt;Code Coverage run three&lt;br /&gt;Note that for some complex design it may not be possible to bring 100% for all types of coverage. &lt;/span&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/588992790346386155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/588992790346386155'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2008/06/code-coverage.html' title='CODE COVERAGE'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-2065005632409402161.post-2775305703662986685</id><published>2008-05-30T04:38:00.000-07:00</published><updated>2009-10-06T23:45:22.939-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="LINTING"/><title type='text'>Linting</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;In general Lint tools that flag suspicious and non- portable usage of language construct in any programming language. It points out the code where it likely to be bugs. In chip design world Lint tools (some time referred as Design Rule Checker) check the cleanness and portability of the HDLs code for various EDA tools. Usually compiler does not show the errors and warnings which detected by lint tools. There are many advantages of it, for example when design style enforced by lint tool it avoids a situation where the synthesis tools implements something different than expected from RTL code.&lt;br /&gt;For example consider the following Verilog code. Lint Check example&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:arial;font-size:100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;module lint_check (x, y, z);&lt;br /&gt;    input x;&lt;br /&gt;    input y;&lt;br /&gt;    output z;&lt;br /&gt;  assign z= x + y;      &lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Endmodule&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;font-family:arial;font-size:100%;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;This example is completely ok with compiler. Complier does not generate warning. In the above code by default the output variable ‘z’ is a wire. It is not necessary declare it as a wire. But some (not every) synthesis tools may need it to be declared it as a wire.&lt;br /&gt;&lt;br /&gt;If Lint tool applied on the code before the synthesis, it points out the above mistake. This is just one example. There are many standards and lint check rules are available. Here are some example for rules, coding style, DFT, design style, language constructs, synthesis and also possible to include custom rule checking. It is possible to select/deselect the rules/standards during lint checking. It completely depends on the need of the particular environment and design. Lint check rule can be stand alone or it can be integrated with come verification environment. Spyglass is a stand alone Lint tool, nLint integrated with Verdi and Debussy debug systems. Leda (Synopsys call it ‘RTL checker’) Black-Tie from cadence are some other Lint tools in the market.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:verdana;font-size:130%;&quot;&gt;&lt;/span&gt; &lt;/div&gt;&lt;div align=&quot;justify&quot;&gt;&lt;span style=&quot;font-family:verdana;font-size:130%;&quot;&gt;&lt;/span&gt; &lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/2775305703662986685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2065005632409402161/posts/default/2775305703662986685'/><link rel='alternate' type='text/html' href='http://chipguru.blogspot.com/2008/05/linting.html' title='Linting'/><author><name>Shobhit Kapoor</name><uri>http://www.blogger.com/profile/10632016364093868248</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>