Rules | Recent posts | topic RSS | Search | Register  | Log in

Dont understand the meaning of this LOOP (VHDL)

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design
Author Message
BlackOps



Joined: 02 Jan 2005
Posts: 260
Helped: 9
Location: AZERBAIJAN


Post24 Jul 2008 10:17   Dont understand the meaning of this LOOP (VHDL)

I am studying the VHDL code generated by the Peripheral Wizard in EDK 9.1

there is such piece of code:
Code:

        for byte_index in 4 to 14 loop
          if ( mst_byte_we(byte_index) = '1' ) then
            mst_reg(byte_index) <= Bus2IP_Data(
                                     (byte_index-(byte_index/(C_DWIDTH/8))*(C_DWIDTH/8))*8 to
                                     (byte_index-(byte_index/(C_DWIDTH/8))*(C_DWIDTH/8))*8+7);
          end if;
        end loop;


C_DWIDTH = 64

for example, if byte_index is 4.. then: (4 - ( ( 4/8 ) * 8 ) ) * 8 = 0, dosnt matter what is value of byte_index, Bus2IP_Data will always have value of [0 to 7] inside...

then why does the wizard not just writes Bus2IP_Data(0 to 7) ?? why is it using such complicated equation? or i am wrong somewhere?

thanks
Back to top
teddyzhai



Joined: 30 Jul 2008
Posts: 1
Location: Erlangen,Ger


Post30 Jul 2008 22:04   Dont understand the meaning of this LOOP (VHDL)

I think, this "user logic" file is just a generic template generated by EDK. It is parametrized.
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> PLD, SPLD, GAL, CPLD, FPGA Design
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap