Open tcal-x opened 3 years ago
3402 fanout: net memdat_1[8] driver Cfu.filter_flow_restrictor.initial_VLO_Z:F
-- this seems to be providing 1'b0
i.e. constant zero i.e. GND.
It's driven by an OXIDE_COMB with INIT = 32'h00000000.
Oh, nice find! It's good to know that one is not really specific to the FlowRestrictor
module in spite of its name.
Does it mean it's working as intended -- we expect the design to have some global constant zero with high fan-out, whatever its name happens to be?
Or does this mean it's not properly using the global routing and we need to fix something?
I don't know the details yet about constant handling. I've dealt with it before on other FPGA architectures. One would think it's trivial, but it's not. Sometimes routing muxes or LUT input muxes have inputs hardcoded to 1'b0 and/or 1'b1 to provide sources of constants. Sometimes you need to burn a LUT to generate a constant. It might be cheaper to route a constant from the closest net providing that value. It doesn't make sense to partition the constant nets before placement. I guess you could special-case the router; provide a number of constant sources spread around the fabric, then have the router connect them to sinks as needed using a minimum spanning trees. I was just about to dig into what nextpnr does...
Here's some discussion relating to constant nets with FPGA interchange, between gatecat and litghost: https://github.com/YosysHQ/nextpnr/pull/591
And here's the current code related to packing constant nets for Nexus: https://github.com/YosysHQ/nextpnr/blob/master/nexus/pack.cc#L302-L321
And here's an interesting comment in router2 related to high-fanout const nets on Nexus: https://github.com/YosysHQ/nextpnr/blob/master/common/router2.cc#L516-L517
The takeaway seems to be that high-fanout constant nets have been considered.
I used the following script to print out high-fanout nets in the HPS design. It is used as the --pre-place script in nextpnr.
This is what it produced (I sorted the list afterwards):