verilog - 如何在不使用时钟的情况下在verilog中生成PWL或脉冲
问题描述
我正在编写一段代码,我需要在其中根据条件生成输出-
1. if input is X/Z output should be X.
2. if input is 0 output should be 0 with a delay of 0.75us.
3. if input is 1 output should be 5 high going pulses of 1.5us with 50% duty cycle
with a delay of 0.75us.
我很困惑如何在verilog中编写它?
解决方案
fork/join_none
您可以为此使用 SystemVerilog
logic in, out;
always begin
fork
case (in)
0: out <= #0.75us 0;
1: repeat (5) begin
#0.75us out <= 1;
#0.75us out <= 0;
end
default: out <= 'x;
endcase
join_none;
@in
disable fork; // kill repeat loop if still active
end
推荐阅读
- google-cloud-platform - GCP 实例之间的高速通信
- javascript - 选择器参数已更改,但未调用渲染
- swift - 在 SwiftUI 视图中嵌入视频
- python - 剪切 os.system 的输出的一行并将其写入文件
- laravel - 是否值得创建 2 个单独的 Laravel 项目?
- powershell - 如何将变量从 Windows 窗体传递给 exe
- python - 从没有包依赖的 yml 文件创建 conda 环境
- swiftui - InputAccessoryView / 使用 SwiftUI 固定到键盘的视图
- c - 指向字符串的指针以及赋值和取消引用之间的区别
- c# - 如何在 C# 中将数字转换为无符号短(始终为 16 位,大端字节序)