Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/fmcomms1/Evaluate/ZC706/capture.tcl

raw
1
2 set currentWorkingDirectory [pwd]
3 set bitFileName "/system.bit"
4 set tclFileName "/ps7_init.tcl"
5 set elfFileName "/capture.elf"
6
7 set bitFilePath $currentWorkingDirectory$bitFileName
8 set tclFilePath $currentWorkingDirectory$tclFileName
9 set elfFilePath $currentWorkingDirectory$elfFileName
10
11 fpga -debugdevice devicenr 2 -f $bitFilePath
12 connect arm hw
13 rst -processor
14 source $tclFilePath
15 ps7_init
16 init_user
17 dow $elfFilePath
18
19 puts "Capturing data..."
20
21 run
22 after 30000
23 stop
24
25 puts "Moving data into rx.csv file..."
26
27 set startAddress 134217728
28 set readData [mrd $startAddress 16384]
29
30 set fp [ open rx.csv a ]
31 for {set index 1} {$index < 32768} {incr index 2} {
32 set data [lindex $readData $index]
33 set intData [expr 0x$data]
34
35 set sampleQ [expr {$intData & 0xFFFF}]
36 set sampleI [expr {($intData >> 16) & 0xFFFF}]
37
38 set line $sampleI,$sampleQ
39
40 puts $fp $line
41 }
42 close $fp
43
44 puts "Done."
45
46 disconnect 64
47 exit