打印
[Actel FPGA]

Synplify Pro综合D触发器置零问题

[复制链接]
1334|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
yoyowodeai|  楼主 | 2010-4-12 21:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
您好:
      我用的是Lidero V9.0,发现综合过程中D触发器的置零端是下降沿触发清零,我想请问能不能调整某个参数使之变成上升沿触发置零的情况,或者有其他办法使之变成综合成上升沿置零。下面是我的代码,我本来是“always @ (posedge clk or posedge rst)”,但是在modlesim后仿真显示错误"$recovery( negedge CLR:499100 ps, posedge CLK:499270 ps, 200ps",后来我改成了“ always @ (negedge clk or posedge rst)“后,modlesim后仿真成功。
module div
    (
    input clk,//106.5M
    input rst,
    output reg   TurnFlag,
    output reg   TurnMoment
    );
    parameter DivFre = 106500;
    //parameter CYCLE  = 6;
    reg[1:0]  DivState;
    reg[16:0] DivCnt;
    reg[9:0]  Div1msCnt;
    reg[9:0]  CYCLE = 9;
    /**********************分频计算得到翻转时刻****************************/
  
    always @ (negedge clk or posedge rst)
    begin
        if(rst)  
        begin
            DivState   <= 2'b00;
            DivCnt     <= 17'b1;
            Div1msCnt  <= 10'b1;
            //CYCLE      <= 10'd10;
            TurnFlag   <= 1'b0;
            TurnMoment <= 1'b0;
        end
        else
        begin   
            case(DivState)
                2'b00:  //DivCnt 0~DivFre
                    begin
                        DivCnt <= DivCnt + 1;
                        if(DivCnt == DivFre)
                            DivState <= 2'b01;
                        else
                        begin
                            DivState <= 2'b00;
                        end
                    end
                2'b01:  //DivCnt清零且Div1msCnt+1
                    begin
                        DivCnt <= 1;
                        Div1msCnt <= Div1msCnt + 1;
                        TurnMoment <= ~TurnMoment;//1ms时间到,波形跳变
                        if(Div1msCnt == CYCLE)
                        begin
                            DivState <= 2'b10;
                        end
                        else
                        begin
                            DivState <= 2'b00;
                        end
                    end
                2'b10:  //Div1msCnt清零且回到初始状态
                    begin
                        Div1msCnt <= 1;
                        TurnFlag <= ~TurnFlag;//周期时间到,波形跳变
                        DivState <= 2'b00;
                    end
                default:
                    begin
                        DivState <= 2'b00;
                    end
            endcase
        end
    end
   
  
endmodule

相关帖子

沙发
yoyowodeai|  楼主 | 2010-4-12 21:54 | 只看该作者
自己顶下

使用特权

评论回复
板凳
年轻不在| | 2010-4-15 21:38 | 只看该作者
好长啊,帮顶

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

191

主题

1265

帖子

2

粉丝