当前位置:网站首页>SystemVerilog语法
SystemVerilog语法
2022-07-25 09:23:00 【工作使我快乐】
前言
整理工作中用到的基础语法。
1、数据类型
双态数据类型,即只有0 1两个状态,没有x z,有利于提高仿真器性能,减少内存使用。
在写testbench中,bit类型的变量可以用于赋值操作或者连线,也即同时用于类似于reg、wire的功能。
基本数据类型
time 64位整数,默认单位为秒
real 来自Verilog,就如C的double类型,64位
shortreal 来自C的float类型,32位
string 可变长度的字符数组
void 空返回,用于函数
整数数据类型
---默认是有符号数
shortint 16位整型 ,2态(1,0)默认值0
int 32位整型 ,2态(1,0)默认值0
longint 64位整型 ,2态(1,0)默认值0
byte 8位整型(ASCII字符) ,2态(1,0)默认值0
integer 32位整型 ,4态(0、1、X、Z)默认值为x
---默认是无符号数
bit 0或1 ,2态(1,0)默认值0
reg 来自Verilog ,4态(0、1、X、Z)默认值为x
logic 与reg类似 ,4态(0、1、X、Z)默认值为x2、task
task与function最大的区别有两点
(1)task可以添加消耗时间的语句,而function不可以消耗时间 (这一点与verilog相同)。
(2)task可以调用task和function,而function仅能调用function。
还有一点要提醒新手:
task和function中是不能使用initial和always的


3、延时
#100;参考
| 1、作者 | 博文 |
| gsithxy | [SV]SystemVerilog語法小結 |
| SystemVerilog——数据类型 | |
| SystemVerilog—Timescale解析 |
参考
边栏推荐
- 服务器cuda toolkit多版本切换
- In depth interpretation of C language random number function and how to realize random number
- Some skills to reduce the complexity of program space
- *6-2 CCF 2015-03-3 Festival
- CDA Level1知识点总结之业务数据分析
- First knowledge of opencv4.x --- drawing shapes on images
- ~1 CCF 2022-06-2 treasure hunt! Big adventure!
- *7-2 CCF 2015-09-2 date calculation
- First knowledge of opencv4.x --- image template matching
- CCF 201509-3 模板生成系统
猜你喜欢

Creation of adjacency table of undirected connected graph output breadth depth traversal

初识Opencv4.X----为图像添加高斯噪声

TensorFlow raw_rnn - 实现seq2seq模式中将上一时刻的输出作为下一时刻的输入

ARM预备知识

Preliminary understanding and implementation of wechat applet bottom navigation bar

*7-1 CCF 2015-09-1 sequence segmentation

yolov5实现小数据集的目标检测--kolektor缺陷数据集

First knowledge of opencv4.x --- drawing shapes on images

AMD EPYC 9664旗舰规格曝光:96核192线程 480MB缓存 3.8GHz频率

Kotlin basic knowledge points
随机推荐
Customize dialog to realize the pop-up box of privacy clause statement imitating Netease cloud music
matlab绘图|坐标轴axis的一些常用设置
Mixed supervision for surface-defect detection: from weakly to fully supervised learning:表面缺陷检测的混合监督
Some usages of Matlab's find() function (quickly find qualified values)
@4-1 CCF 2020-06-1 linear classifier
解决esp8266无法连接手机和电脑热点的问题
Wechat applet realizes the rotation map (automatic switching & manual switching)
Dream set sail (the first blog)
Kotlin realizes file download
【数据挖掘】最近邻和贝叶斯分类器
【数据挖掘】第四章 分类任务(决策树)
Chmod and chown invalidate the files of the mounted partition
Binary Cross Entropy真的适合多标签分类吗?
【数据挖掘】第二章 认识数据
初识Opencv4.X----为图像添加椒盐噪声
UI prototype resources
基于机智云平台的温湿度和光照强度获取
数据分析业务核心
初识Opencv4.X----图像卷积
Kotlin collaboration: foundation and use of collaboration