Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

strange results with IORD IOWR

Hi there,

I've made my custom component with 64bit input vector and 8bit output, successfuly connected to system interconnection fabric.

In nios2-ide when I try to send vector to my component using IOWR i get warning:

alt_u64 uwektor1=0x17463f8c62ae;
IOWR(SSN_COMPONENT_WE_BASE, 0, uwektor1);
I get:

--- Quote Start ---

warning: integer constant is too large for "long" type

--- Quote End ---

And then the results read using:

result=IORD_8DIRECT( SSN_COMPONENT_WY_BASE, 0 );
are strage.

Moreover, such a code:

        IOWR(SSN_COMPONENT_WE_BASE, 0, uwektor1);
        result=IORD_8DIRECT( SSN_COMPONENT_WY_BASE, 0 );
        printf("0x%X \n",result);
  
        result=IORD_8DIRECT( SSN_COMPONENT_WY_BASE, 0 );
      printf("0x%X \n",result);
gives me two different results?!

--- Quote Start ---

0xFD

0xDD

--- Quote End ---

(the DD should be correct output)

What could cause such a problem?

Previously I've made and programmed verion with 16bit input and 8bit output and everything was in order.

How should I fix the problem?

Thanks in advance for any tips.

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    IORD/WR work with 32-bit values. I don't know what the exact results are when you supply them with 64-bits integers, but it is most probably not what you would expect.