如何查看查找的内容 table

How to see content of look up table

假设我们有一个简单的fpga代码,我想知道有没有什么办法可以在合成后查看特定lookUptable的内容,实际上是将写入SRAM的数据

module test8(a,b,c

    );
    input a ; 
    input b ;
    output c;

    assign c = a&b;

endmodule

Simple AND gate

可能性取决于 FPGA 供应商的工具。

一些工具有一个 GUI 平面图视图,可以在其中找到使用的 LUT,然后这些 LUT 可以为 LUT 的内存内容附加相关代码。在 Altera Queatus Chip Planner 中,它可能看起来像:

另一种选择是生成完整设计的网表,通常可从 FPGA 工具写入,然后该网表将包含 LUT 以及 LUT 内容的代码。在 Altera Quartus 生成的 Verilog 网表中,它可能看起来像:

...
// Location: LABCELL_X10_Y34_N0
cyclonev_lcell_comb \c~0 (
// Equation(s):
// \c~0_combout  = ( \a~input0  & ( \b~input0  ) )

    .dataa(gnd),
    .datab(gnd),
    .datac(!\b~input0 ),
    .datad(gnd),
    .datae(gnd),
    .dataf(!\a~input0 ),
    .datag(gnd),
    .cin(gnd),
    .sharein(gnd),
    .combout(\c~0_combout ),
    .sumout(),
    .cout(),
    .shareout());
// synopsys translate_off
defparam \c~0 .extended_lut = "off";
defparam \c~0 .lut_mask = 64'h000000000F0F0F0F;
defparam \c~0 .shared_arith = "off";
// synopsys translate_on
...

请注意,GUI 视图显示 AND 门不是仅使用一个简单的 LUT 实现的,因为只要遵守任何时序和其他要求,工具就可以自由地实现它,因为它看起来合适。

但最后LUT编码的具体实现和注意事项,往往被设计者忽略了...除非特殊调试情况。

我找到了这个 Lookuptable 的 vivado GUI