You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Slot limitations also depends with instructions with immediate values. #55
We would like your help in tackling a scenario where slot limitation also depends with instructions with immediates.
Please have a look below,
The VLIW target that we are trying to experiment can access immediates only through references where 1 packet can access three 8 bit immediate values.
We are facing issue with Scenario 6, as "1200" decimal is converted to two 8 byte decimal value. And considering scenario 6, we are accessing five 8 bit immediate values.
Can you please provide suggestion on how to make Unison aware of such restrictions so that such bundles are not generated.
In our case ADD instr has ALU_ALL slots, thus added in single bundle.
If I got your problem right, you need to define a IMM resource that models the 3 IMM slots (i.e. with capacity 3), and specialize the relevant instructions by number of IMM slots taken (i.e. units of the IMM resource used). For example, you could specialize ADDri into ADDri_1 (which uses 1 unit of IMM) and ADDri_2 (which uses 2 units of IMM), depending on the size of the immediate value. This specialization can be done either on Machine IR, or on Unison IR (during the import or augment phase).
As I'm new to the hashkell, it would be very much helpful if you could point out me more insights or info regarding the same.
However, I have explored the unison code for Hexagon and I could find the "C2mux_ii" instr which takes different operands.
I have also explored the "Transforms.hs" file for C2mux_ii instr marking "muxAlternatives" and "muxOperandType" code. So is this similar to what our case 6 is in above comment?
Please correct if our understanding is wrong..
For preparing a bundle, we consider instructions and ALU slots as a resource. Depending on the criteria of these two the bundle is prepared.
However, we thought to add a new resource "immediate value (IMM)" which will be consider for preparing a bundle. Like, instructions, ALU slots and IMM.
Exploring the unison documents, we found unison doc but the resource model section is not updated. Can you please provide us the updated document?
I have also explored the "Transforms.hs" file for C2mux_ii instr marking "muxAlternatives" and "muxOperandType" code. So is this similar to what our case 6 is in above comment?
muxAlternatives generates instruction alternatives for the solver to consider together with the rest of register allocation and scheduling, because the instruction can be implemented in different ways involving different resource-latency trade-offs. Your case seems to be simpler, as each immediate instruction (e.g. ADDri would only be implemented by one specific version of ADDri, depending on its immediate value. You could even apply this specialization to each instruction before giving the input function to Unison, if that feels easier to do.
Please correct if our understanding is wrong..
For preparing a bundle, we consider instructions and ALU slots as a resource. Depending on the criteria of these two the bundle is prepared.
However, we thought to add a new resource "immediate value (IMM)" which will be consider for preparing a bundle. Like, instructions, ALU slots and IMM.
Yes, this is my suggestion.
Exploring the unison documents, we found unison doc but the resource model section is not updated. Can you please provide us the updated document?
The chapter is unfortunately incomplete, and unlikely to be completed in the near future. In the meantime, you can have a look at Section 6 in this paper, and also read Section 4 in this paper for further background.
Activity
robcasloz commentedon Mar 1, 2021
Hi,
If I got your problem right, you need to define a
IMMresource that models the 3 IMM slots (i.e. with capacity 3), and specialize the relevant instructions by number of IMM slots taken (i.e. units of theIMMresource used). For example, you could specializeADDriintoADDri_1(which uses 1 unit ofIMM) andADDri_2(which uses 2 units ofIMM), depending on the size of the immediate value. This specialization can be done either on Machine IR, or on Unison IR (during theimportoraugmentphase).BR,
Roberto
utkarshyen commentedon Mar 5, 2021
Hello @robcasloz ,
Thank you for the pointer.
As I'm new to the hashkell, it would be very much helpful if you could point out me more insights or info regarding the same.
However, I have explored the unison code for Hexagon and I could find the
"C2mux_ii"instr which takes different operands.I have also explored the
"Transforms.hs"file forC2mux_iiinstr marking"muxAlternatives"and"muxOperandType"code. So is this similar to what our case 6 is in above comment?Regards,
Utkarsh
utkarshyen commentedon Mar 6, 2021
Hello @robcasloz
Please correct if our understanding is wrong..
For preparing a bundle, we consider instructions and ALU slots as a resource. Depending on the criteria of these two the bundle is prepared.
However, we thought to add a new resource "immediate value (IMM)" which will be consider for preparing a bundle. Like, instructions, ALU slots and IMM.
Exploring the unison documents, we found unison doc but the resource model section is not updated. Can you please provide us the updated document?
Regards,
Utkarsh
robcasloz commentedon Mar 7, 2021
muxAlternativesgenerates instruction alternatives for the solver to consider together with the rest of register allocation and scheduling, because the instruction can be implemented in different ways involving different resource-latency trade-offs. Your case seems to be simpler, as each immediate instruction (e.g.ADDriwould only be implemented by one specific version ofADDri, depending on its immediate value. You could even apply this specialization to each instruction before giving the input function to Unison, if that feels easier to do.robcasloz commentedon Mar 7, 2021
Yes, this is my suggestion.
The chapter is unfortunately incomplete, and unlikely to be completed in the near future. In the meantime, you can have a look at Section 6 in this paper, and also read Section 4 in this paper for further background.
utkarshyen commentedon Mar 9, 2021
Hello @robcasloz ,
Thank you for the comment and update.
I shall look into this more and get back to you if anything.
Regards,
Utkarsh