Skip to content

Commit

Permalink
projects/dac_fmc_ebz/common: Custom config params
Browse files Browse the repository at this point in the history
If the parameters are not listed in any of the
supported modes, the user can configure them through make parameters.

e.g.:

make ADI_DAC_DEVICE=AD9164 M=1 L=8 S=4 F=1 HD=1 N=16 NP=16
or
make ADI_DAC_DEVICE=AD9164 ADI_DAC_MODE=08 M=1 S=4

This will result in the same configuration:

M=1 L=8 S=4 F=1 HD=1 N=16 NP=16

Signed-off-by: PopPaul2021 <[email protected]>
  • Loading branch information
PopPaul2021 committed Nov 14, 2024
1 parent fb9a0e9 commit 11e2afe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions projects/dac_fmc_ebz/common/config.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ set params(AD9164,03) {2 3 3 4 1 16 16}
set params(AD9164,04) {2 4 1 1 1 16 16}
set params(AD9164,06) {2 6 3 2 1 16 16}
set params(AD9164,08) {2 8 2 1 1 16 16}
set params(AD9164,09) {1 8 4 1 1 16 16}
set params(AD9164,device_code) 3

# AD9171
Expand Down Expand Up @@ -166,7 +165,11 @@ proc get_config_param {param} {
upvar params params

set jesd_params {M L S F HD N NP}
set index [lsearch $jesd_params $param]

return [lindex $params($device,$mode) $index]
if {[info exists ::env($param)]} {
return $::env($param)
} else {
set index [lsearch $jesd_params $param]
return [lindex $params($device,$mode) $index]
}
}

0 comments on commit 11e2afe

Please sign in to comment.