DFAPacketizer with StateTrans != 0 Assertion

Hi,

I'm trying to get the DFAPacketizer to work for my target but with any
instruction I get the
'Assertion `CachedTable.count(StateTrans) != 0' failed' error and it crashes
out before packeting a single instruction.

I have a *GenDFAPacketizer.inc file and my packetizer pass checks that the
table is not empty before proceeding. I also have a schedule file with my
functional units and itineraries listed. Can anyone think of what I may have
missed to cause this error?

Cheers,
sam

Hi Sam,

Hi,

I'm trying to get the DFAPacketizer to work for my target but with any
instruction I get the
'Assertion `CachedTable.count(StateTrans) != 0' failed' error and it crashes
out before packeting a single instruction.

Do you reserve some resource without verification?

Note that reserveResources() should be called iff canReserveResources() is true (the call order is important here) even for the trivial case (0 instructions in the packet). See VLIWPacketizerList as an example on how to use the API's.

Ivan

Hi Ivan,

The assertion was happening because I wasn’t checking after the first attempt failed. The first packet was failing and so it was ended, and then the packetizer attempted to add it to the next packet without checking for available resources. However this highlights probably the real problem - my packetizer is unable to find resources for the first instruction, or any of my instructions for that matter. Have you ever seen this problem before?

thanks
sam

Sam,

> However this highlights probably the real problem - my packetizer is
> unable to find resources for the first instruction, or any of my instructions
> for that matter. Have you ever seen this problem before?

I would recommend looking at <Target>DFAStateInputTable in <Target>GenDFAPacketizer.inc. That table contains <input, transition> pairs for each state. Each row in the table marks the beginning of a new state. In your case, I'd suggest examining the first row in the table (the DFA's initial state is state 0 which corresponds to the first row) to figure out what the generated DFA is for your target.

-Anshu

Hi sam,

Hi Ivan,

The assertion was happening because I wasn’t checking after the first attempt failed. The first packet was failing and so it was ended, and then the packetizer attempted to add it to the next packet without checking for available resources. However this highlights probably the real problem - my packetizer is unable to find resources for the first instruction, or any of my instructions for that matter. Have you ever seen this problem before?

No. AFAIK, the DFA expects the instruction to have well defined itinerary with its resource utilisation. Does your first instruction have an defined itinerary?

Ivan

Thanks Anshu and Ivan,

It appears the problem was arising from the naming and usage of functional
units across different subtargets. I have renamed the units for each target
and it now works as expected.