FSK bridge example

This should include everything needed to build the FSK bridge example from scratch.

1) Open existing hdl/quartus/bladerf.qsf project in Quartus
        a) Generate the Nios core
                i) Tools -> QSys -> File -> Open -> navigate to ./hdl/fpga/ip/altera/nios_system/nios_system.qsys
                ii) After opening qsys file, go to Generation tab, click the "Generate" button
        b) Compile the embedded Nios image
                i) Tools -> Nios II Software Build Tools for Eclipse
                        I)   File -> Import -> General -> Existing Projects into Workspace -> Next
                                -> Browse to checkout root directory -> check both lms_spi_controller and lms_spi_controller_bsp
                                -> Finish
                        II)  right click lms_spi_controller_bsp -> NIOS II -> Generate BSP
                        III) right click lms_spi_controller -> Build
                        IV)  right click lms_spi_controller -> Make Targets -> Build... -> select mem_init_generate -> Build
        c) Synthesize FPGA image
                i) Processing -> Start Compilation

2) Compile driver and user mode applications
        a) cd linux/kernel ; make ; inmod bladeRF.ko
        b) cd ../apps; make
        c) To program the fpga execute ./simple_load c4images/blink.rbf
                i) Load bladerf.rbf from the quartus output_files directory

3) Use bladeRF's UART as an FSK bridge!

NB. The firmware upgrade utility does work, only use it on valid .img files.
This commit is contained in:
Nuand 2013-02-18 17:02:29 -08:00
commit ce7d8a7ab2
84 changed files with 18832 additions and 0 deletions

339
COPYING Normal file
View file

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
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
convey 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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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.

25
README Normal file
View file

@ -0,0 +1,25 @@
This README details how to build the FSK bridge example
To build and run the FSK bridge rea
1) Open existing hdl/quartus/bladerf.qsf project in Quartus
a) Generate the Nios core
i) Tools -> QSys -> File -> Open -> navigate to ./hdl/fpga/ip/altera/nios_system/nios_system.qsys
ii) After opening qsys file, go to Generation tab, click the "Generate" button
b) Compile the embedded Nios image
i) Tools -> Nios II Software Build Tools for Eclipse
I) File -> Import -> General -> Existing Projects into Workspace -> Next
-> Browse to checkout root directory -> check both lms_spi_controller and lms_spi_controller_bsp
-> Finish
II) right click lms_spi_controller_bsp -> NIOS II -> Generate BSP
III) right click lms_spi_controller -> Build
IV) right click lms_spi_controller -> Make Targets -> Build... -> select mem_init_generate -> Build
c) Synthesize FPGA image
i) Processing -> Start Compilation
2) Compile driver and user mode applications
a) cd linux/kernel ; make ; inmod bladeRF.ko
b) cd ../apps; make
c) To program the fpga execute ./simple_load c4images/blink.rbf
i) Load bladerf.rbf from the quartus output_files directory
3) Use bladeRF as an FSK bridge!

49
common/bladeRF.h Normal file
View file

@ -0,0 +1,49 @@
#define BLADERF_IOCTL_BASE 'N'
#define BLADE_QUERY_VERSION _IOR(BLADERF_IOCTL_BASE, 0, struct bladeRF_version)
#define BLADE_QUERY_FPGA_STATUS _IOR(BLADERF_IOCTL_BASE, 1, unsigned int)
#define BLADE_BEGIN_PROG _IOR(BLADERF_IOCTL_BASE, 2, unsigned int)
#define BLADE_END_PROG _IOR(BLADERF_IOCTL_BASE, 3, unsigned int)
#define BLADE_CHECK_PROG _IOR(BLADERF_IOCTL_BASE, 4, unsigned int)
#define BLADE_RF_RX _IOR(BLADERF_IOCTL_BASE, 5, unsigned int)
#define BLADE_RF_TX _IOR(BLADERF_IOCTL_BASE, 6, unsigned int)
#define BLADE_UPGRADE_FW _IOR(BLADERF_IOCTL_BASE, 50, unsigned int)
#define BLADE_USB_CMD_QUERY_VERSION 0
#define BLADE_USB_CMD_QUERY_FPGA_STATUS 1
#define BLADE_USB_CMD_BEGIN_PROG 2
#define BLADE_USB_CMD_END_PROG 3
#define BLADE_USB_CMD_RF_RX 4
#define BLADE_USB_CMD_RF_TX 5
#define BLADE_USB_CMD_FLASH_READ 100
#define BLADE_USB_CMD_FLASH_WRITE 101
#define BLADE_USB_CMD_FLASH_ERASE 102
#define BLADE_USB_CMD_QUERY_VERSION 0
#define BLADE_USB_CMD_QUERY_FPGA_STATUS 1
#define BLADE_USB_CMD_BEGIN_PROG 2
#define BLADE_USB_CMD_END_PROG 3
#define BLADE_USB_CMD_RF_RX 4
struct bladeRF_version {
unsigned short major;
unsigned short minor;
};
struct bladeRF_firmware {
unsigned int len;
unsigned char *ptr;
};
#define BLADE_USB_TYPE_OUT 0x40
#define BLADE_USB_TYPE_IN 0xC0
#define BLADE_USB_TIMEOUT_MS 1000
#define USB_NUAND_VENDOR_ID 0x04b4
#define USB_NUAND_BLADERF_PRODUCT_ID 0x00f1
#define NUM_CONCURRENT 8
#define NUM_DATA_URB (128)
#define DATA_BUF_SZ (1024*4)

2564
fx3_firmware/.cproject Normal file

File diff suppressed because it is too large Load diff

81
fx3_firmware/.project Normal file
View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>bladeRF</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>cs-make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/BulkLoopAuto/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="us-ascii"?>
<CyXmlSerializer>
<!--This file is machine generated and read. It is not intended to be edited by hand.-->
<!--Due to this, there is no schema for this file.-->
<CyGuid_7d237aff-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtGpif2exe" version="2">
<CyGuid_7d237b00-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtProject" version="1">
<ProjectDocs>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="gpif2model.xml" persistent="./projectfiles/gpif2model.xml" target="7d237b02-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="gpif2view.xml" persistent="./projectfiles/gpif2view.xml" target="7d237b01-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="gpif2timingsimulation.xml" persistent="./projectfiles/gpif2timingsimulation.xml" target="3ad448c6-d155-4f76-a7fb-e760cd8e6feb">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
</ProjectDocs>
<OutputDocs>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="cyfxgpif2config.h" persistent="C:\Users\Robert\Documents\GPIF II Designer\waste.cydsn\cyfxgpif2config.h" target="7d237afd-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="cyfxgpif2config.h" persistent="C:\Users\Robert\Documents\GPIF II Designer\c4loader.cydsn\cyfxgpif2config.h" target="7d237afd-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
</OutputDocs>
</CyGuid_7d237b00-d944-11da-aaba-00164119d63b>
<Settings>
<Setting name="GPIF2_OutputName" value="cyfxgpif2config" />
<Setting name="GPIF2_OutputLocation" value="${ProjectDir}" />
<Setting name="GPIF2_Template" value="cygpif2cheadertemplate" />
</Settings>
</CyGuid_7d237aff-d944-11da-aaba-00164119d63b>
</CyXmlSerializer>

View file

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<GPIFIIModel version="3">
<InterfaceDefination>
<InterfaceSetting>
<I2SEnabled>False</I2SEnabled>
<I2CEnabled>False</I2CEnabled>
<SPIEnabled>False</SPIEnabled>
<I2SEnabled>False</I2SEnabled>
<ADMuxedEnabled>False</ADMuxedEnabled>
<InterfaceType>Master</InterfaceType>
<CommunicationType>Synchronous</CommunicationType>
<ClockSource>Internal</ClockSource>
<ClockEdge>Positive</ClockEdge>
<Endianness>LittleEndian</Endianness>
<DataBusWidth>Bit16</DataBusWidth>
<AddressBuswidth>0</AddressBuswidth>
</InterfaceSetting>
</InterfaceDefination>
<Signals>
<Signal ElementId="OUTPUT0" SignalType="Output" SpecialFunction="None">
<DisplayName>OUTPUT0</DisplayName>
<GPIOPinNumber>GPIO_26</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Delay>Beta</Delay>
<AssetionType>Toggle</AssetionType>
</Signal>
</Signals>
<StateMachine>
<AddressCounter />
<DataCounter />
<ControlCounter />
<AddressComparator />
<DataComparator />
<ControlComparator />
<DRQ />
<AddrData />
<State ElementId="STARTSTATE0" StateType="StartState">
<DisplayName>START</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
</State>
<State ElementId="STATE0" StateType="NormalState">
<DisplayName>STATE0</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread3</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DriveNewData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
</State>
<State ElementId="STATE1" StateType="NormalState">
<DisplayName>INIT</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
</State>
<State ElementId="STATE4" StateType="NormalState">
<DisplayName>STATE2</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread3</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DrivePreviousSetData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
</State>
<State ElementId="STATE5" StateType="NormalState">
<DisplayName>STATE5</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread3</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DrivePreviousSetData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
<Action ElementId="DR_GPIO0" ActionType="DR_GPIO">
<ControlPinName>OUTPUT0</ControlPinName>
</Action>
</State>
<State ElementId="STATE3" StateType="NormalState">
<DisplayName>STATE1</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread3</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DrivePreviousSetData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
<Action ElementId="DR_GPIO0" ActionType="DR_GPIO">
<ControlPinName>OUTPUT0</ControlPinName>
</Action>
</State>
<State ElementId="STATE6" StateType="NormalState">
<DisplayName>STATE4</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread3</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DrivePreviousSetData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
</State>
<Transition ElementId="TRANSITION0" SourceState="STATE1" DestinationState="STATE0" Equation="DMA_RDY_TH3" />
<Transition ElementId="TRANSITION1" SourceState="STARTSTATE0" DestinationState="STATE1" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION5" SourceState="STATE0" DestinationState="STATE3" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION6" SourceState="STATE3" DestinationState="STATE4" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION7" SourceState="STATE4" DestinationState="STATE5" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION8" SourceState="STATE5" DestinationState="STATE6" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION9" SourceState="STATE6" DestinationState="STATE0" Equation="DMA_RDY_TH3" />
</StateMachine>
</GPIFIIModel>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<GPIFIITimingSimulation version="1">
<Clock>100</Clock>
<BufferSize>512</BufferSize>
<WaterMark>0</WaterMark>
<Scenario Name="SCENARIO0" CurrentThread="Thread3">
<State StateId="STARTSTATE0" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE0" WaitNumber="0" />
<State StateId="STATE3" WaitNumber="0" />
<State StateId="STATE4" WaitNumber="0" />
<State StateId="STATE5" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE0" WaitNumber="0" />
</Scenario>
</GPIFIITimingSimulation>

View file

@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<Root version="4">
<CyStates>
<CyNormalState>
<Left>515</Left>
<Top>214.446666666667</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE0</Name>
<DisplayName>STATE0</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>225</Left>
<Top>137.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE1</Name>
<DisplayName>INIT</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>679</Left>
<Top>96.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE3</Name>
<DisplayName>STATE1</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>885</Left>
<Top>36.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE4</Name>
<DisplayName>STATE2</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>1104</Left>
<Top>100.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE5</Name>
<DisplayName>STATE3</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>1265</Left>
<Top>233.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE6</Name>
<DisplayName>STATE4</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyStartState>
<Left>29</Left>
<Top>18.4466666666667</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STARTSTATE0</Name>
<DisplayName>START</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyStartState>
</CyStates>
<CyTransitions>
<CyTransition>
<Name>TRANSITION9</Name>
<TransitionEquation>DMA_RDY_TH3</TransitionEquation>
<SourceName>STATE6</SourceName>
<SinkName>STATE0</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION8</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STATE5</SourceName>
<SinkName>STATE6</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION7</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STATE4</SourceName>
<SinkName>STATE5</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION6</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STATE3</SourceName>
<SinkName>STATE4</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION5</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STATE0</SourceName>
<SinkName>STATE3</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION1</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STARTSTATE0</SourceName>
<SinkName>STATE1</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION0</Name>
<TransitionEquation>DMA_RDY_TH3</TransitionEquation>
<SourceName>STATE1</SourceName>
<SinkName>STATE0</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
</CyTransitions>
</Root>

View file

@ -0,0 +1,75 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := cs-rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
SECONDARY_LIST += \
bladeRF.lst \
SECONDARY_SIZE += \
bladeRF.siz \
# All Target
all: bladeRF.elf secondary-outputs
# Tool invocations
bladeRF.elf: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: ARM Sourcery Windows GCC C Linker'
arm-none-eabi-gcc $(OBJS) $(USER_OBJS) $(LIBS) -T"C:\Cypress\EZ-USB FX3 SDK\1.2\/firmware/common/fx3.ld" -nostartfiles -Wl,-Map,bladeRF.map -Wl,-d -Wl,--no-wchar-size-warning -Wl,--entry,CyU3PFirmwareEntry "C:\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\lib\fx3_debug\cyfxapi.a" "C:\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\lib\fx3_debug\cyu3lpp.a" "C:\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\lib\fx3_debug\cyu3threadx.a" "C:\Cypress\EZ-USB FX3 SDK\1.2\\arm-none-eabi\lib\libc.a" "C:\Cypress\EZ-USB FX3 SDK\1.2\\lib\gcc\arm-none-eabi\4.5.2\libgcc.a" -mcpu=arm926ej-s -mthumb-interwork -g -gdwarf-2 -o"bladeRF.elf"
@echo 'Finished building target: $@'
@echo ' '
$(MAKE) --no-print-directory post-build
bladeRF.lst: bladeRF.elf
@echo 'Invoking: ARM Sourcery Windows GNU Create Listing'
arm-none-eabi-objdump -h -S bladeRF.elf >"bladeRF.lst"
@echo 'Finished building: $@'
@echo ' '
bladeRF.siz: bladeRF.elf
@echo 'Invoking: ARM Sourcery Windows GNU Print Size'
arm-none-eabi-size --format=berkeley bladeRF.elf
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(SECONDARY_SIZE)$(OBJS)$(C_DEPS)$(ASM_DEPS)$(EXECUTABLES)$(SECONDARY_LIST)$(S_UPPER_DEPS) bladeRF.elf
-@echo ' '
post-build:
-@echo 'Converting ELF to image (.img) format'
-"C:\Cypress\EZ-USB FX3 SDK\1.2\\util\elf2img\elf2img.exe" -i bladeRF.elf -o bladeRF.img
-@echo ' '
secondary-outputs: $(SECONDARY_LIST) $(SECONDARY_SIZE)
.PHONY: all clean dependents
.SECONDARY: post-build
-include ../makefile.targets

View file

@ -0,0 +1,7 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
USER_OBJS :=
LIBS :=

View file

@ -0,0 +1,22 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
ELF_SRCS :=
O_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
SECONDARY_SIZE :=
OBJS :=
C_DEPS :=
ASM_DEPS :=
EXECUTABLES :=
SECONDARY_LIST :=
S_UPPER_DEPS :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \

View file

@ -0,0 +1,47 @@
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../bladeRF.c \
../cyfxbladeRFusbdscr.c \
../cyfxtx.c \
../spi_flash_lib.c
S_UPPER_SRCS += \
../cyfx_gcc_startup.S
OBJS += \
./bladeRF.o \
./cyfx_gcc_startup.o \
./cyfxbladeRFusbdscr.o \
./cyfxtx.o \
./spi_flash_lib.o
C_DEPS += \
./bladeRF.d \
./cyfxbladeRFusbdscr.d \
./cyfxtx.d \
./spi_flash_lib.d
S_UPPER_DEPS += \
./cyfx_gcc_startup.d
# Each subdirectory must supply rules for building sources it contributes
%.o: ../%.c
@echo 'Building file: $<'
@echo 'Invoking: ARM Sourcery Windows GCC C Compiler'
arm-none-eabi-gcc -D__CYU3P_TX__=1 -I"C:\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\inc" -O0 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -mcpu=arm926ej-s -mthumb-interwork -g -gdwarf-2 -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '
%.o: ../%.S
@echo 'Building file: $<'
@echo 'Invoking: ARM Sourcery Windows GCC Assembler'
arm-none-eabi-gcc -x assembler-with-cpp -I"C:\Cypress\EZ-USB FX3 SDK\1.2\\firmware\u3p_firmware\inc" -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -mcpu=arm926ej-s -mthumb-interwork -g -gdwarf-2 -o"$@" "$<"
@echo 'Finished building: $<'
@echo ' '

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="us-ascii"?>
<CyXmlSerializer>
<!--This file is machine generated and read. It is not intended to be edited by hand.-->
<!--Due to this, there is no schema for this file.-->
<CyGuid_7d237aff-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtGpif2exe" version="2">
<CyGuid_7d237b00-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtProject" version="1">
<ProjectDocs>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="gpif2model.xml" persistent="./projectfiles/gpif2model.xml" target="7d237b02-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="gpif2view.xml" persistent="./projectfiles/gpif2view.xml" target="7d237b01-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="gpif2timingsimulation.xml" persistent="./projectfiles/gpif2timingsimulation.xml" target="3ad448c6-d155-4f76-a7fb-e760cd8e6feb">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
</ProjectDocs>
<OutputDocs>
<CyGuid_7d237b03-d944-11da-aaba-00164119d63b type_name="CyGpif2Designer.Common.PrjMgmt.Model.CyPrjMgmtItem" name="cyfxgpif2config.h" persistent="C:\Users\Robert\Documents\GPIF II Designer\RFlink.cydsn\cyfxgpif2config.h" target="7d237afd-d944-11da-aaba-00164119d63b">
<Hidden v="False" />
</CyGuid_7d237b03-d944-11da-aaba-00164119d63b>
</OutputDocs>
</CyGuid_7d237b00-d944-11da-aaba-00164119d63b>
<Settings>
<Setting name="GPIF2_OutputName" value="cyfxgpif2config" />
<Setting name="GPIF2_OutputLocation" value="${ProjectDir}" />
<Setting name="GPIF2_Template" value="cygpif2cheadertemplate" />
</Settings>
</CyGuid_7d237aff-d944-11da-aaba-00164119d63b>
</CyXmlSerializer>

View file

@ -0,0 +1,203 @@
<?xml version="1.0" encoding="UTF-8"?>
<GPIFIIModel version="3">
<InterfaceDefination>
<InterfaceSetting>
<I2SEnabled>False</I2SEnabled>
<I2CEnabled>False</I2CEnabled>
<SPIEnabled>False</SPIEnabled>
<I2SEnabled>False</I2SEnabled>
<ADMuxedEnabled>False</ADMuxedEnabled>
<InterfaceType>Master</InterfaceType>
<CommunicationType>Synchronous</CommunicationType>
<ClockSource>Internal</ClockSource>
<ClockEdge>Positive</ClockEdge>
<Endianness>LittleEndian</Endianness>
<DataBusWidth>Bit32</DataBusWidth>
<AddressBuswidth>0</AddressBuswidth>
</InterfaceSetting>
</InterfaceDefination>
<Signals>
<Signal ElementId="INPUT0" SignalType="Input" SpecialFunction="None">
<DisplayName>RX_0</DisplayName>
<GPIOPinNumber>GPIO_17</GPIOPinNumber>
<Polarity>ActiveHigh</Polarity>
</Signal>
<Signal ElementId="INPUT1" SignalType="Input" SpecialFunction="None">
<DisplayName>RX_1</DisplayName>
<GPIOPinNumber>GPIO_18</GPIOPinNumber>
<Polarity>ActiveHigh</Polarity>
</Signal>
<Signal ElementId="INPUT2" SignalType="Input" SpecialFunction="None">
<DisplayName>TX_2</DisplayName>
<GPIOPinNumber>GPIO_19</GPIOPinNumber>
<Polarity>ActiveHigh</Polarity>
</Signal>
<Signal ElementId="INPUT3" SignalType="Input" SpecialFunction="None">
<DisplayName>TX_3</DisplayName>
<GPIOPinNumber>GPIO_20</GPIOPinNumber>
<Polarity>ActiveHigh</Polarity>
</Signal>
<Signal ElementId="OUTPUT0" SignalType="Output" SpecialFunction="None">
<DisplayName>DMA_RX</DisplayName>
<GPIOPinNumber>GPIO_21</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Delay>Alpha</Delay>
<AssetionType>Assert</AssetionType>
</Signal>
<Signal ElementId="FLAG0" SignalType="Flags" SpecialFunction="None">
<DisplayName>FLAG0</DisplayName>
<GPIOPinNumber>GPIO_22</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Flags>Thread_0_DMA_Ready</Flags>
</Signal>
<Signal ElementId="FLAG1" SignalType="Flags" SpecialFunction="None">
<DisplayName>FLAG1</DisplayName>
<GPIOPinNumber>GPIO_23</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Flags>Thread_1_DMA_Ready</Flags>
</Signal>
<Signal ElementId="FLAG2" SignalType="Flags" SpecialFunction="None">
<DisplayName>FLAG2</DisplayName>
<GPIOPinNumber>GPIO_24</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Flags>Thread_2_DMA_Ready</Flags>
</Signal>
<Signal ElementId="FLAG3" SignalType="Flags" SpecialFunction="None">
<DisplayName>FLAG3</DisplayName>
<GPIOPinNumber>GPIO_25</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Flags>Thread_3_DMA_Ready</Flags>
</Signal>
<Signal ElementId="OUTPUT1" SignalType="Output" SpecialFunction="None">
<DisplayName>DMA_TX</DisplayName>
<GPIOPinNumber>GPIO_26</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Delay>Alpha</Delay>
<AssetionType>Assert</AssetionType>
</Signal>
<Signal ElementId="OUTPUT2" SignalType="Output" SpecialFunction="None">
<DisplayName>DMA_DONE</DisplayName>
<GPIOPinNumber>GPIO_27</GPIOPinNumber>
<IntialValue>Low</IntialValue>
<Polarity>ActiveHigh</Polarity>
<Delay>Alpha</Delay>
<AssetionType>Assert</AssetionType>
</Signal>
</Signals>
<StateMachine>
<AddressCounter />
<DataCounter />
<ControlCounter />
<AddressComparator />
<DataComparator />
<ControlComparator />
<DRQ />
<AddrData />
<State ElementId="STARTSTATE0" StateType="StartState">
<DisplayName>START</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
</State>
<State ElementId="STATE0" StateType="NormalState">
<DisplayName>INIT</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
</State>
<State ElementId="STATE1" StateType="NormalState">
<DisplayName>IF_RX_0</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="IN_DATA0" ActionType="IN_DATA">
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread0</ThreadNumber>
<SampleData>True</SampleData>
<WriteDataIntoDataSink>True</WriteDataIntoDataSink>
</Action>
</State>
<State ElementId="STATE2" StateType="NormalState">
<DisplayName>IF_RX_1</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="IN_DATA0" ActionType="IN_DATA">
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread1</ThreadNumber>
<SampleData>True</SampleData>
<WriteDataIntoDataSink>True</WriteDataIntoDataSink>
</Action>
</State>
<State ElementId="STATE10" StateType="NormalState">
<DisplayName>IF_TX_2</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread2</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DriveNewData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
</State>
<State ElementId="STATE5" StateType="NormalState">
<DisplayName>DONE</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_GPIO0" ActionType="DR_GPIO">
<ControlPinName>DMA_DONE</ControlPinName>
</Action>
</State>
<State ElementId="STATE6" StateType="NormalState">
<DisplayName>WAIT_0</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
</State>
<State ElementId="STATE12" StateType="NormalState">
<DisplayName>IF_TX_3</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_DATA0" ActionType="DR_DATA">
<IsDataCounterConnected>False</IsDataCounterConnected>
<DataSourceSink>Socket</DataSourceSink>
<ThreadNumber>Thread3</ThreadNumber>
<SyncBurstMode>Enable</SyncBurstMode>
<DriveNewData>DriveNewData</DriveNewData>
<UpdateSource>True</UpdateSource>
</Action>
</State>
<State ElementId="STATE13" StateType="NormalState">
<DisplayName>IF_TX</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_GPIO0" ActionType="DR_GPIO">
<ControlPinName>DMA_TX</ControlPinName>
</Action>
</State>
<State ElementId="STATE11" StateType="NormalState">
<DisplayName>IF_RX</DisplayName>
<RepeatUntillNextTransition>True</RepeatUntillNextTransition>
<RepeatCount>0</RepeatCount>
<Action ElementId="DR_GPIO0" ActionType="DR_GPIO">
<ControlPinName>DMA_RX</ControlPinName>
</Action>
</State>
<Transition ElementId="TRANSITION0" SourceState="STARTSTATE0" DestinationState="STATE0" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION23" SourceState="STATE13" DestinationState="STATE10" Equation="TX_2" />
<Transition ElementId="TRANSITION1" SourceState="STATE1" DestinationState="STATE5" Equation="!DMA_RDY_TH0" />
<Transition ElementId="TRANSITION2" SourceState="STATE2" DestinationState="STATE5" Equation="!DMA_RDY_TH1" />
<Transition ElementId="TRANSITION17" SourceState="STATE10" DestinationState="STATE5" Equation="!DMA_RDY_TH2" />
<Transition ElementId="TRANSITION24" SourceState="STATE13" DestinationState="STATE12" Equation="TX_3" />
<Transition ElementId="TRANSITION19" SourceState="STATE11" DestinationState="STATE1" Equation="RX_0" />
<Transition ElementId="TRANSITION12" SourceState="STATE0" DestinationState="STATE6" Equation="LOGIC_ONE" />
<Transition ElementId="TRANSITION22" SourceState="STATE6" DestinationState="STATE13" Equation="TX_2|TX_3" />
<Transition ElementId="TRANSITION21" SourceState="STATE6" DestinationState="STATE11" Equation="RX_0|RX_1" />
<Transition ElementId="TRANSITION25" SourceState="STATE12" DestinationState="STATE5" Equation="!DMA_RDY_TH3" />
<Transition ElementId="TRANSITION20" SourceState="STATE11" DestinationState="STATE2" Equation="RX_1" />
<Transition ElementId="TRANSITION26" SourceState="STATE5" DestinationState="STATE6" Equation="LOGIC_ONE" />
</StateMachine>
</GPIFIIModel>

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<GPIFIITimingSimulation version="1">
<Clock>100</Clock>
<BufferSize>16</BufferSize>
<WaterMark>12</WaterMark>
<Scenario Name="SCENARIO0" CurrentThread="Thread0">
<State StateId="STARTSTATE0" WaitNumber="0" />
<State StateId="STATE0" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE11" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE1" WaitNumber="0" />
<State StateId="STATE5" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
<State StateId="STATE6" WaitNumber="0" />
</Scenario>
</GPIFIITimingSimulation>

View file

@ -0,0 +1,260 @@
<?xml version="1.0" encoding="UTF-8"?>
<Root version="4">
<CyStates>
<CyNormalState>
<Left>224</Left>
<Top>274.446666666667</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE0</Name>
<DisplayName>INIT</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>771</Left>
<Top>129.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE1</Name>
<DisplayName>IF_RX_0</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>770</Left>
<Top>237.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE2</Name>
<DisplayName>IF_RX_1</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>1024</Left>
<Top>262.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE5</Name>
<DisplayName>DONE</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>491</Left>
<Top>271.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE6</Name>
<DisplayName>WAIT_0</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>771</Left>
<Top>357.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE10</Name>
<DisplayName>IF_TX_2</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>635</Left>
<Top>166.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE11</Name>
<DisplayName>IF_RX</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>772</Left>
<Top>470.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE12</Name>
<DisplayName>IF_TX_3</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyNormalState>
<Left>631</Left>
<Top>418.41</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STATE13</Name>
<DisplayName>IF_TX</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyNormalState>
<CyStartState>
<Left>29</Left>
<Top>18.4466666666667</Top>
<Width>83</Width>
<Height>70</Height>
<Name>STARTSTATE0</Name>
<DisplayName>START</DisplayName>
<zIndex>1</zIndex>
<IsGroup>False</IsGroup>
<ParentID>00000000-0000-0000-0000-000000000000</ParentID>
</CyStartState>
</CyStates>
<CyTransitions>
<CyTransition>
<Name>TRANSITION26</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STATE5</SourceName>
<SinkName>STATE6</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION25</Name>
<TransitionEquation>!DMA_RDY_TH3</TransitionEquation>
<SourceName>STATE12</SourceName>
<SinkName>STATE5</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION24</Name>
<TransitionEquation>TX_3</TransitionEquation>
<SourceName>STATE13</SourceName>
<SinkName>STATE12</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION23</Name>
<TransitionEquation>TX_2</TransitionEquation>
<SourceName>STATE13</SourceName>
<SinkName>STATE10</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION22</Name>
<TransitionEquation>TX_2|TX_3</TransitionEquation>
<SourceName>STATE6</SourceName>
<SinkName>STATE13</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION21</Name>
<TransitionEquation>RX_0|RX_1</TransitionEquation>
<SourceName>STATE6</SourceName>
<SinkName>STATE11</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION20</Name>
<TransitionEquation>RX_1</TransitionEquation>
<SourceName>STATE11</SourceName>
<SinkName>STATE2</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION19</Name>
<TransitionEquation>RX_0</TransitionEquation>
<SourceName>STATE11</SourceName>
<SinkName>STATE1</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION17</Name>
<TransitionEquation>!DMA_RDY_TH2</TransitionEquation>
<SourceName>STATE10</SourceName>
<SinkName>STATE5</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION12</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STATE0</SourceName>
<SinkName>STATE6</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION2</Name>
<TransitionEquation>!DMA_RDY_TH1</TransitionEquation>
<SourceName>STATE2</SourceName>
<SinkName>STATE5</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION1</Name>
<TransitionEquation>!DMA_RDY_TH0</TransitionEquation>
<SourceName>STATE1</SourceName>
<SinkName>STATE5</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
<CyTransition>
<Name>TRANSITION0</Name>
<TransitionEquation>LOGIC_ONE</TransitionEquation>
<SourceName>STARTSTATE0</SourceName>
<SinkName>STATE0</SinkName>
<SourceConnectorName>Connector</SourceConnectorName>
<SinkConnectorName>Connector</SinkConnectorName>
<SourceArrowSymbol>None</SourceArrowSymbol>
<SinkArrowSymbol>Arrow</SinkArrowSymbol>
<zIndex>0</zIndex>
</CyTransition>
</CyTransitions>
</Root>

1104
fx3_firmware/bladeRF.c Normal file

File diff suppressed because it is too large Load diff

71
fx3_firmware/bladeRF.h Normal file
View file

@ -0,0 +1,71 @@
#ifndef _INCLUDED_BLADE_H_
#define _INCLUDED_BLADE_H_
#include "cyu3externcstart.h"
#include "cyu3types.h"
#include "cyu3usbconst.h"
#include "../common/bladeRF.h"
#define BLADE_GPIF_16_32BIT_CONF_SELECT (0)
#define BLADE_DMA_BUF_COUNT (2)
#define BLADE_DMA_TX_SIZE (0)
#define BLADE_DMA_RX_SIZE (0)
#define BLADE_THREAD_STACK (0x0400)
#define BLADE_THREAD_PRIORITY (8)
// interface #0
#define BLADE_FPGA_EP_PRODUCER 0x02
#define BLADE_FPGA_CONFIG_SOCKET CY_U3P_UIB_SOCKET_PROD_2
// interface #1
#define BLADE_RF_SAMPLE_EP_PRODUCER 0x01
#define BLADE_RF_SAMPLE_EP_PRODUCER_USB_SOCKET CY_U3P_UIB_SOCKET_PROD_1
#define BLADE_UART_EP_PRODUCER 0x02
#define BLADE_UART_EP_PRODUCER_USB_SOCKET CY_U3P_UIB_SOCKET_PROD_2
#define BLADE_RF_SAMPLE_EP_CONSUMER 0x81
#define BLADE_RF_SAMPLE_EP_CONSUMER_USB_SOCKET CY_U3P_UIB_SOCKET_CONS_1
#define BLADE_UART_EP_CONSUMER 0x82
#define BLADE_UART_EP_CONSUMER_USB_SOCKET CY_U3P_UIB_SOCKET_CONS_2
// interface #2
// doesn't actually use BULK, EP exists for debugging purposes
/* Extern definitions for the USB Descriptors */
extern const uint8_t CyFxUSB20DeviceDscr[];
extern const uint8_t CyFxUSB30DeviceDscr[];
extern const uint8_t CyFxUSBDeviceQualDscr[];
extern const uint8_t CyFxUSBFSConfigDscr[];
extern const uint8_t CyFxUSBHSConfigDscr[];
extern const uint8_t CyFxUSBBOSDscr[];
extern const uint8_t CyFxUSBSSConfigDscr[];
extern const uint8_t CyFxUSBStringLangIDDscr[];
extern const uint8_t CyFxUSBManufactureDscr[];
extern const uint8_t CyFxUSBProductDscr[];
#include "cyu3externcend.h"
int FpgaBeginProgram(void);
void NuandFirmwareStart(void);
CyU3PReturnStatus_t CyFxSpiEraseSector(CyBool_t /* isErase */, uint8_t /* sector */);
void NuandGPIOReconfigure(CyBool_t /* fullGpif */, CyBool_t /* warm */);
int FpgaBeginProgram(void);
extern uint32_t glAppMode;
#define GPIO_nSTATUS 52
#define GPIO_nCONFIG 51
#define GPIO_CONFDONE 50
#define GPIO_SYS_RST 24
#define GPIO_RX_EN 21
#define GPIO_TX_EN 22
#define MODE_NO_CONFIG 0
#define MODE_FPGA_CONFIG 1
#define MODE_RF_CONFIG 2
#define MODE_FW_CONFIG 3
#endif

View file

@ -0,0 +1,49 @@
#ifndef _INCLUDED_BLADE_H_
#define _INCLUDED_BLADE_H_
#include "cyu3externcstart.h"
#include "cyu3types.h"
#include "cyu3usbconst.h"
/* 16/32 bit GPIF Configuration select */
/* Set BLADE_GPIF_16_32BIT_CONF_SELECT = 0 for 16 bit GPIF data bus.
* Set BLADE_GPIF_16_32BIT_CONF_SELECT = 1 for 32 bit GPIF data bus.
*/
#define BLADE_GPIF_16_32BIT_CONF_SELECT (0)
#define BLADE_DMA_BUF_COUNT (2)
#define BLADE_DMA_TX_SIZE (0)
#define BLADE_DMA_RX_SIZE (0)
#define BLADE_THREAD_STACK (0x0400)
#define BLADE_THREAD_PRIORITY (8)
#define CY_FX_EP_PRODUCER 0x01 /* EP 1 OUT */
#define BLADE_FPGA_EP_PRODUCER 0x02 /* EP 2 OUT */
#define CY_FX_EP_CONSUMER 0x81 /* EP 1 IN */
#define CY_FX_PRODUCER_USB_SOCKET CY_U3P_UIB_SOCKET_PROD_1 /* USB Socket 1 is producer */
#define BLADE_FPGA_CONFIG_SOCKET CY_U3P_UIB_SOCKET_PROD_2 /* USB Socket 2 is producer */
#define CY_FX_CONSUMER_USB_SOCKET CY_U3P_UIB_SOCKET_CONS_1 /* USB Socket 1 is consumer */
/* Used with FX3 Silicon. */
#define CY_FX_PRODUCER_PPORT_SOCKET CY_U3P_PIB_SOCKET_0 /* P-port Socket 0 is producer */
#define CY_FX_CONSUMER_PPORT_SOCKET CY_U3P_PIB_SOCKET_3 /* P-port Socket 3 is consumer */
/* Extern definitions for the USB Descriptors */
extern const uint8_t CyFxUSB20DeviceDscr[];
extern const uint8_t CyFxUSB30DeviceDscr[];
extern const uint8_t CyFxUSBDeviceQualDscr[];
extern const uint8_t CyFxUSBFSConfigDscr[];
extern const uint8_t CyFxUSBHSConfigDscr[];
extern const uint8_t CyFxUSBBOSDscr[];
extern const uint8_t CyFxUSBSSConfigDscr[];
extern const uint8_t CyFxUSBStringLangIDDscr[];
extern const uint8_t CyFxUSBManufactureDscr[];
extern const uint8_t CyFxUSBProductDscr[];
#include "cyu3externcend.h"
#endif /* _INCLUDED_BLADE_H_ */
/*[]*/

View file

@ -0,0 +1,417 @@
#include "cyfxbladeRF.h"
/* Standard device descriptor for USB 3.0 */
const uint8_t CyFxUSB30DeviceDscr[] __attribute__ ((aligned (32))) =
{
0x12, /* Descriptor size */
CY_U3P_USB_DEVICE_DESCR, /* Device descriptor type */
0x00,0x03, /* USB 3.0 */
0x00, /* Device class */
0x00, /* Device sub-class */
0x00, /* Device protocol */
0x09, /* Maxpacket size for EP0 : 2^9 */
0xB4,0x04, /* Vendor ID */
0xF1,0x00, /* Product ID */
0x00,0x00, /* Device release number */
0x01, /* Manufacture string index */
0x02, /* Product string index */
0x00, /* Serial number string index */
0x01 /* Number of configurations */
};
/* Standard device descriptor for USB 2.0 */
const uint8_t CyFxUSB20DeviceDscr[] __attribute__ ((aligned (32))) =
{
0x12, /* Descriptor size */
CY_U3P_USB_DEVICE_DESCR, /* Device descriptor type */
0x10,0x02, /* USB 2.10 */
0x00, /* Device class */
0x00, /* Device sub-class */
0x00, /* Device protocol */
0x40, /* Maxpacket size for EP0 : 64 bytes */
0xB4,0x04, /* Vendor ID */
0xF1,0x00, /* Product ID */
0x00,0x00, /* Device release number */
0x01, /* Manufacture string index */
0x02, /* Product string index */
0x00, /* Serial number string index */
0x01 /* Number of configurations */
};
/* Binary device object store descriptor */
const uint8_t CyFxUSBBOSDscr[] __attribute__ ((aligned (32))) =
{
0x05, /* Descriptor size */
CY_U3P_BOS_DESCR, /* Device descriptor type */
0x16,0x00, /* Length of this descriptor and all sub descriptors */
0x02, /* Number of device capability descriptors */
/* USB 2.0 extension */
0x07, /* Descriptor size */
CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
CY_U3P_USB2_EXTN_CAPB_TYPE, /* USB 2.0 extension capability type */
0x02,0x00,0x00,0x00, /* Supported device level features: LPM support */
/* SuperSpeed device capability */
0x0A, /* Descriptor size */
CY_U3P_DEVICE_CAPB_DESCR, /* Device capability type descriptor */
CY_U3P_SS_USB_CAPB_TYPE, /* SuperSpeed device capability type */
0x00, /* Supported device level features */
0x0E,0x00, /* Speeds supported by the device : SS, HS and FS */
0x03, /* Functionality support */
0x00, /* U1 Device Exit latency */
0x00,0x00 /* U2 Device Exit latency */
};
/* Standard device qualifier descriptor */
const uint8_t CyFxUSBDeviceQualDscr[] __attribute__ ((aligned (32))) =
{
0x0A, /* Descriptor size */
CY_U3P_USB_DEVQUAL_DESCR, /* Device qualifier descriptor type */
0x00,0x02, /* USB 2.0 */
0x00, /* Device class */
0x00, /* Device sub-class */
0x00, /* Device protocol */
0x40, /* Maxpacket size for EP0 : 64 bytes */
0x01, /* Number of configurations */
0x00 /* Reserved */
};
/* Standard super speed configuration descriptor */
const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32))) =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
0x72,0x00, /* Length of this descriptor and all sub descriptors */
0x03, /* Number of interfaces */
0x01, /* Configuration number */
0x00, /* COnfiguration string index */
0x80, /* Config characteristics - Bus powered */
0x32, /* Max power consumption of device (in 8mA unit) : 400mA */
/* Interface descriptor #0*/
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x00, /* Interface number */
0x00, /* Alternate setting number */
0x01, /* Number of end points */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
BLADE_FPGA_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x04, /* Max packet size = 1024 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Super speed endpoint companion descriptor for producer EP */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x01, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
0x00, /* Max streams for bulk EP = 0 (No streams) */
0x00,0x00, /* Service interval for the EP : 0 for bulk */
/* Interface descriptor #1 */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x01, /* Interface number */
0x00, /* Alternate setting number */
0x04, /* Number of end points */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for consumer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_CONSUMER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x04, /* Max packet size = 1024 bytes */
0x00, /* Servicing interval for data transfers : 0 for Bulk */
/* Super speed endpoint companion descriptor for consumer EP */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x0f, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
0x00, /* Max streams for bulk EP = 0 (No streams) */
0x00,0x00, /* Service interval for the EP : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x04, /* Max packet size = 1024 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Super speed endpoint companion descriptor for producer EP */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x0f, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
0x00, /* Max streams for bulk EP = 0 (No streams) */
0x00,0x00, /* Service interval for the EP : 0 for bulk */
/* Endpoint descriptor for consumer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
0x82, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x04, /* Max packet size = 1024 bytes */
0x00, /* Servicing interval for data transfers : 0 for Bulk */
/* Super speed endpoint companion descriptor for consumer EP */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x01, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
0x00, /* Max streams for bulk EP = 0 (No streams) */
0x00,0x00, /* Service interval for the EP : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
BLADE_FPGA_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x04, /* Max packet size = 1024 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Super speed endpoint companion descriptor for producer EP */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x0f, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
0x00, /* Max streams for bulk EP = 0 (No streams) */
0x00,0x00, /* Service interval for the EP : 0 for bulk */
/* Interface descriptor #2*/
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x02, /* Interface number */
0x00, /* Alternate setting number */
0x01, /* Number of end points */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
BLADE_FPGA_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x04, /* Max packet size = 1024 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Super speed endpoint companion descriptor for producer EP */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x01, /* Max no. of packets in a burst : 0: burst 1 packet at a time */
0x00, /* Max streams for bulk EP = 0 (No streams) */
0x00,0x00, /* Service interval for the EP : 0 for bulk */
};
/* Standard high speed configuration descriptor */
const uint8_t CyFxUSBHSConfigDscr[] __attribute__ ((aligned (32))) =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
0x55,0x00, /* Length of this descriptor and all sub descriptors */
0x03, /* Number of interfaces */
0x01, /* Configuration number */
0x00, /* COnfiguration string index */
0x80, /* Config characteristics - bus powered */
0x32, /* Max power consumption of device (in 2mA unit) : 100mA */
/* Interface descriptor #0 */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x00, /* Interface number */
0x00, /* Alternate setting number */
0x02, /* Number of endpoints */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
BLADE_FPGA_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Interface descriptor #1 */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x01, /* Interface number */
0x00, /* Alternate setting number */
0x04, /* Number of endpoints */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
0x01, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
0x81, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
0x02, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
0x82, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Interface descriptor #2 */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface Descriptor type */
0x02, /* Interface number */
0x00, /* Alternate setting number */
0x01, /* Number of endpoints */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
0x01, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x00,0x02, /* Max packet size = 512 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
};
/* Standard full speed configuration descriptor */
const uint8_t CyFxUSBFSConfigDscr[] __attribute__ ((aligned (32))) =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
0x20,0x00, /* Length of this descriptor and all sub descriptors */
0x01, /* Number of interfaces */
0x01, /* Configuration number */
0x00, /* COnfiguration string index */
0x80, /* Config characteristics - bus powered */
0x32, /* Max power consumption of device (in 2mA unit) : 100mA */
/* Interface descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x00, /* Interface number */
0x00, /* Alternate setting number */
0x03, /* Number of endpoints */
0xFF, /* Interface class */
0x00, /* Interface sub class */
0x00, /* Interface protocol code */
0x00, /* Interface descriptor string index */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x40,0x00, /* Max packet size = 64 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Endpoint descriptor for producer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
BLADE_FPGA_EP_PRODUCER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x40,0x00, /* Max packet size = 64 bytes */
0x00, /* Servicing interval for data transfers : 0 for bulk */
/* Endpoint descriptor for consumer EP */
0x07, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_CONSUMER, /* Endpoint address and description */
CY_U3P_USB_EP_BULK, /* Bulk endpoint type */
0x40,0x00, /* Max packet size = 64 bytes */
0x00 /* Servicing interval for data transfers : 0 for bulk */
};
/* Standard language ID string descriptor */
const uint8_t CyFxUSBStringLangIDDscr[] __attribute__ ((aligned (32))) =
{
0x04, /* Descriptor size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
0x09,0x04 /* Language ID supported */
};
/* Standard manufacturer string descriptor */
const uint8_t CyFxUSBManufactureDscr[] __attribute__ ((aligned (32))) =
{
0x0C, /* Descriptor size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'N',0x00,
'u',0x00,
'a',0x00,
'n',0x00,
'd',0x00,
};
/* Standard product string descriptor */
const uint8_t CyFxUSBProductDscr[] __attribute__ ((aligned (32))) =
{
0x10, /* Descriptor size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
'b',0x00,
'l',0x00,
'a',0x00,
'd',0x00,
'e',0x00,
'R',0x00,
'F',0x00
};
/* Place this buffer as the last buffer so that no other variable / code shares
* the same cache line. Do not add any other variables / arrays in this file.
* This will lead to variables sharing the same cache line. */
const uint8_t CyFxUsbDscrAlignBuffer[32] __attribute__ ((aligned (32)));
/* [ ] */

View file

@ -0,0 +1,168 @@
/*
* Project Name: c4loader.cyfx
* Time : 01/12/2013 00:49:46
* Device Type: FX3
* Project Type: GPIF2
*
*
*
*
* This is a generated file and should not be modified
* This file need to be included only once in the firmware
* This file is generated by Gpif2 designer tool version - 1.0.837.1
*
*/
#ifndef _INCLUDED_CYFXGPIF2CONFIG_
#define _INCLUDED_CYFXGPIF2CONFIG_
#include "cyu3types.h"
#include "cyu3gpif.h"
/* Summary
Number of states in the state machine
*/
#define CY_C4LOADER_NUMBER_OF_STATES 7
/* Summary
Mapping of user defined state names to state indices
*/
#define C4LOADER_START 0x0
#define C4LOADER_STATE0 0x2
#define C4LOADER_INIT 0x1
#define C4LOADER_STATE2 0x4
#define C4LOADER_STATE3 0x5
#define C4LOADER_STATE1 0x3
#define C4LOADER_STATE4 0x6
/* Summary
Initial value of early outputs from the state machine.
*/
#define C4LOADER_ALPHA_START 0x0
/* Summary
Transition function values used in the state machine.
*/
uint16_t C4loader_CyFxGpifTransition[] = {
0x0000, 0xAAAA, 0xFFFF
};
/* Summary
Table containing the transition information for various states.
This table has to be stored in the WAVEFORM Registers.
This array consists of non-replicated waveform descriptors and acts as a
waveform table.
*/
CyU3PGpifWaveData C4loader_CyFxGpifWavedata[] = {
{{0x1E739A01,0x0C0000C0,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x2E739C02,0x0C000040,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x2E739C03,0x00400040,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x2E739C04,0x00000040,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x2E739C05,0x00400040,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x1E739A06,0x0C0000C0,0x80000000},{0x00000000,0x00000000,0x00000000}}
};
/* Summary
Table that maps state indices to the descriptor table indices.
*/
uint8_t C4loader_CyFxGpifWavedataPosition[] = {
0,1,2,3,4,5,1
};
/* Summary
GPIF II configuration register values.
*/
uint32_t C4loader_CyFxGpifRegValue[] = {
0x800083B0, /* CY_U3P_PIB_GPIF_CONFIG */
0x00000067, /* CY_U3P_PIB_GPIF_BUS_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_BUS_CONFIG2 */
0x00000052, /* CY_U3P_PIB_GPIF_AD_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_STATUS */
0x00000000, /* CY_U3P_PIB_GPIF_INTR */
0x00000000, /* CY_U3P_PIB_GPIF_INTR_MASK */
0x00000082, /* CY_U3P_PIB_GPIF_SERIAL_IN_CONFIG */
0x00000782, /* CY_U3P_PIB_GPIF_SERIAL_OUT_CONFIG */
0x54040000, /* CY_U3P_PIB_GPIF_CTRL_BUS_DIRECTION */
0x0000FFFF, /* CY_U3P_PIB_GPIF_CTRL_BUS_DEFAULT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_POLARITY */
0x00000200, /* CY_U3P_PIB_GPIF_CTRL_BUS_TOGGLE */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000008, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000006, /* CY_U3P_PIB_GPIF_CTRL_COUNT_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_COUNT_RESET */
0x0000FFFF, /* CY_U3P_PIB_GPIF_CTRL_COUNT_LIMIT */
0x0000010A, /* CY_U3P_PIB_GPIF_ADDR_COUNT_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_ADDR_COUNT_RESET */
0x0000FFFF, /* CY_U3P_PIB_GPIF_ADDR_COUNT_LIMIT */
0x00000000, /* CY_U3P_PIB_GPIF_STATE_COUNT_CONFIG */
0x0000FFFF, /* CY_U3P_PIB_GPIF_STATE_COUNT_LIMIT */
0x0000010A, /* CY_U3P_PIB_GPIF_DATA_COUNT_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_COUNT_RESET */
0x0000FFFF, /* CY_U3P_PIB_GPIF_DATA_COUNT_LIMIT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_COMP_VALUE */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_COMP_MASK */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_COMP_VALUE */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_COMP_MASK */
0x00000000, /* CY_U3P_PIB_GPIF_ADDR_COMP_VALUE */
0x00000000, /* CY_U3P_PIB_GPIF_ADDR_COMP_MASK */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_CTRL */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x80010400, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x80010401, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x80010402, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x80010403, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_LAMBDA_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_ALPHA_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_BETA_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_WAVEFORM_CTRL_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_WAVEFORM_SWITCH */
0x00000000, /* CY_U3P_PIB_GPIF_WAVEFORM_SWITCH_TIMEOUT */
0x00000000, /* CY_U3P_PIB_GPIF_CRC_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_CRC_DATA */
0xFFFFFFC1 /* CY_U3P_PIB_GPIF_BETA_DEASSERT */
};
/* Summary
This structure holds all the configuration inputs for the GPIF II.
*/
const CyU3PGpifConfig_t C4loader_CyFxGpifConfig = {
(uint16_t)(sizeof(C4loader_CyFxGpifWavedataPosition)/sizeof(uint8_t)),
C4loader_CyFxGpifWavedata,
C4loader_CyFxGpifWavedataPosition,
(uint16_t)(sizeof(C4loader_CyFxGpifTransition)/sizeof(uint16_t)),
C4loader_CyFxGpifTransition,
(uint16_t)(sizeof(C4loader_CyFxGpifRegValue)/sizeof(uint32_t)),
C4loader_CyFxGpifRegValue
};
#endif /* _INCLUDED_CYFXGPIF2CONFIG_ */

View file

@ -0,0 +1,171 @@
/*
* Project Name: RFlink.cyfx
* Time : 01/20/2013 22:51:22
* Device Type: FX3
* Project Type: GPIF2
*
*
*
*
* This is a generated file and should not be modified
* This file need to be included only once in the firmware
* This file is generated by Gpif2 designer tool version - 1.0.837.1
*
*/
#ifndef _INCLUDED_CYFXGPIF2CONFIG_RF_
#define _INCLUDED_CYFXGPIF2CONFIG_RF_
#include "cyu3types.h"
#include "cyu3gpif.h"
/* Summary
Number of states in the state machine
*/
#define CY_RFLINK_NUMBER_OF_STATES 10
/* Summary
Mapping of user defined state names to state indices
*/
#define RFLINK_START 0x0
#define RFLINK_INIT 0x1
#define RFLINK_IF_RX_0 0x3
#define RFLINK_IF_RX_1 0x5
#define RFLINK_IF_TX_2 0x6
#define RFLINK_DONE 0x4
#define RFLINK_WAIT_0 0x2
#define RFLINK_IF_TX_3 0x9
#define RFLINK_IF_TX 0x7
#define RFLINK_IF_RX 0x8
/* Summary
Initial value of early outputs from the state machine.
*/
#define RFLINK_ALPHA_START 0x80
/* Summary
Transition function values used in the state machine.
*/
uint16_t Rflink_CyFxGpifTransition[] = {
0x0000, 0xAAAA, 0x5555, 0xCCCC, 0xFFFF, 0xEEEE, 0xFFF0
};
/* Summary
Table containing the transition information for various states.
This table has to be stored in the WAVEFORM Registers.
This array consists of non-replicated waveform descriptors and acts as a
waveform table.
*/
CyU3PGpifWaveData Rflink_CyFxGpifWavedata[] = {
{{0x4E739C01,0x00001000,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x50806202,0x0000000C,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x1E706207,0x0C00C0C6,0x80000000},{0x1E702008,0x00010106,0x80000000}},
{{0x4E739C04,0x00001000,0x80000000},{0x00000000,0x00000000,0x00000000}},
{{0x2E739A06,0x08000000,0x80000000},{0x2E739A09,0x0C000000,0x80000000}},
{{0x2E739A03,0x20000000,0x80000000},{0x2E739A05,0x24000000,0x80000000}}
};
/* Summary
Table that maps state indices to the descriptor table indices.
*/
uint8_t Rflink_CyFxGpifWavedataPosition[] = {
0,1,2,3,1,3,3,4,5,3
};
/* Summary
GPIF II configuration register values.
*/
uint32_t Rflink_CyFxGpifRegValue[] = {
0x800083B0, /* CY_U3P_PIB_GPIF_CONFIG */
0x0000006C, /* CY_U3P_PIB_GPIF_BUS_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_BUS_CONFIG2 */
0x00000052, /* CY_U3P_PIB_GPIF_AD_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_STATUS */
0x00000000, /* CY_U3P_PIB_GPIF_INTR */
0x00000000, /* CY_U3P_PIB_GPIF_INTR_MASK */
0x00000082, /* CY_U3P_PIB_GPIF_SERIAL_IN_CONFIG */
0x00000782, /* CY_U3P_PIB_GPIF_SERIAL_OUT_CONFIG */
0x55515500, /* CY_U3P_PIB_GPIF_CTRL_BUS_DIRECTION */
0x0000FF70, /* CY_U3P_PIB_GPIF_CTRL_BUS_DEFAULT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_POLARITY */
0x00000080, /* CY_U3P_PIB_GPIF_CTRL_BUS_TOGGLE */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000001, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000002, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000003, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000010, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000012, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000013, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000011, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_BUS_SELECT */
0x00000006, /* CY_U3P_PIB_GPIF_CTRL_COUNT_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_COUNT_RESET */
0x0000FFFF, /* CY_U3P_PIB_GPIF_CTRL_COUNT_LIMIT */
0x0000010A, /* CY_U3P_PIB_GPIF_ADDR_COUNT_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_ADDR_COUNT_RESET */
0x0000FFFF, /* CY_U3P_PIB_GPIF_ADDR_COUNT_LIMIT */
0x00000000, /* CY_U3P_PIB_GPIF_STATE_COUNT_CONFIG */
0x0000FFFF, /* CY_U3P_PIB_GPIF_STATE_COUNT_LIMIT */
0x0000010A, /* CY_U3P_PIB_GPIF_DATA_COUNT_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_COUNT_RESET */
0x0000FFFF, /* CY_U3P_PIB_GPIF_DATA_COUNT_LIMIT */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_COMP_VALUE */
0x00000000, /* CY_U3P_PIB_GPIF_CTRL_COMP_MASK */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_COMP_VALUE */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_COMP_MASK */
0x00000000, /* CY_U3P_PIB_GPIF_ADDR_COMP_VALUE */
0x00000000, /* CY_U3P_PIB_GPIF_ADDR_COMP_MASK */
0x00000000, /* CY_U3P_PIB_GPIF_DATA_CTRL */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_DATA */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_INGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x00000000, /* CY_U3P_PIB_GPIF_EGRESS_ADDRESS */
0x80010400, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x80010401, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x80010402, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x80010403, /* CY_U3P_PIB_GPIF_THREAD_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_LAMBDA_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_ALPHA_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_BETA_STAT */
0x00800000, /* CY_U3P_PIB_GPIF_WAVEFORM_CTRL_STAT */
0x00000000, /* CY_U3P_PIB_GPIF_WAVEFORM_SWITCH */
0x00000000, /* CY_U3P_PIB_GPIF_WAVEFORM_SWITCH_TIMEOUT */
0x00000000, /* CY_U3P_PIB_GPIF_CRC_CONFIG */
0x00000000, /* CY_U3P_PIB_GPIF_CRC_DATA */
0xFFFFFFC1 /* CY_U3P_PIB_GPIF_BETA_DEASSERT */
};
/* Summary
This structure holds all the configuration inputs for the GPIF II.
*/
const CyU3PGpifConfig_t Rflink_CyFxGpifConfig = {
(uint16_t)(sizeof(Rflink_CyFxGpifWavedataPosition)/sizeof(uint8_t)),
Rflink_CyFxGpifWavedata,
Rflink_CyFxGpifWavedataPosition,
(uint16_t)(sizeof(Rflink_CyFxGpifTransition)/sizeof(uint16_t)),
Rflink_CyFxGpifTransition,
(uint16_t)(sizeof(Rflink_CyFxGpifRegValue)/sizeof(uint32_t)),
Rflink_CyFxGpifRegValue
};
#endif /* _INCLUDED_CYFXGPIF2CONFIG_ */

34
fx3_firmware/makefile Normal file
View file

@ -0,0 +1,34 @@
FX3FWROOT="C:/Cypress/EZ-USB FX3 SDK/1.2/firmware"
FX3PFWROOT="C:/Cypress/EZ-USB FX3 SDK/1.2/firmware/u3p_firmware"
all:compile
include $(FX3FWROOT)/common/fx3_build_config.mak
MODULE = bladeRF
SOURCE += $(MODULE).c
C_OBJECT=$(SOURCE:%.c=./%.o)
A_OBJECT=$(SOURCE_ASM:%.S=./%.o)
EXES = $(MODULE).$(EXEEXT)
$(MODULE).$(EXEEXT): $(A_OBJECT) $(C_OBJECT)
$(LINK)
$(C_OBJECT) : %.o : %.c
$(COMPILE)
$(A_OBJECT) : %.o : %.S
$(ASSEMBLE)
clean:
rm -f ./$(MODULE).$(EXEEXT)
rm -f ./$(MODULE).map
rm -f ./*.o
compile: $(C_OBJECT) $(A_OBJECT) $(EXES)
#[]#

View file

@ -0,0 +1,223 @@
/*
* spi_flash_lib.c
*
* Created on: Feb 13, 2013
* Author: Robert
*/
#include "cyu3system.h"
#include "cyu3os.h"
#include "cyu3dma.h"
#include "cyu3error.h"
#include "cyu3usb.h"
#include "cyu3uart.h"
#include "bladeRF.h"
#include "cyu3gpif.h"
#include "cyu3pib.h"
#include "cyu3gpio.h"
#include "pib_regs.h"
#include "cyu3spi.h"
uint16_t glSpiPageSize = 0x100; /* SPI Page size to be used for transfers. */
/* SPI initialization for application. */
CyU3PReturnStatus_t CyFxSpiInit(uint16_t pageLen)
{
CyU3PSpiConfig_t spiConfig;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
/* Start the SPI module and configure the master. */
status = CyU3PSpiInit();
if (status != CY_U3P_SUCCESS) {
return status;
}
/* Start the SPI master block. Run the SPI clock at 8MHz
* and configure the word length to 8 bits. Also configure
* the slave select using FW. */
CyU3PMemSet((uint8_t *)&spiConfig, 0, sizeof(spiConfig));
spiConfig.isLsbFirst = CyFalse;
spiConfig.cpol = CyTrue;
spiConfig.ssnPol = CyFalse;
spiConfig.cpha = CyTrue;
spiConfig.leadTime = CY_U3P_SPI_SSN_LAG_LEAD_HALF_CLK;
spiConfig.lagTime = CY_U3P_SPI_SSN_LAG_LEAD_HALF_CLK;
spiConfig.ssnCtrl = CY_U3P_SPI_SSN_CTRL_FW;
spiConfig.clock = 8000000;
spiConfig.wordLen = 8;
status = CyU3PSpiSetConfig(&spiConfig, NULL);
return status;
}
/* Wait for the status response from the SPI flash. */
CyU3PReturnStatus_t CyFxSpiWaitForStatus(void)
{
uint8_t buf[2], rd_buf[2];
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
/* Wait for status response from SPI flash device. */
do {
buf[0] = 0x06; /* Write enable command. */
CyU3PSpiSetSsnLine(CyFalse);
status = CyU3PSpiTransmitWords (buf, 1);
CyU3PSpiSetSsnLine(CyTrue);
if (status != CY_U3P_SUCCESS) {
CyU3PDebugPrint (2, "SPI WR_ENABLE command failed\n\r");
return status;
}
buf[0] = 0x05; /* Read status command */
CyU3PSpiSetSsnLine(CyFalse);
status = CyU3PSpiTransmitWords(buf, 1);
if (status != CY_U3P_SUCCESS) {
CyU3PDebugPrint(2, "SPI READ_STATUS command failed\n\r");
CyU3PSpiSetSsnLine(CyTrue);
return status;
}
status = CyU3PSpiReceiveWords(rd_buf, 2);
CyU3PSpiSetSsnLine(CyTrue);
if(status != CY_U3P_SUCCESS) {
CyU3PDebugPrint(2, "SPI status read failed\n\r");
return status;
}
} while ((rd_buf[0] & 1) || (!(rd_buf[0] & 0x2)));
return CY_U3P_SUCCESS;
}
/* SPI read / write for programmer application. */
CyU3PReturnStatus_t CyFxSpiTransfer(uint16_t pageAddress, uint16_t byteCount, uint8_t *buffer, CyBool_t isRead)
{
uint8_t location[4];
uint32_t byteAddress = 0;
uint16_t pageCount = (byteCount / glSpiPageSize);
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
if (byteCount == 0) {
return CY_U3P_SUCCESS;
}
if ((byteCount % glSpiPageSize) != 0) {
pageCount ++;
}
byteAddress = pageAddress * glSpiPageSize;
while (pageCount != 0) {
location[1] = (byteAddress >> 16) & 0xFF; /* MS byte */
location[2] = (byteAddress >> 8) & 0xFF;
location[3] = byteAddress & 0xFF; /* LS byte */
if (isRead) {
location[0] = 0x03; /* Read command. */
status = CyFxSpiWaitForStatus();
if (status != CY_U3P_SUCCESS)
return status;
CyU3PSpiSetSsnLine(CyFalse);
status = CyU3PSpiTransmitWords(location, 4);
if (status != CY_U3P_SUCCESS) {
CyU3PDebugPrint (2, "SPI READ command failed\r\n");
CyU3PSpiSetSsnLine (CyTrue);
return status;
}
status = CyU3PSpiReceiveWords(buffer, glSpiPageSize);
if (status != CY_U3P_SUCCESS) {
CyU3PSpiSetSsnLine(CyTrue);
return status;
}
CyU3PSpiSetSsnLine(CyTrue);
} else { /* Write */
location[0] = 0x02; /* Write command */
status = CyFxSpiWaitForStatus();
if (status != CY_U3P_SUCCESS)
return status;
CyU3PSpiSetSsnLine(CyFalse);
status = CyU3PSpiTransmitWords(location, 4);
if (status != CY_U3P_SUCCESS) {
CyU3PDebugPrint(2, "SPI WRITE command failed\r\n");
CyU3PSpiSetSsnLine(CyTrue);
return status;
}
status = CyU3PSpiTransmitWords(buffer, glSpiPageSize);
if (status != CY_U3P_SUCCESS) {
CyU3PSpiSetSsnLine(CyTrue);
return status;
}
CyU3PSpiSetSsnLine(CyTrue);
}
byteAddress += glSpiPageSize;
buffer += glSpiPageSize;
pageCount--;
CyU3PThreadSleep(15);
}
return CY_U3P_SUCCESS;
}
/* Function to erase SPI flash sectors. */
CyU3PReturnStatus_t CyFxSpiEraseSector(CyBool_t isErase, uint8_t sector)
{
uint32_t temp = 0;
uint8_t location[4], rdBuf[2];
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
location[0] = 0x06; /* Write enable. */
CyU3PSpiSetSsnLine (CyFalse);
status = CyU3PSpiTransmitWords (location, 1);
CyU3PSpiSetSsnLine (CyTrue);
if (status != CY_U3P_SUCCESS)
return status;
if (isErase)
{
location[0] = 0xD8; /* Sector erase. */
temp = sector * 0x10000;
location[1] = (temp >> 16) & 0xFF;
location[2] = (temp >> 8) & 0xFF;
location[3] = temp & 0xFF;
CyU3PSpiSetSsnLine (CyFalse);
status = CyU3PSpiTransmitWords (location, 4);
CyU3PSpiSetSsnLine (CyTrue);
}
location[0] = 0x05; /* RDSTATUS */
do {
CyU3PSpiSetSsnLine (CyFalse);
status = CyU3PSpiTransmitWords (location, 1);
status = CyU3PSpiReceiveWords(rdBuf, 1);
CyU3PSpiSetSsnLine (CyTrue);
} while(rdBuf[0] & 1);
return status;
}
void NuandFirmwareStart() {
CyU3PIoMatrixConfig_t io_cfg;
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
NuandGPIOReconfigure(CyFalse, CyFalse);
FpgaBeginProgram();
status = CyFxSpiInit(0x100);
glAppMode = MODE_FW_CONFIG;
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,508 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<buildSystem id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339">
<storageModule id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339" moduleId="org.eclipse.cdt.core.settings"/>
</buildSystem>
<cconfiguration id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339">
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339" name="Nios II" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339." name="/" resourcePath="">
<toolChain id="altera.nios2.mingw.gcc4.1252612423" name="MinGW Nios II GCC4" superClass="altera.nios2.mingw.gcc4">
<targetPlatform id="altera.nios2.mingw.gcc4.1914476081" name="Nios II" superClass="altera.nios2.mingw.gcc4"/>
<builder buildPath="${workspace_loc://lms_spi_controller}" id="cdt.managedbuild.target.gnu.builder.cygwin.base.656724989" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.base.1204759541" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.802842597" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.1706665657" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.1631729392" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base">
<option id="gnu.cpp.compiler.option.preprocessor.undef.1851588163" name="Undefined symbols (-U)" superClass="gnu.cpp.compiler.option.preprocessor.undef" valueType="undefDefinedSymbols">
<listOptionValue builtIn="false" value="__INT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__UINTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__unix__"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="_stdcall"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__"/>
<listOptionValue builtIn="false" value="__GXX_TYPEINFO_EQUALITY_INLINE"/>
<listOptionValue builtIn="false" value="__DEC32_MAX__"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DEC32_EPSILON__"/>
<listOptionValue builtIn="false" value="__INTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__cdecl"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__"/>
<listOptionValue builtIn="false" value="__DEC32_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__"/>
<listOptionValue builtIn="false" value="__WINT_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__CYGWIN32__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__i386"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__GXX_MERGED_TYPEINFO_NAMES"/>
<listOptionValue builtIn="false" value="__INT16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_C(c)"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__"/>
<listOptionValue builtIn="false" value="__INTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__FLT_DIG__"/>
<listOptionValue builtIn="false" value="__UINT8_MAX__"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__pentiumpro__"/>
<listOptionValue builtIn="false" value="__UINT32_MAX__"/>
<listOptionValue builtIn="false" value="__i686"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT32_C(c)"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_TYPE__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_EPSILON__"/>
<listOptionValue builtIn="false" value="__GNUC__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__unix"/>
<listOptionValue builtIn="false" value="__DEC128_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__fastcall"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC64_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_MAX__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MAX__"/>
<listOptionValue builtIn="false" value="__GXX_WEAK__"/>
<listOptionValue builtIn="false" value="__i686__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_MAX__"/>
<listOptionValue builtIn="false" value="__GNUG__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="unix"/>
<listOptionValue builtIn="false" value="__stdcall"/>
<listOptionValue builtIn="false" value="__cplusplus"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="__UINT16_TYPE__"/>
<listOptionValue builtIn="false" value="_X86_"/>
<listOptionValue builtIn="false" value="__UINT32_TYPE__"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN__"/>
<listOptionValue builtIn="false" value="__UINT64_C(c)"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__INT8_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__"/>
<listOptionValue builtIn="false" value="__WCHAR_MIN__"/>
<listOptionValue builtIn="false" value="__CYGWIN__"/>
<listOptionValue builtIn="false" value="__UINTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"/>
<listOptionValue builtIn="false" value="i386"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__UINTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__UINT64_MAX__"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION"/>
<listOptionValue builtIn="false" value="__UINTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__EXCEPTIONS"/>
<listOptionValue builtIn="false" value="__INT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="_cdecl"/>
<listOptionValue builtIn="false" value="__DEPRECATED"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MIN__"/>
<listOptionValue builtIn="false" value="__FLT_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__GXX_RTTI"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__"/>
<listOptionValue builtIn="false" value="__DBL_DIG__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX__"/>
<listOptionValue builtIn="false" value="__BIGGEST_ALIGNMENT__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__WINT_MIN__"/>
<listOptionValue builtIn="false" value="__INT16_C(c)"/>
<listOptionValue builtIn="false" value="__INT64_MAX__"/>
<listOptionValue builtIn="false" value="__INT_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_EPSILON__"/>
<listOptionValue builtIn="false" value="__INT32_C(c)"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__STDC__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__VERSION__"/>
<listOptionValue builtIn="false" value="__INT32_MAX__"/>
<listOptionValue builtIn="false" value="__INT64_C(c)"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__LONG_MAX__"/>
<listOptionValue builtIn="false" value="__pentiumpro"/>
<listOptionValue builtIn="false" value="__INT8_C(c)"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT8_C(c)"/>
<listOptionValue builtIn="false" value="__i386__"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__"/>
<listOptionValue builtIn="false" value="__DEC128_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__"/>
<listOptionValue builtIn="false" value="__DEC_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__FLT_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC128_MIN__"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__"/>
<listOptionValue builtIn="false" value="_fastcall"/>
<listOptionValue builtIn="false" value="__declspec(x)"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT8_TYPE__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__WCHAR_UNSIGNED__"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.842138811" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.1009810634" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base">
<option id="gnu.c.compiler.option.preprocessor.undef.symbol.937831354" name="Undefined symbols (-U)" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" valueType="undefDefinedSymbols">
<listOptionValue builtIn="false" value="__INT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__UINTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__unix__"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="_stdcall"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__"/>
<listOptionValue builtIn="false" value="__GXX_TYPEINFO_EQUALITY_INLINE"/>
<listOptionValue builtIn="false" value="__DEC32_MAX__"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DEC32_EPSILON__"/>
<listOptionValue builtIn="false" value="__INTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__cdecl"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__"/>
<listOptionValue builtIn="false" value="__DEC32_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__"/>
<listOptionValue builtIn="false" value="__WINT_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__CYGWIN32__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__i386"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__GXX_MERGED_TYPEINFO_NAMES"/>
<listOptionValue builtIn="false" value="__INT16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_C(c)"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__"/>
<listOptionValue builtIn="false" value="__INTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__FLT_DIG__"/>
<listOptionValue builtIn="false" value="__UINT8_MAX__"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__pentiumpro__"/>
<listOptionValue builtIn="false" value="__UINT32_MAX__"/>
<listOptionValue builtIn="false" value="__i686"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT32_C(c)"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_TYPE__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_EPSILON__"/>
<listOptionValue builtIn="false" value="__GNUC__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__unix"/>
<listOptionValue builtIn="false" value="__DEC128_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__fastcall"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC64_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_MAX__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MAX__"/>
<listOptionValue builtIn="false" value="__i686__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="unix"/>
<listOptionValue builtIn="false" value="__stdcall"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="_X86_"/>
<listOptionValue builtIn="false" value="__UINT16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT32_TYPE__"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN__"/>
<listOptionValue builtIn="false" value="__UINT64_C(c)"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__INT8_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__"/>
<listOptionValue builtIn="false" value="__WCHAR_MIN__"/>
<listOptionValue builtIn="false" value="__CYGWIN__"/>
<listOptionValue builtIn="false" value="__UINTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"/>
<listOptionValue builtIn="false" value="i386"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__UINTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__UINT64_MAX__"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION"/>
<listOptionValue builtIn="false" value="__UINTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="_cdecl"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MIN__"/>
<listOptionValue builtIn="false" value="__FLT_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__"/>
<listOptionValue builtIn="false" value="__DBL_DIG__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX__"/>
<listOptionValue builtIn="false" value="__BIGGEST_ALIGNMENT__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__WINT_MIN__"/>
<listOptionValue builtIn="false" value="__INT16_C(c)"/>
<listOptionValue builtIn="false" value="__INT64_MAX__"/>
<listOptionValue builtIn="false" value="__INT_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_EPSILON__"/>
<listOptionValue builtIn="false" value="__INT32_C(c)"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__STDC__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__VERSION__"/>
<listOptionValue builtIn="false" value="__INT32_MAX__"/>
<listOptionValue builtIn="false" value="__INT64_C(c)"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__LONG_MAX__"/>
<listOptionValue builtIn="false" value="__pentiumpro"/>
<listOptionValue builtIn="false" value="__INT8_C(c)"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT8_C(c)"/>
<listOptionValue builtIn="false" value="__i386__"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__"/>
<listOptionValue builtIn="false" value="__DEC128_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__"/>
<listOptionValue builtIn="false" value="__DEC_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="__FLT_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC128_MIN__"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__"/>
<listOptionValue builtIn="false" value="_fastcall"/>
<listOptionValue builtIn="false" value="__declspec(x)"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT8_TYPE__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.147388906" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.base.227964594" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base.1294903400" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.658614507" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339" moduleId="org.eclipse.cdt.core.settings" name="Nios II">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="lms_spi_controller.null.928137151" name="lms_spi_controller"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339;preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.1009810634;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.147388906">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339;preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.1762988339.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.1631729392;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.842138811">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="mem_init_install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>mem_init_install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="mem_init_generate" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>mem_init_generate</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
<target name="help" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>help</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>false</useDefaultCommand>
<runAllBuilders>false</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cproject>

View file

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>lms_spi_controller</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.altera.sbtgui.project.makefileBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.altera.sbtgui.project.makefileBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc://lms_spi_controller}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>com.altera.sbtgui.project.SBTGUINature</nature>
<nature>com.altera.sbtgui.project.SBTGUIAppNature</nature>
<nature>com.altera.sbtgui.project.SBTGUIManagedNature</nature>
</natures>
</projectDescription>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,481 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<buildSystem id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325">
<storageModule id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325" moduleId="org.eclipse.cdt.core.settings"/>
</buildSystem>
<cconfiguration id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325">
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" description="" id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325" name="Nios II" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325." name="/" resourcePath="">
<toolChain id="altera.nios2.mingw.gcc4.154219682" name="MinGW Nios II GCC4" superClass="altera.nios2.mingw.gcc4">
<targetPlatform id="altera.nios2.mingw.gcc4.673253927" name="Nios II" superClass="altera.nios2.mingw.gcc4"/>
<builder buildPath="${workspace_loc://lms_spi_controller_bsp}" id="cdt.managedbuild.target.gnu.builder.cygwin.base.1537700835" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.base.874063937" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1687723949" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.1534466639" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.1996515388" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base">
<option id="gnu.cpp.compiler.option.preprocessor.undef.1765595103" superClass="gnu.cpp.compiler.option.preprocessor.undef" valueType="undefDefinedSymbols">
<listOptionValue builtIn="false" value="__INT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__UINTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__unix__"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="_stdcall"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__"/>
<listOptionValue builtIn="false" value="__GXX_TYPEINFO_EQUALITY_INLINE"/>
<listOptionValue builtIn="false" value="__DEC32_MAX__"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DEC32_EPSILON__"/>
<listOptionValue builtIn="false" value="__INTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__cdecl"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__"/>
<listOptionValue builtIn="false" value="__DEC32_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__"/>
<listOptionValue builtIn="false" value="__WINT_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__CYGWIN32__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__i386"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__GXX_MERGED_TYPEINFO_NAMES"/>
<listOptionValue builtIn="false" value="__INT16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_C(c)"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__"/>
<listOptionValue builtIn="false" value="__INTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__FLT_DIG__"/>
<listOptionValue builtIn="false" value="__UINT8_MAX__"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__pentiumpro__"/>
<listOptionValue builtIn="false" value="__UINT32_MAX__"/>
<listOptionValue builtIn="false" value="__i686"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT32_C(c)"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_TYPE__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_EPSILON__"/>
<listOptionValue builtIn="false" value="__GNUC__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__unix"/>
<listOptionValue builtIn="false" value="__DEC128_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__fastcall"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC64_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_MAX__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MAX__"/>
<listOptionValue builtIn="false" value="__GXX_WEAK__"/>
<listOptionValue builtIn="false" value="__i686__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_MAX__"/>
<listOptionValue builtIn="false" value="__GNUG__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="unix"/>
<listOptionValue builtIn="false" value="__stdcall"/>
<listOptionValue builtIn="false" value="__cplusplus"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="__UINT16_TYPE__"/>
<listOptionValue builtIn="false" value="_X86_"/>
<listOptionValue builtIn="false" value="__UINT32_TYPE__"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN__"/>
<listOptionValue builtIn="false" value="__UINT64_C(c)"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__INT8_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__"/>
<listOptionValue builtIn="false" value="__WCHAR_MIN__"/>
<listOptionValue builtIn="false" value="__CYGWIN__"/>
<listOptionValue builtIn="false" value="__UINTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"/>
<listOptionValue builtIn="false" value="i386"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__UINTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__UINT64_MAX__"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION"/>
<listOptionValue builtIn="false" value="__UINTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__EXCEPTIONS"/>
<listOptionValue builtIn="false" value="__INT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="_cdecl"/>
<listOptionValue builtIn="false" value="__DEPRECATED"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MIN__"/>
<listOptionValue builtIn="false" value="__FLT_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__GXX_RTTI"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__"/>
<listOptionValue builtIn="false" value="__DBL_DIG__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX__"/>
<listOptionValue builtIn="false" value="__BIGGEST_ALIGNMENT__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__WINT_MIN__"/>
<listOptionValue builtIn="false" value="__INT16_C(c)"/>
<listOptionValue builtIn="false" value="__INT64_MAX__"/>
<listOptionValue builtIn="false" value="__INT_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_EPSILON__"/>
<listOptionValue builtIn="false" value="__INT32_C(c)"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__STDC__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__VERSION__"/>
<listOptionValue builtIn="false" value="__INT32_MAX__"/>
<listOptionValue builtIn="false" value="__INT64_C(c)"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__LONG_MAX__"/>
<listOptionValue builtIn="false" value="__pentiumpro"/>
<listOptionValue builtIn="false" value="__INT8_C(c)"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT8_C(c)"/>
<listOptionValue builtIn="false" value="__i386__"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__"/>
<listOptionValue builtIn="false" value="__DEC128_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__"/>
<listOptionValue builtIn="false" value="__DEC_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__FLT_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC128_MIN__"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__"/>
<listOptionValue builtIn="false" value="_fastcall"/>
<listOptionValue builtIn="false" value="__declspec(x)"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT8_TYPE__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__WCHAR_UNSIGNED__"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1354213463" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.430493578" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base">
<option id="gnu.c.compiler.option.preprocessor.undef.symbol.1218969014" superClass="gnu.c.compiler.option.preprocessor.undef.symbol" valueType="undefDefinedSymbols">
<listOptionValue builtIn="false" value="__INT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__SCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__UINTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__unix__"/>
<listOptionValue builtIn="false" value="__DBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="_stdcall"/>
<listOptionValue builtIn="false" value="__SHRT_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__SIZEOF_WCHAR_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_PTRDIFF_T__"/>
<listOptionValue builtIn="false" value="__GXX_TYPEINFO_EQUALITY_INLINE"/>
<listOptionValue builtIn="false" value="__DEC32_MAX__"/>
<listOptionValue builtIn="false" value="__SIZEOF_DOUBLE__"/>
<listOptionValue builtIn="false" value="__FLT_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__LDBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DEC32_EPSILON__"/>
<listOptionValue builtIn="false" value="__INTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DIG__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_MAX__"/>
<listOptionValue builtIn="false" value="__cdecl"/>
<listOptionValue builtIn="false" value="__GNUC_PATCHLEVEL__"/>
<listOptionValue builtIn="false" value="__DEC32_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_POINTER__"/>
<listOptionValue builtIn="false" value="__WINT_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__FLT_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__CYGWIN32__"/>
<listOptionValue builtIn="false" value="__DEC32_MIN__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__i386"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_LONG__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__GXX_MERGED_TYPEINFO_NAMES"/>
<listOptionValue builtIn="false" value="__INT16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_C(c)"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__FLT_RADIX__"/>
<listOptionValue builtIn="false" value="__INTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__FLT_DIG__"/>
<listOptionValue builtIn="false" value="__UINT8_MAX__"/>
<listOptionValue builtIn="false" value="__INTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__pentiumpro__"/>
<listOptionValue builtIn="false" value="__UINT32_MAX__"/>
<listOptionValue builtIn="false" value="__i686"/>
<listOptionValue builtIn="false" value="__LONG_LONG_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT32_C(c)"/>
<listOptionValue builtIn="false" value="__DBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_TYPE__"/>
<listOptionValue builtIn="false" value="__FLT_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__NO_INLINE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_EPSILON__"/>
<listOptionValue builtIn="false" value="__GNUC__"/>
<listOptionValue builtIn="false" value="__INT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__unix"/>
<listOptionValue builtIn="false" value="__DEC128_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__fastcall"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__INTPTR_TYPE__"/>
<listOptionValue builtIn="false" value="__INT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DBL_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__WINT_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC64_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__INT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_MAX__"/>
<listOptionValue builtIn="false" value="__INT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZE_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__DBL_MAX__"/>
<listOptionValue builtIn="false" value="__i686__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT16_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_TYPE__"/>
<listOptionValue builtIn="false" value="unix"/>
<listOptionValue builtIn="false" value="__stdcall"/>
<listOptionValue builtIn="false" value="__FLT_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="_X86_"/>
<listOptionValue builtIn="false" value="__UINT16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT32_TYPE__"/>
<listOptionValue builtIn="false" value="__PRAGMA_REDEFINE_EXTNAME"/>
<listOptionValue builtIn="false" value="__FLT_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_MAX__"/>
<listOptionValue builtIn="false" value="__LDBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__DEC64_MIN__"/>
<listOptionValue builtIn="false" value="__UINT64_C(c)"/>
<listOptionValue builtIn="false" value="__REGISTER_PREFIX__"/>
<listOptionValue builtIn="false" value="__INT_FAST8_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__INT8_MAX__"/>
<listOptionValue builtIn="false" value="__FLT_DENORM_MIN__"/>
<listOptionValue builtIn="false" value="__CHAR32_TYPE__"/>
<listOptionValue builtIn="false" value="__WCHAR_MIN__"/>
<listOptionValue builtIn="false" value="__CYGWIN__"/>
<listOptionValue builtIn="false" value="__UINTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8"/>
<listOptionValue builtIn="false" value="i386"/>
<listOptionValue builtIn="false" value="__FLT_MIN_10_EXP__"/>
<listOptionValue builtIn="false" value="__UINTPTR_MAX__"/>
<listOptionValue builtIn="false" value="__UINT64_MAX__"/>
<listOptionValue builtIn="false" value="__WCHAR_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_HAS_DENORM__"/>
<listOptionValue builtIn="false" value="__GXX_ABI_VERSION"/>
<listOptionValue builtIn="false" value="__UINTMAX_C(c)"/>
<listOptionValue builtIn="false" value="__INT_LEAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_MIN_EXP__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_TYPE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG_DOUBLE__"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1"/>
<listOptionValue builtIn="false" value="__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2"/>
<listOptionValue builtIn="false" value="__SIZE_MAX__"/>
<listOptionValue builtIn="false" value="__UINT_FAST32_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="_cdecl"/>
<listOptionValue builtIn="false" value="__SIG_ATOMIC_MIN__"/>
<listOptionValue builtIn="false" value="__FLT_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_EPSILON__"/>
<listOptionValue builtIn="false" value="__UINT_FAST64_MAX__"/>
<listOptionValue builtIn="false" value="__DEC128_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SIZE_T__"/>
<listOptionValue builtIn="false" value="__DBL_DIG__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_MAX__"/>
<listOptionValue builtIn="false" value="__GNUC_MINOR__"/>
<listOptionValue builtIn="false" value="__DEC64_MAX__"/>
<listOptionValue builtIn="false" value="__BIGGEST_ALIGNMENT__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__WINT_MIN__"/>
<listOptionValue builtIn="false" value="__INT16_C(c)"/>
<listOptionValue builtIn="false" value="__INT64_MAX__"/>
<listOptionValue builtIn="false" value="__INT_MAX__"/>
<listOptionValue builtIn="false" value="__DEC64_EPSILON__"/>
<listOptionValue builtIn="false" value="__INT32_C(c)"/>
<listOptionValue builtIn="false" value="__INT32_TYPE__"/>
<listOptionValue builtIn="false" value="__INT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__STDC__"/>
<listOptionValue builtIn="false" value="__LDBL_MIN__"/>
<listOptionValue builtIn="false" value="__INT8_TYPE__"/>
<listOptionValue builtIn="false" value="__SIZEOF_FLOAT__"/>
<listOptionValue builtIn="false" value="__INTMAX_MAX__"/>
<listOptionValue builtIn="false" value="__INT_FAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC32_MAX_EXP__"/>
<listOptionValue builtIn="false" value="__VERSION__"/>
<listOptionValue builtIn="false" value="__INT32_MAX__"/>
<listOptionValue builtIn="false" value="__INT64_C(c)"/>
<listOptionValue builtIn="false" value="__SIZEOF_WINT_T__"/>
<listOptionValue builtIn="false" value="__SIZEOF_INT__"/>
<listOptionValue builtIn="false" value="__USER_LABEL_PREFIX__"/>
<listOptionValue builtIn="false" value="__LONG_MAX__"/>
<listOptionValue builtIn="false" value="__pentiumpro"/>
<listOptionValue builtIn="false" value="__INT8_C(c)"/>
<listOptionValue builtIn="false" value="__INT16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST32_MAX__"/>
<listOptionValue builtIn="false" value="__PTRDIFF_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT8_C(c)"/>
<listOptionValue builtIn="false" value="__i386__"/>
<listOptionValue builtIn="false" value="__CHAR_BIT__"/>
<listOptionValue builtIn="false" value="__DEC128_SUBNORMAL_MIN__"/>
<listOptionValue builtIn="false" value="__DBL_HAS_QUIET_NAN__"/>
<listOptionValue builtIn="false" value="__SIZEOF_SHORT__"/>
<listOptionValue builtIn="false" value="__DEC_EVAL_METHOD__"/>
<listOptionValue builtIn="false" value="__FLT_MAX__"/>
<listOptionValue builtIn="false" value="__DBL_MANT_DIG__"/>
<listOptionValue builtIn="false" value="__UINT_FAST16_TYPE__"/>
<listOptionValue builtIn="false" value="__UINT_LEAST64_TYPE__"/>
<listOptionValue builtIn="false" value="__DEC128_MIN__"/>
<listOptionValue builtIn="false" value="__GNUC_GNU_INLINE__"/>
<listOptionValue builtIn="false" value="_fastcall"/>
<listOptionValue builtIn="false" value="__declspec(x)"/>
<listOptionValue builtIn="false" value="__FLT_HAS_INFINITY__"/>
<listOptionValue builtIn="false" value="__UINT8_TYPE__"/>
<listOptionValue builtIn="false" value="__STDC_HOSTED__"/>
<listOptionValue builtIn="false" value="__DECIMAL_DIG__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX_10_EXP__"/>
<listOptionValue builtIn="false" value="__SIZEOF_LONG__"/>
<listOptionValue builtIn="false" value="__UINTMAX_TYPE__"/>
<listOptionValue builtIn="false" value="__LDBL_MAX__"/>
<listOptionValue builtIn="false" value="__FINITE_MATH_ONLY__"/>
<listOptionValue builtIn="false" value="__WCHAR_TYPE__"/>
<listOptionValue builtIn="false" value="__CHAR16_TYPE__"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.752275201" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.base.685618228" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base.758288416" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1377827139" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325" moduleId="org.eclipse.cdt.core.settings" name="Nios II">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="lms_spi_controller_bsp.null.826523347" name="lms_spi_controller_bsp"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325;preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.1996515388;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1354213463">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325;preference.org.eclipse.cdt.managedbuilder.core.configurationDataProvider.516826325.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.430493578;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.752275201">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>lms_spi_controller_bsp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc://lms_spi_controller_bsp}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.cleanBuildTarget</key>
<value>clean</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
<value>all</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>com.altera.sbtgui.project.SBTGUINature</nature>
<nature>com.altera.sbtgui.project.SBTGUIBspNature</nature>
</natures>
</projectDescription>

View file

@ -0,0 +1,781 @@
#------------------------------------------------------------------------------
# BSP MAKEFILE
#
# This makefile was automatically generated by the nios2-bsp-generate-files
# command. Its purpose is to build a custom Board Support Package (BSP)
# targeting a specific Nios II processor in an SOPC Builder-based design.
#
# To create an application or library Makefile which uses this BSP, try the
# nios2-app-generate-makefile or nios2-lib-generate-makefile commands.
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# TOOLS
#------------------------------------------------------------------------------
MKDIR := mkdir -p
ECHO := echo
SPACE := $(empty) $(empty)
#------------------------------------------------------------------------------
# The adjust-path macro
#
# If COMSPEC is defined, Make is launched from Windows through
# Cygwin. This adjust-path macro will call 'cygpath -u' on all
# paths to ensure they are readable by Make.
#
# If COMSPEC is not defined, Make is launched from *nix, and no adjustment
# is necessary
#------------------------------------------------------------------------------
ifndef COMSPEC
ifdef ComSpec
COMSPEC = $(ComSpec)
endif # ComSpec
endif # !COMSPEC
ifdef COMSPEC
adjust-path = $(subst $(SPACE),\$(SPACE),$(shell cygpath -u "$1"))
adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$(shell cygpath -m "$1"))
else
adjust-path = $(subst $(SPACE),\$(SPACE),$1)
adjust-path-mixed = $(subst $(SPACE),\$(SPACE),$1)
endif
#------------------------------------------------------------------------------
# DEFAULT TARGET
#
# The default target, "all", must appear before any other target in the
# Makefile. Note that extra prerequisites are added to the "all" rule later.
#------------------------------------------------------------------------------
.PHONY: all
all:
@$(ECHO) [BSP build complete]
#------------------------------------------------------------------------------
# PATHS & DIRECTORY NAMES
#
# Explicitly locate absolute path of the BSP root
#------------------------------------------------------------------------------
BSP_ROOT_DIR := .
# Define absolute path to the root of the BSP.
ABS_BSP_ROOT := $(call adjust-path-mixed,$(shell pwd))
# Stash all BSP object files here
OBJ_DIR := ./obj
#------------------------------------------------------------------------------
# MANAGED CONTENT
#
# All content between the lines "START MANAGED" and "END MANAGED" below is
# generated based on variables in the BSP settings file when the
# nios2-bsp-generate-files command is invoked. If you wish to persist any
# information pertaining to the build process, it is recomended that you
# utilize the BSP settings mechanism to do so.
#
# Note that most variable assignments in this section have a corresponding BSP
# setting that can be changed by using the nios2-bsp-create-settings or
# nios2-bsp-update-settings command before nios2-bsp-generate-files; if you
# want any variable set to a specific value when this Makefile is re-generated
# (to prevent hand-edits from being over-written), use the BSP settings
# facilities above.
#------------------------------------------------------------------------------
#START MANAGED
# The following TYPE comment allows tools to identify the 'type' of target this
# makefile is associated with.
# TYPE: BSP_PRIVATE_MAKEFILE
# This following VERSION comment indicates the version of the tool used to
# generate this makefile. A makefile variable is provided for VERSION as well.
# ACDS_VERSION: 12.1sp1
ACDS_VERSION := 12.1sp1
# This following BUILD_NUMBER comment indicates the build number of the tool
# used to generate this makefile.
# BUILD_NUMBER: 243
SETTINGS_FILE := settings.bsp
SOPC_FILE := Z:/work/nuandclean/release/hdl/fpga/ip/altera/nios_system/nios_system.sopcinfo
#-------------------------------------------------------------------------------
# TOOL & COMMAND DEFINITIONS
#
# The base command for each build operation are expressed here. Additional
# switches may be expressed here. They will run for all instances of the
# utility.
#-------------------------------------------------------------------------------
# Archiver command. Creates library files.
AR = nios2-elf-ar
# Assembler command. Note that CC is used for .S files.
AS = nios2-elf-gcc
# Custom flags only passed to the archiver. This content of this variable is
# directly passed to the archiver rather than the more standard "ARFLAGS". The
# reason for this is that GNU Make assumes some default content in ARFLAGS.
# This setting defines the value of BSP_ARFLAGS in Makefile.
BSP_ARFLAGS = -src
# Custom flags only passed to the assembler. This setting defines the value of
# BSP_ASFLAGS in Makefile.
BSP_ASFLAGS = -Wa,-gdwarf2
# C/C++ compiler debug level. '-g' provides the default set of debug symbols
# typically required to debug a typical application. Omitting '-g' removes
# debug symbols from the ELF. This setting defines the value of
# BSP_CFLAGS_DEBUG in Makefile.
BSP_CFLAGS_DEBUG = -g
# C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal"
# optimization, etc. "-O0" is recommended for code that you want to debug since
# compiler optimization can remove variables and produce non-sequential
# execution of code while debugging. This setting defines the value of
# BSP_CFLAGS_OPTIMIZATION in Makefile.
BSP_CFLAGS_OPTIMIZATION = '-Os'
# C/C++ compiler warning level. "-Wall" is commonly used.This setting defines
# the value of BSP_CFLAGS_WARNINGS in Makefile.
BSP_CFLAGS_WARNINGS = -Wall
# C compiler command.
CC = nios2-elf-gcc -xc
# C++ compiler command.
CXX = nios2-elf-gcc -xc++
# Command used to remove files during 'clean' target.
RM = rm -f
#-------------------------------------------------------------------------------
# BUILD PRE & POST PROCESS COMMANDS
#
# The following variables are treated as shell commands in the rule
# definitions for each file-type associated with the BSP build, as well as
# commands run at the beginning and end of the entire BSP build operation.
# Pre-process commands are executed before the relevant command (for example,
# a command defined in the "CC_PRE_PROCESS" variable executes before the C
# compiler for building .c files), while post-process commands are executed
# immediately afterwards.
#
# You can view each pre/post-process command in the "Build Rules: All &
# Clean", "Pattern Rules to Build Objects", and "Library Rules" sections of
# this Makefile.
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# BSP SOURCE BUILD SETTINGS (FLAG GENERATION)
#
# Software build settings such as compiler optimization, debug level, warning
# flags, etc., may be defined in the following variables. The variables below
# are concatenated together in the 'Flags' section of this Makefile to form
# final variables of flags passed to the build tools.
#
# These settings are considered private to the BSP and apply to all library &
# driver files in it; they do NOT automatically propagate to, for example, the
# build settings for an application.
# # For additional detail and syntax requirements, please refer to GCC help
# (example: "nios2-elf-gcc --help --verbose").
#
# Unless indicated otherwise, multiple entries in each variable should be
# space-separated.
#-------------------------------------------------------------------------------
# Altera HAL alt_sys_init.c generated source file
GENERATED_C_FILES := $(ABS_BSP_ROOT)/alt_sys_init.c
GENERATED_C_LIB_SRCS += alt_sys_init.c
#-------------------------------------------------------------------------------
# BSP SOURCE FILE LISTING
#
# All source files that comprise the BSP are listed here, along with path
# information to each file expressed relative to the BSP root. The precise
# list and location of each file is derived from the driver, operating system,
# or software package source file declarations.
#
# Following specification of the source files for each component, driver, etc.,
# each source file type (C, assembly, etc.) is concatenated together and used
# to construct a list of objects. Pattern rules to build each object are then
# used to build each file.
#-------------------------------------------------------------------------------
# altera_avalon_jtag_uart_driver sources root
altera_avalon_jtag_uart_driver_SRCS_ROOT := drivers
# altera_avalon_jtag_uart_driver sources
altera_avalon_jtag_uart_driver_C_LIB_SRCS := \
$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_init.c \
$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_read.c \
$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_write.c \
$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_ioctl.c \
$(altera_avalon_jtag_uart_driver_SRCS_ROOT)/src/altera_avalon_jtag_uart_fd.c
# altera_avalon_spi_driver sources root
altera_avalon_spi_driver_SRCS_ROOT := drivers
# altera_avalon_spi_driver sources
altera_avalon_spi_driver_C_LIB_SRCS := \
$(altera_avalon_spi_driver_SRCS_ROOT)/src/altera_avalon_spi.c
# altera_avalon_timer_driver sources root
altera_avalon_timer_driver_SRCS_ROOT := drivers
# altera_avalon_timer_driver sources
altera_avalon_timer_driver_C_LIB_SRCS := \
$(altera_avalon_timer_driver_SRCS_ROOT)/src/altera_avalon_timer_sc.c \
$(altera_avalon_timer_driver_SRCS_ROOT)/src/altera_avalon_timer_ts.c \
$(altera_avalon_timer_driver_SRCS_ROOT)/src/altera_avalon_timer_vars.c
# altera_avalon_uart_driver sources root
altera_avalon_uart_driver_SRCS_ROOT := drivers
# altera_avalon_uart_driver sources
altera_avalon_uart_driver_C_LIB_SRCS := \
$(altera_avalon_uart_driver_SRCS_ROOT)/src/altera_avalon_uart_fd.c \
$(altera_avalon_uart_driver_SRCS_ROOT)/src/altera_avalon_uart_init.c \
$(altera_avalon_uart_driver_SRCS_ROOT)/src/altera_avalon_uart_ioctl.c \
$(altera_avalon_uart_driver_SRCS_ROOT)/src/altera_avalon_uart_read.c \
$(altera_avalon_uart_driver_SRCS_ROOT)/src/altera_avalon_uart_write.c
# altera_nios2_qsys_hal_driver sources root
altera_nios2_qsys_hal_driver_SRCS_ROOT := HAL
# altera_nios2_qsys_hal_driver sources
altera_nios2_qsys_hal_driver_C_LIB_SRCS := \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/altera_nios2_qsys_irq.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_usleep.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_busy_sleep.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_vars.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_icache_flush_all.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_all.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_dcache_flush_no_writeback.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_instruction_exception_entry.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_register.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_iic.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_cached.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_remap_uncached.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_free.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_uncached_malloc.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_ctors.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_do_dtors.c \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_gmon.c
altera_nios2_qsys_hal_driver_ASM_LIB_SRCS := \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_entry.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_trap.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_exception_muldiv.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_irq_entry.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_software_exception.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_mcount.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/alt_log_macro.S \
$(altera_nios2_qsys_hal_driver_SRCS_ROOT)/src/crt0.S
# hal sources root
hal_SRCS_ROOT := HAL
# hal sources
hal_C_LIB_SRCS := \
$(hal_SRCS_ROOT)/src/alt_alarm_start.c \
$(hal_SRCS_ROOT)/src/alt_close.c \
$(hal_SRCS_ROOT)/src/alt_dev.c \
$(hal_SRCS_ROOT)/src/alt_dev_llist_insert.c \
$(hal_SRCS_ROOT)/src/alt_dma_rxchan_open.c \
$(hal_SRCS_ROOT)/src/alt_dma_txchan_open.c \
$(hal_SRCS_ROOT)/src/alt_environ.c \
$(hal_SRCS_ROOT)/src/alt_env_lock.c \
$(hal_SRCS_ROOT)/src/alt_errno.c \
$(hal_SRCS_ROOT)/src/alt_execve.c \
$(hal_SRCS_ROOT)/src/alt_exit.c \
$(hal_SRCS_ROOT)/src/alt_fcntl.c \
$(hal_SRCS_ROOT)/src/alt_fd_lock.c \
$(hal_SRCS_ROOT)/src/alt_fd_unlock.c \
$(hal_SRCS_ROOT)/src/alt_find_dev.c \
$(hal_SRCS_ROOT)/src/alt_find_file.c \
$(hal_SRCS_ROOT)/src/alt_flash_dev.c \
$(hal_SRCS_ROOT)/src/alt_fork.c \
$(hal_SRCS_ROOT)/src/alt_fs_reg.c \
$(hal_SRCS_ROOT)/src/alt_fstat.c \
$(hal_SRCS_ROOT)/src/alt_get_fd.c \
$(hal_SRCS_ROOT)/src/alt_getchar.c \
$(hal_SRCS_ROOT)/src/alt_getpid.c \
$(hal_SRCS_ROOT)/src/alt_gettod.c \
$(hal_SRCS_ROOT)/src/alt_iic_isr_register.c \
$(hal_SRCS_ROOT)/src/alt_instruction_exception_register.c \
$(hal_SRCS_ROOT)/src/alt_ioctl.c \
$(hal_SRCS_ROOT)/src/alt_io_redirect.c \
$(hal_SRCS_ROOT)/src/alt_irq_handler.c \
$(hal_SRCS_ROOT)/src/alt_isatty.c \
$(hal_SRCS_ROOT)/src/alt_kill.c \
$(hal_SRCS_ROOT)/src/alt_link.c \
$(hal_SRCS_ROOT)/src/alt_load.c \
$(hal_SRCS_ROOT)/src/alt_log_printf.c \
$(hal_SRCS_ROOT)/src/alt_lseek.c \
$(hal_SRCS_ROOT)/src/alt_main.c \
$(hal_SRCS_ROOT)/src/alt_malloc_lock.c \
$(hal_SRCS_ROOT)/src/alt_open.c \
$(hal_SRCS_ROOT)/src/alt_printf.c \
$(hal_SRCS_ROOT)/src/alt_putchar.c \
$(hal_SRCS_ROOT)/src/alt_putstr.c \
$(hal_SRCS_ROOT)/src/alt_read.c \
$(hal_SRCS_ROOT)/src/alt_release_fd.c \
$(hal_SRCS_ROOT)/src/alt_rename.c \
$(hal_SRCS_ROOT)/src/alt_sbrk.c \
$(hal_SRCS_ROOT)/src/alt_settod.c \
$(hal_SRCS_ROOT)/src/alt_stat.c \
$(hal_SRCS_ROOT)/src/alt_tick.c \
$(hal_SRCS_ROOT)/src/alt_times.c \
$(hal_SRCS_ROOT)/src/alt_unlink.c \
$(hal_SRCS_ROOT)/src/alt_wait.c \
$(hal_SRCS_ROOT)/src/alt_write.c
# Assemble all component C source files
COMPONENT_C_LIB_SRCS += \
$(altera_avalon_jtag_uart_driver_C_LIB_SRCS) \
$(altera_avalon_spi_driver_C_LIB_SRCS) \
$(altera_avalon_timer_driver_C_LIB_SRCS) \
$(altera_avalon_uart_driver_C_LIB_SRCS) \
$(altera_nios2_qsys_hal_driver_C_LIB_SRCS) \
$(hal_C_LIB_SRCS)
# Assemble all component assembly source files
COMPONENT_ASM_LIB_SRCS += \
$(altera_nios2_qsys_hal_driver_ASM_LIB_SRCS)
# Assemble all component C++ source files
COMPONENT_CPP_LIB_SRCS += \
#END MANAGED
#------------------------------------------------------------------------------
# PUBLIC.MK
#
# The generated public.mk file contains BSP information that is shared with
# other external makefiles, such as a Nios II application makefile. System-
# dependent information such as hardware-specific compiler flags and
# simulation file generation are stored here.
#
# In addition, public.mk contains include paths that various software,
# such as a device driver, may need for the C compiler. These paths are
# written to public.mk with respect to the BSP root. In public.mk, each
# path is prefixed with a special variable, $(ALT_LIBRARY_ROOT_DIR). The
# purpose of this variable is to allow an external Makefile to append on
# path information to precisely locate paths expressed in public.mk
# Since this is the BSP Makefile, we set ALT_LIBRARY_ROOT_DIR to point right
# here ("."), at the BSP root.
#
# ALT_LIBRARY_ROOT_DIR must always be set before public.mk is included.
#------------------------------------------------------------------------------
ALT_LIBRARY_ROOT_DIR := .
include public.mk
#------------------------------------------------------------------------------
# FLAGS
#
# Include paths for BSP files are written into the public.mk file and must
# be added to the existing list of pre-processor flags. In addition, "hooks"
# for standard flags left intentionally empty (CFLAGS, CPPFLAGS, ASFLAGS,
# and CXXFLAGS) are provided for conveniently adding to the relevant flags
# on the command-line or via script that calls make.
#------------------------------------------------------------------------------
# Assemble final list of compiler flags from generated content
BSP_CFLAGS += \
$(BSP_CFLAGS_DEFINED_SYMBOLS) \
$(BSP_CFLAGS_UNDEFINED_SYMBOLS) \
$(BSP_CFLAGS_OPTIMIZATION) \
$(BSP_CFLAGS_DEBUG) \
$(BSP_CFLAGS_WARNINGS) \
$(BSP_CFLAGS_USER_FLAGS) \
$(ALT_CFLAGS) \
$(CFLAGS)
# Make ready the final list of include directories and other C pre-processor
# flags. Each include path is made ready by prefixing it with "-I".
BSP_CPPFLAGS += \
$(addprefix -I, $(BSP_INC_DIRS)) \
$(addprefix -I, $(ALT_INCLUDE_DIRS)) \
$(ALT_CPPFLAGS) \
$(CPPFLAGS)
# Finish off assembler flags with any user-provided flags
BSP_ASFLAGS += $(ASFLAGS)
# Finish off C++ flags with any user-provided flags
BSP_CXXFLAGS += $(CXXFLAGS)
# And finally, the ordered list
C_SRCS += $(GENERATED_C_LIB_SRCS) \
$(COMPONENT_C_LIB_SRCS)
CXX_SRCS += $(GENERATED_CPP_LIB_SRCS) \
$(COMPONENT_CPP_LIB_SRCS)
ASM_SRCS += $(GENERATED_ASM_LIB_SRCS) \
$(COMPONENT_ASM_LIB_SRCS)
#------------------------------------------------------------------------------
# LIST OF GENERATED FILES
#
# A Nios II BSP relies on the generation of several source files used
# by both the BSP and any applications referencing the BSP.
#------------------------------------------------------------------------------
GENERATED_H_FILES := $(ABS_BSP_ROOT)/system.h
GENERATED_LINKER_SCRIPT := $(ABS_BSP_ROOT)/linker.x
GENERATED_FILES += $(GENERATED_H_FILES) \
$(GENERATED_LINKER_SCRIPT)
#------------------------------------------------------------------------------
# SETUP TO BUILD OBJECTS
#
# List of object files which are to be built. This is constructed from the input
# list of C source files (C_SRCS), C++ source files (CXX_SRCS), and assembler
# source file (ASM_SRCS). The permitted file extensions are:
#
# .c .C - for C files
# .cxx .cc .cpp .CXX .CC .CPP - for C++ files
# .S .s - for assembly files
#
# Extended description: The list of objects is a sorted list (duplicates
# removed) of all possible objects, placed beneath the ./obj directory,
# including any path information stored in the "*_SRCS" variable. The
# "patsubst" commands are used to concatenate together multiple file suffix
# types for common files (i.e. c++ as .cxx, .cc, .cpp).
#
# File extensions are case-insensitive in build rules with the exception of
# assembly sources. Nios II assembly sources with the ".S" extension are first
# run through the C preprocessor. Sources with the ".s" extension are not.
#------------------------------------------------------------------------------
OBJS = $(sort $(addprefix $(OBJ_DIR)/, \
$(patsubst %.c, %.o, $(patsubst %.C, %.o, $(C_SRCS))) \
$(patsubst %.cxx, %.o, $(patsubst %.CXX, %.o, \
$(patsubst %.cc, %.o, $(patsubst %.CC, %.o, \
$(patsubst %.cpp, %.o, $(patsubst %.CPP, %.o, \
$(CXX_SRCS) )))))) \
$(patsubst %.S, %.o, $(patsubst %.s, %.o, $(ASM_SRCS))) ))
# List of dependancy files for each object file.
DEPS = $(OBJS:.o=.d)
# Rules to force your project to rebuild or relink
# .force_relink file will cause any application that depends on this project to relink
# .force_rebuild file will cause this project to rebuild object files
# .force_rebuild_all file will cause this project and any project that depends on this project to rebuild object files
FORCE_RELINK_DEP := .force_relink
FORCE_REBUILD_DEP := .force_rebuild
FORCE_REBUILD_ALL_DEP := .force_rebuild_all
FORCE_REBUILD_DEP_LIST := $(FORCE_RELINK_DEP) $(FORCE_REBUILD_DEP) $(FORCE_REBUILD_ALL_DEP)
$(FORCE_REBUILD_DEP_LIST):
$(OBJS): $(wildcard $(FORCE_REBUILD_DEP)) $(wildcard $(FORCE_REBUILD_ALL_DEP))
#------------------------------------------------------------------------------
# BUILD RULES: ALL & CLEAN
#------------------------------------------------------------------------------
.DELETE_ON_ERROR:
.PHONY: all
all: build_pre_process
all: Makefile $(GENERATED_FILES) $(BSP_LIB) $(NEWLIB_DIR)
all: build_post_process
# clean: remove .o/.a/.d
.PHONY: clean
clean:
@$(RM) -r $(BSP_LIB) $(OBJ_DIR) $(FORCE_REBUILD_DEP_LIST)
ifneq ($(wildcard $(NEWLIB_DIR)),)
@$(RM) -r $(NEWLIB_DIR)
endif
@$(ECHO) [BSP clean complete]
#------------------------------------------------------------------------------
# BUILD PRE/POST PROCESS
#------------------------------------------------------------------------------
build_pre_process :
$(BUILD_PRE_PROCESS)
build_post_process :
$(BUILD_POST_PROCESS)
.PHONY: build_pre_process build_post_process
#------------------------------------------------------------------------------
# MAKEFILE UP TO DATE?
#
# Is this very Makefile up to date? Someone may have changed the BSP settings
# file or the associated target hardware.
#------------------------------------------------------------------------------
# Skip this check when clean is the only target
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(wildcard $(SETTINGS_FILE)),$(SETTINGS_FILE))
$(warning Warning: BSP Settings File $(SETTINGS_FILE) could not be found.)
endif
Makefile: $(wildcard $(SETTINGS_FILE))
@$(ECHO) Makefile not up to date.
@$(ECHO) $(SETTINGS_FILE) has been modified since the BSP Makefile was generated.
@$(ECHO)
@$(ECHO) Generate the BSP to update the Makefile, and then build again.
@$(ECHO)
@$(ECHO) To generate from Eclipse:
@$(ECHO) " 1. Right-click the BSP project."
@$(ECHO) " 2. In the Nios II Menu, click Generate BSP."
@$(ECHO)
@$(ECHO) To generate from the command line:
@$(ECHO) " nios2-bsp-generate-files --settings=<settings file> --bsp-dir=<target bsp files directory>"
@$(ECHO)
@exit 1
ifneq ($(wildcard $(SOPC_FILE)),$(SOPC_FILE))
$(warning Warning: SOPC File $(SOPC_FILE) could not be found.)
endif
public.mk: $(wildcard $(SOPC_FILE))
@$(ECHO) Makefile not up to date.
@$(ECHO) $(SOPC_FILE) has been modified since the BSP was generated.
@$(ECHO)
@$(ECHO) Generate the BSP to update the Makefile, and then build again.
@$(ECHO)
@$(ECHO) To generate from Eclipse:
@$(ECHO) " 1. Right-click the BSP project."
@$(ECHO) " 2. In the Nios II Menu, click Generate BSP."
@$(ECHO)
@$(ECHO) To generate from the command line:
@$(ECHO) " nios2-bsp-generate-files --settings=<settings file> --bsp-dir=<target bsp files directory>"
@$(ECHO)
@exit 1
endif # $(MAKECMDGOALS) != clean
#------------------------------------------------------------------------------
# PATTERN RULES TO BUILD OBJECTS
#------------------------------------------------------------------------------
$(OBJ_DIR)/%.o: %.c
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CC_PRE_PROCESS)
$(CC) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CC_POST_PROCESS)
$(OBJ_DIR)/%.o: %.C
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CC_PRE_PROCESS)
$(CC) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CC_POST_PROCESS)
$(OBJ_DIR)/%.o: %.cpp
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
$(OBJ_DIR)/%.o: %.CPP
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
$(OBJ_DIR)/%.o: %.cc
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
$(OBJ_DIR)/%.o: %.CC
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
$(OBJ_DIR)/%.o: %.cxx
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
$(OBJ_DIR)/%.o: %.CXX
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
$(OBJ_DIR)/%.o: %.S
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(AS_PRE_PROCESS)
$(AS) -MP -MMD -c $(BSP_CFLAGS) $(BSP_CPPFLAGS) $(BSP_ASFLAGS) -o $@ $<
$(AS_POST_PROCESS)
$(OBJ_DIR)/%.o: %.s
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(AS_PRE_PROCESS)
$(AS) -MP -MMD -c $(BSP_ASFLAGS) $(BSP_CFLAGS) -o $@ $<
$(AS_POST_PROCESS)
# Pattern rules for making useful intermediate files
$(OBJ_DIR)/%.s: %.c
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CC_PRE_PROCESS)
$(CC) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CC_POST_PROCESS)
$(OBJ_DIR)/%.s: %.cpp
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_PRE_PROCESS)
$(OBJ_DIR)/%.s: %.cc
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_PRE_PROCESS)
$(OBJ_DIR)/%.s: %.cxx
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_PRE_PROCESS)
$(OBJ_DIR)/%.i: %.c
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CC_PRE_PROCESS)
$(CC) -E $(CPPFLAGS) $(ALT_CFLAGS) $(CFLAGS) -o $@ $<
$(CC_PRE_PROCESS)
$(OBJ_DIR)/%.i: %.cpp
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_PRE_PROCESS)
$(OBJ_DIR)/%.i: %.cc
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_PRE_PROCESS)
$(OBJ_DIR)/%.i: %.cxx
@$(ECHO) Compiling $(<F) to assembler...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_PRE_PROCESS)
# Pattern rules for building other object files.
%.o: %.c
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CC_PRE_PROCESS)
$(CC) -MP -MMD -c $(CPPFLAGS) $(ALT_CFLAGS) $(CFLAGS) -o $@ $<
$(CC_POST_PROCESS)
%.o: %.cpp
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_POST_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
%.o: %.cc
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_POST_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
%.o: %.cxx
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(CXX_PRE_PROCESS)
$(CXX) -MP -MMD -c $(BSP_CPPFLAGS) $(BSP_CXXFLAGS) $(BSP_CFLAGS) -o $@ $<
$(CXX_POST_PROCESS)
%.o: %.S
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(AS_PRE_PROCESS)
$(AS) -MP -MMD -c $(BSP_CFLAGS) $(BSP_CPPFLAGS) $(BSP_ASFLAGS) -o $@ $<
$(AS_POST_PROCESS)
%.o: %.s
@$(ECHO) Compiling $(<F)...
@$(MKDIR) $(@D)
$(AS_PRE_PROCESS)
$(AS) -MP -MMD -c $(BSP_ASFLAGS) $(BSP_CFLAGS) -o $@ $<
$(AS_POST_PROCESS)
#------------------------------------------------------------------------------
# NEWLIB RULES
#------------------------------------------------------------------------------
ifneq ($(NEWLIB_DIR),)
$(NEWLIB_DIR):
@$(ECHO) Creating $(NEWLIB_DIR)...
nios2-newlib-gen --no-multilib $(NEWLIB_DIR)-build-tmp $(NEWLIB_DIR) --custom "$(NEWLIB_FLAGS)"
@$(ECHO) Removing $(NEWLIB_DIR)-build-tmp...
@$(RM) -rf $(NEWLIB_DIR)-build-tmp
endif
#------------------------------------------------------------------------------
# LIBRARY RULES
#------------------------------------------------------------------------------
$(BSP_LIB): $(OBJS)
@$(ECHO) Creating $@...
$(AR_PRE_PROCESS)
$(RM) -f $@
$(AR) $(BSP_ARFLAGS) $@ $^
$(AR_POST_PROCESS)
#------------------------------------------------------------------------------
# DEPENDENCY FILES
#------------------------------------------------------------------------------
ifneq ($(findstring clean, $(MAKECMDGOALS)),clean)
-include $(DEPS)
endif
# End of Makefile

View file

@ -0,0 +1,49 @@
#!/bin/bash
#
# This script creates the ucosii_net_zipfs Board Support Package (BSP).
BSP_TYPE=hal
BSP_DIR=.
SOPC_DIR=../../
SOPC_FILE=Z:/work/nuandclean/release/hdl/fpga/ip/altera/nios_system/nios_system.sopcinfo
NIOS2_BSP_ARGS="--set hal.max_file_descriptors 4 --set hal.enable_small_c_library true --set hal.sys_clk_timer none --set hal.timestamp_timer none --set hal.enable_exit false --set hal.enable_c_plus_plus false --set hal.enable_lightweight_device_driver_api true --set hal.enable_clean_exit false --set hal.enable_sim_optimize false --set hal.enable_reduced_device_drivers true --set hal.make.bsp_cflags_optimization '-Os'"
CPU_NAME=
# Don't run make if create-this-app script is called with --no-make arg
SKIP_MAKE=
while [ $# -gt 0 ]
do
case "$1" in
--no-make)
SKIP_MAKE=1
;;
*)
NIOS2_BSP_ARGS="$NIOS2_BSP_ARGS $1"
;;
esac
shift
done
# Run nios2-bsp utility to create a hal BSP in this directory
# for the system with a .sopc file in $SOPC_FILE.
# Deprecating $SOPC_DIR in 10.1. Multiple .sopcinfo files in a directory may exist.
if [ -z "$SOPC_FILE" ]; then
echo "WARNING: Use of a directory for locating a .sopcinfo file is deprecated in 10.1. Multiple .sopcinfo files may exist. You must specify the full .sopcinfo path."
cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_DIR $NIOS2_BSP_ARGS $CPU_NAME"
else
cmd="nios2-bsp $BSP_TYPE $BSP_DIR $SOPC_FILE $NIOS2_BSP_ARGS $CPU_NAME"
fi
echo "create-this-bsp: Running \"$cmd\""
$cmd || {
echo "$cmd failed"
exit 1
}
if [ -z "$SKIP_MAKE" ]; then
echo "create-this-bsp: Running make"
make
fi

View file

@ -0,0 +1,322 @@
#########################################################################
####### M E M I N I T M A K E F I L E C O N T E N T ######
#########################################################################
#########################################################################
# This file is intended to be included by public.mk
#
#
# The following variables must be defined before including this file:
# - ELF
#
# The following variables may be defined to override the default behavior:
# - HDL_SIM_DIR
# - HDL_SIM_INSTALL_DIR
# - MEM_INIT_DIR
# - MEM_INIT_INSTALL_DIR
# - QUARTUS_PROJECT_DIR
# - SOPC_NAME
# - SIM_OPTIMIZE
# - RESET_ADDRESS
#
#########################################################################
ifeq ($(MEM_INIT_FILE),)
# MEM_INIT_FILE should be set equal to the working relative path to this
# mem_init.mk makefile fragment
MEM_INIT_FILE := $(wildcard $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
endif
ifeq ($(ELF2DAT),)
ELF2DAT := elf2dat
endif
ifeq ($(ELF2HEX),)
ELF2HEX := elf2hex
endif
ifeq ($(ELF2FLASH),)
ELF2FLASH := elf2flash
endif
ifeq ($(FLASH2DAT),)
FLASH2DAT := flash2dat
endif
ifeq ($(NM),)
NM := nios2-elf-nm
endif
ifeq ($(MKDIR),)
MKDIR := mkdir -p
endif
ifeq ($(RM),)
RM := rm -f
endif
ifeq ($(CP),)
CP := cp
endif
ifeq ($(ECHO),)
ECHO := echo
endif
MEM_INIT_DIR ?= mem_init
HDL_SIM_DIR ?= $(MEM_INIT_DIR)/hdl_sim
ifdef QUARTUS_PROJECT_DIR
MEM_INIT_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))
ifdef SOPC_NAME
HDL_SIM_INSTALL_DIR ?= $(patsubst %/,%,$(QUARTUS_PROJECT_DIR))/$(SOPC_NAME)_sim
endif
endif
MEM_INIT_DESCRIPTOR_FILE ?= $(MEM_INIT_DIR)/meminit.spd
MEM_INIT_QIP_FILE ?= $(MEM_INIT_DIR)/meminit.qip
#-------------------------------------
# Default Flash Boot Loaders
#-------------------------------------
BOOT_LOADER_PATH ?= $(SOPC_KIT_NIOS2)/components/altera_nios2
BOOT_LOADER_CFI ?= $(BOOT_LOADER_PATH)/boot_loader_cfi.srec
BOOT_LOADER_CFI_BE ?= $(BOOT_LOADER_PATH)/boot_loader_cfi_be.srec
#-------------------------------------
# Default Target
#-------------------------------------
.PHONY: default_mem_init
ifeq ($(QSYS),1)
default_mem_init: mem_init_generate
else
default_mem_init: mem_init_install
endif
#-------------------------------------
# Runtime Macros
#-------------------------------------
define post-process-info
@echo Post-processing to create $@...
endef
target_stem = $(notdir $(basename $@))
mem_start_address = $($(target_stem)_START)
mem_end_address = $($(target_stem)_END)
mem_width = $($(target_stem)_WIDTH)
mem_endianness = $($(target_stem)_ENDIANNESS)
mem_create_lanes = $($(target_stem)_CREATE_LANES)
mem_pad_flag = $($(target_stem)_PAD_FLAG)
mem_reloc_input_flag = $($(target_stem)_RELOC_INPUT_FLAG)
mem_no_zero_fill_flag = $($(target_stem)_NO_ZERO_FILL_FLAG)
flash_mem_epcs_flag = $($(target_stem)_EPCS_FLAGS)
flash_mem_cfi_flag = $($(target_stem)_CFI_FLAGS)
flash_mem_boot_loader_flag = $($(target_stem)_BOOT_LOADER_FLAG)
elf2dat_extra_args = $(mem_pad_flag)
elf2hex_extra_args = $(mem_no_zero_fill_flag)
elf2flash_extra_args = $(flash_mem_cfi_flag) $(flash_mem_epcs_flag) $(flash_mem_boot_loader_flag)
flash2dat_extra_args = $(mem_pad_flag) $(mem_reloc_input_flag)
#------------------------------------------------------------------------------
# BSP SPECIFIC CONTENT
#
# The content below is controlled by the BSP and SOPC System
#------------------------------------------------------------------------------
#START OF BSP SPECIFIC
#-------------------------------------
# Global Settings
#-------------------------------------
# The following TYPE comment allows tools to identify the 'type' of target this
# makefile is associated with.
# TYPE: BSP_MEMINIT_MAKEFILE
# This following VERSION comment indicates the version of the tool used to
# generate this makefile. A makefile variable is provided for VERSION as well.
# ACDS_VERSION: 12.1sp1
ACDS_VERSION := 12.1sp1
# This following BUILD_NUMBER comment indicates the build number of the tool
# used to generate this makefile.
# BUILD_NUMBER: 243
# Optimize for simulation
SIM_OPTIMIZE ?= 0
# The CPU reset address as needed by elf2flash
RESET_ADDRESS ?= 0x00000000
#-------------------------------------
# Pre-Initialized Memory Descriptions
#-------------------------------------
# Memory: onchip_memory2_0
MEM_0 := nios_system_onchip_memory2_0
$(MEM_0)_NAME := onchip_memory2_0
$(MEM_0)_MEM_INIT_FILE_PARAM_NAME := INIT_FILE
HEX_FILES += $(MEM_INIT_DIR)/$(MEM_0).hex
MEM_INIT_INSTALL_FILES += $(MEM_INIT_INSTALL_DIR)/$(MEM_0).hex
DAT_FILES += $(HDL_SIM_DIR)/$(MEM_0).dat
HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).dat
SYM_FILES += $(HDL_SIM_DIR)/$(MEM_0).sym
HDL_SIM_INSTALL_FILES += $(HDL_SIM_INSTALL_DIR)/$(MEM_0).sym
$(MEM_0)_START := 0x00000000
$(MEM_0)_END := 0x00007fff
$(MEM_0)_HIERARCHICAL_PATH := onchip_memory2_0
$(MEM_0)_WIDTH := 32
$(MEM_0)_ENDIANNESS := --little-endian-mem
$(MEM_0)_CREATE_LANES := 0
.PHONY: onchip_memory2_0
onchip_memory2_0: check_elf_exists $(MEM_INIT_DIR)/$(MEM_0).hex $(HDL_SIM_DIR)/$(MEM_0).dat $(HDL_SIM_DIR)/$(MEM_0).sym
#END OF BSP SPECIFIC
#-------------------------------------
# Pre-Initialized Memory Targets
#-------------------------------------
.PHONY: mem_init_install mem_init_generate mem_init_clean
ifeq ($(QSYS),1)
# Target mem_init_install is deprecated for QSys based systems
# To initialize onchip memories for Quartus II Synthesis with Qsys based systems:
# 1) Use "make mem_init_genearate"
# 2) Add the generated mem_init/meminit.qip file to your Quartus II Project
#
mem_init_install:
$(error Deprecated Makefile Target: '$@'. Use target 'mem_init_generate' and then add $(MEM_INIT_QIP_FILE) to your Quartus II Project)
else # QSYS != 1, if SopcBuilder based system
ifneq ($(MEM_INIT_INSTALL_DIR),)
mem_init_install: $(MEM_INIT_INSTALL_FILES)
endif
ifneq ($(HDL_SIM_INSTALL_DIR),)
mem_init_install: $(HDL_SIM_INSTALL_FILES)
endif
mem_init_install: mem_init_generate
ifeq ($(MEM_INIT_INSTALL_DIR),)
@echo "WARNING: MEM_INIT_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR environment variable."
endif
ifeq ($(HDL_SIM_INSTALL_DIR),)
@echo "WARNING: HDL_SIM_INSTALL_DIR not set. Set your QUARTUS_PROJECT_DIR and SOPC_NAME environment variable."
endif
$(MEM_INIT_INSTALL_FILES): $(MEM_INIT_INSTALL_DIR)/%: $(MEM_INIT_DIR)/%
@$(MKDIR) $(@D)
@$(CP) -v $< $@
$(HDL_SIM_INSTALL_FILES): $(HDL_SIM_INSTALL_DIR)/%: $(HDL_SIM_DIR)/%
@$(MKDIR) $(@D)
@$(CP) -v $< $@
endif # QSYS == 1
mem_init_generate: hex dat sym flash $(MEM_INIT_DESCRIPTOR_FILE) $(MEM_INIT_QIP_FILE)
mem_init_clean:
@$(RM) -r $(MEM_INIT_DIR) $(HDL_SIM_DIR) $(FLASH_FILES)
.PHONY: hex dat sym flash
hex: check_elf_exists $(HEX_FILES)
dat: check_elf_exists $(DAT_FILES)
sym: check_elf_exists $(SYM_FILES)
flash: check_elf_exists $(FLASH_FILES)
#-------------------------------------
# Pre-Initialized Memory Rules
#-------------------------------------
.PHONY: check_elf_exists
check_elf_exists: $(ELF)
ifeq ($(ELF),)
$(error ELF var not set in mem_init.mk)
endif
$(filter-out $(FLASH_DAT_FILES),$(DAT_FILES)): %.dat: $(ELF)
$(post-process-info)
@$(MKDIR) $(@D)
bash -c '$(ELF2DAT) --infile=$< --outfile=$@ \
--base=$(mem_start_address) --end=$(mem_end_address) --width=$(mem_width) \
$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2dat_extra_args)'
$(foreach i,0 1 2 3 4 5 6 7,%_lane$(i).dat): %.dat
@true
$(HEX_FILES): %.hex: $(ELF)
$(post-process-info)
@$(MKDIR) $(@D)
bash -c '$(ELF2HEX) $< $(mem_start_address) $(mem_end_address) --width=$(mem_width) \
$(mem_endianness) --create-lanes=$(mem_create_lanes) $(elf2hex_extra_args) $@'
$(SYM_FILES): %.sym: $(ELF)
$(post-process-info)
@$(MKDIR) $(@D)
$(NM) -n $< > $@
$(FLASH_FILES): %.flash: $(ELF)
$(post-process-info)
@$(MKDIR) $(@D)
bash -c '$(ELF2FLASH) --input=$< --outfile=$@ --sim_optimize=$(SIM_OPTIMIZE) $(mem_endianness) \
$(elf2flash_extra_args)'
#
# Function generate_spd_entry
# Arg1: path to the memory initialization file
# Arg2: Type HEX or DAT
# Arg3: Output spd file to append
gen_spd_entry.BASE_FILE = $(basename $(notdir $1))
gen_spd_entry.PARAM_NAME = $($(gen_spd_entry.BASE_FILE)_MEM_INIT_FILE_PARAM_NAME)
gen_spd_entry.MEM_PATH = $($(gen_spd_entry.BASE_FILE)_HIERARCHICAL_PATH)
gen_spd_entry.SETTINGS = $(strip \
path=\"$1\" \
type=\"$2\" \
$(if $(gen_spd_entry.PARAM_NAME),initParamName=\"$(gen_spd_entry.PARAM_NAME)\") \
$(if $(gen_spd_entry.MEM_PATH),memoryPath=\"$(gen_spd_entry.MEM_PATH)\") \
)
define gen_spd_entry
$(ECHO) "<file $(gen_spd_entry.SETTINGS) />" >> $3
endef
$(MEM_INIT_DESCRIPTOR_FILE).DAT_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(DAT_FILES))
$(MEM_INIT_DESCRIPTOR_FILE).HEX_FILESET := $(patsubst $(dir $(MEM_INIT_DESCRIPTOR_FILE))%,%,$(HEX_FILES))
$(MEM_INIT_DESCRIPTOR_FILE): %.spd: $(MEM_INIT_FILE)
$(post-process-info)
@$(MKDIR) $(@D)
@$(RM) $@
@$(ECHO) "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $@
@$(ECHO) "<simPackage>" >> $@
@$(foreach dat_file,$($@.DAT_FILESET),$(call gen_spd_entry,$(dat_file),DAT,$@) &&)true
@$(foreach hex_file,$($@.HEX_FILESET),$(call gen_spd_entry,$(hex_file),HEX,$@) &&)true
@$(ECHO) "</simPackage>" >> $@
.DELETE_ON_ERROR: $(MEM_INIT_DESCRIPTOR_FILE)
$(MEM_INIT_QIP_FILE): %.qip: $(MEM_INIT_FILE)
$(post-process-info)
@$(MKDIR) $(@D)
@$(RM) $@
@$(ECHO) "set_global_assignment -name SEARCH_PATH $$::quartus(qip_path)" > $@
.DELETE_ON_ERROR: $(MEM_INIT_QIP_FILE)

View file

@ -0,0 +1,390 @@
#------------------------------------------------------------------------------
# BSP "PUBLIC" MAKEFILE CONTENT
#
# This file is intended to be included in an application or library
# Makefile that is using this BSP. You can create such a Makefile with
# the nios2-app-generate-makefile or nios2-lib-generate-makefile
# commands.
#
# The following variables must be defined before including this file:
#
# ALT_LIBRARY_ROOT_DIR
# Contains the path to the BSP top-level (aka root) directory
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# PATHS
#------------------------------------------------------------------------------
# Path to the provided linker script.
BSP_LINKER_SCRIPT := $(ALT_LIBRARY_ROOT_DIR)/linker.x
# Include paths:
# The path to root of all header files that a library wishes to make
# available for an application's use is specified here. Note that this
# may not be *all* folders within a hierarchy. For example, if it is
# desired that the application developer type:
# #include <sockets.h>
# #include <ip/tcpip.h>
# With files laid out like this:
# <root of library>/inc/sockets.h
# <root of library>/inc/ip/tcpip.h
#
# Then, only <root of library>/inc need be added to the list of include
# directories. Alternatively, if you wish to be able to directly include
# all files in a hierarchy, separate paths to each folder in that
# hierarchy must be defined.
# The following are the "base" set of include paths for a BSP.
# These paths are appended to the list that individual software
# components, drivers, etc., add in the generated portion of this
# file (below).
ALT_INCLUDE_DIRS_TO_APPEND += \
$(ALT_LIBRARY_ROOT_DIR) \
$(ALT_LIBRARY_ROOT_DIR)/drivers/inc
# Additions to linker library search-path:
# Here we provide a path to "our self" for the application to construct a
# "-L <path to BSP>" out of. This should contain a list of directories,
# relative to the library root, of all directories with .a files to link
# against.
ALT_LIBRARY_DIRS += $(ALT_LIBRARY_ROOT_DIR)
#------------------------------------------------------------------------------
# COMPILATION FLAGS
#------------------------------------------------------------------------------
# Default C pre-processor flags for a BSP:
ALT_CPPFLAGS += -DSYSTEM_BUS_WIDTH=32 \
-pipe
#------------------------------------------------------------------------------
# MANAGED CONTENT
#
# All content between the lines "START MANAGED" and "END MANAGED" below is
# generated based on variables in the BSP settings file when the
# nios2-bsp-generate-files command is invoked. If you wish to persist any
# information pertaining to the build process, it is recomended that you
# utilize the BSP settings mechanism to do so.
#------------------------------------------------------------------------------
#START MANAGED
# The following TYPE comment allows tools to identify the 'type' of target this
# makefile is associated with.
# TYPE: BSP_PUBLIC_MAKEFILE
# This following VERSION comment indicates the version of the tool used to
# generate this makefile. A makefile variable is provided for VERSION as well.
# ACDS_VERSION: 12.1sp1
ACDS_VERSION := 12.1sp1
# This following BUILD_NUMBER comment indicates the build number of the tool
# used to generate this makefile.
# BUILD_NUMBER: 243
# Qsys--generated SOPCINFO file. Required for resolving node instance ID's with
# design component names.
SOPCINFO_FILE := Z:/work/nuandclean/release/hdl/fpga/ip/altera/nios_system/nios_system.sopcinfo
# Big-Endian operation.
# setting BIG_ENDIAN is false
ALT_CFLAGS += -EL
# Path to the provided C language runtime initialization code.
BSP_CRT0 := $(ALT_LIBRARY_ROOT_DIR)/obj/HAL/src/crt0.o
# Name of BSP library as provided to linker using the "-msys-lib" flag or
# linker script GROUP command.
# setting BSP_SYS_LIB is hal_bsp
BSP_SYS_LIB := hal_bsp
ELF_PATCH_FLAG += --thread_model hal
# Type identifier of the BSP library
# setting BSP_TYPE is hal
ALT_CPPFLAGS += -D__hal__
BSP_TYPE := hal
# CPU Name
# setting CPU_NAME is nios2_qsys_0
CPU_NAME = nios2_qsys_0
ELF_PATCH_FLAG += --cpu_name $(CPU_NAME)
# Hardware Divider present.
# setting HARDWARE_DIVIDE is false
ALT_CFLAGS += -mno-hw-div
# Hardware Multiplier present.
# setting HARDWARE_MULTIPLY is false
ALT_CFLAGS += -mno-hw-mul
# Hardware Mulx present.
# setting HARDWARE_MULX is false
ALT_CFLAGS += -mno-hw-mulx
# Debug Core present.
# setting HAS_DEBUG_CORE is true
CPU_HAS_DEBUG_CORE = 1
# Qsys generated design
# setting QSYS is 1
QSYS := 1
ELF_PATCH_FLAG += --qsys true
# Design Name
# setting SOPC_NAME is nios_system
SOPC_NAME := nios_system
# SopcBuilder Simulation Enabled
# setting SOPC_SIMULATION_ENABLED is false
ELF_PATCH_FLAG += --simulation_enabled false
# Small-footprint (polled mode) driver none
# setting altera_avalon_jtag_uart_driver.enable_small_driver is false
# Enable driver ioctl() support. This feature is not compatible with the
# 'small' driver; ioctl() support will not be compiled if either the UART
# 'enable_small_driver' or HAL 'enable_reduced_device_drivers' settings are
# enabled. none
# setting altera_avalon_uart_driver.enable_ioctl is false
# Small-footprint (polled mode) driver none
# setting altera_avalon_uart_driver.enable_small_driver is false
# Build a custom version of newlib with the specified space-separated compiler
# flags. The custom newlib build will be placed in the &lt;bsp root>/newlib
# directory, and will be used only for applications that utilize this BSP.
# setting hal.custom_newlib_flags is none
# Enable support for a subset of the C++ language. This option increases code
# footprint by adding support for C++ constructors. Certain features, such as
# multiple inheritance and exceptions are not supported. If false, adds
# -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code
# footprint. none
# setting hal.enable_c_plus_plus is false
ALT_CPPFLAGS += -DALT_NO_C_PLUS_PLUS
# When your application exits, close file descriptors, call C++ destructors,
# etc. Code footprint can be reduced by disabling clean exit. If disabled, adds
# -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to
# ALT_LDFLAGS in public.mk. none
# setting hal.enable_clean_exit is false
ALT_CPPFLAGS += -DALT_NO_CLEAN_EXIT
ALT_LDFLAGS += -Wl,--defsym,exit=_exit
# Add exit() support. This option increases code footprint if your "main()"
# routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to
# ALT_CPPFLAGS in public.mk, and reduces footprint none
# setting hal.enable_exit is false
ALT_CPPFLAGS += -DALT_NO_EXIT
# Causes code to be compiled with gprof profiling enabled and the application
# ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to
# ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk. none
# setting hal.enable_gprof is false
# Enables lightweight device driver API. This reduces code and data footprint
# by removing the HAL layer that maps device names (e.g. /dev/uart0) to file
# descriptors. Instead, driver routines are called directly. The open(),
# close(), and lseek() routines will always fail if called. The read(),
# write(), fstat(), ioctl(), and isatty() routines only work for the stdio
# devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.
# The Altera Host and read-only ZIP file systems can't be used if
# hal.enable_lightweight_device_driver_api is true.
# setting hal.enable_lightweight_device_driver_api is true
ALT_CPPFLAGS += -DALT_USE_DIRECT_DRIVERS
# Adds code to emulate multiply and divide instructions in case they are
# executed but aren't present in the CPU. Normally this isn't required because
# the compiler won't use multiply and divide instructions that aren't present
# in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in
# public.mk. none
# setting hal.enable_mul_div_emulation is false
ALT_CPPFLAGS += -DALT_NO_INSTRUCTION_EMULATION
# Certain drivers are compiled with reduced functionality to reduce code
# footprint. Not all drivers observe this setting. The altera_avalon_uart and
# altera_avalon_jtag_uart drivers switch from interrupt-driven to polled
# operation. CAUTION: Several device drivers are disabled entirely. These
# include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and
# altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash
# access routines) to fail. You can define a symbol provided by each driver to
# prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to
# ALT_CPPFLAGS in public.mk. none
# setting hal.enable_reduced_device_drivers is true
ALT_CPPFLAGS += -DALT_USE_SMALL_DRIVERS
# Turns on HAL runtime stack checking feature. Enabling this setting causes
# additional code to be placed into each subroutine call to generate an
# exception if a stack collision occurs with the heap or statically allocated
# data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in
# public.mk. none
# setting hal.enable_runtime_stack_checking is false
# The BSP is compiled with optimizations to speedup HDL simulation such as
# initializing the cache, clearing the .bss section, and skipping long delay
# loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk. When
# this setting is true, the BSP shouldn't be used to build applications that
# are expected to run real hardware.
# setting hal.enable_sim_optimize is false
# Causes the small newlib (C library) to be used. This reduces code and data
# footprint at the expense of reduced functionality. Several newlib features
# are removed such as floating-point support in printf(), stdin input routines,
# and buffered I/O. The small C library is not compatible with Micrium
# MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk. none
# setting hal.enable_small_c_library is true
ALT_LDFLAGS += -msmallc
ALT_CPPFLAGS += -DSMALL_C_LIB
# Enable SOPC Builder System ID. If a System ID SOPC Builder component is
# connected to the CPU associated with this BSP, it will be enabled in the
# creation of command-line arguments to download an ELF to the target.
# Otherwise, system ID and timestamp values are left out of public.mk for
# application Makefile "download-elf" target definition. With the system ID
# check disabled, the Nios II EDS tools will not automatically ensure that the
# application .elf file (and BSP it is linked against) corresponds to the
# hardware design on the target. If false, adds --accept-bad-sysid to
# SOPC_SYSID_FLAG in public.mk. none
# setting hal.enable_sopc_sysid_check is true
# Enable BSP generation to query if SOPC system is big endian. If true ignores
# export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true
# ignores export of 'ALT_CFLAGS += -EL' if little endian system. none
# setting hal.make.ignore_system_derived.big_endian is false
# Enable BSP generation to query if SOPC system has a debug core present. If
# true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core
# is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if
# no debug core is found in the system. none
# setting hal.make.ignore_system_derived.debug_core_present is false
# Enable BSP generation to query if SOPC system has FPU present. If true
# ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found
# in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU
# is not found in the system. none
# setting hal.make.ignore_system_derived.fpu_present is false
# Enable BSP generation to query if SOPC system has hardware divide present. If
# true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no
# division is found in system. If true ignores export of 'ALT_CFLAGS +=
# -mhw-div' if division is found in the system. none
# setting hal.make.ignore_system_derived.hardware_divide_present is false
# Enable BSP generation to query if SOPC system floating point custom
# instruction with a divider is present. If true ignores export of 'ALT_CFLAGS
# += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to
# public.mk if the custom instruction is found in the system. none
# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present is false
# Enable BSP generation to query if SOPC system floating point custom
# instruction without a divider is present. If true ignores export of
# 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS +=
# -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the
# system. none
# setting hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present is false
# Enable BSP generation to query if SOPC system has multiplier present. If true
# ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier
# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if
# multiplier is found in the system. none
# setting hal.make.ignore_system_derived.hardware_multiplier_present is false
# Enable BSP generation to query if SOPC system has hardware mulx present. If
# true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx
# is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx'
# if mulx is found in the system. none
# setting hal.make.ignore_system_derived.hardware_mulx_present is false
# Enable BSP generation to query if SOPC system has simulation enabled. If true
# ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk. none
# setting hal.make.ignore_system_derived.sopc_simulation_enabled is false
# Enable BSP generation to query SOPC system for system ID base address. If
# true ignores export of 'SOPC_SYSID_FLAG += --sidp=<address>' and
# 'ELF_PATCH_FLAG += --sidp=<address>' to public.mk. none
# setting hal.make.ignore_system_derived.sopc_system_base_address is false
# Enable BSP generation to query SOPC system for system ID. If true ignores
# export of 'SOPC_SYSID_FLAG += --id=<sysid>' and 'ELF_PATCH_FLAG +=
# --id=<sysid>' to public.mk. none
# setting hal.make.ignore_system_derived.sopc_system_id is false
# Enable BSP generation to query SOPC system for system timestamp. If true
# ignores export of 'SOPC_SYSID_FLAG += --timestamp=<timestamp>' and
# 'ELF_PATCH_FLAG += --timestamp=<timestamp>' to public.mk. none
# setting hal.make.ignore_system_derived.sopc_system_timestamp is false
# Slave descriptor of STDERR character-mode device. This setting is used by the
# ALT_STDERR family of defines in system.h. none
# setting hal.stderr is jtag_uart_0
ELF_PATCH_FLAG += --stderr_dev jtag_uart_0
# Slave descriptor of STDIN character-mode device. This setting is used by the
# ALT_STDIN family of defines in system.h. none
# setting hal.stdin is jtag_uart_0
ELF_PATCH_FLAG += --stdin_dev jtag_uart_0
# Slave descriptor of STDOUT character-mode device. This setting is used by the
# ALT_STDOUT family of defines in system.h. none
# setting hal.stdout is jtag_uart_0
ELF_PATCH_FLAG += --stdout_dev jtag_uart_0
#------------------------------------------------------------------------------
# SOFTWARE COMPONENT & DRIVER INCLUDE PATHS
#------------------------------------------------------------------------------
ALT_INCLUDE_DIRS += $(ALT_LIBRARY_ROOT_DIR)/HAL/inc
#------------------------------------------------------------------------------
# SOFTWARE COMPONENT & DRIVER PRODUCED ALT_CPPFLAGS ADDITIONS
#------------------------------------------------------------------------------
ALT_CPPFLAGS += -DALT_SINGLE_THREADED
#END MANAGED
#------------------------------------------------------------------------------
# LIBRARY INFORMATION
#------------------------------------------------------------------------------
# Assemble the name of the BSP *.a file using the BSP library name
# (BSP_SYS_LIB) in generated content above.
BSP_LIB := lib$(BSP_SYS_LIB).a
# Additional libraries to link against:
# An application including this file will prefix each library with "-l".
# For example, to include the Newlib math library "m" is included, which
# becomes "-lm" when linking the application.
ALT_LIBRARY_NAMES += m
# Additions to linker dependencies:
# An application Makefile will typically add these directly to the list
# of dependencies required to build the executable target(s). The BSP
# library (*.a) file is specified here.
ALT_LDDEPS += $(ALT_LIBRARY_ROOT_DIR)/$(BSP_LIB)
# Is this library "Makeable"?
# Add to list of root library directories that support running 'make'
# to build them. Because libraries may or may not have a Makefile in their
# root, appending to this variable tells an application to run 'make' in
# the library root to build/update this library.
MAKEABLE_LIBRARY_ROOT_DIRS += $(ALT_LIBRARY_ROOT_DIR)
# Additional Assembler Flags
# -gdwarf2 flag is required for stepping through assembly code
ALT_ASFLAGS += -gdwarf2
#------------------------------------------------------------------------------
# FINAL INCLUDE PATH LIST
#------------------------------------------------------------------------------
# Append static include paths to paths specified by OS/driver/sw package
# additions to the BSP thus giving them precedence in case a BSP addition
# is attempting to override BSP sources.
ALT_INCLUDE_DIRS += $(ALT_INCLUDE_DIRS_TO_APPEND)

View file

@ -0,0 +1,937 @@
<?xml version="1.0" encoding="UTF-8"?>
<sch:Settings xmlns:sch="http://www.altera.com/embeddedsw/bsp/schema">
<BspType>hal</BspType>
<BspVersion>default</BspVersion>
<BspGeneratedTimeStamp>Feb 18, 2013 3:36:43 AM</BspGeneratedTimeStamp>
<BspGeneratedUnixTimeStamp>1361187403314</BspGeneratedUnixTimeStamp>
<BspGeneratedLocation>Z:\work\nuandclean\release\hdl\fpga\ip\altera\nios_system\software\lms_spi_controller_bsp</BspGeneratedLocation>
<BspSettingsFile>.\settings.bsp</BspSettingsFile>
<SopcDesignFile>Z:\work\nuandclean\release\hdl\fpga\ip\altera\nios_system\nios_system.sopcinfo</SopcDesignFile>
<JdiFile>default</JdiFile>
<Cpu>nios2_qsys_0</Cpu>
<SchemaVersion>1.9</SchemaVersion>
<Setting>
<SettingName>hal.sys_clk_timer</SettingName>
<Identifier>ALT_SYS_CLK</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Slave descriptor of the system clock timer device. This device provides a periodic interrupt ("tick") and is typically required for RTOS use. This setting defines the value of ALT_SYS_CLK in system.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.timestamp_timer</SettingName>
<Identifier>ALT_TIMESTAMP_CLK</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Slave descriptor of timestamp timer device. This device is used by Altera HAL timestamp drivers for high-resolution time measurement. This setting defines the value of ALT_TIMESTAMP_CLK in system.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.max_file_descriptors</SettingName>
<Identifier>ALT_MAX_FD</Identifier>
<Type>DecimalNumber</Type>
<Value>4</Value>
<DefaultValue>32</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Determines the number of file descriptors statically allocated. This setting defines the value of ALT_MAX_FD in system.h.</Description>
<Restrictions>If hal.enable_lightweight_device_driver_api is true, there are no file descriptors so this setting is ignored. If hal.enable_lightweight_device_driver_api is false, this setting must be at least 4 because HAL needs a file descriptor for /dev/null, /dev/stdin, /dev/stdout, and /dev/stderr.</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.enable_instruction_related_exceptions_api</SettingName>
<Identifier>ALT_INCLUDE_INSTRUCTION_RELATED_EXCEPTION_API</Identifier>
<Type>BooleanDefineOnly</Type>
<Value>false</Value>
<DefaultValue>false</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Enables API for registering handlers to service instruction-related exceptions. Enabling this setting increases the size of the exception entry code.</Description>
<Restrictions>These exception types can be generated if various processor options are enabled, such as the MMU, MPU, or other advanced exception types.</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.linker.allow_code_at_reset</SettingName>
<Identifier>ALT_ALLOW_CODE_AT_RESET</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Indicates if initialization code is allowed at the reset address. If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h.</Description>
<Restrictions>If true, defines the macro ALT_ALLOW_CODE_AT_RESET in linker.h. This setting is typically false if an external bootloader (e.g. flash bootloader) is present.</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.linker.enable_alt_load</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Enables the alt_load() facility. The alt_load() facility copies sections from the .text memory into RAM. If true, this setting sets up the VMA/LMA of sections in linker.x to allow them to be loaded into the .text memory.</Description>
<Restrictions>This setting is typically false if an external bootloader (e.g. flash bootloader) is present.</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.linker.enable_alt_load_copy_rodata</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Causes the alt_load() facility to copy the .rodata section. If true, this setting defines the macro ALT_LOAD_COPY_RODATA in linker.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.linker.enable_alt_load_copy_rwdata</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Causes the alt_load() facility to copy the .rwdata section. If true, this setting defines the macro ALT_LOAD_COPY_RWDATA in linker.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.linker.enable_alt_load_copy_exceptions</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Causes the alt_load() facility to copy the .exceptions section. If true, this setting defines the macro ALT_LOAD_COPY_EXCEPTIONS in linker.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>hal.linker.enable_exception_stack</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Enables use of a separate exception stack. If true, defines the macro ALT_EXCEPTION_STACK in linker.h, adds a memory region called exception_stack to linker.x, and provides the symbols __alt_exception_stack_pointer and __alt_exception_stack_limit in linker.x.</Description>
<Restrictions>The hal.linker.exception_stack_size and hal.linker.exception_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.linker.exception_stack_size</SettingName>
<Identifier>NONE</Identifier>
<Type>DecimalNumber</Type>
<Value>1024</Value>
<DefaultValue>1024</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Size of the exception stack in bytes.</Description>
<Restrictions>Only used if hal.linker.enable_exception_stack is true.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.linker.exception_stack_memory_region_name</SettingName>
<Identifier>NONE</Identifier>
<Type>UnquotedString</Type>
<Value>onchip_memory2_0</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Name of the existing memory region that will be divided up to create the 'exception_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'exception_stack' memory region.</Description>
<Restrictions>Only used if hal.linker.enable_exception_stack is true.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.linker.enable_interrupt_stack</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Enables use of a separate interrupt stack. If true, defines the macro ALT_INTERRUPT_STACK in linker.h, adds a memory region called interrupt_stack to linker.x, and provides the symbols __alt_interrupt_stack_pointer and __alt_interrupt_stack_limit in linker.x.</Description>
<Restrictions>The hal.linker.interrupt_stack_size and hal.linker.interrupt_stack_memory_region_name settings must also be valid. This setting must be false for MicroC/OS-II BSPs. Only enable if the EIC is used exclusively. The exception stack can be used to improve interrupt and other exception performance if the EIC is *not* used.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.linker.interrupt_stack_size</SettingName>
<Identifier>NONE</Identifier>
<Type>DecimalNumber</Type>
<Value>1024</Value>
<DefaultValue>1024</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Size of the interrupt stack in bytes.</Description>
<Restrictions>Only used if hal.linker.enable_interrupt_stack is true.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.linker.interrupt_stack_memory_region_name</SettingName>
<Identifier>NONE</Identifier>
<Type>UnquotedString</Type>
<Value>onchip_memory2_0</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>none</DestinationFile>
<Description>Name of the existing memory region that will be divided up to create the 'interrupt_stack' memory region. The selected region name will be adjusted automatically when the BSP is generated to create the 'interrupt_stack' memory region.</Description>
<Restrictions>Only used if hal.linker.enable_interrupt_stack is true.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.stdin</SettingName>
<Identifier>NONE</Identifier>
<Type>UnquotedString</Type>
<Value>jtag_uart_0</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Slave descriptor of STDIN character-mode device. This setting is used by the ALT_STDIN family of defines in system.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.stdout</SettingName>
<Identifier>NONE</Identifier>
<Type>UnquotedString</Type>
<Value>jtag_uart_0</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Slave descriptor of STDOUT character-mode device. This setting is used by the ALT_STDOUT family of defines in system.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.stderr</SettingName>
<Identifier>NONE</Identifier>
<Type>UnquotedString</Type>
<Value>jtag_uart_0</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>system_h_define</DestinationFile>
<Description>Slave descriptor of STDERR character-mode device. This setting is used by the ALT_STDERR family of defines in system.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.log_port</SettingName>
<Identifier>NONE</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Slave descriptor of debug logging character-mode device. If defined, it enables extra debug messages in the HAL source. This setting is used by the ALT_LOG_PORT family of defines in system.h.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.build_pre_process</SettingName>
<Identifier>BUILD_PRE_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed before BSP built.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ar_pre_process</SettingName>
<Identifier>AR_PRE_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed before archiver execution.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cflags_defined_symbols</SettingName>
<Identifier>BSP_CFLAGS_DEFINED_SYMBOLS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Preprocessor macros to define. A macro definition in this setting has the same effect as a "#define" in source code. Adding "-DALT_DEBUG" to this setting has the same effect as "#define ALT_DEBUG" in a souce file. Adding "-DFOO=1" to this setting is equivalent to the macro "#define FOO 1" in a source file. Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_DEFINED_SYMBOLS in the BSP Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ar_post_process</SettingName>
<Identifier>AR_POST_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed after archiver execution.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.as</SettingName>
<Identifier>AS</Identifier>
<Type>UnquotedString</Type>
<Value>nios2-elf-gcc</Value>
<DefaultValue>nios2-elf-gcc</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Assembler command. Note that CC is used for .S files.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.build_post_process</SettingName>
<Identifier>BUILD_POST_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed after BSP built.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cflags_debug</SettingName>
<Identifier>BSP_CFLAGS_DEBUG</Identifier>
<Type>UnquotedString</Type>
<Value>-g</Value>
<DefaultValue>-g</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>C/C++ compiler debug level. '-g' provides the default set of debug symbols typically required to debug a typical application. Omitting '-g' removes debug symbols from the ELF. This setting defines the value of BSP_CFLAGS_DEBUG in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.make.ar</SettingName>
<Identifier>AR</Identifier>
<Type>UnquotedString</Type>
<Value>nios2-elf-ar</Value>
<DefaultValue>nios2-elf-ar</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Archiver command. Creates library files.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.rm</SettingName>
<Identifier>RM</Identifier>
<Type>UnquotedString</Type>
<Value>rm -f</Value>
<DefaultValue>rm -f</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command used to remove files during 'clean' target.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.cxx_pre_process</SettingName>
<Identifier>CXX_PRE_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed before each C++ file is compiled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cflags_warnings</SettingName>
<Identifier>BSP_CFLAGS_WARNINGS</Identifier>
<Type>UnquotedString</Type>
<Value>-Wall</Value>
<DefaultValue>-Wall</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>C/C++ compiler warning level. "-Wall" is commonly used.This setting defines the value of BSP_CFLAGS_WARNINGS in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_arflags</SettingName>
<Identifier>BSP_ARFLAGS</Identifier>
<Type>UnquotedString</Type>
<Value>-src</Value>
<DefaultValue>-src</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Custom flags only passed to the archiver. This content of this variable is directly passed to the archiver rather than the more standard "ARFLAGS". The reason for this is that GNU Make assumes some default content in ARFLAGS. This setting defines the value of BSP_ARFLAGS in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cflags_optimization</SettingName>
<Identifier>BSP_CFLAGS_OPTIMIZATION</Identifier>
<Type>UnquotedString</Type>
<Value>'-Os'</Value>
<DefaultValue>-O0</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>C/C++ compiler optimization level. "-O0" = no optimization,"-O2" = "normal" optimization, etc. "-O0" is recommended for code that you want to debug since compiler optimization can remove variables and produce non-sequential execution of code while debugging. This setting defines the value of BSP_CFLAGS_OPTIMIZATION in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.make.as_post_process</SettingName>
<Identifier>AS_POST_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed after each assembly file is compiled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.cc_pre_process</SettingName>
<Identifier>CC_PRE_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed before each .c/.S file is compiled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_asflags</SettingName>
<Identifier>BSP_ASFLAGS</Identifier>
<Type>UnquotedString</Type>
<Value>-Wa,-gdwarf2</Value>
<DefaultValue>-Wa,-gdwarf2</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Custom flags only passed to the assembler. This setting defines the value of BSP_ASFLAGS in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.as_pre_process</SettingName>
<Identifier>AS_PRE_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed before each assembly file is compiled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cflags_undefined_symbols</SettingName>
<Identifier>BSP_CFLAGS_UNDEFINED_SYMBOLS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Preprocessor macros to undefine. Undefined macros are similar to defined macros, but replicate the "#undef" directive in source code. To undefine the macro FOO use the syntax "-u FOO" in this setting. This is equivalent to "#undef FOO" in a source file. Note: the syntax differs from macro definition (there is a space, i.e. "-u FOO" versus "-DFOO"). Macros defined with this setting are applied to all .S, .c, and C++ files in the BSP. This setting defines the value of BSP_CFLAGS_UNDEFINED_SYMBOLS in the BSP Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.cc_post_process</SettingName>
<Identifier>CC_POST_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed after each .c/.S file is compiled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.cxx_post_process</SettingName>
<Identifier>CXX_POST_PROCESS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Command executed before each C++ file is compiled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.cc</SettingName>
<Identifier>CC</Identifier>
<Type>UnquotedString</Type>
<Value>nios2-elf-gcc -xc</Value>
<DefaultValue>nios2-elf-gcc -xc</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>C compiler command.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cxx_flags</SettingName>
<Identifier>BSP_CXXFLAGS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Custom flags only passed to the C++ compiler. This setting defines the value of BSP_CXXFLAGS in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_inc_dirs</SettingName>
<Identifier>BSP_INC_DIRS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Space separated list of extra include directories to scan for header files. Directories are relative to the top-level BSP directory. The -I prefix's added by the makefile so don't add it here. This setting defines the value of BSP_INC_DIRS in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.cxx</SettingName>
<Identifier>CXX</Identifier>
<Type>UnquotedString</Type>
<Value>nios2-elf-gcc -xc++</Value>
<DefaultValue>nios2-elf-gcc -xc++</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>C++ compiler command.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.bsp_cflags_user_flags</SettingName>
<Identifier>BSP_CFLAGS_USER_FLAGS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>makefile_variable</DestinationFile>
<Description>Custom flags passed to the compiler when compiling C, C++, and .S files. This setting defines the value of BSP_CFLAGS_USER_FLAGS in Makefile.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.sopc_system_id</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query SOPC system for system ID. If true ignores export of 'SOPC_SYSID_FLAG += --id=&lt;sysid>' and 'ELF_PATCH_FLAG += --id=&lt;sysid>' to public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.sopc_system_timestamp</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query SOPC system for system timestamp. If true ignores export of 'SOPC_SYSID_FLAG += --timestamp=&lt;timestamp>' and 'ELF_PATCH_FLAG += --timestamp=&lt;timestamp>' to public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.sopc_system_base_address</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query SOPC system for system ID base address. If true ignores export of 'SOPC_SYSID_FLAG += --sidp=&lt;address>' and 'ELF_PATCH_FLAG += --sidp=&lt;address>' to public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.sopc_simulation_enabled</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system has simulation enabled. If true ignores export of 'ELF_PATCH_FLAG += --simulation_enabled' to public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.fpu_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system has FPU present. If true ignores export of 'ALT_CFLAGS += -mhard-float' to public.mk if FPU is found in the system. If true ignores export of 'ALT_CFLAGS += -mhard-soft' if FPU is not found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.hardware_multiplier_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system has multiplier present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mul' to public.mk if no multiplier is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mul' if multiplier is found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.hardware_mulx_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system has hardware mulx present. If true ignores export of 'ALT_CFLAGS += -mno-hw-mulx' to public.mk if no mulx is found in the system. If true ignores export of 'ALT_CFLAGS += -mhw-mulx' if mulx is found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.hardware_divide_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system has hardware divide present. If true ignores export of 'ALT_CFLAGS += -mno-hw-div' to public.mk if no division is found in system. If true ignores export of 'ALT_CFLAGS += -mhw-div' if division is found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.debug_core_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system has a debug core present. If true ignores export of 'CPU_HAS_DEBUG_CORE = 1' to public.mk if a debug core is found in the system. If true ignores export of 'CPU_HAS_DEBUG_CORE = 0' if no debug core is found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.big_endian</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system is big endian. If true ignores export of 'ALT_CFLAGS += -EB' to public.mk if big endian system. If true ignores export of 'ALT_CFLAGS += -EL' if little endian system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.hardware_fp_cust_inst_divider_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system floating point custom instruction with a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-2' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-2' to public.mk if the custom instruction is found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.make.ignore_system_derived.hardware_fp_cust_inst_no_divider_present</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable BSP generation to query if SOPC system floating point custom instruction without a divider is present. If true ignores export of 'ALT_CFLAGS += -mcustom-fpu-cfg=60-1' and 'ALT_LDFLAGS += -mcustom-fpu-cfg=60-1' to public.mk if the custom instruction is found in the system.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_exit</SettingName>
<Identifier>ALT_NO_EXIT</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>1</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Add exit() support. This option increases code footprint if your "main()" routine does "return" or call "exit()". If false, adds -DALT_NO_EXIT to ALT_CPPFLAGS in public.mk, and reduces footprint</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_small_c_library</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Causes the small newlib (C library) to be used. This reduces code and data footprint at the expense of reduced functionality. Several newlib features are removed such as floating-point support in printf(), stdin input routines, and buffered I/O. The small C library is not compatible with Micrium MicroC/OS-II. If true, adds -msmallc to ALT_LDFLAGS in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.enable_clean_exit</SettingName>
<Identifier>ALT_NO_CLEAN_EXIT</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>1</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>When your application exits, close file descriptors, call C++ destructors, etc. Code footprint can be reduced by disabling clean exit. If disabled, adds -DALT_NO_CLEAN_EXIT to ALT_CPPFLAGS and -Wl,--defsym, exit=_exit to ALT_LDFLAGS in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_runtime_stack_checking</SettingName>
<Identifier>ALT_STACK_CHECK</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Turns on HAL runtime stack checking feature. Enabling this setting causes additional code to be placed into each subroutine call to generate an exception if a stack collision occurs with the heap or statically allocated data. If true, adds -DALT_STACK_CHECK and -mstack-check to ALT_CPPFLAGS in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_gprof</SettingName>
<Identifier>ALT_PROVIDE_GMON</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Causes code to be compiled with gprof profiling enabled and the application ELF to be linked with the GPROF library. If true, adds -DALT_PROVIDE_GMON to ALT_CPPFLAGS and -pg to ALT_CFLAGS in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.enable_c_plus_plus</SettingName>
<Identifier>ALT_NO_C_PLUS_PLUS</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>1</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable support for a subset of the C++ language. This option increases code footprint by adding support for C++ constructors. Certain features, such as multiple inheritance and exceptions are not supported. If false, adds -DALT_NO_C_PLUS_PLUS to ALT_CPPFLAGS in public.mk, and reduces code footprint.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_reduced_device_drivers</SettingName>
<Identifier>ALT_USE_SMALL_DRIVERS</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Certain drivers are compiled with reduced functionality to reduce code footprint. Not all drivers observe this setting. The altera_avalon_uart and altera_avalon_jtag_uart drivers switch from interrupt-driven to polled operation. CAUTION: Several device drivers are disabled entirely. These include the altera_avalon_cfi_flash, altera_avalon_epcs_flash_controller, and altera_avalon_lcd_16207 drivers. This can result in certain API (HAL flash access routines) to fail. You can define a symbol provided by each driver to prevent it from being removed. If true, adds -DALT_USE_SMALL_DRIVERS to ALT_CPPFLAGS in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.enable_lightweight_device_driver_api</SettingName>
<Identifier>ALT_USE_DIRECT_DRIVERS</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enables lightweight device driver API. This reduces code and data footprint by removing the HAL layer that maps device names (e.g. /dev/uart0) to file descriptors. Instead, driver routines are called directly. The open(), close(), and lseek() routines will always fail if called. The read(), write(), fstat(), ioctl(), and isatty() routines only work for the stdio devices. If true, adds -DALT_USE_DIRECT_DRIVERS to ALT_CPPFLAGS in public.mk.</Description>
<Restrictions>The Altera Host and read-only ZIP file systems can't be used if hal.enable_lightweight_device_driver_api is true.</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_mul_div_emulation</SettingName>
<Identifier>ALT_NO_INSTRUCTION_EMULATION</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Adds code to emulate multiply and divide instructions in case they are executed but aren't present in the CPU. Normally this isn't required because the compiler won't use multiply and divide instructions that aren't present in the CPU. If false, adds -DALT_NO_INSTRUCTION_EMULATION to ALT_CPPFLAGS in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.enable_sim_optimize</SettingName>
<Identifier>ALT_SIM_OPTIMIZE</Identifier>
<Type>Boolean</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>The BSP is compiled with optimizations to speedup HDL simulation such as initializing the cache, clearing the .bss section, and skipping long delay loops. If true, adds -DALT_SIM_OPTIMIZE to ALT_CPPFLAGS in public.mk.</Description>
<Restrictions>When this setting is true, the BSP shouldn't be used to build applications that are expected to run real hardware.</Restrictions>
<Enabled>false</Enabled>
<Group>common</Group>
</Setting>
<Setting>
<SettingName>hal.enable_sopc_sysid_check</SettingName>
<Identifier>NONE</Identifier>
<Type>Boolean</Type>
<Value>1</Value>
<DefaultValue>1</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable SOPC Builder System ID. If a System ID SOPC Builder component is connected to the CPU associated with this BSP, it will be enabled in the creation of command-line arguments to download an ELF to the target. Otherwise, system ID and timestamp values are left out of public.mk for application Makefile "download-elf" target definition. With the system ID check disabled, the Nios II EDS tools will not automatically ensure that the application .elf file (and BSP it is linked against) corresponds to the hardware design on the target. If false, adds --accept-bad-sysid to SOPC_SYSID_FLAG in public.mk.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.custom_newlib_flags</SettingName>
<Identifier>CUSTOM_NEWLIB_FLAGS</Identifier>
<Type>UnquotedString</Type>
<Value>none</Value>
<DefaultValue>none</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Build a custom version of newlib with the specified space-separated compiler flags.</Description>
<Restrictions>The custom newlib build will be placed in the &amp;lt;bsp root>/newlib directory, and will be used only for applications that utilize this BSP.</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>hal.log_flags</SettingName>
<Identifier>ALT_LOG_FLAGS</Identifier>
<Type>DecimalNumber</Type>
<Value>0</Value>
<DefaultValue>0</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>The value is assigned to ALT_LOG_FLAGS in the generated public.mk. See hal.log_port setting description. Values can be -1 through 3.</Description>
<Restrictions>hal.log_port must be set for this to be used.</Restrictions>
<Enabled>false</Enabled>
<Group>none</Group>
</Setting>
<Setting>
<SettingName>altera_avalon_jtag_uart_driver.enable_small_driver</SettingName>
<Identifier>ALTERA_AVALON_JTAG_UART_SMALL</Identifier>
<Type>BooleanDefineOnly</Type>
<Value>false</Value>
<DefaultValue>false</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Small-footprint (polled mode) driver</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>altera_avalon_uart_driver.enable_small_driver</SettingName>
<Identifier>ALTERA_AVALON_UART_SMALL</Identifier>
<Type>BooleanDefineOnly</Type>
<Value>false</Value>
<DefaultValue>false</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Small-footprint (polled mode) driver</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<Setting>
<SettingName>altera_avalon_uart_driver.enable_ioctl</SettingName>
<Identifier>ALTERA_AVALON_UART_USE_IOCTL</Identifier>
<Type>BooleanDefineOnly</Type>
<Value>false</Value>
<DefaultValue>false</DefaultValue>
<DestinationFile>public_mk_define</DestinationFile>
<Description>Enable driver ioctl() support. This feature is not compatible with the 'small' driver; ioctl() support will not be compiled if either the UART 'enable_small_driver' or HAL 'enable_reduced_device_drivers' settings are enabled.</Description>
<Restrictions>none</Restrictions>
<Enabled>false</Enabled>
<Group xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
</Setting>
<MemoryMap>
<slaveDescriptor>onchip_memory2_0</slaveDescriptor>
<addressRange>0x00000000 - 0x00007FFF</addressRange>
<addressSpan>32768</addressSpan>
<attributes>memory</attributes>
</MemoryMap>
<MemoryMap>
<slaveDescriptor>spi_1</slaveDescriptor>
<addressRange>0x00010000 - 0x0001001F</addressRange>
<addressSpan>32</addressSpan>
<attributes/>
</MemoryMap>
<MemoryMap>
<slaveDescriptor>spi_0</slaveDescriptor>
<addressRange>0x00021000 - 0x0002101F</addressRange>
<addressSpan>32</addressSpan>
<attributes/>
</MemoryMap>
<MemoryMap>
<slaveDescriptor>jtag_uart_0</slaveDescriptor>
<addressRange>0x00022000 - 0x00022007</addressRange>
<addressSpan>8</addressSpan>
<attributes>printable</attributes>
</MemoryMap>
<MemoryMap>
<slaveDescriptor>timer_0</slaveDescriptor>
<addressRange>0x00023000 - 0x0002303F</addressRange>
<addressSpan>64</addressSpan>
<attributes>timer</attributes>
</MemoryMap>
<MemoryMap>
<slaveDescriptor>uart_0</slaveDescriptor>
<addressRange>0x00024000 - 0x0002401F</addressRange>
<addressSpan>32</addressSpan>
<attributes>printable</attributes>
</MemoryMap>
<LinkerSection>
<sectionName>.text</sectionName>
<regionName>onchip_memory2_0</regionName>
</LinkerSection>
<LinkerSection>
<sectionName>.rodata</sectionName>
<regionName>onchip_memory2_0</regionName>
</LinkerSection>
<LinkerSection>
<sectionName>.rwdata</sectionName>
<regionName>onchip_memory2_0</regionName>
</LinkerSection>
<LinkerSection>
<sectionName>.bss</sectionName>
<regionName>onchip_memory2_0</regionName>
</LinkerSection>
<LinkerSection>
<sectionName>.heap</sectionName>
<regionName>onchip_memory2_0</regionName>
</LinkerSection>
<LinkerSection>
<sectionName>.stack</sectionName>
<regionName>onchip_memory2_0</regionName>
</LinkerSection>
</sch:Settings>

View file

@ -0,0 +1,66 @@
BANDWIDTH_TYPE=AUTO
CLK0_DIVIDE_BY=1
CLK0_DUTY_CYCLE=50
CLK0_MULTIPLY_BY=1
CLK0_PHASE_SHIFT=0
CLK1_DIVIDE_BY=1
CLK1_DUTY_CYCLE=50
CLK1_MULTIPLY_BY=2
CLK1_PHASE_SHIFT=0
COMPENSATE_CLOCK=CLK0
INCLK0_INPUT_FREQUENCY=26041
INTENDED_DEVICE_FAMILY="Cyclone IV E"
LPM_TYPE=altpll
OPERATION_MODE=NORMAL
PLL_TYPE=AUTO
PORT_ACTIVECLOCK=PORT_UNUSED
PORT_ARESET=PORT_USED
PORT_CLKBAD0=PORT_UNUSED
PORT_CLKBAD1=PORT_UNUSED
PORT_CLKLOSS=PORT_UNUSED
PORT_CLKSWITCH=PORT_UNUSED
PORT_CONFIGUPDATE=PORT_UNUSED
PORT_FBIN=PORT_UNUSED
PORT_INCLK0=PORT_USED
PORT_INCLK1=PORT_UNUSED
PORT_LOCKED=PORT_USED
PORT_PFDENA=PORT_UNUSED
PORT_PHASECOUNTERSELECT=PORT_UNUSED
PORT_PHASEDONE=PORT_UNUSED
PORT_PHASESTEP=PORT_UNUSED
PORT_PHASEUPDOWN=PORT_UNUSED
PORT_PLLENA=PORT_UNUSED
PORT_SCANACLR=PORT_UNUSED
PORT_SCANCLK=PORT_UNUSED
PORT_SCANCLKENA=PORT_UNUSED
PORT_SCANDATA=PORT_UNUSED
PORT_SCANDATAOUT=PORT_UNUSED
PORT_SCANDONE=PORT_UNUSED
PORT_SCANREAD=PORT_UNUSED
PORT_SCANWRITE=PORT_UNUSED
PORT_clk0=PORT_USED
PORT_clk1=PORT_USED
PORT_clk2=PORT_UNUSED
PORT_clk3=PORT_UNUSED
PORT_clk4=PORT_UNUSED
PORT_clk5=PORT_UNUSED
PORT_clkena0=PORT_UNUSED
PORT_clkena1=PORT_UNUSED
PORT_clkena2=PORT_UNUSED
PORT_clkena3=PORT_UNUSED
PORT_clkena4=PORT_UNUSED
PORT_clkena5=PORT_UNUSED
PORT_extclk0=PORT_UNUSED
PORT_extclk1=PORT_UNUSED
PORT_extclk2=PORT_UNUSED
PORT_extclk3=PORT_UNUSED
SELF_RESET_ON_LOSS_LOCK=OFF
WIDTH_CLOCK=5
DEVICE_FAMILY="Cyclone IV E"
CBX_AUTO_BLACKBOX=ALL
areset
inclk
inclk
clk
clk
locked

View file

@ -0,0 +1,26 @@
--Copyright (C) 1991-2012 Altera Corporation
--Your use of Altera Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Altera Program License
--Subscription Agreement, Altera MegaCore Function License
--Agreement, or other applicable license agreement, including,
--without limitation, that your use is for the sole purpose of
--programming logic devices manufactured by Altera and sold by
--Altera or its authorized distributors. Please refer to the
--applicable agreement for further details.
component pll
PORT
(
areset : IN STD_LOGIC := '0';
inclk0 : IN STD_LOGIC := '0';
c0 : OUT STD_LOGIC ;
c1 : OUT STD_LOGIC ;
c2 : OUT STD_LOGIC ;
locked : OUT STD_LOGIC
);
end component;

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE pinplan>
<pinplan intended_family="Cyclone IV E" variation_name="pll" megafunction_name="ALTPLL" specifies="all_ports">
<global>
<pin name="areset" direction="input" scope="external" />
<pin name="inclk0" direction="input" scope="external" source="clock" />
<pin name="c0" direction="output" scope="external" source="clock" />
<pin name="c1" direction="output" scope="external" source="clock" />
<pin name="c2" direction="output" scope="external" source="clock" />
<pin name="locked" direction="output" scope="external" />
</global>
</pinplan>

View file

@ -0,0 +1,5 @@
set_global_assignment -name IP_TOOL_NAME "ALTPLL"
set_global_assignment -name IP_TOOL_VERSION "12.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "pll.vhd"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "pll.cmp"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "pll.ppf"]

View file

@ -0,0 +1,429 @@
-- megafunction wizard: %ALTPLL%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altpll
-- ============================================================
-- File Name: pll.vhd
-- Megafunction Name(s):
-- altpll
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 12.1 Build 177 11/07/2012 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2012 Altera Corporation
--Your use of Altera Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Altera Program License
--Subscription Agreement, Altera MegaCore Function License
--Agreement, or other applicable license agreement, including,
--without limitation, that your use is for the sole purpose of
--programming logic devices manufactured by Altera and sold by
--Altera or its authorized distributors. Please refer to the
--applicable agreement for further details.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY pll IS
PORT
(
areset : IN STD_LOGIC := '0';
inclk0 : IN STD_LOGIC := '0';
c0 : OUT STD_LOGIC ;
c1 : OUT STD_LOGIC ;
c2 : OUT STD_LOGIC ;
locked : OUT STD_LOGIC
);
END pll;
ARCHITECTURE SYN OF pll IS
SIGNAL sub_wire0 : STD_LOGIC_VECTOR (4 DOWNTO 0);
SIGNAL sub_wire1 : STD_LOGIC ;
SIGNAL sub_wire2 : STD_LOGIC ;
SIGNAL sub_wire3 : STD_LOGIC ;
SIGNAL sub_wire4 : STD_LOGIC ;
SIGNAL sub_wire5 : STD_LOGIC ;
SIGNAL sub_wire6 : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire7_bv : BIT_VECTOR (0 DOWNTO 0);
SIGNAL sub_wire7 : STD_LOGIC_VECTOR (0 DOWNTO 0);
COMPONENT altpll
GENERIC (
bandwidth_type : STRING;
clk0_divide_by : NATURAL;
clk0_duty_cycle : NATURAL;
clk0_multiply_by : NATURAL;
clk0_phase_shift : STRING;
clk1_divide_by : NATURAL;
clk1_duty_cycle : NATURAL;
clk1_multiply_by : NATURAL;
clk1_phase_shift : STRING;
clk2_divide_by : NATURAL;
clk2_duty_cycle : NATURAL;
clk2_multiply_by : NATURAL;
clk2_phase_shift : STRING;
compensate_clock : STRING;
inclk0_input_frequency : NATURAL;
intended_device_family : STRING;
lpm_hint : STRING;
lpm_type : STRING;
operation_mode : STRING;
pll_type : STRING;
port_activeclock : STRING;
port_areset : STRING;
port_clkbad0 : STRING;
port_clkbad1 : STRING;
port_clkloss : STRING;
port_clkswitch : STRING;
port_configupdate : STRING;
port_fbin : STRING;
port_inclk0 : STRING;
port_inclk1 : STRING;
port_locked : STRING;
port_pfdena : STRING;
port_phasecounterselect : STRING;
port_phasedone : STRING;
port_phasestep : STRING;
port_phaseupdown : STRING;
port_pllena : STRING;
port_scanaclr : STRING;
port_scanclk : STRING;
port_scanclkena : STRING;
port_scandata : STRING;
port_scandataout : STRING;
port_scandone : STRING;
port_scanread : STRING;
port_scanwrite : STRING;
port_clk0 : STRING;
port_clk1 : STRING;
port_clk2 : STRING;
port_clk3 : STRING;
port_clk4 : STRING;
port_clk5 : STRING;
port_clkena0 : STRING;
port_clkena1 : STRING;
port_clkena2 : STRING;
port_clkena3 : STRING;
port_clkena4 : STRING;
port_clkena5 : STRING;
port_extclk0 : STRING;
port_extclk1 : STRING;
port_extclk2 : STRING;
port_extclk3 : STRING;
self_reset_on_loss_lock : STRING;
width_clock : NATURAL
);
PORT (
areset : IN STD_LOGIC ;
clk : OUT STD_LOGIC_VECTOR (4 DOWNTO 0);
inclk : IN STD_LOGIC_VECTOR (1 DOWNTO 0);
locked : OUT STD_LOGIC
);
END COMPONENT;
BEGIN
sub_wire7_bv(0 DOWNTO 0) <= "0";
sub_wire7 <= To_stdlogicvector(sub_wire7_bv);
sub_wire4 <= sub_wire0(2);
sub_wire3 <= sub_wire0(0);
sub_wire1 <= sub_wire0(1);
c1 <= sub_wire1;
locked <= sub_wire2;
c0 <= sub_wire3;
c2 <= sub_wire4;
sub_wire5 <= inclk0;
sub_wire6 <= sub_wire7(0 DOWNTO 0) & sub_wire5;
altpll_component : altpll
GENERIC MAP (
bandwidth_type => "AUTO",
clk0_divide_by => 1,
clk0_duty_cycle => 50,
clk0_multiply_by => 2,
clk0_phase_shift => "0",
clk1_divide_by => 1,
clk1_duty_cycle => 50,
clk1_multiply_by => 1,
clk1_phase_shift => "0",
clk2_divide_by => 1,
clk2_duty_cycle => 50,
clk2_multiply_by => 2,
clk2_phase_shift => "3255",
compensate_clock => "CLK0",
inclk0_input_frequency => 26041,
intended_device_family => "Cyclone IV E",
lpm_hint => "CBX_MODULE_PREFIX=pll",
lpm_type => "altpll",
operation_mode => "NORMAL",
pll_type => "AUTO",
port_activeclock => "PORT_UNUSED",
port_areset => "PORT_USED",
port_clkbad0 => "PORT_UNUSED",
port_clkbad1 => "PORT_UNUSED",
port_clkloss => "PORT_UNUSED",
port_clkswitch => "PORT_UNUSED",
port_configupdate => "PORT_UNUSED",
port_fbin => "PORT_UNUSED",
port_inclk0 => "PORT_USED",
port_inclk1 => "PORT_UNUSED",
port_locked => "PORT_USED",
port_pfdena => "PORT_UNUSED",
port_phasecounterselect => "PORT_UNUSED",
port_phasedone => "PORT_UNUSED",
port_phasestep => "PORT_UNUSED",
port_phaseupdown => "PORT_UNUSED",
port_pllena => "PORT_UNUSED",
port_scanaclr => "PORT_UNUSED",
port_scanclk => "PORT_UNUSED",
port_scanclkena => "PORT_UNUSED",
port_scandata => "PORT_UNUSED",
port_scandataout => "PORT_UNUSED",
port_scandone => "PORT_UNUSED",
port_scanread => "PORT_UNUSED",
port_scanwrite => "PORT_UNUSED",
port_clk0 => "PORT_USED",
port_clk1 => "PORT_USED",
port_clk2 => "PORT_USED",
port_clk3 => "PORT_UNUSED",
port_clk4 => "PORT_UNUSED",
port_clk5 => "PORT_UNUSED",
port_clkena0 => "PORT_UNUSED",
port_clkena1 => "PORT_UNUSED",
port_clkena2 => "PORT_UNUSED",
port_clkena3 => "PORT_UNUSED",
port_clkena4 => "PORT_UNUSED",
port_clkena5 => "PORT_UNUSED",
port_extclk0 => "PORT_UNUSED",
port_extclk1 => "PORT_UNUSED",
port_extclk2 => "PORT_UNUSED",
port_extclk3 => "PORT_UNUSED",
self_reset_on_loss_lock => "OFF",
width_clock => 5
)
PORT MAP (
areset => areset,
inclk => sub_wire6,
clk => sub_wire0,
locked => sub_wire2
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
-- Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
-- Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
-- Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
-- Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
-- Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
-- Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
-- Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
-- Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
-- Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0"
-- Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "6"
-- Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "1"
-- Retrieval info: PRIVATE: DIV_FACTOR1 NUMERIC "1"
-- Retrieval info: PRIVATE: DIV_FACTOR2 NUMERIC "1"
-- Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
-- Retrieval info: PRIVATE: DUTY_CYCLE1 STRING "50.00000000"
-- Retrieval info: PRIVATE: DUTY_CYCLE2 STRING "50.00000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "76.800003"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE1 STRING "38.400002"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE2 STRING "76.800003"
-- Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0"
-- Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
-- Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
-- Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
-- Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "38.400"
-- Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
-- Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "1"
-- Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT1 STRING "deg"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT2 STRING "ps"
-- Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any"
-- Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
-- Retrieval info: PRIVATE: MIRROR_CLK1 STRING "0"
-- Retrieval info: PRIVATE: MIRROR_CLK2 STRING "0"
-- Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "2"
-- Retrieval info: PRIVATE: MULT_FACTOR1 NUMERIC "1"
-- Retrieval info: PRIVATE: MULT_FACTOR2 NUMERIC "2"
-- Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "100.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ1 STRING "100.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ2 STRING "100.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE1 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE2 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT1 STRING "MHz"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT2 STRING "MHz"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT1 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT2 STRING "90.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT1 STRING "deg"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT2 STRING "deg"
-- Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
-- Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
-- Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
-- Retrieval info: PRIVATE: RECONFIG_FILE STRING "pll.mif"
-- Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
-- Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
-- Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
-- Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
-- Retrieval info: PRIVATE: SPREAD_USE STRING "0"
-- Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
-- Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
-- Retrieval info: PRIVATE: STICKY_CLK1 STRING "1"
-- Retrieval info: PRIVATE: STICKY_CLK2 STRING "1"
-- Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
-- Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_CLK0 STRING "1"
-- Retrieval info: PRIVATE: USE_CLK1 STRING "1"
-- Retrieval info: PRIVATE: USE_CLK2 STRING "1"
-- Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
-- Retrieval info: PRIVATE: USE_CLKENA1 STRING "0"
-- Retrieval info: PRIVATE: USE_CLKENA2 STRING "0"
-- Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0"
-- Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "1"
-- Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "2"
-- Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: CLK1_DIVIDE_BY NUMERIC "1"
-- Retrieval info: CONSTANT: CLK1_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK1_MULTIPLY_BY NUMERIC "1"
-- Retrieval info: CONSTANT: CLK1_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: CLK2_DIVIDE_BY NUMERIC "1"
-- Retrieval info: CONSTANT: CLK2_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK2_MULTIPLY_BY NUMERIC "2"
-- Retrieval info: CONSTANT: CLK2_PHASE_SHIFT STRING "3255"
-- Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
-- Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "26041"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
-- Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: SELF_RESET_ON_LOSS_LOCK STRING "OFF"
-- Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5"
-- Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
-- Retrieval info: USED_PORT: @inclk 0 0 2 0 INPUT_CLK_EXT VCC "@inclk[1..0]"
-- Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
-- Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
-- Retrieval info: USED_PORT: c1 0 0 0 0 OUTPUT_CLK_EXT VCC "c1"
-- Retrieval info: USED_PORT: c2 0 0 0 0 OUTPUT_CLK_EXT VCC "c2"
-- Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
-- Retrieval info: USED_PORT: locked 0 0 0 0 OUTPUT GND "locked"
-- Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
-- Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
-- Retrieval info: CONNECT: c1 0 0 0 0 @clk 0 0 1 1
-- Retrieval info: CONNECT: c2 0 0 0 0 @clk 0 0 1 2
-- Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.ppf TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.cmp TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL pll_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf
-- Retrieval info: CBX_MODULE_PREFIX: ON

View file

@ -0,0 +1,61 @@
BANDWIDTH_TYPE=AUTO
CLK0_DIVIDE_BY=88
CLK0_DUTY_CYCLE=50
CLK0_MULTIPLY_BY=105
CLK0_PHASE_SHIFT=0
COMPENSATE_CLOCK=CLK0
INCLK0_INPUT_FREQUENCY=26041
INTENDED_DEVICE_FAMILY="Cyclone IV E"
LPM_TYPE=altpll
OPERATION_MODE=NORMAL
PLL_TYPE=AUTO
PORT_ACTIVECLOCK=PORT_UNUSED
PORT_ARESET=PORT_USED
PORT_CLKBAD0=PORT_UNUSED
PORT_CLKBAD1=PORT_UNUSED
PORT_CLKLOSS=PORT_UNUSED
PORT_CLKSWITCH=PORT_UNUSED
PORT_CONFIGUPDATE=PORT_UNUSED
PORT_FBIN=PORT_UNUSED
PORT_INCLK0=PORT_USED
PORT_INCLK1=PORT_UNUSED
PORT_LOCKED=PORT_USED
PORT_PFDENA=PORT_UNUSED
PORT_PHASECOUNTERSELECT=PORT_UNUSED
PORT_PHASEDONE=PORT_UNUSED
PORT_PHASESTEP=PORT_UNUSED
PORT_PHASEUPDOWN=PORT_UNUSED
PORT_PLLENA=PORT_UNUSED
PORT_SCANACLR=PORT_UNUSED
PORT_SCANCLK=PORT_UNUSED
PORT_SCANCLKENA=PORT_UNUSED
PORT_SCANDATA=PORT_UNUSED
PORT_SCANDATAOUT=PORT_UNUSED
PORT_SCANDONE=PORT_UNUSED
PORT_SCANREAD=PORT_UNUSED
PORT_SCANWRITE=PORT_UNUSED
PORT_clk0=PORT_USED
PORT_clk1=PORT_UNUSED
PORT_clk2=PORT_UNUSED
PORT_clk3=PORT_UNUSED
PORT_clk4=PORT_UNUSED
PORT_clk5=PORT_UNUSED
PORT_clkena0=PORT_UNUSED
PORT_clkena1=PORT_UNUSED
PORT_clkena2=PORT_UNUSED
PORT_clkena3=PORT_UNUSED
PORT_clkena4=PORT_UNUSED
PORT_clkena5=PORT_UNUSED
PORT_extclk0=PORT_UNUSED
PORT_extclk1=PORT_UNUSED
PORT_extclk2=PORT_UNUSED
PORT_extclk3=PORT_UNUSED
SELF_RESET_ON_LOSS_LOCK=OFF
WIDTH_CLOCK=5
DEVICE_FAMILY="Cyclone IV E"
CBX_AUTO_BLACKBOX=ALL
areset
inclk
inclk
clk
locked

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE pinplan>
<pinplan intended_family="Cyclone IV E" variation_name="serial_pll" megafunction_name="ALTPLL" specifies="all_ports">
<global>
<pin name="areset" direction="input" scope="external" />
<pin name="inclk0" direction="input" scope="external" source="clock" />
<pin name="c0" direction="output" scope="external" source="clock" />
<pin name="locked" direction="output" scope="external" />
</global>
</pinplan>

View file

@ -0,0 +1,4 @@
set_global_assignment -name IP_TOOL_NAME "ALTPLL"
set_global_assignment -name IP_TOOL_VERSION "12.1"
set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "serial_pll.vhd"]
set_global_assignment -name MISC_FILE [file join $::quartus(qip_path) "serial_pll.ppf"]

View file

@ -0,0 +1,365 @@
-- megafunction wizard: %ALTPLL%
-- GENERATION: STANDARD
-- VERSION: WM1.0
-- MODULE: altpll
-- ============================================================
-- File Name: serial_pll.vhd
-- Megafunction Name(s):
-- altpll
--
-- Simulation Library Files(s):
-- altera_mf
-- ============================================================
-- ************************************************************
-- THIS IS A WIZARD-GENERATED FILE. DO NOT EDIT THIS FILE!
--
-- 12.1 Build 177 11/07/2012 SJ Web Edition
-- ************************************************************
--Copyright (C) 1991-2012 Altera Corporation
--Your use of Altera Corporation's design tools, logic functions
--and other software and tools, and its AMPP partner logic
--functions, and any output files from any of the foregoing
--(including device programming or simulation files), and any
--associated documentation or information are expressly subject
--to the terms and conditions of the Altera Program License
--Subscription Agreement, Altera MegaCore Function License
--Agreement, or other applicable license agreement, including,
--without limitation, that your use is for the sole purpose of
--programming logic devices manufactured by Altera and sold by
--Altera or its authorized distributors. Please refer to the
--applicable agreement for further details.
LIBRARY ieee;
USE ieee.std_logic_1164.all;
LIBRARY altera_mf;
USE altera_mf.all;
ENTITY serial_pll IS
PORT
(
areset : IN STD_LOGIC := '0';
inclk0 : IN STD_LOGIC := '0';
c0 : OUT STD_LOGIC ;
locked : OUT STD_LOGIC
);
END serial_pll;
ARCHITECTURE SYN OF serial_pll IS
SIGNAL sub_wire0 : STD_LOGIC ;
SIGNAL sub_wire1 : STD_LOGIC_VECTOR (4 DOWNTO 0);
SIGNAL sub_wire2 : STD_LOGIC ;
SIGNAL sub_wire3 : STD_LOGIC ;
SIGNAL sub_wire4 : STD_LOGIC_VECTOR (1 DOWNTO 0);
SIGNAL sub_wire5_bv : BIT_VECTOR (0 DOWNTO 0);
SIGNAL sub_wire5 : STD_LOGIC_VECTOR (0 DOWNTO 0);
COMPONENT altpll
GENERIC (
bandwidth_type : STRING;
clk0_divide_by : NATURAL;
clk0_duty_cycle : NATURAL;
clk0_multiply_by : NATURAL;
clk0_phase_shift : STRING;
compensate_clock : STRING;
inclk0_input_frequency : NATURAL;
intended_device_family : STRING;
lpm_hint : STRING;
lpm_type : STRING;
operation_mode : STRING;
pll_type : STRING;
port_activeclock : STRING;
port_areset : STRING;
port_clkbad0 : STRING;
port_clkbad1 : STRING;
port_clkloss : STRING;
port_clkswitch : STRING;
port_configupdate : STRING;
port_fbin : STRING;
port_inclk0 : STRING;
port_inclk1 : STRING;
port_locked : STRING;
port_pfdena : STRING;
port_phasecounterselect : STRING;
port_phasedone : STRING;
port_phasestep : STRING;
port_phaseupdown : STRING;
port_pllena : STRING;
port_scanaclr : STRING;
port_scanclk : STRING;
port_scanclkena : STRING;
port_scandata : STRING;
port_scandataout : STRING;
port_scandone : STRING;
port_scanread : STRING;
port_scanwrite : STRING;
port_clk0 : STRING;
port_clk1 : STRING;
port_clk2 : STRING;
port_clk3 : STRING;
port_clk4 : STRING;
port_clk5 : STRING;
port_clkena0 : STRING;
port_clkena1 : STRING;
port_clkena2 : STRING;
port_clkena3 : STRING;
port_clkena4 : STRING;
port_clkena5 : STRING;
port_extclk0 : STRING;
port_extclk1 : STRING;
port_extclk2 : STRING;
port_extclk3 : STRING;
self_reset_on_loss_lock : STRING;
width_clock : NATURAL
);
PORT (
areset : IN STD_LOGIC ;
clk : OUT STD_LOGIC_VECTOR (4 DOWNTO 0);
inclk : IN STD_LOGIC_VECTOR (1 DOWNTO 0);
locked : OUT STD_LOGIC
);
END COMPONENT;
BEGIN
sub_wire5_bv(0 DOWNTO 0) <= "0";
sub_wire5 <= To_stdlogicvector(sub_wire5_bv);
locked <= sub_wire0;
sub_wire2 <= sub_wire1(0);
c0 <= sub_wire2;
sub_wire3 <= inclk0;
sub_wire4 <= sub_wire5(0 DOWNTO 0) & sub_wire3;
altpll_component : altpll
GENERIC MAP (
bandwidth_type => "AUTO",
clk0_divide_by => 88,
clk0_duty_cycle => 50,
clk0_multiply_by => 105,
clk0_phase_shift => "0",
compensate_clock => "CLK0",
inclk0_input_frequency => 26041,
intended_device_family => "Cyclone IV E",
lpm_hint => "CBX_MODULE_PREFIX=serial_pll",
lpm_type => "altpll",
operation_mode => "NORMAL",
pll_type => "AUTO",
port_activeclock => "PORT_UNUSED",
port_areset => "PORT_USED",
port_clkbad0 => "PORT_UNUSED",
port_clkbad1 => "PORT_UNUSED",
port_clkloss => "PORT_UNUSED",
port_clkswitch => "PORT_UNUSED",
port_configupdate => "PORT_UNUSED",
port_fbin => "PORT_UNUSED",
port_inclk0 => "PORT_USED",
port_inclk1 => "PORT_UNUSED",
port_locked => "PORT_USED",
port_pfdena => "PORT_UNUSED",
port_phasecounterselect => "PORT_UNUSED",
port_phasedone => "PORT_UNUSED",
port_phasestep => "PORT_UNUSED",
port_phaseupdown => "PORT_UNUSED",
port_pllena => "PORT_UNUSED",
port_scanaclr => "PORT_UNUSED",
port_scanclk => "PORT_UNUSED",
port_scanclkena => "PORT_UNUSED",
port_scandata => "PORT_UNUSED",
port_scandataout => "PORT_UNUSED",
port_scandone => "PORT_UNUSED",
port_scanread => "PORT_UNUSED",
port_scanwrite => "PORT_UNUSED",
port_clk0 => "PORT_USED",
port_clk1 => "PORT_UNUSED",
port_clk2 => "PORT_UNUSED",
port_clk3 => "PORT_UNUSED",
port_clk4 => "PORT_UNUSED",
port_clk5 => "PORT_UNUSED",
port_clkena0 => "PORT_UNUSED",
port_clkena1 => "PORT_UNUSED",
port_clkena2 => "PORT_UNUSED",
port_clkena3 => "PORT_UNUSED",
port_clkena4 => "PORT_UNUSED",
port_clkena5 => "PORT_UNUSED",
port_extclk0 => "PORT_UNUSED",
port_extclk1 => "PORT_UNUSED",
port_extclk2 => "PORT_UNUSED",
port_extclk3 => "PORT_UNUSED",
self_reset_on_loss_lock => "OFF",
width_clock => 5
)
PORT MAP (
areset => areset,
inclk => sub_wire4,
locked => sub_wire0,
clk => sub_wire1
);
END SYN;
-- ============================================================
-- CNX file retrieval info
-- ============================================================
-- Retrieval info: PRIVATE: ACTIVECLK_CHECK STRING "0"
-- Retrieval info: PRIVATE: BANDWIDTH STRING "1.000"
-- Retrieval info: PRIVATE: BANDWIDTH_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_FREQ_UNIT STRING "MHz"
-- Retrieval info: PRIVATE: BANDWIDTH_PRESET STRING "Low"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_AUTO STRING "1"
-- Retrieval info: PRIVATE: BANDWIDTH_USE_PRESET STRING "0"
-- Retrieval info: PRIVATE: CLKBAD_SWITCHOVER_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKLOSS_CHECK STRING "0"
-- Retrieval info: PRIVATE: CLKSWITCH_CHECK STRING "0"
-- Retrieval info: PRIVATE: CNX_NO_COMPENSATE_RADIO STRING "0"
-- Retrieval info: PRIVATE: CREATE_CLKBAD_CHECK STRING "0"
-- Retrieval info: PRIVATE: CREATE_INCLK1_CHECK STRING "0"
-- Retrieval info: PRIVATE: CUR_DEDICATED_CLK STRING "c0"
-- Retrieval info: PRIVATE: CUR_FBIN_CLK STRING "c0"
-- Retrieval info: PRIVATE: DEVICE_SPEED_GRADE STRING "6"
-- Retrieval info: PRIVATE: DIV_FACTOR0 NUMERIC "88"
-- Retrieval info: PRIVATE: DUTY_CYCLE0 STRING "50.00000000"
-- Retrieval info: PRIVATE: EFF_OUTPUT_FREQ_VALUE0 STRING "45.818180"
-- Retrieval info: PRIVATE: EXPLICIT_SWITCHOVER_COUNTER STRING "0"
-- Retrieval info: PRIVATE: EXT_FEEDBACK_RADIO STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_COUNTER_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: GLOCKED_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: GLOCKED_MODE_CHECK STRING "0"
-- Retrieval info: PRIVATE: GLOCK_COUNTER_EDIT NUMERIC "1048575"
-- Retrieval info: PRIVATE: HAS_MANUAL_SWITCHOVER STRING "1"
-- Retrieval info: PRIVATE: INCLK0_FREQ_EDIT STRING "38.400"
-- Retrieval info: PRIVATE: INCLK0_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT STRING "100.000"
-- Retrieval info: PRIVATE: INCLK1_FREQ_EDIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_CHANGED STRING "1"
-- Retrieval info: PRIVATE: INCLK1_FREQ_UNIT_COMBO STRING "MHz"
-- Retrieval info: PRIVATE: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
-- Retrieval info: PRIVATE: INT_FEEDBACK__MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: LOCKED_OUTPUT_CHECK STRING "1"
-- Retrieval info: PRIVATE: LONG_SCAN_RADIO STRING "1"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE STRING "Not Available"
-- Retrieval info: PRIVATE: LVDS_MODE_DATA_RATE_DIRTY NUMERIC "0"
-- Retrieval info: PRIVATE: LVDS_PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: MIG_DEVICE_SPEED_GRADE STRING "Any"
-- Retrieval info: PRIVATE: MIRROR_CLK0 STRING "0"
-- Retrieval info: PRIVATE: MULT_FACTOR0 NUMERIC "105"
-- Retrieval info: PRIVATE: NORMAL_MODE_RADIO STRING "1"
-- Retrieval info: PRIVATE: OUTPUT_FREQ0 STRING "100.00000000"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_MODE0 STRING "0"
-- Retrieval info: PRIVATE: OUTPUT_FREQ_UNIT0 STRING "MHz"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: PHASE_RECONFIG_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT0 STRING "0.00000000"
-- Retrieval info: PRIVATE: PHASE_SHIFT_STEP_ENABLED_CHECK STRING "0"
-- Retrieval info: PRIVATE: PHASE_SHIFT_UNIT0 STRING "deg"
-- Retrieval info: PRIVATE: PLL_ADVANCED_PARAM_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_ARESET_CHECK STRING "1"
-- Retrieval info: PRIVATE: PLL_AUTOPLL_CHECK NUMERIC "1"
-- Retrieval info: PRIVATE: PLL_ENHPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FASTPLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_FBMIMIC_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_LVDS_PLL_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PLL_PFDENA_CHECK STRING "0"
-- Retrieval info: PRIVATE: PLL_TARGET_HARCOPY_CHECK NUMERIC "0"
-- Retrieval info: PRIVATE: PRIMARY_CLK_COMBO STRING "inclk0"
-- Retrieval info: PRIVATE: RECONFIG_FILE STRING "serial_pll.mif"
-- Retrieval info: PRIVATE: SACN_INPUTS_CHECK STRING "0"
-- Retrieval info: PRIVATE: SCAN_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SELF_RESET_LOCK_LOSS STRING "0"
-- Retrieval info: PRIVATE: SHORT_SCAN_RADIO STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FEATURE_ENABLED STRING "0"
-- Retrieval info: PRIVATE: SPREAD_FREQ STRING "50.000"
-- Retrieval info: PRIVATE: SPREAD_FREQ_UNIT STRING "KHz"
-- Retrieval info: PRIVATE: SPREAD_PERCENT STRING "0.500"
-- Retrieval info: PRIVATE: SPREAD_USE STRING "0"
-- Retrieval info: PRIVATE: SRC_SYNCH_COMP_RADIO STRING "0"
-- Retrieval info: PRIVATE: STICKY_CLK0 STRING "1"
-- Retrieval info: PRIVATE: SWITCHOVER_COUNT_EDIT NUMERIC "1"
-- Retrieval info: PRIVATE: SWITCHOVER_FEATURE_ENABLED STRING "1"
-- Retrieval info: PRIVATE: SYNTH_WRAPPER_GEN_POSTFIX STRING "0"
-- Retrieval info: PRIVATE: USE_CLK0 STRING "1"
-- Retrieval info: PRIVATE: USE_CLKENA0 STRING "0"
-- Retrieval info: PRIVATE: USE_MIL_SPEED_GRADE NUMERIC "0"
-- Retrieval info: PRIVATE: ZERO_DELAY_RADIO STRING "0"
-- Retrieval info: LIBRARY: altera_mf altera_mf.altera_mf_components.all
-- Retrieval info: CONSTANT: BANDWIDTH_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: CLK0_DIVIDE_BY NUMERIC "88"
-- Retrieval info: CONSTANT: CLK0_DUTY_CYCLE NUMERIC "50"
-- Retrieval info: CONSTANT: CLK0_MULTIPLY_BY NUMERIC "105"
-- Retrieval info: CONSTANT: CLK0_PHASE_SHIFT STRING "0"
-- Retrieval info: CONSTANT: COMPENSATE_CLOCK STRING "CLK0"
-- Retrieval info: CONSTANT: INCLK0_INPUT_FREQUENCY NUMERIC "26041"
-- Retrieval info: CONSTANT: INTENDED_DEVICE_FAMILY STRING "Cyclone IV E"
-- Retrieval info: CONSTANT: LPM_TYPE STRING "altpll"
-- Retrieval info: CONSTANT: OPERATION_MODE STRING "NORMAL"
-- Retrieval info: CONSTANT: PLL_TYPE STRING "AUTO"
-- Retrieval info: CONSTANT: PORT_ACTIVECLOCK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_ARESET STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_CLKBAD0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKBAD1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKLOSS STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CLKSWITCH STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_CONFIGUPDATE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_FBIN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_INCLK0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_INCLK1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_LOCKED STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_PFDENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASECOUNTERSELECT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASESTEP STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PHASEUPDOWN STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_PLLENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANACLR STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLK STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANCLKENA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATA STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDATAOUT STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANDONE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANREAD STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_SCANWRITE STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk0 STRING "PORT_USED"
-- Retrieval info: CONSTANT: PORT_clk1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clk5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena4 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_clkena5 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk0 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk1 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk2 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: PORT_extclk3 STRING "PORT_UNUSED"
-- Retrieval info: CONSTANT: SELF_RESET_ON_LOSS_LOCK STRING "OFF"
-- Retrieval info: CONSTANT: WIDTH_CLOCK NUMERIC "5"
-- Retrieval info: USED_PORT: @clk 0 0 5 0 OUTPUT_CLK_EXT VCC "@clk[4..0]"
-- Retrieval info: USED_PORT: @inclk 0 0 2 0 INPUT_CLK_EXT VCC "@inclk[1..0]"
-- Retrieval info: USED_PORT: areset 0 0 0 0 INPUT GND "areset"
-- Retrieval info: USED_PORT: c0 0 0 0 0 OUTPUT_CLK_EXT VCC "c0"
-- Retrieval info: USED_PORT: inclk0 0 0 0 0 INPUT_CLK_EXT GND "inclk0"
-- Retrieval info: USED_PORT: locked 0 0 0 0 OUTPUT GND "locked"
-- Retrieval info: CONNECT: @areset 0 0 0 0 areset 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 1 GND 0 0 0 0
-- Retrieval info: CONNECT: @inclk 0 0 1 0 inclk0 0 0 0 0
-- Retrieval info: CONNECT: c0 0 0 0 0 @clk 0 0 1 0
-- Retrieval info: CONNECT: locked 0 0 0 0 @locked 0 0 0 0
-- Retrieval info: GEN_FILE: TYPE_NORMAL serial_pll.vhd TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL serial_pll.ppf TRUE
-- Retrieval info: GEN_FILE: TYPE_NORMAL serial_pll.inc FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL serial_pll.cmp FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL serial_pll.bsf FALSE
-- Retrieval info: GEN_FILE: TYPE_NORMAL serial_pll_inst.vhd FALSE
-- Retrieval info: LIB_FILE: altera_mf
-- Retrieval info: CBX_MODULE_PREFIX: ON

View file

@ -0,0 +1,17 @@
proc compile_nuand { root } {
vlib nuand
vcom -work nuand -2008 [file join $root ./synthesis/constellation_mapper.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/sync_fifo.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/uart.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/cordic.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/nco.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/fsk_modulator.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/fsk_demodulator.vhd]
vcom -work nuand -2008 [file join $root ./synthesis/uart.vhd]
vcom -work nuand -2008 [file join $root ./simulation/fx3_model.vhd]
vcom -work nuand -2008 [file join $root ./simulation/lms6002d_model.vhd]
}

View file

@ -0,0 +1,105 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
entity fx3_model is
port (
fx3_pclk : out std_logic ;
fx3_gpif : inout std_logic_vector(31 downto 0) ;
fx3_ctl : inout std_logic_vector(12 downto 0) ;
fx3_uart_rxd : out std_logic ;
fx3_uart_txd : in std_logic ;
fx3_uart_csx : out std_logic
) ;
end entity ; -- fx3_model
architecture digital_loopback of fx3_model is
constant PCLK_HALF_PERIOD : time := 1 sec * (1.0/100.0e6/2.0) ;
alias rxd_samples_request is fx3_ctl(0) ;
alias rxd_samples_acknowledge is fx3_ctl(1) ;
alias rxd_samples_we is fx3_ctl(2) ;
alias txd_samples_we is fx3_ctl(3) ;
alias gpif_reset is fx3_ctl(4) ;
alias unused_ctl is fx3_ctl(12 downto 5) ;
type gpif_state_t is (IDLE, TX_SAMPLES, RX_SAMPLES) ;
signal gpif_state : gpif_state_t ;
signal txd_samples : std_logic_vector(31 downto 0) ;
begin
rxd_samples_request <= 'Z' ;
rxd_samples_we <= 'Z' ;
-- Create a 100MHz clock output
fx3_pclk <= not fx3_pclk after PCLK_HALF_PERIOD when fx3_pclk = '0' or fx3_pclk = '1' else
'1' ;
-- GPIF interface
fx3_gpif <= (others =>'Z') when rxd_samples_acknowledge = '1' else
txd_samples ;
stimulus : process
constant BLOCK_SIZE : natural := 128 ;
variable count : natural := 0 ;
begin
gpif_reset <= '1' ;
gpif_state <= IDLE ;
rxd_samples_acknowledge <= '0' ;
txd_samples_we <= '0' ;
txd_samples <= (others =>'0') ;
for i in 0 to 10 loop
wait until rising_edge( fx3_pclk ) ;
end loop ;
gpif_reset <= '0' ;
while true loop
wait until rising_edge( fx3_pclk ) ;
case gpif_state is
when IDLE =>
if( rxd_samples_request = '0' ) then
gpif_state <= TX_SAMPLES ;
txd_samples_we <= '1' ;
end if ;
when TX_SAMPLES =>
txd_samples <= std_logic_vector(unsigned(txd_samples) + 1) ;
if( rxd_samples_request = '1' and count = 0) then
gpif_state <= RX_SAMPLES ;
txd_samples_we <= '0' ;
rxd_samples_acknowledge <= '1' ;
count := BLOCK_SIZE ;
elsif( count > 0 ) then
txd_samples_we <= '1' ;
count := count - 1 ;
end if ;
when RX_SAMPLES =>
if( count = 1 ) then
gpif_state <= TX_SAMPLES ;
rxd_samples_acknowledge <= '0' ;
count := BLOCK_SIZE ;
else
count := count - 1 ;
end if ;
end case ;
end loop ;
end process ;
-- Unused control signals for now
unused_ctl <= (others =>'0') ;
-- TODO: UART Interface
fx3_uart_rxd <= '0' ;
fx3_uart_csx <= '1' ;
end architecture ; -- digital_loopback
architecture inband_scheduler of fx3_model is
begin
end architecture ; -- inband_scheduler

View file

@ -0,0 +1,57 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
entity lms6002d_model is
port (
-- LMS RX Interface
lms_rx_clock : in std_logic ;
lms_rx_clock_out : out std_logic ;
lms_rx_data : out signed(11 downto 0) ;
lms_rx_enable : in std_logic ;
lms_rx_iq_select : in std_logic ;
-- LMS TX Interface
lms_tx_clock : in std_logic ;
lms_tx_data : in signed(11 downto 0) ;
lms_tx_enable : in std_logic ;
lms_tx_iq_select : in std_logic ;
-- LMS SPI Interface
lms_sclk : in std_logic ;
lms_sen : in std_logic ;
lms_sdio : out std_logic ;
lms_sdo : in std_logic ;
-- LMS Control Interface
lms_pll_out : out std_logic ;
lms_reset : in std_logic
) ;
end entity ; -- lms6002d_model
architecture arch of lms6002d_model is
begin
lms_pll_out <= '0' ;
-- Write transmit samples to a file or drop them on the floor
-- Read receive samples from a file or predetermined tone
lms_rx_clock_out <= lms_rx_clock ;
drive_rx_data : process( lms_reset, lms_rx_clock )
begin
if( lms_reset = '1' ) then
lms_rx_data <= (others =>'0') ;
elsif( rising_edge(lms_rx_clock) or falling_edge(lms_rx_clock) ) then
lms_rx_data <= lms_rx_data + 1 ;
end if ;
end process ;
-- Keep track of the SPI register set
lms_sdio <= '0' ;
end architecture ; -- arch

View file

@ -0,0 +1,39 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity async_fifo is
port (
-- Global clear
clear : in std_logic ;
-- Write side
w_clock : in std_logic ;
w_enable : in std_logic ;
w_data : in std_logic_vector(7 downto 0) ;
w_empty : out std_logic ;
w_full : out std_logic ;
-- Read side
r_clock : in std_logic ;
r_enable : in std_logic ;
r_data : out std_logic_vector(7 downto 0) ;
r_empty : out std_logic ;
r_full : out std_logic
) ;
end entity ; -- async_fifo
architecture arch of async_fifo is
-- Clear signals for their respective sides
signal r_clear : std_logic ;
signal w_clear : std_logic ;
type status_t is record
address : natural range 0 to 1023 ;
count : natural range 0 to 1023 ;
end record ;
begin
end architecture ; -- arch

View file

@ -0,0 +1,289 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
package constellation_mapper_p is
-- All possible modulations
type constellation_mapper_modulation_t is (
APSK_16,
APSK_32,
MSK,
PSK_2,
PSK_4,
PSK_8,
PSK_8_GRAY,
PSK_16,
QAM_16,
QAM_32,
QAM_64,
QAM_128,
QAM_256,
QAM_512,
QAM_1024,
QAM_2048,
QAM_4096
) ;
-- Array of modulations
type constellation_mapper_modulation_array_t is array(natural range <>) of constellation_mapper_modulation_t ;
-- Inputs to the mapper
type constellation_mapper_inputs_t is record
bits : std_logic_vector(15 downto 0) ;
modulation : constellation_mapper_modulation_t ;
valid : std_logic ;
end record ;
-- Outputs of the mapper
type constellation_mapper_outputs_t is record
symbol : complex ;
valid : std_logic ;
end record ;
end package ; -- constellation_mapper_p
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
library work ;
use work.constellation_mapper_p.all ;
entity constellation_mapper is
generic (
MODULATIONS : constellation_mapper_modulation_array_t := ( MSK, PSK_2, QAM_16 )
) ;
port (
clock : in std_logic ;
inputs : in constellation_mapper_inputs_t ;
outputs : out constellation_mapper_outputs_t
) ;
end entity ; -- constellation_mapper
architecture arch of constellation_mapper is
type real_array_t is array(natural range <>) of real ;
type complex_array_t is array(natural range <>) of complex ;
type modulation_info_t is record
index : natural ;
mask : std_logic_vector(15 downto 0) ;
end record ;
-- NOTE: If QAM_4096 is ever not the end, this needs to change
type modulation_index_t is array(0 to constellation_mapper_modulation_t'pos(QAM_4096)-1) of modulation_info_t ;
-- Get the number of entries of each of the supported modulations
function size( x : constellation_mapper_modulation_t ) return natural is
variable rv : natural := 0;
begin
case x is
when APSK_16 => rv := 16;
when APSK_32 => rv := 32;
when MSK => rv := 2 ;
when PSK_2 => rv := 2 ;
when PSK_4 => rv := 4 ;
when PSK_8 => rv := 8 ;
when PSK_8_GRAY => rv := 8 ;
when PSK_16 => rv := 16 ;
when QAM_16 => rv := 16 ;
when QAM_32 => rv := 32 ;
when QAM_64 => rv := 64 ;
when QAM_128 => rv := 128 ;
when QAM_256 => rv := 256 ;
when QAM_512 => rv := 512 ;
when QAM_1024 => rv := 1024 ;
when QAM_2048 => rv := 2048 ;
when QAM_4096 => rv := 4096 ;
end case ;
return rv ;
end function ;
-- 16-APSK Modulation points
function constellation_apsk_16 return complex_array_t is
variable rv : complex_array_t(0 to 15) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 32-APSK Modulation Points
function constellation_apsk_32 return complex_array_t is
variable rv : complex_array_t(0 to 31) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- MSK Modulation Points
function constellation_msk return complex_array_t is
variable rv : complex_array_t(0 to 1) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- BPSK Modulation Points
function constellation_psk_2 return complex_array_t is
variable rv : complex_array_t(0 to 1) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- QPSK Modulation Points
function constellation_psk_4 return complex_array_t is
variable rv : complex_array_t(0 to 3) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 8-PSK Modulation Points
function constellation_psk_8 return complex_array_t is
variable rv : complex_array_t(0 to 7) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 8-PSK Offset Modulation Points
function constellation_psk_8_gray return complex_array_t is
variable rv : complex_array_t(0 to 7) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 16-PSK Modulation Points
function constellation_psk_16 return complex_array_t is
variable rv : complex_array_t(0 to 15) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 16-QAM Modulation Points
function constellation_qam_16 return complex_array_t is
variable rv : complex_array_t(0 to 15) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 32-QAM Modulation Points
function constellation_qam_32 return complex_array_t is
variable rv : complex_array_t(0 to 31) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 64-QAM Modulation Points
function constellation_qam_64 return complex_array_t is
variable rv : complex_array_t(0 to 63) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 128-QAM Modulation Points
function constellation_qam_128 return complex_array_t is
variable rv : complex_array_t(0 to 127) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 256-QAM Modulation Points
function constellation_qam_256 return complex_array_t is
variable rv : complex_array_t(0 to 255) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 512-QAM Modulation Points
function constellation_qam_512 return complex_array_t is
variable rv : complex_array_t(0 to 511) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 1024-QAM Modulation Points
function constellation_qam_1024 return complex_array_t is
variable rv : complex_array_t(0 to 1023) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 2048-QAM Modulation Points
function constellation_qam_2048 return complex_array_t is
variable rv : complex_array_t(0 to 2047) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- 4096-QAM Modulation Points
function constellation_qam_4096 return complex_array_t is
variable rv : complex_array_t(0 to 4096) := (others =>(0.0,0.0)) ;
begin
return rv ;
end function ;
-- Get each of the constellation arrays
function constellation( x : constellation_mapper_modulation_t ) return complex_array_t is
begin
case x is
when APSK_16 => return constellation_apsk_16 ;
when APSK_32 => return constellation_apsk_32 ;
when MSK => return constellation_msk ;
when PSK_2 => return constellation_psk_2 ;
when PSK_4 => return constellation_psk_4 ;
when PSK_8 => return constellation_psk_8 ;
when PSK_8_GRAY => return constellation_psk_8_gray ;
when PSK_16 => return constellation_psk_16 ;
when QAM_16 => return constellation_qam_16 ;
when QAM_32 => return constellation_qam_32 ;
when QAM_64 => return constellation_qam_64 ;
when QAM_128 => return constellation_qam_128 ;
when QAM_256 => return constellation_qam_256 ;
when QAM_512 => return constellation_qam_512 ;
when QAM_1024 => return constellation_qam_1024 ;
when QAM_2048 => return constellation_qam_2048 ;
when QAM_4096 => return constellation_qam_4096 ;
end case ;
end function ;
-- Calculate the base indicies for each modulation type
function calculate_indices( x : constellation_mapper_modulation_array_t ) return modulation_index_t is
variable index : natural := 0;
variable rv : modulation_index_t := (others =>(0, x"0000")) ;
begin
for i in x'range loop
rv(constellation_mapper_modulation_t'pos(x(i))).index := index ;
rv(constellation_mapper_modulation_t'pos(x(i))).mask := std_logic_vector(to_unsigned(size(x(i))-1,rv(constellation_mapper_modulation_t'pos(x(i))).mask'length)) ;
index := index + size(x(i)) ;
end loop ;
return rv ;
end function ;
-- Take in the array and create the modulations recursively
function generate_modulation_table( x : constellation_mapper_modulation_array_t ) return complex_array_t is
begin
return constellation(x(x'low)) & generate_modulation_table(x(x'low+1 to x'high)) ;
end function ;
-- Constant values generated
constant modulation_index : modulation_index_t := calculate_indices(MODULATIONS) ;
constant modulation_table : complex_array_t := generate_modulation_table(MODULATIONS) ;
-- Actual signals!
signal base : modulation_info_t ;
signal symbol : complex ;
begin
-- Get the inputs and base address
base <= modulation_index(constellation_mapper_modulation_t'pos(inputs.modulation)) ;
-- Map it to the modulation table
symbol <= modulation_table(base.index + to_integer(unsigned(inputs.bits and base.mask))) ;
-- Register the outputs
outputs.symbol <= symbol when rising_edge( clock ) and inputs.valid = '1' ;
outputs.valid <= inputs.valid when rising_edge( clock ) ;
end architecture ; -- arch

View file

@ -0,0 +1,145 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
package cordic_p is
-- Vectoring mode forces outputs.y to 0
-- Rotation mode forces outputs.z to 0
type cordic_mode_t is (CORDIC_ROTATION, CORDIC_VECTORING) ;
-- TODO: Make this a generic package
type cordic_xyz_t is record
x : signed(15 downto 0) ;
y : signed(15 downto 0) ;
z : signed(15 downto 0) ;
valid : std_logic ;
end record ;
end package ; -- cordic_p
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
library work ;
use work.cordic_p.all ;
entity cordic is
port (
clock : in std_logic ;
reset : in std_logic ;
mode : in cordic_mode_t ;
inputs : in cordic_xyz_t ;
outputs : out cordic_xyz_t
) ;
end entity ; -- cordic
architecture arch of cordic is
-- TODO: Make this generic
constant NUM_STAGES : natural := 12 ;
-- TODO: Use the VHDL-2008 integer_vector
type integer_array_t is array(natural range <>) of integer ;
-- Each stage of the CORDIC is atan(2^(-i))
function calculate_cordic_table return integer_array_t is
variable rv : integer_array_t(0 to NUM_STAGES-1) := (others => 0) ;
begin
for i in 0 to rv'high loop
rv(i) := integer(round((2.0**NUM_STAGES)*arctan(2.0**(-i))/MATH_PI)) ;
end loop ;
return rv ;
end function ;
-- Constant array
constant K : integer_array_t := calculate_cordic_table ;
-- The array for CORDIC stages
type xyzs_t is array(0 to NUM_STAGES-1) of cordic_xyz_t ;
-- ALl the XYZ's for the CORDIC stages
signal xyzs : xyzs_t ;
begin
rotate : process(clock, reset)
begin
if( reset = '1' ) then
xyzs <= (others =>(x => (others =>'0'), y => (others =>'0'), z => (others =>'0'), valid => '0')) ;
elsif( rising_edge( clock ) ) then
-- First stage will rotate the vector to be within -pi/2 to pi/2
xyzs(0).valid <= inputs.valid ;
if( inputs.valid = '1' ) then
case mode is
when CORDIC_ROTATION =>
-- Make sure we're only rotating -pi/2 to pi/2 and adjust accordingly
if( inputs.z > 2**(NUM_STAGES-1) ) then
xyzs(0).x <= -inputs.x ;
xyzs(0).y <= -inputs.y ;
xyzs(0).z <= inputs.z - 2**NUM_STAGES ;
elsif( inputs.z < -(2**(NUM_STAGES-1)) ) then
xyzs(0).x <= -inputs.x ;
xyzs(0).y <= -inputs.y ;
xyzs(0).z <= inputs.z + 2**NUM_STAGES ;
else
xyzs(0).x <= inputs.x ;
xyzs(0).y <= inputs.y ;
xyzs(0).z <= inputs.z ;
end if ;
when CORDIC_VECTORING =>
-- Make sure we're in the 1st or 4th quadrant only
if( inputs.x < 0 and inputs.y < 0 ) then
xyzs(0).x <= -inputs.x ;
xyzs(0).y <= -inputs.y ;
xyzs(0).z <= inputs.z - 2**(NUM_STAGES) ;
elsif( inputs.x < 0 ) then
xyzs(0).x <= -inputs.x ;
xyzs(0).y <= -inputs.y ;
xyzs(0).z <= inputs.z + 2**(NUM_STAGES) ;
else
xyzs(0).x <= inputs.x ;
xyzs(0).y <= inputs.y ;
xyzs(0).z <= inputs.z ;
end if ;
end case ;
end if ;
-- Run through all the other stages
for i in 0 to xyzs'high-1 loop
xyzs(i+1).valid <= xyzs(i).valid ;
if( xyzs(i).valid = '1' ) then
case mode is
when CORDIC_ROTATION =>
if( xyzs(i).z < 0 ) then
xyzs(i+1).x <= xyzs(i).x + shift_right(xyzs(i).y, i) ;
xyzs(i+1).y <= xyzs(i).y - shift_right(xyzs(i).x, i) ;
xyzs(i+1).z <= xyzs(i).z + K(i) ;
else
xyzs(i+1).x <= xyzs(i).x - shift_right(xyzs(i).y, i) ;
xyzs(i+1).y <= xyzs(i).y + shift_right(xyzs(i).x, i) ;
xyzs(i+1).z <= xyzs(i).z - K(i) ;
end if ;
when CORDIC_VECTORING =>
if( xyzs(i).y < 0 ) then
xyzs(i+1).x <= xyzs(i).x - shift_right(xyzs(i).y, i) ;
xyzs(i+1).y <= xyzs(i).y + shift_right(xyzs(i).x, i) ;
xyzs(i+1).z <= xyzs(i).z - K(i) ;
else
xyzs(i+1).x <= xyzs(i).x + shift_right(xyzs(i).y, i) ;
xyzs(i+1).y <= xyzs(i).y - shift_right(xyzs(i).x, i) ;
xyzs(i+1).z <= xyzs(i).z + K(i) ;
end if ;
end case ;
end if ;
end loop ;
-- Output stage
outputs <= xyzs(xyzs'high) ;
end if ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,81 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
library work ;
use work.cordic_p.all ;
entity fsk_demodulator is
port (
clock : in std_logic ;
reset : in std_logic ;
in_real : in signed(15 downto 0) ;
in_imag : in signed(15 downto 0) ;
in_valid : in std_logic ;
out_ssd : buffer signed(15 downto 0) ;
out_valid : out std_logic
) ;
end entity ; -- fsk_demodulator
architecture arch of fsk_demodulator is
signal cordic_inputs : cordic_xyz_t ;
signal cordic_outputs : cordic_xyz_t ;
signal prev_z : signed(15 downto 0) ;
signal delta_z : signed(15 downto 0) ;
signal delta_z_valid : std_logic ;
signal unwrapped_z : signed(15 downto 0) ;
signal unwrapped_valid : std_logic ;
begin
cordic_inputs <= ( x => in_real, y => in_imag, z => (others =>'0'), valid => in_valid ) ;
U_cordic : entity work.cordic
port map (
clock => clock,
reset => reset,
mode => CORDIC_VECTORING,
inputs => cordic_inputs,
outputs => cordic_outputs
) ;
find_derivative : process(clock, reset)
begin
if( reset = '1' ) then
prev_z <= (others =>'0') ;
delta_z <= (others =>'0') ;
delta_z_valid <= '0' ;
elsif( rising_edge( clock ) ) then
delta_z_valid <= cordic_outputs.valid ;
if( cordic_outputs.valid = '1' ) then
prev_z <= cordic_outputs.z ;
delta_z <= cordic_outputs.z - prev_z ;
end if ;
end if ;
end process ;
unwrap : process(clock, reset)
begin
if( reset = '1' ) then
unwrapped_z <= (others =>'0') ;
unwrapped_valid <= '0' ;
elsif( rising_edge( clock ) ) then
unwrapped_valid <= delta_z_valid ;
if( delta_z > 4096 ) then
unwrapped_z <= delta_z - 8192 ;
elsif( delta_z < -4096 ) then
unwrapped_z <= delta_z + 8192 ;
else
unwrapped_z <= delta_z ;
end if ;
end if ;
end process ;
out_ssd <= out_ssd - shift_right(out_ssd,4) + unwrapped_z when rising_edge(clock) and unwrapped_valid = '1' ;
out_valid <= unwrapped_valid when rising_edge(clock);
end architecture ; -- arch

View file

@ -0,0 +1,83 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
library work ;
use work.nco_p.all ;
entity fsk_modulator is
port (
clock : in std_logic ;
reset : in std_logic ;
symbol : in std_logic ;
symbol_valid : in std_logic ;
out_real : out signed(15 downto 0) ;
out_imag : out signed(15 downto 0) ;
out_valid : out std_logic
) ;
end entity ; -- fsk_modulator
architecture arch of fsk_modulator is
-- Positive deviation for ZERO and negative deviation for ONE
constant ZERO : signed(15 downto 0) := to_signed(integer(round(4096.0/19.2)),16) ;
constant ONE : signed(15 downto 0) := -ZERO ;
signal nco_input : nco_input_t ;
signal nco_output : nco_output_t ;
begin
register_new_symbol : process(clock, reset)
-- variable dir : std_logic ;
-- variable dphase : signed(15 downto 0) ;
begin
if( reset = '1' ) then
-- dir := '1' ;
-- dphase := (others =>'0') ;
nco_input.dphase <= ZERO ;
nco_input.valid <= '0' ;
elsif( rising_edge( clock ) ) then
nco_input.valid <= '1' ;
-- if( dir = '1' ) then
-- if( dphase < 4094) then
-- dphase := dphase + 1 ;
-- else
-- dphase := dphase - 1 ;
-- dir := '0' ;
-- end if ;
-- else
-- if( dphase > -4094) then
-- dphase := dphase - 1 ;
-- else
-- dphase := dphase + 1 ;
-- dir := '1' ;
-- end if ;
-- end if ;
if( symbol_valid = '1' ) then
-- nco_input.dphase <= dphase ;
if( symbol = '0' ) then
nco_input.dphase <= ZERO ;
else
nco_input.dphase <= ONE ;
end if ;
end if ;
end if ;
end process ;
U_nco : entity work.nco
port map (
clock => clock,
reset => reset,
inputs => nco_input,
outputs => nco_output
) ;
out_real <= nco_output.re ;
out_imag <= nco_output.im ;
out_valid <= nco_output.valid ;
end architecture ; -- arch

View file

@ -0,0 +1,79 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
package nco_p is
type nco_input_t is record
dphase : signed(15 downto 0) ;
valid : std_logic ;
end record ;
type nco_output_t is record
re : signed(15 downto 0) ;
im : signed(15 downto 0) ;
valid : std_logic ;
end record ;
end package ; -- nco_p
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
library work ;
use work.cordic_p.all ;
use work.nco_p.all ;
entity nco is
port (
clock : in std_logic ;
reset : in std_logic ;
inputs : in nco_input_t ;
outputs : out nco_output_t
) ;
end entity ; -- nco
architecture arch of nco is
signal phase : signed(15 downto 0) ;
signal cordic_inputs : cordic_xyz_t ;
signal cordic_outputs : cordic_xyz_t ;
begin
accumulate_phase : process(clock, reset)
variable temp : signed(15 downto 0) ;
begin
if( reset = '1' ) then
phase <= (others =>'0') ;
elsif( rising_edge( clock ) ) then
if( inputs.valid = '1' ) then
temp := phase + inputs.dphase ;
if( temp > 4096 ) then
temp := temp - 8192 ;
elsif( temp < -4096 ) then
temp := temp + 8192 ;
end if ;
phase <= temp ;
end if ;
end if ;
end process ;
cordic_inputs <= ( x => to_signed(1234,16), y => (others =>'0'), z => phase, valid => inputs.valid ) ;
U_cordic : entity work.cordic
port map (
clock => clock,
reset => reset,
mode => CORDIC_ROTATION,
inputs => cordic_inputs,
outputs => cordic_outputs
) ;
outputs.re <= cordic_outputs.x ;
outputs.im <= cordic_outputs.y ;
outputs.valid <= cordic_outputs.valid ;
end architecture ; -- arch

View file

@ -0,0 +1,86 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity sync_fifo is
generic (
DEPTH : positive := 32 ;
WIDTH : positive := 16 ;
READ_AHEAD : boolean := true
) ;
port (
areset : in std_logic ;
clock : in std_logic ;
-- FIFO Status information
full : out std_logic ;
empty : out std_logic ;
used_words : out natural range 0 to DEPTH ;
-- FIFO Input Side
data_in : in std_logic_vector(WIDTH-1 downto 0) ;
write_en : in std_logic ;
-- FIFO Output Side
data_out : out std_logic_vector(WIDTH-1 downto 0) ;
read_en : in std_logic
) ;
end entity ; -- sync_fifo
architecture arch of sync_fifo is
-- House keeping
signal write_address : natural range 0 to DEPTH-1 ;
signal read_address : natural range 0 to DEPTH-1 ;
signal used : natural range 0 to DEPTH ;
-- Dual port RAM
type ram_t is array(0 to DEPTH-1) of std_logic_vector(WIDTH-1 downto 0) ;
signal ram : ram_t ;
begin
empty <= '1' when used = 0 else '0' ;
full <= '1' when used = DEPTH else '0' ;
used_words <= used ;
follow_used_words : process( clock, areset )
begin
if( areset = '1' ) then
used <= 0 ;
write_address <= 0 ;
read_address <= 0 ;
elsif( rising_edge(clock) ) then
if( write_en = '1' ) then
if( read_en = '0' ) then
if( used < DEPTH ) then
write_address <= (write_address + 1) mod DEPTH ;
used <= used + 1 ;
else
report "Trying to write a full FIFO!" severity error ;
end if ;
end if ;
else
if( read_en = '1' ) then
if( used > 0 ) then
read_address <= (read_address + 1) mod DEPTH ;
used <= used - 1 ;
else
report "Trying to read an empty FIFO!" severity error ;
end if ;
end if ;
end if ;
end if ;
end process ;
access_ram : process( clock )
begin
if( rising_edge( clock ) ) then
data_out <= ram(read_address) ;
if( write_en = '1' ) then
ram(write_address) <= data_in ;
end if ;
end if ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,84 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
library work ;
use work.cordic_p.all ;
entity cordic_tb is
end entity ; -- cordic_tb
architecture arch of cordic_tb is
signal clock : std_logic := '1' ;
signal reset : std_logic := '1' ;
signal inputs : cordic_xyz_t := ( x => (others =>'0'), y => (others =>'0'), z => (others =>'0'), valid => '0' );
signal outputs : cordic_xyz_t ;
signal outputs2 : cordic_xyz_t ;
procedure nop( signal clock : in std_logic ; count : in natural ) is
begin
for i in 1 to count loop
wait until rising_edge( clock ) ;
end loop ;
end procedure ; -- nop
begin
-- Generate clock
clock <= not clock after 1 ns ;
-- Magnitude/phase to cos+isin
U_cordic : entity work.cordic
port map (
clock => clock,
reset => reset,
mode => CORDIC_ROTATION,
inputs => inputs,
outputs => outputs
) ;
-- cos+isin to magnitude/phase
U_cordic2 : entity work.cordic
port map (
clock => clock,
reset => reset,
mode => CORDIC_VECTORING,
inputs => outputs,
outputs => outputs2
) ;
tb : process
variable ang : integer := 0 ;
variable dang : integer := integer(round(0.01*4096.0)) ;
begin
reset <= '1' ;
nop( clock, 10 ) ;
reset <= '0' ;
nop( clock, 10 ) ;
ang := 0 ;
inputs.x <= to_signed( integer(round(4096.0/1.66)), inputs.x'length ) ;
inputs.y <= to_signed( 0, inputs.y'length ) ;
for i in 0 to 10000 loop
inputs.z <= to_signed( ang, inputs.z'length ) ;
inputs.valid <= '1' ;
wait until rising_edge( clock ) ;
inputs.valid <= '0' ;
nop( clock, 20 ) ;
ang := ang + dang ;
if( ang > 4096 ) then
ang := ang - 8192 ;
elsif( ang < -4096 ) then
ang := ang + 8192 ;
end if ;
end loop ;
report "-- End of Simulation --" severity failure ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,83 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
entity fsk_tb is
end entity ; -- fsk_tb
architecture arch of fsk_tb is
signal clock : std_logic := '1' ;
signal reset : std_logic := '1' ;
signal tx_symbol : std_logic := '0' ;
signal tx_valid : std_logic := '0' ;
signal tx_sig_real : signed(15 downto 0) ;
signal tx_sig_imag : signed(15 downto 0) ;
signal tx_sig_valid : std_logic ;
signal rx_symbol : signed(15 downto 0) ;
signal rx_valid : std_logic ;
procedure nop( signal clock : in std_logic ; count : in natural ) is
begin
for i in 1 to count loop
wait until rising_edge( clock ) ;
end loop ;
end procedure ;
begin
clock <= not clock after 1 ns ;
U_fsk_modulator : entity work.fsk_modulator
port map (
clock => clock,
reset => reset,
symbol => tx_symbol,
symbol_valid => tx_valid,
out_real => tx_sig_real,
out_imag => tx_sig_imag,
out_valid => tx_sig_valid
) ;
U_fsk_demodulator : entity work.fsk_demodulator
port map (
clock => clock,
reset => reset,
in_real => tx_sig_real,
in_imag => tx_sig_imag,
in_valid => tx_sig_valid,
out_ssd => rx_symbol,
out_valid => rx_valid
) ;
tb : process
variable s1, s2 : natural ;
variable random : real ;
begin
reset <= '1' ;
nop( clock, 10 ) ;
reset <= '0' ;
nop( clock, 10 ) ;
s1 := 1234 ;
s2 := 2345 ;
for i in 0 to 10000 loop
uniform( s1, s2, random ) ;
if( random >= 0.5 ) then
tx_symbol <= '1' ;
else
tx_symbol <= '0' ;
end if ;
tx_valid <= '1' ;
nop( clock, 50 ) ;
end loop ;
report "-- End of Simulation --" severity failure ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,72 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
library work ;
use work.cordic_p.all ;
use work.nco_p.all ;
entity nco_tb is
end entity ; -- nco_tb
architecture arch of nco_tb is
signal clock : std_logic := '1' ;
signal reset : std_logic := '1' ;
signal inputs : nco_input_t := ( dphase => (others =>'0'), valid => '0' );
signal outputs : nco_output_t ;
procedure nop( signal clock : in std_logic ; count : in natural ) is
begin
for i in 1 to count loop
wait until rising_edge( clock ) ;
end loop ;
end procedure ;
begin
clock <= not clock after 1 ns ;
U_nco : entity work.nco
port map (
clock => clock,
reset => reset,
inputs => inputs,
outputs => outputs
) ;
tb : process
variable up_downx : boolean := true ;
begin
reset <= '1' ;
nop( clock, 10 ) ;
reset <= '0' ;
nop( clock, 10 ) ;
for i in 0 to 100000 loop
if( inputs.dphase = 4096 ) then
up_downx := false ;
elsif( inputs.dphase = -4096 ) then
up_downx := true ;
end if ;
if( up_downx ) then
inputs.dphase <= inputs.dphase + 1 ;
else
inputs.dphase <= inputs.dphase - 1 ;
end if ;
inputs.valid <= '1' ;
wait until rising_edge( clock ) ;
inputs.valid <= '0' ;
nop( clock, 10 ) ;
end loop ;
report "-- End of Simulation --" severity failure ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,123 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity uart_tb is
end entity ; -- uart_tb
architecture arch of uart_tb is
signal clock : std_logic := '1' ;
signal reset : std_logic := '1' ;
signal enable : std_logic := '0' ;
signal rs232_rxd : std_logic ;
signal rs232_txd : std_logic := '1' ;
signal txd_we : std_logic ;
signal txd_full : std_logic := '0' ;
signal txd_data : std_logic_vector(7 downto 0) ;
signal rxd_re : std_logic ;
signal rxd_empty : std_logic := '1' ;
signal rxd_data : std_logic_vector(7 downto 0) := (others =>'0') ;
procedure nop( signal clock : in std_logic ; count : in natural ) is
begin
for i in 1 to count loop
wait until rising_edge(clock) ;
end loop ;
end procedure ;
procedure uart_send( signal clock : in std_logic ; signal txd : out std_logic ; data : in std_logic_vector(7 downto 0) ; cpb : in natural ) is
begin
wait until rising_edge(clock) ;
-- Send start bit
txd <= '0' ;
nop( clock, cpb ) ;
-- Send data
for i in 0 to data'high loop
txd <= data(i) ;
nop( clock, cpb ) ;
end loop ;
-- Send stop bit
txd <= '1' ;
nop( clock, cpb ) ;
end procedure ;
begin
clock <= not clock after 1 ns ;
U_uart : entity work.uart
port map (
clock => clock,
reset => reset,
enable => enable,
rs232_rxd => rs232_rxd,
rs232_txd => rs232_txd,
txd_we => txd_we,
txd_full => txd_full,
txd_data => txd_data,
rxd_re => rxd_re,
rxd_empty => rxd_empty,
rxd_data => rxd_data
) ;
stimulate : process
begin
-- Reset
reset <= '1' ;
nop( clock, 10 ) ;
-- Done with reset ...
reset <= '0' ;
nop( clock, 10 ) ;
-- Make sure we don't do anything when we aren't enabled ...
enable <= '0' ;
nop( clock, 10 ) ;
-- ... and now lets go!
enable <= '1' ;
nop( clock, 100000 ) ;
-- Ding!
report "-- End of Simulation -- " severity failure ;
end process ;
-- Just keep sending data in from the UART
simulate_uart_sending : process
variable val : natural := 0 ;
begin
rs232_txd <= '1' ;
wait until enable = '1' ;
nop( clock, 100 ) ;
while true loop
uart_send( clock, rs232_txd, std_logic_vector(to_unsigned(val,8)), 10 ) ;
val := (val + 1) mod 256 ;
--nop( clock, 5 ) ;
end loop ;
end process ;
-- Feedback data continuously
simulate_s2u_fifo : process
begin
rxd_empty <= '1' ;
wait until enable = '1' ;
nop( clock, 100 ) ;
rxd_empty <= '0' ;
rxd_data <= (others =>'0') ;
while true loop
wait until rising_edge( clock ) and rxd_re = '1' ;
rxd_data <= std_logic_vector(unsigned(rxd_data)+1) ;
end loop ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,200 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity uart is
port (
-- FPGA internal interface to the TX and RX FIFOs
clock : in std_logic ;
reset : in std_logic ;
enable : in std_logic ;
-- RS232 interface
rs232_rxd : out std_logic ;
rs232_txd : in std_logic ;
-- UART -> FIFO interface
txd_we : out std_logic ;
txd_full : in std_logic ;
txd_data : out std_logic_vector(7 downto 0) ;
-- FIFO -> UART interface
rxd_re : out std_logic ;
rxd_empty : in std_logic ;
rxd_data : in std_logic_vector(7 downto 0)
) ;
end entity ; -- uart
architecture arch of uart is
-- TODO: Make this a generic instead of a constant
constant CLOCKS_PER_BIT : natural := 10 ;
-- Send and receive state machine definitions
type send_fsm_t is (IDLE, SEND_START, SEND_DATA, SEND_STOP ) ;
type receive_fsm_t is (WAIT_FOR_START, CENTER_START, SAMPLE_DATA, WAIT_FOR_STOP) ;
-- FSM signals
signal send_fsm : send_fsm_t ;
signal receive_fsm : receive_fsm_t ;
-- Synchronization signals for asynchronous input
signal reg_txd : std_logic ;
signal sync_txd : std_logic ;
begin
-- Synchronize asynchronous inputs
reg_txd <= rs232_txd when rising_edge( clock ) ;
sync_txd <= reg_txd when rising_edge( clock ) ;
-- Receive data from the UART and put it in the FIFO
receive_from_uart : process(all)
variable bits : std_logic_vector(7 downto 0) ;
variable bit_count : natural range 0 to bits'length ;
variable clock_count : natural range 0 to CLOCKS_PER_BIT ;
variable txd_delay : std_logic ;
begin
if( reset = '1' ) then
receive_fsm <= WAIT_FOR_START ;
txd_we <= '0' ;
txd_data <= (others =>'0') ;
bits := (others =>'0') ;
bit_count := 0 ;
clock_count := 0 ;
txd_delay := '0' ;
elsif( rising_edge(clock) ) then
if( enable = '0' ) then
txd_we <= '0' ;
txd_data <= (others =>'0') ;
bits := (others =>'0') ;
bit_count := 0 ;
clock_count := 0 ;
txd_delay := '0' ;
else
txd_we <= '0' ;
case receive_fsm is
-- Wait for the start signal
when WAIT_FOR_START =>
if( sync_txd = '0' and txd_delay = '1' ) then
receive_fsm <= CENTER_START ;
clock_count := CLOCKS_PER_BIT/2-1 ;
end if ;
txd_delay := sync_txd ;
-- Center the start bit
when CENTER_START =>
clock_count := clock_count - 1 ;
if( clock_count = 0 ) then
receive_fsm <= SAMPLE_DATA ;
clock_count := CLOCKS_PER_BIT ;
bit_count := bits'length ;
end if ;
-- Sample the bits
when SAMPLE_DATA =>
clock_count := clock_count - 1 ;
if( clock_count = 0 ) then
bits := sync_txd & bits(bits'high downto 1) ;
bit_count := bit_count - 1 ;
clock_count := CLOCKS_PER_BIT ;
if( bit_count = 0 ) then
receive_fsm <= WAIT_FOR_STOP ;
txd_data <= bits ;
txd_we <= '1' ;
end if ;
end if ;
-- Wait for the stop bit
when WAIT_FOR_STOP =>
clock_count := clock_count - 1 ;
if( clock_count = 0 ) then
receive_fsm <= WAIT_FOR_START ;
assert sync_txd = '1' report "STOP bit not found!" severity error ;
end if ;
when others =>
end case ;
end if ;
end if ;
end process ;
-- Send data to the UART from the FIFO
send_to_uart : process(all)
variable bits : std_logic_vector(7 downto 0) ;
variable bit_count : natural range 0 to bits'length ;
variable clock_count : natural range 0 to CLOCKS_PER_BIT ;
begin
if( reset = '1' ) then
send_fsm <= IDLE ;
rxd_re <= '0' ;
rs232_rxd <= '1' ;
bit_count := 0 ;
clock_count := 0 ;
bits := (others =>'0') ;
elsif( rising_edge(clock) ) then
if( enable = '0' ) then
send_fsm <= IDLE ;
rxd_re <= '0' ;
rs232_rxd <= '1' ;
bit_count := 0 ;
clock_count := 0 ;
bits := (others =>'0') ;
else
rxd_re <= '0' ;
case send_fsm is
-- Wait until we have something to send
when IDLE =>
rs232_rxd <= '1' ;
if( rxd_empty = '0' ) then
send_fsm <= SEND_START ;
rxd_re <= '1' ;
bit_count := bits'length ;
clock_count := CLOCKS_PER_BIT ;
end if ;
-- Send the start bit
when SEND_START =>
rs232_rxd <= '0' ;
-- bits := rxd_data ;
clock_count := clock_count - 1 ;
if( clock_count = 0 ) then
send_fsm <= SEND_DATA ;
clock_count := CLOCKS_PER_BIT ;
elsif( clock_count = 9 ) then
bits := rxd_data ;
end if ;
-- Send the data
when SEND_DATA =>
rs232_rxd <= bits(0) ;
clock_count := clock_count - 1 ;
if( clock_count = 0 ) then
bits := '0' & bits(bits'high downto 1) ;
bit_count := bit_count - 1 ;
clock_count := CLOCKS_PER_BIT ;
if( bit_count = 0 ) then
send_fsm <= SEND_STOP ;
end if ;
end if ;
-- Send the stop bit
when SEND_STOP =>
rs232_rxd <= '1' ;
clock_count := clock_count - 1 ;
if( clock_count = 0 ) then
send_fsm <= IDLE ;
end if ;
-- Weird
when others =>
send_fsm <= IDLE ;
rs232_rxd <= '1' ;
bit_count := 0 ;
clock_count := 0 ;
bits := (others =>'0') ;
end case ;
end if ;
end if ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,114 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity uart_bridge is
port (
-- UART Interface
uart_clock : in std_logic ;
uart_reset : in std_logic ;
uart_enable : in std_logic ;
uart_rxd : out std_logic ;
uart_txd : out std_logic ;
-- SPI Interface
spi_clock : in std_logic ;
spi_reset : in std_logic ;
spi_sclk : out std_logic ;
spi_miso : in std_logic ;
spi_mosi : out std_logic ;
spi_csn : out std_logic
) ;
end entity ; -- uart_bridge
architecture arch of uart_bridge is
-- UART to SPI FIFO signals
signal u2s_write : std_logic ;
signal u2s_full : std_logic ;
signal u2s_data : std_logic_vector(7 downto 0) ;
-- SPI to UART FIFO signals
signal s2u_read : std_logic ;
signal s2u_empty : std_logic ;
signal s2u_data : std_logic_vector(7 downto 0) ;
begin
-- UART interface
U_uart : entity work.uart
port map (
-- Control signals
clock => uart_clock,
reset => uart_reset,
enable => uart_enable,
-- External UART signals
rs232_rxd => uart_rxd,
rs232_txd => uart_txd,
-- FIFO signals for UART to FIFO from external interface
txd_we => u2s_write,
txd_full => u2s_full,
txd_wdata => u2s_data,
-- FIFO signals for FIFO to UART to be transmitted back
rxd_re => s2u_read,
rxd_empty => s2u_empty,
rxd_rdata => s2u_data
) ;
-- Dual clock FIFO for UART -> SPI comms
U_u2s_fifo : entity work.async_fifo
port map (
-- Write side: UART
w_clock => uart_clock,
w_enable => u2s_write,
w_data => u2s_data,
w_empty => open,
w_full => u2s_full,
-- Read side: SPI
r_clock => spi_clock,
r_enable => spi_read,
r_data => spi_data,
r_empty => spi_empty,
r_full => open
) ;
-- Dual clock FIFO for SPI -> UART comms
U_s2u_fifo : entity work.async_fifo
port map (
-- Write side: SPI
w_clock => spi_clock,
w_enable => spi_readback_wen,
w_data => spi_readback_data,
w_empty => open,
w_full => s2u_full,
-- Read side: UART
r_clock => uart_clock,
r_enable => s2u_read,
r_data => s2u_data,
r_empty => s2u_empty,
r_full => open
) ;
-- LMS SPI interface
U_lms_spi : entity lms_spi
port map (
-- Control signals
clock => spi_clock,
reset => spi_reset,
-- SPI data stream
spi_data => spi_data,
spi_read => spi_read,
spi_empty => spi_empty,
-- SPI readback data stream
readback_data => spi_readback_data,
readback_enable => spi_readback_wen
) ;
end architecture ; -- arch

View file

@ -0,0 +1,15 @@
proc compile_bladerf { root } {
vlib pll
vcom -work pll [file join $root ../../ip/altera/pll/pll.vhd]
vlib serial_pll
vcom -work serial_pll [file join $root ../../ip/altera/serial_pll/serial_pll.vhd]
vlib nuand
vcom -work nuand -2008 [file join $root ./vhdl/fx3.vhd]
vcom -work nuand -2008 [file join $root ./vhdl/bladerf_debug_p.vhd]
vcom -work nuand -2008 [file join $root ./vhdl/ramp.vhd]
vcom -work nuand -2008 [file join $root ./vhdl/bladerf.vhd]
vcom -work nuand -2008 [file join $root ./vhdl/tb/bladerf_tb.vhd]
}

View file

@ -0,0 +1,31 @@
# Clock inputs
create_clock -period "100.0 MHz" [get_ports fx3_pclk]
create_clock -period "38.4 MHz" [get_ports c4_clock]
create_clock -period "38.4 MHz" [get_ports lms_pll_out]
create_clock -period "19.2 MHz" [get_ports lms_sclk]
create_clock -period "76.8 MHz" [get_ports lms_rx_clock_out]
# Generate the appropriate PLL clocks
derive_pll_clocks
derive_clock_uncertainty
# TODO: Constrain the FX3 interface
# TODO: Constrain the LMS interface
set_input_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_rx_clock_out] -max 10.0 [get_ports lms_rx_data*]
set_input_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_rx_clock_out] -min 1.0 [get_ports lms_rx_data*] -add_delay
#set_input_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_rx_clock] -max 6 [get_ports lms_rx_data*] -add_delay
set_input_delay -clock [get_clocks lms_sclk] -reference_pin [get_ports lms_sclk] -min 0.2 [get_ports lms_sdo]
set_input_delay -clock [get_clocks lms_sclk] -reference_pin [get_ports lms_sclk] -max 10.0 [get_ports lms_sdo] -add_delay
set_output_delay -clock [get_clocks lms_sclk] -reference_pin [get_ports lms_sclk] -min 0.2 [get_ports {lms_sen lms_sdio}]
set_output_delay -clock [get_clocks lms_sclk] -reference_pin [get_ports lms_sclk] -max 9 [get_ports {lms_sen lms_sdio}] -add_delay
# Transmit samples
set_output_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_tx_clock] -min 1.0 [get_ports *lms_tx_data*]
set_output_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_tx_clock] -max 10 [get_ports *lms_tx_data*] -add_delay
set_output_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_tx_clock] -min 1.0 [get_ports lms_tx_iq_select]
set_output_delay -clock [get_clocks *clk*0*] -reference_pin [get_ports lms_tx_clock] -max 10 [get_ports lms_tx_iq_select] -add_delay

View file

@ -0,0 +1,259 @@
# Copyright (C) 1991-2011 Altera Corporation
# Your use of Altera Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
# to the terms and conditions of the Altera Program License
# Subscription Agreement, Altera MegaCore Function License
# Agreement, or other applicable license agreement, including,
# without limitation, that your use is for the sole purpose of
# programming logic devices manufactured by Altera and sold by
# Altera or its authorized distributors. Please refer to the
# applicable agreement for further details.
# Quartus II 32-bit Version 11.1 Build 173 11/01/2011 SJ Web Edition
# File: Z:\projects\nuand\quartus\constraints\pins.tcl
# Generated on: Tue Oct 09 23:04:36 2012
package require ::quartus::project
set VOLTAGE "3.3-V LVCMOS"
#set VOLTAGE "1.8 V"
set_instance_assignment -name IO_STANDARD $VOLTAGE -to c4_clock
set_instance_assignment -name IO_STANDARD $VOLTAGE -to dac_csx
set_instance_assignment -name IO_STANDARD $VOLTAGE -to dac_sclk
set_instance_assignment -name IO_STANDARD $VOLTAGE -to dac_sdi
set_instance_assignment -name IO_STANDARD $VOLTAGE -to dac_sdo
set_instance_assignment -name IO_STANDARD $VOLTAGE -to refexp_1pps
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_clock
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[16]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[15]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[14]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[13]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[12]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[11]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[10]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[9]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[8]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[7]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[6]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[5]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[4]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[3]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_gpio[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_present
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_spi_clock
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_spi_miso
set_instance_assignment -name IO_STANDARD $VOLTAGE -to exp_spi_mosi
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_pclk
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[12]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[11]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[10]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[9]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[8]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[7]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[6]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[5]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[4]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[3]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_ctl[0]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[31]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[30]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[29]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[28]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[27]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[26]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[25]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[24]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[23]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[22]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[21]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[20]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[19]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[18]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[17]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[16]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[15]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[14]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[13]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[12]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[11]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[10]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[9]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[8]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[7]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[6]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[5]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[4]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[3]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_gpif[0]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_uart_csx
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_uart_rxd
set_instance_assignment -name IO_STANDARD $VOLTAGE -to fx3_uart_txd
set_instance_assignment -name IO_STANDARD $VOLTAGE -to led[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to led[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_pll_out
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_reset
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_clock
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_clock_out
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[11]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[10]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[9]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[8]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[7]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[6]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[5]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[4]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[3]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_data[0]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_enable
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_iq_select
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_v[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_rx_v[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_sclk
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_sdio
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_sdo
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_sen
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_clock
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[11]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[10]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[9]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[8]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[7]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[6]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[5]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[4]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[3]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[1]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_data[0]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_enable
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_iq_select
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_v[2]
set_instance_assignment -name IO_STANDARD $VOLTAGE -to lms_tx_v[1]
set_location_assignment PIN_A11 -to c4_clock
set_location_assignment PIN_B10 -to dac_csx
set_location_assignment PIN_B9 -to dac_sclk
set_location_assignment PIN_A10 -to dac_sdi
set_location_assignment PIN_A9 -to dac_sdo
set_location_assignment PIN_G1 -to fx3_pclk
set_location_assignment PIN_M1 -to fx3_ctl[12]
set_location_assignment PIN_J4 -to fx3_ctl[11]
set_location_assignment PIN_J6 -to fx3_ctl[10]
set_location_assignment PIN_K2 -to fx3_ctl[9]
set_location_assignment PIN_N1 -to fx3_ctl[8]
set_location_assignment PIN_G3 -to fx3_ctl[7]
set_location_assignment PIN_F7 -to fx3_ctl[6]
set_location_assignment PIN_B1 -to fx3_ctl[5]
set_location_assignment PIN_C1 -to fx3_ctl[4]
set_location_assignment PIN_H1 -to fx3_ctl[3]
set_location_assignment PIN_H6 -to fx3_ctl[2]
set_location_assignment PIN_F2 -to fx3_ctl[1]
set_location_assignment PIN_F1 -to fx3_ctl[0]
set_location_assignment PIN_Y1 -to fx3_gpif[31]
set_location_assignment PIN_AA1 -to fx3_gpif[30]
set_location_assignment PIN_AB3 -to fx3_gpif[29]
set_location_assignment PIN_P1 -to fx3_gpif[28]
set_location_assignment PIN_W7 -to fx3_gpif[27]
set_location_assignment PIN_R2 -to fx3_gpif[26]
set_location_assignment PIN_W6 -to fx3_gpif[25]
set_location_assignment PIN_W1 -to fx3_gpif[24]
set_location_assignment PIN_R1 -to fx3_gpif[23]
set_location_assignment PIN_V5 -to fx3_gpif[22]
set_location_assignment PIN_T4 -to fx3_gpif[21]
set_location_assignment PIN_M4 -to fx3_gpif[20]
set_location_assignment PIN_T5 -to fx3_gpif[19]
set_location_assignment PIN_P4 -to fx3_gpif[18]
set_location_assignment PIN_M6 -to fx3_gpif[17]
set_location_assignment PIN_N6 -to fx3_gpif[16]
set_location_assignment PIN_D1 -to fx3_gpif[15]
set_location_assignment PIN_C8 -to fx3_gpif[14]
set_location_assignment PIN_C7 -to fx3_gpif[13]
set_location_assignment PIN_C4 -to fx3_gpif[12]
set_location_assignment PIN_C6 -to fx3_gpif[11]
set_location_assignment PIN_B3 -to fx3_gpif[10]
set_location_assignment PIN_F10 -to fx3_gpif[9]
set_location_assignment PIN_B4 -to fx3_gpif[8]
set_location_assignment PIN_K1 -to fx3_gpif[7]
set_location_assignment PIN_A8 -to fx3_gpif[6]
set_location_assignment PIN_A3 -to fx3_gpif[5]
set_location_assignment PIN_F8 -to fx3_gpif[4]
set_location_assignment PIN_A5 -to fx3_gpif[3]
set_location_assignment PIN_B8 -to fx3_gpif[2]
set_location_assignment PIN_B7 -to fx3_gpif[1]
set_location_assignment PIN_B6 -to fx3_gpif[0]
set_location_assignment PIN_AA3 -to fx3_uart_txd
set_location_assignment PIN_AA4 -to fx3_uart_csx
set_location_assignment PIN_AA5 -to fx3_uart_rxd
set_location_assignment PIN_AA7 -to led[1]
set_location_assignment PIN_AB7 -to led[2]
set_location_assignment PIN_T21 -to lms_pll_out
set_location_assignment PIN_K21 -to lms_rx_clock
set_location_assignment PIN_T22 -to lms_rx_clock_out
set_location_assignment PIN_B22 -to lms_rx_data[11]
set_location_assignment PIN_B21 -to lms_rx_data[10]
set_location_assignment PIN_C22 -to lms_rx_data[9]
set_location_assignment PIN_C21 -to lms_rx_data[8]
set_location_assignment PIN_D22 -to lms_rx_data[7]
set_location_assignment PIN_E21 -to lms_rx_data[6]
set_location_assignment PIN_D21 -to lms_rx_data[5]
set_location_assignment PIN_F21 -to lms_rx_data[4]
set_location_assignment PIN_E22 -to lms_rx_data[3]
set_location_assignment PIN_H21 -to lms_rx_data[2]
set_location_assignment PIN_F22 -to lms_rx_data[1]
set_location_assignment PIN_J21 -to lms_rx_data[0]
set_location_assignment PIN_H22 -to lms_rx_iq_select
set_location_assignment PIN_L21 -to lms_tx_clock
set_location_assignment PIN_U21 -to lms_tx_data[11]
set_location_assignment PIN_P22 -to lms_tx_data[10]
set_location_assignment PIN_U22 -to lms_tx_data[9]
set_location_assignment PIN_R21 -to lms_tx_data[8]
set_location_assignment PIN_N22 -to lms_tx_data[7]
set_location_assignment PIN_R22 -to lms_tx_data[6]
set_location_assignment PIN_M22 -to lms_tx_data[5]
set_location_assignment PIN_P21 -to lms_tx_data[4]
set_location_assignment PIN_L22 -to lms_tx_data[3]
set_location_assignment PIN_N21 -to lms_tx_data[2]
set_location_assignment PIN_K22 -to lms_tx_data[1]
set_location_assignment PIN_M21 -to lms_tx_data[0]
set_location_assignment PIN_AA13 -to lms_reset
set_location_assignment PIN_AA14 -to lms_rx_enable
set_location_assignment PIN_AA15 -to lms_sclk
set_location_assignment PIN_AA20 -to lms_tx_v[2]
set_location_assignment PIN_AA21 -to lms_tx_v[1]
set_location_assignment PIN_AB13 -to lms_sdio
set_location_assignment PIN_AB14 -to lms_sdo
set_location_assignment PIN_AB15 -to lms_tx_enable
set_location_assignment PIN_AB16 -to lms_sen
set_location_assignment PIN_AB19 -to lms_rx_v[2]
set_location_assignment PIN_AB20 -to lms_rx_v[1]
set_location_assignment PIN_J22 -to lms_tx_iq_select
set_location_assignment PIN_A13 -to exp_spi_mosi
set_location_assignment PIN_A14 -to exp_gpio[1]
set_location_assignment PIN_A15 -to exp_gpio[2]
set_location_assignment PIN_A16 -to exp_gpio[3]
set_location_assignment PIN_A17 -to exp_gpio[4]
set_location_assignment PIN_A18 -to exp_gpio[5]
set_location_assignment PIN_A19 -to exp_gpio[6]
set_location_assignment PIN_A20 -to exp_gpio[7]
set_location_assignment PIN_C19 -to exp_gpio[8]
set_location_assignment PIN_B13 -to exp_gpio[9]
set_location_assignment PIN_B14 -to exp_gpio[10]
set_location_assignment PIN_B15 -to exp_gpio[11]
set_location_assignment PIN_B16 -to exp_gpio[12]
set_location_assignment PIN_B17 -to exp_gpio[13]
set_location_assignment PIN_B18 -to exp_gpio[14]
set_location_assignment PIN_B19 -to exp_gpio[15]
set_location_assignment PIN_B20 -to exp_gpio[16]
set_location_assignment PIN_C13 -to exp_present
set_location_assignment PIN_D13 -to exp_spi_miso
set_location_assignment PIN_E12 -to exp_spi_clock

View file

@ -0,0 +1,345 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
library pll ;
library serial_pll ;
entity bladerf is
port (
-- Main 38.4MHz system clock
c4_clock : in std_logic ;
-- VCTCXO DAC
dac_sclk : out std_logic ;
dac_sdi : out std_logic ;
dac_sdo : in std_logic ;
dac_csx : out std_logic ;
-- LEDs
led : buffer std_logic_vector(2 downto 1) := (others =>'0') ;
-- LMS RX Interface
lms_rx_clock : buffer std_logic ;
lms_rx_clock_out : in std_logic ;
lms_rx_data : in signed(11 downto 0) ;
lms_rx_enable : out std_logic ;
lms_rx_iq_select : in std_logic := '0' ;
lms_rx_v : out std_logic_vector(2 downto 1) ;
-- LMS TX Interface
lms_tx_clock : out std_logic ;
lms_tx_data : out signed(11 downto 0) ;
lms_tx_enable : out std_logic ;
lms_tx_iq_select : buffer std_logic := '0' ;
lms_tx_v : out std_logic_vector(2 downto 1) ;
-- LMS SPI Interface
lms_sclk : buffer std_logic ;
lms_sen : out std_logic ;
lms_sdio : out std_logic ;
lms_sdo : in std_logic ;
-- LMS Control Interface
lms_pll_out : in std_logic ;
lms_reset : buffer std_logic ;
-- FX3 Interface
fx3_pclk : in std_logic ;
fx3_gpif : inout std_logic_vector(31 downto 0) ;
fx3_ctl : inout std_logic_vector(12 downto 0) ;
fx3_uart_rxd : out std_logic ;
fx3_uart_txd : in std_logic ;
fx3_uart_csx : in std_logic ;
-- 1pps reference
refexp_1pps : in std_logic ;
-- Expansion Interface
exp_clock : out std_logic ;
exp_present : in std_logic ;
exp_spi_clock : out std_logic ;
exp_spi_miso : in std_logic ;
exp_spi_mosi : out std_logic ;
exp_gpio : inout std_logic_vector(16 downto 1)
) ;
end entity ; -- bladerf
architecture arch of bladerf is
component nios_system is
port (
clk_clk : in std_logic := 'X'; -- clk
reset_reset_n : in std_logic := 'X'; -- reset_n
dac_MISO : in std_logic := 'X'; -- MISO
dac_MOSI : out std_logic; -- MOSI
dac_SCLK : out std_logic; -- SCLK
dac_SS_n : out std_logic; -- SS_n
spi_MISO : in std_logic := 'X'; -- MISO
spi_MOSI : out std_logic; -- MOSI
spi_SCLK : out std_logic; -- SCLK
spi_SS_n : out std_logic; -- SS_n
uart_rxd : in std_logic;
uart_txd : out std_logic
);
end component nios_system;
signal ramp_out : signed(11 downto 0) ;
signal \38.4MHz\ : std_logic ;
signal \76.8MHz\ : std_logic ;
signal \76.8MHz@90\ : std_logic ;
signal rs232_clock : std_logic ;
signal rs232_locked : std_logic ;
signal sfifo_din : std_logic_vector(7 downto 0) ;
signal sfifo_dout : std_logic_vector(7 downto 0) ;
signal sfifo_full : std_logic ;
signal sfifo_empty : std_logic ;
signal sfifo_re : std_logic ;
signal sfifo_we : std_logic ;
attribute noprune : boolean ;
signal rx_i : signed(11 downto 0) ;
signal rx_q : signed(11 downto 0) ;
attribute noprune of rx_i : signal is true ;
attribute noprune of rx_q : signal is true ;
signal fsk_real : signed(15 downto 0) ;
signal fsk_imag : signed(15 downto 0) ;
signal fsk_valid : std_logic ;
attribute noprune of fsk_real : signal is true ;
attribute noprune of fsk_imag : signal is true ;
signal nios_uart_txd : std_logic ;
signal nios_uart_rxd : std_logic ;
attribute noprune of nios_uart_txd : signal is true ;
attribute noprune of nios_uart_rxd : signal is true ;
signal demod_in_i : signed(15 downto 0) ;
signal demod_in_q : signed(15 downto 0) ;
signal demod_ssd : signed(15 downto 0) ;
signal demod_valid : std_logic ;
signal qualifier : unsigned(5 downto 0) := (others =>'0') ;
attribute noprune of qualifier : signal is true ;
begin
qualifier <= qualifier + 1 when rising_edge(\38.4MHz\) ;
rx_i <= lms_rx_data when rising_edge(lms_rx_clock_out) and lms_rx_iq_select = '1' ;
rx_q <= lms_rx_data when rising_edge(lms_rx_clock_out) and lms_rx_iq_select = '0' ;
U_pll : entity pll.pll
port map (
inclk0 => c4_clock,
c0 => \76.8MHz\,
c1 => \38.4MHz\,
c2 => \76.8MHz@90\,
locked => open
) ;
U_serial_pll : entity serial_pll.serial_pll
port map (
inclk0 => c4_clock,
c0 => rs232_clock,
locked => rs232_locked
) ;
-- U_uart_bridge : entity work.uart_bridge
-- port map (
-- uart_clock
-- uart_reset
-- uart_enable
-- uart_rxd
-- uart_txd
-- ) ;
-- U_uart : entity work.uart
-- port map (
-- clock => rs232_clock,
-- reset => not(rs232_locked),
-- enable => not(fx3_uart_csx),
-- rs232_rxd => fx3_uart_rxd,
-- rs232_txd => fx3_uart_txd,
-- txd_we => sfifo_we,
-- txd_full => sfifo_full,
-- txd_data => sfifo_din,
-- rxd_re => sfifo_re,
-- rxd_empty => sfifo_empty,
-- rxd_data => sfifo_dout
-- ) ;
-- U_sfifo : entity work.sync_fifo
-- generic map (
-- DEPTH => 32,
-- WIDTH => sfifo_din'length,
-- READ_AHEAD => true
-- ) port map (
-- areset => not(rs232_locked),
-- clock => rs232_clock,
-- full => sfifo_full,
-- empty => sfifo_empty,
-- used_words => open,
-- data_in => sfifo_din,
-- write_en => sfifo_we,
-- data_out => sfifo_dout,
-- read_en => sfifo_re
-- ) ;
U_nios_system : nios_system
port map (
clk_clk => c4_clock,
reset_reset_n => '1',
dac_MISO => dac_sdo,
dac_MOSI => dac_sdi,
dac_SCLK => dac_sclk,
dac_SS_n => dac_csx,
spi_MISO => lms_sdo,
spi_MOSI => lms_sdio,
spi_SCLK => lms_sclk,
spi_SS_n => lms_sen,
uart_rxd => nios_uart_rxd,
uart_txd => nios_uart_txd
) ;
-- U_spi_reader : entity work.spi_reader
-- port map (
-- clock => c4_clock,
-- sclk => lms_sclk,
-- miso => lms_sdo,
-- mosi => lms_sdio,
-- enx => lms_sen,
-- reset_out => lms_reset
-- ) ;
U_fsk_modulator : entity work.fsk_modulator
port map (
clock => \38.4MHz\,
reset => '0',
symbol => nios_uart_txd,
symbol_valid => '1',
out_real => fsk_real,
out_imag => fsk_imag,
out_valid => fsk_valid
) ;
demod_in_i <= resize(rx_i,demod_in_i'length) when rising_edge(lms_rx_clock_out) and lms_rx_iq_select = '1' ;
demod_in_q <= resize(rx_q,demod_in_q'length) when rising_edge(lms_rx_clock_out) and lms_rx_iq_Select = '1' ;
U_fsk_demodulator : entity work.fsk_demodulator
port map (
clock => lms_rx_clock_out,
reset => '0',
in_real => resize(rx_i,16),
in_imag => resize(rx_q,16),
in_valid => lms_rx_iq_select,
out_ssd => demod_ssd,
out_valid => demod_valid
) ;
nios_uart_rxd <= demod_ssd(demod_ssd'high) when demod_valid = '1' ;
toggle_led1 : process(lms_rx_clock_out)
variable count : natural range 0 to 38_400_00 := 38_400_00 ;
begin
if( rising_edge(lms_rx_clock_out) ) then
count := count - 1 ;
if( count = 0 ) then
count := 38_400_00 ;
led(1) <= not led(1) ;
end if ;
end if ;
end process ;
toggle_led2 : process(c4_clock)
variable count : natural range 0 to 3_840_000 := 3_840_000 ;
begin
if( rising_edge(c4_clock) ) then
count := count - 1;
if( count = 0 ) then
count := 3_840_000 ;
led(2) <= not led(2) ;
end if ;
end if ;
end process ;
-- -- Digital loopback FX3
-- U_fx3 : entity work.fx3(digital_loopback)
-- port map (
-- pclk => fx3_pclk,
-- gpif => fx3_gpif,
-- ctl => fx3_ctl,
-- rxd => fx3_uart_rxd,
-- txd => fx3_uart_txd,
-- csx => fx3_uart_csx
-- ) ;
-- Outputs
-- dac_sclk <= '0' ;
-- dac_sdo <= '0' ;
-- dac_csx <= '0' ;
lms_reset <= '1' ;
lms_rx_clock <= \76.8MHz\ ;
lms_rx_enable <= '1' ;
lms_tx_clock <= \76.8MHz\ ;
lms_tx_enable <= '1' ;
lms_tx_iq_select <= not lms_tx_iq_select when rising_edge(\76.8MHz\) ;
assign_data : process(\76.8MHz\)
begin
if( rising_edge(\76.8MHz\) ) then
if( lms_tx_iq_select = '1' ) then
lms_tx_data <= resize(shift_right(fsk_real,0),lms_tx_data'length) ;
else
lms_tx_data <= resize(shift_right(fsk_imag,0),lms_tx_data'length) ;
end if ;
end if ;
end process ;
U_ramp : entity work.ramp
port map (
clock => c4_clock,
reset => '0',
ramp_out => ramp_out
) ;
--lms_sclk <= '0' ;
--lms_sen <= '0' ;
--lms_sdo <= '0' ;
lms_tx_v <= "10" ;
lms_rx_v <= "10" ;
fx3_gpif <= (others =>'Z') ;
fx3_ctl <= (others =>'Z') ;
-- fx3_uart_rxd <= fx3_uart_txd ;
exp_clock <= '0' ;
exp_spi_clock <= '0' ;
exp_spi_mosi <= '0' ;
exp_gpio <= (others =>'Z') ;
end architecture ; -- arch

View file

@ -0,0 +1,11 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
package bladerf_debug_p is
-- Debug signals
end package ;

View file

@ -0,0 +1,135 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
library nuand ;
entity fx3 is
port (
-- FX3 GPIF
pclk : in std_logic ;
gpif : inout std_logic_vector(31 downto 0) ;
ctl : inout std_logic_vector(12 downto 0) ;
-- FX3 UART
rxd : out std_logic ;
txd : in std_logic ;
csx : in std_logic ;
-- USB RX'd data output side
usb_data_rx : out std_logic_vector(31 downto 0) ;
usb_data_rx_we : out std_logic ;
usb_data_rx_clear : out std_logic ;
-- USB TX data input
usb_data_tx : in std_logic_vector(31 downto 0) := (others =>'0') ;
usb_data_tx_empty : in std_logic := '1' ;
usb_data_tx_re : out std_logic ;
usb_data_tx_clear : out std_logic ;
-- UART RX'd data output side
uart_data_rx : out std_logic_vector(7 downto 0) ;
uart_data_rx_we : out std_logic ;
-- UART TX data input
uart_data_tx : in std_logic_vector(7 downto 0) := (others =>'0') ;
uart_data_tx_re : out std_logic ;
uart_data_tx_empty : in std_logic := '1'
) ;
end entity ; -- fx3
architecture digital_loopback of fx3 is
alias rxd_samples_request is ctl(0) ;
alias rxd_samples_acknowledge is ctl(1) ;
alias rxd_samples_we is ctl(2) ;
alias txd_samples_we is ctl(3) ;
alias gpif_reset is ctl(4) ;
alias unused_ctl is ctl(12 downto 5) ;
constant FIFO_DEPTH : positive := 1024 ;
signal rxd_samples : std_logic_vector(gpif'range) ;
signal fifo_used : natural range 0 to FIFO_DEPTH ;
signal fifo_full : std_logic ;
signal fifo_empty : std_logic ;
signal fifo_read_en : std_logic ;
begin
-- USB data goes nowhere
usb_data_rx <= (others =>'0') ;
usb_data_rx_we <= '0' ;
usb_data_rx_clear <= '1' ;
usb_data_tx_re <= '0' ;
usb_data_tx_clear <= '1' ;
-- UART loopback
rxd <= txd when csx = '0' else '0' ;
uart_data_rx <= (others =>'0') ;
uart_data_rx_we <= '0' ;
uart_data_tx_re <= '0' ;
-- Set the unused control lines to something
unused_ctl <= (others =>'0') ;
-- Only drive the GPIF when we've gotten an acknowledgement from the FX3 saying we have the bus
gpif <= rxd_samples when rxd_samples_acknowledge = '1'
else (others =>'Z') ;
-- Control signals that the FX3 drives
rxd_samples_acknowledge <= 'Z' ;
txd_samples_we <= 'Z' ;
rxd_samples_we <= '0' when gpif_reset = '1' else
rxd_samples_acknowledge when rising_edge(pclk) ;
fifo_read_en <= '0' ;
request_generator : process(all)
begin
if( fifo_used = 0 ) then
rxd_samples_request <= '0' ;
elsif( fifo_used > 128 ) then
if( rxd_samples_request = '0' ) then
rxd_samples_request <= '1' ;
else
if( fifo_used = 1 ) then
rxd_samples_request <= '0' ;
else
rxd_samples_request <= '1' ;
end if ;
end if ;
else
if( rxd_samples_request = '1' ) then
if( fifo_used = 0 ) then
rxd_samples_request <= '0' ;
end if ;
end if ;
end if ;
end process ;
-- Synchronous FIFO for loopback
U_fifo : entity nuand.sync_fifo
generic map (
DEPTH => FIFO_DEPTH,
WIDTH => gpif'length,
READ_AHEAD => true
) port map (
areset => gpif_reset,
clock => pclk,
used_words => fifo_used,
full => fifo_full,
empty => fifo_empty,
data_in => gpif,
write_en => txd_samples_we,
data_out => rxd_samples,
read_en => rxd_samples_acknowledge
) ;
end architecture ; -- digital_loopback
architecture inband_scheduler of fx3 is
begin
end architecture ; -- inband_scheduler

View file

@ -0,0 +1,28 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity ramp is
port (
clock : in std_logic ;
reset : in std_logic ;
ramp_out : buffer signed(11 downto 0)
) ;
end entity ;
architecture arch of ramp is
begin
count : process(clock, reset)
begin
if( reset = '1' ) then
ramp_out <= (others =>'0') ;
elsif( rising_edge(clock) ) then
ramp_out <= ramp_out + 1 ;
end if ;
end process ;
end architecture ;

View file

@ -0,0 +1,115 @@
library ieee;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity spi_reader is
port (
clock : in std_logic ;
sclk : out std_logic ;
miso : in std_logic ;
mosi : out std_logic ;
enx : out std_logic ;
reset_out : out std_logic
) ;
end entity ;
architecture arch of spi_reader is
constant RESET_CYCLES : natural := 1000 ;
constant ENX_WAIT_CYCLES : natural := 10 ;
constant WRITE_BIT_COUNT : natural := 7 ;
constant READ_BIT_COUNT : natural := 8 ;
constant TOTAL_BIT_COUNT : natural := WRITE_BIT_COUNT + READ_BIT_COUNT ;
type command_t is (COMMAND_READ, COMMAND_WRITE) ;
type fsm_t is (RESET, WAITING, FALLING_SCLK, RISING_SCLK) ;
signal fsm : fsm_t ;
constant command : command_t := COMMAND_READ ;
signal spi_address : unsigned(6 downto 0) := (others =>'0') ;
begin
reader : process(all)
variable count : natural range 0 to 1000 := 0 ;
variable address : unsigned(6 downto 0) := (others =>'0') ;
variable wdata : unsigned(7 downto 0) ;
variable rdata : unsigned(7 downto 0) ;
begin
if( rising_edge(clock) ) then
enx <= '0' ;
reset_out <= '1' ;
case fsm is
when RESET =>
reset_out <= '0' ;
spi_address <= (others =>'0') ;
if( count = 0 ) then
fsm <= WAITING ;
count := ENX_WAIT_CYCLES ;
else
count := count - 1 ;
end if ;
when WAITING =>
sclk <= '1' ;
enx <= '1' ;
if( spi_address = 127 ) then
spi_address <= (others =>'0') ;
fsm <= RESET ;
count := RESET_CYCLES ;
end if ;
if( count = 0 ) then
count := TOTAL_BIT_COUNT ;
fsm <= FALLING_SCLK ;
address := spi_address ;
spi_address <= spi_address + 1;
else
count := count - 1 ;
end if ;
when FALLING_SCLK =>
sclk <= '0' ;
fsm <= RISING_SCLK ;
if( command = COMMAND_READ ) then
if( count = TOTAL_BIT_COUNT ) then
mosi <= '0' ;
elsif( count < TOTAL_BIT_COUNT - WRITE_BIT_COUNT ) then
mosi <= '0' ;
else
mosi <= address(address'high) ;
address := shift_left(address,1) ;
end if ;
else
if( count = TOTAL_BIT_COUNT ) then
mosi <= '1' ;
elsif( count < TOTAL_BIT_COUNT - WRITE_BIT_COUNT ) then
mosi <= wdata(wdata'high) ;
wdata := shift_left(wdata,1) ;
else
mosi <= address(address'high) ;
address := shift_left(address,1) ;
end if ;
end if ;
when RISING_SCLK =>
sclk <= '1' ;
if( command = COMMAND_READ ) then
if( count < TOTAL_BIT_COUNT - WRITE_BIT_COUNT ) then
rdata := rdata(rdata'high-1 downto 0) & miso ;
end if ;
end if ;
if( count = 0 ) then
fsm <= WAITING ;
count := ENX_WAIT_CYCLES ;
else
count := count - 1 ;
fsm <= FALLING_SCLK ;
end if ;
end case ;
end if ;
end process ;
end architecture ;

View file

@ -0,0 +1,208 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
use ieee.math_real.all ;
use ieee.math_complex.all ;
library nuand ;
entity bladerf_tb is
end entity ; -- bladerf_tb
architecture arch of bladerf_tb is
constant C4_CLOCK_HALF_PERIOD : time := 1 sec * (1.0/38.4e6/2.0) ;
type lms_rx_t is record
clock : std_logic ;
clock_out : std_logic ;
data : signed(11 downto 0) ;
enable : std_logic ;
iq_select : std_logic ;
end record ;
type lms_tx_t is record
clock : std_logic ;
data : signed(11 downto 0) ;
enable : std_logic ;
iq_select : std_logic ;
end record ;
type lms_spi_t is record
sclk : std_logic ;
sen : std_logic ;
sdio : std_logic ;
sdo : std_logic ;
end record ;
type fx3_gpif_t is record
pclk : std_logic ;
gpif : std_logic_vector(31 downto 0) ;
ctl : std_logic_vector(12 downto 0) ;
end record ;
type fx3_uart_t is record
rxd : std_logic ;
txd : std_logic ;
csx : std_logic ;
end record ;
procedure nop( signal clock : in std_logic ; count : in natural ) is
begin
for i in 1 to count loop
wait until rising_edge(clock) ;
end loop ;
end procedure ;
procedure uart_send( signal clock : in std_logic ; signal txd : out std_logic ; data : in std_logic_vector(7 downto 0) ; cpb : in natural ) is
begin
wait until rising_edge(clock) ;
-- Send start bit
txd <= '0' ;
nop( clock, cpb ) ;
-- Send data
for i in 0 to data'high loop
txd <= data(i) ;
nop( clock, cpb ) ;
end loop ;
-- Send stop bit
txd <= '1' ;
nop( clock, cpb ) ;
end procedure ;
signal c4_clock : std_logic := '1' ;
signal lms_rx : lms_rx_t ;
signal lms_tx : lms_tx_t ;
signal lms_spi : lms_spi_t ;
signal lms_pll_out : std_logic ;
signal lms_reset : std_logic ;
signal fx3_gpif : fx3_gpif_t ;
signal fx3_uart : fx3_uart_t ;
signal refexp_1pps : std_logic ;
begin
-- Main 38.4MHz clock input
c4_clock <= not c4_clock after C4_CLOCK_HALF_PERIOD ;
-- Top level of the FPGA
U_bladerf : entity nuand.bladerf
port map (
-- Main system clock
c4_clock => c4_clock,
-- VCTCXO DAC
dac_sclk => open,
dac_sdi => '0',
dac_sdo => open,
dac_csx => open,
-- LMS RX Interface
lms_rx_clock => lms_rx.clock,
lms_rx_clock_out => lms_rx.clock_out,
lms_rx_data => lms_rx.data,
lms_rx_enable => lms_rx.enable,
lms_rx_iq_select => lms_rx.iq_select,
-- LMS TX Interface
lms_tx_clock => lms_tx.clock,
lms_tx_data => lms_tx.data,
lms_tx_enable => lms_tx.enable,
lms_tx_iq_select => lms_tx.iq_select,
-- LMS SPI Interface
lms_sclk => lms_spi.sclk,
lms_sen => lms_spi.sen,
lms_sdio => lms_spi.sdio,
lms_sdo => lms_spi.sdo,
-- LMS Control Interface
lms_pll_out => lms_pll_out,
lms_reset => lms_reset,
-- FX3 Interface
fx3_pclk => fx3_gpif.pclk,
fx3_gpif => fx3_gpif.gpif,
fx3_ctl => fx3_gpif.ctl,
fx3_uart_rxd => fx3_uart.rxd,
fx3_uart_txd => fx3_uart.txd,
fx3_uart_csx => fx3_uart.csx,
-- 1pps reference
refexp_1pps => refexp_1pps,
-- Expansion Interface
exp_clock => open,
exp_present => '0',
exp_spi_clock => open,
exp_spi_miso => '0',
exp_spi_mosi => open,
exp_gpio => open
) ;
-- LMS6002D Model
U_lms6002d : entity nuand.lms6002d_model
port map (
-- LMS RX Interface
lms_rx_clock => lms_rx.clock,
lms_rx_clock_out => lms_rx.clock_out,
lms_rx_data => lms_rx.data,
lms_rx_enable => lms_rx.enable,
lms_rx_iq_select => lms_rx.iq_select,
-- LMS TX Interface
lms_tx_clock => lms_tx.clock,
lms_tx_data => lms_tx.data,
lms_tx_enable => lms_tx.enable,
lms_tx_iq_select => lms_tx.iq_select,
-- LMS SPI Interface
lms_sclk => lms_spi.sclk,
lms_sen => lms_spi.sen,
lms_sdio => lms_spi.sdio,
lms_sdo => lms_spi.sdo,
-- LMS Control Interface
lms_pll_out => lms_pll_out,
lms_reset => lms_reset
) ;
-- FX3 Model
U_fx3 : entity nuand.fx3_model(digital_loopback)
port map (
-- GPIF
fx3_pclk => fx3_gpif.pclk,
fx3_gpif => fx3_gpif.gpif,
fx3_ctl => fx3_gpif.ctl,
-- UART
fx3_uart_rxd => fx3_uart.rxd,
fx3_uart_txd => fx3_uart.txd,
fx3_uart_csx => fx3_uart.csx
) ;
-- Create an accurate 1pps signal that is 1 ms wide
create_1pps : process
constant PULSE_PERIOD : time := 1 sec ;
constant PULSE_WIDTH : time := 1 ms ;
begin
if( now = 0 ps ) then
refexp_1pps <= '0' ;
else
refexp_1pps <= '1' ;
end if ;
wait for PULSE_WIDTH ;
refexp_1pps <= '0' ;
wait for PULSE_PERIOD - PULSE_WIDTH ;
end process ;
-- Stimulus
tb : process
begin
wait for 10 ms ;
report "-- End of simulation --" severity failure ;
end process ;
end architecture ; -- arch

View file

@ -0,0 +1,32 @@
library ieee ;
use ieee.std_logic_1164.all ;
use ieee.numeric_std.all ;
entity spi_reader_tb is
end entity ;
architecture arch of spi_reader_tb is
signal clock : std_logic := '1' ;
signal sclk : std_logic ;
signal miso : std_logic := '0' ;
signal mosi : std_logic ;
signal enx : std_logic ;
signal reset_out : std_logic ;
begin
clock <= not clock after 1 ns ;
U_spi_reader : entity work.spi_reader
port map (
clock => clock,
sclk => sclk,
miso => miso,
mosi => mosi,
enx => enx,
reset_out => reset_out
) ;
end architecture ;

30
hdl/quartus/bladerf.qpf Normal file
View file

@ -0,0 +1,30 @@
# -------------------------------------------------------------------------- #
#
# Copyright (C) 1991-2012 Altera Corporation
# Your use of Altera Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
# to the terms and conditions of the Altera Program License
# Subscription Agreement, Altera MegaCore Function License
# Agreement, or other applicable license agreement, including,
# without limitation, that your use is for the sole purpose of
# programming logic devices manufactured by Altera and sold by
# Altera or its authorized distributors. Please refer to the
# applicable agreement for further details.
#
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 12.1 Build 177 11/07/2012 SJ Web Edition
# Date created = 00:17:06 November 24, 2012
#
# -------------------------------------------------------------------------- #
QUARTUS_VERSION = "12.1"
DATE = "00:17:06 November 24, 2012"
# Revisions
PROJECT_REVISION = "bladerf"

501
hdl/quartus/bladerf.qsf Normal file
View file

@ -0,0 +1,501 @@
# -------------------------------------------------------------------------- #
#
# Copyright (C) 1991-2012 Altera Corporation
# Your use of Altera Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
# to the terms and conditions of the Altera Program License
# Subscription Agreement, Altera MegaCore Function License
# Agreement, or other applicable license agreement, including,
# without limitation, that your use is for the sole purpose of
# programming logic devices manufactured by Altera and sold by
# Altera or its authorized distributors. Please refer to the
# applicable agreement for further details.
#
# -------------------------------------------------------------------------- #
#
# Quartus II 64-Bit
# Version 12.1 Build 177 11/07/2012 SJ Web Edition
# Date created = 00:17:06 November 24, 2012
#
# -------------------------------------------------------------------------- #
#
# Notes:
#
# 1) The default values for assignments are stored in the file:
# bladerf_assignment_defaults.qdf
# If this file doesn't exist, see file:
# assignment_defaults.qdf
#
# 2) Altera recommends that you do not modify this file. This
# file is updated automatically by the Quartus II software
# and any changes you make may be lost or overwritten.
#
# -------------------------------------------------------------------------- #
set_global_assignment -name FAMILY "Cyclone IV E"
set_global_assignment -name DEVICE EP4CE15F23C6
set_global_assignment -name TOP_LEVEL_ENTITY bladerf
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 12.1
set_global_assignment -name PROJECT_CREATION_TIME_DATE "00:17:06 NOVEMBER 24, 2012"
set_global_assignment -name LAST_QUARTUS_VERSION "12.1 SP1"
set_global_assignment -name SEARCH_PATH nuand
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name DEVICE_FILTER_PACKAGE FBGA
set_global_assignment -name DEVICE_FILTER_PIN_COUNT 484
set_global_assignment -name EDA_SIMULATION_TOOL "ModelSim-Altera (VHDL)"
set_global_assignment -name EDA_OUTPUT_DATA_FORMAT VHDL -section_id eda_simulation
set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
set_global_assignment -name PARTITION_FITTER_PRESERVATION_LEVEL PLACEMENT_AND_ROUTING -section_id Top
set_global_assignment -name PARTITION_COLOR 16764057 -section_id Top
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to c4_clock
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to dac_csx
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to dac_sclk
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to dac_sdi
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to dac_sdo
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to refexp_1pps
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_clock
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[16]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[15]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[14]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[13]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[12]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[11]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[10]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[9]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[8]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[7]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[6]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[5]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[4]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[3]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_gpio[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_present
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_spi_clock
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_spi_miso
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to exp_spi_mosi
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[12]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[11]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[10]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[9]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[8]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[7]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[6]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[5]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[4]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[3]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_ctl[0]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[31]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[30]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[29]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[28]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[27]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[26]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[25]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[24]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[23]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[22]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[21]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[20]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[19]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[18]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[17]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[16]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[15]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[14]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[13]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[12]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[11]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[10]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[9]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[8]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[7]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[6]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[5]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[4]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[3]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_gpif[0]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_uart_csx
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_uart_rxd
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_uart_txd
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_pll_out
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_reset
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_clock
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_clock_out
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[11]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[10]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[9]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[8]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[7]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[6]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[5]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[4]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[3]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_data[0]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_enable
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_iq_select
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_sclk
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_sdio
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_sdo
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_sen
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_clock
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[11]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[10]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[9]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[8]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[7]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[6]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[5]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[4]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[3]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_data[0]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_enable
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_iq_select
set_location_assignment PIN_A11 -to c4_clock
set_location_assignment PIN_B10 -to dac_csx
set_location_assignment PIN_B9 -to dac_sclk
set_location_assignment PIN_A10 -to dac_sdi
set_location_assignment PIN_A9 -to dac_sdo
set_location_assignment PIN_M1 -to fx3_ctl[12]
set_location_assignment PIN_J4 -to fx3_ctl[11]
set_location_assignment PIN_J6 -to fx3_ctl[10]
set_location_assignment PIN_K2 -to fx3_ctl[9]
set_location_assignment PIN_N1 -to fx3_ctl[8]
set_location_assignment PIN_G3 -to fx3_ctl[7]
set_location_assignment PIN_F7 -to fx3_ctl[6]
set_location_assignment PIN_B1 -to fx3_ctl[5]
set_location_assignment PIN_C1 -to fx3_ctl[4]
set_location_assignment PIN_H1 -to fx3_ctl[3]
set_location_assignment PIN_H6 -to fx3_ctl[2]
set_location_assignment PIN_F2 -to fx3_ctl[1]
set_location_assignment PIN_F1 -to fx3_ctl[0]
set_location_assignment PIN_AA1 -to fx3_gpif[31]
set_location_assignment PIN_Y1 -to fx3_gpif[30]
set_location_assignment PIN_AB3 -to fx3_gpif[29]
set_location_assignment PIN_P1 -to fx3_gpif[28]
set_location_assignment PIN_W7 -to fx3_gpif[27]
set_location_assignment PIN_R2 -to fx3_gpif[26]
set_location_assignment PIN_W6 -to fx3_gpif[25]
set_location_assignment PIN_W1 -to fx3_gpif[24]
set_location_assignment PIN_R1 -to fx3_gpif[23]
set_location_assignment PIN_V5 -to fx3_gpif[22]
set_location_assignment PIN_T4 -to fx3_gpif[21]
set_location_assignment PIN_M4 -to fx3_gpif[20]
set_location_assignment PIN_T5 -to fx3_gpif[19]
set_location_assignment PIN_P4 -to fx3_gpif[18]
set_location_assignment PIN_M6 -to fx3_gpif[17]
set_location_assignment PIN_N6 -to fx3_gpif[16]
set_location_assignment PIN_D1 -to fx3_gpif[15]
set_location_assignment PIN_C8 -to fx3_gpif[14]
set_location_assignment PIN_C7 -to fx3_gpif[13]
set_location_assignment PIN_C4 -to fx3_gpif[12]
set_location_assignment PIN_C6 -to fx3_gpif[11]
set_location_assignment PIN_B3 -to fx3_gpif[10]
set_location_assignment PIN_F10 -to fx3_gpif[9]
set_location_assignment PIN_B4 -to fx3_gpif[8]
set_location_assignment PIN_K1 -to fx3_gpif[7]
set_location_assignment PIN_A8 -to fx3_gpif[6]
set_location_assignment PIN_A3 -to fx3_gpif[5]
set_location_assignment PIN_F8 -to fx3_gpif[4]
set_location_assignment PIN_A5 -to fx3_gpif[3]
set_location_assignment PIN_B8 -to fx3_gpif[2]
set_location_assignment PIN_B7 -to fx3_gpif[1]
set_location_assignment PIN_B6 -to fx3_gpif[0]
set_location_assignment PIN_AA4 -to fx3_uart_csx
set_location_assignment PIN_AA5 -to fx3_uart_rxd
set_location_assignment PIN_AA3 -to fx3_uart_txd
set_location_assignment PIN_T21 -to lms_pll_out
set_location_assignment PIN_K21 -to lms_rx_clock
set_location_assignment PIN_T22 -to lms_rx_clock_out
set_location_assignment PIN_B22 -to lms_rx_data[11]
set_location_assignment PIN_B21 -to lms_rx_data[10]
set_location_assignment PIN_C22 -to lms_rx_data[9]
set_location_assignment PIN_C21 -to lms_rx_data[8]
set_location_assignment PIN_D22 -to lms_rx_data[7]
set_location_assignment PIN_E21 -to lms_rx_data[6]
set_location_assignment PIN_D21 -to lms_rx_data[5]
set_location_assignment PIN_F21 -to lms_rx_data[4]
set_location_assignment PIN_E22 -to lms_rx_data[3]
set_location_assignment PIN_H21 -to lms_rx_data[2]
set_location_assignment PIN_F22 -to lms_rx_data[1]
set_location_assignment PIN_J21 -to lms_rx_data[0]
set_location_assignment PIN_H22 -to lms_rx_iq_select
set_location_assignment PIN_L21 -to lms_tx_clock
set_location_assignment PIN_U21 -to lms_tx_data[11]
set_location_assignment PIN_P22 -to lms_tx_data[10]
set_location_assignment PIN_U22 -to lms_tx_data[9]
set_location_assignment PIN_R21 -to lms_tx_data[8]
set_location_assignment PIN_N22 -to lms_tx_data[7]
set_location_assignment PIN_R22 -to lms_tx_data[6]
set_location_assignment PIN_M22 -to lms_tx_data[5]
set_location_assignment PIN_P21 -to lms_tx_data[4]
set_location_assignment PIN_L22 -to lms_tx_data[3]
set_location_assignment PIN_N21 -to lms_tx_data[2]
set_location_assignment PIN_K22 -to lms_tx_data[1]
set_location_assignment PIN_M21 -to lms_tx_data[0]
set_global_assignment -name CYCLONEIII_CONFIGURATION_SCHEME "ACTIVE PARALLEL"
set_global_assignment -name USE_CONFIGURATION_DEVICE OFF
set_global_assignment -name GENERATE_TTF_FILE ON
set_global_assignment -name GENERATE_RBF_FILE ON
set_global_assignment -name CRC_ERROR_OPEN_DRAIN OFF
set_global_assignment -name ON_CHIP_BITSTREAM_DECOMPRESSION OFF
set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -rise
set_global_assignment -name OUTPUT_IO_TIMING_NEAR_END_VMEAS "HALF VCCIO" -fall
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -rise
set_global_assignment -name OUTPUT_IO_TIMING_FAR_END_VMEAS "HALF SIGNAL SWING" -fall
set_global_assignment -name RESERVE_DATA0_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA1_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DATA7_THROUGH_DATA2_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_FLASH_NCE_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_OTHER_AP_PINS_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name CYCLONEII_RESERVE_NCEO_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_global_assignment -name RESERVE_DCLK_AFTER_CONFIGURATION "USE AS REGULAR IO"
set_location_assignment PIN_AA13 -to lms_reset
set_location_assignment PIN_AA14 -to lms_rx_enable
set_location_assignment PIN_AA20 -to lms_tx_v[2]
set_location_assignment PIN_AB13 -to lms_sdio
set_location_assignment PIN_AB14 -to lms_sdo
set_location_assignment PIN_AB15 -to lms_tx_enable
set_location_assignment PIN_AB16 -to lms_sen
set_location_assignment PIN_AB19 -to lms_rx_v[2]
set_location_assignment PIN_AB20 -to lms_rx_v[1]
set_location_assignment PIN_J22 -to lms_tx_iq_select
set_location_assignment PIN_A13 -to exp_spi_mosi
set_location_assignment PIN_A14 -to exp_gpio[1]
set_location_assignment PIN_A15 -to exp_gpio[2]
set_location_assignment PIN_A16 -to exp_gpio[3]
set_location_assignment PIN_A17 -to exp_gpio[4]
set_location_assignment PIN_A18 -to exp_gpio[5]
set_location_assignment PIN_A19 -to exp_gpio[6]
set_location_assignment PIN_A20 -to exp_gpio[7]
set_location_assignment PIN_C19 -to exp_gpio[8]
set_location_assignment PIN_B13 -to exp_gpio[9]
set_location_assignment PIN_B14 -to exp_gpio[10]
set_location_assignment PIN_B15 -to exp_gpio[11]
set_location_assignment PIN_B16 -to exp_gpio[12]
set_location_assignment PIN_B17 -to exp_gpio[13]
set_location_assignment PIN_B18 -to exp_gpio[14]
set_location_assignment PIN_B19 -to exp_gpio[15]
set_location_assignment PIN_B20 -to exp_gpio[16]
set_location_assignment PIN_C13 -to exp_present
set_location_assignment PIN_G1 -to fx3_pclk
set_location_assignment PIN_AA15 -to lms_sclk
set_location_assignment PIN_D13 -to exp_spi_miso
set_location_assignment PIN_E12 -to exp_spi_clock
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to fx3_pclk
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to led[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to led[2]
set_location_assignment PIN_AA7 -to led[1]
set_location_assignment PIN_AB7 -to led[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_v[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_rx_v[1]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_v[2]
set_instance_assignment -name IO_STANDARD "3.3-V LVCMOS" -to lms_tx_v[1]
set_location_assignment PIN_AA21 -to lms_tx_v[1]
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
set_global_assignment -name ENABLE_SIGNALTAP ON
set_global_assignment -name USE_SIGNALTAP_FILE signaltap/spi_debugging.stp
set_global_assignment -name SLD_NODE_CREATOR_ID 110 -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_ENTITY_NAME sld_signaltap -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_INFO=805334528" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_POWER_UP_TRIGGER=0" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ATTRIBUTE_MEM_MODE=OFF" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_FLOW_USE_GENERATED=0" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STATE_BITS=11" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_BUFFER_FULL_STOP=1" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_CURRENT_RESOURCE_WIDTH=1" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL=1" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_IN_ENABLED=0" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ADVANCED_TRIGGER_ENTITY=basic,1," -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_LEVEL_PIPELINE=1" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_ENABLE_ADVANCED_TRIGGER=0" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_GAP_RECORD=1" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_MODE=COMBINATIONAL" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_ADVANCED_CONDITION_ENTITY=basic,1," -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_PIPELINE=1" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_ENABLE_ADVANCED_CONDITION=0" -section_id auto_signaltap_0
set_global_assignment -name STRATIX_DEVICE_IO_STANDARD "2.5 V"
set_global_assignment -name POWER_PRESET_COOLING_SOLUTION "23 MM HEAT SINK WITH 200 LFPM AIRFLOW"
set_global_assignment -name POWER_BOARD_THERMAL_MODEL "NONE (CONSERVATIVE)"
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SEGMENT_SIZE=2048" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_SAMPLE_DEPTH=2048" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_clk -to lms_rx_clock_out -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[0] -to dac_csx -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[1] -to dac_sclk -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[2] -to dac_sdi -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[3] -to dac_sdo -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[4] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[0]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[5] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[10]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[6] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[11]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[7] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[12]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[8] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[13]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[9] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[14]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[10] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[15]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[11] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[1]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[12] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[2]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[13] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[3]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[14] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[4]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[15] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[5]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[16] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[6]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[17] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[7]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[18] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[8]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[19] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[9]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[20] -to "nios_system:U_nios_system|uart_txd" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[21] -to qualifier[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[22] -to rx_i[0] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[23] -to rx_i[10] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[24] -to rx_i[11] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[25] -to rx_i[1] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[26] -to rx_i[2] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[27] -to rx_i[3] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[28] -to rx_i[4] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[29] -to rx_i[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[30] -to rx_i[6] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[31] -to rx_i[7] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[32] -to rx_i[8] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[33] -to rx_i[9] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[34] -to rx_q[0] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[35] -to rx_q[10] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[36] -to rx_q[11] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[37] -to rx_q[1] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[38] -to rx_q[2] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[39] -to rx_q[3] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[40] -to rx_q[4] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[41] -to rx_q[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[42] -to rx_q[6] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[43] -to rx_q[7] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[44] -to rx_q[8] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_trigger_in[45] -to rx_q[9] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[0] -to dac_csx -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[1] -to dac_sclk -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[2] -to dac_sdi -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[3] -to dac_sdo -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[4] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[0]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[5] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[10]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[6] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[11]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[7] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[12]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[8] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[13]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[9] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[14]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[10] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[15]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[11] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[1]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[12] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[2]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[13] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[3]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[14] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[4]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[15] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[5]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[16] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[6]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[17] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[7]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[18] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[8]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[19] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[9]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[20] -to "nios_system:U_nios_system|uart_txd" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[21] -to qualifier[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[22] -to rx_i[0] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[23] -to rx_i[10] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[24] -to rx_i[11] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[25] -to rx_i[1] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[26] -to rx_i[2] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[27] -to rx_i[3] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[28] -to rx_i[4] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[29] -to rx_i[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[30] -to rx_i[6] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[31] -to rx_i[7] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[32] -to rx_i[8] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[33] -to rx_i[9] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[34] -to rx_q[0] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[35] -to rx_q[10] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[36] -to rx_q[11] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[37] -to rx_q[1] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[38] -to rx_q[2] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[39] -to rx_q[3] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[40] -to rx_q[4] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[41] -to rx_q[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[42] -to rx_q[6] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[43] -to rx_q[7] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[44] -to rx_q[8] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_data_in[45] -to rx_q[9] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[0] -to dac_csx -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[1] -to dac_sclk -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[2] -to dac_sdi -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[3] -to dac_sdo -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[4] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[0]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[5] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[10]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[6] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[11]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[7] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[12]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[8] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[13]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[9] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[14]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[10] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[15]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[11] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[1]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[12] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[2]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[13] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[3]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[14] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[4]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[15] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[5]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[16] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[6]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[17] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[7]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[18] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[8]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[19] -to "fsk_demodulator:U_fsk_demodulator|unwrapped_z[9]" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[20] -to "nios_system:U_nios_system|uart_txd" -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[21] -to qualifier[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[22] -to rx_i[0] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[23] -to rx_i[10] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[24] -to rx_i[11] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[25] -to rx_i[1] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[26] -to rx_i[2] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[27] -to rx_i[3] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[28] -to rx_i[4] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[29] -to rx_i[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[30] -to rx_i[6] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[31] -to rx_i[7] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[32] -to rx_i[8] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[33] -to rx_i[9] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[34] -to rx_q[0] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[35] -to rx_q[10] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[36] -to rx_q[11] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[37] -to rx_q[1] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[38] -to rx_q[2] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[39] -to rx_q[3] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[40] -to rx_q[4] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[41] -to rx_q[5] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[42] -to rx_q[6] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[43] -to rx_q[7] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[44] -to rx_q[8] -section_id auto_signaltap_0
set_instance_assignment -name CONNECT_TO_SLD_NODE_ENTITY_PORT acq_storage_qualifier_in[45] -to rx_q[9] -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_DATA_BITS=46" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_TRIGGER_BITS=46" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_BITS=46" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK=00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_INVERSION_MASK_LENGTH=302" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_STORAGE_QUALIFIER_INVERSION_MASK_LENGTH=139" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_CRC_LOWORD=20626" -section_id auto_signaltap_0
set_global_assignment -name SLD_NODE_PARAMETER_ASSIGNMENT "SLD_NODE_CRC_HIWORD=47504" -section_id auto_signaltap_0
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/nco.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/fsk_modulator.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/fsk_demodulator.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/cordic.vhd -hdl_version VHDL_2008
set_global_assignment -name VHDL_FILE ../fpga/platforms/bladerf/vhdl/ramp.vhd -hdl_version VHDL_2008
set_global_assignment -name SIGNALTAP_FILE signaltap/spi_debugging.stp
set_global_assignment -name VHDL_FILE ../fpga/platforms/bladerf/vhdl/spi_reader.vhd -hdl_version VHDL_2008
set_global_assignment -name SDC_FILE ../fpga/platforms/bladerf/constraints/bladerf.sdc
set_global_assignment -name VHDL_FILE ../fpga/platforms/bladerf/vhdl/fx3.vhd -hdl_version VHDL_2008 -library nuand
set_global_assignment -name VHDL_FILE ../fpga/platforms/bladerf/vhdl/bladerf_debug_p.vhd -hdl_version VHDL_2008 -library nuand
set_global_assignment -name VHDL_FILE ../fpga/platforms/bladerf/vhdl/bladerf.vhd -hdl_version VHDL_2008 -library nuand
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/uart.vhd -hdl_version VHDL_2008 -library nuand
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/sync_fifo.vhd -hdl_version VHDL_2008 -library nuand
set_global_assignment -name VHDL_FILE ../fpga/ip/nuand/synthesis/constellation_mapper.vhd -hdl_version VHDL_2008 -library nuand
set_global_assignment -name QIP_FILE ../fpga/ip/altera/nios_system/software/lms_spi_controller/mem_init/meminit.qip
set_global_assignment -name QIP_FILE ../fpga/ip/altera/nios_system/nios_system/synthesis/nios_system.qip
set_global_assignment -name QIP_FILE ../fpga/ip/altera/pll/pll.qip
set_global_assignment -name QIP_FILE ../fpga/ip/altera/serial_pll/serial_pll.qip
set_global_assignment -name QIP_FILE ../fpga/ip/altera/gigemac/gigemac.qip
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View file

@ -0,0 +1,11 @@
# Clock inputs
create_clock -period "100.0 MHz" [get_ports fx3_pclk]
create_clock -period "38.4 MHz" [get_ports c4_clock]
# Generate the appropriate PLL clocks
derive_pll_clocks
dervice_clock_uncertainty
# TODO: Constrain the FX3 interface
# TODO: Constrain the LMS interface

View file

@ -0,0 +1,326 @@
# Copyright (C) 1991-2011 Altera Corporation
# Your use of Altera Corporation's design tools, logic functions
# and other software and tools, and its AMPP partner logic
# functions, and any output files from any of the foregoing
# (including device programming or simulation files), and any
# associated documentation or information are expressly subject
# to the terms and conditions of the Altera Program License
# Subscription Agreement, Altera MegaCore Function License
# Agreement, or other applicable license agreement, including,
# without limitation, that your use is for the sole purpose of
# programming logic devices manufactured by Altera and sold by
# Altera or its authorized distributors. Please refer to the
# applicable agreement for further details.
# Quartus II 32-bit Version 11.1 Build 173 11/01/2011 SJ Web Edition
# File: Z:\projects\nuand\quartus\constraints\pins.tcl
# Generated on: Tue Oct 09 23:04:36 2012
package require ::quartus::project
set_instance_assignment -name IO_STANDARD "1.8 V" -to c4_clock
set_instance_assignment -name IO_STANDARD "1.8 V" -to dac_csx
set_instance_assignment -name IO_STANDARD "1.8 V" -to dac_sclk
set_instance_assignment -name IO_STANDARD "1.8 V" -to dac_sdi
set_instance_assignment -name IO_STANDARD "1.8 V" -to dac_sdo
set_instance_assignment -name IO_STANDARD "1.8 V" -to refexp_1pps
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_clock
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[16]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[15]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[14]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[13]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[12]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_gpio[1]
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_present
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_spi_clock
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_spi_miso
set_instance_assignment -name IO_STANDARD "1.8 V" -to exp_spi_mosi
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[12]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[1]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_ctl[0]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[31]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[30]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[29]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[28]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[27]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[26]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[25]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[24]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[23]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[22]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[21]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[20]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[19]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[18]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[17]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[16]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[15]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[14]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[13]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[12]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[1]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_gpif[0]
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_uart_csx
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_uart_rxd
set_instance_assignment -name IO_STANDARD "1.8 V" -to fx3_uart_txd
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_pll_out
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_reset
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_clock
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_clock_out
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[1]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_data[0]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_enable
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_rx_iq_select
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_sclk
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_sdio
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_sdo
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_sen
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_clock
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[1]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_data[0]
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_enable
set_instance_assignment -name IO_STANDARD "1.8 V" -to lms_tx_iq_select
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to c4_clock
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to dac_csx
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to dac_sclk
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to dac_sdi
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to dac_sdo
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_clock
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[16]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[15]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[14]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[13]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[12]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[11]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[10]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[9]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[8]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[7]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[6]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[5]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[4]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[3]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[2]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_gpio[1]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_present
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_spi_clock
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_spi_miso
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to exp_spi_mosi
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[12]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[11]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[10]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[9]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[8]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[7]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[6]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[5]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[4]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[3]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[2]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[1]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_ctl[0]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[31]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[30]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[29]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[28]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[27]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[26]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[25]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[24]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[23]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[22]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[21]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[20]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[19]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[18]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[17]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[16]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[15]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[14]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[13]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[12]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[11]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[10]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[9]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[8]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[7]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[6]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[5]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[4]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[3]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[2]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[1]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_gpif[0]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_uart_csx
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_uart_rxd
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to fx3_uart_txd
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_pll_out
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_reset
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_clock
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_clock_out
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[11]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[10]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[9]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[8]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[7]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[6]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[5]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[4]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[3]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[2]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[1]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_data[0]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_enable
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_rx_iq_select
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_sclk
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_sdio
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_sdo
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_sen
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_clock
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[11]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[10]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[9]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[8]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[7]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[6]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[5]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[4]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[3]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[2]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[1]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_data[0]
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_enable
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to lms_tx_iq_select
set_instance_assignment -name CURRENT_STRENGTH_NEW 4MA -to refexp_1pps
set_location_assignment PIN_A11 -to c4_clock
set_location_assignment PIN_B10 -to dac_csx
set_location_assignment PIN_B9 -to dac_sclk
set_location_assignment PIN_A10 -to dac_sdi
set_location_assignment PIN_A9 -to dac_sdo
set_location_assignment PIN_M1 -to fx3_ctl[12]
set_location_assignment PIN_J4 -to fx3_ctl[11]
set_location_assignment PIN_J6 -to fx3_ctl[10]
set_location_assignment PIN_K2 -to fx3_ctl[9]
set_location_assignment PIN_N1 -to fx3_ctl[8]
set_location_assignment PIN_G3 -to fx3_ctl[7]
set_location_assignment PIN_F7 -to fx3_ctl[6]
set_location_assignment PIN_B1 -to fx3_ctl[5]
set_location_assignment PIN_C1 -to fx3_ctl[4]
set_location_assignment PIN_H1 -to fx3_ctl[3]
set_location_assignment PIN_H6 -to fx3_ctl[2]
set_location_assignment PIN_F2 -to fx3_ctl[1]
set_location_assignment PIN_F1 -to fx3_ctl[0]
set_location_assignment PIN_Y1 -to fx3_gpif[31]
set_location_assignment PIN_AA1 -to fx3_gpif[30]
set_location_assignment PIN_AB3 -to fx3_gpif[29]
set_location_assignment PIN_P1 -to fx3_gpif[28]
set_location_assignment PIN_W7 -to fx3_gpif[27]
set_location_assignment PIN_R2 -to fx3_gpif[26]
set_location_assignment PIN_W6 -to fx3_gpif[25]
set_location_assignment PIN_W1 -to fx3_gpif[24]
set_location_assignment PIN_R1 -to fx3_gpif[23]
set_location_assignment PIN_V5 -to fx3_gpif[22]
set_location_assignment PIN_T4 -to fx3_gpif[21]
set_location_assignment PIN_M4 -to fx3_gpif[20]
set_location_assignment PIN_T5 -to fx3_gpif[19]
set_location_assignment PIN_P4 -to fx3_gpif[18]
set_location_assignment PIN_M6 -to fx3_gpif[17]
set_location_assignment PIN_N6 -to fx3_gpif[16]
set_location_assignment PIN_D1 -to fx3_gpif[15]
set_location_assignment PIN_C8 -to fx3_gpif[14]
set_location_assignment PIN_C7 -to fx3_gpif[13]
set_location_assignment PIN_C4 -to fx3_gpif[12]
set_location_assignment PIN_C6 -to fx3_gpif[11]
set_location_assignment PIN_B3 -to fx3_gpif[10]
set_location_assignment PIN_F10 -to fx3_gpif[9]
set_location_assignment PIN_B4 -to fx3_gpif[8]
set_location_assignment PIN_K1 -to fx3_gpif[7]
set_location_assignment PIN_A8 -to fx3_gpif[6]
set_location_assignment PIN_A3 -to fx3_gpif[5]
set_location_assignment PIN_F8 -to fx3_gpif[4]
set_location_assignment PIN_A5 -to fx3_gpif[3]
set_location_assignment PIN_B8 -to fx3_gpif[2]
set_location_assignment PIN_B7 -to fx3_gpif[1]
set_location_assignment PIN_B6 -to fx3_gpif[0]
set_location_assignment PIN_AA3 -to fx3_uart_csx
set_location_assignment PIN_AA4 -to fx3_uart_rxd
set_location_assignment PIN_AA5 -to fx3_uart_txd
set_location_assignment PIN_T21 -to lms_pll_out
set_location_assignment PIN_K21 -to lms_rx_clock
set_location_assignment PIN_T16 -to lms_rx_clock_out
set_location_assignment PIN_B22 -to lms_rx_data[11]
set_location_assignment PIN_B21 -to lms_rx_data[10]
set_location_assignment PIN_C22 -to lms_rx_data[9]
set_location_assignment PIN_C21 -to lms_rx_data[8]
set_location_assignment PIN_D22 -to lms_rx_data[7]
set_location_assignment PIN_E21 -to lms_rx_data[6]
set_location_assignment PIN_D21 -to lms_rx_data[5]
set_location_assignment PIN_F21 -to lms_rx_data[4]
set_location_assignment PIN_E22 -to lms_rx_data[3]
set_location_assignment PIN_H21 -to lms_rx_data[2]
set_location_assignment PIN_F22 -to lms_rx_data[1]
set_location_assignment PIN_J21 -to lms_rx_data[0]
set_location_assignment PIN_H22 -to lms_rx_iq_select
set_location_assignment PIN_L21 -to lms_tx_clock
set_location_assignment PIN_U21 -to lms_tx_data[11]
set_location_assignment PIN_P22 -to lms_tx_data[10]
set_location_assignment PIN_U22 -to lms_tx_data[9]
set_location_assignment PIN_R21 -to lms_tx_data[8]
set_location_assignment PIN_N22 -to lms_tx_data[7]
set_location_assignment PIN_R22 -to lms_tx_data[6]
set_location_assignment PIN_M22 -to lms_tx_data[5]
set_location_assignment PIN_P21 -to lms_tx_data[4]
set_location_assignment PIN_L22 -to lms_tx_data[3]
set_location_assignment PIN_N21 -to lms_tx_data[2]
set_location_assignment PIN_K22 -to lms_tx_data[1]
set_location_assignment PIN_M21 -to lms_tx_data[0]

File diff suppressed because one or more lines are too long

11
linux/apps/Makefile Normal file
View file

@ -0,0 +1,11 @@
all: simple_load upgrade_firmware
clean:
rm -rf simple_load upgrade_firmware
simple_load : simple_load.c
gcc -o $@ $<
upgrade_firmware: upgrade_firmware.c
gcc -o $@ $<

Binary file not shown.

110
linux/apps/simple_load.c Normal file
View file

@ -0,0 +1,110 @@
#include <linux/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <time.h>
struct bladeRF_version {
unsigned short major;
unsigned short minor;
};
#define BLADERF_IOCTL_BASE 'N'
#define BLADE_QUERY_VERSION _IOR(BLADERF_IOCTL_BASE, 0, struct bladeRF_version)
#define BLADE_QUERY_FPGA_STATUS _IOR(BLADERF_IOCTL_BASE, 1, unsigned int)
#define BLADE_BEGIN_PROG _IOR(BLADERF_IOCTL_BASE, 2, unsigned int)
#define BLADE_END_PROG _IOR(BLADERF_IOCTL_BASE, 3, unsigned int)
#define BLADE_RF_RX _IOR(BLADERF_IOCTL_BASE, 4, unsigned int)
int time_past(struct timeval ref, struct timeval now) {
if (now.tv_sec > ref.tv_sec)
return 1;
if (now.tv_sec == ref.tv_sec && now.tv_usec > ref.tv_usec)
return 1;
return 0;
}
#define STACK_BUFFER_SZ 1024
int prog_fpga(int fd, char *file) {
int ret;
int fpga_fd, nread, toread;
int programmed;
size_t bytes;
struct stat stat;
char buf[STACK_BUFFER_SZ];
struct timeval end_time, curr_time;
int endTime;
fpga_fd = open(file, 0);
if (fpga_fd == -1)
return 1;
ioctl(fd, BLADE_BEGIN_PROG, &ret);
fstat(fpga_fd, &stat);
#define min(x,y) ((x<y)?x:y)
for (bytes = stat.st_size; bytes;) {
nread = read(fpga_fd, buf, min(STACK_BUFFER_SZ, bytes));
write(fd, buf, nread);
bytes -= nread;
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 4000000;
nanosleep(&ts, NULL);
}
close(fpga_fd);
endTime = time(NULL) + 1;
gettimeofday(&end_time, NULL);
end_time.tv_sec++;
programmed = 0;
do {
ioctl(fd, BLADE_QUERY_FPGA_STATUS, &ret);
if (ret) {
programmed = 1;
break;
}
gettimeofday(&curr_time, NULL);
} while(!time_past(end_time, curr_time));
ioctl(fd, BLADE_END_PROG, &ret);
return !programmed;
}
int main(int argc, char *argv[]) {
struct bladeRF_version ver;
int fd;
int ret = 0;
fd = open("/dev/bladerf1", O_WRONLY|O_CREAT|O_TRUNC, 0666);
if (fd == -1) {
printf("Can't open bladeRF\n");
return 1;
}
if (!ioctl(fd, BLADE_QUERY_FPGA_STATUS, &ret))
printf("FPGA programmed: %d\n", ret);
if (!ioctl(fd, BLADE_QUERY_VERSION, &ver))
printf("bladeRF firmware version: v%d.%d\n", ver.major, ver.minor);
if (argc > 1) {
ret = prog_fpga(fd, argv[1]);
printf("FPGA programming: %s\n", ret ? "error" : "success");
}
return 0;
}

View file

@ -0,0 +1,67 @@
#include <linux/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include "../../common/bladeRF.h"
int main(int argc, char *argv[]) {
struct bladeRF_version ver;
int fd;
int ret = 0;
int val;
fd = open("/dev/bladerf1", O_RDWR|O_CREAT|O_TRUNC, 0666);
if (fd == -1) {
printf("Can't open bladeRF\n");
return 1;
}
if (argc > 1) {
int fw_fd;
int nread, nidx;
struct stat fw_stat;
struct bladeRF_firmware fw_param;
fw_fd = open(argv[1], O_RDWR);
if (fw_fd == -1) {
printf("Can't open `%s'\n", argv[1]);
return 1;
}
if (fstat(fw_fd, &fw_stat) == -1) {
printf("Can't fstat firmware file\n");
return 1;
}
fw_param.len = fw_stat.st_size;
fw_param.ptr = malloc(fw_param.len);
if (!fw_param.ptr) {
printf("Can't allocate buffer\n");
return 1;
}
nread = fw_stat.st_size;
nidx = 0;
do {
ret = read(fw_fd, &fw_param.ptr[nidx], nread);
if (ret == -1) {
printf("Couldn't read file\n");
return 1;
}
nread -= ret;
} while(nread);
ret = ioctl(fd, BLADE_UPGRADE_FW, &fw_param);
printf("Upgrading fw, ptr=%p, len=%d\n", fw_param.ptr, fw_param.len);
printf("BLADE_UPGRADE_FW = %d\n", ret);
free(fw_param.ptr);
close(fw_fd);
}
return ret;
}

6
linux/kernel/Makefile Normal file
View file

@ -0,0 +1,6 @@
obj-m = bladeRF.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

598
linux/kernel/bladeRF.c Normal file
View file

@ -0,0 +1,598 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/usb.h>
#include <linux/slab.h>
#include <linux/scatterlist.h>
#include <linux/dma-mapping.h>
#include <linux/sched.h>
#include <linux/mutex.h>
#include <linux/wait.h>
#include "../../common/bladeRF.h"
struct data_buffer {
struct urb *urb;
void *addr;
dma_addr_t dma;
};
typedef struct {
struct usb_device *udev;
struct usb_interface *interface;
int intnum;
int rx_en;
spinlock_t data_in_lock;
unsigned int data_in_consumer_idx;
unsigned int data_in_producer_idx;
atomic_t data_in_cnt;
struct data_buffer data_in_bufs[NUM_DATA_URB];
struct usb_anchor data_in_anchor;
wait_queue_head_t data_in_wait;
} bladerf_device_t;
static struct usb_driver bladerf_driver;
// USB PID-VID table
static struct usb_device_id bladerf_table[] = {
{ USB_DEVICE(USB_NUAND_VENDOR_ID, USB_NUAND_BLADERF_PRODUCT_ID) },
{ } /* Terminate entry */
};
MODULE_DEVICE_TABLE(usb, bladerf_table);
static int __submit_rx_urb(bladerf_device_t *dev, unsigned int flags) {
struct urb *urb;
urb = dev->data_in_bufs[dev->data_in_producer_idx].urb;
dev->data_in_producer_idx++;
dev->data_in_producer_idx &= (NUM_DATA_URB - 1);
atomic_inc(&dev->data_in_cnt);
return usb_submit_urb(urb, flags ? flags : GFP_KERNEL );
}
static void __bladeRF_read_cb(struct urb *urb) {
bladerf_device_t *dev;
unsigned char *buf;
buf = (unsigned char *)urb->transfer_buffer;
dev = (bladerf_device_t *)urb->context;
if (dev->rx_en)
__submit_rx_urb(dev, GFP_ATOMIC);
wake_up_interruptible(&dev->data_in_wait);
}
static int bladerf_start(bladerf_device_t *dev) {
int i;
void *buf;
struct urb *urb;
dev->rx_en = 0;
atomic_set(&dev->data_in_cnt, 0);
dev->data_in_consumer_idx = 0;
dev->data_in_producer_idx = 0;
for (i = 0; i < NUM_DATA_URB; i++) {
buf = usb_alloc_coherent(dev->udev, DATA_BUF_SZ,
GFP_KERNEL, &dev->data_in_bufs[i].dma);
if (!buf) {
dev_err(&dev->interface->dev, "Could not allocate data IN buffer\n");
return -1;
}
dev->data_in_bufs[i].addr = buf;
urb = usb_alloc_urb(0, GFP_KERNEL);
if (!buf) {
dev_err(&dev->interface->dev, "Could not allocate data IN URB\n");
return -1;
}
dev->data_in_bufs[i].urb = urb;
usb_fill_bulk_urb(urb, dev->udev, usb_rcvbulkpipe(dev->udev, 1),
dev->data_in_bufs[i].addr, DATA_BUF_SZ, __bladeRF_read_cb, dev);
urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
urb->transfer_dma = dev->data_in_bufs[i].dma;
}
return 0;
}
static void bladerf_stop(bladerf_device_t *dev) {
int i;
for (i = 0; i < NUM_DATA_URB; i++) {
usb_free_coherent(dev->udev, DATA_BUF_SZ, dev->data_in_bufs[i].addr, dev->data_in_bufs[i].dma);
usb_free_urb(dev->data_in_bufs[i].urb);
}
}
int __bladerf_snd_cmd(bladerf_device_t *dev, int cmd, void *ptr, __u16 len);
static int enable_rx(bladerf_device_t *dev) {
int ret;
int i;
unsigned int val;
val = 1;
if (dev->intnum != 1)
return -1;
ret = __bladerf_snd_cmd(dev, BLADE_USB_CMD_RF_RX, &val, sizeof(val));
if (ret < 0)
goto err_out;
ret = 0;
dev->rx_en = 1;
for (i = 0; i < NUM_CONCURRENT; i++) {
if ((ret = __submit_rx_urb(dev, 0)) < 0) {
dev_err(&dev->interface->dev, "Error submitting initial RX URBs (%d/%d), error=%d\n", i, NUM_CONCURRENT, ret);
break;
}
}
err_out:
return ret;
}
static ssize_t bladerf_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
ssize_t ret = 0;
bladerf_device_t *dev;
int read;
dev = (bladerf_device_t *)file->private_data;
if (dev->intnum != 1) {
return -1;
}
if (!dev->rx_en) {
if (enable_rx(dev)) {
return -EINVAL;
}
}
read = 0;
while (!read) {
if (atomic_read(&dev->data_in_cnt)) {
unsigned int idx;
spin_lock(&dev->data_in_lock);
atomic_dec(&dev->data_in_cnt);
idx = dev->data_in_consumer_idx++;
dev->data_in_consumer_idx &= (DATA_BUF_SZ - 1);
spin_unlock(&dev->data_in_lock);
ret = copy_to_user(buf, dev->data_in_bufs[idx].addr, DATA_BUF_SZ);
if (!ret)
ret = DATA_BUF_SZ;
break;
} else {
ret = wait_event_interruptible(dev->data_in_wait, atomic_read(&dev->data_in_cnt));
if (ret < 0)
break;
}
}
return ret;
}
static ssize_t bladerf_write(struct file *file, const char *user_buf, size_t count, loff_t *ppos)
{
bladerf_device_t *dev;
char *buf = NULL;
struct urb *urb = NULL;
int nwrote, ret;
dev = (bladerf_device_t *)file->private_data;
buf = kmalloc(count, GFP_KERNEL);
if (copy_from_user(buf, user_buf, count)) {
kfree(buf);
return -EFAULT;
}
ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2), buf, count, &nwrote, 2000);
kfree(buf);
if (ret)
return ret;
return nwrote;
}
int __bladerf_rcv_cmd(bladerf_device_t *dev, int cmd, void *ptr, __u16 len) {
int tries = 3;
int retval;
do {
retval = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
cmd, BLADE_USB_TYPE_IN, 0, 0,
ptr, len, BLADE_USB_TIMEOUT_MS);
if (retval < 0) {
dev_err(&dev->interface->dev, "Error in %s calling usb_control_msg()"
" with error %d, %d tries left\n", __func__, retval, tries);
}
} while ((retval < 0) && --tries);
return retval;
}
int __bladerf_rcv_one_word(bladerf_device_t *dev, int cmd, void __user *arg) {
unsigned int buf;
int retval = -EINVAL;
if (!arg) {
retval = -EFAULT;
goto err_out;
}
retval = __bladerf_rcv_cmd(dev, cmd, &buf, sizeof(buf));
if (retval >= 0) {
buf = le32_to_cpu(buf);
retval = copy_to_user(arg, &buf, sizeof(buf));
}
if (retval >= 0) {
retval = 0;
}
err_out:
return retval;
}
int __bladerf_snd_cmd(bladerf_device_t *dev, int cmd, void *ptr, __u16 len) {
int tries = 3;
int retval;
do {
printk("usb_control_msg(ptr=%p) len=%d\n", ptr, len);
retval = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
cmd, BLADE_USB_TYPE_OUT, 0, 0,
ptr, len, BLADE_USB_TIMEOUT_MS);
printk("done usb_control_msg() = %d\n", retval);
if (retval < 0) {
dev_err(&dev->interface->dev, "Error in %s calling usb_control_msg()"
" with error %d, %d tries left\n", __func__, retval, tries);
}
} while ((retval < 0) && --tries);
return retval;
}
int __bladerf_snd_one_word(bladerf_device_t *dev, int cmd, void __user *arg) {
unsigned int buf;
int retval = -EINVAL;
if (!arg) {
retval = -EFAULT;
goto err_out;
}
if ((retval = copy_from_user(&buf, arg, sizeof(buf))))
goto err_out;
buf = cpu_to_le32(buf);
retval = __bladerf_snd_cmd(dev, cmd, &buf, sizeof(buf));
err_out:
return retval;
}
long bladerf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
bladerf_device_t *dev;
void __user *data;
struct bladeRF_version ver;
int ret;
int retval = -EINVAL;
int sz, nread, nwrite;
int sectors_to_wipe, sector_idx;
int pages_to_write, page_idx;
int pages_to_read;
int check_idx, check_error;
unsigned char buf[1024];
struct bladeRF_firmware brf_fw;
unsigned char *fw_buf;
dev = file->private_data;
data = (void __user *)arg;
switch (cmd) {
case BLADE_QUERY_VERSION:
retval = __bladerf_rcv_cmd(dev, BLADE_USB_CMD_QUERY_VERSION, &ver, sizeof(ver));
if (retval >= 0) {
ver.major = le16_to_cpu(ver.major);
ver.minor = le16_to_cpu(ver.minor);
retval = copy_to_user(data, &ver, sizeof(struct bladeRF_version));
}
break;
case BLADE_QUERY_FPGA_STATUS:
retval = __bladerf_rcv_one_word(dev, BLADE_USB_CMD_QUERY_FPGA_STATUS, data);
break;
case BLADE_BEGIN_PROG:
if (dev->intnum != 0) {
ret = usb_set_interface(dev->udev, 0,0);
dev->intnum = 0;
}
retval = __bladerf_rcv_one_word(dev, BLADE_USB_CMD_BEGIN_PROG, data);
break;
case BLADE_END_PROG:
// TODO: send another 2 DCLK cycles to ensure compliance with C4's boot procedure
retval = __bladerf_rcv_one_word(dev, BLADE_USB_CMD_QUERY_FPGA_STATUS, data);
if (!retval) {
ret = usb_set_interface(dev->udev, 1,0);
dev->intnum = 1;
}
break;
case BLADE_UPGRADE_FW:
if (dev->intnum != 2) {
retval = usb_set_interface(dev->udev, 2,0);
if (retval)
break;
dev->intnum = 2;
}
if (copy_from_user(&brf_fw, data, sizeof(struct bladeRF_firmware))) {
return -EFAULT;
}
brf_fw.len = ((brf_fw.len + 255) / 256) * 256;
fw_buf = kzalloc(brf_fw.len, GFP_KERNEL);
if (!fw_buf)
goto leave_fw;
if (copy_from_user(fw_buf, brf_fw.ptr, brf_fw.len)) {
retval = -EFAULT;
goto leave_fw;
}
retval = -ENODEV;
sectors_to_wipe = (brf_fw.len + 0xffff) / 0x10000;
printk("Going to wipe %d sectors\n", sectors_to_wipe);
for (sector_idx = 0; sector_idx < sectors_to_wipe; sector_idx++) {
printk("Erasing sector %d... ", sector_idx);
retval = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
BLADE_USB_CMD_FLASH_ERASE, BLADE_USB_TYPE_IN, 0x0000, sector_idx,
&ret, 4, BLADE_USB_TIMEOUT_MS * 100);
printk("- erased\n");
if (retval != 4) {
goto leave_fw;
}
ret = le32_to_cpu(ret);
if (ret != 1) {
printk("Unable to erase previous sector, quitting\n");
goto leave_fw;
}
}
if (dev->udev->speed == USB_SPEED_HIGH) {
sz = 64;
} else if (dev->udev->speed == USB_SPEED_SUPER) {
sz = 256;
}
pages_to_write = (brf_fw.len + 255) / 0x100;
for (page_idx = pages_to_write - 1; page_idx >= 0; page_idx--) {
nwrite = 0;
do {
retval = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
BLADE_USB_CMD_FLASH_WRITE, BLADE_USB_TYPE_OUT, 0x0000, page_idx,
&fw_buf[page_idx * 256 + nwrite], sz, BLADE_USB_TIMEOUT_MS);
nwrite += sz;
} while (nwrite != 256);
}
pages_to_read = (brf_fw.len + 255) / 0x100;
check_error = 0;
for (page_idx = 0; page_idx < pages_to_read; page_idx++) {
nread = 0;
do {
retval = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0),
BLADE_USB_CMD_FLASH_READ, BLADE_USB_TYPE_IN, 0x0000, page_idx,
&buf[nread], sz, BLADE_USB_TIMEOUT_MS);
nread += sz;
} while (nread != 256);
for (check_idx = 0; check_idx < 256; check_idx++) {
if (buf[check_idx] != fw_buf[page_idx * 256 + check_idx]) {
printk("ERROR: bladeRF firmware verification detected a mismatch at byte offset 0x%.8x\n", page_idx * 256 + check_idx);
printk("ERROR: expected byte 0x%.2X, got 0x%.2X\n", fw_buf[page_idx * 256 + check_idx], buf[check_idx]);
check_error = 1;
goto leave_fw;
}
}
}
retval = 0;
printk("SUCCESSFULLY VERIFIED\n");
leave_fw:
kfree(fw_buf);
break;
case BLADE_CHECK_PROG:
retval = 0;
printk("ok %d\n", dev->intnum);
if (dev->intnum == 0) {
retval = __bladerf_rcv_cmd(dev, BLADE_USB_CMD_QUERY_FPGA_STATUS, &ret, sizeof(ret));
printk("retval =%d ret=%d\n", retval, ret);
if (retval >= 0 && ret) {
retval = 0;
ret = usb_set_interface(dev->udev, 1,0);
dev->intnum = 1;
retval = copy_to_user((void __user *)arg, &ret, sizeof(ret));
printk("ok changed intf\n");
}
}
break;
case BLADE_RF_RX:
if (dev->intnum != 1) {
dev_err(&dev->interface->dev, "Cannot enable RX from config mode\n");
retval = -1;
break;
}
printk("RF_RX!\n");
retval = __bladerf_snd_one_word(dev, BLADE_USB_CMD_RF_RX, data);
break;
case BLADE_RF_TX:
if (dev->intnum != 1) {
dev_err(&dev->interface->dev, "Cannot enable TX from config mode\n");
retval = -1;
break;
}
printk("RF_TX!\n");
retval = __bladerf_snd_one_word(dev, BLADE_USB_CMD_RF_TX, data);
break;
}
return retval;
}
static int bladerf_open(struct inode *inode, struct file *file)
{
bladerf_device_t *dev;
struct usb_interface *interface;
int subminor;
subminor = iminor(inode);
interface = usb_find_interface(&bladerf_driver, subminor);
if (interface == NULL) {
pr_err("%s - error, cannot find device for minor %d\n", __func__, subminor);
return -ENODEV;
}
dev = usb_get_intfdata(interface);
if (dev == NULL) {
return -ENODEV;
}
file->private_data = dev;
return 0;
}
static int bladerf_release(struct inode *inode, struct file *file)
{
return 0;
}
static struct file_operations bladerf_fops = {
.owner = THIS_MODULE,
.read = bladerf_read,
.write = bladerf_write,
.unlocked_ioctl = bladerf_ioctl,
.open = bladerf_open,
.release = bladerf_release,
};
#define USB_NUAND_BLADERF_MINOR_BASE 193
static struct usb_class_driver bladerf_class = {
.name = "bladerf%d",
.fops = &bladerf_fops,
.minor_base = USB_NUAND_BLADERF_MINOR_BASE,
};
static int bladerf_probe(struct usb_interface *interface,
const struct usb_device_id *id)
{
bladerf_device_t *dev;
int retval;
dev = kzalloc(sizeof(bladerf_device_t), GFP_KERNEL);
if (dev == NULL) {
dev_err(&interface->dev, "Out of memory\n");
goto error_oom;
}
spin_lock_init(&dev->data_in_lock);
dev->udev = usb_get_dev(interface_to_usbdev(interface));
dev->interface = interface;
dev->intnum = 0;
init_usb_anchor(&dev->data_in_anchor);
init_waitqueue_head(&dev->data_in_wait);
bladerf_start(dev);
usb_set_intfdata(interface, dev);
retval = usb_register_dev(interface, &bladerf_class);
if (retval) {
dev_err(&interface->dev, "Unable to get a minor device number for bladeRF device\n");
usb_set_intfdata(interface, NULL);
return retval;
}
dev_info(&interface->dev, "Nuand bladeRF device is now attached\n");
return 0;
error_oom:
return -ENOMEM;
}
static void bladerf_disconnect(struct usb_interface *interface)
{
bladerf_device_t *dev;
dev = usb_get_intfdata(interface);
bladerf_stop(dev);
usb_deregister_dev(interface, &bladerf_class);
usb_set_intfdata(interface, NULL);
usb_put_dev(dev->udev);
dev_info(&interface->dev, "Nuand bladeRF device has been disconnected\n");
kfree(dev);
}
static struct usb_driver bladerf_driver = {
.name = "nuand_bladerf",
.probe = bladerf_probe,
.disconnect = bladerf_disconnect,
.id_table = bladerf_table,
};
module_usb_driver(bladerf_driver);
MODULE_AUTHOR("Robert Ghilduta <robert.ghilduta@gmail.com>");
MODULE_DESCRIPTION("bladeRF USB driver");
MODULE_VERSION("v0.1");
MODULE_LICENSE("GPL");

48
linux/kernel/bladeRF.h Normal file
View file

@ -0,0 +1,48 @@
#define BLADERF_IOCTL_BASE 'N'
#define BLADE_QUERY_VERSION _IOR(BLADERF_IOCTL_BASE, 0, struct bladeRF_version)
#define BLADE_QUERY_FPGA_STATUS _IOR(BLADERF_IOCTL_BASE, 1, unsigned int)
#define BLADE_BEGIN_PROG _IOR(BLADERF_IOCTL_BASE, 2, unsigned int)
#define BLADE_END_PROG _IOR(BLADERF_IOCTL_BASE, 3, unsigned int)
#define BLADE_CHECK_PROG _IOR(BLADERF_IOCTL_BASE, 4, unsigned int)
#define BLADE_RF_RX _IOR(BLADERF_IOCTL_BASE, 5, unsigned int)
#define BLADE_RF_TX _IOR(BLADERF_IOCTL_BASE, 6, unsigned int)
#define BLADE_UPGRADE_FW _IOR(BLADERF_IOCTL_BASE, 50, unsigned int)
#define BLADE_USB_CMD_QUERY_VERSION 0
#define BLADE_USB_CMD_QUERY_FPGA_STATUS 1
#define BLADE_USB_CMD_BEGIN_PROG 2
#define BLADE_USB_CMD_END_PROG 3
#define BLADE_USB_CMD_RF_RX 4
#define BLADE_USB_CMD_RF_TX 5
#define BLADE_USB_CMD_FLASH_READ 100
#define BLADE_USB_CMD_FLASH_WRITE 101
#define BLADE_USB_CMD_FLASH_ERASE 102
#define BLADE_USB_CMD_QUERY_VERSION 0
#define BLADE_USB_CMD_QUERY_FPGA_STATUS 1
#define BLADE_USB_CMD_BEGIN_PROG 2
#define BLADE_USB_CMD_END_PROG 3
#define BLADE_USB_CMD_RF_RX 4
struct bladeRF_version {
unsigned short major;
unsigned short minor;
};
struct bladeRF_firmware {
unsigned int len;
unsigned char *ptr;
};
#define BLADE_USB_TYPE_OUT 0x40
#define BLADE_USB_TYPE_IN 0xC0
#define BLADE_USB_TIMEOUT_MS 1000
#define USB_NUAND_VENDOR_ID 0x04b4
#define USB_NUAND_BLADERF_PRODUCT_ID 0x00f1
#define NUM_CONCURRENT 8
#define NUM_DATA_URB (128)
#define DATA_BUF_SZ (1024*4)