Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FPGA Configuration Space
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
FPGA Configuration Space
Commits
76e13756
Commit
76e13756
authored
12 years ago
by
Alessandro Rubini
Browse files
Options
Downloads
Patches
Plain Diff
doc: slight reword of the endianness section
parent
3fb49318
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/specification/sdb.tex
+11
-11
11 additions, 11 deletions
docs/specification/sdb.tex
with
11 additions
and
11 deletions
docs/specification/sdb.tex
+
11
−
11
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
w
he
n 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
th
os
e
b
it
s
. 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
t
he
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
l
it
tle-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
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment