Skip to content

Commit

Permalink
Issue #156: Support active serial bitstream for DE2-115 board
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
jbush001 committed Mar 4, 2018
1 parent 772ee87 commit f7bf888
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
14 changes: 13 additions & 1 deletion hardware/fpga/de2-115/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,36 @@ project(de2_115)
# The working directory for these is the source dir, which means these will
# put output files in the source hierarchy even if this is an out-of-tree
# build. This is because the Quartus project file specifies relative paths.
# XXX it might be cleaner to have this generate the .qsf file.
# XXX it might be cleaner to have this generate the .qsf file, or perhaps
# expand a template QSF file.
set(OUTPUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/output_files/)

find_program(QUARTUS_MAP NAMES quartus_map)
find_program(QUARTUS_FIT NAMES quartus_fit)
find_program(QUARTUS_ASM NAMES quartus_asm)
find_program(QUARTUS_STA NAMES quartus_sta)
find_program(QUARTUS_PGM NAMES quartus_pgm)
find_program(QUARTUS_CPF NAMES quartus_cpf)

add_custom_target(synthesize
COMMAND ${QUARTUS_MAP} de2_115
COMMAND ${QUARTUS_FIT} de2_115
COMMAND ${QUARTUS_ASM} de2_115
COMMAND ${QUARTUS_STA} de2_115
COMMAND ${QUARTUS_CPF} -c -d EPCS64 ${OUTPUT_DIR}/de2_115.sof ${OUTPUT_DIR}/de2_115.pof
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/print_summary.py
COMMENT "Synthesizing"
DEPENDS bootrom
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# This loads the SOF (SRAM Object File), which can be loaded onto the board in JTAG
# mode.
add_custom_target(program
COMMAND ${QUARTUS_PGM} -m jtag -o \"P\;output_files/de2_115.sof\"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})

# Load a POF (Program Object File) into the board, which is loaded automatically in
# active serial mode every time the board boots.
add_custom_target(asprogram
COMMAND ${QUARTUS_PGM} -m jtag -o \"P\;output_files/de2_115.pof\"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
21 changes: 18 additions & 3 deletions hardware/fpga/de2-115/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ download the drivers. Also, if you search for 'FTDI USB serial' on a retail
site like Amazon, there are a number that do explicitly note the chipset type.
This one has worked well for me: http://a.co/hOTKx9R*

## Synthesizing and Running Programs
## Synthesizing and Running

The build system is command line based and does not use the Quartus GUI.

Expand Down Expand Up @@ -105,9 +105,24 @@ Other notes:
onto the FPGA board using the serial_loader program (tools/serial_loader).
- Reload programs by pressing the reset button (push button 0) and using
'run_fpga' again.
- You do not need to reload the bitstream (step 2) as long as the board is
powered (it will be lost if it is turned off, however).
- This loads programs in 'JTAG' mode. You do not need to reload the bitstream
(step 2) as long as the board is powered. It will be lost if it is turned off,
however. Instructions below describe how to load the configuration bitstream
into non-volatile memory.
- The `program` target does not resynthesize the bitstream if source files
have changed. This must be done explicitly by typing `make synthesize`.
- The serial_loader program is also capable of loading a ramdisk file into
memory on the board, which some of the test programs use.

### Flashing Configuration Onto Board

The configuration above loads the configuration bitstream into the FPGA, but
doesn't persist across power cycles. The board supports loading a non-volatile
image using 'Active Serial' programming mode. To do that, use the following steps:

1. Switch SW19 to 'prog'
2. Send program

make asprogram

3. Switch SW19 to 'run' and power cycle the board.

0 comments on commit f7bf888

Please sign in to comment.