How to synthesize a base design
===============================

The design assumes the following hiearchy.
TOP
 |- DR_TOP (instantiated from TOP as DR): to be reconfigured dynamically

Some of the source files vary with the target board.
Such files are in a subfolder, except tb, corresponding to the board.
Hereinafter the name of the subfolder is denoted as <BOARD>.

1. Synthesize TOP with blank DR_TOP.
   VHDL source files are all EXCEPT dr_top.vhdl and <BOARD>/dr_base.vhdl.
   Constraint file is <BOARD>/<BOARD>.xdc.
   ILA IP Core setting file is <BOARD>/ila_0.xci.

2. Open the synthesized design and save the design checkpoint
   (File - Checkpoint - Write) as step_1.dcp.
   A critical warning (Project 1-486) can be safely ignored.

3. Synthesize a base DR_TOP using dr_top.vhdl and <BOARD>/dr_base.vhdl.
   An additional synthesis option "-mode out_of_context" is required.

4. Save the design checkpoint as step_3.dcp

5. Open the checkpoint file step_1.dcp (File - Checkpoint - Open).

# After opening the checkpoint, check the device properties
# (Tools -> Edit Device Properties) and make sure the following changes are applied.
#   - general -> bitstream compression -> TRUE
#   - configuration -> configuration rate -> 33
#   - configuration modes -> Master SPI x4

6. Add the checkpoint saved in Step 4 as the DR instance.
>     set_property HD.RECONFIGURABLE true [get_cells DR]
>     cd /PATH/TO/CHECKPOINT
>     read_checkpoint -cell [get_cells DR] step_3.dcp

# 7. Create Pblock.
#    In the Device tab, turn on Draw Pblock button and select a region for DR.
#    Then execute the following command in the tcl shell.
# >     add_cells_to_pblock [get_pblocks pblock_DR] [get_cells DR]
# 
# 8. Check the design rules (Reports - Report DRC).
#    Only the DFX-related rules have to be checked.
#    If DRC fails, modify the Pblock according to messages and try again.
# 
# 9. Save the design constraints.
#    Steps 6-8 can be performed at once using the saved XDC file.
# >     write_xdc -force PBLOCK.xdc

7-9. Load the saved design constraints.
>     read_xdc PBLOCK.xdc

10. Perform the implementation steps and generate a bitstream.
    Remember to add -bin_file option to create .bin file.
>     opt_design
>     place_design
>     route_design
>     write_bitstream -force -bin_file rc_base.bit
>     write_debug_probes -force rc_base.ltx

11. Let DR be a black box again and save the checkpoint.
>     update_design -cell DR -black_box
>     lock_design -level routing
>     write_checkpoint -force rc_base.dcp
