4.  General Partitioning Guidelines

本文提供了FPGA设计分区的指导原则,包括按功能和规模、时钟域及时序关键性来划分设计,以及如何考虑变更因素。建议创建大小相近的设计分区,并尽量减少文件间的依赖。

 4.  General Partitioning Guidelines

    The first step in planning your design partitions is to organize your source code

4.1  Plan Design Hierarchy and Design Files

    hierarchy : 

      the partition includes the assigned instance and entities instantiated below that are not defined as separate partitions.

      combine hierarchical partitions into a single partition, as long as they have the same immediate parent partition.

      keep logic in the “leaves” of the hierarchy 

    files:

      Create entities that can form partitions of approximately equal size.

      Create each entity in an independent file.

      Commands such as VHDL use and Verilog HDL include create dependencies between files, Avoid these types of file dependencies if possible.  

4.1.1 Using Partitions with Third-Party Synthesis Tools

    create a separate Verilog Quartus Mapping File (.vqm) or EDIF Input File (.edf) netlist for each hierarchical partition.

4.2  Partition Design by Functionality and Block Size

    Keeping functional blocks together means that synthesis and fitting can optimize related logic as a whole

    how many partitions  --> the size

    compiling small partitions is typically faster than compiling large partitions  -->  the size not too big

    too many partitions can reduce the quality of results by limiting optimization --> each partition should contain more than approximately 2,000 LEs or ALMs

4.3  Partition Design by Clock Domain and Timing Criticality

    keep clock domains within one partition.

    Additionally, limiting the number of clocks within each partition simplifies the timing requirements for each partition during optimization.

4.4  Consider What Is Changing

    As a general rule, create partitions to isolate logic that will change from logic that will not change.

    compile one time and immediately preserve the results and not have to compile that part of the design again.

    recompile only the changing part while the rest of the design remains unchanged.

转载于:https://www.cnblogs.com/testset/archive/2013/05/21/3090847.html

### Collectors.partitioningBy() 方法详解 `Collectors.partitioningBy()` 是 Java 8 中引入的一个非常有用的收集器方法,用于将流中的元素按照指定的条件划分为两部分:满足条件的部分和不满足条件的部分。它返回的是一个 `Map<Boolean, List<T>>` 类型的结果,其中键为 `true` 的列表包含了满足谓词条件的元素,而键为 `false` 的列表则包含不满足条件的元素。 以下是该方法的具体用法以及其实现细节: #### 使用示例 下面是一个简单的例子来展示如何使用 `partitioningBy()` 将一组整数按奇偶性分类[^1]: ```java import java.util.*; import java.util.stream.Collectors; public class PartitionExample { public static void main(String[] args) { List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5, 6); Map<Boolean, List<Integer>> partitionedNumbers = numbers.stream() .collect(Collectors.partitioningBy(n -> n % 2 == 0)); System.out.println("Even Numbers: " + partitionedNumbers.get(true)); System.out.println("Odd Numbers: " + partitionedNumbers.get(false)); } } ``` 运行结果如下: ``` Even Numbers: [2, 4, 6] Odd Numbers: [1, 3, 5] ``` 在这个例子中,我们通过传递给 `partitioningBy()` 一个 lambda 表达式 `(n -> n % 2 == 0)` 来判断哪些数字是偶数。最终得到的结果是以布尔值作为键的地图结构,分别存储了符合条件(即为真)和不符合条件(即为假)的数值列表。 #### 实现原理 内部实现方面,`partitioningBy()` 基于双桶分区策略工作。具体来说,当调用此方法时会创建两个独立的目标容器——通常情况下这两个目标容器都是基于 ArrayList 构建而成;接着遍历输入源数据集里的每一个项目并依据所提供的断言函数决定应该将其放入哪个分组之中。整个过程可以视为一种特殊的 reduce 操作,在每次迭代过程中更新相应的累积状态直到完成全部处理为止[^2]。 另外值得注意的一点是,由于其设计上的特点决定了只有两种可能的状态存在(要么属于某类子集要么不属于),因此相比其他形式更通用化的 groupByKey 或者类似的机制而言效率更高也更加直观易懂[^3]。 #### 结合下游收集器增强功能 除了基本的功能之外,还可以进一步利用所谓的 **downstream collector** 提升灵活性。例如如果我们不仅仅想要知道某个属性下的数量差异还希望获取更多统计信息的话,则可以通过组合的方式达成目的。以下是如何计算平均年龄的同时区分性别男女的例子[^4]: ```java List<Person> people = ... ; Map<Boolean, Double> averageAgeByGender = people.stream().collect( Collectors.partitioningBy(person -> person.getSex() == Sex.MALE, Collectors.averagingInt(Person::getAge))); ``` 这里我们将标准版升级成了带有额外参数的形式,允许用户自定义对于每一分支该如何继续加工汇总逻辑从而获得更为丰富的分析视角。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值