斯芬克斯的Verilog域
sphinx-verilog-domain的Python项目详细描述
警告
这个扩展正处于开发阶段。在
依赖关系
- lark-parser
使能
在conf.py中添加扩展名:
extensions = [ 'sphinx_verilog_domain' ]
使用
模块标题(目前仅限非ANSI样式):
^{pr2}$港口申报:
.. verilog:port:: input wire [31:0] a, b;
参数声明:
.. verilog:parameter:: parameter logic param_name_05 = 1, param_name_05_b = 2;
在引用中使用的自定义名称:
.. verilog:module:: module \35(4p3|) (z); :refname: module_escaped
参考文献:
Reference to :verilog:ref:`Top` Reference to :verilog:ref:`module_escaped` - links to ``\\35(4p3|)``
嵌套:
.. verilog:module:: module Top1(a, b, c); .. verilog:port:: input a; Description of port ``a`` .. verilog:port:: input b; Description of port ``b`` .. verilog:module:: module Nested(a); .. verilog:port:: output a; Description of port ``a`` in ``Nested`` Reference to module ``Top1``'s port ``a``: :verilog:ref:`Top1.a`.
名称空间
更改当前Verilog作用域有三个指令:
- .. verilog:namespace:: A::B-将当前作用域设置为A::B。使用$root作为参数或使用不带参数的指令可设置全局命名空间。在
- .. verilog:namespace-push::C::D-将当前作用域设置为相对于当前作用域的C::D
- .. verilog:namespace-pop::-还原在调用前一个namespace-push之前处于活动状态的作用域。如果没有匹配的namespace-push,则scope设置为global scope。在
注意
verilog::namespace重置推/弹出堆栈
示例:
.. verilog:namespace:: A::B .. verilog:port:: input inside_a_b; .. verilog:namespace-push:: C::D .. verilog:port:: input inside_a_b_c_d; .. verilog:namespace-pop:: .. verilog:port:: input inside_a_b_again; .. verilog:namespace:: .. verilog:port:: input in_global_namespace;
发展
创建和开放全系统的开发环境 python包使用:
make env source env/conda/bin/activate sphinx-verilog-domain
- 项目
标签: