Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FPGA Configuration Space
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FPGA Configuration Space
Commits
76e13756
Commit
76e13756
authored
Jul 24, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: slight reword of the endianness section
parent
3fb49318
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
sdb.tex
docs/specification/sdb.tex
+11
-11
No files found.
docs/specification/sdb.tex
View file @
76e13756
...
...
@@ -963,9 +963,9 @@ BusPath VendorID Product Base(Hex) Description
\subsection
{
Endianness Problems
}
Please note that the host may have some issue reading the binary
Please note that the host may have some issue
s
reading the binary
dumps. According to how the bridge between the host and FPGA is
designed you may face one of the following situation:
designed you may face one of the following situation
s
:
\begin{itemize}
\item
The host is big-endian (data is always correct).
...
...
@@ -975,18 +975,18 @@ designed you may face one of the following situation:
If the bridge is byte-oriented, i.e. each and every byte can be
independently addressed as such, then the usual endian conversion
rules apply (e.g. you can
\textit
{
memcpy
}
and then access fields with
endian-aware code).
rules apply (e.g. you can
\textit
{
memcpy
}
the records to host memory
and access fields with
endian-aware code).
If the bridge i
t word-oriented, however
, the behaviour is stranger, in
If the bridge i
s word-oriented, with 32-bit words in this example
, the behaviour is stranger, in
a way. After you copied the data to host memory (whether one byte at
a time or not), you'll find that
within each word the bytes are
swapped. This happens because when the host reads the byte at offse
t
0, it requests bits 0..7, and the bridge returns the byte at offset 3,
which corresponds to those bits
. If this is your case, you need to
a time or not), you'll find that
the bytes are swapped within each word.
This happens because the 32-bit word is transferred as a whole: the least significan
t
bits remain the the least significant, but they come from offset 3 in the data structure
and are stored at offset 0 in the little-endian host
. If this is your case, you need to
byte-swap each 32-bit word before using the structure in a
little-endian host. After such swapping, the
usual rules for
multi-byte values apply
.
little-endian host. After such swapping, the
data fields live at the correct
offsets and must be accessed as big endian
.
\subsection
{
Existing Tools
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment