VIVADO经常使用TCL脚本对FPGA进行调试,通过JTAG转AXI对内部模块进行控制,但是TCL语言书籍比较少,这边是一个英文的TCL语言学习书籍. 第 1 章. TCL基本知识................................................................................................................1 1.1 什么是TCL..............................................................................................................................1 1.2 TCL自学工具...........................................................................................................................1 1.3 TCL软件包..............................................................................................................................2 1.4 TCL命令格式...........................................................................................................................2 1.5 TCL脚本文件和SOURCE 命令..................................................................................................3 1.6 可执行脚本文件(EXECUTABLE FILE)...........................................................................................3 1.7 获得帮助.................................................................................................................................4 1.7.1 Windows系统.............................................................................................................4 1.7.2 Unix系统......................................................................................................................4 第 2 章. 输出、赋值与替换........................................................................................................5 2.1 PUTS.........................................................................................................................................5 2.2 SET & UNSET..............................................................................................................................5 2.3 替换........................................................................................................................................6 2.3.1 $...................................................................................................................................6 2.3.2 []..................................................................................................................................6 2.3.3 " " 和{}..........................................................................................................................6 2.3.4 \...................................................................................................................................7 第 3 章. 数学表达式与EXPR命令..............................................................................................8 3.1 数学和逻辑运算符..................................................................................................................8 3.2 数学函数.................................................................................................................................8 3.3 数学运算举例.........................................................................................................................9 3.4 INCR命令................................................................................................................................9 第 4 章. 字符串........................................................................................................................10 4.1 基本命令集...........................................................................................................................10 4.2 APPEND命令..........................................................................................................................10 4.3 FORMAT命令..........................................................................................................................10 4.3.1 format命令说明......................................................................................................10 4.3.2 format举例..............................................................................................................11 4.4 SCAN命令.............................................................................................................................12 4.5 BINARY命令...........................................................................................................................13 4.6 SUBST命令..............................................................................................................................14 4.7 STRING 命令...........................................................................................................................15 4.7.1 string 命令列表.........................................................................................................15 4.7.2 字符串比较................................................................................................................16 4.7.3 string match字符串匹配.........................................................................................16 4.7.4 字符串替换................................................................................................................18 4.7.5 字符类别(class)测试.................................................................................................18 4.7.6 字符串映射................................................................................................................19 第 5 章. TCL列表操作..............................................................................................................20 5.1 列表命令集...........................................................................................................................20 5.2 LIST命令.................................................................................................................................20 5.3 CONCAT命令.........................................................................................................................21 5.4 LAPPEND命令........................................................................................................................21 5.5 LLENGTH 命令.........................................................................................................................22 5.6 LINDEX命令............................................................................................................................22 5.7 LRANGE命令..........................................................................................................................22 5.8 LINSERT 和LREPLACE命令........................................................................................................22 5.9 LSEARCH命令.........................................................................................................................23 5.10 LSORT命令.............................................................................................................................24 5.11 JOIN与SPLIT命令...................................................................................................................24 5.12 FOREACH控制结构................................................................................................................27 第 6 章. 数组............................................................................................................................28 6.1 数组的定义与格式................................................................................................................28 6.2 数组变量...............................................................................................................................29 6.3 多维数组...............................................................................................................................29 6.4 数组操作命令.......................................................................................................................30 6.4.1 array get命令.........................................................................................................30 6.4.2 array names命令....................................................................................................30 6.4.3 遍历数组...................................................................................................................31 6.4.4 用数组定义结构........................................................................................................31 第 7 章. 控制结构命令.............................................................................................................32 7.1 IF/ELSE命令............................................................................................................................32 7.2 FOR命令................................................................................................................................33 7.3 WHILE命令.............................................................................................................................33 7.4 BREAK 与 CONTINUE命令........................................................................................................34 7.5 SWITCH命令...........................................................................................................................34 7.6 CATCH 命令...........................................................................................................................35 7.7 ERROR命令............................................................................................................................36 7.8 RETURN 命令...........................................................................................................................37 7.9 EXIT命令................................................................................................................................37 第 8 章. 过程与作用域.............................................................................................................38 8.1 PROC—过程定义命令...........................................................................................................38 8.2 作用域...................................................................................................................................40 8.2.1 过程的作用域............................................................................................................40 8.2.2 变量的作用域............................................................................................................40 8.3 UPVAR命令............................................................................................................................42 8.4 RENAME命令.........................................................................................................................44 8.5 特殊变量...............................................................................................................................45 8.5.1 命令行参数................................................................................................................45 8.5.2 env--环境变量数组...................................................................................................45 8.6 EVAL命令..............................................................................................................................46 8.7 UPLEVEL命令..........................................................................................................................48 第 9 章. 正则表达式(REGULAR EXPRESSIONS)...................................................................49 9.1 REGEXP命令..........................................................................................................................49 9.2 REGSUB命令...........................................................................................................................51 9.3 正则表达式的语法................................................................................................................52 9.3.1 分支(branch)和原子(atom)....................................................................................52 9.3.2 基本语法...................................................................................................................52 9.3.2.1 匹配字符........................................................................................................................................52 9.3.2.2 限定匹配........................................................................................................................................53 9.3.2.3 方括号表达式与字符集.................................................................................................................53 9.3.2.4 匹配分支........................................................................................................................................54 9.3.2.5 量词(Qulifier)...........................................................................................................................54 9.3.2.6 子模式与匹配报告捕获.................................................................................................................55 9.3.2.7 反斜杠引用....................................................................................................................................56 9.3.2.8 匹配优先级....................................................................................................................................56 9.3.3 高级正则表达式(AREs).........................................................................................57 9.3.3.1 反斜杠换码(escape)序列............................................................................................................57 9.3.3.2 归整元素(collating element).....................................................................................................57 9.3.3.3 等价类(equivalence class)........................................................................................................58 9.3.3.4 字符类(character class).............................................................................................................58 9.3.3.5 非贪婪量词....................................................................................................................................59 9.3.3.6 约束量词........................................................................................................................................59 9.3.3.7 回退引用........................................................................................................................................59 9.3.3.8 前瞻(lookahead).........................................................................................................................60 9.3.3.9 换行符敏感的匹配.........................................................................................................................60 9.3.3.10 嵌入式选项...............................................................................................................................60 9.3.3.11 扩展语法...................................................................................................................................60 9.3.4 语法小结...................................................................................................................60 9.3.5 其它支持正则表达式的命令......................................................................................60 第 10 章. 名字空间.................................................................................................................62 10.1 创建名字空间...................................................................................................................62 10.2 用::限定符来使用变量和过程...........................................................................................62 10.3 名字空间的变量...............................................................................................................63 10.4 过程的进口与出口............................................................................................................64 10.5 内省(INTROSPECTION).........................................................................................................65 10.6 名字空间命令集...............................................................................................................65 第 11 章. 跟踪与调试.............................................................................................................67 11.1 CLOCK命令...........................................................................................................................67 11.1.1 clock clicks命令......................................................................................................67 11.1.2 clock seconds命令................................................................................................67 11.1.3 clock format命令...................................................................................................68 11.1.4 clock scan命令.......................................................................................................70 11.2 INFO 命令...............................................................................................................................71 11.2.1 info level..................................................................................................................72 11.2.2 info exists.................................................................................................................72 11.3 TRACE命令............................................................................................................................73 11.3.1 trace variable.........................................................................................................73 11.3.2 trace vdelete..........................................................................................................75 11.3.3 trace vinfo...............................................................................................................75 第 12 章. 脚本库与软件包......................................................................................................76 12.1 声明和使用软件包............................................................................................................76 12.1.1 软件包定位................................................................................................................76 12.1.2 声明软件包命令........................................................................................................76 12.1.3 加载软件包命令........................................................................................................76 12.1.4 自动加载与软件包索引.............................................................................................77 12.1.5 用链接库提供软件包.................................................................................................79 12.2 PACKAGE命令集...................................................................................................................80 12.3 小结..................................................................................................................................80 第 13 章. 文件操作与程序调用...............................................................................................81 13.1 文件操作...........................................................................................................................81 13.1.1 文件I/O....................................................................................................................81 13.1.2 文件系统信息命令.....................................................................................................82 13.1.2.1 glob命令.................................................................................................................................83 13.1.2.2 file命令集.................................................................................................................................83 13.2 程序调用...........................................................................................................................85 13.2.1 用open命令打开一个进程管道..............................................................................85 13.2.2 用exec命令调用程序..............................................................................................87 13.2.3 pid命令....................................................................................................................88 第 14 章. 套接字与事件驱动编程简介....................................................................................89 14.1 套接字编程.......................................................................................................................89 14.1.1 socket命令..............................................................................................................89 14.1.1.1 Client端socket命令..............................................................................................................89 14.1.1.2 Server端socket命令选项......................................................................................................90 14.1.2 用fconfigure配置套接字........................................................................................90 14.1.3 C/S编程举例............................................................................................................90 14.2 事件驱动编程...................................................................................................................93 14.2.1 after命令.................................................................................................................93 14.2.2 fileevent命令..........................................................................................................96 14.2.3 vwait命令................................................................................................................96 14.2.4 fconfigure命令.......................................................................................................97 14.2.4.1 fconfigure语法.......................................................................................................................97 14.2.4.2 非阻塞I/O................................................................................................................................98 14.2.4.3 缓冲..........................................................................................................................................98
2023-01-06 16:54:44 2.43MB TCL VIVADO 脚本
1
osg-3rdparty-cmake, 概念创建用于生成OpenSceneGraph第三方库的脚本 osg-3rdparty-cmake概念创建用于生成OpenSceneGraph第三方库的脚本。这些脚本可以使用 CMake ( http://www.cmake.org/ ) build从源代码构建第三方库。各自库的源代码必须单独
2023-01-06 15:57:23 38KB 开源
1
该资源用于触控精灵 app 中执行脚本使用。需先安装安卓版触控精灵app。 而下载后解压使用触控精灵打开,即可触发悟空浏览器刷宝箱任务脚本。 该脚本为个人测试脚本,不允许用于盈利用途,如有需要,请联系作者获取版权。谢谢!
2023-01-06 09:21:53 69KB 触控精灵 悟空浏览器 宝箱
1
如有多块显卡,可执行 sh nvidia.sh 0 #计算0显卡的剩余显存 sh nvidia,sh 1 #计算1显卡的剩余显存 sh nvidia,sh 2 #计算2显卡的剩余显存 多张显卡以此类推;显卡号与显卡位置互不影响;三系卡、二系卡脚本通用; 注:执行脚本后面必须加参数0或者1【2、3、4、5、6、7、8】;否则会报错;也不可添加英文字母或中文字母;否则也会报错。 nvidia-smi --format=csv --query-gpu=memory.free #也可直接查看显卡的剩余显存,但是和计算的有一定的差异;
2023-01-05 17:06:15 448B nvidia-smi nvidia Linux 显卡驱动
1
TCL脚本入门教程.doc
2023-01-05 16:59:00 517KB Tcl Vivado
1
bat脚本 读取目录下所有文件(递归读取),并复制到指定目录 使用时:先编辑修改读取目录和写入目录
2023-01-05 13:03:51 289B bat
1
二、基本概念 链接器把一个或多个输入文件合成一个输出文件. 输入文件: 目标文件或链接脚本文件. 输出文件: 目标文件或可执行文件. 目标文件(包括可执行文件)具有固定的格式, 在 UNIX 或 GNU/Linux 平台下, 一般为 ELF 格 式 有时把输入文件内的 section 称为输入 section(input section), 把输出文件内的 section 称为 输出 section(output sectin). 目标文件的每个 section 至少包含两个信息: 名字和大小. 大部分 section 还包含与它相关联 的一块数据, 称为 section contents(section 内容). 一个 section 可被标记为“loadable(可加 载的)”或“allocatable(可分配的)”. loadable section: 在输出文件运行时, 相应的 section 内容将被载入进程地址空间中. allocatable section: 内容为空的 section 可被标记为“可分配的”. 在输出文件运行时, 在进 程地址空间中空出大小同 section 指定大小的部分. 某些情况下, 这块内存必须被置零. 如果一个 section 不是“可加载的”或“可分配的”, 那么该 section 通常包含了调试信息. 可用 objdump -h 命令查看相关信息. 每个“可加载的”或“可分配的”输出 section 通常包含两个地址: VMA(virtual memory address 虚拟内存地址或程序地址空间地址)和LMA(load memory address加载内存地址或进程地址 空间地址). 通常 VMA 和 LMA 是相同的. 在目标文件中, loadable 或 allocatable 的输出 section 有两种地址: VMA(virtual Memory Address)和 LMA(Load Memory Address). VMA 是执行输出文件时 section 所在的地址, 而 LMA 是加载输出文件时 section 所在的地址. 一般而言, 某 section 的 VMA == LMA. 但在 嵌入式系统中, 经常存在加载地址和执行地址不同的情况: 比如将输出文件加载到开发板 的 flash中(由 LMA指定), 而在运行时将位于 flash中的输出文件复制到SDRAM中(由VMA 指定). 可这样来理解 VMA 和 LMA, 假设: (1) .data section对应的VMA地址是 0×08050000, 该 section内包含了 3个 32位全局变量, i、j 和 k, 分别为 1,2,3. (2) .text section 内包含由”printf( “j=%d “, j );”程序片段产生的代码. 连接时指定.data section 的 VMA 为 0×08050000, 产生的 printf 指令是将地址为 0×08050004 处的 4 字节内容作为一个整数打印出来。 如果.data section 的 LMA 为 0×08050000,显然结果是 j=2 如果.data section 的 LMA 为 0×08050004,显然结果是 j=1 还可这样理解 LMA:
1
ffmpeg按静音批量切分音频文件脚本
2023-01-04 20:02:41 3KB ffmpeg bash 脚本
1
LatticeVisualization工具 Python软件包将生成各种格子的视觉效果,这有助于演示。 使用的Python软件包 structures.py代码需要运行以下python软件包:-matplotlib -numpy -termcolor -argparse 运行structures.py structure.py代码采用数字输入字符串,并使用它来生成简单立方(sc),体心立方(bcc),面心立方(fcc)和六边形密堆积(hcp)类型的周期晶胞。 通过使用单元格中的原子数作为传入列表中的元素数来生成所需的单元格。 例如,要生产一个带有两个不同原子的密件抄送电池。 我会说: python structures.py -colors 1 2 对于具有所有相同原子的fcc电池,我将输入: python structures.py -colors 1 1 1 1 样本图片 这是
2023-01-04 17:42:03 15KB Python
1
1、可对视频进行批量转码,使用的是ffmpeg对视频进行操作。 2、用ffmpeg对视频进行批量推流,前提是您已有直播服务器,这里批量推流用的服务器是我自己搭建的nginx直播服务。 3、全部是bat脚本文件
2023-01-04 14:20:20 125KB ffmpeg 批量转码 批量推流
1