0

In the config sequence I would like to create a conditional constraint. I have two clock rates and only a set of combinations of the clock rates are legal in the design.

I am having trouble coming up with the correct syntax to achieve this.The use of case or if statements give me a syntax error. This is what I have right now.

case main_clk{
    1e6:{
        keep div_clk == select{
            80: 5e9;
            20: 5.6e9;
        };
    };
   .
   .
   .
};

I also tried using when but it didn't work. Any suggestions on how I can implement this?

4

1 回答 1

3

首先,我从您的数字中使用科学记数法看到您正在使用real字段。您可能应该切换到使用uint字段,因为从生成的角度来看它们更灵活。

case语句是程序性的,不能用于生成。也是如此if。要在另一个条件上生成一个字段,您需要使用=>(隐含)运算符:

  keep main_clk == 1e6 =>
    soft div_clk == select {
      80: 5e9;
      20: 5.6e9;
    };

对于 的每个可能值,您都需要一个这样的含义main_clk

于 2014-12-13T10:23:10.513 回答