verilog-to-routing / vtr-verilog-to-routing

Verilog to Routing -- Open Source CAD Flow for FPGA Research
https://verilogtorouting.org
Other
988 stars 380 forks source link

The same molecules with the same logical blocks being packed up to three times #25

Open kmurray opened 9 years ago

kmurray commented 9 years ago

Originally reported on Google Code with ID 32

What steps will reproduce the problem?
1. Trunk version from May 28th
2. In pack.c line 86 after lis_of_pack_molecules is assigned: use the following to
print the molecules and their respective logical_blocks:

#if 1   /*Alshahna -- sanity check of molecule blocks */
        cur_molecule = list_of_pack_molecules;
        while(cur_molecule != NULL) {
            printf("IN PACK: This molecule has the following number of logic blocks: '%d' \n",

                    cur_molecule->num_blocks);
            for (i=0; i < cur_molecule->num_blocks; i++) {
                printf("logical blocks '%s'\n", cur_molecule->logical_block_ptrs[i]->name);

            }
            cur_molecule = cur_molecule->next;
        }
#endif  /*endAlshahna*/

3.

What is the expected output? What do you see instead?

I expected each logical block to be packed into a molecule once...instead I'm seeing
all blocks packed into molecules 3 times. As in the exact same packed molecule three
times. 

What version of the product are you using? On what operating system?

Trunk version from May 28th, Debian.

Please provide any additional information below.

Have included the output file which shows a printout of the molecules -- start at the
molecule that has n1231, the list of molecules after this is repeated three times I
believe.

Reported by alshahna.jamal on 2012-06-04 18:46:20


kmurray commented 9 years ago
That is a good sanity check you have.  Are you using a fracturable LUT architecture
with molecules?  If yes, then this behaviour you see is normal because you have in
fact three unique architectural LUT+FF patterns each of which correspond to different
parts of the complex block.

Pattern #1: 6-LUT to flip-flop
Pattern #2: 5-LUT to flip-flop shared with pattern #1
Pattern #3: 5-LUT to flip-flop not shared with pattern #1

One thing that I could do to reduce the molecule search space is to prune away patterns
that become dominated.  But in this situation, it's actually not obvious whether or
not there is a dominating molecule.  Pre-packing to the 5-LUT + FF is obvious but there
is a non-obvious case where one may wish to pre-pack to the 6-LUT for speed reasons
(the fastest LUT input cannot be used in dual 5-LUT mode so the larger 6-LUT should
be used instead).

Another implementation that I could have done instead is reduce the control the architect
has when specifying pack patterns to only specify patterns for netlist blocks without
regard to physical implementation.  For example, the architect can specify that the
tool look for LUT+FF pairs in the netlist and the tool will auto-infer when such cases
make sense and when they do not make sense in the architecture.        This will reduce
the number of molecules generated.  I don't intend to implement this because our intention
is to eventually remove the need for the architect to specify pack_patterns to begin
with.  So if the packer was smart enough to auto-infer when a molecule exists in the
architecture given a netlist molecule, then it is pretty close to being smart enough
to automate that whole process.

Reported by JasonKaiLuu on 2012-06-04 19:28:50

kmurray commented 9 years ago

Reported by JasonKaiLuu on 2012-06-04 19:29:24

kmurray commented 9 years ago
Oh I see, thanks for explaining this!

Yes, I am using a fracturable LUT architecture with molecules.

Reported by alshahna.jamal on 2012-06-04 20:08:50

kmurray commented 9 years ago

Reported by JasonKaiLuu on 2012-06-04 21:51:28

kmurray commented 9 years ago
Is it right to assume that in clustering, the most feasible molecule of the three packing
patterns (with the same logical blocks) will be chosen? As in right now there are three
molecules with the same logical blocks but each logical block is only clustered once
... so the best molecule for this is chosen?

Reported by alshahna.jamal on 2012-07-12 19:36:30

kmurray commented 9 years ago
Yes, the "best" molecule gets chosen where "best" is based on cost functions during
packing.

Works well right now for regular BLEs and fracturable LUT BLEs but I got some work
to do making this more robust for other kinds of blocks (The performance of molecules
is right now hit-and-miss for other kinds of structures).

Reported by JasonKaiLuu on 2012-07-12 19:45:39