【发布时间】:2021-03-04 07:40:24
【问题描述】:
考虑一个连线类型变量 x。在 begin-end 块内赋值。例如 开始 x = 1'b0 结束
在 begin-end 块之外。例如
赋值 x = 1'b0
它们之间的主要区别是什么?
【问题讨论】:
-
您不能对电线进行程序分配
标签: system-verilog
考虑一个连线类型变量 x。在 begin-end 块内赋值。例如 开始 x = 1'b0 结束
在 begin-end 块之外。例如
赋值 x = 1'b0
它们之间的主要区别是什么?
【问题讨论】:
标签: system-verilog
Verilog 有两种结构,结构和程序。
在模块中,您可以有声明和结构构造,例如generate,模块实例,分配。这些是代表电路中一部分的东西。
input data
wire a;
wire b;
assign a = data; // this is a wire connection in the circuit
assign b = ~data; // this an inverted gate and b is connected to its output
你有过程上下文,你可以在其中描述更像编程的逻辑。
// sequential logic
always @(posedge clk or negedge rstn) begin
// here you cannot assign
if(~rstn) begin
// here you reset your logic
end
else begin
// here you write some logic that can be though
// as an event handler
// every variable here will be be store in a flop
a <= data;
// the value of a is not updated at this point
// only after the block execution ends
// it is called non-blocking assignment
end
end
input data;
reg b;
always @(data) begin
b = data; // b is not a flop even though it was declared as a reg.
end
还有很多,如果你把你的问题更具体一些,它可能有助于回答。
【讨论】: