Open ThinkOpenly opened 5 months ago
hey @ThinkOpenly i would like to work on this issue , please assign it to me !!
@harshagr70 , you are welcome to investigate this, but this might not be an easy one. Ask lots of questions.
Interestingly, looking again at the example above, I think there is some unnecessary redundancy. The sign_extend
function is called twice for the imm
parameter, once before calling ADDIW
and once within ADDIW
. That's arguably a bug in the Sail source.
@ThinkOpenly , i am unable to find the function use , or the function discussed above in the /sail repository , please help me figure it out ! , correctly said there's probably a bug in the function's code as mentioned .
i am unable to find the function use , or the function discussed above in the /sail repository
This project has a few related repositories, and I am probably careless in distinguishing among them:
The functions described in the opening comment for this issue can be found in the second repository:
@ThinkOpenly
I’ve submitted a pull request that addresses this issue by implementing the direct C_ADDIW
clause and removing redundant operations. Please review it at your convenience.
I’ve submitted a pull request that addresses this issue by implementing the direct
C_ADDIW
clause and removing redundant operations.
I commented in that PR, but copying some of that reply here for clarification as to the expectation for solving this issue...
The preferred solution would be to emit the (duplicated) code in the JSON produced by the Sail JSON backend, without changing the Sail code at all.
[Or,] it could be that the code emitted in JSON currently is just fine, and the burden of linking the indirect call to the actual code should be left to downstream users of the JSON, like that website referenced in https://github.com/ThinkOpenly/sail/issues/32#issuecomment-2256205026
Interestingly, looking again at the example above, I think there is some unnecessary redundancy. The
sign_extend
function is called twice for theimm
parameter, once before callingADDIW
and once withinADDIW
. That's arguably a bug in the Sail source.
This has nothing to do with this issue, but since I brought it up here, I thought I should resolve it here.
I investigated this, and it seems this is a necessary evil:
C_ADDIW
is given an immediate value of type bits(6)
ADDIW
expects an immediate value of type bits(12)
sign_extend()
is used to sign-extend and promote the bits(6)
value to a bits(12)
value suitable for ADDIW
@ThinkOpenly got it !! , i will raise a pr once i fix the issue in the backend json , thanks for follow up @ThinkOpenly !!
Most
function clause execute
stanzas use a syntax like:Some use a different syntax:
This is an indirect reference to the prior
function clause execute
with some parameter manipulation.It would be nice to substitute the actual code in place of the reference.