日常记录(86)UART初步等细节
2022/6/1 23:20:29
本文主要是介绍日常记录(86)UART初步等细节,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
UART的RTL连接
左端的uart16550为需要验的模块
验证收集内容
https://gitee.com/bai-mengwei/my_uart_tb
LCR:控制读写格式的
MCR:调制解调控制寄存器
MSR:调制解调状态寄存器
断言:验证apb协议
onehot0
onehot0表示没有高(全为0),则仍然可以断言成功
可以用在检查片选信号上(片选信号每次最多选一个,可以不选)
binsof(x) intersect(y)
bins的选择条件
x的内容中,包括y的部分
如下示例
$stable
是上升沿||下降沿的一种取反。
在判定的时候,不稳定是指代前一个状态发生
module taa (); logic a; logic [2:0] b; logic c; initial begin a = 0; forever begin #10 a = ~a; end end initial begin b = 3'b0; forever begin #20 b = b + 1; end end initial begin c = 0; forever begin #5 c = ~c; end end property STABLE_TEST; @(posedge a) (!$stable(b) && $onehot(b)) |=> c; endproperty MY_ASSERT: assert property(STABLE_TEST); initial begin #100000; $finish; end endmodule
test: taa wave taa: vcs -full64 -sverilog -R -debug_access+all +vcs+vcdpluson taa.sv debug: ./simv -gui & wave: dve -vpd vcdplus.vpd &
fork-join_none在task外的执行
module taa (); task task1(); fork #10; $display("after 10 time"); join_none endtask: task1 task task2(); fork #10; $display("after 10 time"); join endtask: task2 task task3(); begin #10; $display("after 10 time"); end endtask: task3 initial begin $display("before"); task1(); #10; $display("task 1:fork join_none %t", $realtime); task2(); #10; $display("task 2 %t fork join", $realtime); task3(); #10; $display("task 3 %t begin end", $realtime); $finish; end endmodule
taa: vcs -full64 -sverilog -R -debug_access+a taa.sv
输出
before after 10 time task 1:fork join_none 10 after 10 time task 2 30 fork join after 10 time task 3 50 begin end $finish called from file "taa.sv", line 34. $finish at simulation time 50
非连续跟随重复符
连续重复运算符
非连续重复操作符
uvm_reg_predictor
如果使用镜像值获取数据(在function中使用),则必须定义uvm_reg_predictor并连接(bus_in)
例子
自定义概率生成数据的randcase
module taa (); initial begin int x; for (int i = 0; i < 10; i++) begin randcase 1:x=1; 2:x=2; 3:x=3; endcase $display("x is %0d", x); end end endmodule
taa: vcs -sverilog -R taa.sv
输出数据
x is 2 x is 3 x is 1 x is 3 x is 3 x is 3 x is 2 x is 1 x is 2 x is 3
这篇关于日常记录(86)UART初步等细节的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-15鸿蒙生态设备数量超8亿台
- 2024-05-13TiDB + ES:转转业财系统亿级数据存储优化实践
- 2024-05-09“2024鸿蒙零基础快速实战-仿抖音App开发(ArkTS版)”实战课程已上线
- 2024-05-09聊聊如何通过arthas-tunnel-server来远程管理所有需要arthas监控的应用
- 2024-05-09log4j2这么配就对了
- 2024-05-09nginx修改Content-Type
- 2024-05-09Redis多数据源,看这篇就够了
- 2024-05-09Google Chrome驱动程序 124.0.6367.62(正式版本)去哪下载?
- 2024-05-09有没有大佬知道这种数据应该怎么抓取呀?
- 2024-05-09这种运行结果里的10.100000001,怎么能最快改成10.1?