【问题标题】:Asynchronous D FlipFlop synthesis异步 D 触发器综合
【发布时间】:2015-10-07 17:03:33
【问题描述】:
 module dff_async(clk,r1,r2,dout);
 input clk,r1,r2;
 output reg dout;

  always@(posedge clk or negedge r1)
  begin

    if(r2)
      dout<=1'b1;
    else
      dout<=1'b0;
  end

 endmodule

以上代码没有合成,有错误:

合成不支持多条单边下的赋值

根据我的解释,代码应该已经合成如上图所示。我无法找到问题。什么是停止合成代码?

【问题讨论】:

  • 是不是因为灵敏度列表中有两个异步信号,即 clk 和 r1,所以工具无法识别哪个应该是时钟信号? clk 还是 r1 ?

标签: asynchronous verilog synthesis flip-flop


【解决方案1】:

r1 为低时,您需要异步重置dout

module dff_async (clk,r1,r2,dout);
    input clk,r1,r2;
    output reg dout;

    always @(posedge clk or negedge r1) begin
        if (!r1) begin
            dout <= 1'b0;
        end
        else begin
            dout <= r2;
        end
    end
endmodule

请注意,多路复用器的代码已被简化。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-07
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 1970-01-01
    相关资源
    最近更新 更多