Commit graph

54 commits

Author SHA1 Message Date
Brian Glod
9632450d40 hdl: build: Add build time output
Prints total time taken to build the FPGA image.
2018-02-16 18:45:48 -05:00
Brian Glod
37de987a36 hdl: build: Delete empty SOPC directories
Delete empty SOPC directories created by Quartus during IP core
generation. These empty directories are created in the user's home
directory and can accumulate if left unchecked. Use `find' with
approprate filters to (hopefully) avoid deleting anything important!
2018-02-16 13:29:23 -05:00
Brian Glod
3a71aee58a hdl: build: Add build flow support
Quartus supports different build flows. Adding support for that so that
a user can choose to simply generate the project files, run synthesis
only (e.g. to check syntax), or do the full place and route to generate
programming files.
2018-02-09 17:57:25 -05:00
Brian Glod
236a639021 hdl: build: Fix Quartus project revision parameter
The project revision option specified on the command line was not being
passed to the build Tcl file.

Changed handling of message suppression files. Filename should be the
same as the revision name. Instead of managing potentially several
identical or nearly identical .srf files, just manage the one and have
the build script rename it when copying it to the build directory.

Fixed references to the nios_system.qip file in bladerf-fsk_bridge.qip
and bladerf-qpsk_tx.qip.
2018-02-09 17:54:20 -05:00
Brian Glod
4faf3d172a hdl: build: Better checking for Quartus binaries
- Check for qsys-* binaries
- Check for nios2-* binaries

These binaries do not exist in the same directory as quartus_sh.
2018-02-09 17:42:06 -05:00
Brian Glod
3b5c432f0c hdl: build: getopts, help text
- Add "board" as a required option in help text
- The description of the SignalTap force option was vague.
- Added check for null argument.
- Do not print full usage information for an invalid option.
2018-02-09 17:37:38 -05:00
Brian Glod
8a162b337e hdl: build: Remove NiosII/s option
Beginning in Quartus 14.0, the NiosII processor split into two versions:
Classic and Gen 2. Development of new features for the Classic ceased in
Quartus 14.0. Nuand upgraded to the Gen 2 core for the release of the
bladeRF micro. The Gen 2 core does not have an option for the
Small (NiosII/s) implementation, so the option was removed from the
build script.

Nuand may add a NiosII/s approximation of the NiosII/f in the
future. This will happen quicker if we get requests to do so. :)
2018-02-09 13:01:27 -05:00
Brian Glod
0be88bb868 hdl: build: Fix adding FPGA size to work dir name
This commit should be squashed into:

4f9a59aafd
  "hdl/build: Fix clearing of work directory"
2018-02-07 17:02:36 -05:00
Brian Glod
4ac61d1a3f hdl/build: Add FPGA size to work directory name
Allows even more builds to occur simultaneously.
2018-01-26 20:07:40 -05:00
Brian Glod
4f9a59aafd hdl/build: Fix clearing of work directory
Don't wipe the entire work directory, only wipe the work/$platform
directory. This allows us to run builds of multiple platforms
simultaneously.
2018-01-26 17:47:04 -05:00
Brian Glod
51255913f4 hdl: Move message suppression files
To platform's build dir
2017-12-21 15:44:54 -05:00
Brian Glod
268259fed8 bladerf-micro: build: Add hosted message suppression file
Suppress some warnings that we have no control over. For example, some
nets within Quartus-generated HDL:

- avalon_merlin_width_adapter
- avalon_merlin_axi_slave_ni
- interconnect_2_router
- Altera's SPI controller
- Altera's LVDS controller
- etc...
2017-12-21 12:55:01 -05:00
Brian Glod
83bfd22f34 bladerf: Move SignalTap files into platform dir 2017-12-21 12:55:00 -05:00
Brian Glod
d48e59066f build: Change flow from 'none' to 'gen'
More accurate description of what the flow is. The 'gen' flow only
generates the Quartus projects and other dependencies. It does not
perform synthesis, fitting, etc. As a result 'gen' is a more appropriate
flow name than 'none'.
2017-12-21 12:54:57 -05:00
Brian Glod
46b0b26edf build: Fix force STP option 2017-12-21 12:54:55 -05:00
Brian Glod
4cebde5516 bladerf: build: Remove obsolete build script 2017-12-21 12:54:54 -05:00
Brian Glod
8994765595 bladerf: build: Port to new build script 2017-12-21 12:54:54 -05:00
Brian Glod
6bc6c23eef bladerf-micro: build: Delete obsolete build scripts 2017-12-21 12:21:15 -05:00
Brian Glod
4fa3acada4 bladerf-micro: build script overhaul
First pass, lots of changes. Untested.
2017-12-21 12:21:07 -05:00
Brian Glod
b9cff9f52e bladerf-micro: Initial commit
Will synthesize, but cannot fit due to some problem with adi_tx_clock.
2017-12-21 11:28:58 -05:00
Brian Padalino
65e764d4bb adsb: Adding FPGA based ADSB decoding.
This commit adds all the files required for using the FPGA on
the bladeRF as an ADSB message decoder.  The decoder uses a low
IF approach for decoding the PPM messages from ADSB.  The FPGA
processing expects a samplerate of 16 MHz and the IF to be at
4 MHz.  The FPGA will mix, filter and turn the result into a
power value.  This power value is then compared against a noise
floor, the preamble is searched and, if found, one of a number
of message decoders are used to decode the data.  If the CRC
does not pass, a bit flipping technique is used to flip the
lowest 5 soft decisions and re-try the CRC.  If successful,
the message is sent into a holding area and into a FIFO which
collects the ADSB messages.  After a timeout period, if messages
have not filled the FIFO, zeros are stuffed until the FIFO is
full enough for a DMA transfer to the host.

An example of a host application for receiving the ADSB messages
is located in the example directory.
2016-04-27 23:58:28 -07:00
Brian Glod
597435bcd5 hdl: Deleting obsolete files.
These files are not used. Constraints are located in the platform
directory.
2016-04-06 16:43:06 -04:00
Brian Glod
1f0e6f65e0 build: Fix SignalTap in scripted builds
Simply enabling SignalTap and specifying the .stp file in the project
settings is not sufficient for getting SignalTap into the build. The
.stp file must be translated into project assignments that get appended
to the .qsf file. This is done by calling 'quartus_stp' with the project
name, revision, the .stp file, and the parameter to enable SignalTap in
the project. Quartus_stp must run successfully before Analysis &
Synthesis.

Also added an exception to let non-Web Editions (e.g. Standard and Pro)
of the Quartus tools to add SignalTap files without enabling TalkBack.
2016-04-01 23:19:31 -04:00
Ryan Tucker
a82c85e48c hdl: check for null TALKBACK_ENABLED (#354)
This handles the case where TALKBACK_ENABLED has never been explicitly
set and is empty.
2016-01-24 17:10:26 -05:00
Brian Glod
56c6f9c080 hdl: Fixed tune reference MUX select inputs and
The tune reference MUX select inputs were connected to a version of the
tune mode signal synchronized to the tune_ref clock domain. This was an
oversight that would cause a 2-3 second delay after resetting the
counters when tuning against a 1PPS reference (because the synchronizer
block contains two flops clocked at 1 Hz). This was corrected and the
MUX now uses the system-synchronous tune_mode signal from the control
register in the Avalon-MM interface.

Renamed the tune_mode signals to include the clock domain (prefixed with
tune_ref_*).

Added ability for the Avalon-MM master to read back the control register
contents.

Updated tcxopps.stp SignalTap file with new signal names.
2015-12-14 15:29:59 -05:00
Brian Glod
16c0b854fc hdl: Updating VCTCXO Tamer SignalTap file to reflect current signal names 2015-12-14 15:29:59 -05:00
Brian Glod
67eeb00f97 hdl: Initial checkin of TCXO tuning via 1PPS 2015-12-14 15:29:58 -05:00
Jon Szymaniak
238d8b23be hdl: Added build option to select NIOS II core implementation 2015-08-25 13:28:05 -04:00
Brian Padalino
44f7b40ae8 quartus: Enable/Disable TalkBack.
Enable/Disable the TalkBack feature of Quartus based on SignalTap
insertion and if the user really wants to force the script to enable
and disable it at the end of building.

If TalkBack is disabled, and SignalTap is requested to be added to
the project, then the build will now fail instead of warn about
TalkBack not being enabled.
2015-08-20 15:01:05 -04:00
Jon Szymaniak
993b3e1fbb hdl: Check for Quartus 15 in build script
Provide clear and concise feedback early, rather than a long
set of unintuitive errors.
2015-06-29 20:45:27 -04:00
Jon Szymaniak
3bfae3ca67 nios: Redesign and rewrite of NIOS II code
The NIOS II code that handles requests/response from the host
(via the FX3 UART) has been redesigned and rewritten to improve
its readability and extensibility.

Many, many thanks go out to Cameron Karlsson for providing his NIOS II
code re-design and feedback, upon which this effort was based.
2015-06-18 18:32:55 -04:00
Jon Szymaniak
67c5782ef9 hdl: Removed outdated revisions from build script
These items have become out-of-date with the current design and
no longer build. As such, they have been removed to avoid confusion.

Issue #360 has been opened to track the updating of these. These
items shall be re-added as they are updated.
2014-12-12 15:50:55 -05:00
Jon Szymaniak
d7d93c173c hdl: Store build artifacts in a timestamped directory, with reports
FPGA build artifacts are now copied to a <rev>x<size>-<timestamp>
directory. The .rbf, SHA256 & MD5 checksums, and reports/summaries are
copied into this directory.

This is intended to help keep files with their associated FPGA images, as
items in work/ are clobbered with each invocation of build_bladerf.sh.
2014-10-23 13:02:31 -04:00
Jon Szymaniak
30aab0e684 hdl: Print MD5 & SHA256 checksums of FPGA images at the end of the build 2014-10-22 17:22:12 -04:00
modustollens
35e5a6ee06 hdl: Added ATSC TX FPGA implementation
This revision introduces an FPGA-based ATSC transmitter to offload the
pilot insertion, filtering, and shift to baseband.

This design expects that 4-bit ATSC symbols are written to the device in
little-endian 32-bit words, as shown below.

        |<-------                               32 Bit Word                                     ------->|
Bit     |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
Symbol  [ X|   7    ][X|  6     ][X|   5    ][X|    4   ][X|   3   ][X|   2     ][X|    1   ][X|    0   ]

The FPGA transmits Symbol 0 first, and Symbol 7 last. The three
least-significant bits in each symbol's nibble contain values 0 to 7,
mapping to values of -7 to 7, with the most-significant bit left unused.

This FPGA image may be built by specifying the "atsc_tx" image to the
build_bladerf.sh script. The resulting output files will be
atsc_txx40.rbf and atsc_txx115.rbf for the x40 and the x115,
respectively.

Transmitting a pre-made stream on channel 14-1 can be achieved with the
following commands in the bladeRF-cli:

    set frequency 473000000
    set samplerate 32286713 2867 10000

    set txvga1 -4
    set txvga2 20

    tx config file=<path to file> repeat=0 delay=0
    tx start
2014-10-17 18:24:54 -04:00
Brian Padalino
2ddb78e20f hdl: Adding fx3_pll for better clock control. 2014-07-10 22:10:22 -04:00
Ryan Tucker
0933b6aa2f build_bladerf: don't set QUARTUS_BINDIR on Linux
Turns out that Quartus doesn't have problems finding
JRE on Linux, unless we override it...
2013-12-28 12:46:43 -05:00
Brian Padalino
3ef2ab82a7 Making it all work with Windows.
Bug in Quartus causes the java location to not be well defined when using
the nios2_command_shell in Windows, but works fine in linux.

Problem reported to Altera.
2013-12-28 12:46:43 -05:00
Brian Padalino
61130fb4ab Fixed minor issues.
ARST_LVL was inadvertantly changed to be a '0' instead of a '1' during the renaming of oc_i2c_master to bladerf_oc_i2c_master.  This is moved back.

Updated to using Quartus II 13.1, and with that discovered that Qsys now outputs '1' or '0' into a Verilog file which should be 1'b0 or 1'b1, so now there is a small sed replacement after generating the Qsys components to handle this problem.
2013-12-28 12:46:43 -05:00
Brian Padalino
e7b89f2696 Rebuild application every time. 2013-12-28 12:46:42 -05:00
Brian Padalino
39da7c998c Update HDL and improve UART speed.
This updates the HDL and improves the UART speed significantly.
2013-12-28 12:46:42 -05:00
Keith Rothman
4797ac08b5 Moved settings.bsp out of the path 2013-10-04 22:31:31 -07:00
Brian Padalino
3ec971c235 Unified .gitignore top level file. 2013-10-02 20:14:22 -04:00
Ryan Tucker
2cdd5e9c65 build_bladerf.sh: fix quartus 13.0+ support
nios2-build-project does not seem to exist in 13.0 and later.
So, look for nios2-terminal instead.
2013-07-28 14:21:12 -04:00
Jon Szymaniak
30145aa6ec hdl: Updated build script to kick off entire build
build_bladerf.sh now takes command line arguments for the desired
FPGA revision and size. This requires that the user adds a few
item to their PATH.
2013-07-17 23:59:11 -04:00
Ryan Tucker
ba9cd4ef06 Build BSP after setting up Nios system
We need lms_spi_controller/mem_init/meminit.qip to build the
FPGA successfully, so this needs to be created prior to anything
else happening.
2013-07-16 22:17:43 -04:00
Brian Padalino
f68bde7970 fpga: Adding rx signals signaltap file. 2013-07-06 14:13:06 -07:00
Brian Padalino
11ee6006b1 fpga: Changed build system.
Modified the build system for the FPGA, the following commands should be run
from the Quartus command line shell

  $ cd hdl/quartus && mkdir work && cd work
  $ quartus_sh -t ../bladerf.tcl && quartus_sh -t build -rev hosted

Should build the USB3.0 bridge FPGA.  New architectures are easy to modify
to create new functionality.
2013-06-16 18:15:56 -07:00
Brian Padalino
d6f30c22d3 hdl: added two convenience build scripts
- build_bladerf.sh
- bladerf.tcl

Make sure quartus_sh is in your path and run:

$ cd hdl/quartus ; ./build_bladerf.sh

Should generate the appropriate Qsys synthesis files as well
as build the FPGA image.

Current FPGA image fails timing due to clock constraints
feeding into the SignalTap block.
2013-06-09 22:45:31 -07:00
Brian Padalino
f83e2a1bb1 hdl: nios: enable I2C controller
This commit ties the I2C controller to the Nios 2 Core and updates the system
pinout.
2013-06-02 23:14:09 -07:00