removing rest of USERSPACE_TOOLS (unused or depricated)
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7224 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -1,674 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
@@ -1,6 +0,0 @@
|
||||
updatefw: updatefw.c
|
||||
$(CC) updatefw.c -o updatefw -I../../../targets/ARCH/EXMIMO
|
||||
|
||||
clean:
|
||||
rm -f updatefw
|
||||
|
||||
@@ -1,605 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*============================================================================
|
||||
File: elf.h
|
||||
Include file for ELF file. Defines both 32-/64-bit files.
|
||||
Copyright Hewlett-Packard Co. 1996. All rights reserved.
|
||||
============================================================================*/
|
||||
|
||||
#ifndef ELF_INCLUDED
|
||||
#define ELF_INCLUDED
|
||||
|
||||
#include "elftypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*============================================================================
|
||||
Constant values for the sizes of fundamental types
|
||||
============================================================================*/
|
||||
|
||||
#define ELF64_FSZ_ADDR 8
|
||||
#define ELF64_FSZ_HALF 2
|
||||
#define ELF64_FSZ_OFF 8
|
||||
#define ELF64_FSZ_SWORD 4
|
||||
#define ELF64_FSZ_WORD 4
|
||||
#define ELF64_FSZ_SXWORD 8
|
||||
#define ELF64_FSZ_XWORD 8
|
||||
|
||||
#define ELF32_FSZ_ADDR 4
|
||||
#define ELF32_FSZ_HALF 2
|
||||
#define ELF32_FSZ_OFF 4
|
||||
#define ELF32_FSZ_SWORD 4
|
||||
#define ELF32_FSZ_WORD 4
|
||||
#define ELF32_FSZ_XWORD 4
|
||||
|
||||
/*============================================================================
|
||||
The EI_* macros define indices into the e_ident[] array of the
|
||||
ElfXX_Ehdr structure.
|
||||
============================================================================*/
|
||||
|
||||
#define EI_MAG0 0 /* File identification */
|
||||
#define EI_MAG1 1 /* File identification */
|
||||
#define EI_MAG2 2 /* File identification */
|
||||
#define EI_MAG3 3 /* File identification */
|
||||
#define EI_CLASS 4 /* File class */
|
||||
#define EI_DATA 5 /* Data encoding */
|
||||
#define EI_VERSION 6 /* File version */
|
||||
#define EI_OSABI 7 /* OS/ABI identification */
|
||||
#define EI_ABIVERSION 8 /* ABI version */
|
||||
#define EI_PAD 9 /* Start of padding bytes */
|
||||
|
||||
#define EI_NIDENT 16 /* Size of e_ident[] */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Ehdr - ELF file header structure.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
unsigned char e_ident[EI_NIDENT]; /* ELF identification */
|
||||
Elf64_Half e_type; /* Object file type */
|
||||
Elf64_Half e_machine; /* Machine type */
|
||||
Elf64_Word e_version; /* Object file version */
|
||||
Elf64_Addr e_entry; /* Entry point address */
|
||||
Elf64_Off e_phoff; /* Program header offset */
|
||||
Elf64_Off e_shoff; /* Section header offset */
|
||||
Elf64_Word e_flags; /* Processor-specific flags */
|
||||
Elf64_Half e_ehsize; /* ELF header size */
|
||||
Elf64_Half e_phentsize; /* Size of program header entry */
|
||||
Elf64_Half e_phnum; /* Number of program header entries */
|
||||
Elf64_Half e_shentsize; /* Size of section header entry */
|
||||
Elf64_Half e_shnum; /* Number of section header entries */
|
||||
Elf64_Half e_shstrndx; /* Section name string table index */
|
||||
} Elf64_Ehdr;
|
||||
|
||||
typedef struct {
|
||||
unsigned char e_ident[EI_NIDENT]; /*16/ ELF "magic number" */
|
||||
Elf32_Half e_type; /* 2/ Identifies object file type */
|
||||
Elf32_Half e_machine; /* 2/ Specifies required architecture */
|
||||
Elf32_Word e_version; /* 4/ Identifies object file version */
|
||||
Elf32_Addr e_entry; /* 4/ Entry point virtual address */
|
||||
Elf32_Off e_phoff; /* 4/ Program header table file offset */
|
||||
Elf32_Off e_shoff; /* 4/ Section header table file offset */
|
||||
Elf32_Word e_flags; /* 4/ Processor-specific flags */
|
||||
Elf32_Half e_ehsize; /* 2/ ELF header size in bytes */
|
||||
Elf32_Half e_phentsize; /* 2/ Program header table entry size */
|
||||
Elf32_Half e_phnum; /* 2/ Program header table entry count */
|
||||
Elf32_Half e_shentsize; /* 2/ Section header table entry size */
|
||||
Elf32_Half e_shnum; /* 2/ Section header table entry count */
|
||||
Elf32_Half e_shstrndx; /* 2/ Section header string table index */
|
||||
} Elf32_Ehdr;
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFCLASS* macros are the defined values of e_ident[EI_CLASS].
|
||||
============================================================================*/
|
||||
|
||||
#define ELFCLASSNONE 0 /* Invalid class */
|
||||
#define ELFCLASS32 1 /* 32-bit objects */
|
||||
#define ELFCLASS64 2 /* 64-bit objects */
|
||||
|
||||
#define ELFCLASS64_A 200 /* 64-bit objects (interim definition) */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFDATA* macros are the allowed values of e_ident[EI_DATA].
|
||||
============================================================================*/
|
||||
|
||||
#define ELFDATANONE 0 /* Invalid data encoding */
|
||||
#define ELFDATA2LSB 1 /* 2's complement, LSB at lowest byte address */
|
||||
#define ELFDATA2MSB 2 /* 2's complement, MSB at lowest byte address */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFOSIABI* macros are the allowed values of e_ident[EI_OSABI].
|
||||
============================================================================*/
|
||||
|
||||
#define ELFOSABI_SYSV 0 /* System V ABI, third edition, no checking */
|
||||
#define ELFOSABI_HPUX 1 /* HP-UX operating system */
|
||||
|
||||
#define ELFOSABI_STANDALONE 255 /* STANDALONE operating system */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFABIVERSION* macros are the allowed values of e_ident[EI_ABIVERSION].
|
||||
============================================================================*/
|
||||
|
||||
#define ELFABI_HPUX_NONE 0 /* None specified */
|
||||
#define ELFABI_HPUX_REL11 1
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ET_* macros define the values of the e_type field of the ElfXX_Ehdr
|
||||
structure.
|
||||
============================================================================*/
|
||||
|
||||
#define ET_NONE 0 /* No file type */
|
||||
#define ET_REL 1 /* Relocatable file */
|
||||
#define ET_EXEC 2 /* Executable file */
|
||||
#define ET_DYN 3 /* Shared object file */
|
||||
#define ET_CORE 4 /* Core file */
|
||||
|
||||
#define ET_LOOS 0xfe00 /* OS-specific lowest value */
|
||||
#define ET_HIOS 0xfeff /* OS-specific highest value */
|
||||
|
||||
#define ET_LOPROC 0xff00 /* Processor-specific lowest value */
|
||||
#define ET_HIPROC 0xffff /* Processor-specific highest value */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The EV_* macros are the allowed values of the e_version field of
|
||||
ElfXX_Ehdr;
|
||||
============================================================================*/
|
||||
|
||||
#define EV_NONE 0 /* Invalid version */
|
||||
#define EV_CURRENT 1 /* Current version */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFMAG* macros are the values of e_ident[EI_MAG0-4]
|
||||
============================================================================*/
|
||||
|
||||
#define ELFMAG0 0x7f /* magic number, byte 0 */
|
||||
#define ELFMAG1 'E' /* magic number, byte 1 */
|
||||
#define ELFMAG2 'L' /* magic number, byte 2 */
|
||||
#define ELFMAG3 'F' /* magic number, byte 3 */
|
||||
#define ELFMAG "\177ELF" /* magic string */
|
||||
#define SELFMAG 4 /* magic string length */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Phdr - program header structure. Element of the array of
|
||||
program headers.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
Elf64_Word p_type; /* Type of segment */
|
||||
Elf64_Word p_flags; /* Segment attributes */
|
||||
Elf64_Off p_offset; /* Offset in file */
|
||||
Elf64_Addr p_vaddr; /* Virtual address in memory */
|
||||
Elf64_Addr p_paddr; /* Reserved */
|
||||
Elf64_Xword p_filesz; /* Size of segment in file */
|
||||
Elf64_Xword p_memsz; /* Size of segment in memory */
|
||||
Elf64_Xword p_align; /* Alignment of segment */
|
||||
} Elf64_Phdr;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word p_type; /* Type of segment */
|
||||
Elf32_Off p_offset; /* Offset in file */
|
||||
Elf32_Addr p_vaddr; /* Virtual address in memory */
|
||||
Elf32_Addr p_paddr; /* Reserved */
|
||||
Elf32_Xword p_filesz; /* Size of segment in file */
|
||||
Elf32_Xword p_memsz; /* Size of segment in memory */
|
||||
Elf32_Word p_flags; /* Segment attributes */
|
||||
Elf32_Xword p_align; /* Alignment of segment */
|
||||
} Elf32_Phdr;
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The PF_* macros are the segment flag bits in p_flags of ElfXX_Phdr.
|
||||
============================================================================*/
|
||||
|
||||
#define PF_X 0x1 /* Execute */
|
||||
#define PF_W 0x2 /* Write */
|
||||
#define PF_R 0x4 /* Read */
|
||||
|
||||
#define PF_MASKOS 0x0ff00000 /* OS-specific */
|
||||
|
||||
#define PF_MASKPROC 0xf0000000 /* Processor-specific */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The PT_* macros are the values of p_type in ElfXX_Phdr.
|
||||
============================================================================*/
|
||||
|
||||
#define PT_NULL 0 /* Array element is unused. Ignore. */
|
||||
#define PT_LOAD 1 /* Loadable segment. */
|
||||
#define PT_DYNAMIC 2 /* Dynamic Section */
|
||||
#define PT_INTERP 3 /* Section is a path to an interpreter */
|
||||
#define PT_NOTE 4 /* Note Section */
|
||||
#define PT_SHLIB 5 /* Currently unspecified semantics */
|
||||
#define PT_PHDR 6 /* Program header table. */
|
||||
|
||||
#define PT_LOOS 0x60000000 /* Lowest OS-specific type */
|
||||
#define PT_HIOS 0x6fffffff /* Highest OS-specific type */
|
||||
|
||||
#define PT_LOPROC 0x70000000 /* Lowest Processor-specific type */
|
||||
#define PT_HIPROC 0x7fffffff /* Highest Processor-specific type */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Shdr - structure for an ELF section header. Element of the array
|
||||
of section headers.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
Elf64_Word sh_name; /* Section name */
|
||||
Elf64_Word sh_type; /* Section type */
|
||||
Elf64_Xword sh_flags; /* Section attributes */
|
||||
Elf64_Addr sh_addr; /* Virtual address in memory */
|
||||
Elf64_Off sh_offset; /* Offset in file */
|
||||
Elf64_Xword sh_size; /* Size of section */
|
||||
Elf64_Word sh_link; /* Link to other section */
|
||||
Elf64_Word sh_info; /* Miscellaneous information */
|
||||
Elf64_Xword sh_addralign; /* Address alignment boundary */
|
||||
Elf64_Xword sh_entsize; /* Entry size, if section has table */
|
||||
} Elf64_Shdr;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word sh_name; /* Section name */
|
||||
Elf32_Word sh_type; /* Section type */
|
||||
Elf32_Xword sh_flags; /* Section attributes */
|
||||
Elf32_Addr sh_addr; /* Virtual address in memory */
|
||||
Elf32_Off sh_offset; /* Offset in file */
|
||||
Elf32_Xword sh_size; /* Size of section */
|
||||
Elf32_Word sh_link; /* Link to other section */
|
||||
Elf32_Word sh_info; /* Miscellaneous information */
|
||||
Elf32_Xword sh_addralign; /* Address alignment boundary*/
|
||||
Elf32_Xword sh_entsize; /* Entry size, if section has table */
|
||||
} Elf32_Shdr;
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELF_STRING_xxx macros are names of common sections
|
||||
============================================================================*/
|
||||
|
||||
#define ELF_STRING_bss ".bss"
|
||||
#define ELF_STRING_hbss ".hbss"
|
||||
#define ELF_STRING_sbss ".sbss"
|
||||
#define ELF_STRING_tbss ".tbss"
|
||||
#define ELF_STRING_data ".data"
|
||||
#define ELF_STRING_hdata ".hdata"
|
||||
#define ELF_STRING_sdata ".sdata"
|
||||
#define ELF_STRING_fini ".fini"
|
||||
#define ELF_STRING_init ".init"
|
||||
#define ELF_STRING_interp ".interp"
|
||||
#define ELF_STRING_rodata ".rodata"
|
||||
#define ELF_STRING_text ".text"
|
||||
#define ELF_STRING_comment ".comment"
|
||||
#define ELF_STRING_dynamic ".dynamic"
|
||||
#define ELF_STRING_dynstr ".dynstr"
|
||||
#define ELF_STRING_dynsym ".dynsym"
|
||||
#define ELF_STRING_dlt ".dlt"
|
||||
#define ELF_STRING_note ".note"
|
||||
#define ELF_STRING_opd ".opd"
|
||||
#define ELF_STRING_plt ".plt"
|
||||
#define ELF_STRING_bss_rela ".rela.bss"
|
||||
#define ELF_STRING_hbss_rela ".rela.hbss"
|
||||
#define ELF_STRING_data_rela ".rela.data"
|
||||
#define ELF_STRING_dlt_rela ".rela.dlt"
|
||||
#define ELF_STRING_plt_rela ".rela.plt"
|
||||
#define ELF_STRING_sdata_rela ".rela.sdata"
|
||||
#define ELF_STRING_strtab ".strtab"
|
||||
#define ELF_STRING_symtab ".symtab"
|
||||
#define ELF_STRING_hash ".hash"
|
||||
#define ELF_STRING_shstrtab ".shstrtab"
|
||||
#define ELF_STRING_shsymtab ".shsymtab"
|
||||
#define ELF_STRING_rela ".rela"
|
||||
#define ELF_STRING_rel ".rel"
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The SHF_* macros are the allowed values of the sh_flags field of
|
||||
ElfXX_Shdr. These 1-bit flags define attributes of a section.
|
||||
============================================================================*/
|
||||
|
||||
#define SHF_WRITE 0x1 /* Writable during execution */
|
||||
#define SHF_ALLOC 0x2 /* Occupies memory during execution */
|
||||
#define SHF_EXECINSTR 0x4 /* Contains executable instructions */
|
||||
|
||||
#define SHF_MASKPROC 0xf0000000 /* mask for processor-specific bits */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
SHN_* macros are reserved section header indices. An object file will
|
||||
not have sections for these special indices.
|
||||
============================================================================*/
|
||||
|
||||
#define SHN_UNDEF 0 /* undefined, e.g. undefined symbol */
|
||||
|
||||
#define SHN_LORESERVE 0xff00 /* Lower bound of reserved indices */
|
||||
|
||||
#define SHN_LOPROC 0xff00 /* Lower bound processor-specific index */
|
||||
#define SHN_HIPROC 0xff1f/* Upper bound processor-specific index */
|
||||
|
||||
#define SHN_LOOS 0xff20 /* Lower bound OS-specific index */
|
||||
#define SHN_HIOS 0xff3f /* Upper bound OS-specific index */
|
||||
|
||||
#define SHN_ABS 0xfff1 /* Absolute value, not relocated */
|
||||
#define SHN_COMMON 0xfff2/* FORTRAN common or unallocated C */
|
||||
|
||||
#define SHN_HIRESERVE 0xffff /* Upper bound of reserved indices */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
SHT_* macros are the values of sh_type in ElfXX_Shdr
|
||||
============================================================================*/
|
||||
|
||||
#define SHT_NULL 0 /* Inactive section header */
|
||||
#define SHT_PROGBITS 1 /* Information defined by the program */
|
||||
#define SHT_SYMTAB 2 /* Symbol table - not DLL */
|
||||
#define SHT_STRTAB 3 /* String table */
|
||||
#define SHT_RELA 4 /* Explicit addend relocations, Elf64_Rela */
|
||||
#define SHT_HASH 5 /* Symbol hash table */
|
||||
#define SHT_DYNAMIC 6 /* Information for dynamic linking */
|
||||
#define SHT_NOTE 7 /* A Note section */
|
||||
#define SHT_NOBITS 8 /* Like SHT_PROGBITS with no data */
|
||||
#define SHT_REL 9 /* Implicit addend relocations, Elf64_Rel */
|
||||
#define SHT_SHLIB 10 /* Currently unspecified semantics */
|
||||
#define SHT_DYNSYM 11 /* Symbol table for a DLL */
|
||||
|
||||
#define SHT_LOOS 0x60000000 /* Lowest OS-specific section type */
|
||||
#define SHT_HIOS 0x6fffffff /* Highest OS-specific section type */
|
||||
|
||||
#define SHT_LOPROC 0x70000000 /* Lowest processor-specific section type */
|
||||
#define SHT_HIPROC 0x7fffffff /* Highest processor-specific section type */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Sym - ELF symbol structure.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
Elf64_Word st_name; /* Symbol name */
|
||||
unsigned char st_info; /* Type and Binding attributes */
|
||||
unsigned char st_other; /* Reserved */
|
||||
Elf64_Half st_shndx; /* Section table index */
|
||||
Elf64_Addr st_value; /* Symbol value */
|
||||
Elf64_Xword st_size; /* Size of object (e.g., common) */
|
||||
} Elf64_Sym;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Word st_name; /* Symbol name */
|
||||
Elf32_Addr st_value; /* Symbol value */
|
||||
Elf32_Xword st_size; /* Size of object (e.g., common) */
|
||||
unsigned char st_info; /* Type and Binding attributes */
|
||||
unsigned char st_other; /* Reserved */
|
||||
Elf32_Half st_shndx; /* Section table index */
|
||||
} Elf32_Sym;
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFXX_ST_* macros operate on the st_info field of ElfXX_Sym
|
||||
to extract binding attributes, type information and how to build
|
||||
an st_info value from binding and type information.
|
||||
============================================================================*/
|
||||
|
||||
#define ELF64_ST_BIND(val) ((val) >> 4)
|
||||
#define ELF64_ST_TYPE(val) ((val) & 0xf)
|
||||
#define ELF64_ST_INFO(bind,type) (((bind) << 4) + ((type) & 0xf))
|
||||
|
||||
#define ELF32_ST_BIND(val) ((val) >> 4)
|
||||
#define ELF32_ST_TYPE(val) ((val) & 0xf)
|
||||
#define ELF32_ST_INFO(bind,type) (((bind) << 4) + ((type) & 0xf))
|
||||
|
||||
|
||||
/*============================================================================
|
||||
STN_UNDEF (zero) designeates the first entry in the symbol table and serves
|
||||
as the undefined symbol index.
|
||||
============================================================================*/
|
||||
|
||||
#define STN_UNDEF 0
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The STB_* macros are the defined values of the binding information part
|
||||
of st_info in ElfXX_Sym.
|
||||
============================================================================*/
|
||||
|
||||
#define STB_LOCAL 0 /* Local symbols */
|
||||
#define STB_GLOBAL 1 /* Globally visible symbols */
|
||||
#define STB_WEAK 2 /* Global symbols with lower precedence */
|
||||
|
||||
#define STB_LOOS 10 /* Lowest OS-specific value */
|
||||
#define STB_HIOS 12 /* Highest OS-specific value */
|
||||
|
||||
#define STB_LOPROC 13 /* Lowest processor-specific value */
|
||||
#define STB_HIPROC 15 /* Highest processor-specific value */
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
The STT_* macros are the allowed values of the type information part of
|
||||
st_info in ElfXX_Sym.
|
||||
============================================================================*/
|
||||
|
||||
#define STT_NOTYPE 0 /* Undefined symbol type */
|
||||
#define STT_OBJECT 1 /* A data object, variable, array, etc. */
|
||||
#define STT_FUNC 2 /* A function or other executable code */
|
||||
#define STT_SECTION 3 /* Symbol associated with a section */
|
||||
#define STT_FILE 4 /* Typically the name of the source file */
|
||||
|
||||
#define STT_LOOS 10 /* Lowest OS-specific symbol type */
|
||||
#define STT_HIOS 12 /* Highest OS-specific symbol type */
|
||||
|
||||
#define STT_LOPROC 13 /* Lowest processor-specific symbol type */
|
||||
#define STT_HIPROC 15 /* Highest processor-specific symbol type */
|
||||
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Rel - ELF relocation without an explicit addend.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
Elf64_Addr r_offset; /* Address of reference */
|
||||
Elf64_Xword r_info; /* Symbol index, relocation type */
|
||||
} Elf64_Rel;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Addr r_offset; /* Address of reference */
|
||||
Elf32_Xword r_info; /* Symbol index, reloc. type */
|
||||
} Elf32_Rel;
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Rela - ELF relocation with an explicit addend.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
Elf64_Addr r_offset; /* Address of reference */
|
||||
Elf64_Xword r_info; /* Symbol index, relocation type */
|
||||
Elf64_Sxword r_addend; /* Constant part of expression */
|
||||
} Elf64_Rela;
|
||||
|
||||
typedef struct {
|
||||
Elf32_Addr r_offset; /* Address of reference */
|
||||
Elf32_Xword r_info; /* Symbol index, reloc. type */
|
||||
Elf32_Sword r_addend; /* Constant part of expression */
|
||||
} Elf32_Rela;
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The ELFXX_R_* macros show how to extract the type and index parts
|
||||
of r_info in ElfXX_Rel and ElfXX_Rela and how to build r_info
|
||||
from a symbol index and type.
|
||||
============================================================================*/
|
||||
|
||||
#define ELF64_R_INFO(sym,type) \
|
||||
((((Elf64_Addr) (sym)) << 32) + ((Elf64_Addr) (type)))
|
||||
#define ELF64_R_SYM(info) \
|
||||
((Elf64_Sword) (((Elf64_Addr) (info)) >> 32))
|
||||
#define ELF64_R_TYPE(info) \
|
||||
((Elf64_Word) (((Elf64_Addr) (info)) & 0xffffffffLL))
|
||||
|
||||
#define ELF32_R_INFO(sym,type) (((sym) << 8) + ((unsigned char) (type)))
|
||||
#define ELF32_R_SYM(info) ((info) >> 8)
|
||||
#define ELF32_R_TYPE(info) ((unsigned char) (info))
|
||||
|
||||
|
||||
/*============================================================================
|
||||
ElfXX_Dyn - dynamic array entry.
|
||||
============================================================================*/
|
||||
|
||||
typedef struct {
|
||||
Elf32_Sword d_tag;
|
||||
union {
|
||||
Elf32_Word d_val; /* unsigned word */
|
||||
Elf32_Addr d_ptr; /* address */
|
||||
} d_un;
|
||||
} Elf32_Dyn;
|
||||
|
||||
extern Elf32_Dyn _DYNAMIC32[];
|
||||
|
||||
typedef struct {
|
||||
Elf64_Sxword d_tag;
|
||||
union {
|
||||
Elf64_Xword d_val; /* unsigned word */
|
||||
Elf64_Addr d_ptr; /* address */
|
||||
} d_un;
|
||||
} Elf64_Dyn;
|
||||
|
||||
extern Elf64_Dyn _DYNAMIC[];
|
||||
|
||||
|
||||
/*============================================================================
|
||||
The DT_* defines are the allowed values of d_tag in ElfXX_dyn.
|
||||
These are the Dynamic Array types.
|
||||
============================================================================*/
|
||||
|
||||
/* (i)gnore (m)andatory (o)ptional */
|
||||
/* d_un Exec DLL */
|
||||
/* ---- ---- --- */
|
||||
#define DT_NULL 0 /* ignored m m */
|
||||
#define DT_NEEDED 1 /* d_val o o */
|
||||
#define DT_PLTRELSZ 2 /* d_val o o */
|
||||
#define DT_PLTGOT 3 /* d_ptr o o */
|
||||
#define DT_HASH 4 /* d_ptr m m */
|
||||
#define DT_STRTAB 5 /* d_ptr m m */
|
||||
#define DT_SYMTAB 6 /* d_ptr m m */
|
||||
#define DT_RELA 7 /* d_ptr m o */
|
||||
#define DT_RELASZ 8 /* d_val m o */
|
||||
#define DT_RELAENT 9 /* d_val m o */
|
||||
#define DT_STRSZ 10 /* d_val m m */
|
||||
#define DT_SYMENT 11 /* d_val m m */
|
||||
#define DT_INIT 12 /* d_ptr o o */
|
||||
#define DT_FINI 13 /* d_ptr o o */
|
||||
#define DT_SONAME 14 /* d_val i o */
|
||||
#define DT_RPATH 15 /* d_val o i */
|
||||
#define DT_SYMBOLIC 16 /* ignored i o */
|
||||
#define DT_REL 17 /* d_ptr m o */
|
||||
#define DT_RELSZ 18 /* d_val m o */
|
||||
#define DT_RELENT 19 /* d_val m o */
|
||||
#define DT_PLTREL 20 /* d_val o o */
|
||||
#define DT_DEBUG 21 /* d_ptr o i */
|
||||
#define DT_TEXTREL 22 /* ignored o o */
|
||||
#define DT_JMPREL 23 /* d_ptr o o */
|
||||
#define DT_BIND_NOW 24 /* ignored */
|
||||
#define DT_INIT_ARRAY 25 /* d_ptr o o */
|
||||
#define DT_FINI_ARRAY 26 /* d_ptr o o */
|
||||
#define DT_INIT_ARRAYSZ 27 /* d_val o o */
|
||||
#define DT_FINI_ARRAYSZ 28 /* d_val o o */
|
||||
|
||||
#define DT_LOOS 0x60000000 /* unspecified - OS specific */
|
||||
#define DT_HIOS 0x6fffffff /* unspecified - OS specific */
|
||||
|
||||
#define DT_LOPROC 0x70000000 /* unspecified - processor specific */
|
||||
#define DT_HIPROC 0x7fffffff /* unspecified - processor specific */
|
||||
|
||||
|
||||
#ifndef _HP_NO_ELF_DEPRICATED
|
||||
|
||||
/* These defines have been depricated and will be removed in a future release.*/
|
||||
|
||||
#define ELFOSABI_NONE 0 /* None specified */
|
||||
#define ELFOSABI_NT 2 /* NT operating system */
|
||||
#define ELFOSABI_SCOUNIX 3 /* SCO UNIX operating system */
|
||||
#define SHF_COMDAT 0x8 /* Is a member of a COMDAT group */
|
||||
#define SHT_COMDAT 12 /* COMDAT group directory -> SHT_HP_COMDAT */
|
||||
|
||||
#endif /* ifndef _HP_NO_ELF_DEPRICATED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* ifndef _HP_NO_ELF_DEPRICATED */
|
||||
|
||||
#if defined(ELF_TARGET_ALL) || defined(ELF_TARGET_PARISC)
|
||||
#include <elf_parisc.h>
|
||||
#endif
|
||||
|
||||
#endif /* ELF_INCLUDED */
|
||||
@@ -1,80 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*============================================================================
|
||||
File: elftypes.h
|
||||
Include file for Elf types. Define elf types for Elf structures.
|
||||
Copyright Hewlett-Packard Co. 1995. All rights reserved.
|
||||
============================================================================*/
|
||||
|
||||
#ifndef ELFTYPES_INCLUDED
|
||||
#define ELFTYPES_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __LP64__
|
||||
typedef unsigned int Elf32_Addr; /* Unsigned program address */
|
||||
typedef unsigned int Elf32_Off; /* Unsigned file offset */
|
||||
typedef int Elf32_Sword; /* Signed large integer */
|
||||
typedef unsigned int Elf32_Xword; /* Unsigned large integer */
|
||||
#else
|
||||
typedef unsigned long Elf32_Addr; /* Unsigned program address */
|
||||
typedef unsigned long Elf32_Off; /* Unsigned file offset */
|
||||
typedef long Elf32_Sword; /* Signed large integer */
|
||||
typedef unsigned long Elf32_Xword; /* Unsigned large integer */
|
||||
#endif
|
||||
|
||||
typedef unsigned int Elf32_Word; /* Unsigned large integer */
|
||||
typedef unsigned short Elf32_Half; /* Unsigned medium integer */
|
||||
typedef unsigned char Elf32_Char; /* Unsigned tiny integer */
|
||||
typedef unsigned char Elf32_Byte; /* Unsigned tiny integer */
|
||||
|
||||
#ifdef __LP64__
|
||||
typedef unsigned long Elf64_Addr;
|
||||
typedef unsigned long Elf64_Off;
|
||||
typedef unsigned long Elf64_Xword;
|
||||
typedef long Elf64_Sxword;
|
||||
#else
|
||||
typedef unsigned long long Elf64_Addr;
|
||||
typedef unsigned long long Elf64_Off;
|
||||
typedef unsigned long long Elf64_Xword;
|
||||
typedef long long Elf64_Sxword;
|
||||
#endif
|
||||
|
||||
typedef unsigned short Elf64_Half;
|
||||
typedef int Elf64_Sword;
|
||||
typedef unsigned int Elf64_Word;
|
||||
typedef unsigned char Elf64_Byte; /* Unsigned tiny integer */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ELFTYPES_INCLUDED */
|
||||
Binary file not shown.
@@ -1,657 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
C Header file <updatefw.h> for updatefw tool.
|
||||
|
||||
K. Khalfallah, Aug, 2007
|
||||
kkhalfallah@free.fr
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <getopt.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <openair_device.h>
|
||||
|
||||
#include "elf.h"
|
||||
#include "elftypes.h"
|
||||
#define EM_SPARC 2
|
||||
#define MAX_SIZE_STRING_TABLE 1024
|
||||
#define MAX_SIZE_SECTION_NAME 32
|
||||
|
||||
#include "updatefw.h"
|
||||
|
||||
/* Interface with OpenAirInterface driver */
|
||||
#define DEVICE_NAME "/dev/openair0"
|
||||
#define ACCESS_MODE O_RDONLY
|
||||
|
||||
#define SWITCH_IS_OFF 0
|
||||
#define SWITCH_IS_ON 1
|
||||
static unsigned int helpflag = SWITCH_IS_OFF;
|
||||
static unsigned int pflag = SWITCH_IS_OFF;
|
||||
static unsigned int fflag = SWITCH_IS_OFF;
|
||||
static unsigned int sflag = SWITCH_IS_OFF;
|
||||
static unsigned int rebootflag = SWITCH_IS_OFF;
|
||||
static FILE* p_elfimage;
|
||||
static Elf32_Ehdr elf_Ehdr;
|
||||
static Elf32_Shdr elf_Shdr;
|
||||
long Shdr_pos, StringSec_pos, StringSec_size;
|
||||
//char section_name[MAX_SIZE_SECTION_NAME];
|
||||
char SecNameStnTable[MAX_SIZE_STRING_TABLE];
|
||||
unsigned int ioctl_params[4];
|
||||
|
||||
#define LONGOPTIONS_NB 5
|
||||
struct option updatefw_longopts[LONGOPTIONS_NB+1] = {
|
||||
{ .name = "help", .has_arg = no_argument, .flag = &helpflag, .val = SWITCH_IS_ON },
|
||||
{ .name = "firmware", .has_arg = required_argument, .flag = NULL, .val = 'f' },
|
||||
{ .name = "pretend", .has_arg = no_argument, .flag = &pflag, .val = SWITCH_IS_ON },
|
||||
{ .name = "stackptr", .has_arg = required_argument, .flag = NULL, .val = 's' },
|
||||
{ .name = "forcereboot", .has_arg = no_argument, .flag = &rebootflag, .val = SWITCH_IS_ON },
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
void show_usage(char* pgname)
|
||||
{
|
||||
unsigned int i;
|
||||
fprintf(stderr, " %s : Tool to update firmware of Cardbus-MIMO-1/Leon3 card through the PCI interface,\n", pgname);
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " that is, even without using the Xilinx parallel cable. The tool performs sequentially\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " the 5 following operations:\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " 1) Ask card driver to reboot (optionally)\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " 2) Ask card driver to transfer .text section\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " 3) Ask card driver to transfer .data section\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " 4) Ask card driver to clear .bss section\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " 5) Ask card driver to have Leon processor set stack-pointer\n");
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, " and jump to firmware entry.\n");
|
||||
fprintf(stderr, "Usage:\n");
|
||||
fprintf(stderr, " %s [-f|--firmware 'filename'] [-s|--stackptr value] [-b|--forcereboot]\n",pgname);
|
||||
fprintf(stderr, " ");
|
||||
|
||||
for (i=0; i<strlen(pgname); i++) fprintf(stderr, " ");
|
||||
|
||||
fprintf(stderr, "[-v|-vv|-vvv|-vvvv] [-h|--help] [-p|--pretend]\n\n");
|
||||
fprintf(stderr, " [-f|--firmware ] Mandatory option, to set the name of the executable file\n");
|
||||
fprintf(stderr, " of the firmware to update the remote card with.\n");
|
||||
fprintf(stderr, " The file should be an executable file in the Sparc32 ELF binary\n");
|
||||
fprintf(stderr, " format, containing at least the 3 mandatory sections .text, .data & .bss\n");
|
||||
fprintf(stderr, " [-s|--stackptr] Mandatory option, to set the value of the stack pointer before\n");
|
||||
fprintf(stderr, " giving hand to the firmware. The specified value must be an integer\n");
|
||||
fprintf(stderr, " number of 8 hexadecimal digits preceded by token '0x'.\n");
|
||||
fprintf(stderr, " [-b|--forcereboot] Force reboot of Leon processor before updating the firmware.\n");
|
||||
fprintf(stderr, " [-p|--pretend] Just pretend to transfer commands (ioctls) to driver, don't do it\n");
|
||||
fprintf(stderr, " actually. Useful together with verbose -vv switch.\n");
|
||||
fprintf(stderr, " [-v|-vv|-vvv|-vvvv] Verbose modes.\n");
|
||||
fprintf(stderr, " [-h|--help] Displays this help.\n");
|
||||
}
|
||||
|
||||
int get_elf_header(Elf32_Ehdr* p_Elf32_hdr, FILE* p_file)
|
||||
{
|
||||
int nbread;
|
||||
nbread = fread(p_Elf32_hdr, sizeof(elf_Ehdr), 1, p_file);
|
||||
|
||||
if (nbread != 1) {
|
||||
fprintf(stderr, "Error : while reading ELF header (fread() returned %d)\n", nbread);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
invert2(p_Elf32_hdr->e_type); /* $$$$KMK: bad code !!! Endianess dependant ! */
|
||||
invert2(p_Elf32_hdr->e_machine);
|
||||
invert4(p_Elf32_hdr->e_version);
|
||||
invert4(p_Elf32_hdr->e_entry);
|
||||
invert4(p_Elf32_hdr->e_phoff);
|
||||
invert4(p_Elf32_hdr->e_shoff);
|
||||
invert4(p_Elf32_hdr->e_flags);
|
||||
invert2(p_Elf32_hdr->e_ehsize);
|
||||
invert2(p_Elf32_hdr->e_phentsize);
|
||||
invert2(p_Elf32_hdr->e_phnum);
|
||||
invert2(p_Elf32_hdr->e_shentsize);
|
||||
invert2(p_Elf32_hdr->e_shnum);
|
||||
invert2(p_Elf32_hdr->e_shstrndx);
|
||||
return (p_Elf32_hdr->e_type == ET_EXEC)
|
||||
&& (p_Elf32_hdr->e_machine == EM_SPARC)
|
||||
&& (p_Elf32_hdr->e_version == EV_CURRENT)
|
||||
&& (p_Elf32_hdr->e_ident[EI_CLASS] == ELFCLASS32)
|
||||
&& (p_Elf32_hdr->e_ident[EI_DATA] == ELFDATA2MSB)
|
||||
&& (p_Elf32_hdr->e_ident[EI_VERSION] == EV_CURRENT);
|
||||
}
|
||||
|
||||
int get_elf_section_header(Elf32_Shdr* p_Elf32_Shdr, FILE* p_file, unsigned int section_ndx)
|
||||
{
|
||||
int nbread;
|
||||
/* retrieve the position of the section header table */
|
||||
fseek(p_file, Shdr_pos + (section_ndx * elf_Ehdr.e_shentsize), 0);
|
||||
/* set file pointer to the position of the section header section_ndx */
|
||||
// seekrst = fseek(p_file, (long), 0);
|
||||
nbread = fread(p_Elf32_Shdr, sizeof(elf_Shdr), 1, p_file);
|
||||
|
||||
if (nbread != 1) {
|
||||
fprintf(stderr, "Error : while reading elf section header (fread() returned %d)\n", nbread);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
invert4(p_Elf32_Shdr->sh_name); /* $$$$KMK: bad code !!! Endianess dependant ! */
|
||||
invert4(p_Elf32_Shdr->sh_type);
|
||||
invert4(p_Elf32_Shdr->sh_flags);
|
||||
invert4(p_Elf32_Shdr->sh_addr);
|
||||
invert4(p_Elf32_Shdr->sh_offset);
|
||||
invert4(p_Elf32_Shdr->sh_size);
|
||||
invert4(p_Elf32_Shdr->sh_link);
|
||||
invert4(p_Elf32_Shdr->sh_info);
|
||||
invert4(p_Elf32_Shdr->sh_addralign);
|
||||
invert4(p_Elf32_Shdr->sh_entsize);
|
||||
//fseek(p_file, StringSec_pos + p_Elf32_Shdr->sh_name, 0);
|
||||
//fread();
|
||||
//strcpy(sname, );
|
||||
return nbread;
|
||||
}
|
||||
|
||||
void find_and_transfer_section(char* section_name, unsigned int verboselevel)
|
||||
{
|
||||
/* Interface with driver */
|
||||
int ioctlretval;
|
||||
int ifile;
|
||||
char* section_content;
|
||||
int nbread;
|
||||
unsigned int secnb = 0;
|
||||
|
||||
for (secnb = 0 ; secnb < elf_Ehdr.e_shnum; secnb++) {
|
||||
get_elf_section_header(&elf_Shdr, p_elfimage, secnb);
|
||||
|
||||
if (!strcmp(SecNameStnTable + elf_Shdr.sh_name, section_name)) {
|
||||
if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS)
|
||||
printf("Info: ok, found section %s (as section nb. %d)\n", SecNameStnTable + elf_Shdr.sh_name, secnb);
|
||||
|
||||
/* Check that section size is a multiple of 4 bytes. */
|
||||
if (elf_Shdr.sh_size % 4) {
|
||||
fprintf(stderr, "Error: section %s has a non-multiple-of-4-bytes size (%d).\n",
|
||||
SecNameStnTable + elf_Shdr.sh_name, elf_Shdr.sh_size);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS) {
|
||||
printf("Info: ok, section %s has size %d bytes (multiple of 4 bytes).\n",
|
||||
SecNameStnTable + elf_Shdr.sh_name, elf_Shdr.sh_size);
|
||||
}
|
||||
|
||||
/* Dynamically allocate a chunk of memory to store the section into. */
|
||||
section_content = (char*)malloc(elf_Shdr.sh_size);
|
||||
|
||||
if (!section_content) {
|
||||
fprintf(stderr, "Error: could not dynamically allocate %d bytes for section %s.\n",
|
||||
elf_Shdr.sh_size, SecNameStnTable + elf_Shdr.sh_name);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, dynamically allocated a %d bytes buffer for section %s.\n",
|
||||
elf_Shdr.sh_size, SecNameStnTable + elf_Shdr.sh_name);
|
||||
}
|
||||
|
||||
/* Position the file cursor at the begining of proper section. */
|
||||
fseek(p_elfimage, (long)(elf_Shdr.sh_offset), 0);
|
||||
/* Copy the section's content into this temporary buffer. */
|
||||
nbread = fread(section_content, elf_Shdr.sh_size, 1, p_elfimage);
|
||||
|
||||
if (nbread != 1) {
|
||||
fprintf(stderr, "Error: could not read %d bytes from ELF file into dynamic buffer.\n", elf_Shdr.sh_size);
|
||||
free(section_content);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, copied content of section %s into dynamic buffer (%d bytes copied).\n",
|
||||
SecNameStnTable + elf_Shdr.sh_name, elf_Shdr.sh_size);
|
||||
}
|
||||
|
||||
/* Open the special device file. */
|
||||
if (!pflag) {
|
||||
ifile = open(DEVICE_NAME, ACCESS_MODE, 0);
|
||||
|
||||
if (ifile<0) {
|
||||
fprintf(stderr, "Error: could not open %s (open() returned %d, errno=%u)\n", DEVICE_NAME, ifile, errno);
|
||||
free(section_content);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successfully opened %s.\n", DEVICE_NAME);
|
||||
}
|
||||
|
||||
/* Collect control data for ioctl. */
|
||||
ioctl_params[0] = UPDATE_FIRMWARE_TRANSFER_BLOCK;
|
||||
ioctl_params[1] = elf_Shdr.sh_addr;
|
||||
ioctl_params[2] = elf_Shdr.sh_size / 4;
|
||||
ioctl_params[3] = (unsigned int)((unsigned int*)section_content);
|
||||
//invert4(ioctl_params[1]);
|
||||
//invert4(ioctl_params[2]);
|
||||
/* Call ioctl driver */
|
||||
ioctlretval = ioctl(ifile, openair_UPDATE_FIRMWARE, ioctl_params);
|
||||
|
||||
if (ioctlretval) {
|
||||
fprintf(stderr, "Error: ioctl on %s failed.\n", DEVICE_NAME);
|
||||
close(ifile);
|
||||
free(section_content);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successful ioctl on %s for section %s.\n",
|
||||
DEVICE_NAME, SecNameStnTable + elf_Shdr.sh_name);
|
||||
}
|
||||
|
||||
close(ifile);
|
||||
} /* pflag */
|
||||
|
||||
free(section_content);
|
||||
} /* section_name */
|
||||
} /* for secnb */
|
||||
}
|
||||
|
||||
void find_and_clear_section_bss(unsigned int verboselevel)
|
||||
{
|
||||
/* Interface with driver */
|
||||
int ioctlretval;
|
||||
int ifile;
|
||||
unsigned int secnb = 0;
|
||||
|
||||
for (secnb = 0 ; secnb < elf_Ehdr.e_shnum; secnb++) {
|
||||
get_elf_section_header(&elf_Shdr, p_elfimage, secnb);
|
||||
|
||||
if (!strcmp(SecNameStnTable + elf_Shdr.sh_name, ".bss")) {
|
||||
if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS)
|
||||
printf("Info: ok, found section %s (as section nb. %d)\n", SecNameStnTable + elf_Shdr.sh_name, secnb);
|
||||
|
||||
/* Open the special device file. */
|
||||
if (!pflag) {
|
||||
ifile = open(DEVICE_NAME, ACCESS_MODE, 0);
|
||||
|
||||
if (ifile<0) {
|
||||
fprintf(stderr, "Error: could not open %s (open() returned %d, errno=%u)\n", DEVICE_NAME, ifile, errno);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successfully opened %s.\n", DEVICE_NAME);
|
||||
}
|
||||
|
||||
/* Collect control data for ioctl. */
|
||||
ioctl_params[0] = UPDATE_FIRMWARE_CLEAR_BSS;
|
||||
ioctl_params[1] = elf_Shdr.sh_addr;
|
||||
ioctl_params[2] = elf_Shdr.sh_size;
|
||||
//invert4(ioctl_params[1]);
|
||||
//invert4(ioctl_params[2]);
|
||||
/* Call ioctl driver */
|
||||
ioctlretval = ioctl(ifile, openair_UPDATE_FIRMWARE, ioctl_params);
|
||||
|
||||
if (ioctlretval) {
|
||||
fprintf(stderr, "Error: ioctl on %s failed.\n", DEVICE_NAME);
|
||||
close(ifile);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successful ioctl on %s for section %s.\n",
|
||||
DEVICE_NAME, SecNameStnTable + elf_Shdr.sh_name);
|
||||
}
|
||||
|
||||
close(ifile);
|
||||
} /* pflag */
|
||||
} /* section_name */
|
||||
} /* for secnb */
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
/* Interface with driver */
|
||||
int ioctlretval;
|
||||
int ifile;
|
||||
/* Interface with getopt_long() libC function */
|
||||
int getoptret;
|
||||
int indexptr;
|
||||
int erroroption = FALSE;
|
||||
char* p_str_fwn = NULL;
|
||||
char* p_str_stkptr = NULL;
|
||||
char* filename;
|
||||
unsigned int verboselevel = 0;
|
||||
unsigned int i;
|
||||
char* c;
|
||||
unsigned int stackpointer = 0;
|
||||
unsigned int ioctl_test_gok = 0;
|
||||
|
||||
/*****************
|
||||
* Parse options *
|
||||
*****************/
|
||||
while ((getoptret = getopt_long_only (argc, argv, "f:vhps:b", updatefw_longopts, &indexptr)) != -1)
|
||||
switch (getoptret) {
|
||||
/* Without-argument options */
|
||||
case 0: /* means that the option just sets a flag. Nothing has to be done,
|
||||
since getopt_long already sets the flag. */
|
||||
break;
|
||||
|
||||
/* With-argument options & equivalent short options */
|
||||
case 'v':
|
||||
verboselevel++;
|
||||
break;
|
||||
|
||||
case 'h': /* short switch -h was used */
|
||||
helpflag = SWITCH_IS_ON;
|
||||
break;
|
||||
|
||||
case 'p': /* short switch -p was used */
|
||||
pflag = SWITCH_IS_ON;
|
||||
break;
|
||||
|
||||
case 'f': /* short switch -f was used */
|
||||
fflag = SWITCH_IS_ON;
|
||||
p_str_fwn = optarg;
|
||||
break;
|
||||
|
||||
case 's': /* short switch -s was used */
|
||||
sflag = SWITCH_IS_ON;
|
||||
p_str_stkptr = optarg;
|
||||
break;
|
||||
|
||||
case 'b': /* short switch -b was used */
|
||||
rebootflag = SWITCH_IS_ON;
|
||||
break;
|
||||
|
||||
default:
|
||||
erroroption = TRUE;
|
||||
break;
|
||||
};
|
||||
|
||||
/* End of while */
|
||||
|
||||
/********************************
|
||||
* Check consistency of options *
|
||||
********************************/
|
||||
/* First, any irregularity in the use of the options ? Leave. */
|
||||
if (erroroption == TRUE) {
|
||||
fprintf(stderr, "%s: Misuse (--help to show usage)\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Let print the help if it has been explicitly asked for */
|
||||
if (helpflag == SWITCH_IS_ON) {
|
||||
show_usage(argv[0]);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Check that mandatory firmware option was specified */
|
||||
if (fflag != SWITCH_IS_ON) {
|
||||
fprintf(stderr, "%s: missing mandatory [-f|--firmware] option (--help to show usage).\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Check that mandatory stack pointer option was specified */
|
||||
if (sflag != SWITCH_IS_ON) {
|
||||
fprintf(stderr, "%s: missing mandatory [-s|--stackptr] option (--help to show usage).\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Check consistency of stack pointer value. */
|
||||
/* 1/2 - The address must start with the 2 characters '0x' and be exactly 10 characters long. */
|
||||
if ((strncmp(p_str_stkptr, "0x", 2)) || (strlen(p_str_stkptr) != 10)) { /* 10 is for 0x + 8 hex digits. */
|
||||
fprintf(stderr, "%s: Invalid value to [s|--stackptr] option (--help to show usage).\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* 2/2 - The address must only be made of hexadecimal digits. */
|
||||
for (i=0,c=p_str_stkptr+2; i < 8 ; i++,c++) {
|
||||
if (!
|
||||
( ((*c >= '0') && (*c <= '9'))
|
||||
|| ((*c >= 'a') && (*c <= 'f'))
|
||||
|| ((*c >= 'A') && (*c <= 'F'))
|
||||
)
|
||||
) {
|
||||
fprintf(stderr, "%s: Invalid value to [s|--stackptr] option (--help to show usage).\n", argv[0]);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Transcode string hexadecinmal value into binary value */
|
||||
if ((*c <= '9') && (*c >= '0'))
|
||||
stackpointer |= (*c - '0') << 28-(i*4);
|
||||
else if ((*c <= 'F') && (*c >= 'A'))
|
||||
stackpointer |= ((*c - 'A') + 10) << 28-(i*4);
|
||||
else if ((*c <= 'f') && (*c >= 'a'))
|
||||
stackpointer |= ((*c - 'a') + 10) << 28-(i*4);
|
||||
}
|
||||
|
||||
/* Open firmware file in READ_ONLY mode. */
|
||||
filename = p_str_fwn;
|
||||
p_elfimage = fopen(filename, READ_FILE_MODE);
|
||||
|
||||
if (p_elfimage == NULL) {
|
||||
fprintf(stderr, "Error : could not open file <%s> in %s mode.\n", filename, READ_FILE_MODE);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_ACCESS_FILES)
|
||||
printf("Info: using file <%s> (successfully opened in %s mode).\n", filename, READ_FILE_MODE);
|
||||
|
||||
/* Read elf binary image file */
|
||||
/* Get informations from header file */
|
||||
if (!(get_elf_header(&elf_Ehdr, p_elfimage))) {
|
||||
fprintf(stderr, "Error : file doesn't match expected format.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_ACCESS_FILES)
|
||||
printf("Info: ok, file matches expected format.\n");
|
||||
|
||||
/* record the position of the section header table in the file */
|
||||
fseek(p_elfimage, (long)(elf_Ehdr.e_shoff), 0);
|
||||
Shdr_pos = ftell(p_elfimage);
|
||||
/* record the position of the section name string table */
|
||||
get_elf_section_header(&elf_Shdr, p_elfimage, elf_Ehdr.e_shstrndx);
|
||||
fseek(p_elfimage, (long)(elf_Shdr.sh_offset), 0);
|
||||
StringSec_pos = ftell(p_elfimage);
|
||||
StringSec_size = elf_Shdr.sh_size;
|
||||
|
||||
/* copy the string table into global variable */
|
||||
if (StringSec_size > MAX_SIZE_STRING_TABLE) {
|
||||
fprintf(stderr, "Error: section name string table too big (%d > %d);"
|
||||
" increase max. allowed value in source code and recompile\n",
|
||||
StringSec_size, MAX_SIZE_STRING_TABLE);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
fread(SecNameStnTable, 1, StringSec_size, p_elfimage);
|
||||
|
||||
/* Action 1: force reboot (if option was specified) */
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) {
|
||||
if (rebootflag == SWITCH_IS_ON)
|
||||
printf("Info: entering action #1 (forcing reboot of Leon).\n");
|
||||
else
|
||||
printf("Info: squeezed action #1 (forcing reboot of Leon).\n");
|
||||
}
|
||||
|
||||
if ((rebootflag == SWITCH_IS_ON) && (!pflag)) {
|
||||
ifile = open(DEVICE_NAME, ACCESS_MODE, 0);
|
||||
|
||||
if (ifile<0) {
|
||||
fprintf(stderr, "Error: could not open %s (open() returned %d, errno=%u).\n", DEVICE_NAME, ifile, errno);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successfully opened %s.\n", DEVICE_NAME);
|
||||
}
|
||||
|
||||
ioctl_params[0] = UPDATE_FIRMWARE_FORCE_REBOOT;
|
||||
/* Call ioctl driver */
|
||||
ioctlretval = ioctl(ifile, openair_UPDATE_FIRMWARE, ioctl_params);
|
||||
|
||||
if (ioctlretval) {
|
||||
fprintf(stderr, "Error: ioctl on %s failed.\n", DEVICE_NAME);
|
||||
close(ifile);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successful ioctl on %s to force reboot.\n", DEVICE_NAME);
|
||||
}
|
||||
|
||||
/* If the card received the boot order, then
|
||||
1) The firmware who handled the order must have cleared the BOOT_GOK bit
|
||||
before rebooting ;
|
||||
2) Boot-strap should once again set it back upon its init operations.
|
||||
So we wait for this bit to be set again before issuing the rest of the
|
||||
update-firmware operations (transfer loadable sections and so on...).
|
||||
Note: putting the polling loop here is better than to have it in the
|
||||
openair driver, because it avoids hanging the kernel if the card was
|
||||
ever not to reboot cleanly. If the loop was to not end, user can simply
|
||||
gives up the update-firmware operation by issuing a Ctrl-C. */
|
||||
ioctl_params[0] = UPDATE_FIRMWARE_TEST_GOK;
|
||||
|
||||
/* Call ioctl driver */
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS)
|
||||
printf("Info: waiting for GOK bit (as acknowledge of reboot command) - May take a few seconds...\n");
|
||||
|
||||
ioctl_test_gok = 0;
|
||||
|
||||
do {
|
||||
ioctlretval = ioctl(ifile, openair_UPDATE_FIRMWARE, ioctl_params);
|
||||
ioctl_test_gok++;
|
||||
sleep(1); /* sleep 1 second */
|
||||
|
||||
if (!(ioctl_test_gok % 10))
|
||||
printf("Warning: card does not seem to have rebooted cleanly (no GOK bit). Still trying ([Ctrl-C] to abort).\n");
|
||||
} while (ioctlretval);
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_IOCTL)
|
||||
printf("Info: ok, card set again GOK bit (after %u seconds).\n", ioctl_test_gok);
|
||||
|
||||
close(ifile);
|
||||
} /* rebootflag && pflag */
|
||||
|
||||
if ((verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) && (rebootflag == SWITCH_IS_ON))
|
||||
printf("Info: action #1 done.\n");
|
||||
|
||||
/* Action 2: Find the .text section */
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: entering action #2 (Transfer .text section).\n");
|
||||
|
||||
find_and_transfer_section(".text", verboselevel);
|
||||
sleep(1);
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: action #2 done.\n");
|
||||
|
||||
/* Action 3 : Find the .data section */
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: entering action #3 (Transfer .data section).\n");
|
||||
|
||||
find_and_transfer_section(".data", verboselevel);
|
||||
sleep(1);
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: action #3 done.\n");
|
||||
|
||||
/* Action 4 : Find the .bss section */
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: entering action #4 (Clear .bss section).\n");
|
||||
|
||||
find_and_clear_section_bss(verboselevel);
|
||||
sleep(1);
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: action #4 done.\n");
|
||||
|
||||
/* Action 5 : Find the entry address */
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: entering action #5 (Jump to firmware/set stack-pointer).\n");
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_SECTION_DETAILS)
|
||||
printf("Info: Firmware entry point = 0x%08x, setting stack pointer = 0x%08x.\n", elf_Ehdr.e_entry, stackpointer);
|
||||
|
||||
/* Open the special device file. */
|
||||
if (!pflag) {
|
||||
ifile = open(DEVICE_NAME, ACCESS_MODE, 0);
|
||||
|
||||
if (ifile<0) {
|
||||
fprintf(stderr, "Error: could not open %s (open() returned %d, errno=%u).\n", DEVICE_NAME, ifile, errno);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successfully opened %s.\n", DEVICE_NAME);
|
||||
}
|
||||
|
||||
/* Collect control data for ioctl. */
|
||||
ioctl_params[0] = UPDATE_FIRMWARE_START_EXECUTION;
|
||||
ioctl_params[1] = elf_Ehdr.e_entry;
|
||||
ioctl_params[2] = stackpointer;
|
||||
//invert4(ioctl_params[1]);
|
||||
//invert4(ioctl_params[2]);
|
||||
/* Call ioctl driver */
|
||||
ioctlretval = ioctl(ifile, openair_UPDATE_FIRMWARE, ioctl_params);
|
||||
|
||||
if (ioctlretval) {
|
||||
fprintf(stderr, "Error: ioctl on %s failed.\n", DEVICE_NAME);
|
||||
close(ifile);
|
||||
fclose(p_elfimage);
|
||||
exit(-1);
|
||||
} else if (verboselevel >= VERBOSE_LEVEL_IOCTL) {
|
||||
printf("Info: ok, successful ioctl on %s for stack-pointer setting/firmware-execution.\n", DEVICE_NAME);
|
||||
}
|
||||
|
||||
close(ifile);
|
||||
} /* pflag */
|
||||
|
||||
if (verboselevel >= VERBOSE_LEVEL_MAIN_STEPS) printf("Info: action #5 done.\n");
|
||||
|
||||
fclose(p_elfimage);
|
||||
|
||||
/* Did we pretend ? */
|
||||
if (pflag) printf("Nothing done.\n");
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*******************************************************************************
|
||||
OpenAirInterface
|
||||
Copyright(c) 1999 - 2014 Eurecom
|
||||
|
||||
OpenAirInterface is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
|
||||
OpenAirInterface is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenAirInterface.The full GNU General Public License is
|
||||
included in this distribution in the file called "COPYING". If not,
|
||||
see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Contact Information
|
||||
OpenAirInterface Admin: openair_admin@eurecom.fr
|
||||
OpenAirInterface Tech : openair_tech@eurecom.fr
|
||||
OpenAirInterface Dev : openair4g-devel@eurecom.fr
|
||||
|
||||
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
|
||||
|
||||
*******************************************************************************/
|
||||
/*
|
||||
C Header file <updatefw.h> for updatefw tool.
|
||||
|
||||
K. Khalfallah, Aug, 2007
|
||||
kkhalfallah@free.fr
|
||||
*/
|
||||
|
||||
#ifndef UPDATEFW_H
|
||||
#define UPDATEFW_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#define _testsyscall(x, y, z) {if (x==-1) { \
|
||||
fprintf(stderr, "Error : %s() returned "z" (errno=%d)\n", y, x, errno); \
|
||||
fprintf(stderr, "Warning : not leaving normally. Remove ipc ressources by hand !"); \
|
||||
fprintf(stderr, " (use shell commands ipcs & ipcrm)\n"); \
|
||||
exit(-1); \
|
||||
}}
|
||||
// else { \
|
||||
// printf("Info : successfully called %s, returned "z"\n", y, x);}}
|
||||
|
||||
/* Intel is little-endian, sparc is big */
|
||||
unsigned long ltmp;
|
||||
#define invert4(x) {ltmp=x; x=((ltmp & 0xff)<<24) | ((ltmp & 0xff00)<<8) | \
|
||||
((ltmp & 0xff0000)>>8) | ((ltmp & 0xff000000)>>24); }
|
||||
unsigned short stmp;
|
||||
#define invert2(x) {stmp=x; x=((stmp & 0xff)<< 8) | ((stmp & 0xff00)>>8);}
|
||||
|
||||
|
||||
/* static variables, global */
|
||||
char* virt_addr;
|
||||
unsigned int packet_ndx = 0;
|
||||
|
||||
#define FSEEK_ORIGIN 0
|
||||
#define FSEEK_CURRENT 1
|
||||
#define READ_FILE_MODE "r"
|
||||
/* Verbose levels */
|
||||
#define VERBOSE_LEVEL_MAIN_STEPS 1
|
||||
#define VERBOSE_LEVEL_ACCESS_FILES 2
|
||||
#define VERBOSE_LEVEL_SECTION_DETAILS 3
|
||||
#define VERBOSE_LEVEL_IOCTL 4
|
||||
|
||||
|
||||
#endif /* UPDATEFW_H */
|
||||
@@ -1,100 +0,0 @@
|
||||
function [ratio,phi_est]=IQ_estimation(freq)
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
sme=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu (for SME)
|
||||
gpib_send(gpib_card,sme,'*RST;*CLS'); % reset and configure the signal generator
|
||||
sleep(.1);
|
||||
gpib_send(gpib_card,sme,'POW -63dBm');
|
||||
disp(freq)
|
||||
gpib_send(gpib_card,sme,strcat('FREQ ',int2str(freq),'MHz'));
|
||||
gpib_send(gpib_card,sme,'OUTP:STAT ON'); % activate output
|
||||
|
||||
cmd1='/homes/nussbaum/openair1/ARCH/LEON3/hostpc/user/tools/scripts/set_receiver -M ';
|
||||
gain1=61;
|
||||
gain2=61;
|
||||
frequency=int2str(freq);
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
system(cmd);
|
||||
sleep(.1);
|
||||
s=oarf_get_frame(0);
|
||||
signal=s(:,1);
|
||||
|
||||
|
||||
size_data=20480;
|
||||
Fs=7680; %in kHz
|
||||
band = 2000; %in kHz
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
if(abs(freq_max-2000)>100)
|
||||
disp('Warning')
|
||||
end;
|
||||
|
||||
cumI=0;
|
||||
cumQ=0;
|
||||
|
||||
I=real(signal(1:2000));
|
||||
Q=imag(signal(1:2000));
|
||||
|
||||
for i=1:2000
|
||||
cumI=cumI + I(i)*I(i);
|
||||
cumQ=cumQ + Q(i)*Q(i);
|
||||
end;
|
||||
amp= sqrt(2*cumI/length(I))
|
||||
I=I/amp;
|
||||
Q=Q/amp;
|
||||
ratio=sqrt(cumI/cumQ)
|
||||
n_fft=1024;
|
||||
f=abs(fft(I(1:n_fft)));
|
||||
max = 0;
|
||||
index=0;
|
||||
for i=1:n_fft/2
|
||||
if f(i)> max
|
||||
max=f(i);
|
||||
index=i;
|
||||
end;
|
||||
end;
|
||||
disp(max)
|
||||
disp(index)
|
||||
%figure
|
||||
%plot(20*log10(abs(f)));
|
||||
freq_estim=(index-1)/n_fft;
|
||||
p=Q*ratio.*I;
|
||||
sinphi=2*sum(p)/length(Q);
|
||||
phi_est=-asin(sinphi)
|
||||
Qcor=(sin(phi_est)*I+ratio*Q)/cos(phi_est);
|
||||
%figure
|
||||
%plot(I(1:100))
|
||||
%hold on
|
||||
%plot(Qcor(1:100),'g');
|
||||
comp=I+j*Qcor;
|
||||
%hold off
|
||||
%figure
|
||||
%plot(20*log10(abs(fft(comp))));
|
||||
endfunction;
|
||||
% per=round(1/freq_estim)
|
||||
% figure;plot(I(1:per+1))
|
||||
% opt_offset=-5
|
||||
% min_diff=10^20;
|
||||
% for offset=0:per
|
||||
% diff=0;
|
||||
% for k=1:n_fft
|
||||
% diff=diff+abs(I(k+offset)-Q(k));
|
||||
% end;
|
||||
% if diff<min_diff
|
||||
% min_diff=diff;
|
||||
% opt_offset= offset;
|
||||
% end;
|
||||
% end;
|
||||
% disp(opt_offset)
|
||||
% % normally, as to be 3/4*per
|
||||
% opt_offset=opt_offset-3*per/4;
|
||||
% disp(opt_offset/per*2*pi)
|
||||
@@ -1,42 +0,0 @@
|
||||
s = oarf_get_frame(2);
|
||||
sig0 = s(:,1);
|
||||
sig1 = s(:,2);
|
||||
|
||||
sig0 = s(5000:end,1); % first channel
|
||||
sig1 = s(5000:end,2); % 2nd channel
|
||||
|
||||
|
||||
bw=7.68e6;
|
||||
|
||||
spec = abs(fft(sig1)).^2;
|
||||
[a,b] = max(spec);
|
||||
freq = (b-1)*bw/length(sig0);
|
||||
|
||||
L= 1000;
|
||||
W = 1;
|
||||
|
||||
offset_vec = (0:L-1)*((2*W)+1);
|
||||
W2 = 1+(2*W);
|
||||
|
||||
window_vec = (-W : W);
|
||||
pn = zeros(1,(2*L) - 1);
|
||||
for i = 1:L,
|
||||
pn(i+L-1) = sum(spec(offset_vec(i) + b + window_vec));
|
||||
end
|
||||
|
||||
for i = 2:L,
|
||||
pn(L-i+1) = sum(spec(-offset_vec(i) + b + window_vec));
|
||||
end
|
||||
|
||||
pn_2 = 20*log10(pn / pn(L)) - 10*log10(W2*bw/length(sig0));
|
||||
|
||||
f = ((-L+1):(L-1))*W2*bw/length(sig0);
|
||||
|
||||
|
||||
ylabel('dBc/Hz')
|
||||
xlabel("f_offset (Hz)")
|
||||
title("Phase Noise @ IQ output for Fc = 1912.6 + Fs/4 MHz CW input at antenna")
|
||||
semilogx(f(L:(2*L - 1)),pn_2(L:(2*L -1)))
|
||||
|
||||
|
||||
sum(pn.^2*(f(2)-f(1)))
|
||||
@@ -1,48 +0,0 @@
|
||||
|
||||
closeplot
|
||||
figure(1)
|
||||
|
||||
|
||||
gain2391=70; gain9862=0;
|
||||
for rxrfmode=0:2
|
||||
i=find( (m(:,2)==gain2391) & (m(:,3)==gain9862) & (m(:,4)==rxrfmode));
|
||||
plot(m(i,1),m(i,5:8))
|
||||
pause
|
||||
end
|
||||
|
||||
|
||||
gain2391=70; rxrfmode=1;
|
||||
for gain9862=0:5:15
|
||||
i=find((m(:,2)==gain2391) & (m(:,3)==gain9862) & (m(:,4)==rxrfmode));
|
||||
plot(m(i,1),m(i,5:8))
|
||||
pause
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
rxrfmode=1; power_dBm=-70;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
plot(m(i,1),m(i,5:8))
|
||||
pause
|
||||
end
|
||||
|
||||
|
||||
|
||||
power_dBm=-90;
|
||||
|
||||
subplot(1,3,1)
|
||||
rxrfmode=0;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
mesh(0:10:150,[0 5 10 15],reshape(m(i,5)-m(i,6),4,16))
|
||||
|
||||
subplot(1,3,2)
|
||||
rxrfmode=1;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
mesh(0:10:150,[0 5 10 15],reshape(m(i,5)-m(i,6),4,16))
|
||||
|
||||
subplot(1,3,3)
|
||||
rxrfmode=2;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
mesh(0:10:150,[0 5 10 15],reshape(m(i,5)-m(i,6),4,16))
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
|
||||
closeplot
|
||||
figure(1);
|
||||
|
||||
|
||||
%for power_dBm=ALL_power_dBm
|
||||
for power_dBm=-65
|
||||
|
||||
disp(['input: ' num2str(power_dBm) ' dBm']);
|
||||
|
||||
xlabel('Gain 2391');
|
||||
ylabel('Gain 9862');
|
||||
zlabel('SNR');
|
||||
|
||||
rxrfmode=0;
|
||||
idx=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
M0=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
M1=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
for i=idx.'
|
||||
i1=find(ALL_gain2391==m(i,2));
|
||||
i2=find(ALL_gain9862==m(i,3));
|
||||
M0(i1,i2)=m(i,5)-m(i,6);
|
||||
M1(i1,i2)=m(i,7)-m(i,8);
|
||||
end
|
||||
subplot(2,3,1); clg;
|
||||
title('Channel 0, rxrfmode 0');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M0.')
|
||||
subplot(2,3,4); clg;
|
||||
title('Channel 1, rxrfmode 0');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M1.')
|
||||
|
||||
rxrfmode=1;
|
||||
idx=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
M0=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
M1=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
for i=idx.'
|
||||
i1=find(ALL_gain2391==m(i,2));
|
||||
i2=find(ALL_gain9862==m(i,3));
|
||||
M0(i1,i2)=m(i,5)-m(i,6);
|
||||
M1(i1,i2)=m(i,7)-m(i,8);
|
||||
end
|
||||
subplot(2,3,2); clg;
|
||||
title('Channel 0, rxrfmode 1');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M0.')
|
||||
subplot(2,3,5); clg;
|
||||
title('Channel 1, rxrfmode 1');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M1.')
|
||||
|
||||
rxrfmode=2;
|
||||
idx=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
M0=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
M1=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
for i=idx.'
|
||||
i1=find(ALL_gain2391==m(i,2));
|
||||
i2=find(ALL_gain9862==m(i,3));
|
||||
M0(i1,i2)=m(i,5)-m(i,6);
|
||||
M1(i1,i2)=m(i,7)-m(i,8);
|
||||
end
|
||||
subplot(2,3,3); clg;
|
||||
title('Channel 0, rxrfmode 2');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M0.')
|
||||
subplot(2,3,6); clg;
|
||||
title('Channel 1, rxrfmode 2');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M1.')
|
||||
|
||||
pause
|
||||
|
||||
end
|
||||
@@ -1,109 +0,0 @@
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
% script to setup mxa and sign generator
|
||||
|
||||
size_data=20480;
|
||||
Fs=7680; %sampling freq in kHz
|
||||
band = 2500; % noise band in kHz
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
sme=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu (for SME)
|
||||
|
||||
openair_init;
|
||||
freq=2000; % normally loop
|
||||
|
||||
% first, calculation of IQ missmatch
|
||||
[ratio,phase]=IQ_estimation(freq);
|
||||
|
||||
|
||||
gpib_send(gpib_card,sme,'*RST;*CLS'); % reset and configure the signal generator
|
||||
|
||||
gpib_send(gpib_card,sme,'POW -100dBm');
|
||||
%disp('FREQ ',int2str(freq),'MHz');
|
||||
gpib_send(gpib_card,sme,strcat('FREQ ',int2str(freq),'MHz'));
|
||||
%disp('FREQ ',int2str(freq),'MHz');
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
|
||||
cmd1='/homes/nussbaum/open_freya/arch/openair_CardBus_MIMO1/LEON3/hostpc/user/tools/scripts/set_receiver -M ';
|
||||
frequency=int2str(freq);
|
||||
|
||||
|
||||
ALL_gain1=0:16:3;
|
||||
ALL_gain2=0:16:3;
|
||||
|
||||
i=0;
|
||||
for gain1=ALL_gain1
|
||||
for gain2= ALL_gain2
|
||||
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
table=zeros(i,4);
|
||||
i=1;
|
||||
for gain1=ALL_gain1
|
||||
for gain2=ALL_gain2
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
system(cmd);
|
||||
%system('set_receiver -M ' frequency ' -g1 ' int2str(gain1) ' -g2 ' int2str(gain2));
|
||||
%system('sleep 1');
|
||||
gpib_send(gpib_card,sme,'OUTP:STAT ON'); % activate output
|
||||
sleep(.1);
|
||||
table(i,1)=gain1;
|
||||
table(i,2)=gain2;
|
||||
|
||||
s=oarf_get_frame(0);
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
signal=s(:,1);
|
||||
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
if(abs(freq_max-2000)>100)
|
||||
disp("Warning")
|
||||
end;
|
||||
|
||||
|
||||
% calculation of the signal power
|
||||
Pu=sum(f(max_pos-20:max_pos+20))
|
||||
ns_noise =round((band/Fs)*(size_data/2))
|
||||
Pnoise=sum(f(max_pos-ns_noise:max_pos+ns_noise))-Pu
|
||||
plot(10*log10(f))
|
||||
|
||||
% plot(10*log10(f(max_pos-ns_noise:max_pos+ns_noise)))
|
||||
|
||||
SNR=10*log10(Pu/Pnoise)
|
||||
N_in = -174 +10*log10(1000*band)
|
||||
S_in = -100;
|
||||
SNR_in=S_in - N_in
|
||||
|
||||
NF=SNR_in-SNR
|
||||
|
||||
|
||||
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
disp(table);
|
||||
|
||||
P_num =100; %(warning, to be updated)
|
||||
|
||||
|
||||
|
||||
% Post processing of the table started here
|
||||
Pmin = -40; % in dBm
|
||||
Pmax = 20; % in dBm
|
||||
|
||||
|
||||
|
||||
% a Tx calibration file is calculated for a given board and frequency
|
||||
|
||||
%fid=fopen(['/tmp/cal_TX' frequency '_' int2str(n) '.dat'],'wb')
|
||||
%fwrite(fid,signal);
|
||||
%fclose(fid);
|
||||
@@ -1,91 +0,0 @@
|
||||
|
||||
% Maxime Guillaud - created Wed May 10 18:08:04 CEST 2006
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu
|
||||
freqband=2; % frequency band used by the openair card
|
||||
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signal generator and the card input (splitter, cables)
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,gpib_device,'POW -70dBm');
|
||||
gpib_send(gpib_card,gpib_device,'FREQ 1.91452GHz');
|
||||
|
||||
|
||||
|
||||
oarf_config(freqband,'openair_config.cfg','openair_scenario.scn')
|
||||
|
||||
saturation_threshold =5; % min number of samples (real+imaginary) equal to the max per frame to declare saturation
|
||||
|
||||
ALL_power_dBm = [-100:1:-60 -150];
|
||||
ALL_rxrfmode = 0:2;
|
||||
ALL_gain2391 = 0:5:120; % this is some strange scale
|
||||
ALL_gain9862 = 0:1:18; % this in in dB
|
||||
|
||||
|
||||
m=[];
|
||||
|
||||
|
||||
%for power_dBm=ALL_power_dBm
|
||||
power_dBm=-70
|
||||
gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
sleep(1)
|
||||
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
for gain2391= ALL_gain2391
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain9862,gain2391,gain9862);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
for gain2391= ALL_gain2391
|
||||
SpN0 = mean(abs(s(:,1)).^2) - abs(mean(s(:,1))).^2;
|
||||
SpN1 = mean(abs(s(:,2)).^2) - abs(mean(s(:,2))).^2;
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain9862,gain2391,gain9862);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
sleep(.1);
|
||||
s=oarf_get_frame(freqband);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
N0 = mean(abs(s(:,1)).^2) - abs(mean(s(:,1))).^2;
|
||||
N1 = mean(abs(s(:,2)).^2) - abs(mean(s(:,2))).^2;
|
||||
|
||||
<<<<<<< rx_calibration.m
|
||||
S0 = 10*log10(SpN0-N0);
|
||||
S1 = 10*log10(SpN1-N1);
|
||||
G0 = S0 - power_dBm;
|
||||
G1 = S1 - power_dBm;
|
||||
NF0 = N0 - G0 + 108;
|
||||
NF1 = N1 - G1 + 108;
|
||||
|
||||
fprintf(' %d %d : Signal strength (%d,%d), Gain (%d %d), NF (%d %d)\n',
|
||||
gain2391,gain9862, S0,S1,G0,G1,NF0,NF1);
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
|
||||
% Maxime Guillaud - created Wed May 10 18:08:04 CEST 2006
|
||||
% Raymond & Florian - last modified Fri Oct 26 17:12:10 CEST 2007
|
||||
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu
|
||||
freqband=2; % frequency band used by the openair card
|
||||
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signal generator and the card input (splitter, cables)
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,gpib_device,'POW -70dBm');
|
||||
gpib_send(gpib_card,gpib_device,'FREQ 1.91860GHz');
|
||||
|
||||
oarf_config(freqband,'openair_config.cfg','openair_scenario.scn')
|
||||
|
||||
saturation_threshold =5; % min number of samples (real+imaginary) equal to the max per frame to declare saturation
|
||||
|
||||
ALL_power_dBm = [-90];
|
||||
ALL_rxrfmode = 0:2;
|
||||
ALL_gain2391 = 0:5:180; % this is some strange scale
|
||||
ALL_gain9862 = 0; %:1:18; % this in in dB
|
||||
|
||||
%fprintf(fid, 'Tx Power (dBm), gain2391, gain9862, Signal strength Rx0, Signal Strength Rx1, Gain Rx0, Gain Rx1, Noise Rx0, Noise Rx1, SNR Rx0, SNR Rx1, NF Rx0, NF Rx1\n');
|
||||
|
||||
SpN0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SpN1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
N0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
N1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
S0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
S1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
G0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
G1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
NF0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
NF1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SNR0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SNR1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
|
||||
min_agc_level = 96; %ceil(min(max(G0,[],1)));
|
||||
max_agc_level = 150; %floor(max(max(G0,[],1)));
|
||||
|
||||
oarf_set_calibrated_rx_gain(0);
|
||||
|
||||
idx_power = 1;
|
||||
for power_dBm=ALL_power_dBm
|
||||
%power_dBm=-70
|
||||
%while (min(max(max(G0)),max(max(G1))) <= max_agc_level)
|
||||
gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
sleep(.5)
|
||||
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
idx_gain2391 = 1;
|
||||
for gain2391= ALL_gain2391
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain2391,gain9862,gain9862);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
sleep(.1);
|
||||
do
|
||||
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
s2 = s(1:8192,:);
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
|
||||
|
||||
SpN0(idx_power,idx_gain2391) = mean(abs(s2(:,1)).^2) - abs(mean(s2(:,1))).^2;
|
||||
SpN1(idx_power,idx_gain2391) = mean(abs(s2(:,2)).^2) - abs(mean(s2(:,2))).^2;
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
figure(1);
|
||||
hold off
|
||||
plot(20*log10(abs(fft(s2(:,1)))))
|
||||
|
||||
sleep(.1);
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
s2 = s(1:8192,:);
|
||||
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
N0(idx_power,idx_gain2391) = mean(abs(s2(:,1)).^2) - abs(mean(s2(:,1))).^2;
|
||||
N1(idx_power,idx_gain2391) = mean(abs(s2(:,2)).^2) - abs(mean(s2(:,2))).^2;
|
||||
|
||||
S0(idx_power,idx_gain2391) = 10*log10(SpN0(idx_power,idx_gain2391)-N0(idx_power,idx_gain2391));
|
||||
S1(idx_power,idx_gain2391) = 10*log10(SpN1(idx_power,idx_gain2391)-N1(idx_power,idx_gain2391));
|
||||
G0(idx_power,idx_gain2391) = S0(idx_power,idx_gain2391) - power_dBm;
|
||||
G1(idx_power,idx_gain2391) = S1(idx_power,idx_gain2391) - power_dBm;
|
||||
NF0(idx_power,idx_gain2391) = 10*log10(N0(idx_power,idx_gain2391)) - G0(idx_power,idx_gain2391) + 108; % 108 is the thermal noise
|
||||
NF1(idx_power,idx_gain2391) = 10*log10(N1(idx_power,idx_gain2391)) - G1(idx_power,idx_gain2391) + 108;
|
||||
SNR0(idx_power,idx_gain2391) = S0(idx_power,idx_gain2391)-10*log10(N0(idx_power,idx_gain2391));
|
||||
SNR1(idx_power,idx_gain2391) = S1(idx_power,idx_gain2391)-10*log10(N1(idx_power,idx_gain2391));
|
||||
printf(' %d %d : Signal strength (%f,%f), Gain (%f %f), N (%f %f) SNR (%f %f) NF (%f %f)\n',
|
||||
gain2391,gain9862, S0(idx_power,idx_gain2391),S1(idx_power,idx_gain2391),G0(idx_power,idx_gain2391),G1(idx_power,idx_gain2391),10*log10(N0(idx_power,idx_gain2391)),10*log10(N1(idx_power,idx_gain2391)),SNR0(idx_power,idx_gain2391),SNR1(idx_power,idx_gain2391),NF0(idx_power,idx_gain2391),NF1(idx_power,idx_gain2391));
|
||||
fflush(stdout);
|
||||
%fprintf(fid,'%d, %d, %d, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n',
|
||||
% power_dBm,gain2391,gain9862, S0,S1,G0,G1,10*log10(N0),10*log10(N1),SNR0,SNR1,NF0,NF1);
|
||||
|
||||
figure(2);
|
||||
hold off
|
||||
plot(20*log10(abs(fft(s2(:,1)))))
|
||||
|
||||
sleep(.1);
|
||||
|
||||
idx_gain2391 = idx_gain2391 + 1;
|
||||
|
||||
figure(3)
|
||||
hold off
|
||||
plot(ALL_gain2391,G0,'r')
|
||||
hold on
|
||||
plot(ALL_gain2391,G1,'b')
|
||||
legend('Rx0','Rx1');
|
||||
title('Gains')
|
||||
|
||||
figure(4)
|
||||
hold off
|
||||
plot(ALL_gain2391,NF0,'r')
|
||||
hold on
|
||||
plot(ALL_gain2391,NF1,'b')
|
||||
legend('Rx0','Rx1');
|
||||
title('Noise Figure')
|
||||
|
||||
end
|
||||
end
|
||||
%power_dBm = power_dBm + 20;
|
||||
idx_power = idx_power + 1;
|
||||
end
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
%l0 = [ALL_gain2391; ones(size(ALL_gain2391))].'\G0;
|
||||
%l1 = [ALL_gain2391; ones(size(ALL_gain2391))].'\G1;
|
||||
|
||||
gain_levels = zeros(max_agc_level-min_agc_level+1,2);
|
||||
|
||||
gain_levels(:,1) = round(interp1(max(G0,[],1),ALL_gain2391,min_agc_level:max_agc_level,'linear')).';
|
||||
gain_levels(:,2) = round(interp1(max(G1,[],1),ALL_gain2391,min_agc_level:max_agc_level,'linear')).';
|
||||
|
||||
%gain_levels(isnan(gain_levels)) = 0;
|
||||
|
||||
write_table
|
||||
@@ -1,51 +0,0 @@
|
||||
function out=rx_post(nom,ratio,phase)
|
||||
|
||||
%load data.dat signal
|
||||
%fid=fopen('/tmp/store1.dat',)
|
||||
fid=fopen(nom,'rb')
|
||||
signal=fread(fid,20480*2,'float');
|
||||
disp(signal(1:10));
|
||||
signal=signal(1:2:length(signal))+j*signal(2:2:length(signal));
|
||||
|
||||
size_data=20480;
|
||||
Fs=7680; %in kHz
|
||||
band = 2000; %in kHz
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
if(abs(freq_max-2000)>100)
|
||||
disp('Warning')
|
||||
end;
|
||||
|
||||
|
||||
% calculation of the signal power
|
||||
Pu=sum(f(max_pos-20:max_pos+20))
|
||||
ns_noise =round((band/Fs)*(size_data/2))
|
||||
Pnoise=sum(f(max_pos-ns_noise:max_pos+ns_noise))-Pu
|
||||
plot(10*log10(f))
|
||||
|
||||
I=real(signal);
|
||||
Q=imag(signal);
|
||||
Qcor=(sin(phase)*I+ratio*Q)/cos(phase);
|
||||
comp=I+j*Qcor;
|
||||
hold on
|
||||
plot(20*log10(abs(fft(comp))),'g')
|
||||
|
||||
comp=comp(1:10000).*exp(-j*(pi/2+0.1)*(1:10000))';
|
||||
figure
|
||||
plot(real(comp(1:500)));
|
||||
hold on
|
||||
plot(imag(comp(1:500)),'g');
|
||||
figure
|
||||
plot(20*log10(abs(fft(comp))),'g')
|
||||
|
||||
%end;
|
||||
@@ -1,43 +0,0 @@
|
||||
function out=rx_post(nom)
|
||||
|
||||
%load data.dat signal
|
||||
%fid=fopen('/tmp/store1.dat',)
|
||||
fid=fopen(nom,'rb')
|
||||
signal=fread(fid,20480*2,'float');
|
||||
signal=signal(1:2:length(signal))+j*signal(2:2:length(signal));
|
||||
disp(signal(1:10));
|
||||
size_data=20480/2;
|
||||
Fs=7680; %in kHz
|
||||
band = 2000; %in kHz
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
if(abs(freq_max-2000)>100)
|
||||
disp("Warning")
|
||||
end;
|
||||
|
||||
|
||||
% calculation of the signal power
|
||||
Pu=sum(f(max_pos-20:max_pos+20))
|
||||
ns_noise =round((band/Fs)*(size_data/2))
|
||||
Pnoise=sum(f(max_pos-ns_noise:max_pos+ns_noise))-Pu
|
||||
plot(10*log10(f))
|
||||
|
||||
% plot(10*log10(f(max_pos-ns_noise:max_pos+ns_noise)))
|
||||
|
||||
SNR=10*log10(Pu/Pnoise)
|
||||
N_in = -174 +10*log10(1000*band)
|
||||
S_in = -110;
|
||||
SNR_in=S_in - N_in
|
||||
|
||||
NF=SNR_in-SNR
|
||||
end;
|
||||
@@ -1,96 +0,0 @@
|
||||
function [ratio,phase]=IQ_estimation(freq)
|
||||
|
||||
gpib_send(gpib_card,sme,'*RST;*CLS'); % reset and configure the signal generator
|
||||
|
||||
gpib_send(gpib_card,sme,'POW -60dBm');
|
||||
|
||||
gpib_send(gpib_card,sme,strcat('FREQ ',int2str(freq),'MHz'));
|
||||
gpib_send(gpib_card,sme,'OUTP:STAT ON'); % activate output
|
||||
|
||||
cmd1='/homes/nussbaum/open_freya/arch/openair_CardBus_MIMO1/LEON3/hostpc/user/tools/scripts/set_receiver -M ';
|
||||
gain1=30;
|
||||
gain2=30;
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
system(cmd);
|
||||
sleep(.1);
|
||||
s=oarf_get_frame(0);
|
||||
signal=s(:,1);
|
||||
|
||||
|
||||
size_data=20480;
|
||||
Fs=7680; %in kHz
|
||||
band = 2000; %in kHz
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
if(abs(freq_max-2000)>100)
|
||||
disp('Warning')
|
||||
end;
|
||||
|
||||
cumI=0;
|
||||
cumQ=0;
|
||||
|
||||
I=real(signal(1:2000));
|
||||
Q=imag(signal(1:2000));
|
||||
|
||||
for i=1:2000
|
||||
cumI=cumI + I(i)*I(i);
|
||||
cumQ=cumQ + Q(i)*Q(i);
|
||||
end;
|
||||
amp= sqrt(2*cumI/length(I))
|
||||
I=I/amp;
|
||||
Q=Q/amp;
|
||||
ratio=sqrt(cumI/cumQ)
|
||||
n_fft=1024;
|
||||
f=abs(fft(I(1:n_fft)));
|
||||
max = 0;
|
||||
index=0;
|
||||
for i=1:n_fft/2
|
||||
if f(i)> max
|
||||
max=f(i);
|
||||
index=i;
|
||||
end;
|
||||
end;
|
||||
disp(max)
|
||||
disp(index)
|
||||
plot(f);
|
||||
freq_estim=(index-1)/n_fft;
|
||||
p=Q*ratio.*I;
|
||||
sinphi=2*sum(p)/length(Q);
|
||||
phi_est=-asin(sinphi)
|
||||
Qcor=(sin(phi_est)*I+ratio*Q)/cos(phi_est);
|
||||
figure
|
||||
plot(I(1:100))
|
||||
hold on
|
||||
plot(Qcor(1:100),'g');
|
||||
comp=I+j*Qcor;
|
||||
figure
|
||||
plot(20*log10(abs(fft(comp))));
|
||||
|
||||
% per=round(1/freq_estim)
|
||||
% figure;plot(I(1:per+1))
|
||||
% opt_offset=-5
|
||||
% min_diff=10^20;
|
||||
% for offset=0:per
|
||||
% diff=0;
|
||||
% for k=1:n_fft
|
||||
% diff=diff+abs(I(k+offset)-Q(k));
|
||||
% end;
|
||||
% if diff<min_diff
|
||||
% min_diff=diff;
|
||||
% opt_offset= offset;
|
||||
% end;
|
||||
% end;
|
||||
% disp(opt_offset)
|
||||
% % normally, as to be 3/4*per
|
||||
% opt_offset=opt_offset-3*per/4;
|
||||
% disp(opt_offset/per*2*pi)
|
||||
@@ -1,8 +0,0 @@
|
||||
openair_init;
|
||||
i=5
|
||||
while (i>0)
|
||||
s=oarf_get_frame(0);
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
i=i-1;
|
||||
disp(i)
|
||||
end
|
||||
@@ -1,11 +0,0 @@
|
||||
openair_init;
|
||||
i=30
|
||||
while (i>0)
|
||||
s=oarf_get_frame(0);
|
||||
figure(1)
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
figure(2)
|
||||
plot(imag(s(:,1)))
|
||||
i=i-1;
|
||||
disp(i)
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
frequency = input('Input freq in MHz: ', 's');
|
||||
num=1;
|
||||
openair_init;
|
||||
for n=1:num
|
||||
s=oarf_get_frame(0);
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
signal=s(:,1);
|
||||
disp(signal(1:10));
|
||||
fid=fopen(['/tmp/' frequency '_' int2str(n) '.dat'],'wb')
|
||||
sig=zeros(2*length(signal),1);
|
||||
sig(1:2:length(sig))=real(signal);
|
||||
sig(2:2:length(sig))=imag(signal);
|
||||
fwrite(fid,sig,'float');
|
||||
fclose(fid);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_sig_gen=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu (for SME)
|
||||
gpib_spec_ana=20; % this is configured in the spectrum analsyer
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,gpib_device,'POW -70dBm');
|
||||
gpib_send(gpib_card,gpib_device,'FREQ 1.91452GHz');
|
||||
|
||||
cmd1='/homes/khalfall/work/openairinterface/arch/openair_CardBus_MIMO1/LEON3/hostpc/user/tools/scripts/set_receiver -M ';
|
||||
frequency='900';
|
||||
|
||||
ALL_gain1=61:1:63;
|
||||
ALL_gain2=61:1:63;
|
||||
|
||||
for gain1=ALL_gain1
|
||||
|
||||
for gain2= ALL_gain2
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
disp(cmd);
|
||||
system(cmd);
|
||||
%system('set_receiver -M ' frequency ' -g1 ' int2str(gain1) ' -g2 ' int2str(gain2));
|
||||
system('sleep 1');
|
||||
end;
|
||||
end;
|
||||
|
||||
num=10;
|
||||
openair_init;
|
||||
%for n=1:num
|
||||
%s=oarf_get_frame(0);
|
||||
%plot(20*log10(abs(fft(s(:,1)))))
|
||||
%signal=s(:,1);
|
||||
%fid=fopen(['/tmp/' frequency '_' int2str(n) '.dat'],'wb')
|
||||
%fwrite(fid,signal);
|
||||
%fclose(fid);
|
||||
%end;
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
frequency = input('Input freq in MHz: ', 's');
|
||||
num=1;
|
||||
openair_init;
|
||||
for n=1:num
|
||||
s=oarf_get_frame(0);
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
signal=s(:,1);
|
||||
disp(signal(1:10));
|
||||
fid=fopen(['/tmp/' frequency '_ref' int2str(n) '.dat'],'wb')
|
||||
sig=zeros(2*length(signal),1);
|
||||
sig(1:2:length(sig))=real(signal);
|
||||
sig(2:2:length(sig))=imag(signal);
|
||||
fwrite(fid,sig,'float');
|
||||
fclose(fid);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
% script to setup mxa and sign generator
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
sme=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu (for SME)
|
||||
mxa=20; % this is configured in the spectrum analsyer
|
||||
|
||||
|
||||
%gpib_send(gpib_card,sme,'*RST;*CLS'); % reset and configure the signal generator
|
||||
%gpib_send(gpib_card,sme,'POW -70dBm');
|
||||
%gpib_send(gpib_card,sme,'FREQ 1.91452GHz');
|
||||
|
||||
gpib_send(gpib_card,mxa,'*CLS');
|
||||
gpib_send(gpib_card,mxa,'SENS:FREQ:CENT 642MHz');
|
||||
|
||||
sleep(1);
|
||||
gpib_send(gpib_card,mxa,'SENS:FREQ:SPAN 50MHz');
|
||||
|
||||
sleep(1);
|
||||
%gpib_send(gpib_card,mxa,'SENS:BAND:RES 10KHZ');
|
||||
|
||||
sleep(1);
|
||||
gpib_send(gpib_card,mxa,'CONF:ACP');
|
||||
gpib_send(gpib_card,mxa,'INIT:ACP');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:FREQ:SPAN 20MHz');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:CARR1:LIST:BAND:INT 8MHz');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:OFFS1:LIST:STAT ON');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:OFFS1:LIST:FREQ 8MHZ,8MHZ,8MHZ,8MHZ,8MHZ,8MHZ');
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:OFFS1:LIST:BAND:INT 8MHZ,8MHZ,8MHZ,8MHZ,8MHZ,8MHZ');
|
||||
|
||||
gpib_send(0,20,'SENS:POW:RANG:OPT:ATT COMB')
|
||||
gpib_send(0,20,'SENS:POW:RF:RANG:OPT IMM')
|
||||
|
||||
|
||||
%gpib_send(gpib_card,mxa,'POW:ATT 40dB');
|
||||
x=gpib_query(gpib_card,mxa,'SENS:ACP:CARR1:POW?',1);
|
||||
|
||||
|
||||
|
||||
cmd1='/homes/khalfall/work/openairinterface/arch/openair_CardBus_MIMO1/LEON3/hostpc/user/tools/scripts/set_transmitter -M ';
|
||||
frequency='900';
|
||||
|
||||
ALL_gain1=0:16:63;
|
||||
ALL_gain2=0:16:63;
|
||||
|
||||
i=0;
|
||||
for gain1=ALL_gain1
|
||||
for gain2= ALL_gain2
|
||||
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
table=zeros(i,4);
|
||||
i=1;
|
||||
for gain1=ALL_gain1
|
||||
for gain2= ALL_gain2
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
%disp(cmd);
|
||||
system(cmd);
|
||||
%system('set_receiver -M ' frequency ' -g1 ' int2str(gain1) ' -g2 ' int2str(gain2));
|
||||
%system('sleep 1');
|
||||
sleep(.1);
|
||||
table(i,1)=gain1;
|
||||
table(i,2)=gain2;
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
x=gpib_query(gpib_card,mxa,'READ:ACP?',3);
|
||||
table(i,3)=x(1);
|
||||
table(i,4)=(x(2)+x(3))/2;
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
disp(table);
|
||||
|
||||
P_num =100; %(warning, to be updated)
|
||||
|
||||
|
||||
|
||||
% Post processing of the table started here
|
||||
Pmin = -40; % in dBm
|
||||
Pmax = 20; % in dBm
|
||||
|
||||
|
||||
|
||||
% a Tx calibration file is calculated for a given board and frequency
|
||||
|
||||
%fid=fopen(['/tmp/cal_TX' frequency '_' int2str(n) '.dat'],'wb')
|
||||
%fwrite(fid,signal);
|
||||
%fclose(fid);
|
||||
@@ -1,111 +0,0 @@
|
||||
clear all
|
||||
|
||||
size_data = 20480; % in ech
|
||||
band = 7*10^6; %in Hz
|
||||
|
||||
Samples = zeros(size_data,1);
|
||||
prefixe_in = '/tmp/'; % c'estle repertoire des fichiers .dat
|
||||
|
||||
signal_1 = [prefixe_in '953_4.dat'];
|
||||
fid_1 = fopen(signal_1,'rb');
|
||||
signal = fread(fid_1, size_data);
|
||||
fclose(fid_1);
|
||||
Samples(:,1) = signal;
|
||||
|
||||
data = (fft(Samples))';
|
||||
|
||||
mes_norm = sqrt(real(data).^2+imag(data).^2);
|
||||
|
||||
[n,m]= size(mes_norm);
|
||||
|
||||
decal_freq = 180*10^3; % in Hz
|
||||
decal = ceil((decal_freq*size_data)/band); % in ech
|
||||
|
||||
|
||||
for q = 1:(m - decal);
|
||||
% Parameters
|
||||
mu_norm = sum(mes_norm(q:q+decal))/(decal+1);
|
||||
sigma2_norm = sum((mes_norm(q:q+decal)-mu_norm).^2)./(decal+1);
|
||||
sigma_ray = sqrt((1/(2*(decal+1)))*sum(mes_norm(q:q+decal).^2));
|
||||
|
||||
% Distributions %%%%%%%%%
|
||||
rayleigh = mes_norm(q:q+decal)./(sigma_ray^2).*exp(-(mes_norm(q:q+decal).^2)./(2*(sigma_ray^2)));
|
||||
aic_matrix (1,q) = sum(log10(rayleigh))+2;
|
||||
nr = exp(-(1/2)*(mes_norm(q:q+decal)-mu_norm).^2./(sigma2_norm))./(sqrt(sigma2_norm*2*pi));
|
||||
aic_matrix (2,q) = sum(log10(nr))+8;
|
||||
end
|
||||
|
||||
|
||||
min_vect = min(aic_matrix(:,:));
|
||||
|
||||
for i=1:m-decal,
|
||||
D(1,i) = aic_matrix(1,i) - min_vect(i);
|
||||
D(2,i) = aic_matrix(2,i) - min_vect(i);
|
||||
|
||||
den = sum(exp(-0.5*D(:,i)));
|
||||
w_ray(i) = exp(-0.5*D(1,i))/den;
|
||||
w_nr(i) = exp(-0.5*D(2,i))/den;
|
||||
end
|
||||
|
||||
for i= 1:ceil(decal/2),
|
||||
bande(i) = 0;
|
||||
end
|
||||
|
||||
for i=ceil(decal/2) + 1:length(w_ray)+ceil(decal/2),
|
||||
if w_ray(i-ceil(decal/2)) < 0.009,
|
||||
bande(i) = 1;
|
||||
else
|
||||
bande(i) = 0;
|
||||
end
|
||||
end
|
||||
|
||||
for i= length(w_ray)+ceil(decal/2)+1:length(w_ray)+decal,
|
||||
bande(i) = 0;
|
||||
end
|
||||
|
||||
bande_1 = zeros(1,length(bande));
|
||||
|
||||
for i=1:decal:length(bande)-decal,
|
||||
nb_zeros = 0;
|
||||
for k = 1:decal,
|
||||
if (bande(i+k-1)==0),
|
||||
nb_zeros = nb_zeros+1;
|
||||
end
|
||||
end
|
||||
if (nb_zeros > decal/2),
|
||||
for k = 1:decal,
|
||||
bande_1(i+k-1)=0;
|
||||
end
|
||||
else
|
||||
for k = 1:decal,
|
||||
bande_1(i+k-1)=1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for i=1:length(bande)/2-72,
|
||||
bande_1(length(bande) - i - 1) = bande_1(i + 72);
|
||||
end
|
||||
|
||||
for i=1:length(bande),
|
||||
ban(i) = 0;
|
||||
end
|
||||
|
||||
for i=1:decal:length(bande),
|
||||
ban(i) = 1;
|
||||
end
|
||||
|
||||
if 1,
|
||||
size_data = size_data - decal;
|
||||
fr = -band/2:band/size_data:band/2-band/size_data;
|
||||
figure(1),
|
||||
subplot(2,1,1),plot(fr,w_ray,'k.'), axis([-band/2, band/2, 0, 1])
|
||||
title('')
|
||||
size_data = 20480;
|
||||
band = 7*10^6; %in kHz
|
||||
fr = -band/2:band/size_data:band/2-band/size_data;
|
||||
subplot(2,1,2),plot(fr, real(data(1,:)), 'k-'), axis([-band/2, band/2, -150000, 150000])
|
||||
subplot(2,1,2),hold on, plot(fr, 10^5.*ban,'k--'), plot(fr, 10^5.*bande_1,'r')
|
||||
subplot(2,1,1),hold on, plot(fr, ban,'k--'),
|
||||
title('')
|
||||
end
|
||||
@@ -1,112 +0,0 @@
|
||||
frequency = input('Input freq in MHz: ', 's');
|
||||
% script to setup mxa and sign generator
|
||||
freq=str2num(frequency);
|
||||
size_data=20480;
|
||||
Fs=7680; %sampling freq in kHz
|
||||
band = 1500; % noise band in kHz
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
sme=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu (for SME)
|
||||
cd ../CBMIMO1_TOOLS;
|
||||
openair_init;
|
||||
cd ../AGILE_RF_TOOLS;
|
||||
%freq=1200; % normally loop
|
||||
S_in=-100;
|
||||
loss_cable=0.5 + freq/2000;
|
||||
% first, calculation of IQ missmatch
|
||||
[ratio,phi_est]=IQ_estimation(freq);
|
||||
|
||||
gpib_send(gpib_card,sme,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,sme,strcat('POW ',int2str(S_in),'dBm'));
|
||||
%disp('FREQ ',int2str(freq),'MHz');
|
||||
gpib_send(gpib_card,sme,strcat('FREQ ',int2str(freq),'MHz'));
|
||||
%disp('FREQ ',int2str(freq),'MHz');
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
|
||||
cmd1='/homes/nussbaum/openair1/ARCH/LEON3/hostpc/user/tools/scripts/set_receiver -M ';
|
||||
frequency=int2str(freq);
|
||||
ALL_gain1=63;
|
||||
ALL_gain2=63;
|
||||
|
||||
i=0;
|
||||
for gain1=ALL_gain1
|
||||
for gain2= ALL_gain2
|
||||
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
table=zeros(i,4);
|
||||
i=1;
|
||||
|
||||
for gain1=ALL_gain1
|
||||
for gain2=ALL_gain2
|
||||
S_in_debug=-73 + floor((gain1+gain2)/2);
|
||||
gpib_send(gpib_card,sme,strcat('POW ',int2str(S_in_debug),'dBm')); % this is for debug without the boards
|
||||
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
system(cmd);
|
||||
%system('set_receiver -M ' frequency ' -g1 ' int2str(gain1) ' -g2 ' int2str(gain2));
|
||||
%system('sleep 1');
|
||||
gpib_send(gpib_card,sme,'OUTP:STAT ON'); % activate output
|
||||
sleep(.1);
|
||||
table(i,1)=gain1;
|
||||
table(i,2)=gain2;
|
||||
|
||||
s=oarf_get_frame(0);
|
||||
%figure
|
||||
%plot(20*log10(abs(fft(s(:,1)))),'g')
|
||||
signal=s(:,1);
|
||||
I=real(signal);
|
||||
Q=imag(signal);
|
||||
disp(phi_est);
|
||||
Qcor=sin(phi_est)*I;
|
||||
|
||||
Qcor=(sin(phi_est)*I+ratio*Q)/cos(phi_est);
|
||||
figure
|
||||
plot(I(1:100))
|
||||
hold on
|
||||
plot(Qcor(1:100),'g');
|
||||
comp=I+j*Qcor;
|
||||
hold off
|
||||
figure
|
||||
plot(20*log10(abs(fft(comp))));
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=size_data/2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
disp("max_pos")
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
disp("freq_max")
|
||||
disp(freq_max)
|
||||
if(abs(freq_max-2000)>400) % probably and error occurs
|
||||
disp("Warning")
|
||||
Pu=0.1;
|
||||
Pnoise=10000;
|
||||
else
|
||||
% calculation of the signal power
|
||||
Pu=sum(f(max_pos-20:max_pos+20))
|
||||
ns_noise =round((band/Fs)*(size_data/2))
|
||||
Pnoise=sum(f(max_pos-ns_noise:max_pos+ns_noise))-Pu
|
||||
end;
|
||||
|
||||
|
||||
% plot(10*log10(f))
|
||||
|
||||
% plot(10*log10(f(max_pos-ns_noise:max_pos+ns_noise)))
|
||||
|
||||
SNR=10*log10(Pu/Pnoise)
|
||||
N_in = -174 +10*log10(1000*band)
|
||||
S_in = S_in-loss_cable;
|
||||
SNR_in=S_in - N_in
|
||||
|
||||
NF=SNR_in-SNR
|
||||
disp("gain_total")
|
||||
gain_total=10*log10(Pu) - S_in
|
||||
|
||||
end;
|
||||
end;
|
||||
@@ -1,94 +0,0 @@
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
% script to setup mxa and sign generator
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
sme=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu (for SME)
|
||||
mxa=20; % this is configured in the spectrum analsyer
|
||||
|
||||
|
||||
%gpib_send(gpib_card,sme,'*RST;*CLS'); % reset and configure the signal generator
|
||||
%gpib_send(gpib_card,sme,'POW -70dBm');
|
||||
%gpib_send(gpib_card,sme,'FREQ 1.91452GHz');
|
||||
|
||||
gpib_send(gpib_card,mxa,'*CLS');
|
||||
gpib_send(gpib_card,mxa,'SENS:FREQ:CENT 642MHz');
|
||||
|
||||
sleep(1);
|
||||
gpib_send(gpib_card,mxa,'SENS:FREQ:SPAN 50MHz');
|
||||
|
||||
sleep(1);
|
||||
%gpib_send(gpib_card,mxa,'SENS:BAND:RES 10KHZ');
|
||||
|
||||
sleep(1);
|
||||
gpib_send(gpib_card,mxa,'CONF:ACP');
|
||||
gpib_send(gpib_card,mxa,'INIT:ACP');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:FREQ:SPAN 20MHz');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:CARR1:LIST:BAND:INT 8MHz');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:OFFS1:LIST:STAT ON');
|
||||
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:OFFS1:LIST:FREQ 8MHZ,8MHZ,8MHZ,8MHZ,8MHZ,8MHZ');
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
gpib_send(gpib_card,mxa,'SENS:ACP:OFFS1:LIST:BAND:INT 8MHZ,8MHZ,8MHZ,8MHZ,8MHZ,8MHZ');
|
||||
|
||||
gpib_send(0,20,'SENS:POW:RANG:OPT:ATT COMB')
|
||||
gpib_send(0,20,'SENS:POW:RF:RANG:OPT IMM')
|
||||
|
||||
|
||||
%gpib_send(gpib_card,mxa,'POW:ATT 40dB');
|
||||
x=gpib_query(gpib_card,mxa,'SENS:ACP:CARR1:POW?',1);
|
||||
|
||||
|
||||
|
||||
cmd1='/homes/khalfall/work/openairinterface/arch/openair_CardBus_MIMO1/LEON3/hostpc/user/tools/scripts/set_transmitter -M ';
|
||||
frequency='900';
|
||||
|
||||
ALL_gain1=0:16:63;
|
||||
ALL_gain2=0:16:63;
|
||||
|
||||
i=0;
|
||||
for gain1=ALL_gain1
|
||||
for gain2= ALL_gain2
|
||||
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
table=zeros(i,4);
|
||||
i=1;
|
||||
for gain1=ALL_gain1
|
||||
for gain2= ALL_gain2
|
||||
cmd=strcat(cmd1,frequency,' -g1 ',int2str(gain1),' -g2 ',int2str(gain2));
|
||||
%disp(cmd);
|
||||
system(cmd);
|
||||
%system('set_receiver -M ' frequency ' -g1 ' int2str(gain1) ' -g2 ' int2str(gain2));
|
||||
%system('sleep 1');
|
||||
sleep(.1);
|
||||
table(i,1)=gain1;
|
||||
table(i,2)=gain2;
|
||||
%frequency = input('Input freq in MHz: ', 's');
|
||||
x=gpib_query(gpib_card,mxa,'READ:ACP?',3);
|
||||
table(i,3)=x(1);
|
||||
table(i,4)=(x(2)+x(3))/2;
|
||||
i=i+1;
|
||||
end;
|
||||
end;
|
||||
disp(table);
|
||||
|
||||
P_num =100; %(warning, to be updated)
|
||||
|
||||
|
||||
|
||||
% Post processing of the table started here
|
||||
Pmin = -40; % in dBm
|
||||
Pmax = 20; % in dBm
|
||||
optimal_gain=zeros(Pmax-Pmin+1,4);
|
||||
|
||||
|
||||
|
||||
% a Tx calibration file is calculated for a given board and frequency
|
||||
|
||||
%fid=fopen(['/tmp/cal_TX' frequency '_' int2str(n) '.dat'],'wb')
|
||||
%fwrite(fid,signal);
|
||||
%fclose(fid);
|
||||
@@ -1,33 +0,0 @@
|
||||
function retvalue=variouspowers(s)
|
||||
|
||||
W=25;
|
||||
|
||||
fftsize=2^ceil(log2(length(s)));
|
||||
powspectrum=fftshift(abs(fft(s-mean(s),fftsize)/sqrt(fftsize)));
|
||||
|
||||
powspectrumfilt=conv(powspectrum,ones(1,2*W+1));
|
||||
|
||||
[sigpower carrier_idx]=max(powspectrumfilt);
|
||||
|
||||
if (carrier_idx<=3*W)
|
||||
carrier_idx=3*W+1;
|
||||
end
|
||||
sigpower_dB=20*log10(sigpower);
|
||||
|
||||
|
||||
if (carrier_idx>3*W)
|
||||
|
||||
noiseplusintfspectrum=powspectrum;
|
||||
noiseplusintfspectrum(carrier_idx+(-W:W)-2*W)=zeros(1,2*W+1);
|
||||
|
||||
noiseplusintfpower_dB=10*log10(sum(noiseplusintfspectrum.^2));
|
||||
|
||||
noiseplusintfspectrum_dB=20*log10(noiseplusintfspectrum);
|
||||
noiseplusintfspectrum_dB(carrier_idx+(-W:W)-2*W)=-20;
|
||||
|
||||
%plot([ 20*log10(powspectrum) noiseplusintfspectrum_dB])
|
||||
%pause
|
||||
retvalue=[sigpower_dB noiseplusintfpower_dB];
|
||||
else
|
||||
retvalue=[sigpower_dB +Inf];
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
card = input('Input card number: ', 's');
|
||||
|
||||
filename_h = ['gain_table_' card '.h']; % file to store the gain table to
|
||||
filename_mat = ['gain_table_' card '.mat'];
|
||||
|
||||
save(filename_mat,'SpN0','SpN1','N0','N1','S0','S1','G0','G1','NF0','NF1','SNR0','SNR1');
|
||||
|
||||
fid = fopen(filename_h,'w');
|
||||
|
||||
fprintf(fid,'#ifndef _GAIN_TABLE_H__\n');
|
||||
fprintf(fid,'#define _GAIN_TABLE_H__\n');
|
||||
|
||||
fprintf(fid,'#include "phy_implementation_defs.h"\n');
|
||||
%fprintf(fid,'#include "phy_implementation_defs.h"\n');
|
||||
|
||||
fprintf(fid,'#define TCXO_OFFSET\n');
|
||||
|
||||
fprintf(fid,'struct gain_table_entry {\n');
|
||||
fprintf(fid,' unsigned char gain0;\n');
|
||||
fprintf(fid,' unsigned char gain1;\n');
|
||||
fprintf(fid,'};\n');
|
||||
|
||||
fprintf(fid,'struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {\n');
|
||||
for agc_level = 1:(max_agc_level-min_agc_level)
|
||||
fprintf(fid,'%d, %d,\n',gain_levels(agc_level,:));
|
||||
end
|
||||
fprintf(fid,'%d, %d};\n',gain_levels(end,:));
|
||||
|
||||
|
||||
fprintf(fid,'#endif /* _GAIN_TABLE_H__ */\n');
|
||||
|
||||
fclose(fid);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.0 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.9 KiB |
@@ -1,54 +0,0 @@
|
||||
CC = gcc
|
||||
|
||||
TOP_DIR = ../..
|
||||
OPENAIR2_DIR = ../../../../openair2
|
||||
OPENAIR2_TOP = $(OPENAIR2_DIR)
|
||||
|
||||
CFLAGS = -DNODE_RG -DUSER_MODE -DPC_TARGET -DPC_DSP -DMAX_MODULES=1 -DPHY_CONTEXT=1 -DDEBUG_PHY -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNB_ANTENNAS_TXRX=2 -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES
|
||||
|
||||
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
|
||||
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
|
||||
CFLAGS += $(L2_incl) $(UTIL_incl)
|
||||
|
||||
#ifdef OPENAIR_LTE
|
||||
CFLAGS += -DOPENAIR_LTE
|
||||
#endif
|
||||
|
||||
|
||||
XTRA_CFLAGS = -msse -msse2 -mssse3
|
||||
|
||||
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
|
||||
ifeq "$(GCCVERSION)" "4.4.3"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.5.2"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
ifeq "$(GCCVERSION)" "4.6.1"
|
||||
CFLAGS += -Wno-packed-bitfield-compat
|
||||
endif
|
||||
|
||||
OPENAIROBJS +=$(OPENAIR1_DIR)/PHY/INIT/lte_parms.o
|
||||
|
||||
#OPENAIROBJS = $(OPENAIR1_DIR)/PHY/CONFIG/openair_readconfigfile.o $(OPENAIR1_DIR)/PHY/CONFIG/openair_configure.o
|
||||
|
||||
OCTAVEOBJS = oarf_set_tcxo_dac.oct oarf_config.oct oarf_config_exmimo.oct oarf_set_calibrated_rx_gain.oct oarf_set_tx_gain.oct oarf_get_frame.oct oarf_set_rx_gain.oct oarf_set_rx_rfmode.oct oarf_stop.oct oarf_send_frame.oct
|
||||
|
||||
all: $(OCTAVEOBJS) gpib_send.oct
|
||||
|
||||
oarf: $(OCTAVEOBJS)
|
||||
|
||||
$(OPENAIROBJS) : %.o : %.c
|
||||
gcc -c $(CFLAGS) $(XTRA_CFLAGS) -o $@ $<
|
||||
|
||||
test:
|
||||
echo $(OPENAIROBJS)
|
||||
|
||||
$(OCTAVEOBJS) : %.oct : %.cc $(OPENAIROBJS)
|
||||
mkoctfile -o $@ $(CFLAGS) -lm $(OPENAIROBJS) $<
|
||||
|
||||
gpib_send.oct: gpib_send.cc
|
||||
mkoctfile -I/usr/include/gpib -I/usr/local/include/gpib -lgpib gpib_send.cc
|
||||
|
||||
clean:
|
||||
rm -f gpib_send.oct $(OCTAVEOBJS) $(OPENAIROBJS)
|
||||
@@ -1,19 +0,0 @@
|
||||
function [sig,sig_length] = OFDM_TX(num_carriers,num_zeros,prefix_length,input)
|
||||
|
||||
% OFDM Transmitter - DC removed
|
||||
% sig is the output signal
|
||||
% length is the length of the output signal
|
||||
% num_carriers - number of sub-carriers (power of 2)
|
||||
% num_zeros - number of zeros minus 1 (DC) in output spectrum (odd)
|
||||
% prefix_length - length of cyclic prefix
|
||||
% input - input dimensions (length = number_carriers - num_zeros - 1)
|
||||
|
||||
if (length(input) + num_zeros + 1 ~= num_carriers)
|
||||
fprintf('error in lengths\n');
|
||||
return;
|
||||
end
|
||||
|
||||
ext_input = [0 input(1:length(input)/2) zeros(1,num_zeros) input((1+length(input)/2) : length(input))];
|
||||
output_1 = ifft(ext_input);
|
||||
sig = [output_1((num_carriers - prefix_length + 1) : num_carriers) output_1];
|
||||
sig_length = length(sig);
|
||||
@@ -1,22 +0,0 @@
|
||||
function sig = OFDM_TX_FRAME(num_carriers,num_zeros,prefix_length,num_symbols_frame,preamble_length)
|
||||
|
||||
% sig - output signal
|
||||
% sig_length - output signal length
|
||||
% num_carriers - number of sub-carriers
|
||||
% num_zeros - number of zero carriers minus 1 (DC)
|
||||
% prefix_length - length of cyclic prefix
|
||||
% num_symbols_frame - number of symbols per OFDM frame
|
||||
% preamble_length - length of 4-QAM preamble
|
||||
|
||||
num_useful_carriers = num_carriers - num_zeros -1;
|
||||
|
||||
sig = [];
|
||||
for k=1:preamble_length
|
||||
QAM4_preamble = QAM_MOD(4,floor(256*abs(rand(1,num_useful_carriers/4))));
|
||||
sig = [sig OFDM_TX(num_carriers,num_zeros,prefix_length,QAM4_preamble)];
|
||||
end
|
||||
|
||||
for k=1:(num_symbols_frame - preamble_length)
|
||||
QAM_data = QAM_MOD(256,floor(256*abs(rand(1,num_useful_carriers))));
|
||||
sig = [sig OFDM_TX(num_carriers,num_zeros,prefix_length,QAM_data)];
|
||||
end
|
||||
@@ -1,29 +0,0 @@
|
||||
function [sig,sig_length] = QAM_MOD(size,input)
|
||||
|
||||
% sig - output symbols
|
||||
% size - modulation size (4,16,256)
|
||||
% input - vector of bytes to be modulated
|
||||
|
||||
AM2 = [-1 1];
|
||||
AM4 = [-3 -1 1 3]; AM4 = 2*AM4/sqrt(AM4*AM4');
|
||||
AM16 = [-15 -13 -11 -9 -7 -5 -3 -1 1 3 5 7 9 11 13 15]; AM16 = 4*AM16/sqrt(AM16*AM16');
|
||||
|
||||
sig = zeros(1,length(input)*8/log2(size));
|
||||
sig_length = length(input)*8/log2(size);
|
||||
|
||||
for l=1:length(input)
|
||||
if (size == 256)
|
||||
sig(l) = (AM16(1+ floor((input(l)/16))) +sqrt(-1)*AM16(1+rem(input(l),16)))/sqrt(2);
|
||||
|
||||
elseif (size == 16)
|
||||
sig(1 + 2*(l-1)) = (AM4(1+floor((input(l)/64))) + sqrt(-1)*AM4(1+rem(floor(input(l)/16) , 4)))/sqrt(2);
|
||||
sig(2 + 2*(l-1)) = (AM4(1+rem(floor(input(l)/4) , 4)) + sqrt(-1)*AM4(1+rem(input(l) , 4)))/sqrt(2);
|
||||
|
||||
elseif (size == 4)
|
||||
sig(1+ 4*(l-1)) = (AM2(1+(floor(input(l)/128))) + sqrt(-1)*AM2(1+rem(floor(input(l)/64) , 2)))/sqrt(2);
|
||||
sig(2+ 4*(l-1)) = (AM2(1+rem(floor(input(l)/32) ,2)) + sqrt(-1)*AM2(1+rem(floor(input(l)/16) , 2)))/sqrt(2);
|
||||
sig(3+ 4*(l-1)) = (AM2(1+rem(floor(input(l)/8) , 2)) + sqrt(-1)*AM2(1+rem(floor(input(l)/4) , 2)))/sqrt(2);
|
||||
sig(4+ 4*(l-1)) = (AM2(1+rem(floor(input(l)/2) , 2)) + sqrt(-1)*AM2(1+rem(input(l) , 2)))/sqrt(2);
|
||||
|
||||
end
|
||||
end
|
||||
@@ -1,18 +0,0 @@
|
||||
chan=1;
|
||||
hold off ;
|
||||
s=oarf_get_frame(0);
|
||||
|
||||
s2=zeros(76800*2,1);
|
||||
s2(1:2:end) = s(:,chan);
|
||||
s2(2:2:end) = s(:,chan);
|
||||
|
||||
plot(real(s2),'b',"markersize",1);
|
||||
hold on; plot(imag(s2),'r',"markersize",1);
|
||||
|
||||
bit11_I = rem(floor(real(2048+s(:,chan))/2048),2);
|
||||
bit11_Q = rem(floor(imag((2048*j)+s(:,chan))/2048),2);
|
||||
bit11_IQ = zeros(1,2*length(bit11_I));
|
||||
bit11_IQ(1:2:end) = bit11_I;
|
||||
bit11_IQ(2:2:end) = bit11_Q;
|
||||
plot(500*bit11_IQ,'k')
|
||||
axis([0 76800 -1000 1000])
|
||||
@@ -1,89 +0,0 @@
|
||||
close all
|
||||
clear all
|
||||
hold off
|
||||
|
||||
% Maxime Guillaud - created Wed May 10 18:08:04 CEST 2006
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu
|
||||
freqband=0; % frequency band used by the openair card (depricated)
|
||||
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signal generator and the card input (splitter, cables)
|
||||
dual_tx = 0;
|
||||
tdd = 1;
|
||||
|
||||
fc = 1902600e3+freqband*5e6; % this has to be the same as in the config file
|
||||
fs = 7680e3;
|
||||
%fs = 6500e3;
|
||||
fref = fc+fs/4;
|
||||
power_dBm=-70;
|
||||
|
||||
|
||||
%gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
%gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
%gpib_send(gpib_card,gpib_device,['FREQ 1.91860 Ghz']); % set the frequency
|
||||
%gpib_send(gpib_card,gpib_device,['FREQ ' int2str(fref/1e3) 'khz']); % set the frequency
|
||||
%gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
|
||||
%keyboard;
|
||||
|
||||
oarf_config(freqband,tdd,dual_tx)
|
||||
|
||||
oarf_set_rx_rfmode(0);
|
||||
|
||||
oarf_set_rx_gain(70,70,0,0);
|
||||
|
||||
sleep(2)
|
||||
|
||||
step = 128;
|
||||
tcxo_freq = 128;
|
||||
|
||||
f_off_min = 1e6;
|
||||
tcxo_freq_min = 256;
|
||||
|
||||
do
|
||||
|
||||
step = step/2;
|
||||
tcxo_freq
|
||||
oarf_set_tcxo_dac(tcxo_freq);
|
||||
sleep(2);
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
nb_rx = size(s,2);
|
||||
|
||||
% find the DC component
|
||||
m = mean(s);
|
||||
|
||||
s_phase = unwrap(angle(s(10000:4:length(s),1).'));
|
||||
s_phase = s_phase - s_phase(1,1);
|
||||
f_off = mean(s_phase(2:length(s_phase))*fs/4./(1:(length(s_phase)-1))/2/pi)
|
||||
plot(1:length(s_phase),s_phase,'r');
|
||||
|
||||
if (nb_rx>1)
|
||||
s_phase2 = unwrap(angle(s(10000:4:length(s),2).'));
|
||||
s_phase2 = s_phase2 - s_phase2(1,1);
|
||||
f_off2 = mean(s_phase2(2:length(s_phase2))*fs/4./(1:(length(s_phase2)-1))/2/pi)
|
||||
hold on
|
||||
plot(1:length(s_phase2),s_phase2,'g');
|
||||
hold off
|
||||
end
|
||||
|
||||
|
||||
if (abs(f_off) < f_off_min)
|
||||
tcxo_freq_min = tcxo_freq;
|
||||
f_off_min = abs((f_off));
|
||||
end
|
||||
|
||||
if ((f_off) > 0)
|
||||
tcxo_freq = tcxo_freq + step;
|
||||
else
|
||||
tcxo_freq = tcxo_freq - step;
|
||||
endif
|
||||
|
||||
|
||||
until (step < 1)
|
||||
|
||||
write_tcxo
|
||||
|
||||
%gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 96
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
26, 17,
|
||||
28, 22,
|
||||
29, 25,
|
||||
31, 27,
|
||||
33, 29,
|
||||
35, 31,
|
||||
38, 33,
|
||||
40, 35,
|
||||
48, 38,
|
||||
52, 40,
|
||||
54, 43,
|
||||
56, 48,
|
||||
57, 52,
|
||||
58, 54,
|
||||
60, 56,
|
||||
61, 58,
|
||||
63, 60,
|
||||
65, 62,
|
||||
67, 65,
|
||||
69, 67,
|
||||
73, 69,
|
||||
79, 72,
|
||||
84, 74,
|
||||
88, 78,
|
||||
90, 82,
|
||||
92, 85,
|
||||
94, 88,
|
||||
95, 90,
|
||||
97, 92,
|
||||
98, 94,
|
||||
99, 96,
|
||||
101, 99,
|
||||
103, 101,
|
||||
105, 103,
|
||||
107, 106,
|
||||
111, 108,
|
||||
116, 111,
|
||||
122, 114,
|
||||
126, 118,
|
||||
127, 122,
|
||||
128, 125,
|
||||
129, 127,
|
||||
131, 130,
|
||||
133, 132,
|
||||
135, 134,
|
||||
138, 137,
|
||||
140, 139,
|
||||
144, 143,
|
||||
152, 148,
|
||||
155, 152,
|
||||
157, 155,
|
||||
158, 157,
|
||||
160, 160,
|
||||
162, 162,
|
||||
164, 166
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
@@ -1,9 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 96
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
@@ -1,66 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 96
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
28, 21,
|
||||
29, 28,
|
||||
30, 30,
|
||||
32, 31,
|
||||
33, 33,
|
||||
34, 34,
|
||||
35, 35,
|
||||
37, 37,
|
||||
39, 39,
|
||||
41, 41,
|
||||
46, 46,
|
||||
55, 52,
|
||||
57, 55,
|
||||
58, 57,
|
||||
60, 59,
|
||||
61, 61,
|
||||
62, 62,
|
||||
64, 64,
|
||||
65, 65,
|
||||
69, 68,
|
||||
76, 73,
|
||||
78, 76,
|
||||
79, 78,
|
||||
81, 80,
|
||||
83, 82,
|
||||
85, 83,
|
||||
89, 85,
|
||||
94, 90,
|
||||
97, 95,
|
||||
100, 98,
|
||||
101, 100,
|
||||
103, 101,
|
||||
104, 103,
|
||||
105, 104,
|
||||
107, 106,
|
||||
111, 108,
|
||||
117, 115,
|
||||
119, 118,
|
||||
121, 120,
|
||||
122, 122,
|
||||
124, 123,
|
||||
125, 124,
|
||||
128, 126,
|
||||
130, 128,
|
||||
140, 132,
|
||||
143, 141,
|
||||
145, 143,
|
||||
147, 145,
|
||||
149, 147,
|
||||
151, 150,
|
||||
152, 151,
|
||||
154, 153,
|
||||
155, 154,
|
||||
167, 167,
|
||||
168, 169
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
@@ -1,66 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#include "phy_implementation_defs.h"
|
||||
#define TCXO_OFFSET
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
27, 20,
|
||||
29, 23,
|
||||
32, 26,
|
||||
34, 28,
|
||||
37, 31,
|
||||
41, 34,
|
||||
43, 37,
|
||||
45, 39,
|
||||
48, 42,
|
||||
51, 45,
|
||||
54, 47,
|
||||
56, 50,
|
||||
58, 52,
|
||||
61, 55,
|
||||
63, 57,
|
||||
65, 60,
|
||||
67, 63,
|
||||
70, 65,
|
||||
72, 67,
|
||||
75, 70,
|
||||
78, 72,
|
||||
80, 75,
|
||||
83, 77,
|
||||
86, 80,
|
||||
88, 82,
|
||||
90, 85,
|
||||
93, 87,
|
||||
98, 90,
|
||||
102, 93,
|
||||
103, 95,
|
||||
105, 97,
|
||||
106, 100,
|
||||
108, 102,
|
||||
114, 105,
|
||||
116, 107,
|
||||
117, 110,
|
||||
118, 113,
|
||||
120, 115,
|
||||
123, 118,
|
||||
131, 121,
|
||||
132, 123,
|
||||
132, 126,
|
||||
133, 128,
|
||||
134, 131,
|
||||
141, 134,
|
||||
142, 136,
|
||||
149, 139,
|
||||
152, 142,
|
||||
155, 145,
|
||||
156, 148,
|
||||
158, 151,
|
||||
160, 154,
|
||||
167, 157,
|
||||
179, 160,
|
||||
179, 164
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
@@ -1,66 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#include "phy_implementation_defs.h"
|
||||
#define TCXO_OFFSET
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
1, 2,
|
||||
6, 7,
|
||||
10, 11,
|
||||
13, 15,
|
||||
17, 18,
|
||||
20, 21,
|
||||
23, 25,
|
||||
26, 28,
|
||||
29, 30,
|
||||
31, 33,
|
||||
34, 36,
|
||||
37, 39,
|
||||
39, 42,
|
||||
42, 44,
|
||||
45, 47,
|
||||
47, 50,
|
||||
50, 52,
|
||||
52, 55,
|
||||
55, 57,
|
||||
57, 58,
|
||||
60, 60,
|
||||
62, 61,
|
||||
65, 62,
|
||||
67, 63,
|
||||
70, 64,
|
||||
72, 65,
|
||||
75, 66,
|
||||
77, 67,
|
||||
80, 69,
|
||||
82, 70,
|
||||
85, 72,
|
||||
87, 75,
|
||||
90, 78,
|
||||
92, 81,
|
||||
94, 87,
|
||||
97, 93,
|
||||
100, 100,
|
||||
102, 106,
|
||||
105, 110,
|
||||
107, 112,
|
||||
110, 114,
|
||||
112, 116,
|
||||
115, 118,
|
||||
117, 120,
|
||||
120, 123,
|
||||
123, 125,
|
||||
125, 128,
|
||||
128, 130,
|
||||
131, 133,
|
||||
134, 136,
|
||||
136, 138,
|
||||
139, 141,
|
||||
142, 144,
|
||||
145, 147,
|
||||
148, 150
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
@@ -1,32 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 130
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
32, 32,
|
||||
35, 35,
|
||||
38, 38,
|
||||
40, 40,
|
||||
43, 43,
|
||||
46, 46,
|
||||
48, 48,
|
||||
51, 51,
|
||||
54, 53,
|
||||
56, 56,
|
||||
59, 58,
|
||||
61, 61,
|
||||
64, 63,
|
||||
67, 66,
|
||||
69, 68,
|
||||
72, 71,
|
||||
75, 73,
|
||||
77, 76,
|
||||
80, 79,
|
||||
82, 81,
|
||||
85, 84
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 130
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
46, 56,
|
||||
49, 58,
|
||||
51, 61,
|
||||
54, 63,
|
||||
56, 66,
|
||||
59, 68,
|
||||
62, 71,
|
||||
64, 73,
|
||||
67, 76,
|
||||
69, 78,
|
||||
72, 81,
|
||||
74, 83,
|
||||
77, 85,
|
||||
79, 88,
|
||||
82, 90,
|
||||
84, 93,
|
||||
87, 95,
|
||||
89, 98,
|
||||
92, 100,
|
||||
94, 103,
|
||||
97, 106
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 130
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
25, 34,
|
||||
28, 37,
|
||||
31, 39,
|
||||
34, 42,
|
||||
36, 45,
|
||||
39, 47,
|
||||
42, 50,
|
||||
44, 53,
|
||||
47, 55,
|
||||
49, 58,
|
||||
52, 60,
|
||||
54, 63,
|
||||
57, 65,
|
||||
59, 68,
|
||||
62, 70,
|
||||
64, 73,
|
||||
67, 75,
|
||||
69, 78,
|
||||
72, 80,
|
||||
74, 83,
|
||||
77, 85
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
Binary file not shown.
@@ -1,32 +0,0 @@
|
||||
#ifndef _GAIN_TABLE_H__
|
||||
#define _GAIN_TABLE_H__
|
||||
#define MAX_RF_GAIN 150
|
||||
#define MIN_RF_GAIN 130
|
||||
struct gain_table_entry {
|
||||
unsigned char gain0;
|
||||
unsigned char gain1;
|
||||
};
|
||||
struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {
|
||||
25, 30,
|
||||
28, 33,
|
||||
30, 36,
|
||||
33, 38,
|
||||
36, 41,
|
||||
39, 44,
|
||||
42, 46,
|
||||
44, 49,
|
||||
47, 52,
|
||||
50, 54,
|
||||
52, 57,
|
||||
55, 59,
|
||||
57, 62,
|
||||
60, 64,
|
||||
63, 67,
|
||||
65, 69,
|
||||
68, 72,
|
||||
70, 75,
|
||||
73, 77,
|
||||
75, 80,
|
||||
78, 82
|
||||
};
|
||||
#endif /* _GAIN_TABLE_H__ */
|
||||
Binary file not shown.
@@ -1,101 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Wed May 10 19:23:30 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compile with: mkoctfile -I/usr/local/include/gpib -lgpib gpib_send.cc
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include "ib.h"
|
||||
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
if (args.length()!=3)
|
||||
{
|
||||
error("gpib_send: syntax: gpib_send(gpib_board,gpib_device,gpib_str).");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (!args(0).is_real_scalar())
|
||||
{
|
||||
error("gpib_send: GPIB board number must be a positive integer.");
|
||||
return true;
|
||||
}
|
||||
if (args(0).scalar_value() < 0.0)
|
||||
{
|
||||
error("gpib_send: GPIB board number must be a positive integer.");
|
||||
return true;
|
||||
}
|
||||
if (floor(args(0).scalar_value()) != args(0).scalar_value())
|
||||
{
|
||||
error("gpib_send: GPIB board number must be a positive integer.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (!args(1).is_real_scalar())
|
||||
{
|
||||
error("gpib_send: GPIB device number must be a positive integer.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args(1).scalar_value() < 0.0)
|
||||
{
|
||||
error("gpib_send: GPIB device number must be a positive integer.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (floor(args(1).scalar_value()) != args(1).scalar_value())
|
||||
{
|
||||
error("gpib_send: GPIB device number must be a positive integer.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!args(2).is_string())
|
||||
{
|
||||
error("gpib_send: third parameter must be a char string.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (gpib_send, args, nargout,"sends commands to the GPIB bus")
|
||||
{
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
|
||||
const int gpib_board = args(0).int_value();
|
||||
const int gpib_device = args(1).int_value();
|
||||
const std::string gpib_string = args(2).string_value();
|
||||
|
||||
unsigned short addlist[2] = {gpib_device, NOADDR};
|
||||
|
||||
SendIFC(gpib_board);
|
||||
|
||||
// ENABLE all on GPIB bus
|
||||
EnableRemote(gpib_board, addlist);
|
||||
// If error, Bye!
|
||||
if (ibsta & ERR)
|
||||
{
|
||||
error("gpib_send: Instrument enable failed!");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
Send(gpib_board, gpib_device, gpib_string.c_str(), strlen(gpib_string.c_str()), NLend);
|
||||
if (ibsta & ERR)
|
||||
{
|
||||
error("gpib_send: Send failed!");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
return octave_value_list();
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
modprobe ni_usb_gpib
|
||||
fxload -D /proc/bus/usb/004/003 -I /usr/local/share/linux-gpib-3.2.11/gpib_firmware-2008-08-10/ni_gpib_usb_b/niusbb_firmware.hex -s /usr/local/share/linux-gpib-3.2.11/gpib_firmware-2008-08-10/ni_gpib_usb_b/niusbb_loader.hex
|
||||
gpib_config
|
||||
chmod a+rw /dev/gpib0
|
||||
@@ -1,75 +0,0 @@
|
||||
RXEN=1;
|
||||
TXEN=2;
|
||||
|
||||
TXLPFENMASK=4;
|
||||
TXLPFEN=4;
|
||||
|
||||
|
||||
TXLPFMASK =15*(2^3);
|
||||
TXLPF14 =0;
|
||||
TXLPF10 =1*(2^3);
|
||||
TXLPF7 =2*(2^3);
|
||||
TXLPF6 =3*(2^3);
|
||||
TXLPF5 =4*(2^3);
|
||||
TXLPF4375 =5*(2^3);
|
||||
TXLPF35 =6*(2^3);
|
||||
TXLPF3 =7*(2^3);
|
||||
TXLPF275 =8*(2^3);
|
||||
TXLPF25 =9*(2^3);
|
||||
TXLPF192 =10*(2^3);
|
||||
TXLPF15 =11*(2^3);
|
||||
TXLPF1375 =12*(2^3);
|
||||
TXLPF125 =13*(2^3);
|
||||
TXLPF0875 =14*(2^3);
|
||||
TXLPF075 =15*(2^3);
|
||||
RXLPFENMASK=1*(2^7);
|
||||
RXLPFEN =128;
|
||||
RXLPFMASK =15*(2^8);
|
||||
RXLPF14 =0;
|
||||
RXLPF10 =1*(2^8);
|
||||
RXLPF7 =2*(2^8);
|
||||
RXLPF6 =3*(2^8);
|
||||
RXLPF5 =4*(2^8);
|
||||
RXLPF4375 =5*(2^8);
|
||||
RXLPF35 =6*(2^8);
|
||||
RXLPF3 =7*(2^8);
|
||||
RXLPF275 =8*(2^8);
|
||||
RXLPF25 =9*(2^8);
|
||||
RXLPF192 =10*(2^8);
|
||||
RXLPF15 =11*(2^8);
|
||||
RXLPF1375 =12*(2^8);
|
||||
RXLPF125 =13*(2^8);
|
||||
RXLPF0875 =14*(2^8);
|
||||
RXLPF075 =15*(2^8);
|
||||
LNAMASK=3*(2^12);
|
||||
LNADIS =0;
|
||||
LNA1ON =1*(2^12);
|
||||
LNA2ON =2*(2^12) ;
|
||||
LNA3ON =3*(2^12);
|
||||
LNAGAINMASK=3*(2^14);
|
||||
LNAByp =1*(2^14);
|
||||
LNAMed =2*(2^14);
|
||||
LNAMax =3*(2^14);
|
||||
|
||||
RFBBMASK =7*(2^16);
|
||||
RFBBNORM =0;
|
||||
RFBBRXLPF =1*(2^16);
|
||||
RFBBRXVGA =2*(2^16);
|
||||
RFBBOUTPUT=3*(2^16);
|
||||
RFBBLNA1 =4*(2^16);
|
||||
RFBBLNA2 =5*(2^16);
|
||||
RFBBLNA3 =6*(2^16);
|
||||
|
||||
TXLPFMODEMASK=1*(2^21);
|
||||
TXLPFNORM =0;
|
||||
TXLPFBYP =1*(2^21);
|
||||
|
||||
RXLPFMODEMASK=3*(2^19);
|
||||
RXLPFNORM =0;
|
||||
RXLPFBYP =1*(2^19);
|
||||
RXLPFBPY2 =3*(2^19);
|
||||
|
||||
|
||||
rf_local = 31 + 31*(2^6) + 31*(2^12) + 31*(2^18);
|
||||
rf_rxdc = 128 + 128*(2^8)
|
||||
rf_vcocal = ((0xE)*(2^6)) + (0xE);
|
||||
@@ -1,655 +0,0 @@
|
||||
// Maxime Guillaud - Created Fri May 12 16:06:53 CEST 2006
|
||||
// this files gathers the various functions used to control the openair RF interface
|
||||
// it is equivalent to the openair_readconfigfile.c and openair_configure.c of the config/ directory
|
||||
|
||||
|
||||
|
||||
|
||||
// Structures shared by various functions in this file
|
||||
PHY_CONFIG PHY_config_mem;
|
||||
PHY_CONFIG *PHY_config;
|
||||
FILE *config, *scenario;
|
||||
|
||||
PHY_FRAMING phyFraming[MAX_CFG_SECTIONS];
|
||||
PHY_CHBCH phyCHBCH[MAX_CFG_SECTIONS];
|
||||
PHY_CHSCH phyCHSCH[MAX_CFG_SECTIONS];
|
||||
PHY_SCH phySCH[MAX_CFG_SECTIONS];
|
||||
PHY_SACH phySACH[MAX_CFG_SECTIONS];
|
||||
|
||||
const cfg_Action Action[] = {
|
||||
{"PHY_FRAMING", phyFraming_ProcessInitReq}, // to do some manipulation of the raw data
|
||||
{"PHY_CHSCH", phyCHSCH_ProcessInitReq},
|
||||
{"PHY_SCH", phySCH_ProcessInitReq},
|
||||
{"PHY_CHBCH", phyCHBCH_ProcessInitReq},
|
||||
{"PHY_SACH", phySACH_ProcessInitReq}
|
||||
};
|
||||
|
||||
const cfg_Section Section[]= {
|
||||
{"PHY_FRAMING", cfg_readPhyFraming},
|
||||
{"PHY_CHBCH", cfg_readPhyCHBCH},
|
||||
{"PHY_CHSCH", cfg_readPhyCHSCH},
|
||||
{"PHY_SCH", cfg_readPhySCH},
|
||||
{"PHY_SACH", cfg_readPhySACH}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void
|
||||
dump_config()
|
||||
{
|
||||
|
||||
int i;
|
||||
FILE *fid;
|
||||
|
||||
msg("[openair][CONFIG] Dumping Config\n\n");
|
||||
msg("[openair][CONFIG] PHY_FRAMING\n");
|
||||
msg("[openair][CONFIG] -----------\n");
|
||||
msg("[openair][CONFIG] fc = %d kHz\n",PHY_config->PHY_framing.fc_khz);
|
||||
msg("[openair][CONFIG] fs = %d kHz\n",PHY_config->PHY_framing.fs_khz);
|
||||
msg("[openair][CONFIG] Nsymb= %d\n",PHY_config->PHY_framing.Nsymb);
|
||||
msg("[openair][CONFIG] Nd= %d\n",PHY_config->PHY_framing.Nd);
|
||||
msg("[openair][CONFIG] log2Nd= %d\n",PHY_config->PHY_framing.log2Nd);
|
||||
msg("[openair][CONFIG] Nc= %d\n",PHY_config->PHY_framing.Nc);
|
||||
msg("[openair][CONFIG] Nz= %d\n",PHY_config->PHY_framing.Nz);
|
||||
msg("[openair][CONFIG] Nf= %d\n",PHY_config->PHY_framing.Nf);
|
||||
|
||||
switch (PHY_config->PHY_framing.Extension_type) {
|
||||
|
||||
case CYCLIC_SUFFIX:
|
||||
msg("[openair][CONFIG] Extension= CYCLIC_SUFFIX \n");
|
||||
break;
|
||||
|
||||
case CYCLIC_PREFIX:
|
||||
msg("[op`enair][CONFIG] Extension= CYCLIC_PREFIX \n");
|
||||
break;
|
||||
|
||||
case ZEROS:
|
||||
msg("[openair][CONFIG] Extension= ZEROS\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("[openair][CONFIG] Extension= CYCLIC_SUFFIX\n");
|
||||
break;
|
||||
}
|
||||
|
||||
msg("[openair][CONFIG]\n");
|
||||
msg("[openair][CONFIG] PHY_CHSCH\n");
|
||||
msg("[openair][CONFIG] -----------\n");
|
||||
msg("[openair][CONFIG] symbol = %d\n",PHY_config->PHY_chsch[0].symbol);
|
||||
msg("[openair][CONFIG] Nsymb= %d\n",PHY_config->PHY_chsch[0].Nsymb);
|
||||
msg("[openair][CONFIG] dd_offset= %d\n",PHY_config->PHY_chsch[0].dd_offset);
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
msg("[openair][CONFIG] chsch_seq_re[%d]= %x\n",i,PHY_config->PHY_chsch[0].chsch_seq_re[i]);
|
||||
msg("[openair][CONFIG] chsch_seq_im[%d]= %x\n",i,PHY_config->PHY_chsch[0].chsch_seq_im[i]);
|
||||
}
|
||||
|
||||
msg("[openair][CONFIG] CHSCH_POWER= %d dBm\n",PHY_config->PHY_chsch[0].CHSCH_POWER_dBm);
|
||||
|
||||
msg("[openair][CONFIG]\n");
|
||||
msg("[openair][CONFIG] PHY_CHBCH\n");
|
||||
msg("[openair][CONFIG] -----------\n");
|
||||
msg("[openair][CONFIG] symbol = %d\n",PHY_config->PHY_chbch[0].symbol);
|
||||
msg("[openair][CONFIG] Nsymb= %d\n",PHY_config->PHY_chbch[0].Nsymb);
|
||||
msg("[openair][CONFIG] IntDepth= %d\n",PHY_config->PHY_chbch[0].IntDepth);
|
||||
msg("[openair][CONFIG] dd_offset= %d\n",PHY_config->PHY_chbch[0].dd_offset);
|
||||
msg("[openair][CONFIG] Npilot= %d\n",PHY_config->PHY_chbch[0].Npilot);
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
msg("[openair][CONFIG] pilot_re[%d]= %x\n",i,PHY_config->PHY_chbch[0].pilot_re[i]);
|
||||
msg("[openair][CONFIG] pilot_im[%d]= %x\n",i,PHY_config->PHY_chbch[0].pilot_im[i]);
|
||||
}
|
||||
|
||||
msg("[openair][CONFIG] FreqReuse= %d\n",PHY_config->PHY_chbch[0].FreqReuse);
|
||||
msg("[openair][CONFIG] FreqReuse_ind= %d\n",PHY_config->PHY_chbch[0].FreqReuse_ind);
|
||||
msg("[openair][CONFIG] CHBCH_POWER= %d dBm\n",PHY_config->PHY_chbch[0].CHBCH_POWER_dBm);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
reconfigure_MACPHY(FILE* scenario)
|
||||
{
|
||||
|
||||
FILE *inscenario=scenario;
|
||||
int cfgNumber, ActionIndex;
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
char ActionName[MAX_ACTION_NAME_SIZE];
|
||||
|
||||
/*!< \brief Reading or opening the scenario*/
|
||||
|
||||
|
||||
loadConfig();
|
||||
|
||||
while ( fgets(LineBuffer, MAX_LINE_SIZE, inscenario) != NULL ) {
|
||||
printf("[CONFIG] : %s\n",LineBuffer);
|
||||
|
||||
if ( sscanf(LineBuffer, "%s %d", ActionName, &cfgNumber) != 2) {
|
||||
msg("[CONFIG] Parse Error: \"%s\" \n", LineBuffer);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (ActionIndex=0; ActionIndex <6; ActionIndex++) { //sizeof(Action)/sizeof(cfg_Action); ActionIndex++)
|
||||
|
||||
if (strcmp(ActionName, Action[ActionIndex].ActionName) == 0) {
|
||||
Action[ActionIndex].Func(cfgNumber);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ActionIndex == 6)//(sizeof(Action)/sizeof(cfg_Action) == ActionIndex)
|
||||
msg("[CONFIG] Unknown <%s> Action! \n", ActionName);
|
||||
}
|
||||
|
||||
fclose(inscenario);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
phyFraming_ProcessInitReq (int cfgNumber)
|
||||
{
|
||||
PHY_FRAMING *phyframing_processinitreq;
|
||||
phyframing_processinitreq = cfg_getPhyFraming(cfgNumber);
|
||||
|
||||
if(phyframing_processinitreq != NULL) {
|
||||
memcpy((void *)&PHY_config->PHY_framing,phyframing_processinitreq,sizeof(PHY_FRAMING));
|
||||
#ifdef TRACE
|
||||
msg("[CONFIG] PHY_FRAMING configuration completed!\n");
|
||||
#endif
|
||||
} else
|
||||
msg("[CONFIG FRAMING] The config number <%d> is not loaded.\n", cfgNumber);
|
||||
|
||||
return cfgNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
loadConfig (void)
|
||||
{
|
||||
int SectionIndex;
|
||||
int cfgNumber;
|
||||
char SectionName[MAX_SECTION_NAME_SIZE];
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
|
||||
|
||||
while ( (fgets (LineBuffer, MAX_LINE_SIZE, config)) != NULL) {
|
||||
if (LineBuffer[0] != '[')
|
||||
continue;
|
||||
|
||||
if (sscanf(LineBuffer, "[%s %d]", SectionName, &cfgNumber) != 2) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (SectionIndex=0; SectionIndex < 5; SectionIndex++) { //sizeof(Section)/sizeof(cfg_Section) ; SectionIndex++)
|
||||
if ( strcmp(SectionName,Section[SectionIndex].SectionName) == 0) {
|
||||
Section[SectionIndex].Func(config, cfgNumber);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (SectionIndex == 5)//(sizeof(Section)/sizeof(cfg_Section) == SectionIndex)
|
||||
msg("[CONFIG] Unknown <%s> section!\n", SectionName);
|
||||
}
|
||||
|
||||
msg("[CONFIG] loadConfig done.\n");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cfg_readPhyFraming (FILE* config, int cfgNumber)
|
||||
{
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
|
||||
if( cfgNumber >= MAX_CFG_SECTIONS ) {
|
||||
msg("[CONFIG] %d outrang number of sections\n", cfgNumber);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf(LineBuffer, "fc_khz: %lu", &phyFraming[cfgNumber].fc_khz ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].fc_khz);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "fs_khz: %lu", &phyFraming[cfgNumber].fs_khz ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].fs_khz);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nsymb: %hu", &phyFraming[cfgNumber].Nsymb ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].Nsymb);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nd: %hu", &phyFraming[cfgNumber].Nd ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].Nd);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "log2Nd: %hu", &phyFraming[cfgNumber].log2Nd ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].log2Nd);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nc: %hu", &phyFraming[cfgNumber].Nc ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].Nc);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nz: %hu", &phyFraming[cfgNumber].Nz ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].Nz);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nf: %hu", &phyFraming[cfgNumber].Nf ) !=1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
//msg("[CONFIG] %s (%d)\n",LineBuffer,phyFraming[cfgNumber].Nf);
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Extension_type: %hu", &phyFraming[cfgNumber].Extension_type ) !=1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
msg("[CONFIG FRAMING] : Done\n");
|
||||
}
|
||||
|
||||
|
||||
PHY_FRAMING *cfg_getPhyFraming(int cfgNumber)
|
||||
{
|
||||
if (cfgNumber < MAX_CFG_SECTIONS)
|
||||
return &phyFraming[cfgNumber];
|
||||
else {
|
||||
msg("[CONFIG] Outrange config number <%d>.\n", cfgNumber);
|
||||
return NULL; //exit(1)??
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cfg_readPhyCHBCH(FILE* config, int cfgNumber)
|
||||
{
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
char temp_string[32];
|
||||
char i;
|
||||
|
||||
if( cfgNumber >= MAX_CFG_SECTIONS ) {
|
||||
msg("[CONFIG CHBCH] %d outrang number of sections\n", cfgNumber);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf(LineBuffer, "symbol: %hu", &phyCHBCH[cfgNumber].symbol ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nsymb: %hu", &phyCHBCH[cfgNumber].Nsymb ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets( LineBuffer, MAX_LINE_SIZE, config );
|
||||
|
||||
if( sscanf( LineBuffer, "IntDepth: %hu", &phyCHBCH[cfgNumber].IntDepth ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "dd_offset: %hu", &phyCHBCH[cfgNumber].dd_offset ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets( LineBuffer, MAX_LINE_SIZE, config );
|
||||
|
||||
if( sscanf( LineBuffer, "Npilot: %hu", &phyCHBCH[cfgNumber].Npilot ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"pilot_re[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phyCHBCH[cfgNumber].pilot_re[i] ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"pilot_im[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phyCHBCH[cfgNumber].pilot_im[i] ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "FreqReuse: %hu", &phyCHBCH[cfgNumber].FreqReuse ) !=1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "FreqReuse_Ind: %hu", &phyCHBCH[cfgNumber].FreqReuse_ind ) !=1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "CHBCH_POWER_dBm: %d", &phyCHBCH[cfgNumber].CHBCH_POWER_dBm ) != 1) {
|
||||
msg("[CONFIG CHBCH] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
msg("[CONFIG CHBCH]: Done\n");
|
||||
}
|
||||
|
||||
|
||||
PHY_CHBCH *cfg_getPhyCHBCH(int cfgNumber)
|
||||
{
|
||||
if ( cfgNumber < MAX_CFG_SECTIONS )
|
||||
return &phyCHBCH[cfgNumber];
|
||||
else {
|
||||
msg("[CONFIG CHBCH] Outrange config number <%d>.\n", cfgNumber);
|
||||
return NULL; //exit(1)??
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cfg_readPhySCH(FILE* config, int cfgNumber)
|
||||
{
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
char temp_string[32];
|
||||
int i;
|
||||
|
||||
if( cfgNumber >= MAX_CFG_SECTIONS ) {
|
||||
msg("[SCH CONFIG] %d outrang number of sections\n", cfgNumber);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nsymb: %hu", &phySCH[cfgNumber].Nsymb ) != 1) {
|
||||
msg("[SCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "dd_offset: %lu", &phySCH[cfgNumber].dd_offset ) != 1) {
|
||||
msg("[SCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"sch_seq_re[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phySCH[cfgNumber].sch_seq_re[i] ) != 1) {
|
||||
msg("[SCH CONFIG] %d: Parse Error: \"%s\"\n (%s)", cfgNumber,LineBuffer,temp_string);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"sch_seq_im[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phySCH[cfgNumber].sch_seq_im[i] ) != 1) {
|
||||
msg("[SCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fgets( LineBuffer, MAX_LINE_SIZE, config );
|
||||
|
||||
if( sscanf( LineBuffer, "SCH_POWER_dBm: %d", &phySCH[cfgNumber].SCH_POWER_dBm ) != 1) {
|
||||
msg("[SCH CONFIG] %d:Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
msg("[CONFIG SCH]: Done\n");
|
||||
}
|
||||
|
||||
PHY_SCH* cfg_getPhySCH(int cfgNumber)
|
||||
{
|
||||
if ( cfgNumber < MAX_CFG_SECTIONS )
|
||||
return &phySCH[cfgNumber];
|
||||
else {
|
||||
msg("[CONFIG] Outrange config number <%d>.\n", cfgNumber);
|
||||
return NULL; //exit(1)??
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cfg_readPhyCHSCH(FILE* config, int cfgNumber)
|
||||
{
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
char temp_string[32];
|
||||
int i;
|
||||
|
||||
if( cfgNumber >= MAX_CFG_SECTIONS ) {
|
||||
msg("[CHSCH CONFIG] %d outrang number of sections\n", cfgNumber);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf(LineBuffer, "symbol: %hu", &phyCHSCH[cfgNumber].symbol ) != 1) {
|
||||
msg("[CHSCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "Nsymb: %hu", &phyCHSCH[cfgNumber].Nsymb ) != 1) {
|
||||
msg("[CHSCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
if( sscanf( LineBuffer, "dd_offset: %lu", &phyCHSCH[cfgNumber].dd_offset ) != 1) {
|
||||
msg("[CHSCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
for (i=0; i<32; i++) {
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"chsch_seq_re[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phyCHSCH[cfgNumber].chsch_seq_re[i] ) != 1) {
|
||||
msg("[CHSCH CONFIG] %d: Parse Error: \"%s\"\n (%s)", cfgNumber,LineBuffer,temp_string);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"chsch_seq_im[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phyCHSCH[cfgNumber].chsch_seq_im[i] ) != 1) {
|
||||
msg("[CHSCH CONFIG] %d: Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fgets( LineBuffer, MAX_LINE_SIZE, config );
|
||||
|
||||
if( sscanf( LineBuffer, "CHSCH_POWER_dBm: %d", &phyCHSCH[cfgNumber].CHSCH_POWER_dBm ) != 1) {
|
||||
msg("[CHSCH CONFIG] %d:Parse Error: \"%s\"\n", cfgNumber,LineBuffer);
|
||||
}
|
||||
|
||||
msg("[CONFIG CHSCH]: Done\n");
|
||||
}
|
||||
|
||||
|
||||
PHY_CHSCH* cfg_getPhyCHSCH(int cfgNumber)
|
||||
{
|
||||
if ( cfgNumber < MAX_CFG_SECTIONS )
|
||||
return &phyCHSCH[cfgNumber];
|
||||
else {
|
||||
msg("[CONFIG] Outrange config number <%d>.\n", cfgNumber);
|
||||
return NULL; //exit(1)??
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cfg_readPhySACH(FILE* config, int cfgNumber)
|
||||
{
|
||||
char LineBuffer[MAX_LINE_SIZE];
|
||||
char temp_string[32];
|
||||
int i;
|
||||
|
||||
if( cfgNumber >= MAX_CFG_SECTIONS ) {
|
||||
msg("[CONFIG] %d outrang number of sections\n", cfgNumber);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
//msg("[CONFIG SACH] : %s\n",LineBuffer);
|
||||
if( sscanf(LineBuffer, "Signal_format: %hu", &phySACH[cfgNumber].Signal_format ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
|
||||
fgets( LineBuffer, MAX_LINE_SIZE, config );
|
||||
|
||||
//msg("[CONFIG SACH] : %s\n",LineBuffer);
|
||||
if( sscanf( LineBuffer, "Npilot: %hu", &phySACH[cfgNumber].Npilot ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"pilot_re[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phySACH[cfgNumber].pilot_re[i] ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
sprintf(temp_string,"pilot_im[%d]: %%x",i);
|
||||
|
||||
if( sscanf( LineBuffer,temp_string, &phySACH[cfgNumber].pilot_im[i] ) != 1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fgets(LineBuffer, MAX_LINE_SIZE, config);
|
||||
|
||||
//msg("[CONFIG SACH] : %s\n",LineBuffer);
|
||||
if( sscanf( LineBuffer, "SACH_POWER_dBm: %d", &phySACH[cfgNumber].SACH_POWER_dBm ) !=1) {
|
||||
msg("[CONFIG] Parse Error: \"%s\"\n", LineBuffer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
PHY_SACH *cfg_getPhySACH(int cfgNumber)
|
||||
{
|
||||
if ( cfgNumber < MAX_CFG_SECTIONS )
|
||||
return &phySACH[cfgNumber];
|
||||
else {
|
||||
msg("[CONFIG ] Outrange config number <%d>.\n", cfgNumber);
|
||||
return NULL; //exit(1)??
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
phyCHBCH_ProcessInitReq (int cfgNumber)
|
||||
{
|
||||
|
||||
PHY_CHBCH *phychbch_processinitreq;
|
||||
|
||||
phychbch_processinitreq = cfg_getPhyCHBCH(cfgNumber);
|
||||
|
||||
if (phychbch_processinitreq != NULL) {
|
||||
memcpy((void *)&PHY_config->PHY_chbch,phychbch_processinitreq,sizeof(PHY_CHBCH));
|
||||
#ifdef TRACE
|
||||
msg("[CONFIG] PHY_CHBCH configuration completed!\n");
|
||||
#endif
|
||||
} else
|
||||
msg("[CONFIG CHBCH ] The config number <%d> is not loaded.\n", cfgNumber);
|
||||
|
||||
return cfgNumber;
|
||||
}
|
||||
|
||||
int
|
||||
phySCH_ProcessInitReq (int cfgNumber)
|
||||
{
|
||||
PHY_SCH *physch_processinitreq;
|
||||
physch_processinitreq = cfg_getPhySCH(cfgNumber);
|
||||
|
||||
if (physch_processinitreq != NULL) {
|
||||
memcpy(&PHY_config->PHY_sch[0],physch_processinitreq,sizeof(PHY_SCH));
|
||||
|
||||
#ifdef TRACE
|
||||
printf("[CONFIG] PHY_SCH configuration completed!\n");
|
||||
#endif TRACE
|
||||
} else
|
||||
msg("[CONFIG SCH] The config number <%d> is not loaded.\n", cfgNumber);
|
||||
|
||||
return cfgNumber;
|
||||
}
|
||||
|
||||
int
|
||||
phySACH_ProcessInitReq (int cfgNumber)
|
||||
{
|
||||
PHY_SACH *physach_processinitreq;
|
||||
physach_processinitreq = cfg_getPhySACH(cfgNumber);
|
||||
|
||||
if (physach_processinitreq != NULL) {
|
||||
memcpy((void *)&PHY_config->PHY_sach,physach_processinitreq,sizeof(PHY_SACH));
|
||||
|
||||
#ifdef TRACE
|
||||
msg("[CONFIG] PHY_SACH configuration completed!\n");
|
||||
#endif TRACE
|
||||
} else
|
||||
msg("[CONFIG SACH] The config number <%d> is not loaded.\n", cfgNumber);
|
||||
|
||||
return cfgNumber;
|
||||
}
|
||||
|
||||
int
|
||||
phyCHSCH_ProcessInitReq (int cfgNumber)
|
||||
{
|
||||
PHY_CHSCH *phychsch_processinitreq;
|
||||
phychsch_processinitreq = cfg_getPhyCHSCH(cfgNumber);
|
||||
|
||||
if (phychsch_processinitreq != NULL) {
|
||||
memcpy(&PHY_config->PHY_chsch[0],phychsch_processinitreq,sizeof(PHY_CHSCH));
|
||||
|
||||
#ifdef TRACE
|
||||
printf("[CONFIG] PHY_CHSCH configuration completed!\n");
|
||||
#endif
|
||||
} else
|
||||
msg("[CONFIG CHSCH] The config number <%d> is not loaded.\n", cfgNumber);
|
||||
|
||||
return cfgNumber;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Thu May 11 17:19:25 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
extern "C" {
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
//#include "PHY/extern.h"
|
||||
//#include "PHY/CONFIG/defs.h"
|
||||
//#include "PHY/CONFIG/extern.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
//#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
}
|
||||
//#include "PHY/vars.h"
|
||||
//#include "PHY/CONFIG/vars.h"
|
||||
|
||||
//#include "oarf_common.c"
|
||||
|
||||
#define FCNNAME "oarf_config"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
//PHY_CONFIG PHY_config_mem;
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v,w;
|
||||
|
||||
if (args.length()!=4)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_config(freqband,tdd,dual_tx,tdd_config)");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 6.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("freqband must be 0-5");
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((!args(1).is_real_scalar()))// || (args(1).scalar_value()!=0.0) || (args(1).scalar_value()!=1.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("tdd must be 0 or 1.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((!args(2).is_real_scalar()))// || (args(2).scalar_value()!=0.0) || (args(2).scalar_value()!=1.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("dual_tx must be 0 or 1.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if ((!args(3).is_real_scalar()) || (args(3).scalar_value()<0.0) || (args(3).scalar_value()>255.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("dual_tx must be 0-9, 254=RX only or 255=TX only.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_config, args, nargout,"configure the openair interface - returns 0 if successful")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
const uint freq = args(0).int_value();
|
||||
//const std::string configfile = args(1).string_value();
|
||||
//const std::string scenariofile = args(2).string_value();
|
||||
const int tdd = args(1).int_value();
|
||||
const int dual_tx = args(2).int_value();
|
||||
const int tdd_config = args(3).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
/*
|
||||
if((config = fopen(configfile.c_str(),"r")) == NULL)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("configuration file could not be opened!");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
if((scenario = fopen(scenariofile.c_str(),"r")) == NULL) // this file is closed by function reconfigure_MACPHY of oarf_common.c
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("scenario file could not be opened!");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
PHY_config = (PHY_CONFIG *)&PHY_config_mem;
|
||||
reconfigure_MACPHY(scenario);
|
||||
fclose(config);
|
||||
*/
|
||||
|
||||
frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
||||
frame_parms->N_RB_DL = 25;
|
||||
frame_parms->N_RB_UL = 25;
|
||||
frame_parms->Ncp = 1;
|
||||
frame_parms->Nid_cell = 0;
|
||||
frame_parms->nushift = 0;
|
||||
frame_parms->nb_antennas_tx = NB_ANTENNAS_TX;
|
||||
frame_parms->nb_antennas_rx = NB_ANTENNAS_RX;
|
||||
frame_parms->mode1_flag = 1; //default == SISO
|
||||
frame_parms->tdd_config = tdd_config;
|
||||
frame_parms->dual_tx = dual_tx;
|
||||
frame_parms->frame_type = TDD;
|
||||
frame_parms->freq_idx = freq;
|
||||
|
||||
init_frame_parms(frame_parms,1);
|
||||
dump_frame_parms(frame_parms);
|
||||
|
||||
returnvalue=ioctl(openair_fd, openair_DUMP_CONFIG,(char *)frame_parms);
|
||||
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Fri May 12 16:20:04 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
// Update: Wed May 23 17:25:39 CEST 2007, fifo acquisition of signal buffer (RK)
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
extern "C" {
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "ARCH/COMMON/defs.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
}
|
||||
#include "PHY/vars.h"
|
||||
|
||||
#define FCNNAME "oarf_get_frame"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
//extern PHY_CONFIG *PHY_config;
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=1)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_get_frame(freqband)\n freqband in 0-5.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 6.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("freqband must be 0-5.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_get_frame, args, nargout,"Get frame (Action 5)")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
const int freq = args(0).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd,i,aa,rx_sig_fifo_fd,rf_cntl_fifo_fd;
|
||||
unsigned int length;//mem_base;
|
||||
short *rx_sig[4];
|
||||
int fc;
|
||||
|
||||
//PHY_VARS *PHY_vars;
|
||||
//PHY_CONFIG *PHY_config;
|
||||
|
||||
//PHY_vars = (PHY_VARS *)malloc(sizeof(PHY_VARS));
|
||||
//PHY_config = (PHY_CONFIG *)malloc(sizeof(PHY_CONFIG));
|
||||
|
||||
TX_RX_VARS dummy_tx_rx_vars;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
||||
|
||||
unsigned int bigphys_top;
|
||||
unsigned int mem_base;
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
#ifdef CBMIMO1
|
||||
if ((rx_sig_fifo_fd = open("/dev/rtf59", O_RDONLY,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/rtf59");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
if ((rf_cntl_fifo_fd = open("/dev/rtf60", O_RDONLY,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/rtf60");
|
||||
return octave_value_list();
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
printf("Getting PHY_vars ...\n");
|
||||
|
||||
ioctl(openair_fd,openair_GET_VARS,PHY_vars);
|
||||
|
||||
//printf("Getting PHY_vars->tx_vars[0].TX_DMA_BUFFER=%p\n",PHY_vars->tx_vars[0].TX_DMA_BUFFER);
|
||||
//printf("Getting PHY_vars->rx_vars[0].RX_DMA_BUFFER = %p\n",PHY_vars->rx_vars[0].RX_DMA_BUFFER);
|
||||
*/
|
||||
|
||||
// printf("Getting PHY_config ...\n");
|
||||
|
||||
ioctl(openair_fd,openair_GET_CONFIG,frame_parms);
|
||||
|
||||
// dump_frame_parms(frame_parms);
|
||||
|
||||
ComplexMatrix dx (FRAME_LENGTH_COMPLEX_SAMPLES,frame_parms->nb_antennas_rx);
|
||||
|
||||
/*
|
||||
// version using FIFO
|
||||
short dma_buffer_local[2*NB_ANTENNAS_RX*FRAME_LENGTH_COMPLEX_SAMPLES];
|
||||
|
||||
// Flush RX sig fifo
|
||||
((unsigned int *)&dma_buffer_local[0])[0] = 1 | ((freq&7)<<1) | ((freq&7)<<4);
|
||||
ioctl(openair_fd,openair_GET_BUFFER,(void *)dma_buffer_local);
|
||||
|
||||
// wait for indication from RT process that a new frame is ready
|
||||
read(rf_cntl_fifo_fd,(void *)dma_buffer_local,4);
|
||||
printf("Sched count %d\n",((int *)dma_buffer_local)[0]);
|
||||
|
||||
length = read(rx_sig_fifo_fd,(void *)dma_buffer_local,NB_ANTENNAS_RX*FRAME_LENGTH_BYTES);
|
||||
printf("Got %d bytes from sig fifo\n",length);
|
||||
|
||||
for (i=0;i<NB_ANTENNAS_RX;i++)
|
||||
rx_sig[i] = (short *)(&dma_buffer_local[2*i*FRAME_LENGTH_COMPLEX_SAMPLES]);
|
||||
*/
|
||||
|
||||
// version using mmap
|
||||
ioctl(openair_fd,openair_GET_VARS,(void* )&dummy_tx_rx_vars);
|
||||
ioctl(openair_fd,openair_GET_BIGPHYSTOP,(void *)&bigphys_top);
|
||||
|
||||
if (dummy_tx_rx_vars.TX_DMA_BUFFER[0]==NULL) {
|
||||
error(FCNNAME);
|
||||
error("pci_buffers not allocated\n");
|
||||
close(openair_fd);
|
||||
return octave_value_list();
|
||||
//exit(-1);
|
||||
}
|
||||
/*
|
||||
printf("BIGPHYS top 0x%x\n",bigphys_top);
|
||||
printf("RX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.RX_DMA_BUFFER[0]);
|
||||
printf("TX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.TX_DMA_BUFFER[0]);
|
||||
printf("RX_DMA_BUFFER[1] %p\n",dummy_tx_rx_vars.RX_DMA_BUFFER[1]);
|
||||
printf("TX_DMA_BUFFER[1] %p\n",dummy_tx_rx_vars.TX_DMA_BUFFER[1]);
|
||||
*/
|
||||
|
||||
mem_base = (unsigned int)mmap(0,
|
||||
BIGPHYS_NUMPAGES*4096,
|
||||
PROT_READ,
|
||||
MAP_PRIVATE,
|
||||
openair_fd,
|
||||
0);
|
||||
|
||||
if (mem_base != -1) {}
|
||||
//msg("MEM base= %p\n",(void*) mem_base);
|
||||
else {
|
||||
error(FCNNAME);
|
||||
error("Could not map physical memory\n");
|
||||
return octave_value_list();
|
||||
//exit(-1);
|
||||
}
|
||||
|
||||
for (i=0;i<frame_parms->nb_antennas_rx;i++)
|
||||
rx_sig[i] = (short *)(mem_base + (unsigned int)dummy_tx_rx_vars.RX_DMA_BUFFER[i]-bigphys_top);
|
||||
|
||||
|
||||
fc=0;
|
||||
// msg("Getting buffer...\n");
|
||||
ioctl(openair_fd,openair_GET_BUFFER,(void *)&fc);
|
||||
|
||||
#ifdef CBMIMO1
|
||||
sleep(1);
|
||||
#endif
|
||||
|
||||
for (i=0;i<FRAME_LENGTH_COMPLEX_SAMPLES;i++)
|
||||
for (aa=0;aa<frame_parms->nb_antennas_rx;aa++)
|
||||
dx(i,aa)=Complex( rx_sig[aa][i*2], rx_sig[aa][i*2+1] );
|
||||
|
||||
close(openair_fd);
|
||||
|
||||
munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096);
|
||||
|
||||
//close(rx_sig_fifo_fd);
|
||||
//close(rf_cntl_fifo_fd);
|
||||
|
||||
//free(PHY_vars);
|
||||
//free(PHY_config);
|
||||
free(frame_parms);
|
||||
|
||||
return octave_value (dx);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Fri May 12 16:20:04 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
extern "C" {
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/CONFIG/defs.h"
|
||||
#include "PHY/CONFIG/extern.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/defs.h"
|
||||
}
|
||||
|
||||
#include <time.h>
|
||||
|
||||
//#include <rtai.h>
|
||||
|
||||
|
||||
//#include "config_vars.h"
|
||||
#include "chansounder_defs.h"
|
||||
|
||||
|
||||
//#include "oarf_common.c"
|
||||
|
||||
#define FCNNAME "oarf_get_rtframe"
|
||||
|
||||
|
||||
#define SLOTS_PER_FRAME 4
|
||||
#define FRAME_LENGTH_COMPLEX_SAMPLES (OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*NUMBER_OF_OFDM_SYMBOLS_PER_SLOT*SLOTS_PER_FRAME)
|
||||
|
||||
extern PHY_CONFIG *PHY_config;
|
||||
|
||||
|
||||
typedef struct /* this shouldn't be here, but including mac_defs.h screws up the macros defining the symbol/slot/frame length :-( */
|
||||
{
|
||||
int registers;
|
||||
void *params_ptr;
|
||||
int params_size;
|
||||
} MACPHY_PARAMS;
|
||||
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=1)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_get_rtframe(freqband)\n freqband in 0-3.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 3.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("freqband must be 0, 1, 2, or 3.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_get_rtframe, args, nargout,"Get frame through RT mode (Action 20)")
|
||||
{
|
||||
MACPHY_PARAMS MACPHY_params;
|
||||
CHANSOUNDER_PARAMS CHANSOUNDER_params;
|
||||
int result, slot, openair_fifo_fd;
|
||||
char *signalbuffer;
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
const int freq = args(0).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd,i;
|
||||
|
||||
ComplexMatrix dx (FRAME_LENGTH_COMPLEX_SAMPLES,nb_rx);
|
||||
char buffer_local[4*FRAME_LENGTH_COMPLEX_SAMPLES+sizeof(long long)];
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
|
||||
|
||||
CHANSOUNDER_params.slot_cyclelength=10000;
|
||||
CHANSOUNDER_params.slot_save=SLOTS_PER_FRAME;
|
||||
|
||||
MACPHY_params.registers=((freq&3)<<1) | ((freq&3)<<3);
|
||||
MACPHY_params.params_ptr=&CHANSOUNDER_params;
|
||||
MACPHY_params.params_size=sizeof(CHANSOUNDER_params);
|
||||
|
||||
result=ioctl(openair_fd,openair_START_CHANSOUNDER,&MACPHY_params);
|
||||
// printf("start sounder ioctl result=%d, sleeping\n",result);
|
||||
|
||||
usleep(20000); // sleep for 20 ms
|
||||
|
||||
CHANSOUNDER_params.slot_save=0;
|
||||
result=ioctl(openair_fd,openair_START_CHANSOUNDER,&MACPHY_params);
|
||||
// printf("start sounder with slot_save=0, ioctl result=%d, reading fifo\n",result);
|
||||
|
||||
// result=ioctl(openair_fd,openair_STOP,NULL); // do not stop sounder since doing it too many times crashes RTAI.
|
||||
|
||||
close(openair_fd);
|
||||
|
||||
|
||||
openair_fifo_fd=open("/dev/rtf3",O_RDONLY);
|
||||
if (openair_fifo_fd==-1)
|
||||
{
|
||||
printf("Can not open openair FIFO (/dev/rtf3), load kernel modules first !\n");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
for (slot=0;slot<SLOTS_PER_FRAME;slot++)
|
||||
{
|
||||
read(openair_fifo_fd,buffer_local,CHANSOUNDER_BYTESPERSLOT+sizeof(long long));
|
||||
// printf("slot=%d, slot_time=%llu\n",slot,*(long long *)buffer_local);
|
||||
signalbuffer=buffer_local+sizeof(long long);
|
||||
|
||||
for (i=0;i<NUMBER_OF_OFDM_SYMBOLS_PER_SLOT*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES;i++)
|
||||
{
|
||||
dx(i+slot*NUMBER_OF_OFDM_SYMBOLS_PER_SLOT*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,0)=Complex( signalbuffer[i*4], signalbuffer[i*4+1] );
|
||||
dx(i+slot*NUMBER_OF_OFDM_SYMBOLS_PER_SLOT*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES,1)=Complex( signalbuffer[i*4+2], signalbuffer[i*4+3] );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
close(openair_fifo_fd);
|
||||
|
||||
|
||||
return octave_value (dx);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Fri May 12 16:20:04 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
// Update: Wed May 23 17:25:39 CEST 2007, fifo acquisition of signal buffer (RK)
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
extern "C" {
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "ARCH/COMMON/defs.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
}
|
||||
#include "PHY/vars.h"
|
||||
|
||||
#define FCNNAME "oarf_send_frame"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
//extern PHY_CONFIG *PHY_config;
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=3)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_send_frame(freqband,sig,nbits)\n freqband in 0-3, sig is a 2D vector, nbits is number of bits to quantize the signal to.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 3.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("freqband must be 0, 1, 2, or 3.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(1);
|
||||
printf("signal: R %d, C %d\n",v.rows(),v.columns());
|
||||
return false;
|
||||
|
||||
v=args(2);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value()!=8) || (v.scalar_value()!=16)) {
|
||||
error(FCNNAME);
|
||||
error("nbits must be either 8 (CBMIMO) or 16 (ExpressMIMO)bits.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_send_frame, args, nargout,"Send frame")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
//const int freq = args(0).int_value();
|
||||
ComplexMatrix dx = args(1).complex_matrix_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd,i;
|
||||
unsigned int length,aa,nbits;
|
||||
int dummy=0;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
|
||||
|
||||
TX_VARS *TX_vars = (TX_VARS*) malloc(sizeof(TX_VARS));
|
||||
TX_RX_VARS dummy_tx_rx_vars;
|
||||
|
||||
unsigned int bigphys_top;
|
||||
unsigned int mem_base;
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
printf("Getting PHY_config 1 ...\n");
|
||||
|
||||
ioctl(openair_fd,openair_GET_CONFIG,frame_parms);
|
||||
|
||||
dump_frame_parms(frame_parms);
|
||||
|
||||
printf("colums = %d, rows = %d\n\n\n", args(1).columns(), args(1).rows());
|
||||
|
||||
if ((args(1).columns()!=NB_ANTENNAS_TX) || (args(1).rows()!=76800))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("input array must be of size (%d,%d)",76800,NB_ANTENNAS_TX);
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
nbits = args(2).scalar_value();
|
||||
|
||||
// ioctl(openair_fd,openair_STOP,(void*)&dummy);
|
||||
|
||||
// version using mmap
|
||||
ioctl(openair_fd,openair_GET_VARS,(void* )&dummy_tx_rx_vars);
|
||||
ioctl(openair_fd,openair_GET_BIGPHYSTOP,(void *)&bigphys_top);
|
||||
|
||||
if (dummy_tx_rx_vars.TX_DMA_BUFFER[0]==NULL) {
|
||||
close(openair_fd);
|
||||
error(FCNNAME);
|
||||
error("pci_buffers not allocated");
|
||||
return octave_value_list();
|
||||
}
|
||||
/*
|
||||
printf("BIGPHYS top 0x%x\n",bigphys_top);
|
||||
printf("RX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.RX_DMA_BUFFER[0]);
|
||||
printf("TX_DMA_BUFFER[0] %p\n",dummy_tx_rx_vars.TX_DMA_BUFFER[0]);
|
||||
*/
|
||||
mem_base = (unsigned int)mmap(0,
|
||||
BIGPHYS_NUMPAGES*4096,
|
||||
PROT_WRITE,
|
||||
MAP_SHARED,
|
||||
openair_fd,
|
||||
0);
|
||||
|
||||
if (mem_base != -1)
|
||||
msg("MEM base= %p\n",(void*) mem_base);
|
||||
else {
|
||||
error(FCNNAME);
|
||||
error("Could not map physical memory");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (aa=0;aa<NB_ANTENNAS_TX;aa++) {
|
||||
//TX_vars->TX_DMA_BUFFER[aa] = (char*) malloc(2*76800);
|
||||
TX_vars->TX_DMA_BUFFER[aa] = (char *)(mem_base + (unsigned int)dummy_tx_rx_vars.TX_DMA_BUFFER[aa]-bigphys_top);
|
||||
|
||||
if (nbits==16) {
|
||||
for (i=0;i<76800;i++) {
|
||||
if (i<64)
|
||||
printf("%d: %d,%d\n",i,(short)real(dx(i,aa)),(short)imag(dx(i,aa)));
|
||||
((short*) TX_vars->TX_DMA_BUFFER[aa])[2*i] = (short)(real(dx(i,aa)));
|
||||
((short*) TX_vars->TX_DMA_BUFFER[aa])[1+(2*i)] = (short)(imag(dx(i,aa)));
|
||||
}
|
||||
}
|
||||
else if (nbits==8) {
|
||||
for (i=0;i<76800;i++) {
|
||||
if (i<64)
|
||||
printf("%d: %d,%d\n",i,char(real(dx(i,aa))),char(imag(dx(i,aa))));
|
||||
((char*) TX_vars->TX_DMA_BUFFER[aa])[2*i] = char(real(dx(i,aa)));
|
||||
((char*) TX_vars->TX_DMA_BUFFER[aa])[1+(2*i)] = char(imag(dx(i,aa)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
error(FCNNAME);
|
||||
error("nbits has to be 8 or 16!");
|
||||
}
|
||||
}
|
||||
|
||||
ioctl(openair_fd,openair_START_TX_SIG,(void *)TX_vars);
|
||||
|
||||
close(openair_fd);
|
||||
|
||||
munmap((void*)mem_base, BIGPHYS_NUMPAGES*4096);
|
||||
|
||||
/*
|
||||
for (aa=0;aa<NB_ANTENNAS_TX;aa++)
|
||||
free(TX_vars->TX_DMA_BUFFER[aa]);
|
||||
*/
|
||||
|
||||
free(TX_vars);
|
||||
free(frame_parms);
|
||||
|
||||
return octave_value (dx);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Fri May 12 14:55:02 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "PHY/vars.h"
|
||||
|
||||
#define FCNNAME "oarf_set_calibrated_rx_gain"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=1)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_set_calibrated_rx_gain(gain)");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("gain must be >=0 and <=255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_set_calibrated_rx_gain, args, nargout,"Set RX gains (Action 16) - params bool")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
unsigned int temp = args(0).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
returnvalue=ioctl(openair_fd,openair_SET_CALIBRATED_RX_GAIN,&temp);
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Fri May 12 14:55:02 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
|
||||
#define FCNNAME "oarf_set_rx_gain"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=4)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_set_rx_gain(2391_G0, 2391_G1, 9862_RX_G0,,9862_RX_G1)");
|
||||
error("Valid ranges: 2391_G0, 2391_G1: 0-255, 9862_RX_G0, 9862_RX_G1: 0-19 dB");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("2391_G0 must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(2);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 19))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("9862_RX_G0 must be an integer in 0..19.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(1);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("2391_G1 must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(3);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 19))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("9862_RX_G1 must be an integer in 0..19.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_set_rx_gain, args, nargout,"Set RX gains (Action 7) - params 2391_G0, 2391_G1 in 0-255, 9862_RX_G0 and 9862_RX_G1 in 0-19 dB.")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
unsigned char temp[4] = {args(0).int_value(),args(1).int_value(),args(2).int_value(),args(3).int_value()};
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
returnvalue=ioctl(openair_fd,openair_SET_RX_GAIN,&temp[0]);
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Mon May 22 15:54:44 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
|
||||
#define FCNNAME "oarf_set_rx_rfmode"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=1)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_set_rx_rfmode(mode)");
|
||||
error("mode: (see MAXIM 2391 data sheet p. 17)");
|
||||
error(" 0: Low gain (LNA low gain, Mixer low gain) ");
|
||||
error(" 1: Med gain (LNA high gain, Mixer low gain)");
|
||||
error(" 2: High gain (LNA high gain, Mixer high gain)");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 2.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("mode must be 0, 1 or 2.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_set_rx_rfmode, args, nargout,"Set RX RF Mode (MAX2391 CONFIG and OPCNTRL registers - p. 17 of the data sheet) (Action 14) - mode is 0, 1 or 2.")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
unsigned int modenumber = args(0).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
returnvalue=ioctl(openair_fd,openair_RX_RF_MODE,&modenumber);
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Tue Jun 27 19:31:06 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
|
||||
#define FCNNAME "oarf_set_tcxo_dac"
|
||||
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=1)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_set_tcxo_dac(value)");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("value must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_set_tcxo_dac, args, nargout,"Set TCXO DAC - value in 0-255.")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
unsigned int value = args(0).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
returnvalue=ioctl(openair_fd,openair_SET_TCXO_DAC,&value);
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
|
||||
// Maxime Guillaud - created Mon May 15 14:54:55 CEST 2006
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
#include "PHY/vars.h"
|
||||
|
||||
#define FCNNAME "oarf_set_tx_gain"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=4)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_set_tx_gain(2394_G0,2394_G1,9862_TX_G0,9862_TX_G1)");
|
||||
error("Valid ranges: 2394_G0, 2394_G1, 9862_TX_G0, 9862_TX_G1: 0-255");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("2394_G0 must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(1);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("2394_G1 must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(2);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("9862_TX_G0 must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(3);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 255))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("9862_TX_G1 must be an integer in 0..255.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_set_tx_gain, args, nargout,"Set TX gains (Action 6) - params 2394_G0, 2394_G1, 9862_TX_G0 and 9862_TX_G1 in 0-255 ")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
unsigned char temp[4] = {args(0).int_value(),args(1).int_value(),args(2).int_value(),args(3).int_value()};
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
//error("fixme: oarf_set_tx_gain: check the order of the parameters as received by the kernel");
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
returnvalue=ioctl(openair_fd,openair_SET_TX_GAIN,&temp[0]);
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
|
||||
// Florian Kaltenberger - created 2010-01-22
|
||||
// see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
// and http://wiki.octave.org/wiki.pl?CodaTutorial
|
||||
// and http://octave.sourceforge.net/coda/c58.html
|
||||
// compilation: see Makefile
|
||||
|
||||
|
||||
|
||||
#include <octave/oct.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
extern "C" {
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/impl_defs_lte.h"
|
||||
#include "ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_device.h"
|
||||
}
|
||||
#include "PHY/vars.h"
|
||||
|
||||
#define FCNNAME "oarf_stop"
|
||||
|
||||
#define TRACE 1
|
||||
|
||||
|
||||
|
||||
static bool any_bad_argument(const octave_value_list &args)
|
||||
{
|
||||
octave_value v;
|
||||
if (args.length()!=1)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("syntax: oarf_stop(freqband)");
|
||||
return true;
|
||||
}
|
||||
|
||||
v=args(0);
|
||||
if ((!v.is_real_scalar()) || (v.scalar_value() < 0.0) || (floor(v.scalar_value()) != v.scalar_value()) || (v.scalar_value() > 6.0))
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("freqband must be 0-5");
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
DEFUN_DLD (oarf_stop, args, nargout,"Stop RT acquisition and write registers.")
|
||||
{
|
||||
|
||||
if (any_bad_argument(args))
|
||||
return octave_value_list();
|
||||
|
||||
unsigned int fd, frequency = args(0).int_value();
|
||||
|
||||
octave_value returnvalue;
|
||||
int openair_fd;
|
||||
|
||||
if ((openair_fd = open("/dev/openair0", O_RDWR,0)) <0)
|
||||
{
|
||||
error(FCNNAME);
|
||||
error("Error opening /dev/openair0");
|
||||
return octave_value_list();
|
||||
}
|
||||
|
||||
fd = (1 | ((frequency&7)<<1) | ((frequency&7)<<4));
|
||||
returnvalue=ioctl(openair_fd,openair_STOP,(void*)&fd);
|
||||
|
||||
close(openair_fd);
|
||||
|
||||
return octave_value(returnvalue);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
oarf_config(0,"config.cfg","scenario.scn")
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
s = oarf_get_frame(2);
|
||||
sig0 = s(:,1);
|
||||
sig1 = s(:,2);
|
||||
|
||||
#sig0 = s(5000:end,1); % first channel
|
||||
#sig1 = s(5000:end,2); % 2nd channel
|
||||
|
||||
|
||||
bw=7.68e6;
|
||||
|
||||
spec = abs(fft(sig1)).^2;
|
||||
[a,b] = max(spec);
|
||||
freq = (b-1)*bw/length(sig0);
|
||||
|
||||
L= 1000;
|
||||
W = 1;
|
||||
|
||||
offset_vec = (0:L-1)*((2*W)+1);
|
||||
W2 = 1+(2*W);
|
||||
|
||||
window_vec = (-W : W);
|
||||
pn = zeros(1,(2*L) - 1);
|
||||
for i = 1:L,
|
||||
pn(i+L-1) = sum(spec(offset_vec(i) + b + window_vec));
|
||||
end
|
||||
|
||||
for i = 2:L,
|
||||
pn(L-i+1) = sum(spec(-offset_vec(i) + b + window_vec));
|
||||
end
|
||||
|
||||
pn_2 = 10*log10(pn / pn(L)) - 10*log10(W2*bw/length(sig0));
|
||||
|
||||
f = ((-L+1):(L-1))*W2*bw/length(sig0);
|
||||
|
||||
|
||||
ylabel('dBc/Hz')
|
||||
xlabel("f_offset (Hz)")
|
||||
title("Phase Noise @ IQ output for Fc = 1912.6 + Fs/4 MHz CW input at antenna")
|
||||
semilogx(f(L:(2*L - 1)),pn_2(L:(2*L -1)))
|
||||
|
||||
|
||||
sum(pn*(f(2)-f(1)))
|
||||
@@ -1,69 +0,0 @@
|
||||
close all
|
||||
|
||||
load gain_table_v2_7_800_s1
|
||||
|
||||
figure(1)
|
||||
plot(ALL_gain2391,real(NF0),'r;RX0;',ALL_gain2391,real(NF1),'g;RX1;')
|
||||
title('Noise Figure vs. Digital Gain (Sector 0, CBMIMO1 v2.7)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('Noise Figure (dB)')
|
||||
print -FTimes-Roman -dpdf s0_v27_nf.pdf
|
||||
|
||||
figure(2)
|
||||
plot(ALL_gain2391,real(G0),'r;RX0;',ALL_gain2391,real(G1),'g;RX1;')
|
||||
title('RF Gain vs. Digital Gain (Sector 0, CBMIMO1 v2.7)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('RF Gain (dB)')
|
||||
print -dpdf s0_v27_gain.pdf
|
||||
|
||||
load gain_table_v2_8_800_s2
|
||||
|
||||
figure(3)
|
||||
plot(ALL_gain2391,real(NF0),'r;RX0;',ALL_gain2391,real(NF1),'g;RX1;')
|
||||
title('Noise Figure vs. Digital Gain (Sector 1, CBMIMO v2.8)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('Noise Figure (dB)')
|
||||
print -dpdf s1_v28_nf.pdf
|
||||
|
||||
figure(4)
|
||||
plot(ALL_gain2391,real(G0),'r;RX0;',ALL_gain2391,real(G1),'g;RX1;')
|
||||
title('RF Gain vs. Digital Gain (Sector 1, CBMIMO1 v2.8)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('RF Gain (dB)')
|
||||
print -dpdf s1_v28_gain.pdf
|
||||
|
||||
load gain_table_v2_13_800_s3
|
||||
|
||||
|
||||
figure(5)
|
||||
plot(ALL_gain2391,real(NF0),'r;RX0;',ALL_gain2391,real(NF1),'g;RX1;')
|
||||
title('Noise Figure vs. Digital Gain (Sector 2, CBMIMO v2.13)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('Noise Figure (dB)')
|
||||
print -dpdf s2_v213_nf.pdf
|
||||
|
||||
figure(6)
|
||||
plot(ALL_gain2391,real(G0),'r;RX0;',ALL_gain2391,real(G1),'g;RX1;')
|
||||
title('RF Gain vs. Digital Gain (Sector 2, CBMIMO1 v2.13)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('RF Gain (dB)')
|
||||
print -dpdf s2_v213_gain.pdf
|
||||
|
||||
load gain_table_v2_3_800_ue
|
||||
|
||||
|
||||
figure(7)
|
||||
plot(ALL_gain2391,real(NF0),'r;RX0;',ALL_gain2391,real(NF1),'g;RX1;')
|
||||
title('Noise Figure vs. Digital Gain (UE, CBMIMO v2.3)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('Noise Figure (dB)')
|
||||
print -dpdf s2_v23_nf.pdf
|
||||
|
||||
figure(8)
|
||||
plot(ALL_gain2391,real(G0),'r;RX0;',ALL_gain2391,real(G1),'g;RX1;')
|
||||
title('RF Gain vs. Digital Gain (UE, CBMIMO1 v2.3)')
|
||||
xlabel('Digital Gain')
|
||||
ylabel('RF Gain (dB)')
|
||||
print -dpdf s2_v23_gain.pdf
|
||||
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
|
||||
closeplot
|
||||
figure(1)
|
||||
|
||||
|
||||
gain2391=70; gain9862=0;
|
||||
for rxrfmode=0:2
|
||||
i=find( (m(:,2)==gain2391) & (m(:,3)==gain9862) & (m(:,4)==rxrfmode));
|
||||
plot(m(i,1),m(i,5:8))
|
||||
pause
|
||||
end
|
||||
|
||||
|
||||
gain2391=70; rxrfmode=1;
|
||||
for gain9862=0:5:15
|
||||
i=find((m(:,2)==gain2391) & (m(:,3)==gain9862) & (m(:,4)==rxrfmode));
|
||||
plot(m(i,1),m(i,5:8))
|
||||
pause
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
rxrfmode=1; power_dBm=-70;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
plot(m(i,1),m(i,5:8))
|
||||
pause
|
||||
end
|
||||
|
||||
|
||||
|
||||
power_dBm=-90;
|
||||
|
||||
subplot(1,3,1)
|
||||
rxrfmode=0;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
mesh(0:10:150,[0 5 10 15],reshape(m(i,5)-m(i,6),4,16))
|
||||
|
||||
subplot(1,3,2)
|
||||
rxrfmode=1;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
mesh(0:10:150,[0 5 10 15],reshape(m(i,5)-m(i,6),4,16))
|
||||
|
||||
subplot(1,3,3)
|
||||
rxrfmode=2;
|
||||
i=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
mesh(0:10:150,[0 5 10 15],reshape(m(i,5)-m(i,6),4,16))
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
|
||||
closeplot
|
||||
figure(1);
|
||||
|
||||
|
||||
%for power_dBm=ALL_power_dBm
|
||||
for power_dBm=-65
|
||||
|
||||
disp(['input: ' num2str(power_dBm) ' dBm']);
|
||||
|
||||
xlabel('Gain 2391');
|
||||
ylabel('Gain 9862');
|
||||
zlabel('SNR');
|
||||
|
||||
rxrfmode=0;
|
||||
idx=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
M0=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
M1=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
for i=idx.'
|
||||
i1=find(ALL_gain2391==m(i,2));
|
||||
i2=find(ALL_gain9862==m(i,3));
|
||||
M0(i1,i2)=m(i,5)-m(i,6);
|
||||
M1(i1,i2)=m(i,7)-m(i,8);
|
||||
end
|
||||
subplot(2,3,1); clg;
|
||||
title('Channel 0, rxrfmode 0');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M0.')
|
||||
subplot(2,3,4); clg;
|
||||
title('Channel 1, rxrfmode 0');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M1.')
|
||||
|
||||
rxrfmode=1;
|
||||
idx=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
M0=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
M1=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
for i=idx.'
|
||||
i1=find(ALL_gain2391==m(i,2));
|
||||
i2=find(ALL_gain9862==m(i,3));
|
||||
M0(i1,i2)=m(i,5)-m(i,6);
|
||||
M1(i1,i2)=m(i,7)-m(i,8);
|
||||
end
|
||||
subplot(2,3,2); clg;
|
||||
title('Channel 0, rxrfmode 1');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M0.')
|
||||
subplot(2,3,5); clg;
|
||||
title('Channel 1, rxrfmode 1');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M1.')
|
||||
|
||||
rxrfmode=2;
|
||||
idx=find((m(:,1)==power_dBm) & (m(:,4)==rxrfmode));
|
||||
M0=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
M1=zeros(length(ALL_gain2391),length(ALL_gain9862));
|
||||
for i=idx.'
|
||||
i1=find(ALL_gain2391==m(i,2));
|
||||
i2=find(ALL_gain9862==m(i,3));
|
||||
M0(i1,i2)=m(i,5)-m(i,6);
|
||||
M1(i1,i2)=m(i,7)-m(i,8);
|
||||
end
|
||||
subplot(2,3,3); clg;
|
||||
title('Channel 0, rxrfmode 2');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M0.')
|
||||
subplot(2,3,6); clg;
|
||||
title('Channel 1, rxrfmode 2');
|
||||
mesh(ALL_gain2391,ALL_gain9862,M1.')
|
||||
|
||||
pause
|
||||
|
||||
end
|
||||
@@ -1,91 +0,0 @@
|
||||
|
||||
% Maxime Guillaud - created Wed May 10 18:08:04 CEST 2006
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu
|
||||
freqband=2; % frequency band used by the openair card
|
||||
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signal generator and the card input (splitter, cables)
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,gpib_device,'POW -70dBm');
|
||||
gpib_send(gpib_card,gpib_device,'FREQ 1.91452GHz');
|
||||
|
||||
|
||||
|
||||
oarf_config(freqband,'openair_config.cfg','openair_scenario.scn')
|
||||
|
||||
saturation_threshold =5; % min number of samples (real+imaginary) equal to the max per frame to declare saturation
|
||||
|
||||
ALL_power_dBm = [-100:1:-60 -150];
|
||||
ALL_rxrfmode = 0:2;
|
||||
ALL_gain2391 = 0:5:120; % this is some strange scale
|
||||
ALL_gain9862 = 0:1:18; % this in in dB
|
||||
|
||||
|
||||
m=[];
|
||||
|
||||
|
||||
%for power_dBm=ALL_power_dBm
|
||||
power_dBm=-70
|
||||
gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
sleep(1)
|
||||
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
for gain2391= ALL_gain2391
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain9862,gain2391,gain9862);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
for gain2391= ALL_gain2391
|
||||
SpN0 = mean(abs(s(:,1)).^2) - abs(mean(s(:,1))).^2;
|
||||
SpN1 = mean(abs(s(:,2)).^2) - abs(mean(s(:,2))).^2;
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain9862,gain2391,gain9862);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
sleep(.1);
|
||||
s=oarf_get_frame(freqband);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
N0 = mean(abs(s(:,1)).^2) - abs(mean(s(:,1))).^2;
|
||||
N1 = mean(abs(s(:,2)).^2) - abs(mean(s(:,2))).^2;
|
||||
|
||||
<<<<<<< rx_calibration.m
|
||||
S0 = 10*log10(SpN0-N0);
|
||||
S1 = 10*log10(SpN1-N1);
|
||||
G0 = S0 - power_dBm;
|
||||
G1 = S1 - power_dBm;
|
||||
NF0 = N0 - G0 + 108;
|
||||
NF1 = N1 - G1 + 108;
|
||||
|
||||
fprintf(' %d %d : Signal strength (%d,%d), Gain (%d %d), NF (%d %d)\n',
|
||||
gain2391,gain9862, S0,S1,G0,G1,NF0,NF1);
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
|
||||
|
||||
@@ -1,183 +0,0 @@
|
||||
close all
|
||||
clear all
|
||||
hold off
|
||||
|
||||
% Maxime Guillaud - created Wed May 10 18:08:04 CEST 2006
|
||||
% Raymond & Florian - last modified Fri Oct 26 17:12:10 CEST 2007
|
||||
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu
|
||||
freqband=0; % frequency band used by the openair card
|
||||
|
||||
%fc = 1902600e3+5e6*freqband-(1043.1e6); % this has to be the same as in the config file
|
||||
fc = 1902600e3+5e6*freqband;
|
||||
|
||||
fs = 7680e3;
|
||||
%fs = 6500e3;
|
||||
fref = fc+fs/4;
|
||||
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signal generator and the card input (splitter, cables)
|
||||
dual_tx = 0;
|
||||
tdd = 1;
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,gpib_device,'POW -90dBm');
|
||||
%gpib_send(gpib_card,gpib_device,'FREQ 1.91860GHz');
|
||||
%gpib_send(gpib_card,gpib_device,'FREQ 1.919225GHz');
|
||||
%gpib_send(gpib_card,gpib_device,'FREQ 1.909225GHz');
|
||||
gpib_send(gpib_card,gpib_device,sprintf("FREQ %dHz",fref));
|
||||
|
||||
oarf_config(freqband,tdd,dual_tx)
|
||||
#oarf_set_rx_rfmode(1);
|
||||
|
||||
saturation_threshold =5; % min number of samples (real+imaginary) equal to the max per frame to declare saturation
|
||||
|
||||
ALL_power_dBm = [-95];
|
||||
ALL_rxrfmode = 0:2;
|
||||
ALL_gain2391 = 5:10:160; % this is some strange scale
|
||||
ALL_gain9862 = 0; %:1:18; % this in in dB
|
||||
|
||||
%fprintf(fid, 'Tx Power (dBm), gain2391, gain9862, Signal strength Rx0, Signal Strength Rx1, Gain Rx0, Gain Rx1, Noise Rx0, Noise Rx1, SNR Rx0, SNR Rx1, NF Rx0, NF Rx1\n');
|
||||
|
||||
SpN0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SpN1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
N0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
N1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
S0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
S1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
G0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
G1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
NF0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
NF1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SNR0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SNR1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
|
||||
min_agc_level = 130; %min_agc_level = 90; %ceil(min(max(G0,[],1)));
|
||||
max_agc_level = 150; %floor(max(max(G0,[],1)));
|
||||
|
||||
oarf_set_calibrated_rx_gain(0); % turns off the AGC
|
||||
#oarf_set_rx_rfmode(2);
|
||||
|
||||
idx_power = 1;
|
||||
for power_dBm=ALL_power_dBm
|
||||
|
||||
gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
idx_gain2391 = 1;
|
||||
for gain2391= [0 0 0 ALL_gain2391] %the first 3 runs give strange results, so we run the loop 3 times more
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain2391,gain9862,gain9862);
|
||||
oarf_set_rx_rfmode(1);
|
||||
oarf_stop(freqband); %this actually writes the gain to the registers
|
||||
sleep(.5);
|
||||
|
||||
if 1
|
||||
% signal measurement
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
sleep(.1);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
s2 = s(1:8192,:);
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
SpN0(idx_power,idx_gain2391) = mean(abs(s2(:,1)).^2) - abs(mean(s2(:,1))).^2;
|
||||
SpN1(idx_power,idx_gain2391) = mean(abs(s2(:,2)).^2) - abs(mean(s2(:,2))).^2;
|
||||
|
||||
figure(1);
|
||||
hold off
|
||||
plot(20*log10(abs(fft(s2(:,1)))),'r',20*log10(abs(fft(s2(:,2)))),'b')
|
||||
title("Signal");
|
||||
|
||||
% noise measurement
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
sleep(.1);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
s2 = s(1:8192,:);
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
N0(idx_power,idx_gain2391) = mean(abs(s2(:,1)).^2) - abs(mean(s2(:,1))).^2;
|
||||
N1(idx_power,idx_gain2391) = mean(abs(s2(:,2)).^2) - abs(mean(s2(:,2))).^2;
|
||||
|
||||
figure(2);
|
||||
hold off
|
||||
plot(20*log10(abs(fft(s2(:,1)))),'r',20*log10(abs(fft(s2(:,2)))),'b')
|
||||
title("Noise");
|
||||
|
||||
% do some plausibility checks
|
||||
% if ((N0(idx_power,idx_gain2391) > SpN0(idx_power,idx_gain2391)) ||
|
||||
% (N1(idx_power,idx_gain2391) > SpN1(idx_power,idx_gain2391)))
|
||||
% error("something is wrong");
|
||||
% end
|
||||
|
||||
S0(idx_power,idx_gain2391) = 10*log10(SpN0(idx_power,idx_gain2391)-N0(idx_power,idx_gain2391));
|
||||
S1(idx_power,idx_gain2391) = 10*log10(SpN1(idx_power,idx_gain2391)-N1(idx_power,idx_gain2391));
|
||||
G0(idx_power,idx_gain2391) = S0(idx_power,idx_gain2391) - power_dBm;
|
||||
G1(idx_power,idx_gain2391) = S1(idx_power,idx_gain2391) - power_dBm;
|
||||
NF0(idx_power,idx_gain2391) = 10*log10(N0(idx_power,idx_gain2391)) - G0(idx_power,idx_gain2391) + 107; % 108 is the thermal noise
|
||||
NF1(idx_power,idx_gain2391) = 10*log10(N1(idx_power,idx_gain2391)) - G1(idx_power,idx_gain2391) + 107;
|
||||
SNR0(idx_power,idx_gain2391) = S0(idx_power,idx_gain2391)-10*log10(N0(idx_power,idx_gain2391));
|
||||
SNR1(idx_power,idx_gain2391) = S1(idx_power,idx_gain2391)-10*log10(N1(idx_power,idx_gain2391));
|
||||
|
||||
printf(' %d %d : Signal strength (%f,%f), Gain (%f %f), N (%f %f) SNR (%f %f) NF (%f %f)\n',
|
||||
gain2391,gain9862, S0(idx_power,idx_gain2391),S1(idx_power,idx_gain2391),
|
||||
G0(idx_power,idx_gain2391),G1(idx_power,idx_gain2391),
|
||||
10*log10(N0(idx_power,idx_gain2391)),10*log10(N1(idx_power,idx_gain2391)),
|
||||
SNR0(idx_power,idx_gain2391),SNR1(idx_power,idx_gain2391),
|
||||
NF0(idx_power,idx_gain2391),NF1(idx_power,idx_gain2391));
|
||||
fflush(stdout);
|
||||
%fprintf(fid,'%d, %d, %d, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n',
|
||||
% power_dBm,gain2391,gain9862, S0,S1,G0,G1,10*log10(N0),10*log10(N1),SNR0,SNR1,NF0,NF1);
|
||||
|
||||
|
||||
if (gain2391 > 0)
|
||||
idx_gain2391 = idx_gain2391 + 1;
|
||||
end
|
||||
|
||||
figure(3)
|
||||
hold off
|
||||
plot(ALL_gain2391,G0,'r')
|
||||
hold on
|
||||
plot(ALL_gain2391,G1,'b')
|
||||
legend('Rx0','Rx1');
|
||||
title('Gains')
|
||||
|
||||
figure(4)
|
||||
hold off
|
||||
plot(ALL_gain2391,NF0,'r')
|
||||
hold on
|
||||
plot(ALL_gain2391,NF1,'b')
|
||||
legend('Rx0','Rx1');
|
||||
title('Noise Figure')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
%power_dBm = power_dBm + 20;
|
||||
idx_power = idx_power + 1;
|
||||
end
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
%l0 = [ALL_gain2391; ones(size(ALL_gain2391))].'\G0;
|
||||
%l1 = [ALL_gain2391; ones(size(ALL_gain2391))].'\G1;
|
||||
|
||||
gain_levels = zeros(max_agc_level-min_agc_level+1,2);
|
||||
|
||||
gain_levels(:,1) = round(interp1(max(G0,[],1),ALL_gain2391,min_agc_level:max_agc_level,'linear','extrap')).';
|
||||
gain_levels(:,2) = round(interp1(max(G1,[],1),ALL_gain2391,min_agc_level:max_agc_level,'linear','extrap')).';
|
||||
|
||||
%gain_levels(isnan(gain_levels)) = 0;
|
||||
|
||||
write_table
|
||||
@@ -1,183 +0,0 @@
|
||||
close all
|
||||
clear all
|
||||
hold off
|
||||
|
||||
% Maxime Guillaud - created Wed May 10 18:08:04 CEST 2006
|
||||
% Raymond & Florian - last modified Fri Oct 26 17:12:10 CEST 2007
|
||||
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System->GPIB->Address menu
|
||||
freqband=0; % frequency band used by the openair card
|
||||
|
||||
fc = 1902600e3+5e6*freqband-(1043.1e6); % this has to be the same as in the config file
|
||||
#fc = 1902600e3+5e6*freqband;
|
||||
|
||||
fs = 7680e3;
|
||||
%fs = 6500e3;
|
||||
fref = fc+fs/4;
|
||||
|
||||
dual_tx = 0;
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signal generator and the card input (splitter, cables)
|
||||
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'*RST;*CLS'); % reset and configure the signal generator
|
||||
gpib_send(gpib_card,gpib_device,'POW -90dBm');
|
||||
%gpib_send(gpib_card,gpib_device,'FREQ 1.91860GHz');
|
||||
%gpib_send(gpib_card,gpib_device,'FREQ 1.919225GHz');
|
||||
%gpib_send(gpib_card,gpib_device,'FREQ 1.909225GHz');
|
||||
gpib_send(gpib_card,gpib_device,sprintf("FREQ %dHz",fref));
|
||||
|
||||
oarf_config(freqband,'config.cfg','scenario.scn',dual_tx)
|
||||
#oarf_set_rx_rfmode(1);
|
||||
|
||||
saturation_threshold =5; % min number of samples (real+imaginary) equal to the max per frame to declare saturation
|
||||
|
||||
ALL_power_dBm = [-102];
|
||||
ALL_rxrfmode = 0:2;
|
||||
ALL_gain2391 = 5:10:160; % this is some strange scale
|
||||
ALL_gain9862 = 0; %:1:18; % this in in dB
|
||||
|
||||
%fprintf(fid, 'Tx Power (dBm), gain2391, gain9862, Signal strength Rx0, Signal Strength Rx1, Gain Rx0, Gain Rx1, Noise Rx0, Noise Rx1, SNR Rx0, SNR Rx1, NF Rx0, NF Rx1\n');
|
||||
|
||||
SpN0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SpN1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
N0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
N1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
S0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
S1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
G0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
G1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
NF0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
NF1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SNR0 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
SNR1 = zeros(length(ALL_power_dBm),length(ALL_gain2391));
|
||||
|
||||
min_agc_level = 130; %min_agc_level = 90; %ceil(min(max(G0,[],1)));
|
||||
max_agc_level = 150; %floor(max(max(G0,[],1)));
|
||||
|
||||
oarf_set_calibrated_rx_gain(0); % turns off the AGC
|
||||
#oarf_set_rx_rfmode(2);
|
||||
|
||||
idx_power = 1;
|
||||
for power_dBm=ALL_power_dBm
|
||||
|
||||
gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
|
||||
for gain9862=ALL_gain9862
|
||||
|
||||
idx_gain2391 = 1;
|
||||
for gain2391= [0 0 0 ALL_gain2391] %the first 3 runs give strange results, so we run the loop 3 times more
|
||||
|
||||
oarf_set_rx_gain(gain2391,gain2391,gain9862,gain9862);
|
||||
oarf_set_rx_rfmode(1);
|
||||
oarf_stop(freqband); %this actually writes the gain to the registers
|
||||
sleep(.5);
|
||||
|
||||
if 1
|
||||
% signal measurement
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
sleep(.1);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
s2 = s(1:8192,:);
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
SpN0(idx_power,idx_gain2391) = mean(abs(s2(:,1)).^2) - abs(mean(s2(:,1))).^2;
|
||||
SpN1(idx_power,idx_gain2391) = mean(abs(s2(:,2)).^2) - abs(mean(s2(:,2))).^2;
|
||||
|
||||
figure(1);
|
||||
hold off
|
||||
plot(20*log10(abs(fft(s2(:,1)))),'r',20*log10(abs(fft(s2(:,2)))),'b')
|
||||
title("Signal");
|
||||
|
||||
% noise measurement
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
sleep(.1);
|
||||
|
||||
nacq=0; % count the number of tries to get data
|
||||
do
|
||||
s=oarf_get_frame(freqband); %oarf_get_frame
|
||||
s2 = s(1:8192,:);
|
||||
sleep(.1);
|
||||
nacq=nacq+1;
|
||||
until max(max(abs(s)))>0 % ensures that the frame is properly read
|
||||
|
||||
N0(idx_power,idx_gain2391) = mean(abs(s2(:,1)).^2) - abs(mean(s2(:,1))).^2;
|
||||
N1(idx_power,idx_gain2391) = mean(abs(s2(:,2)).^2) - abs(mean(s2(:,2))).^2;
|
||||
|
||||
figure(2);
|
||||
hold off
|
||||
plot(20*log10(abs(fft(s2(:,1)))),'r',20*log10(abs(fft(s2(:,2)))),'b')
|
||||
title("Noise");
|
||||
|
||||
% do some plausibility checks
|
||||
% if ((N0(idx_power,idx_gain2391) > SpN0(idx_power,idx_gain2391)) ||
|
||||
% (N1(idx_power,idx_gain2391) > SpN1(idx_power,idx_gain2391)))
|
||||
% error("something is wrong");
|
||||
% end
|
||||
|
||||
S0(idx_power,idx_gain2391) = 10*log10(SpN0(idx_power,idx_gain2391)-N0(idx_power,idx_gain2391));
|
||||
S1(idx_power,idx_gain2391) = 10*log10(SpN1(idx_power,idx_gain2391)-N1(idx_power,idx_gain2391));
|
||||
G0(idx_power,idx_gain2391) = S0(idx_power,idx_gain2391) - power_dBm;
|
||||
G1(idx_power,idx_gain2391) = S1(idx_power,idx_gain2391) - power_dBm;
|
||||
NF0(idx_power,idx_gain2391) = 10*log10(N0(idx_power,idx_gain2391)) - G0(idx_power,idx_gain2391) + 107; % 108 is the thermal noise
|
||||
NF1(idx_power,idx_gain2391) = 10*log10(N1(idx_power,idx_gain2391)) - G1(idx_power,idx_gain2391) + 107;
|
||||
SNR0(idx_power,idx_gain2391) = S0(idx_power,idx_gain2391)-10*log10(N0(idx_power,idx_gain2391));
|
||||
SNR1(idx_power,idx_gain2391) = S1(idx_power,idx_gain2391)-10*log10(N1(idx_power,idx_gain2391));
|
||||
|
||||
printf(' %d %d : Signal strength (%f,%f), Gain (%f %f), N (%f %f) SNR (%f %f) NF (%f %f)\n',
|
||||
gain2391,gain9862, S0(idx_power,idx_gain2391),S1(idx_power,idx_gain2391),
|
||||
G0(idx_power,idx_gain2391),G1(idx_power,idx_gain2391),
|
||||
10*log10(N0(idx_power,idx_gain2391)),10*log10(N1(idx_power,idx_gain2391)),
|
||||
SNR0(idx_power,idx_gain2391),SNR1(idx_power,idx_gain2391),
|
||||
NF0(idx_power,idx_gain2391),NF1(idx_power,idx_gain2391));
|
||||
fflush(stdout);
|
||||
%fprintf(fid,'%d, %d, %d, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n',
|
||||
% power_dBm,gain2391,gain9862, S0,S1,G0,G1,10*log10(N0),10*log10(N1),SNR0,SNR1,NF0,NF1);
|
||||
|
||||
|
||||
if (gain2391 > 0)
|
||||
idx_gain2391 = idx_gain2391 + 1;
|
||||
end
|
||||
|
||||
figure(3)
|
||||
hold off
|
||||
plot(ALL_gain2391,G0,'r')
|
||||
hold on
|
||||
plot(ALL_gain2391,G1,'b')
|
||||
legend('Rx0','Rx1');
|
||||
title('Gains')
|
||||
|
||||
figure(4)
|
||||
hold off
|
||||
plot(ALL_gain2391,NF0,'r')
|
||||
hold on
|
||||
plot(ALL_gain2391,NF1,'b')
|
||||
legend('Rx0','Rx1');
|
||||
title('Noise Figure')
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
%power_dBm = power_dBm + 20;
|
||||
idx_power = idx_power + 1;
|
||||
end
|
||||
|
||||
gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % deactivate output
|
||||
|
||||
%l0 = [ALL_gain2391; ones(size(ALL_gain2391))].'\G0;
|
||||
%l1 = [ALL_gain2391; ones(size(ALL_gain2391))].'\G1;
|
||||
|
||||
gain_levels = zeros(max_agc_level-min_agc_level+1,2);
|
||||
|
||||
gain_levels(:,1) = round(interp1(max(G0,[],1),ALL_gain2391,min_agc_level:max_agc_level,'linear','extrap')).';
|
||||
gain_levels(:,2) = round(interp1(max(G1,[],1),ALL_gain2391,min_agc_level:max_agc_level,'linear','extrap')).';
|
||||
|
||||
%gain_levels(isnan(gain_levels)) = 0;
|
||||
|
||||
write_table
|
||||
@@ -1,42 +0,0 @@
|
||||
function out=rx_post(nom)
|
||||
|
||||
%load data.dat signal
|
||||
%fid=fopen('/tmp/store1.dat',)
|
||||
fid=fopen(nom,'rb')
|
||||
signal=fread(fid,20480);
|
||||
|
||||
size_data=20480;
|
||||
Fs=7680; %in kHz
|
||||
band = 2000; %in kHz
|
||||
max_pos=0;
|
||||
max=0;
|
||||
f=abs(fft(signal)).^2;
|
||||
for n=2:size_data
|
||||
if(f(n) > max)
|
||||
max=f(n);
|
||||
max_pos=n;
|
||||
end;
|
||||
end;
|
||||
|
||||
disp(max_pos)
|
||||
freq_max=Fs/size_data*max_pos - Fs/2 % corresponding frequency
|
||||
if(abs(freq_max-2000)>100)
|
||||
disp("Warning")
|
||||
end;
|
||||
|
||||
|
||||
% calculation of the signal power
|
||||
Pu=sum(f(max_pos-20:max_pos+20))
|
||||
ns_noise =round((band/Fs)*(size_data/2))
|
||||
Pnoise=sum(f(max_pos-ns_noise:max_pos+ns_noise))-Pu
|
||||
plot(10*log10(f))
|
||||
|
||||
% plot(10*log10(f(max_pos-ns_noise:max_pos+ns_noise)))
|
||||
|
||||
SNR=10*log10(Pu/Pnoise)
|
||||
N_in = -174 +10*log10(1000*band)
|
||||
S_in = -110;
|
||||
SNR_in=S_in - N_in
|
||||
|
||||
NF=SNR_in-SNR
|
||||
end;
|
||||
@@ -1,10 +0,0 @@
|
||||
addpath('../../../PHY/LTE_REFSIG/');
|
||||
primary_synch;
|
||||
pss_t = upsample(primary_synch0_time,4);
|
||||
corr = abs(conv(conj(pss_t),s(:,1)));
|
||||
figure(3);
|
||||
plot(corr);
|
||||
|
||||
[pss_amp, pss_pos] = max(corr);
|
||||
sss_pos = pss_pos - 640;
|
||||
ssst = s(sss_pos:(sss_pos+511));
|
||||
@@ -1,26 +0,0 @@
|
||||
dual_tx=0;
|
||||
oarf_config(0,1,dual_tx)
|
||||
|
||||
gpib_card=0; % first GPIB PCI card in the computer
|
||||
gpib_device=28; % this is configured in the signal generator Utilities->System
|
||||
cables_loss_dB = 6; % we need to account for the power loss between the signa
|
||||
power_dBm = -95;
|
||||
|
||||
%gpib_send(gpib_card,gpib_device,['POW ' int2str(power_dBm+cables_loss_dB) 'dBm']);
|
||||
%gpib_send(gpib_card,gpib_device,'OUTP:STAT ON'); % activate output
|
||||
|
||||
oarf_set_calibrated_rx_gain(0); % turns off the AGC
|
||||
oarf_set_rx_gain(80,85,0,0);
|
||||
oarf_set_rx_rfmode(0);
|
||||
|
||||
s=oarf_get_frame(0);
|
||||
f = (7.68*(0:length(s(:,1))-1)/(length(s(:,1))))-3.84;
|
||||
spec0 = 20*log10(abs(fftshift(fft(s(:,1)))));
|
||||
spec1 = 20*log10(abs(fftshift(fft(s(:,2)))));
|
||||
|
||||
clf
|
||||
plot(f',spec0,'r',f',spec1,'b')
|
||||
axis([-3.84,3.84,40,160]);
|
||||
%gpib_send(gpib_card,gpib_device,'OUTP:STAT OFF'); % activate output
|
||||
legend('Antenna Port 0','Antenna Port 1');
|
||||
grid
|
||||
@@ -1,13 +0,0 @@
|
||||
num=10;
|
||||
openair_init;
|
||||
for n=1:num
|
||||
s=oarf_get_frame(0);
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
signal=s(:,1);
|
||||
fid=fopen(['/tmp/store' int2str(n) '.dat'],'wb')
|
||||
fwrite(fid,signal);
|
||||
fclose(fid);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
fc = 1907600000;
|
||||
fidx=1;
|
||||
tdd=1;
|
||||
dual_tx=1;
|
||||
cbmimo1=0;
|
||||
rxgain=30;
|
||||
txgain=25;
|
||||
eNB_flag = 0;
|
||||
|
||||
off = 0; % -994;
|
||||
if (cbmimo1)
|
||||
oarf_config(fidx,tdd,dual_tx,255);
|
||||
amp = pow2(7)-1;
|
||||
n_bit = 8;
|
||||
else
|
||||
limeparms;
|
||||
rf_mode = RXEN+TXEN+TXLPFNORM+TXLPFEN+TXLPF25+RXLPFNORM+RXLPFEN+RXLPF25+LNA1ON+LNAMax+RFBBNORM * ones(1,4);
|
||||
% rf_mode = RXEN+TXEN+TXLPFNORM+TXLPFEN+TXLPF25+RXLPFNORM+RXLPFEN+RXLPF25+LNA1ON+LNAByp+RFBBLNA1;
|
||||
|
||||
rf_local = rf_local * ones(1,4);
|
||||
rf_rxdc = rf_rxdc * ones(1,4);
|
||||
rf_vcocal = rf_vcocal * ones(1,4);
|
||||
rxgain = rxgain*ones(1,4);
|
||||
txgain = txgain*ones(1,4);
|
||||
freq_rx = fc*[1 1 1 1];
|
||||
freq_tx = freq_rx+1920000;
|
||||
|
||||
oarf_config_exmimo(freq_rx,freq_tx,1,dual_tx,rxgain,txgain,eNB_flag,rf_mode,rf_rxdc,rf_local,rf_vcocal);
|
||||
amp = pow2(13)-1;
|
||||
n_bit = 16;
|
||||
end
|
||||
|
||||
s = zeros(76800,2);
|
||||
|
||||
select = 1;
|
||||
|
||||
switch(select)
|
||||
|
||||
case 1
|
||||
s(:,1) = floor(amp * (exp(sqrt(-1)*.5*pi*(0:((76800)-1)))));
|
||||
s(:,2) = floor(amp * (exp(sqrt(-1)*.5*pi*(0:((76800)-1)))));
|
||||
|
||||
case 2
|
||||
s(38400+128,1)= 80-1j*40;
|
||||
s(38400+138,1)= -80+1j*40;
|
||||
|
||||
case 3
|
||||
for i=0:(12*5-1)
|
||||
s((38401+640*i):(38400+640*(i+1)),1)=floor(linspace(-127,128,640)); %+1j*floor(linspace(128,-127,640));
|
||||
end
|
||||
|
||||
case 4
|
||||
pss0_f0=[0,0,0,0,0,0,0,0,0,0,32767,0,-26120,-19785,11971,-30502,-24020,-22288,32117,6492,31311,9658,-16384,-28378,25100,-21063,-7292,-31946,20429,25618,14948,29158,11971,-30502,31311,9658,25100,-21063,-16384,28377,-24020,22287,32117,6492,-7292,31945,20429,25618,-26120,-19785,-16384,-28378,-16384,28377,-26120,-19785,-32402,4883,31311,-9659,32117,6492,-7292,-31946,32767,-1,25100,-21063,-24020,22287,-32402,4883,-32402,4883,-24020,22287,25100,-21063,32767,-1,-7292,-31946,32117,6492,31311,-9659,-32402,4883,-26120,-19785,-16384,28377,-16384,-28378,-26120,-19785,20429,25618,-7292,31945,32117,6492,-24020,22287,-16384,28377,25100,-21063,31311,9658,11971,-30502,14948,29158,20429,25618,-7292,-31946,25100,-21063,-16384,-28378,31311,9658,32117,6492,-24020,-22288,11971,-30502,-26120,-19785,32767,0,0,0,0,0,0,0,0,0,0,0];
|
||||
|
||||
pss0_f = pss0_f0(1:2:length(pss0_f0)) + sqrt(-1)*pss0_f0(2:2:length(pss0_f0));
|
||||
|
||||
pss0_f = [0 pss0_f(37:72) zeros(1,512-73) pss0_f(1:36)];
|
||||
pss0_t = ifft(pss0_f);
|
||||
pss0_t = [pss0_t((512-127):512) pss0_t];
|
||||
pss0_t = [pss0_t zeros(1,512+36) pss0_t];
|
||||
pss0_max = max(max(abs(real(pss0_t))),max(abs(imag(pss0_t))));
|
||||
|
||||
pss0_t_fp_re = floor(real(8192*pss0_t/pss0_max));
|
||||
pss0_t_fp_im = floor(imag(8192*pss0_t/pss0_max));
|
||||
|
||||
s(38400+(1:length(pss0_t_fp_re)),1) = 2*floor(pss0_t_fp_re) + 2*sqrt(-1)*floor(pss0_t_fp_im);
|
||||
s(38400+(1:length(pss0_t_fp_re)),2) = 2*floor(pss0_t_fp_re) + 2*sqrt(-1)*floor(pss0_t_fp_im);
|
||||
otherwise
|
||||
error('unknown case')
|
||||
endswitch
|
||||
|
||||
if (cbmimo1)
|
||||
oarf_set_tx_gain(110,110,110,110);
|
||||
else
|
||||
s = s*2;
|
||||
end
|
||||
oarf_send_frame(0,s,n_bit);
|
||||
|
||||
figure(1)
|
||||
hold off
|
||||
plot(real(s(:,1)),'r')
|
||||
hold on
|
||||
plot(imag(s(:,2)),'b')
|
||||
@@ -1,27 +0,0 @@
|
||||
dual_tx=1;
|
||||
cbmimo1=0;
|
||||
|
||||
if (cbmimo1)
|
||||
oarf_config(0,1,dual_tx,255);
|
||||
amp = pow2(7)-1;
|
||||
n_bit = 8;
|
||||
else
|
||||
oarf_config_exmimo(1902600000,1,dual_tx,30);
|
||||
amp = pow2(15)-1;
|
||||
n_bit = 16;
|
||||
end
|
||||
|
||||
s = zeros(76800,2);
|
||||
s(:,1) = 8*floor(amp*OFDM_TX_FRAME(512,211,128,120,8));
|
||||
s(:,2) = 8*floor(amp*OFDM_TX_FRAME(512,211,128,120,8));
|
||||
|
||||
|
||||
%s(:,1) = amp * (exp(sqrt(-1)*.5*pi*(0:((76800)-1))));
|
||||
%s(:,2) = amp * (exp(sqrt(-1)*.5*pi*(0:((76800)-1))));
|
||||
|
||||
if (cbmimo1)
|
||||
oarf_set_tx_gain(110,110,110,110);
|
||||
end
|
||||
oarf_send_frame(0,s,n_bit);
|
||||
|
||||
plot(20*log10(abs(fft(s(:,1)))))
|
||||
@@ -1,33 +0,0 @@
|
||||
function retvalue=variouspowers(s)
|
||||
|
||||
W=25;
|
||||
|
||||
fftsize=2^ceil(log2(length(s)));
|
||||
powspectrum=fftshift(abs(fft(s-mean(s),fftsize)/sqrt(fftsize)));
|
||||
|
||||
powspectrumfilt=conv(powspectrum,ones(1,2*W+1));
|
||||
|
||||
[sigpower carrier_idx]=max(powspectrumfilt);
|
||||
|
||||
if (carrier_idx<=3*W)
|
||||
carrier_idx=3*W+1;
|
||||
end
|
||||
sigpower_dB=20*log10(sigpower);
|
||||
|
||||
|
||||
if (carrier_idx>3*W)
|
||||
|
||||
noiseplusintfspectrum=powspectrum;
|
||||
noiseplusintfspectrum(carrier_idx+(-W:W)-2*W)=zeros(1,2*W+1);
|
||||
|
||||
noiseplusintfpower_dB=10*log10(sum(noiseplusintfspectrum.^2));
|
||||
|
||||
noiseplusintfspectrum_dB=20*log10(noiseplusintfspectrum);
|
||||
noiseplusintfspectrum_dB(carrier_idx+(-W:W)-2*W)=-20;
|
||||
|
||||
%plot([ 20*log10(powspectrum) noiseplusintfspectrum_dB])
|
||||
%pause
|
||||
retvalue=[sigpower_dB noiseplusintfpower_dB];
|
||||
else
|
||||
retvalue=[sigpower_dB +Inf];
|
||||
end
|
||||
@@ -1,33 +0,0 @@
|
||||
card = input('Input card number: ', 's');
|
||||
|
||||
filename_h = ['gain_table_' card '.h']; % file to store the gain table to
|
||||
filename_mat = ['gain_table_' card '.mat'];
|
||||
|
||||
save('-mat',filename_mat,'ALL_power_dBm','ALL_rxrfmode','ALL_gain2391','ALL_gain9862','min_agc_level','max_agc_level','gain_levels','SpN0','SpN1','N0','N1','S0','S1','G0','G1','NF0','NF1','SNR0','SNR1');
|
||||
|
||||
fid = fopen(filename_h,'w');
|
||||
|
||||
fprintf(fid,'#ifndef _GAIN_TABLE_H__\n');
|
||||
fprintf(fid,'#define _GAIN_TABLE_H__\n');
|
||||
|
||||
fprintf(fid,'#define MAX_RF_GAIN %d\n',max_agc_level);
|
||||
fprintf(fid,'#define MIN_RF_GAIN %d\n',min_agc_level);
|
||||
|
||||
%fprintf(fid,'#define TCXO_OFFSET\n');
|
||||
|
||||
fprintf(fid,'struct gain_table_entry {\n');
|
||||
fprintf(fid,' unsigned char gain0;\n');
|
||||
fprintf(fid,' unsigned char gain1;\n');
|
||||
fprintf(fid,'};\n');
|
||||
|
||||
fprintf(fid,'struct gain_table_entry gain_table[MAX_RF_GAIN-MIN_RF_GAIN+1] = {\n');
|
||||
for agc_level = 1:(max_agc_level-min_agc_level)
|
||||
fprintf(fid,'%d, %d,\n',gain_levels(agc_level,:));
|
||||
end
|
||||
fprintf(fid,'%d, %d};\n',gain_levels(end,:));
|
||||
|
||||
|
||||
fprintf(fid,'#endif /* _GAIN_TABLE_H__ */\n');
|
||||
|
||||
fclose(fid);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
card = input('Input card number: ', 's');
|
||||
|
||||
filename_h = ['tcxo_val_' card '.h']; % file to store the gain table to
|
||||
|
||||
fid = fopen(filename_h,'w');
|
||||
|
||||
fprintf(fid,"#ifndef _TCXO_VAL_H__\n");
|
||||
fprintf(fid,"#define _TCXO_VAL_H__\n");
|
||||
|
||||
fprintf(fid,"#define TCXO_VAL %d\n",tcxo_freq_min);
|
||||
|
||||
fprintf(fid,"#endif /* _TCXO_VAL_H__ */\n");
|
||||
|
||||
fclose(fid);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
# Maxime Guillaud - created Wed May 10 17:47:36 CEST 2006
|
||||
# see http://etow.com/UsingGPIBOctaveLinux.htm
|
||||
|
||||
all: gpibcmd querygpib
|
||||
|
||||
|
||||
gpibcmd: gpibcmd.c
|
||||
gcc gpibcmd.c -I/usr/include/gpib/ -o gpibcmd -lgpib
|
||||
|
||||
|
||||
querygpib: querygpib.c
|
||||
gcc querygpib.c -I/usr/include/gpib/ -o querygpib -lgpib
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/* Code of gpibcmd.c */
|
||||
//
|
||||
// BrettFrymire
|
||||
// 04/07/2004
|
||||
// Version 0.9
|
||||
//Compile like this
|
||||
//gcc gpibcmd.c -o test -lgpib
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "/usr/include/gpib/ib.h"
|
||||
#include <strings.h>
|
||||
|
||||
/* Forward declares */
|
||||
void check_args(int argc);
|
||||
|
||||
|
||||
/* Type declarations */
|
||||
|
||||
|
||||
|
||||
void check_args(int argc)
|
||||
{
|
||||
if (argc != 3) {
|
||||
printf("\nUsage: program Gpibaddress Command\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
check_args(argc);
|
||||
unsigned short addlist[2] = {atoi(argv[1]), NOADDR}; // list to enable inst
|
||||
//Reset Card 0 (i.e:gpib0)
|
||||
SendIFC(0);
|
||||
|
||||
// ENABLE all on GPIB bus
|
||||
EnableRemote(0, addlist);
|
||||
|
||||
// If error, Bye!
|
||||
if (ibsta & ERR) {
|
||||
printf("Instrument enable failed!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Send (BoardID, GPIBAddr, Command, LengthCommand, Endline)
|
||||
// typical command:
|
||||
// Send(0, 20, "*RST", 4l, NLend);
|
||||
|
||||
Send(0, atoi(argv[1]), argv[2], strlen(argv[2]), NLend);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,57 +0,0 @@
|
||||
/* Code of QueryGpib.c */
|
||||
//
|
||||
// BrettFrymire
|
||||
// 04/07/2004
|
||||
// Version 0.9
|
||||
//Compile like this
|
||||
//gcc test.c -o test -lgpib
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ib.h"
|
||||
#include <strings.h>
|
||||
|
||||
|
||||
/* Type declarations */
|
||||
char inData[19];
|
||||
|
||||
|
||||
void check_args(int argc)
|
||||
{
|
||||
if (argc != 3) {
|
||||
printf("\nUsage: program Gpibaddress Command\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int loop;
|
||||
check_args(argc);
|
||||
|
||||
for (loop=0; loop<=19-1; loop++) {
|
||||
inData[loop] = 0;
|
||||
}
|
||||
|
||||
unsigned short addlist[2] = {atoi(argv[1]), NOADDR}; // list to enable inst
|
||||
|
||||
//Reset Card 0 (i.e:gpib0)
|
||||
SendIFC(0);
|
||||
// ENABLE all on GPIB bus
|
||||
EnableRemote(0, addlist);
|
||||
|
||||
// If error, Bye!
|
||||
if (ibsta & ERR) {
|
||||
printf("Instrument enable failed!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Send (BoardID, GPIBAddr, Command, LengthCommand, Endline)
|
||||
// typical command:
|
||||
// Send(0, 20, "*RST", 4l, NLend);
|
||||
Send(0, atoi(argv[1]), argv[2], strlen(argv[2]), NLend);
|
||||
Receive(0, atoi(argv[1]), inData, 19, STOPend);
|
||||
printf("%s",inData);
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
function [qresult]=QueryGPIB(addr,cmdstr);
|
||||
% Pass address of GPIB instrument and the command string to
|
||||
% trigger the query.
|
||||
% example querygpib(20, FREQ?)
|
||||
|
||||
A = system('/local/gpibquery ' sprintf('%i ',addr) cmdstr);
|
||||
qresult = sscanf(A, "%f")
|
||||
@@ -1,12 +0,0 @@
|
||||
function [] = sendgpib(addr, command);
|
||||
% Sample file showing how to interface with gpibcmd
|
||||
% Command in Octave: sendgpib (20, '"FREQ 5000"')
|
||||
% Must have the quotes around the command to work
|
||||
% addr = 20;
|
||||
% command = '"FREQ 2000"';
|
||||
|
||||
% this could be rewritten as native octave, see http://www.gnu.org/software/octave/doc/interpreter/Dynamically-Linked-Functions.html#Dynamically-Linked-Functions
|
||||
|
||||
cmdstr= ["./gpibcmd " sprintf('%i' , addr) " '" command "'"];
|
||||
disp(['sendgpib: executing >> ' cmdstr ' <<'])
|
||||
system(cmdstr);
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,257 +0,0 @@
|
||||
chsch0_sync_f = [-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
];
|
||||
@@ -1,257 +0,0 @@
|
||||
chsch0_sync_f_tx = [-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
];
|
||||
@@ -1,257 +0,0 @@
|
||||
chsch1_sync_f = [23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
];
|
||||
@@ -1,257 +0,0 @@
|
||||
chsch1_sync_f_tx = [724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
];
|
||||
@@ -1,257 +0,0 @@
|
||||
chsch2_sync_f = [-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(23170)
|
||||
23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
-23170 + j*(-23170)
|
||||
];
|
||||
@@ -1,257 +0,0 @@
|
||||
chsch2_sync_f_tx = [-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(-725)
|
||||
0 + j*(0)
|
||||
724 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(724)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
-725 + j*(-725)
|
||||
0 + j*(0)
|
||||
];
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user