SystemVerilog之小知识0

📅 2026/7/4 4:54:18
SystemVerilog之小知识0
1.生成1Ghz时钟按照周期/2分别高低电平logic clk_1g0;forever begin#0.5ns clk_1g ~ clk_1g;end2.timescale 1ns/1ps时间单位仿真延时的基准1ns;比如#1等价于#1ns;时间精度仿真最小分辨刻度决定小数延时精度注意精度不能大于单位否则会报错3.约束产生一堆不相同的数字,取值在0100并且递增rand bit [7:0] data[10];constraint c_unique{foreach(data[i]){data[i] inside{[0:100]};if(i0)data[i] data[i-1];}unique{data};}