Debian Codegraph @

thirdparty/analogdevicesinc/no-OS/scripts/capture.tcl

raw
1
2 # xsdb tcl file
3
4 set m_type [lindex $argv 0]
5
6 connect
7
8 if {$m_type == "ZYNQ_PSU"} {
9 targets -set -filter {name =~ "PSU"}
10 }
11
12 if {$m_type == "ZYNQ_PS7"} {
13 targets -set -filter {name =~ "xc7z*"}
14 }
15
16 if {$m_type == "MICROBLAZE"} {
17 targets -set -filter {name =~ "xc*"}
18 }
19
20 puts "Moving data into .csv files..."
21
22 after 1000
23
24 set readData [list]
25
26 set startAddress 8388608
27
28 for {set i 0} {$i < 32768} {incr i 1} {
29 set readData [lappend $readData [mrd -force [expr $startAddress + $i]]]
30 }
31
32 set fp1 [ open channel_0.csv w ]
33 set fp2 [ open channel_1.csv w ]
34 for {set index 1} {$index < 65536} {incr index 2} {
35 set data [lindex $readData $index]
36 set intData [expr 0x$data]
37
38 set sampleI1 [expr {$intData & 0xFFFF}]
39 set sampleQ1 [expr {($intData >> 16) & 0xFFFF}]
40
41 puts $fp1 $sampleI1
42 puts $fp2 $sampleQ1
43
44 }
45 close $fp1
46 close $fp2
47
48 puts "Done."
49
50 disconnect 64
51 exit