Skip to content

Commit

Permalink
Enabled the pin assignment by quartus
Browse files Browse the repository at this point in the history
Signed-off-by: y <hui1.teng.lim@intel.com>
  • Loading branch information
hui1teng authored and FelixWongSiewAn committed Mar 28, 2024
1 parent 1ffdc08 commit 1527aca
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 65 deletions.
97 changes: 48 additions & 49 deletions sm_soc_devkit_ghrd/create_ghrd_quartus.tcl
Expand Up @@ -185,55 +185,54 @@ if {[info exists pin_assignment_table]} {

set_instance_assignment -name IO_STANDARD "1.8 V" -to hps_osc_clk

if {$hps_emif_en} {
if {$board == "hidden"} {

# set ranks r1
# set width $hps_emif_width
set ecc $hps_emif_ecc_en
set key x32_r1
}
if {$ecc} {
incr width 8
}

# set key "x${width}_$ranks"

# Search for key in the first line
set key_line [lindex $pin_matrix 0]
set idx [lsearch $key_line $key]

if {$idx < 0} {
error "Could not locate configuration $key for EMIF generation"
}

set mem_type_idx [lsearch $key_line "MEM"]

if {$mem_type_idx < 0} {
error "Could not locate memory type specifier in pinout matrix for EMIF generation"
}

puts "key = $key"
puts "board = $board"
puts "mem_type = $hps_emif_type"

# Now add all items
set skip_first 1
foreach key_line $pin_matrix {
if {$skip_first} {
set skip_first 0
} else {
set pin [lindex $key_line $idx]
set mem_type [lindex $key_line $mem_type_idx]

if {$pin != "unused" && (($mem_type == $hps_emif_type) || ($mem_type == "both"))} {
set_location_assignment $pin -to [lindex $key_line 0]
puts "Setting: set_location_assignment $pin -to [lindex $key_line 0]"
}
}
}
}
set_instance_assignment -name IO_STANDARD "1.8 V" -to hps_osc_clk
#if {$hps_emif_en} {
# if {$board == "hidden"} {
#
## set ranks r1
## set width $hps_emif_width
# set ecc $hps_emif_ecc_en
# set key x32_r1
# }
# if {$ecc} {
# incr width 8
# }
#
## set key "x${width}_$ranks"
#
# # Search for key in the first line
# set key_line [lindex $pin_matrix 0]
# set idx [lsearch $key_line $key]
#
# if {$idx < 0} {
# error "Could not locate configuration $key for EMIF generation"
# }
#
# set mem_type_idx [lsearch $key_line "MEM"]
#
# if {$mem_type_idx < 0} {
# error "Could not locate memory type specifier in pinout matrix for EMIF generation"
# }
#
# puts "key = $key"
# puts "board = $board"
# puts "mem_type = $hps_emif_type"
#
# # Now add all items
# set skip_first 1
# foreach key_line $pin_matrix {
# if {$skip_first} {
# set skip_first 0
# } else {
# set pin [lindex $key_line $idx]
# set mem_type [lindex $key_line $mem_type_idx]
#
# if {$pin != "unused" && (($mem_type == $hps_emif_type) || ($mem_type == "both"))} {
# set_location_assignment $pin -to [lindex $key_line 0]
# puts "Setting: set_location_assignment $pin -to [lindex $key_line 0]"
# }
# }
# }
#}

if {$hps_io_off == 0} {
set_instance_assignment -name IO_STANDARD "1.8 V" -to hps_jtag_tck
Expand Down
32 changes: 16 additions & 16 deletions sm_soc_devkit_ghrd/top_level_template.v.terp
Expand Up @@ -473,23 +473,23 @@ ${qsys_name} soc_inst (
@@}
@@if {$hps_emif_en == 1} {
@@if {$hps_emif_type == "ddr4"} {
.emif_hps_emif_mem_0_mem_ck_t (emif_hps_emif_mem_0_mem_ck_t),
.emif_hps_emif_mem_0_mem_ck_c (emif_hps_emif_mem_0_mem_ck_c),
.emif_hps_emif_mem_0_mem_a (emif_hps_emif_mem_0_mem_a),
.emif_hps_emif_mem_0_mem_act_n (emif_hps_emif_mem_0_mem_act_n),
.emif_hps_emif_mem_0_mem_ba (emif_hps_emif_mem_0_mem_ba),
.emif_hps_emif_mem_0_mem_bg (emif_hps_emif_mem_0_mem_bg),
.emif_hps_emif_mem_0_mem_cke (emif_hps_emif_mem_0_mem_cke),
.emif_hps_emif_mem_0_mem_cs_n (emif_hps_emif_mem_0_mem_cs_n),
.emif_hps_emif_mem_0_mem_odt (emif_hps_emif_mem_0_mem_odt),
.emif_hps_emif_mem_0_mem_ck_t (emif_hps_emif_mem_0_mem_ck_t),
.emif_hps_emif_mem_0_mem_ck_c (emif_hps_emif_mem_0_mem_ck_c),
.emif_hps_emif_mem_0_mem_a (emif_hps_emif_mem_0_mem_a),
.emif_hps_emif_mem_0_mem_act_n (emif_hps_emif_mem_0_mem_act_n),
.emif_hps_emif_mem_0_mem_ba (emif_hps_emif_mem_0_mem_ba),
.emif_hps_emif_mem_0_mem_bg (emif_hps_emif_mem_0_mem_bg),
.emif_hps_emif_mem_0_mem_cke (emif_hps_emif_mem_0_mem_cke),
.emif_hps_emif_mem_0_mem_cs_n (emif_hps_emif_mem_0_mem_cs_n),
.emif_hps_emif_mem_0_mem_odt (emif_hps_emif_mem_0_mem_odt),
.emif_hps_emif_mem_0_mem_reset_n (emif_hps_emif_mem_0_mem_reset_n),
.emif_hps_emif_mem_0_mem_par (emif_hps_emif_mem_0_mem_par),
.emif_hps_emif_mem_0_mem_alert_n (emif_hps_emif_mem_0_mem_alert_n),
.emif_hps_emif_mem_0_mem_dqs_t (emif_hps_emif_mem_0_mem_dqs_t),
.emif_hps_emif_mem_0_mem_dqs_c (emif_hps_emif_mem_0_mem_dqs_c),
.emif_hps_emif_mem_0_mem_dq (emif_hps_emif_mem_0_mem_dq),
.emif_hps_emif_oct_0_oct_rzqin (emif_hps_emif_oct_0_oct_rzqin),
.emif_hps_emif_ref_clk_0_clk (emif_hps_emif_ref_clk_0_clk),
.emif_hps_emif_mem_0_mem_par (emif_hps_emif_mem_0_mem_par),
.emif_hps_emif_mem_0_mem_alert_n (emif_hps_emif_mem_0_mem_alert_n),
.emif_hps_emif_mem_0_mem_dqs_t (emif_hps_emif_mem_0_mem_dqs_t),
.emif_hps_emif_mem_0_mem_dqs_c (emif_hps_emif_mem_0_mem_dqs_c),
.emif_hps_emif_mem_0_mem_dq (emif_hps_emif_mem_0_mem_dq),
.emif_hps_emif_oct_0_oct_rzqin (emif_hps_emif_oct_0_oct_rzqin),
.emif_hps_emif_ref_clk_0_clk (emif_hps_emif_ref_clk_0_clk),
@@}
@@}
@@}
Expand Down

0 comments on commit 1527aca

Please sign in to comment.