daq2/a10gx: Add cfi_flash to qsys

+ Add cfi_flash to qsys
   + Set nios reset vector to cfi_flash
main
STEVE KRAVATSKY 2017-07-19 22:41:37 -04:00 committed by Istvan Csomortani
parent a33f3178c2
commit ee01ea3736
4 changed files with 413 additions and 129 deletions

View File

@ -164,6 +164,143 @@ set_instance_assignment -name IO_STANDARD "1.8 V" -to eth_intn
set_instance_assignment -name GLOBAL_SIGNAL "GLOBAL CLOCK" -to eth_ref_clk
# flash
set_location_assignment PIN_BB12 -to flash_addr[0]
set_location_assignment PIN_BB11 -to flash_addr[1]
set_instance_assignment -name VIRTUAL_PIN ON -to flash_addr[0]
set_instance_assignment -name VIRTUAL_PIN ON -to flash_addr[1]
set_location_assignment PIN_AM11 -to flash_addr[2]
set_location_assignment PIN_AM12 -to flash_addr[3]
set_location_assignment PIN_AL12 -to flash_addr[4]
set_location_assignment PIN_AN13 -to flash_addr[5]
set_location_assignment PIN_AM13 -to flash_addr[6]
set_location_assignment PIN_AE12 -to flash_addr[7]
set_location_assignment PIN_AN15 -to flash_addr[8]
set_location_assignment PIN_AL10 -to flash_addr[9]
set_location_assignment PIN_AR10 -to flash_addr[10]
set_location_assignment PIN_AP11 -to flash_addr[11]
set_location_assignment PIN_AL13 -to flash_addr[12]
set_location_assignment PIN_AH11 -to flash_addr[13]
set_location_assignment PIN_AN14 -to flash_addr[14]
set_location_assignment PIN_AG11 -to flash_addr[15]
set_location_assignment PIN_AH10 -to flash_addr[16]
set_location_assignment PIN_AF14 -to flash_addr[17]
set_location_assignment PIN_AF15 -to flash_addr[18]
set_location_assignment PIN_AH14 -to flash_addr[19]
set_location_assignment PIN_AJ12 -to flash_addr[20]
set_location_assignment PIN_AJ14 -to flash_addr[21]
set_location_assignment PIN_AH13 -to flash_addr[22]
set_location_assignment PIN_AG12 -to flash_addr[23]
set_location_assignment PIN_AJ13 -to flash_addr[24]
set_location_assignment PIN_AF12 -to flash_addr[25]
set_location_assignment PIN_AK14 -to flash_addr[26]
set_location_assignment PIN_AK11 -to flash_addr[27]
set_location_assignment PIN_BB20 -to flash_data[0]
set_location_assignment PIN_BA22 -to flash_data[1]
set_location_assignment PIN_AU25 -to flash_data[2]
set_location_assignment PIN_BD21 -to flash_data[3]
set_location_assignment PIN_AY25 -to flash_data[4]
set_location_assignment PIN_BD22 -to flash_data[5]
set_location_assignment PIN_AY24 -to flash_data[6]
set_location_assignment PIN_AV25 -to flash_data[7]
set_location_assignment PIN_BC21 -to flash_data[8]
set_location_assignment PIN_BB21 -to flash_data[9]
set_location_assignment PIN_BC20 -to flash_data[10]
set_location_assignment PIN_AW22 -to flash_data[11]
set_location_assignment PIN_AP26 -to flash_data[12]
set_location_assignment PIN_BA24 -to flash_data[13]
set_location_assignment PIN_BA25 -to flash_data[14]
set_location_assignment PIN_AR26 -to flash_data[15]
set_location_assignment PIN_AT25 -to flash_data[16]
set_location_assignment PIN_BA19 -to flash_data[17]
set_location_assignment PIN_BA20 -to flash_data[18]
set_location_assignment PIN_AP24 -to flash_data[19]
set_location_assignment PIN_AP23 -to flash_data[20]
set_location_assignment PIN_BA18 -to flash_data[21]
set_location_assignment PIN_AT24 -to flash_data[22]
set_location_assignment PIN_BD19 -to flash_data[23]
set_location_assignment PIN_AU23 -to flash_data[24]
set_location_assignment PIN_AR24 -to flash_data[25]
set_location_assignment PIN_AT23 -to flash_data[26]
set_location_assignment PIN_AR25 -to flash_data[27]
set_location_assignment PIN_AP22 -to flash_data[28]
set_location_assignment PIN_BC19 -to flash_data[29]
set_location_assignment PIN_AU22 -to flash_data[30]
set_location_assignment PIN_BA17 -to flash_data[31]
set_location_assignment PIN_BC25 -to flash_advn
set_location_assignment PIN_BB22 -to flash_cen[0]
set_location_assignment PIN_BB23 -to flash_cen[1]
set_location_assignment PIN_BB25 -to flash_clk
set_location_assignment PIN_BC26 -to flash_oen
set_location_assignment PIN_BA23 -to flash_resetn
set_location_assignment PIN_BD26 -to flash_wen
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_clk
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_oen
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_resetn
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_wen
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_advn
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_cen
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[27]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[26]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[25]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[24]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[23]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[22]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[21]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[20]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[19]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[18]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[17]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[16]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[15]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[14]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[13]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[12]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_addr[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[31]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[30]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[29]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[28]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[27]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[26]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[25]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[24]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[23]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[22]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[21]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[20]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[19]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[18]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[17]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[16]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[15]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[14]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[13]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[12]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[11]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[10]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[9]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[8]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[7]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[6]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[5]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[4]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[3]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[2]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[1]
set_instance_assignment -name IO_STANDARD "1.8 V" -to flash_data[0]
# leds
set_location_assignment PIN_L28 -to gpio_bd_o[0] ; ## led-g0-d10

View File

@ -78,6 +78,95 @@ set_interface_property sys_ddr3_cntrl_mem EXPORT_OF sys_ddr3_cntrl.mem
set_interface_property sys_ddr3_cntrl_oct EXPORT_OF sys_ddr3_cntrl.oct
set_interface_property sys_ddr3_cntrl_pll_ref_clk EXPORT_OF sys_ddr3_cntrl.pll_ref_clk
# flash bridge
add_instance sys_flash_bridge altera_tristate_conduit_bridge
add_connection sys_clk.clk sys_flash_bridge.clk
add_connection sys_clk.clk_reset sys_flash_bridge.reset
# flash
add_instance sys_flash altera_generic_tristate_controller
set_instance_parameter_value sys_flash {TCM_ADDRESS_W} {24}
set_instance_parameter_value sys_flash {TCM_DATA_W} {32}
set_instance_parameter_value sys_flash {TCM_BYTEENABLE_W} {4}
set_instance_parameter_value sys_flash {TCM_READ_WAIT} {144}
set_instance_parameter_value sys_flash {TCM_WRITE_WAIT} {144}
set_instance_parameter_value sys_flash {TCM_SETUP_WAIT} {33}
set_instance_parameter_value sys_flash {TCM_DATA_HOLD} {33}
set_instance_parameter_value sys_flash {TCM_MAX_PENDING_READ_TRANSACTIONS} {3}
set_instance_parameter_value sys_flash {TCM_TURNAROUND_TIME} {2}
set_instance_parameter_value sys_flash {TCM_TIMING_UNITS} {0}
set_instance_parameter_value sys_flash {TCM_READLATENCY} {2}
set_instance_parameter_value sys_flash {TCM_SYMBOLS_PER_WORD} {4}
set_instance_parameter_value sys_flash {USE_READDATA} {1}
set_instance_parameter_value sys_flash {USE_WRITEDATA} {1}
set_instance_parameter_value sys_flash {USE_READ} {1}
set_instance_parameter_value sys_flash {USE_WRITE} {1}
set_instance_parameter_value sys_flash {USE_BEGINTRANSFER} {0}
set_instance_parameter_value sys_flash {USE_BYTEENABLE} {0}
set_instance_parameter_value sys_flash {USE_CHIPSELECT} {1}
set_instance_parameter_value sys_flash {USE_LOCK} {0}
set_instance_parameter_value sys_flash {USE_ADDRESS} {1}
set_instance_parameter_value sys_flash {USE_WAITREQUEST} {0}
set_instance_parameter_value sys_flash {USE_WRITEBYTEENABLE} {0}
set_instance_parameter_value sys_flash {USE_OUTPUTENABLE} {0}
set_instance_parameter_value sys_flash {USE_RESETREQUEST} {0}
set_instance_parameter_value sys_flash {USE_IRQ} {0}
set_instance_parameter_value sys_flash {USE_RESET_OUTPUT} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_READ} {1}
set_instance_parameter_value sys_flash {ACTIVE_LOW_LOCK} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_WRITE} {1}
set_instance_parameter_value sys_flash {ACTIVE_LOW_CHIPSELECT} {1}
set_instance_parameter_value sys_flash {ACTIVE_LOW_BYTEENABLE} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_OUTPUTENABLE} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_WRITEBYTEENABLE} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_WAITREQUEST} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_BEGINTRANSFER} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_RESETREQUEST} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_IRQ} {0}
set_instance_parameter_value sys_flash {ACTIVE_LOW_RESET_OUTPUT} {0}
set_instance_parameter_value sys_flash {CHIPSELECT_THROUGH_READLATENCY} {0}
set_instance_parameter_value sys_flash {IS_MEMORY_DEVICE} {1}
set_instance_parameter_value sys_flash {MODULE_ASSIGNMENT_KEYS} {embeddedsw.configuration.hwClassnameDriverSupportList \
embeddedsw.configuration.hwClassnameDriverSupportDefault \
embeddedsw.CMacro.SETUP_VALUE \
embeddedsw.CMacro.WAIT_VALUE \
embeddedsw.CMacro.HOLD_VALUE \
embeddedsw.CMacro.TIMING_UNITS \
embeddedsw.CMacro.SIZE \
embeddedsw.memoryInfo.MEM_INIT_DATA_WIDTH \
embeddedsw.memoryInfo.HAS_BYTE_LANE \
embeddedsw.memoryInfo.IS_FLASH \
embeddedsw.memoryInfo.GENERATE_DAT_SYM \
embeddedsw.memoryInfo.GENERATE_FLASH \
embeddedsw.memoryInfo.DAT_SYM_INSTALL_DIR \
embeddedsw.memoryInfo.FLASH_INSTALL_DIR}
set_instance_parameter_value sys_flash {MODULE_ASSIGNMENT_VALUES} {altera_avalon_lan91c111:altera_avalon_cfi_flash1616 \
altera_avalon_cfi_flash1616 \
33 \
144 \
33 \
ns \
134217728u \
32 \
1 \
1 \
1 \
1 \
SIM_DIR \
APP_DIR}
set_instance_parameter_value sys_flash {INTERFACE_ASSIGNMENT_KEYS} {embeddedsw.configuration.isFlash \
embeddedsw.configuration.isMemoryDevice \
embeddedsw.configuration.isNonVolatileStorage}
set_instance_parameter_value sys_flash {INTERFACE_ASSIGNMENT_VALUES} {1 \
1 \
1}
add_connection sys_flash.tcm sys_flash_bridge.tcs
add_connection sys_clk.clk sys_flash.clk
add_connection sys_clk.clk_reset sys_flash.reset
# cpu
add_instance sys_cpu altera_nios2_gen2
@ -85,7 +174,7 @@ set_instance_parameter_value sys_cpu {setting_support31bitdcachebypass} {0}
set_instance_parameter_value sys_cpu {setting_activateTrace} {1}
set_instance_parameter_value sys_cpu {mmu_autoAssignTlbPtrSz} {0}
set_instance_parameter_value sys_cpu {mmu_TLBMissExcOffset} {4096}
set_instance_parameter_value sys_cpu {resetSlave} {sys_ddr3_cntrl_arch.ctrl_amm_0}
set_instance_parameter_value sys_cpu {resetSlave} {sys_flash.uas}
set_instance_parameter_value sys_cpu {mmu_TLBMissExcSlave} {sys_tlb_mem.s2}
set_instance_parameter_value sys_cpu {exceptionSlave} {sys_ddr3_cntrl_arch.ctrl_amm_0}
set_instance_parameter_value sys_cpu {breakSlave} {sys_cpu.jtag_debug_module}
@ -115,6 +204,18 @@ set_connection_parameter_value sys_cpu.instruction_master/sys_int_mem.s1 baseAdd
set_connection_parameter_value sys_cpu.tightly_coupled_instruction_master_0/sys_tlb_mem.s2 baseAddress {0x10200000}
set_connection_parameter_value sys_cpu.tightly_coupled_data_master_0/sys_tlb_mem.s1 baseAddress {0x10200000}
add_connection sys_cpu.data_master sys_flash.uas
set_connection_parameter_value sys_cpu.data_master/sys_flash.uas arbitrationPriority {1}
set_connection_parameter_value sys_cpu.data_master/sys_flash.uas baseAddress {0x11000000}
set_connection_parameter_value sys_cpu.data_master/sys_flash.uas defaultConnection {0}
add_connection sys_cpu.instruction_master sys_flash.uas
set_connection_parameter_value sys_cpu.instruction_master/sys_flash.uas arbitrationPriority {1}
set_connection_parameter_value sys_cpu.instruction_master/sys_flash.uas baseAddress {0x11000000}
set_connection_parameter_value sys_cpu.instruction_master/sys_flash.uas defaultConnection {0}
# cpu/hps handling
proc ad_cpu_interrupt {m_irq m_port} {
@ -318,4 +419,8 @@ ad_cpu_interrupt 5 sys_gpio_in.irq
ad_cpu_interrupt 6 sys_gpio_bd.irq
ad_cpu_interrupt 7 sys_spi.irq
# exported interfaces
add_interface sys_flash conduit end
set_interface_property sys_flash EXPORT_OF sys_flash_bridge.out

View File

@ -7,3 +7,15 @@ derive_pll_clocks
derive_clock_uncertainty
set_false_path -from [get_registers *altera_reset_synchronizer:alt_rst_sync_uq1|altera_reset_synchronizer_int_chain_out*]
# flash interface
set_output_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_addr[*]} ]
set_input_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_data[*]} ]
set_output_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_data[*]} ]
set_output_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_cen[*]} ]
set_output_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_oen} ]
set_output_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_resetn} ]
set_output_delay -clock [ get_clocks sys_clk_100mhz ] 2 [ get_ports {flash_wen} ]
set_false_path -from * -to [get_ports {flash_resetn}]

View File

@ -77,6 +77,17 @@ module system_top (
input [ 10:0] gpio_bd_i,
output [ 15:0] gpio_bd_o,
// flash
output flash_oen,
output [ 1:0] flash_cen,
output [ 27:0] flash_addr, // drop A0 & A1 for 32 bit data bus
inout [ 31:0] flash_data,
output flash_wen,
output flash_advn,
output flash_clk,
output flash_resetn,
// lane interface
input rx_ref_clk,
@ -121,6 +132,12 @@ module system_top (
wire spi_mosi_s;
wire [ 7:0] spi_csn_s;
// User code space at offset 0x0930_0000 per Altera's Board Update Portal
// reference design used to program flash
wire [23:0] flash_addr_raw;
assign flash_addr = flash_addr_raw + 28'h9300000;
// daq2
assign spi_csn_adc = spi_csn_s[2];
@ -170,6 +187,14 @@ module system_top (
assign gpio_bd_o = gpio_o[15:0];
// Common Flash interface assignments
assign flash_resetn = 1'b1; // user_resetn; flash ready after FPGA is configured, reset during configuration
assign flash_advn = 1'b0;
assign flash_clk = 1'b0;
assign flash_cen[1] = flash_cen[0]; // select both flash devices for double-wide 32 bit data width
system_bd i_system_bd (
.rx_serial_data_rx_serial_data (rx_serial_data),
.rx_ref_clk_clk (rx_ref_clk),
@ -213,7 +238,12 @@ module system_top (
.tx_serial_data_tx_serial_data (tx_serial_data),
.tx_ref_clk_clk (tx_ref_clk),
.tx_sync_export (tx_sync),
.tx_sysref_export (tx_sysref));
.tx_sysref_export (tx_sysref),
.sys_flash_tcm_address_out (flash_addr_raw),
.sys_flash_tcm_read_n_out (flash_oen),
.sys_flash_tcm_write_n_out (flash_wen),
.sys_flash_tcm_data_out (flash_data),
.sys_flash_tcm_chipselect_n_out (flash_cen[0]));
endmodule